Sin descripción

block-library.js 1.5MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116
  1. /******/ (function() { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 3827:
  4. /***/ (function(module, exports) {
  5. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  6. Copyright (c) 2018 Jed Watson.
  7. Licensed under the MIT License (MIT), see
  8. http://jedwatson.github.io/classnames
  9. */
  10. /* global define */
  11. (function () {
  12. 'use strict';
  13. var classNames = (function () {
  14. // don't inherit from Object so we can skip hasOwnProperty check later
  15. // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
  16. function StorageObject() {}
  17. StorageObject.prototype = Object.create(null);
  18. function _parseArray (resultSet, array) {
  19. var length = array.length;
  20. for (var i = 0; i < length; ++i) {
  21. _parse(resultSet, array[i]);
  22. }
  23. }
  24. var hasOwn = {}.hasOwnProperty;
  25. function _parseNumber (resultSet, num) {
  26. resultSet[num] = true;
  27. }
  28. function _parseObject (resultSet, object) {
  29. if (object.toString === Object.prototype.toString) {
  30. for (var k in object) {
  31. if (hasOwn.call(object, k)) {
  32. // set value to false instead of deleting it to avoid changing object structure
  33. // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
  34. resultSet[k] = !!object[k];
  35. }
  36. }
  37. } else {
  38. resultSet[object.toString()] = true;
  39. }
  40. }
  41. var SPACE = /\s+/;
  42. function _parseString (resultSet, str) {
  43. var array = str.split(SPACE);
  44. var length = array.length;
  45. for (var i = 0; i < length; ++i) {
  46. resultSet[array[i]] = true;
  47. }
  48. }
  49. function _parse (resultSet, arg) {
  50. if (!arg) return;
  51. var argType = typeof arg;
  52. // 'foo bar'
  53. if (argType === 'string') {
  54. _parseString(resultSet, arg);
  55. // ['foo', 'bar', ...]
  56. } else if (Array.isArray(arg)) {
  57. _parseArray(resultSet, arg);
  58. // { 'foo': true, ... }
  59. } else if (argType === 'object') {
  60. _parseObject(resultSet, arg);
  61. // '130'
  62. } else if (argType === 'number') {
  63. _parseNumber(resultSet, arg);
  64. }
  65. }
  66. function _classNames () {
  67. // don't leak arguments
  68. // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
  69. var len = arguments.length;
  70. var args = Array(len);
  71. for (var i = 0; i < len; i++) {
  72. args[i] = arguments[i];
  73. }
  74. var classSet = new StorageObject();
  75. _parseArray(classSet, args);
  76. var list = [];
  77. for (var k in classSet) {
  78. if (classSet[k]) {
  79. list.push(k)
  80. }
  81. }
  82. return list.join(' ');
  83. }
  84. return _classNames;
  85. })();
  86. if ( true && module.exports) {
  87. classNames.default = classNames;
  88. module.exports = classNames;
  89. } else if (true) {
  90. // register as 'classnames', consistent with npm package name
  91. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  92. return classNames;
  93. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  94. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  95. } else {}
  96. }());
  97. /***/ }),
  98. /***/ 4403:
  99. /***/ (function(module, exports) {
  100. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  101. Copyright (c) 2018 Jed Watson.
  102. Licensed under the MIT License (MIT), see
  103. http://jedwatson.github.io/classnames
  104. */
  105. /* global define */
  106. (function () {
  107. 'use strict';
  108. var hasOwn = {}.hasOwnProperty;
  109. function classNames() {
  110. var classes = [];
  111. for (var i = 0; i < arguments.length; i++) {
  112. var arg = arguments[i];
  113. if (!arg) continue;
  114. var argType = typeof arg;
  115. if (argType === 'string' || argType === 'number') {
  116. classes.push(arg);
  117. } else if (Array.isArray(arg)) {
  118. if (arg.length) {
  119. var inner = classNames.apply(null, arg);
  120. if (inner) {
  121. classes.push(inner);
  122. }
  123. }
  124. } else if (argType === 'object') {
  125. if (arg.toString === Object.prototype.toString) {
  126. for (var key in arg) {
  127. if (hasOwn.call(arg, key) && arg[key]) {
  128. classes.push(key);
  129. }
  130. }
  131. } else {
  132. classes.push(arg.toString());
  133. }
  134. }
  135. }
  136. return classes.join(' ');
  137. }
  138. if ( true && module.exports) {
  139. classNames.default = classNames;
  140. module.exports = classNames;
  141. } else if (true) {
  142. // register as 'classnames', consistent with npm package name
  143. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  144. return classNames;
  145. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  146. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  147. } else {}
  148. }());
  149. /***/ }),
  150. /***/ 5027:
  151. /***/ (function(module) {
  152. /*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
  153. (function (global, factory) {
  154. true ? module.exports = factory() :
  155. 0;
  156. }(this, (function () { 'use strict';
  157. function _classCallCheck(instance, Constructor) {
  158. if (!(instance instanceof Constructor)) {
  159. throw new TypeError("Cannot call a class as a function");
  160. }
  161. }
  162. function _defineProperties(target, props) {
  163. for (var i = 0; i < props.length; i++) {
  164. var descriptor = props[i];
  165. descriptor.enumerable = descriptor.enumerable || false;
  166. descriptor.configurable = true;
  167. if ("value" in descriptor) descriptor.writable = true;
  168. Object.defineProperty(target, descriptor.key, descriptor);
  169. }
  170. }
  171. function _createClass(Constructor, protoProps, staticProps) {
  172. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  173. if (staticProps) _defineProperties(Constructor, staticProps);
  174. return Constructor;
  175. }
  176. function _slicedToArray(arr, i) {
  177. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  178. }
  179. function _arrayWithHoles(arr) {
  180. if (Array.isArray(arr)) return arr;
  181. }
  182. function _iterableToArrayLimit(arr, i) {
  183. var _arr = [];
  184. var _n = true;
  185. var _d = false;
  186. var _e = undefined;
  187. try {
  188. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  189. _arr.push(_s.value);
  190. if (i && _arr.length === i) break;
  191. }
  192. } catch (err) {
  193. _d = true;
  194. _e = err;
  195. } finally {
  196. try {
  197. if (!_n && _i["return"] != null) _i["return"]();
  198. } finally {
  199. if (_d) throw _e;
  200. }
  201. }
  202. return _arr;
  203. }
  204. function _nonIterableRest() {
  205. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  206. }
  207. var FastAverageColor =
  208. /*#__PURE__*/
  209. function () {
  210. function FastAverageColor() {
  211. _classCallCheck(this, FastAverageColor);
  212. }
  213. _createClass(FastAverageColor, [{
  214. key: "getColorAsync",
  215. /**
  216. * Get asynchronously the average color from not loaded image.
  217. *
  218. * @param {HTMLImageElement} resource
  219. * @param {Function} callback
  220. * @param {Object|null} [options]
  221. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  222. * @param {*} [options.data]
  223. * @param {string} [options.mode="speed"] "precision" or "speed"
  224. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  225. * @param {number} [options.step=1]
  226. * @param {number} [options.left=0]
  227. * @param {number} [options.top=0]
  228. * @param {number} [options.width=width of resource]
  229. * @param {number} [options.height=height of resource]
  230. */
  231. value: function getColorAsync(resource, callback, options) {
  232. if (resource.complete) {
  233. callback.call(resource, this.getColor(resource, options), options && options.data);
  234. } else {
  235. this._bindImageEvents(resource, callback, options);
  236. }
  237. }
  238. /**
  239. * Get the average color from images, videos and canvas.
  240. *
  241. * @param {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement} resource
  242. * @param {Object|null} [options]
  243. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  244. * @param {*} [options.data]
  245. * @param {string} [options.mode="speed"] "precision" or "speed"
  246. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  247. * @param {number} [options.step=1]
  248. * @param {number} [options.left=0]
  249. * @param {number} [options.top=0]
  250. * @param {number} [options.width=width of resource]
  251. * @param {number} [options.height=height of resource]
  252. *
  253. * @returns {Object}
  254. */
  255. }, {
  256. key: "getColor",
  257. value: function getColor(resource, options) {
  258. options = options || {};
  259. var defaultColor = this._getDefaultColor(options),
  260. originalSize = this._getOriginalSize(resource),
  261. size = this._prepareSizeAndPosition(originalSize, options);
  262. var error = null,
  263. value = defaultColor;
  264. if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) {
  265. return this._prepareResult(defaultColor, new Error('FastAverageColor: Incorrect sizes.'));
  266. }
  267. if (!this._ctx) {
  268. this._canvas = this._makeCanvas();
  269. this._ctx = this._canvas.getContext && this._canvas.getContext('2d');
  270. if (!this._ctx) {
  271. return this._prepareResult(defaultColor, new Error('FastAverageColor: Canvas Context 2D is not supported in this browser.'));
  272. }
  273. }
  274. this._canvas.width = size.destWidth;
  275. this._canvas.height = size.destHeight;
  276. try {
  277. this._ctx.clearRect(0, 0, size.destWidth, size.destHeight);
  278. this._ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight);
  279. var bitmapData = this._ctx.getImageData(0, 0, size.destWidth, size.destHeight).data;
  280. value = this.getColorFromArray4(bitmapData, options);
  281. } catch (e) {
  282. // Security error, CORS
  283. // https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image
  284. error = e;
  285. }
  286. return this._prepareResult(value, error);
  287. }
  288. /**
  289. * Get the average color from a array when 1 pixel is 4 bytes.
  290. *
  291. * @param {Array|Uint8Array} arr
  292. * @param {Object} [options]
  293. * @param {string} [options.algorithm="sqrt"] "simple", "sqrt" or "dominant"
  294. * @param {Array} [options.defaultColor=[255, 255, 255, 255]]
  295. * @param {number} [options.step=1]
  296. *
  297. * @returns {Array} [red (0-255), green (0-255), blue (0-255), alpha (0-255)]
  298. */
  299. }, {
  300. key: "getColorFromArray4",
  301. value: function getColorFromArray4(arr, options) {
  302. options = options || {};
  303. var bytesPerPixel = 4,
  304. arrLength = arr.length;
  305. if (arrLength < bytesPerPixel) {
  306. return this._getDefaultColor(options);
  307. }
  308. var len = arrLength - arrLength % bytesPerPixel,
  309. preparedStep = (options.step || 1) * bytesPerPixel,
  310. algorithm = '_' + (options.algorithm || 'sqrt') + 'Algorithm';
  311. if (typeof this[algorithm] !== 'function') {
  312. throw new Error("FastAverageColor: ".concat(options.algorithm, " is unknown algorithm."));
  313. }
  314. return this[algorithm](arr, len, preparedStep);
  315. }
  316. /**
  317. * Destroy the instance.
  318. */
  319. }, {
  320. key: "destroy",
  321. value: function destroy() {
  322. delete this._canvas;
  323. delete this._ctx;
  324. }
  325. }, {
  326. key: "_getDefaultColor",
  327. value: function _getDefaultColor(options) {
  328. return this._getOption(options, 'defaultColor', [255, 255, 255, 255]);
  329. }
  330. }, {
  331. key: "_getOption",
  332. value: function _getOption(options, name, defaultValue) {
  333. return typeof options[name] === 'undefined' ? defaultValue : options[name];
  334. }
  335. }, {
  336. key: "_prepareSizeAndPosition",
  337. value: function _prepareSizeAndPosition(originalSize, options) {
  338. var srcLeft = this._getOption(options, 'left', 0),
  339. srcTop = this._getOption(options, 'top', 0),
  340. srcWidth = this._getOption(options, 'width', originalSize.width),
  341. srcHeight = this._getOption(options, 'height', originalSize.height),
  342. destWidth = srcWidth,
  343. destHeight = srcHeight;
  344. if (options.mode === 'precision') {
  345. return {
  346. srcLeft: srcLeft,
  347. srcTop: srcTop,
  348. srcWidth: srcWidth,
  349. srcHeight: srcHeight,
  350. destWidth: destWidth,
  351. destHeight: destHeight
  352. };
  353. }
  354. var maxSize = 100,
  355. minSize = 10;
  356. var factor;
  357. if (srcWidth > srcHeight) {
  358. factor = srcWidth / srcHeight;
  359. destWidth = maxSize;
  360. destHeight = Math.round(destWidth / factor);
  361. } else {
  362. factor = srcHeight / srcWidth;
  363. destHeight = maxSize;
  364. destWidth = Math.round(destHeight / factor);
  365. }
  366. if (destWidth > srcWidth || destHeight > srcHeight || destWidth < minSize || destHeight < minSize) {
  367. destWidth = srcWidth;
  368. destHeight = srcHeight;
  369. }
  370. return {
  371. srcLeft: srcLeft,
  372. srcTop: srcTop,
  373. srcWidth: srcWidth,
  374. srcHeight: srcHeight,
  375. destWidth: destWidth,
  376. destHeight: destHeight
  377. };
  378. }
  379. }, {
  380. key: "_simpleAlgorithm",
  381. value: function _simpleAlgorithm(arr, len, preparedStep) {
  382. var redTotal = 0,
  383. greenTotal = 0,
  384. blueTotal = 0,
  385. alphaTotal = 0,
  386. count = 0;
  387. for (var i = 0; i < len; i += preparedStep) {
  388. var alpha = arr[i + 3],
  389. red = arr[i] * alpha,
  390. green = arr[i + 1] * alpha,
  391. blue = arr[i + 2] * alpha;
  392. redTotal += red;
  393. greenTotal += green;
  394. blueTotal += blue;
  395. alphaTotal += alpha;
  396. count++;
  397. }
  398. return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  399. }
  400. }, {
  401. key: "_sqrtAlgorithm",
  402. value: function _sqrtAlgorithm(arr, len, preparedStep) {
  403. var redTotal = 0,
  404. greenTotal = 0,
  405. blueTotal = 0,
  406. alphaTotal = 0,
  407. count = 0;
  408. for (var i = 0; i < len; i += preparedStep) {
  409. var red = arr[i],
  410. green = arr[i + 1],
  411. blue = arr[i + 2],
  412. alpha = arr[i + 3];
  413. redTotal += red * red * alpha;
  414. greenTotal += green * green * alpha;
  415. blueTotal += blue * blue * alpha;
  416. alphaTotal += alpha;
  417. count++;
  418. }
  419. return alphaTotal ? [Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  420. }
  421. }, {
  422. key: "_dominantAlgorithm",
  423. value: function _dominantAlgorithm(arr, len, preparedStep) {
  424. var colorHash = {},
  425. divider = 24;
  426. for (var i = 0; i < len; i += preparedStep) {
  427. var red = arr[i],
  428. green = arr[i + 1],
  429. blue = arr[i + 2],
  430. alpha = arr[i + 3],
  431. key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider);
  432. if (colorHash[key]) {
  433. colorHash[key] = [colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1];
  434. } else {
  435. colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1];
  436. }
  437. }
  438. var buffer = Object.keys(colorHash).map(function (key) {
  439. return colorHash[key];
  440. }).sort(function (a, b) {
  441. var countA = a[4],
  442. countB = b[4];
  443. return countA > countB ? -1 : countA === countB ? 0 : 1;
  444. });
  445. var _buffer$ = _slicedToArray(buffer[0], 5),
  446. redTotal = _buffer$[0],
  447. greenTotal = _buffer$[1],
  448. blueTotal = _buffer$[2],
  449. alphaTotal = _buffer$[3],
  450. count = _buffer$[4];
  451. return alphaTotal ? [Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count)] : [0, 0, 0, 0];
  452. }
  453. }, {
  454. key: "_bindImageEvents",
  455. value: function _bindImageEvents(resource, callback, options) {
  456. var _this = this;
  457. options = options || {};
  458. var data = options && options.data,
  459. defaultColor = this._getDefaultColor(options),
  460. onload = function onload() {
  461. unbindEvents();
  462. callback.call(resource, _this.getColor(resource, options), data);
  463. },
  464. onerror = function onerror() {
  465. unbindEvents();
  466. callback.call(resource, _this._prepareResult(defaultColor, new Error('Image error')), data);
  467. },
  468. onabort = function onabort() {
  469. unbindEvents();
  470. callback.call(resource, _this._prepareResult(defaultColor, new Error('Image abort')), data);
  471. },
  472. unbindEvents = function unbindEvents() {
  473. resource.removeEventListener('load', onload);
  474. resource.removeEventListener('error', onerror);
  475. resource.removeEventListener('abort', onabort);
  476. };
  477. resource.addEventListener('load', onload);
  478. resource.addEventListener('error', onerror);
  479. resource.addEventListener('abort', onabort);
  480. }
  481. }, {
  482. key: "_prepareResult",
  483. value: function _prepareResult(value, error) {
  484. var rgb = value.slice(0, 3),
  485. rgba = [].concat(rgb, value[3] / 255),
  486. isDark = this._isDark(value);
  487. return {
  488. error: error,
  489. value: value,
  490. rgb: 'rgb(' + rgb.join(',') + ')',
  491. rgba: 'rgba(' + rgba.join(',') + ')',
  492. hex: this._arrayToHex(rgb),
  493. hexa: this._arrayToHex(value),
  494. isDark: isDark,
  495. isLight: !isDark
  496. };
  497. }
  498. }, {
  499. key: "_getOriginalSize",
  500. value: function _getOriginalSize(resource) {
  501. if (resource instanceof HTMLImageElement) {
  502. return {
  503. width: resource.naturalWidth,
  504. height: resource.naturalHeight
  505. };
  506. }
  507. if (resource instanceof HTMLVideoElement) {
  508. return {
  509. width: resource.videoWidth,
  510. height: resource.videoHeight
  511. };
  512. }
  513. return {
  514. width: resource.width,
  515. height: resource.height
  516. };
  517. }
  518. }, {
  519. key: "_toHex",
  520. value: function _toHex(num) {
  521. var str = num.toString(16);
  522. return str.length === 1 ? '0' + str : str;
  523. }
  524. }, {
  525. key: "_arrayToHex",
  526. value: function _arrayToHex(arr) {
  527. return '#' + arr.map(this._toHex).join('');
  528. }
  529. }, {
  530. key: "_isDark",
  531. value: function _isDark(color) {
  532. // http://www.w3.org/TR/AERT#color-contrast
  533. var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000;
  534. return result < 128;
  535. }
  536. }, {
  537. key: "_makeCanvas",
  538. value: function _makeCanvas() {
  539. return typeof window === 'undefined' ? new OffscreenCanvas(1, 1) : document.createElement('canvas');
  540. }
  541. }]);
  542. return FastAverageColor;
  543. }();
  544. return FastAverageColor;
  545. })));
  546. /***/ }),
  547. /***/ 9756:
  548. /***/ (function(module) {
  549. /**
  550. * Memize options object.
  551. *
  552. * @typedef MemizeOptions
  553. *
  554. * @property {number} [maxSize] Maximum size of the cache.
  555. */
  556. /**
  557. * Internal cache entry.
  558. *
  559. * @typedef MemizeCacheNode
  560. *
  561. * @property {?MemizeCacheNode|undefined} [prev] Previous node.
  562. * @property {?MemizeCacheNode|undefined} [next] Next node.
  563. * @property {Array<*>} args Function arguments for cache
  564. * entry.
  565. * @property {*} val Function result.
  566. */
  567. /**
  568. * Properties of the enhanced function for controlling cache.
  569. *
  570. * @typedef MemizeMemoizedFunction
  571. *
  572. * @property {()=>void} clear Clear the cache.
  573. */
  574. /**
  575. * Accepts a function to be memoized, and returns a new memoized function, with
  576. * optional options.
  577. *
  578. * @template {Function} F
  579. *
  580. * @param {F} fn Function to memoize.
  581. * @param {MemizeOptions} [options] Options object.
  582. *
  583. * @return {F & MemizeMemoizedFunction} Memoized function.
  584. */
  585. function memize( fn, options ) {
  586. var size = 0;
  587. /** @type {?MemizeCacheNode|undefined} */
  588. var head;
  589. /** @type {?MemizeCacheNode|undefined} */
  590. var tail;
  591. options = options || {};
  592. function memoized( /* ...args */ ) {
  593. var node = head,
  594. len = arguments.length,
  595. args, i;
  596. searchCache: while ( node ) {
  597. // Perform a shallow equality test to confirm that whether the node
  598. // under test is a candidate for the arguments passed. Two arrays
  599. // are shallowly equal if their length matches and each entry is
  600. // strictly equal between the two sets. Avoid abstracting to a
  601. // function which could incur an arguments leaking deoptimization.
  602. // Check whether node arguments match arguments length
  603. if ( node.args.length !== arguments.length ) {
  604. node = node.next;
  605. continue;
  606. }
  607. // Check whether node arguments match arguments values
  608. for ( i = 0; i < len; i++ ) {
  609. if ( node.args[ i ] !== arguments[ i ] ) {
  610. node = node.next;
  611. continue searchCache;
  612. }
  613. }
  614. // At this point we can assume we've found a match
  615. // Surface matched node to head if not already
  616. if ( node !== head ) {
  617. // As tail, shift to previous. Must only shift if not also
  618. // head, since if both head and tail, there is no previous.
  619. if ( node === tail ) {
  620. tail = node.prev;
  621. }
  622. // Adjust siblings to point to each other. If node was tail,
  623. // this also handles new tail's empty `next` assignment.
  624. /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
  625. if ( node.next ) {
  626. node.next.prev = node.prev;
  627. }
  628. node.next = head;
  629. node.prev = null;
  630. /** @type {MemizeCacheNode} */ ( head ).prev = node;
  631. head = node;
  632. }
  633. // Return immediately
  634. return node.val;
  635. }
  636. // No cached value found. Continue to insertion phase:
  637. // Create a copy of arguments (avoid leaking deoptimization)
  638. args = new Array( len );
  639. for ( i = 0; i < len; i++ ) {
  640. args[ i ] = arguments[ i ];
  641. }
  642. node = {
  643. args: args,
  644. // Generate the result from original function
  645. val: fn.apply( null, args ),
  646. };
  647. // Don't need to check whether node is already head, since it would
  648. // have been returned above already if it was
  649. // Shift existing head down list
  650. if ( head ) {
  651. head.prev = node;
  652. node.next = head;
  653. } else {
  654. // If no head, follows that there's no tail (at initial or reset)
  655. tail = node;
  656. }
  657. // Trim tail if we're reached max size and are pending cache insertion
  658. if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
  659. tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
  660. /** @type {MemizeCacheNode} */ ( tail ).next = null;
  661. } else {
  662. size++;
  663. }
  664. head = node;
  665. return node.val;
  666. }
  667. memoized.clear = function() {
  668. head = null;
  669. tail = null;
  670. size = 0;
  671. };
  672. if ( false ) {}
  673. // Ignore reason: There's not a clear solution to create an intersection of
  674. // the function with additional properties, where the goal is to retain the
  675. // function signature of the incoming argument and add control properties
  676. // on the return value.
  677. // @ts-ignore
  678. return memoized;
  679. }
  680. module.exports = memize;
  681. /***/ })
  682. /******/ });
  683. /************************************************************************/
  684. /******/ // The module cache
  685. /******/ var __webpack_module_cache__ = {};
  686. /******/
  687. /******/ // The require function
  688. /******/ function __webpack_require__(moduleId) {
  689. /******/ // Check if module is in cache
  690. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  691. /******/ if (cachedModule !== undefined) {
  692. /******/ return cachedModule.exports;
  693. /******/ }
  694. /******/ // Create a new module (and put it into the cache)
  695. /******/ var module = __webpack_module_cache__[moduleId] = {
  696. /******/ // no module.id needed
  697. /******/ // no module.loaded needed
  698. /******/ exports: {}
  699. /******/ };
  700. /******/
  701. /******/ // Execute the module function
  702. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  703. /******/
  704. /******/ // Return the exports of the module
  705. /******/ return module.exports;
  706. /******/ }
  707. /******/
  708. /************************************************************************/
  709. /******/ /* webpack/runtime/compat get default export */
  710. /******/ !function() {
  711. /******/ // getDefaultExport function for compatibility with non-harmony modules
  712. /******/ __webpack_require__.n = function(module) {
  713. /******/ var getter = module && module.__esModule ?
  714. /******/ function() { return module['default']; } :
  715. /******/ function() { return module; };
  716. /******/ __webpack_require__.d(getter, { a: getter });
  717. /******/ return getter;
  718. /******/ };
  719. /******/ }();
  720. /******/
  721. /******/ /* webpack/runtime/define property getters */
  722. /******/ !function() {
  723. /******/ // define getter functions for harmony exports
  724. /******/ __webpack_require__.d = function(exports, definition) {
  725. /******/ for(var key in definition) {
  726. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  727. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  728. /******/ }
  729. /******/ }
  730. /******/ };
  731. /******/ }();
  732. /******/
  733. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  734. /******/ !function() {
  735. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  736. /******/ }();
  737. /******/
  738. /******/ /* webpack/runtime/make namespace object */
  739. /******/ !function() {
  740. /******/ // define __esModule on exports
  741. /******/ __webpack_require__.r = function(exports) {
  742. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  743. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  744. /******/ }
  745. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  746. /******/ };
  747. /******/ }();
  748. /******/
  749. /************************************************************************/
  750. var __webpack_exports__ = {};
  751. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  752. !function() {
  753. "use strict";
  754. // ESM COMPAT FLAG
  755. __webpack_require__.r(__webpack_exports__);
  756. // EXPORTS
  757. __webpack_require__.d(__webpack_exports__, {
  758. "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; },
  759. "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; },
  760. "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; }
  761. });
  762. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js
  763. var archives_namespaceObject = {};
  764. __webpack_require__.r(archives_namespaceObject);
  765. __webpack_require__.d(archives_namespaceObject, {
  766. "metadata": function() { return metadata; },
  767. "name": function() { return archives_name; },
  768. "settings": function() { return settings; }
  769. });
  770. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
  771. var avatar_namespaceObject = {};
  772. __webpack_require__.r(avatar_namespaceObject);
  773. __webpack_require__.d(avatar_namespaceObject, {
  774. "metadata": function() { return avatar_metadata; },
  775. "name": function() { return avatar_name; },
  776. "settings": function() { return avatar_settings; }
  777. });
  778. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js
  779. var build_module_audio_namespaceObject = {};
  780. __webpack_require__.r(build_module_audio_namespaceObject);
  781. __webpack_require__.d(build_module_audio_namespaceObject, {
  782. "metadata": function() { return audio_metadata; },
  783. "name": function() { return audio_name; },
  784. "settings": function() { return audio_settings; }
  785. });
  786. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js
  787. var build_module_button_namespaceObject = {};
  788. __webpack_require__.r(build_module_button_namespaceObject);
  789. __webpack_require__.d(build_module_button_namespaceObject, {
  790. "metadata": function() { return button_metadata; },
  791. "name": function() { return button_name; },
  792. "settings": function() { return button_settings; }
  793. });
  794. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
  795. var build_module_buttons_namespaceObject = {};
  796. __webpack_require__.r(build_module_buttons_namespaceObject);
  797. __webpack_require__.d(build_module_buttons_namespaceObject, {
  798. "metadata": function() { return buttons_metadata; },
  799. "name": function() { return buttons_name; },
  800. "settings": function() { return buttons_settings; }
  801. });
  802. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
  803. var build_module_calendar_namespaceObject = {};
  804. __webpack_require__.r(build_module_calendar_namespaceObject);
  805. __webpack_require__.d(build_module_calendar_namespaceObject, {
  806. "metadata": function() { return calendar_metadata; },
  807. "name": function() { return calendar_name; },
  808. "settings": function() { return calendar_settings; }
  809. });
  810. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js
  811. var categories_namespaceObject = {};
  812. __webpack_require__.r(categories_namespaceObject);
  813. __webpack_require__.d(categories_namespaceObject, {
  814. "metadata": function() { return categories_metadata; },
  815. "name": function() { return categories_name; },
  816. "settings": function() { return categories_settings; }
  817. });
  818. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
  819. var freeform_namespaceObject = {};
  820. __webpack_require__.r(freeform_namespaceObject);
  821. __webpack_require__.d(freeform_namespaceObject, {
  822. "metadata": function() { return freeform_metadata; },
  823. "name": function() { return freeform_name; },
  824. "settings": function() { return freeform_settings; }
  825. });
  826. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js
  827. var build_module_code_namespaceObject = {};
  828. __webpack_require__.r(build_module_code_namespaceObject);
  829. __webpack_require__.d(build_module_code_namespaceObject, {
  830. "metadata": function() { return code_metadata; },
  831. "name": function() { return code_name; },
  832. "settings": function() { return code_settings; }
  833. });
  834. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js
  835. var build_module_column_namespaceObject = {};
  836. __webpack_require__.r(build_module_column_namespaceObject);
  837. __webpack_require__.d(build_module_column_namespaceObject, {
  838. "metadata": function() { return column_metadata; },
  839. "name": function() { return column_name; },
  840. "settings": function() { return column_settings; }
  841. });
  842. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js
  843. var build_module_columns_namespaceObject = {};
  844. __webpack_require__.r(build_module_columns_namespaceObject);
  845. __webpack_require__.d(build_module_columns_namespaceObject, {
  846. "metadata": function() { return columns_metadata; },
  847. "name": function() { return columns_name; },
  848. "settings": function() { return columns_settings; }
  849. });
  850. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
  851. var build_module_comment_author_name_namespaceObject = {};
  852. __webpack_require__.r(build_module_comment_author_name_namespaceObject);
  853. __webpack_require__.d(build_module_comment_author_name_namespaceObject, {
  854. "metadata": function() { return comment_author_name_metadata; },
  855. "name": function() { return comment_author_name_name; },
  856. "settings": function() { return comment_author_name_settings; }
  857. });
  858. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
  859. var build_module_comment_content_namespaceObject = {};
  860. __webpack_require__.r(build_module_comment_content_namespaceObject);
  861. __webpack_require__.d(build_module_comment_content_namespaceObject, {
  862. "metadata": function() { return comment_content_metadata; },
  863. "name": function() { return comment_content_name; },
  864. "settings": function() { return comment_content_settings; }
  865. });
  866. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
  867. var comment_date_namespaceObject = {};
  868. __webpack_require__.r(comment_date_namespaceObject);
  869. __webpack_require__.d(comment_date_namespaceObject, {
  870. "metadata": function() { return comment_date_metadata; },
  871. "name": function() { return comment_date_name; },
  872. "settings": function() { return comment_date_settings; }
  873. });
  874. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
  875. var build_module_comment_edit_link_namespaceObject = {};
  876. __webpack_require__.r(build_module_comment_edit_link_namespaceObject);
  877. __webpack_require__.d(build_module_comment_edit_link_namespaceObject, {
  878. "metadata": function() { return comment_edit_link_metadata; },
  879. "name": function() { return comment_edit_link_name; },
  880. "settings": function() { return comment_edit_link_settings; }
  881. });
  882. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
  883. var build_module_comment_reply_link_namespaceObject = {};
  884. __webpack_require__.r(build_module_comment_reply_link_namespaceObject);
  885. __webpack_require__.d(build_module_comment_reply_link_namespaceObject, {
  886. "metadata": function() { return comment_reply_link_metadata; },
  887. "name": function() { return comment_reply_link_name; },
  888. "settings": function() { return comment_reply_link_settings; }
  889. });
  890. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
  891. var comment_template_namespaceObject = {};
  892. __webpack_require__.r(comment_template_namespaceObject);
  893. __webpack_require__.d(comment_template_namespaceObject, {
  894. "metadata": function() { return comment_template_metadata; },
  895. "name": function() { return comment_template_name; },
  896. "settings": function() { return comment_template_settings; }
  897. });
  898. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
  899. var comments_pagination_previous_namespaceObject = {};
  900. __webpack_require__.r(comments_pagination_previous_namespaceObject);
  901. __webpack_require__.d(comments_pagination_previous_namespaceObject, {
  902. "metadata": function() { return comments_pagination_previous_metadata; },
  903. "name": function() { return comments_pagination_previous_name; },
  904. "settings": function() { return comments_pagination_previous_settings; }
  905. });
  906. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js
  907. var comments_query_loop_namespaceObject = {};
  908. __webpack_require__.r(comments_query_loop_namespaceObject);
  909. __webpack_require__.d(comments_query_loop_namespaceObject, {
  910. "metadata": function() { return comments_query_loop_metadata; },
  911. "name": function() { return comments_query_loop_name; },
  912. "settings": function() { return comments_query_loop_settings; }
  913. });
  914. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
  915. var comments_pagination_namespaceObject = {};
  916. __webpack_require__.r(comments_pagination_namespaceObject);
  917. __webpack_require__.d(comments_pagination_namespaceObject, {
  918. "metadata": function() { return comments_pagination_metadata; },
  919. "name": function() { return comments_pagination_name; },
  920. "settings": function() { return comments_pagination_settings; }
  921. });
  922. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
  923. var comments_pagination_next_namespaceObject = {};
  924. __webpack_require__.r(comments_pagination_next_namespaceObject);
  925. __webpack_require__.d(comments_pagination_next_namespaceObject, {
  926. "metadata": function() { return comments_pagination_next_metadata; },
  927. "name": function() { return comments_pagination_next_name; },
  928. "settings": function() { return comments_pagination_next_settings; }
  929. });
  930. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
  931. var comments_pagination_numbers_namespaceObject = {};
  932. __webpack_require__.r(comments_pagination_numbers_namespaceObject);
  933. __webpack_require__.d(comments_pagination_numbers_namespaceObject, {
  934. "metadata": function() { return comments_pagination_numbers_metadata; },
  935. "name": function() { return comments_pagination_numbers_name; },
  936. "settings": function() { return comments_pagination_numbers_settings; }
  937. });
  938. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
  939. var comments_title_namespaceObject = {};
  940. __webpack_require__.r(comments_title_namespaceObject);
  941. __webpack_require__.d(comments_title_namespaceObject, {
  942. "metadata": function() { return comments_title_metadata; },
  943. "name": function() { return comments_title_name; },
  944. "settings": function() { return comments_title_settings; }
  945. });
  946. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js
  947. var build_module_cover_namespaceObject = {};
  948. __webpack_require__.r(build_module_cover_namespaceObject);
  949. __webpack_require__.d(build_module_cover_namespaceObject, {
  950. "metadata": function() { return cover_metadata; },
  951. "name": function() { return cover_name; },
  952. "settings": function() { return cover_settings; }
  953. });
  954. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js
  955. var embed_namespaceObject = {};
  956. __webpack_require__.r(embed_namespaceObject);
  957. __webpack_require__.d(embed_namespaceObject, {
  958. "metadata": function() { return embed_metadata; },
  959. "name": function() { return embed_name; },
  960. "settings": function() { return embed_settings; }
  961. });
  962. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js
  963. var build_module_file_namespaceObject = {};
  964. __webpack_require__.r(build_module_file_namespaceObject);
  965. __webpack_require__.d(build_module_file_namespaceObject, {
  966. "metadata": function() { return file_metadata; },
  967. "name": function() { return file_name; },
  968. "settings": function() { return file_settings; }
  969. });
  970. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
  971. var build_module_gallery_namespaceObject = {};
  972. __webpack_require__.r(build_module_gallery_namespaceObject);
  973. __webpack_require__.d(build_module_gallery_namespaceObject, {
  974. "metadata": function() { return gallery_metadata; },
  975. "name": function() { return gallery_name; },
  976. "settings": function() { return gallery_settings; }
  977. });
  978. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js
  979. var build_module_group_namespaceObject = {};
  980. __webpack_require__.r(build_module_group_namespaceObject);
  981. __webpack_require__.d(build_module_group_namespaceObject, {
  982. "metadata": function() { return group_metadata; },
  983. "name": function() { return group_name; },
  984. "settings": function() { return group_settings; }
  985. });
  986. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js
  987. var build_module_heading_namespaceObject = {};
  988. __webpack_require__.r(build_module_heading_namespaceObject);
  989. __webpack_require__.d(build_module_heading_namespaceObject, {
  990. "metadata": function() { return heading_metadata; },
  991. "name": function() { return heading_name; },
  992. "settings": function() { return heading_settings; }
  993. });
  994. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
  995. var home_link_namespaceObject = {};
  996. __webpack_require__.r(home_link_namespaceObject);
  997. __webpack_require__.d(home_link_namespaceObject, {
  998. "metadata": function() { return home_link_metadata; },
  999. "name": function() { return home_link_name; },
  1000. "settings": function() { return home_link_settings; }
  1001. });
  1002. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js
  1003. var build_module_html_namespaceObject = {};
  1004. __webpack_require__.r(build_module_html_namespaceObject);
  1005. __webpack_require__.d(build_module_html_namespaceObject, {
  1006. "metadata": function() { return html_metadata; },
  1007. "name": function() { return html_name; },
  1008. "settings": function() { return html_settings; }
  1009. });
  1010. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js
  1011. var build_module_image_namespaceObject = {};
  1012. __webpack_require__.r(build_module_image_namespaceObject);
  1013. __webpack_require__.d(build_module_image_namespaceObject, {
  1014. "metadata": function() { return image_metadata; },
  1015. "name": function() { return image_name; },
  1016. "settings": function() { return image_settings; }
  1017. });
  1018. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
  1019. var latest_comments_namespaceObject = {};
  1020. __webpack_require__.r(latest_comments_namespaceObject);
  1021. __webpack_require__.d(latest_comments_namespaceObject, {
  1022. "metadata": function() { return latest_comments_metadata; },
  1023. "name": function() { return latest_comments_name; },
  1024. "settings": function() { return latest_comments_settings; }
  1025. });
  1026. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
  1027. var latest_posts_namespaceObject = {};
  1028. __webpack_require__.r(latest_posts_namespaceObject);
  1029. __webpack_require__.d(latest_posts_namespaceObject, {
  1030. "metadata": function() { return latest_posts_metadata; },
  1031. "name": function() { return latest_posts_name; },
  1032. "settings": function() { return latest_posts_settings; }
  1033. });
  1034. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js
  1035. var build_module_list_namespaceObject = {};
  1036. __webpack_require__.r(build_module_list_namespaceObject);
  1037. __webpack_require__.d(build_module_list_namespaceObject, {
  1038. "metadata": function() { return list_metadata; },
  1039. "name": function() { return list_name; },
  1040. "settings": function() { return list_settings; }
  1041. });
  1042. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
  1043. var loginout_namespaceObject = {};
  1044. __webpack_require__.r(loginout_namespaceObject);
  1045. __webpack_require__.d(loginout_namespaceObject, {
  1046. "metadata": function() { return loginout_metadata; },
  1047. "name": function() { return loginout_name; },
  1048. "settings": function() { return loginout_settings; }
  1049. });
  1050. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
  1051. var media_text_namespaceObject = {};
  1052. __webpack_require__.r(media_text_namespaceObject);
  1053. __webpack_require__.d(media_text_namespaceObject, {
  1054. "metadata": function() { return media_text_metadata; },
  1055. "name": function() { return media_text_name; },
  1056. "settings": function() { return media_text_settings; }
  1057. });
  1058. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js
  1059. var missing_namespaceObject = {};
  1060. __webpack_require__.r(missing_namespaceObject);
  1061. __webpack_require__.d(missing_namespaceObject, {
  1062. "metadata": function() { return missing_metadata; },
  1063. "name": function() { return missing_name; },
  1064. "settings": function() { return missing_settings; }
  1065. });
  1066. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js
  1067. var build_module_more_namespaceObject = {};
  1068. __webpack_require__.r(build_module_more_namespaceObject);
  1069. __webpack_require__.d(build_module_more_namespaceObject, {
  1070. "metadata": function() { return more_metadata; },
  1071. "name": function() { return more_name; },
  1072. "settings": function() { return more_settings; }
  1073. });
  1074. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
  1075. var build_module_navigation_namespaceObject = {};
  1076. __webpack_require__.r(build_module_navigation_namespaceObject);
  1077. __webpack_require__.d(build_module_navigation_namespaceObject, {
  1078. "metadata": function() { return navigation_metadata; },
  1079. "name": function() { return navigation_name; },
  1080. "settings": function() { return navigation_settings; }
  1081. });
  1082. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
  1083. var navigation_link_namespaceObject = {};
  1084. __webpack_require__.r(navigation_link_namespaceObject);
  1085. __webpack_require__.d(navigation_link_namespaceObject, {
  1086. "metadata": function() { return navigation_link_metadata; },
  1087. "name": function() { return navigation_link_name; },
  1088. "settings": function() { return navigation_link_settings; }
  1089. });
  1090. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
  1091. var navigation_submenu_namespaceObject = {};
  1092. __webpack_require__.r(navigation_submenu_namespaceObject);
  1093. __webpack_require__.d(navigation_submenu_namespaceObject, {
  1094. "metadata": function() { return navigation_submenu_metadata; },
  1095. "name": function() { return navigation_submenu_name; },
  1096. "settings": function() { return navigation_submenu_settings; }
  1097. });
  1098. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
  1099. var nextpage_namespaceObject = {};
  1100. __webpack_require__.r(nextpage_namespaceObject);
  1101. __webpack_require__.d(nextpage_namespaceObject, {
  1102. "metadata": function() { return nextpage_metadata; },
  1103. "name": function() { return nextpage_name; },
  1104. "settings": function() { return nextpage_settings; }
  1105. });
  1106. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
  1107. var pattern_namespaceObject = {};
  1108. __webpack_require__.r(pattern_namespaceObject);
  1109. __webpack_require__.d(pattern_namespaceObject, {
  1110. "metadata": function() { return pattern_metadata; },
  1111. "name": function() { return pattern_name; },
  1112. "settings": function() { return pattern_settings; }
  1113. });
  1114. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
  1115. var page_list_namespaceObject = {};
  1116. __webpack_require__.r(page_list_namespaceObject);
  1117. __webpack_require__.d(page_list_namespaceObject, {
  1118. "metadata": function() { return page_list_metadata; },
  1119. "name": function() { return page_list_name; },
  1120. "settings": function() { return page_list_settings; }
  1121. });
  1122. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
  1123. var build_module_paragraph_namespaceObject = {};
  1124. __webpack_require__.r(build_module_paragraph_namespaceObject);
  1125. __webpack_require__.d(build_module_paragraph_namespaceObject, {
  1126. "metadata": function() { return paragraph_metadata; },
  1127. "name": function() { return paragraph_name; },
  1128. "settings": function() { return paragraph_settings; }
  1129. });
  1130. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
  1131. var build_module_post_author_namespaceObject = {};
  1132. __webpack_require__.r(build_module_post_author_namespaceObject);
  1133. __webpack_require__.d(build_module_post_author_namespaceObject, {
  1134. "metadata": function() { return post_author_metadata; },
  1135. "name": function() { return post_author_name; },
  1136. "settings": function() { return post_author_settings; }
  1137. });
  1138. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
  1139. var post_author_biography_namespaceObject = {};
  1140. __webpack_require__.r(post_author_biography_namespaceObject);
  1141. __webpack_require__.d(post_author_biography_namespaceObject, {
  1142. "metadata": function() { return post_author_biography_metadata; },
  1143. "name": function() { return post_author_biography_name; },
  1144. "settings": function() { return post_author_biography_settings; }
  1145. });
  1146. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
  1147. var build_module_post_comments_namespaceObject = {};
  1148. __webpack_require__.r(build_module_post_comments_namespaceObject);
  1149. __webpack_require__.d(build_module_post_comments_namespaceObject, {
  1150. "metadata": function() { return post_comments_metadata; },
  1151. "name": function() { return post_comments_name; },
  1152. "settings": function() { return post_comments_settings; }
  1153. });
  1154. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
  1155. var build_module_post_comments_form_namespaceObject = {};
  1156. __webpack_require__.r(build_module_post_comments_form_namespaceObject);
  1157. __webpack_require__.d(build_module_post_comments_form_namespaceObject, {
  1158. "metadata": function() { return post_comments_form_metadata; },
  1159. "name": function() { return post_comments_form_name; },
  1160. "settings": function() { return post_comments_form_settings; }
  1161. });
  1162. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
  1163. var build_module_post_content_namespaceObject = {};
  1164. __webpack_require__.r(build_module_post_content_namespaceObject);
  1165. __webpack_require__.d(build_module_post_content_namespaceObject, {
  1166. "metadata": function() { return post_content_metadata; },
  1167. "name": function() { return post_content_name; },
  1168. "settings": function() { return post_content_settings; }
  1169. });
  1170. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
  1171. var build_module_post_date_namespaceObject = {};
  1172. __webpack_require__.r(build_module_post_date_namespaceObject);
  1173. __webpack_require__.d(build_module_post_date_namespaceObject, {
  1174. "metadata": function() { return post_date_metadata; },
  1175. "name": function() { return post_date_name; },
  1176. "settings": function() { return post_date_settings; }
  1177. });
  1178. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
  1179. var build_module_post_excerpt_namespaceObject = {};
  1180. __webpack_require__.r(build_module_post_excerpt_namespaceObject);
  1181. __webpack_require__.d(build_module_post_excerpt_namespaceObject, {
  1182. "metadata": function() { return post_excerpt_metadata; },
  1183. "name": function() { return post_excerpt_name; },
  1184. "settings": function() { return post_excerpt_settings; }
  1185. });
  1186. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
  1187. var build_module_post_featured_image_namespaceObject = {};
  1188. __webpack_require__.r(build_module_post_featured_image_namespaceObject);
  1189. __webpack_require__.d(build_module_post_featured_image_namespaceObject, {
  1190. "metadata": function() { return post_featured_image_metadata; },
  1191. "name": function() { return post_featured_image_name; },
  1192. "settings": function() { return post_featured_image_settings; }
  1193. });
  1194. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
  1195. var post_navigation_link_namespaceObject = {};
  1196. __webpack_require__.r(post_navigation_link_namespaceObject);
  1197. __webpack_require__.d(post_navigation_link_namespaceObject, {
  1198. "metadata": function() { return post_navigation_link_metadata; },
  1199. "name": function() { return post_navigation_link_name; },
  1200. "settings": function() { return post_navigation_link_settings; }
  1201. });
  1202. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
  1203. var post_template_namespaceObject = {};
  1204. __webpack_require__.r(post_template_namespaceObject);
  1205. __webpack_require__.d(post_template_namespaceObject, {
  1206. "metadata": function() { return post_template_metadata; },
  1207. "name": function() { return post_template_name; },
  1208. "settings": function() { return post_template_settings; }
  1209. });
  1210. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
  1211. var build_module_post_terms_namespaceObject = {};
  1212. __webpack_require__.r(build_module_post_terms_namespaceObject);
  1213. __webpack_require__.d(build_module_post_terms_namespaceObject, {
  1214. "metadata": function() { return post_terms_metadata; },
  1215. "name": function() { return post_terms_name; },
  1216. "settings": function() { return post_terms_settings; }
  1217. });
  1218. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
  1219. var build_module_post_title_namespaceObject = {};
  1220. __webpack_require__.r(build_module_post_title_namespaceObject);
  1221. __webpack_require__.d(build_module_post_title_namespaceObject, {
  1222. "metadata": function() { return post_title_metadata; },
  1223. "name": function() { return post_title_name; },
  1224. "settings": function() { return post_title_settings; }
  1225. });
  1226. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
  1227. var build_module_preformatted_namespaceObject = {};
  1228. __webpack_require__.r(build_module_preformatted_namespaceObject);
  1229. __webpack_require__.d(build_module_preformatted_namespaceObject, {
  1230. "metadata": function() { return preformatted_metadata; },
  1231. "name": function() { return preformatted_name; },
  1232. "settings": function() { return preformatted_settings; }
  1233. });
  1234. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
  1235. var build_module_pullquote_namespaceObject = {};
  1236. __webpack_require__.r(build_module_pullquote_namespaceObject);
  1237. __webpack_require__.d(build_module_pullquote_namespaceObject, {
  1238. "metadata": function() { return pullquote_metadata; },
  1239. "name": function() { return pullquote_name; },
  1240. "settings": function() { return pullquote_settings; }
  1241. });
  1242. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js
  1243. var query_namespaceObject = {};
  1244. __webpack_require__.r(query_namespaceObject);
  1245. __webpack_require__.d(query_namespaceObject, {
  1246. "metadata": function() { return query_metadata; },
  1247. "name": function() { return query_name; },
  1248. "settings": function() { return query_settings; }
  1249. });
  1250. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
  1251. var query_no_results_namespaceObject = {};
  1252. __webpack_require__.r(query_no_results_namespaceObject);
  1253. __webpack_require__.d(query_no_results_namespaceObject, {
  1254. "metadata": function() { return query_no_results_metadata; },
  1255. "name": function() { return query_no_results_name; },
  1256. "settings": function() { return query_no_results_settings; }
  1257. });
  1258. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
  1259. var build_module_query_pagination_namespaceObject = {};
  1260. __webpack_require__.r(build_module_query_pagination_namespaceObject);
  1261. __webpack_require__.d(build_module_query_pagination_namespaceObject, {
  1262. "metadata": function() { return query_pagination_metadata; },
  1263. "name": function() { return query_pagination_name; },
  1264. "settings": function() { return query_pagination_settings; }
  1265. });
  1266. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
  1267. var build_module_query_pagination_next_namespaceObject = {};
  1268. __webpack_require__.r(build_module_query_pagination_next_namespaceObject);
  1269. __webpack_require__.d(build_module_query_pagination_next_namespaceObject, {
  1270. "metadata": function() { return query_pagination_next_metadata; },
  1271. "name": function() { return query_pagination_next_name; },
  1272. "settings": function() { return query_pagination_next_settings; }
  1273. });
  1274. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
  1275. var build_module_query_pagination_numbers_namespaceObject = {};
  1276. __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject);
  1277. __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, {
  1278. "metadata": function() { return query_pagination_numbers_metadata; },
  1279. "name": function() { return query_pagination_numbers_name; },
  1280. "settings": function() { return query_pagination_numbers_settings; }
  1281. });
  1282. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
  1283. var build_module_query_pagination_previous_namespaceObject = {};
  1284. __webpack_require__.r(build_module_query_pagination_previous_namespaceObject);
  1285. __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, {
  1286. "metadata": function() { return query_pagination_previous_metadata; },
  1287. "name": function() { return query_pagination_previous_name; },
  1288. "settings": function() { return query_pagination_previous_settings; }
  1289. });
  1290. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
  1291. var build_module_query_title_namespaceObject = {};
  1292. __webpack_require__.r(build_module_query_title_namespaceObject);
  1293. __webpack_require__.d(build_module_query_title_namespaceObject, {
  1294. "metadata": function() { return query_title_metadata; },
  1295. "name": function() { return query_title_name; },
  1296. "settings": function() { return query_title_settings; }
  1297. });
  1298. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js
  1299. var build_module_quote_namespaceObject = {};
  1300. __webpack_require__.r(build_module_quote_namespaceObject);
  1301. __webpack_require__.d(build_module_quote_namespaceObject, {
  1302. "metadata": function() { return quote_metadata; },
  1303. "name": function() { return quote_name; },
  1304. "settings": function() { return quote_settings; },
  1305. "settingsV1": function() { return quote_settingsV1; }
  1306. });
  1307. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js
  1308. var block_namespaceObject = {};
  1309. __webpack_require__.r(block_namespaceObject);
  1310. __webpack_require__.d(block_namespaceObject, {
  1311. "metadata": function() { return block_metadata; },
  1312. "name": function() { return block_name; },
  1313. "settings": function() { return block_settings; }
  1314. });
  1315. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
  1316. var read_more_namespaceObject = {};
  1317. __webpack_require__.r(read_more_namespaceObject);
  1318. __webpack_require__.d(read_more_namespaceObject, {
  1319. "metadata": function() { return read_more_metadata; },
  1320. "name": function() { return read_more_name; },
  1321. "settings": function() { return read_more_settings; }
  1322. });
  1323. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js
  1324. var build_module_rss_namespaceObject = {};
  1325. __webpack_require__.r(build_module_rss_namespaceObject);
  1326. __webpack_require__.d(build_module_rss_namespaceObject, {
  1327. "metadata": function() { return rss_metadata; },
  1328. "name": function() { return rss_name; },
  1329. "settings": function() { return rss_settings; }
  1330. });
  1331. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js
  1332. var build_module_search_namespaceObject = {};
  1333. __webpack_require__.r(build_module_search_namespaceObject);
  1334. __webpack_require__.d(build_module_search_namespaceObject, {
  1335. "metadata": function() { return search_metadata; },
  1336. "name": function() { return search_name; },
  1337. "settings": function() { return search_settings; }
  1338. });
  1339. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js
  1340. var build_module_separator_namespaceObject = {};
  1341. __webpack_require__.r(build_module_separator_namespaceObject);
  1342. __webpack_require__.d(build_module_separator_namespaceObject, {
  1343. "metadata": function() { return separator_metadata; },
  1344. "name": function() { return separator_name; },
  1345. "settings": function() { return separator_settings; }
  1346. });
  1347. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
  1348. var build_module_shortcode_namespaceObject = {};
  1349. __webpack_require__.r(build_module_shortcode_namespaceObject);
  1350. __webpack_require__.d(build_module_shortcode_namespaceObject, {
  1351. "metadata": function() { return shortcode_metadata; },
  1352. "name": function() { return shortcode_name; },
  1353. "settings": function() { return shortcode_settings; }
  1354. });
  1355. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
  1356. var build_module_site_logo_namespaceObject = {};
  1357. __webpack_require__.r(build_module_site_logo_namespaceObject);
  1358. __webpack_require__.d(build_module_site_logo_namespaceObject, {
  1359. "metadata": function() { return site_logo_metadata; },
  1360. "name": function() { return site_logo_name; },
  1361. "settings": function() { return site_logo_settings; }
  1362. });
  1363. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
  1364. var site_tagline_namespaceObject = {};
  1365. __webpack_require__.r(site_tagline_namespaceObject);
  1366. __webpack_require__.d(site_tagline_namespaceObject, {
  1367. "metadata": function() { return site_tagline_metadata; },
  1368. "name": function() { return site_tagline_name; },
  1369. "settings": function() { return site_tagline_settings; }
  1370. });
  1371. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
  1372. var site_title_namespaceObject = {};
  1373. __webpack_require__.r(site_title_namespaceObject);
  1374. __webpack_require__.d(site_title_namespaceObject, {
  1375. "metadata": function() { return site_title_metadata; },
  1376. "name": function() { return site_title_name; },
  1377. "settings": function() { return site_title_settings; }
  1378. });
  1379. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
  1380. var social_link_namespaceObject = {};
  1381. __webpack_require__.r(social_link_namespaceObject);
  1382. __webpack_require__.d(social_link_namespaceObject, {
  1383. "metadata": function() { return social_link_metadata; },
  1384. "name": function() { return social_link_name; },
  1385. "settings": function() { return social_link_settings; }
  1386. });
  1387. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
  1388. var social_links_namespaceObject = {};
  1389. __webpack_require__.r(social_links_namespaceObject);
  1390. __webpack_require__.d(social_links_namespaceObject, {
  1391. "metadata": function() { return social_links_metadata; },
  1392. "name": function() { return social_links_name; },
  1393. "settings": function() { return social_links_settings; }
  1394. });
  1395. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
  1396. var spacer_namespaceObject = {};
  1397. __webpack_require__.r(spacer_namespaceObject);
  1398. __webpack_require__.d(spacer_namespaceObject, {
  1399. "metadata": function() { return spacer_metadata; },
  1400. "name": function() { return spacer_name; },
  1401. "settings": function() { return spacer_settings; }
  1402. });
  1403. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js
  1404. var build_module_table_namespaceObject = {};
  1405. __webpack_require__.r(build_module_table_namespaceObject);
  1406. __webpack_require__.d(build_module_table_namespaceObject, {
  1407. "metadata": function() { return table_metadata; },
  1408. "name": function() { return table_name; },
  1409. "settings": function() { return table_settings; }
  1410. });
  1411. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
  1412. var tag_cloud_namespaceObject = {};
  1413. __webpack_require__.r(tag_cloud_namespaceObject);
  1414. __webpack_require__.d(tag_cloud_namespaceObject, {
  1415. "metadata": function() { return tag_cloud_metadata; },
  1416. "name": function() { return tag_cloud_name; },
  1417. "settings": function() { return tag_cloud_settings; }
  1418. });
  1419. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
  1420. var template_part_namespaceObject = {};
  1421. __webpack_require__.r(template_part_namespaceObject);
  1422. __webpack_require__.d(template_part_namespaceObject, {
  1423. "metadata": function() { return template_part_metadata; },
  1424. "name": function() { return template_part_name; },
  1425. "settings": function() { return template_part_settings; }
  1426. });
  1427. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
  1428. var build_module_term_description_namespaceObject = {};
  1429. __webpack_require__.r(build_module_term_description_namespaceObject);
  1430. __webpack_require__.d(build_module_term_description_namespaceObject, {
  1431. "metadata": function() { return term_description_metadata; },
  1432. "name": function() { return term_description_name; },
  1433. "settings": function() { return term_description_settings; }
  1434. });
  1435. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
  1436. var text_columns_namespaceObject = {};
  1437. __webpack_require__.r(text_columns_namespaceObject);
  1438. __webpack_require__.d(text_columns_namespaceObject, {
  1439. "metadata": function() { return text_columns_metadata; },
  1440. "name": function() { return text_columns_name; },
  1441. "settings": function() { return text_columns_settings; }
  1442. });
  1443. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js
  1444. var build_module_verse_namespaceObject = {};
  1445. __webpack_require__.r(build_module_verse_namespaceObject);
  1446. __webpack_require__.d(build_module_verse_namespaceObject, {
  1447. "metadata": function() { return verse_metadata; },
  1448. "name": function() { return verse_name; },
  1449. "settings": function() { return verse_settings; }
  1450. });
  1451. // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js
  1452. var build_module_video_namespaceObject = {};
  1453. __webpack_require__.r(build_module_video_namespaceObject);
  1454. __webpack_require__.d(build_module_video_namespaceObject, {
  1455. "metadata": function() { return video_metadata; },
  1456. "name": function() { return video_name; },
  1457. "settings": function() { return video_settings; }
  1458. });
  1459. ;// CONCATENATED MODULE: external ["wp","blocks"]
  1460. var external_wp_blocks_namespaceObject = window["wp"]["blocks"];
  1461. ;// CONCATENATED MODULE: external ["wp","element"]
  1462. var external_wp_element_namespaceObject = window["wp"]["element"];
  1463. ;// CONCATENATED MODULE: external ["wp","primitives"]
  1464. var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
  1465. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js
  1466. /**
  1467. * WordPress dependencies
  1468. */
  1469. const archive = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1470. viewBox: "0 0 24 24",
  1471. xmlns: "http://www.w3.org/2000/svg"
  1472. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1473. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"
  1474. }));
  1475. /* harmony default export */ var library_archive = (archive);
  1476. ;// CONCATENATED MODULE: external ["wp","components"]
  1477. var external_wp_components_namespaceObject = window["wp"]["components"];
  1478. ;// CONCATENATED MODULE: external ["wp","i18n"]
  1479. var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
  1480. ;// CONCATENATED MODULE: external ["wp","blockEditor"]
  1481. var external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
  1482. ;// CONCATENATED MODULE: external ["wp","serverSideRender"]
  1483. var external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
  1484. var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
  1485. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/edit.js
  1486. /**
  1487. * WordPress dependencies
  1488. */
  1489. function ArchivesEdit(_ref) {
  1490. let {
  1491. attributes,
  1492. setAttributes
  1493. } = _ref;
  1494. const {
  1495. showPostCounts,
  1496. displayAsDropdown,
  1497. type
  1498. } = attributes;
  1499. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  1500. title: (0,external_wp_i18n_namespaceObject.__)('Archives settings')
  1501. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1502. label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
  1503. checked: displayAsDropdown,
  1504. onChange: () => setAttributes({
  1505. displayAsDropdown: !displayAsDropdown
  1506. })
  1507. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1508. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  1509. checked: showPostCounts,
  1510. onChange: () => setAttributes({
  1511. showPostCounts: !showPostCounts
  1512. })
  1513. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  1514. label: (0,external_wp_i18n_namespaceObject.__)('Group by:'),
  1515. options: [{
  1516. label: (0,external_wp_i18n_namespaceObject.__)('Year'),
  1517. value: 'yearly'
  1518. }, {
  1519. label: (0,external_wp_i18n_namespaceObject.__)('Month'),
  1520. value: 'monthly'
  1521. }, {
  1522. label: (0,external_wp_i18n_namespaceObject.__)('Week'),
  1523. value: 'weekly'
  1524. }, {
  1525. label: (0,external_wp_i18n_namespaceObject.__)('Day'),
  1526. value: 'daily'
  1527. }],
  1528. value: type,
  1529. onChange: value => setAttributes({
  1530. type: value
  1531. })
  1532. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  1533. block: "core/archives",
  1534. attributes: attributes
  1535. }))));
  1536. }
  1537. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/archives/index.js
  1538. /**
  1539. * WordPress dependencies
  1540. */
  1541. /**
  1542. * Internal dependencies
  1543. */
  1544. const metadata = {
  1545. $schema: "https://schemas.wp.org/trunk/block.json",
  1546. apiVersion: 2,
  1547. name: "core/archives",
  1548. title: "Archives",
  1549. category: "widgets",
  1550. description: "Display a date archive of your posts.",
  1551. textdomain: "default",
  1552. attributes: {
  1553. displayAsDropdown: {
  1554. type: "boolean",
  1555. "default": false
  1556. },
  1557. showPostCounts: {
  1558. type: "boolean",
  1559. "default": false
  1560. },
  1561. type: {
  1562. type: "string",
  1563. "default": "monthly"
  1564. }
  1565. },
  1566. supports: {
  1567. align: true,
  1568. html: false
  1569. },
  1570. editorStyle: "wp-block-archives-editor"
  1571. };
  1572. const {
  1573. name: archives_name
  1574. } = metadata;
  1575. const settings = {
  1576. icon: library_archive,
  1577. example: {},
  1578. edit: ArchivesEdit
  1579. };
  1580. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
  1581. /**
  1582. * WordPress dependencies
  1583. */
  1584. const commentAuthorAvatar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1585. xmlns: "http://www.w3.org/2000/svg",
  1586. viewBox: "0 0 24 24"
  1587. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1588. fillRule: "evenodd",
  1589. d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
  1590. clipRule: "evenodd"
  1591. }));
  1592. /* harmony default export */ var comment_author_avatar = (commentAuthorAvatar);
  1593. ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  1594. function _extends() {
  1595. _extends = Object.assign || function (target) {
  1596. for (var i = 1; i < arguments.length; i++) {
  1597. var source = arguments[i];
  1598. for (var key in source) {
  1599. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1600. target[key] = source[key];
  1601. }
  1602. }
  1603. }
  1604. return target;
  1605. };
  1606. return _extends.apply(this, arguments);
  1607. }
  1608. // EXTERNAL MODULE: ./node_modules/classnames/index.js
  1609. var classnames = __webpack_require__(4403);
  1610. var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
  1611. ;// CONCATENATED MODULE: external ["wp","url"]
  1612. var external_wp_url_namespaceObject = window["wp"]["url"];
  1613. ;// CONCATENATED MODULE: external ["wp","coreData"]
  1614. var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
  1615. ;// CONCATENATED MODULE: external ["wp","data"]
  1616. var external_wp_data_namespaceObject = window["wp"]["data"];
  1617. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js
  1618. /**
  1619. * WordPress dependencies
  1620. */
  1621. function getAvatarSizes(sizes) {
  1622. const minSize = sizes ? sizes[0] : 24;
  1623. const maxSize = sizes ? sizes[sizes.length - 1] : 96;
  1624. const maxSizeBuffer = Math.floor(maxSize * 2.5);
  1625. return {
  1626. minSize,
  1627. maxSize: maxSizeBuffer
  1628. };
  1629. }
  1630. function useDefaultAvatar() {
  1631. const {
  1632. avatarURL: defaultAvatarUrl
  1633. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1634. const {
  1635. getSettings
  1636. } = select(external_wp_blockEditor_namespaceObject.store);
  1637. const {
  1638. __experimentalDiscussionSettings
  1639. } = getSettings();
  1640. return __experimentalDiscussionSettings;
  1641. });
  1642. return defaultAvatarUrl;
  1643. }
  1644. function useCommentAvatar(_ref) {
  1645. let {
  1646. commentId
  1647. } = _ref;
  1648. const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
  1649. const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId);
  1650. const avatarUrls = avatars ? Object.values(avatars) : null;
  1651. const sizes = avatars ? Object.keys(avatars) : null;
  1652. const {
  1653. minSize,
  1654. maxSize
  1655. } = getAvatarSizes(sizes);
  1656. const defaultAvatar = useDefaultAvatar();
  1657. return {
  1658. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
  1659. minSize,
  1660. maxSize,
  1661. // translators: %s is the Author name.
  1662. alt: authorName ? // translators: %s is the Author name.
  1663. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
  1664. };
  1665. }
  1666. function useUserAvatar(_ref2) {
  1667. let {
  1668. userId,
  1669. postId,
  1670. postType
  1671. } = _ref2;
  1672. const {
  1673. authorDetails
  1674. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1675. var _getEditedEntityRecor;
  1676. const {
  1677. getEditedEntityRecord,
  1678. getUser
  1679. } = select(external_wp_coreData_namespaceObject.store);
  1680. if (userId) {
  1681. return {
  1682. authorDetails: getUser(userId)
  1683. };
  1684. }
  1685. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  1686. return {
  1687. authorDetails: _authorId ? getUser(_authorId) : null
  1688. };
  1689. }, [postType, postId, userId]);
  1690. const avatarUrls = authorDetails ? Object.values(authorDetails.avatar_urls) : null;
  1691. const sizes = authorDetails ? Object.keys(authorDetails.avatar_urls) : null;
  1692. const {
  1693. minSize,
  1694. maxSize
  1695. } = getAvatarSizes(sizes);
  1696. const defaultAvatar = useDefaultAvatar();
  1697. return {
  1698. src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
  1699. minSize,
  1700. maxSize,
  1701. alt: authorDetails ? // translators: %s is the Author name.
  1702. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar')
  1703. };
  1704. }
  1705. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js
  1706. /**
  1707. * WordPress dependencies
  1708. */
  1709. const AUTHORS_QUERY = {
  1710. who: 'authors',
  1711. per_page: -1,
  1712. _fields: 'id,name',
  1713. context: 'view'
  1714. };
  1715. function UserControl(_ref) {
  1716. let {
  1717. value,
  1718. onChange
  1719. } = _ref;
  1720. const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)();
  1721. const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  1722. const {
  1723. getUsers
  1724. } = select(external_wp_coreData_namespaceObject.store);
  1725. return getUsers(AUTHORS_QUERY);
  1726. }, []);
  1727. if (!authorsList) {
  1728. return null;
  1729. }
  1730. const options = authorsList.map(author => {
  1731. return {
  1732. label: author.name,
  1733. value: author.id
  1734. };
  1735. });
  1736. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ComboboxControl, {
  1737. label: (0,external_wp_i18n_namespaceObject.__)('User'),
  1738. help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'),
  1739. value: value,
  1740. onChange: onChange,
  1741. options: filteredAuthorsList || options,
  1742. onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase())))
  1743. });
  1744. }
  1745. /* harmony default export */ var user_control = (UserControl);
  1746. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/edit.js
  1747. /**
  1748. * External dependencies
  1749. */
  1750. /**
  1751. * WordPress dependencies
  1752. */
  1753. /**
  1754. * Internal dependencies
  1755. */
  1756. const AvatarInspectorControls = _ref => {
  1757. let {
  1758. setAttributes,
  1759. avatar,
  1760. attributes,
  1761. selectUser
  1762. } = _ref;
  1763. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  1764. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  1765. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  1766. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  1767. onChange: newSize => setAttributes({
  1768. size: newSize
  1769. }),
  1770. min: avatar.minSize,
  1771. max: avatar.maxSize,
  1772. initialPosition: attributes === null || attributes === void 0 ? void 0 : attributes.size,
  1773. value: attributes === null || attributes === void 0 ? void 0 : attributes.size
  1774. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1775. label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'),
  1776. onChange: () => setAttributes({
  1777. isLink: !attributes.isLink
  1778. }),
  1779. checked: attributes.isLink
  1780. }), attributes.isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  1781. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  1782. onChange: value => setAttributes({
  1783. linkTarget: value ? '_blank' : '_self'
  1784. }),
  1785. checked: attributes.linkTarget === '_blank'
  1786. }), selectUser && (0,external_wp_element_namespaceObject.createElement)(user_control, {
  1787. value: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
  1788. onChange: value => {
  1789. setAttributes({
  1790. userId: value
  1791. });
  1792. }
  1793. })));
  1794. };
  1795. const ResizableAvatar = _ref2 => {
  1796. let {
  1797. setAttributes,
  1798. attributes,
  1799. avatar,
  1800. blockProps,
  1801. isSelected
  1802. } = _ref2;
  1803. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  1804. const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar === null || avatar === void 0 ? void 0 : avatar.src, ['s']), {
  1805. s: (attributes === null || attributes === void 0 ? void 0 : attributes.size) * 2
  1806. });
  1807. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  1808. size: {
  1809. width: attributes.size,
  1810. height: attributes.size
  1811. },
  1812. showHandle: isSelected,
  1813. onResizeStop: (event, direction, elt, delta) => {
  1814. setAttributes({
  1815. size: parseInt(attributes.size + (delta.height || delta.width), 10)
  1816. });
  1817. },
  1818. lockAspectRatio: true,
  1819. enable: {
  1820. top: false,
  1821. right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
  1822. bottom: true,
  1823. left: (0,external_wp_i18n_namespaceObject.isRTL)()
  1824. },
  1825. minWidth: avatar.minSize,
  1826. maxWidth: avatar.maxSize
  1827. }, (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  1828. src: doubledSizedSrc,
  1829. alt: avatar.alt
  1830. }, borderProps, {
  1831. className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className),
  1832. style: { ...borderProps.style // Border radius, width and style.
  1833. }
  1834. }))));
  1835. };
  1836. const CommentEdit = _ref3 => {
  1837. let {
  1838. attributes,
  1839. context,
  1840. setAttributes,
  1841. isSelected
  1842. } = _ref3;
  1843. const {
  1844. commentId
  1845. } = context;
  1846. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  1847. const avatar = useCommentAvatar({
  1848. commentId
  1849. });
  1850. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
  1851. avatar: avatar,
  1852. setAttributes: setAttributes,
  1853. attributes: attributes,
  1854. selectUser: false
  1855. }), attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  1856. href: "#avatar-pseudo-link",
  1857. className: "wp-block-avatar__link",
  1858. onClick: event => event.preventDefault()
  1859. }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1860. attributes: attributes,
  1861. avatar: avatar,
  1862. blockProps: blockProps,
  1863. isSelected: isSelected,
  1864. setAttributes: setAttributes
  1865. })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1866. attributes: attributes,
  1867. avatar: avatar,
  1868. blockProps: blockProps,
  1869. isSelected: isSelected,
  1870. setAttributes: setAttributes
  1871. }));
  1872. };
  1873. const UserEdit = _ref4 => {
  1874. let {
  1875. attributes,
  1876. context,
  1877. setAttributes,
  1878. isSelected
  1879. } = _ref4;
  1880. const {
  1881. postId,
  1882. postType
  1883. } = context;
  1884. const avatar = useUserAvatar({
  1885. userId: attributes === null || attributes === void 0 ? void 0 : attributes.userId,
  1886. postId,
  1887. postType
  1888. });
  1889. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  1890. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AvatarInspectorControls, {
  1891. selectUser: true,
  1892. attributes: attributes,
  1893. avatar: avatar,
  1894. setAttributes: setAttributes
  1895. }), (0,external_wp_element_namespaceObject.createElement)("div", null, attributes.isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  1896. href: "#avatar-pseudo-link",
  1897. className: "wp-block-avatar__link",
  1898. onClick: event => event.preventDefault()
  1899. }, (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1900. attributes: attributes,
  1901. avatar: avatar,
  1902. blockProps: blockProps,
  1903. isSelected: isSelected,
  1904. setAttributes: setAttributes
  1905. })) : (0,external_wp_element_namespaceObject.createElement)(ResizableAvatar, {
  1906. attributes: attributes,
  1907. avatar: avatar,
  1908. blockProps: blockProps,
  1909. isSelected: isSelected,
  1910. setAttributes: setAttributes
  1911. })));
  1912. };
  1913. function Edit(props) {
  1914. var _props$context, _props$context2;
  1915. // Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`).
  1916. if (props !== null && props !== void 0 && (_props$context = props.context) !== null && _props$context !== void 0 && _props$context.commentId || (props === null || props === void 0 ? void 0 : (_props$context2 = props.context) === null || _props$context2 === void 0 ? void 0 : _props$context2.commentId) === null) {
  1917. return (0,external_wp_element_namespaceObject.createElement)(CommentEdit, props);
  1918. }
  1919. return (0,external_wp_element_namespaceObject.createElement)(UserEdit, props);
  1920. }
  1921. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
  1922. /**
  1923. * WordPress dependencies
  1924. */
  1925. /**
  1926. * Internal dependencies
  1927. */
  1928. const avatar_metadata = {
  1929. $schema: "https://schemas.wp.org/trunk/block.json",
  1930. apiVersion: 2,
  1931. name: "core/avatar",
  1932. title: "Avatar",
  1933. category: "theme",
  1934. description: "Add a user's avatar.",
  1935. textdomain: "default",
  1936. attributes: {
  1937. userId: {
  1938. type: "number"
  1939. },
  1940. size: {
  1941. type: "number",
  1942. "default": 96
  1943. },
  1944. isLink: {
  1945. type: "boolean",
  1946. "default": false
  1947. },
  1948. linkTarget: {
  1949. type: "string",
  1950. "default": "_self"
  1951. }
  1952. },
  1953. usesContext: ["postType", "postId", "commentId"],
  1954. supports: {
  1955. html: false,
  1956. align: true,
  1957. alignWide: false,
  1958. spacing: {
  1959. margin: true
  1960. },
  1961. __experimentalBorder: {
  1962. __experimentalSkipSerialization: true,
  1963. radius: true,
  1964. width: true,
  1965. color: true,
  1966. style: true,
  1967. __experimentalDefaultControls: {
  1968. radius: true
  1969. }
  1970. },
  1971. color: {
  1972. text: false,
  1973. background: false,
  1974. __experimentalDuotone: "img"
  1975. }
  1976. },
  1977. editorStyle: "wp-block-avatar",
  1978. style: "wp-block-avatar"
  1979. };
  1980. const {
  1981. name: avatar_name
  1982. } = avatar_metadata;
  1983. const avatar_settings = {
  1984. icon: comment_author_avatar,
  1985. edit: Edit
  1986. };
  1987. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/audio.js
  1988. /**
  1989. * WordPress dependencies
  1990. */
  1991. const audio = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  1992. viewBox: "0 0 24 24",
  1993. xmlns: "http://www.w3.org/2000/svg"
  1994. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  1995. d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"
  1996. }));
  1997. /* harmony default export */ var library_audio = (audio);
  1998. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js
  1999. /**
  2000. * WordPress dependencies
  2001. */
  2002. /* harmony default export */ var deprecated = ([{
  2003. attributes: {
  2004. src: {
  2005. type: 'string',
  2006. source: 'attribute',
  2007. selector: 'audio',
  2008. attribute: 'src'
  2009. },
  2010. caption: {
  2011. type: 'string',
  2012. source: 'html',
  2013. selector: 'figcaption'
  2014. },
  2015. id: {
  2016. type: 'number'
  2017. },
  2018. autoplay: {
  2019. type: 'boolean',
  2020. source: 'attribute',
  2021. selector: 'audio',
  2022. attribute: 'autoplay'
  2023. },
  2024. loop: {
  2025. type: 'boolean',
  2026. source: 'attribute',
  2027. selector: 'audio',
  2028. attribute: 'loop'
  2029. },
  2030. preload: {
  2031. type: 'string',
  2032. source: 'attribute',
  2033. selector: 'audio',
  2034. attribute: 'preload'
  2035. }
  2036. },
  2037. supports: {
  2038. align: true
  2039. },
  2040. save(_ref) {
  2041. let {
  2042. attributes
  2043. } = _ref;
  2044. const {
  2045. autoplay,
  2046. caption,
  2047. loop,
  2048. preload,
  2049. src
  2050. } = attributes;
  2051. return (0,external_wp_element_namespaceObject.createElement)("figure", null, (0,external_wp_element_namespaceObject.createElement)("audio", {
  2052. controls: "controls",
  2053. src: src,
  2054. autoPlay: autoplay,
  2055. loop: loop,
  2056. preload: preload
  2057. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  2058. tagName: "figcaption",
  2059. value: caption
  2060. }));
  2061. }
  2062. }]);
  2063. ;// CONCATENATED MODULE: external ["wp","blob"]
  2064. var external_wp_blob_namespaceObject = window["wp"]["blob"];
  2065. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/constants.js
  2066. const ASPECT_RATIOS = [// Common video resolutions.
  2067. {
  2068. ratio: '2.33',
  2069. className: 'wp-embed-aspect-21-9'
  2070. }, {
  2071. ratio: '2.00',
  2072. className: 'wp-embed-aspect-18-9'
  2073. }, {
  2074. ratio: '1.78',
  2075. className: 'wp-embed-aspect-16-9'
  2076. }, {
  2077. ratio: '1.33',
  2078. className: 'wp-embed-aspect-4-3'
  2079. }, // Vertical video and instagram square video support.
  2080. {
  2081. ratio: '1.00',
  2082. className: 'wp-embed-aspect-1-1'
  2083. }, {
  2084. ratio: '0.56',
  2085. className: 'wp-embed-aspect-9-16'
  2086. }, {
  2087. ratio: '0.50',
  2088. className: 'wp-embed-aspect-1-2'
  2089. }];
  2090. const WP_EMBED_TYPE = 'wp-embed';
  2091. ;// CONCATENATED MODULE: external "lodash"
  2092. var external_lodash_namespaceObject = window["lodash"];
  2093. // EXTERNAL MODULE: ./node_modules/classnames/dedupe.js
  2094. var dedupe = __webpack_require__(3827);
  2095. var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe);
  2096. // EXTERNAL MODULE: ./node_modules/memize/index.js
  2097. var memize = __webpack_require__(9756);
  2098. var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
  2099. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/util.js
  2100. /**
  2101. * Internal dependencies
  2102. */
  2103. /**
  2104. * External dependencies
  2105. */
  2106. /**
  2107. * WordPress dependencies
  2108. */
  2109. /**
  2110. * Internal dependencies
  2111. */
  2112. const util_metadata = {
  2113. $schema: "https://schemas.wp.org/trunk/block.json",
  2114. apiVersion: 2,
  2115. name: "core/embed",
  2116. title: "Embed",
  2117. category: "embed",
  2118. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  2119. textdomain: "default",
  2120. attributes: {
  2121. url: {
  2122. type: "string"
  2123. },
  2124. caption: {
  2125. type: "string",
  2126. source: "html",
  2127. selector: "figcaption"
  2128. },
  2129. type: {
  2130. type: "string"
  2131. },
  2132. providerNameSlug: {
  2133. type: "string"
  2134. },
  2135. allowResponsive: {
  2136. type: "boolean",
  2137. "default": true
  2138. },
  2139. responsive: {
  2140. type: "boolean",
  2141. "default": false
  2142. },
  2143. previewable: {
  2144. type: "boolean",
  2145. "default": true
  2146. }
  2147. },
  2148. supports: {
  2149. align: true
  2150. },
  2151. editorStyle: "wp-block-embed-editor",
  2152. style: "wp-block-embed"
  2153. };
  2154. const {
  2155. name: DEFAULT_EMBED_BLOCK
  2156. } = util_metadata;
  2157. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  2158. /**
  2159. * Returns the embed block's information by matching the provided service provider
  2160. *
  2161. * @param {string} provider The embed block's provider
  2162. * @return {WPBlockVariation} The embed block's information
  2163. */
  2164. const getEmbedInfoByProvider = provider => {
  2165. var _getBlockVariations;
  2166. return (_getBlockVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => {
  2167. let {
  2168. name
  2169. } = _ref;
  2170. return name === provider;
  2171. });
  2172. };
  2173. /**
  2174. * Returns true if any of the regular expressions match the URL.
  2175. *
  2176. * @param {string} url The URL to test.
  2177. * @param {Array} patterns The list of regular expressions to test agains.
  2178. * @return {boolean} True if any of the regular expressions match the URL.
  2179. */
  2180. const matchesPatterns = function (url) {
  2181. let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2182. return patterns.some(pattern => url.match(pattern));
  2183. };
  2184. /**
  2185. * Finds the block variation that should be used for the URL,
  2186. * based on the provided URL and the variation's patterns.
  2187. *
  2188. * @param {string} url The URL to test.
  2189. * @return {WPBlockVariation} The block variation that should be used for this URL
  2190. */
  2191. const findMoreSuitableBlock = url => {
  2192. var _getBlockVariations2;
  2193. return (_getBlockVariations2 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => {
  2194. let {
  2195. patterns
  2196. } = _ref2;
  2197. return matchesPatterns(url, patterns);
  2198. });
  2199. };
  2200. const isFromWordPress = html => html && html.includes('class="wp-embedded-content"');
  2201. const getPhotoHtml = photo => {
  2202. // 100% width for the preview so it fits nicely into the document, some "thumbnails" are
  2203. // actually the full size photo. If thumbnails not found, use full image.
  2204. const imageUrl = photo.thumbnail_url || photo.url;
  2205. const photoPreview = (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("img", {
  2206. src: imageUrl,
  2207. alt: photo.title,
  2208. width: "100%"
  2209. }));
  2210. return (0,external_wp_element_namespaceObject.renderToString)(photoPreview);
  2211. };
  2212. /**
  2213. * Creates a more suitable embed block based on the passed in props
  2214. * and attributes generated from an embed block's preview.
  2215. *
  2216. * We require `attributesFromPreview` to be generated from the latest attributes
  2217. * and preview, and because of the way the react lifecycle operates, we can't
  2218. * guarantee that the attributes contained in the block's props are the latest
  2219. * versions, so we require that these are generated separately.
  2220. * See `getAttributesFromPreview` in the generated embed edit component.
  2221. *
  2222. * @param {Object} props The block's props.
  2223. * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.
  2224. * @return {Object|undefined} A more suitable embed block if one exists.
  2225. */
  2226. const createUpgradedEmbedBlock = function (props) {
  2227. var _getBlockVariations3;
  2228. let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2229. const {
  2230. preview,
  2231. attributes = {}
  2232. } = props;
  2233. const {
  2234. url,
  2235. providerNameSlug,
  2236. type,
  2237. ...restAttributes
  2238. } = attributes;
  2239. if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return;
  2240. const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns,
  2241. // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.
  2242. const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // If current block is not WordPress and a more suitable block found
  2243. // that is different from the current one, create the new matched block.
  2244. const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug);
  2245. if (shouldCreateNewBlock) {
  2246. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
  2247. url,
  2248. ...restAttributes,
  2249. ...matchedBlock.attributes
  2250. });
  2251. }
  2252. const wpVariation = (_getBlockVariations3 = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => {
  2253. let {
  2254. name
  2255. } = _ref3;
  2256. return name === 'wordpress';
  2257. }); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
  2258. if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
  2259. return;
  2260. } // This is not the WordPress embed block so transform it into one.
  2261. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
  2262. url,
  2263. ...wpVariation.attributes,
  2264. // By now we have the preview, but when the new block first renders, it
  2265. // won't have had all the attributes set, and so won't get the correct
  2266. // type and it won't render correctly. So, we pass through the current attributes
  2267. // here so that the initial render works when we switch to the WordPress
  2268. // block. This only affects the WordPress block because it can't be
  2269. // rendered in the usual Sandbox (it has a sandbox of its own) and it
  2270. // relies on the preview to set the correct render type.
  2271. ...attributesFromPreview
  2272. });
  2273. };
  2274. /**
  2275. * Removes all previously set aspect ratio related classes and return the rest
  2276. * existing class names.
  2277. *
  2278. * @param {string} existingClassNames Any existing class names.
  2279. * @return {string} The class names without any aspect ratio related class.
  2280. */
  2281. const removeAspectRatioClasses = existingClassNames => {
  2282. if (!existingClassNames) {
  2283. // Avoids extraneous work and also, by returning the same value as
  2284. // received, ensures the post is not dirtied by a change of the block
  2285. // attribute from `undefined` to an emtpy string.
  2286. return existingClassNames;
  2287. }
  2288. const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, _ref4) => {
  2289. let {
  2290. className
  2291. } = _ref4;
  2292. accumulator[className] = false;
  2293. return accumulator;
  2294. }, {
  2295. 'wp-has-aspect-ratio': false
  2296. });
  2297. return dedupe_default()(existingClassNames, aspectRatioClassNames);
  2298. };
  2299. /**
  2300. * Returns class names with any relevant responsive aspect ratio names.
  2301. *
  2302. * @param {string} html The preview HTML that possibly contains an iframe with width and height set.
  2303. * @param {string} existingClassNames Any existing class names.
  2304. * @param {boolean} allowResponsive If the responsive class names should be added, or removed.
  2305. * @return {string} Deduped class names.
  2306. */
  2307. function getClassNames(html, existingClassNames) {
  2308. let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2309. if (!allowResponsive) {
  2310. return removeAspectRatioClasses(existingClassNames);
  2311. }
  2312. const previewDocument = document.implementation.createHTMLDocument('');
  2313. previewDocument.body.innerHTML = html;
  2314. const iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block.
  2315. if (iframe && iframe.height && iframe.width) {
  2316. const aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it.
  2317. for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) {
  2318. const potentialRatio = ASPECT_RATIOS[ratioIndex];
  2319. if (aspectRatio >= potentialRatio.ratio) {
  2320. // Evaluate the difference between actual aspect ratio and closest match.
  2321. // If the difference is too big, do not scale the embed according to aspect ratio.
  2322. const ratioDiff = aspectRatio - potentialRatio.ratio;
  2323. if (ratioDiff > 0.1) {
  2324. // No close aspect ratio match found.
  2325. return removeAspectRatioClasses(existingClassNames);
  2326. } // Close aspect ratio match found.
  2327. return dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio');
  2328. }
  2329. }
  2330. }
  2331. return existingClassNames;
  2332. }
  2333. /**
  2334. * Fallback behaviour for unembeddable URLs.
  2335. * Creates a paragraph block containing a link to the URL, and calls `onReplace`.
  2336. *
  2337. * @param {string} url The URL that could not be embedded.
  2338. * @param {Function} onReplace Function to call with the created fallback block.
  2339. */
  2340. function fallback(url, onReplace) {
  2341. const link = (0,external_wp_element_namespaceObject.createElement)("a", {
  2342. href: url
  2343. }, url);
  2344. onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  2345. content: (0,external_wp_element_namespaceObject.renderToString)(link)
  2346. }));
  2347. }
  2348. /***
  2349. * Gets block attributes based on the preview and responsive state.
  2350. *
  2351. * @param {Object} preview The preview data.
  2352. * @param {string} title The block's title, e.g. Twitter.
  2353. * @param {Object} currentClassNames The block's current class names.
  2354. * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.
  2355. * @param {boolean} allowResponsive Apply responsive classes to fixed size content.
  2356. * @return {Object} Attributes and values.
  2357. */
  2358. const getAttributesFromPreview = memize_default()(function (preview, title, currentClassNames, isResponsive) {
  2359. let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  2360. if (!preview) {
  2361. return {};
  2362. }
  2363. const attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'.
  2364. let {
  2365. type = 'rich'
  2366. } = preview; // If we got a provider name from the API, use it for the slug, otherwise we use the title,
  2367. // because not all embed code gives us a provider name.
  2368. const {
  2369. html,
  2370. provider_name: providerName
  2371. } = preview;
  2372. const providerNameSlug = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase());
  2373. if (isFromWordPress(html)) {
  2374. type = WP_EMBED_TYPE;
  2375. }
  2376. if (html || 'photo' === type) {
  2377. attributes.type = type;
  2378. attributes.providerNameSlug = providerNameSlug;
  2379. }
  2380. attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive);
  2381. return attributes;
  2382. });
  2383. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/edit.js
  2384. /**
  2385. * External dependencies
  2386. */
  2387. /**
  2388. * WordPress dependencies
  2389. */
  2390. /**
  2391. * Internal dependencies
  2392. */
  2393. const ALLOWED_MEDIA_TYPES = ['audio'];
  2394. function AudioEdit(_ref) {
  2395. let {
  2396. attributes,
  2397. className,
  2398. noticeOperations,
  2399. setAttributes,
  2400. onReplace,
  2401. isSelected,
  2402. noticeUI,
  2403. insertBlocksAfter
  2404. } = _ref;
  2405. const {
  2406. id,
  2407. autoplay,
  2408. caption,
  2409. loop,
  2410. preload,
  2411. src
  2412. } = attributes;
  2413. const isTemporaryAudio = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
  2414. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
  2415. const {
  2416. getSettings
  2417. } = select(external_wp_blockEditor_namespaceObject.store);
  2418. return getSettings().mediaUpload;
  2419. }, []);
  2420. (0,external_wp_element_namespaceObject.useEffect)(() => {
  2421. if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
  2422. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
  2423. if (file) {
  2424. mediaUpload({
  2425. filesList: [file],
  2426. onFileChange: _ref2 => {
  2427. let [{
  2428. id: mediaId,
  2429. url
  2430. }] = _ref2;
  2431. setAttributes({
  2432. id: mediaId,
  2433. src: url
  2434. });
  2435. },
  2436. onError: e => {
  2437. setAttributes({
  2438. src: undefined,
  2439. id: undefined
  2440. });
  2441. noticeOperations.createErrorNotice(e);
  2442. },
  2443. allowedTypes: ALLOWED_MEDIA_TYPES
  2444. });
  2445. }
  2446. }
  2447. }, []);
  2448. function toggleAttribute(attribute) {
  2449. return newValue => {
  2450. setAttributes({
  2451. [attribute]: newValue
  2452. });
  2453. };
  2454. }
  2455. function onSelectURL(newSrc) {
  2456. // Set the block's src from the edit component's state, and switch off
  2457. // the editing UI.
  2458. if (newSrc !== src) {
  2459. // Check if there's an embed block that handles this URL.
  2460. const embedBlock = createUpgradedEmbedBlock({
  2461. attributes: {
  2462. url: newSrc
  2463. }
  2464. });
  2465. if (undefined !== embedBlock && onReplace) {
  2466. onReplace(embedBlock);
  2467. return;
  2468. }
  2469. setAttributes({
  2470. src: newSrc,
  2471. id: undefined
  2472. });
  2473. }
  2474. }
  2475. function onUploadError(message) {
  2476. noticeOperations.removeAllNotices();
  2477. noticeOperations.createErrorNotice(message);
  2478. }
  2479. function getAutoplayHelp(checked) {
  2480. return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null;
  2481. }
  2482. function onSelectAudio(media) {
  2483. if (!media || !media.url) {
  2484. // In this case there was an error and we should continue in the editing state
  2485. // previous attributes should be removed because they may be temporary blob urls.
  2486. setAttributes({
  2487. src: undefined,
  2488. id: undefined
  2489. });
  2490. return;
  2491. } // Sets the block's attribute and updates the edit component from the
  2492. // selected media, then switches off the editing UI.
  2493. setAttributes({
  2494. src: media.url,
  2495. id: media.id
  2496. });
  2497. }
  2498. const classes = classnames_default()(className, {
  2499. 'is-transient': isTemporaryAudio
  2500. });
  2501. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  2502. className: classes
  2503. });
  2504. if (!src) {
  2505. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  2506. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  2507. icon: library_audio
  2508. }),
  2509. onSelect: onSelectAudio,
  2510. onSelectURL: onSelectURL,
  2511. accept: "audio/*",
  2512. allowedTypes: ALLOWED_MEDIA_TYPES,
  2513. value: attributes,
  2514. notices: noticeUI,
  2515. onError: onUploadError
  2516. }));
  2517. }
  2518. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  2519. group: "other"
  2520. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  2521. mediaId: id,
  2522. mediaURL: src,
  2523. allowedTypes: ALLOWED_MEDIA_TYPES,
  2524. accept: "audio/*",
  2525. onSelect: onSelectAudio,
  2526. onSelectURL: onSelectURL,
  2527. onError: onUploadError
  2528. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  2529. title: (0,external_wp_i18n_namespaceObject.__)('Audio settings')
  2530. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2531. label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
  2532. onChange: toggleAttribute('autoplay'),
  2533. checked: autoplay,
  2534. help: getAutoplayHelp
  2535. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  2536. label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
  2537. onChange: toggleAttribute('loop'),
  2538. checked: loop
  2539. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  2540. label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'),
  2541. value: preload || '' // `undefined` is required for the preload attribute to be unset.
  2542. ,
  2543. onChange: value => setAttributes({
  2544. preload: value || undefined
  2545. }),
  2546. options: [{
  2547. value: '',
  2548. label: (0,external_wp_i18n_namespaceObject.__)('Browser default')
  2549. }, {
  2550. value: 'auto',
  2551. label: (0,external_wp_i18n_namespaceObject.__)('Auto')
  2552. }, {
  2553. value: 'metadata',
  2554. label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
  2555. }, {
  2556. value: 'none',
  2557. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
  2558. }]
  2559. }))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
  2560. isDisabled: !isSelected
  2561. }, (0,external_wp_element_namespaceObject.createElement)("audio", {
  2562. controls: "controls",
  2563. src: src
  2564. })), isTemporaryAudio && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  2565. tagName: "figcaption",
  2566. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Audio caption text'),
  2567. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  2568. value: caption,
  2569. onChange: value => setAttributes({
  2570. caption: value
  2571. }),
  2572. inlineToolbar: true,
  2573. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  2574. })));
  2575. }
  2576. /* harmony default export */ var edit = ((0,external_wp_components_namespaceObject.withNotices)(AudioEdit));
  2577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/save.js
  2578. /**
  2579. * WordPress dependencies
  2580. */
  2581. function save(_ref) {
  2582. let {
  2583. attributes
  2584. } = _ref;
  2585. const {
  2586. autoplay,
  2587. caption,
  2588. loop,
  2589. preload,
  2590. src
  2591. } = attributes;
  2592. return src && (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("audio", {
  2593. controls: "controls",
  2594. src: src,
  2595. autoPlay: autoplay,
  2596. loop: loop,
  2597. preload: preload
  2598. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  2599. tagName: "figcaption",
  2600. value: caption
  2601. }));
  2602. }
  2603. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/transforms.js
  2604. /**
  2605. * WordPress dependencies
  2606. */
  2607. const transforms = {
  2608. from: [{
  2609. type: 'files',
  2610. isMatch(files) {
  2611. return files.length === 1 && files[0].type.indexOf('audio/') === 0;
  2612. },
  2613. transform(files) {
  2614. const file = files[0]; // We don't need to upload the media directly here
  2615. // It's already done as part of the `componentDidMount`
  2616. // in the audio block.
  2617. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
  2618. src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  2619. });
  2620. return block;
  2621. }
  2622. }, {
  2623. type: 'shortcode',
  2624. tag: 'audio',
  2625. attributes: {
  2626. src: {
  2627. type: 'string',
  2628. shortcode: _ref => {
  2629. let {
  2630. named: {
  2631. src,
  2632. mp3,
  2633. m4a,
  2634. ogg,
  2635. wav,
  2636. wma
  2637. }
  2638. } = _ref;
  2639. return src || mp3 || m4a || ogg || wav || wma;
  2640. }
  2641. },
  2642. loop: {
  2643. type: 'string',
  2644. shortcode: _ref2 => {
  2645. let {
  2646. named: {
  2647. loop
  2648. }
  2649. } = _ref2;
  2650. return loop;
  2651. }
  2652. },
  2653. autoplay: {
  2654. type: 'string',
  2655. shortcode: _ref3 => {
  2656. let {
  2657. named: {
  2658. autoplay
  2659. }
  2660. } = _ref3;
  2661. return autoplay;
  2662. }
  2663. },
  2664. preload: {
  2665. type: 'string',
  2666. shortcode: _ref4 => {
  2667. let {
  2668. named: {
  2669. preload
  2670. }
  2671. } = _ref4;
  2672. return preload;
  2673. }
  2674. }
  2675. }
  2676. }]
  2677. };
  2678. /* harmony default export */ var audio_transforms = (transforms);
  2679. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/audio/index.js
  2680. /**
  2681. * WordPress dependencies
  2682. */
  2683. /**
  2684. * Internal dependencies
  2685. */
  2686. const audio_metadata = {
  2687. $schema: "https://schemas.wp.org/trunk/block.json",
  2688. apiVersion: 2,
  2689. name: "core/audio",
  2690. title: "Audio",
  2691. category: "media",
  2692. description: "Embed a simple audio player.",
  2693. keywords: ["music", "sound", "podcast", "recording"],
  2694. textdomain: "default",
  2695. attributes: {
  2696. src: {
  2697. type: "string",
  2698. source: "attribute",
  2699. selector: "audio",
  2700. attribute: "src"
  2701. },
  2702. caption: {
  2703. type: "string",
  2704. source: "html",
  2705. selector: "figcaption"
  2706. },
  2707. id: {
  2708. type: "number"
  2709. },
  2710. autoplay: {
  2711. type: "boolean",
  2712. source: "attribute",
  2713. selector: "audio",
  2714. attribute: "autoplay"
  2715. },
  2716. loop: {
  2717. type: "boolean",
  2718. source: "attribute",
  2719. selector: "audio",
  2720. attribute: "loop"
  2721. },
  2722. preload: {
  2723. type: "string",
  2724. source: "attribute",
  2725. selector: "audio",
  2726. attribute: "preload"
  2727. }
  2728. },
  2729. supports: {
  2730. anchor: true,
  2731. align: true
  2732. },
  2733. editorStyle: "wp-block-audio-editor",
  2734. style: "wp-block-audio"
  2735. };
  2736. const {
  2737. name: audio_name
  2738. } = audio_metadata;
  2739. const audio_settings = {
  2740. icon: library_audio,
  2741. example: {
  2742. attributes: {
  2743. src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg'
  2744. }
  2745. },
  2746. transforms: audio_transforms,
  2747. deprecated: deprecated,
  2748. edit: edit,
  2749. save: save
  2750. };
  2751. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/button.js
  2752. /**
  2753. * WordPress dependencies
  2754. */
  2755. const button_button = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  2756. viewBox: "0 0 24 24",
  2757. xmlns: "http://www.w3.org/2000/svg"
  2758. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  2759. d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"
  2760. }));
  2761. /* harmony default export */ var library_button = (button_button);
  2762. ;// CONCATENATED MODULE: external ["wp","compose"]
  2763. var external_wp_compose_namespaceObject = window["wp"]["compose"];
  2764. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js
  2765. /**
  2766. * External dependencies
  2767. */
  2768. /**
  2769. * Removed empty nodes from nested objects.
  2770. *
  2771. * @param {Object} object
  2772. * @return {Object} Object cleaned from empty nodes.
  2773. */
  2774. const cleanEmptyObject = object => {
  2775. if (!(0,external_lodash_namespaceObject.isObject)(object) || Array.isArray(object)) {
  2776. return object;
  2777. }
  2778. const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
  2779. return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
  2780. };
  2781. /* harmony default export */ var clean_empty_object = (cleanEmptyObject);
  2782. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js
  2783. /**
  2784. * External dependencies
  2785. */
  2786. /**
  2787. * Internal dependencies
  2788. */
  2789. /**
  2790. * Migrates the current style.typography.fontFamily attribute,
  2791. * whose value was "var:preset|font-family|helvetica-arial",
  2792. * to the style.fontFamily attribute, whose value will be "helvetica-arial".
  2793. *
  2794. * @param {Object} attributes The current attributes
  2795. * @return {Object} The updated attributes.
  2796. */
  2797. /* harmony default export */ function migrate_font_family(attributes) {
  2798. var _attributes$style, _attributes$style$typ;
  2799. if (!(attributes !== null && attributes !== void 0 && (_attributes$style = attributes.style) !== null && _attributes$style !== void 0 && (_attributes$style$typ = _attributes$style.typography) !== null && _attributes$style$typ !== void 0 && _attributes$style$typ.fontFamily)) {
  2800. return attributes;
  2801. } // Clone first so when we delete the fontFamily
  2802. // below we're not modifying the original
  2803. // attributes. Because the deprecation may be discarded
  2804. // we don't want to alter the original attributes.
  2805. const atts = (0,external_lodash_namespaceObject.cloneDeep)(attributes);
  2806. const fontFamily = atts.style.typography.fontFamily.split('|').pop();
  2807. delete atts.style.typography.fontFamily;
  2808. atts.style = clean_empty_object(atts.style);
  2809. return { ...atts,
  2810. fontFamily
  2811. };
  2812. }
  2813. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/deprecated.js
  2814. /**
  2815. * External dependencies
  2816. */
  2817. /**
  2818. * WordPress dependencies
  2819. */
  2820. /**
  2821. * Internal dependencies
  2822. */
  2823. const migrateBorderRadius = attributes => {
  2824. var _newAttributes$style, _newAttributes$style$, _newAttributes$style2;
  2825. const {
  2826. borderRadius,
  2827. ...newAttributes
  2828. } = attributes; // We have to check old property `borderRadius` and if
  2829. // `styles.border.radius` is a `number`
  2830. const oldBorderRadius = [borderRadius, (_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : (_newAttributes$style$ = _newAttributes$style.border) === null || _newAttributes$style$ === void 0 ? void 0 : _newAttributes$style$.radius].find(possibleBorderRadius => {
  2831. return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0;
  2832. });
  2833. if (!oldBorderRadius) {
  2834. return newAttributes;
  2835. }
  2836. return { ...newAttributes,
  2837. style: { ...newAttributes.style,
  2838. border: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.border),
  2839. radius: `${oldBorderRadius}px`
  2840. }
  2841. }
  2842. };
  2843. };
  2844. const migrateCustomColorsAndGradients = attributes => {
  2845. if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) {
  2846. return attributes;
  2847. }
  2848. const style = {
  2849. color: {}
  2850. };
  2851. if (attributes.customTextColor) {
  2852. style.color.text = attributes.customTextColor;
  2853. }
  2854. if (attributes.customBackgroundColor) {
  2855. style.color.background = attributes.customBackgroundColor;
  2856. }
  2857. if (attributes.customGradient) {
  2858. style.color.gradient = attributes.customGradient;
  2859. }
  2860. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customGradient']),
  2861. style
  2862. };
  2863. };
  2864. const oldColorsMigration = attributes => {
  2865. return migrateCustomColorsAndGradients((0,external_lodash_namespaceObject.omit)({ ...attributes,
  2866. customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
  2867. customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined
  2868. }, ['color', 'textColor']));
  2869. };
  2870. const blockAttributes = {
  2871. url: {
  2872. type: 'string',
  2873. source: 'attribute',
  2874. selector: 'a',
  2875. attribute: 'href'
  2876. },
  2877. title: {
  2878. type: 'string',
  2879. source: 'attribute',
  2880. selector: 'a',
  2881. attribute: 'title'
  2882. },
  2883. text: {
  2884. type: 'string',
  2885. source: 'html',
  2886. selector: 'a'
  2887. }
  2888. };
  2889. const v10 = {
  2890. attributes: {
  2891. url: {
  2892. type: 'string',
  2893. source: 'attribute',
  2894. selector: 'a',
  2895. attribute: 'href'
  2896. },
  2897. title: {
  2898. type: 'string',
  2899. source: 'attribute',
  2900. selector: 'a',
  2901. attribute: 'title'
  2902. },
  2903. text: {
  2904. type: 'string',
  2905. source: 'html',
  2906. selector: 'a'
  2907. },
  2908. linkTarget: {
  2909. type: 'string',
  2910. source: 'attribute',
  2911. selector: 'a',
  2912. attribute: 'target'
  2913. },
  2914. rel: {
  2915. type: 'string',
  2916. source: 'attribute',
  2917. selector: 'a',
  2918. attribute: 'rel'
  2919. },
  2920. placeholder: {
  2921. type: 'string'
  2922. },
  2923. backgroundColor: {
  2924. type: 'string'
  2925. },
  2926. textColor: {
  2927. type: 'string'
  2928. },
  2929. gradient: {
  2930. type: 'string'
  2931. },
  2932. width: {
  2933. type: 'number'
  2934. }
  2935. },
  2936. supports: {
  2937. anchor: true,
  2938. align: true,
  2939. alignWide: false,
  2940. color: {
  2941. __experimentalSkipSerialization: true,
  2942. gradients: true
  2943. },
  2944. typography: {
  2945. fontSize: true,
  2946. __experimentalFontFamily: true
  2947. },
  2948. reusable: false,
  2949. spacing: {
  2950. __experimentalSkipSerialization: true,
  2951. padding: ['horizontal', 'vertical'],
  2952. __experimentalDefaultControls: {
  2953. padding: true
  2954. }
  2955. },
  2956. __experimentalBorder: {
  2957. radius: true,
  2958. __experimentalSkipSerialization: true
  2959. },
  2960. __experimentalSelector: '.wp-block-button__link'
  2961. },
  2962. save(_ref) {
  2963. var _style$border, _style$typography;
  2964. let {
  2965. attributes,
  2966. className
  2967. } = _ref;
  2968. const {
  2969. fontSize,
  2970. linkTarget,
  2971. rel,
  2972. style,
  2973. text,
  2974. title,
  2975. url,
  2976. width
  2977. } = attributes;
  2978. if (!text) {
  2979. return null;
  2980. }
  2981. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  2982. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  2983. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  2984. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  2985. // For backwards compatibility add style that isn't provided via
  2986. // block support.
  2987. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  2988. });
  2989. const buttonStyle = { ...borderProps.style,
  2990. ...colorProps.style,
  2991. ...spacingProps.style
  2992. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  2993. // if it had already been assigned, for the sake of backward-compatibility.
  2994. // A title will no longer be assigned for new or updated button block links.
  2995. const wrapperClasses = classnames_default()(className, {
  2996. [`has-custom-width wp-block-button__width-${width}`]: width,
  2997. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  2998. });
  2999. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3000. className: wrapperClasses
  3001. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3002. tagName: "a",
  3003. className: buttonClasses,
  3004. href: url,
  3005. title: title,
  3006. style: buttonStyle,
  3007. value: text,
  3008. target: linkTarget,
  3009. rel: rel
  3010. }));
  3011. },
  3012. migrate: migrate_font_family,
  3013. isEligible(_ref2) {
  3014. var _style$typography2;
  3015. let {
  3016. style
  3017. } = _ref2;
  3018. return style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontFamily;
  3019. }
  3020. };
  3021. const deprecated_deprecated = [v10, {
  3022. supports: {
  3023. anchor: true,
  3024. align: true,
  3025. alignWide: false,
  3026. color: {
  3027. __experimentalSkipSerialization: true,
  3028. gradients: true
  3029. },
  3030. typography: {
  3031. fontSize: true,
  3032. __experimentalFontFamily: true
  3033. },
  3034. reusable: false,
  3035. __experimentalSelector: '.wp-block-button__link'
  3036. },
  3037. attributes: { ...blockAttributes,
  3038. linkTarget: {
  3039. type: 'string',
  3040. source: 'attribute',
  3041. selector: 'a',
  3042. attribute: 'target'
  3043. },
  3044. rel: {
  3045. type: 'string',
  3046. source: 'attribute',
  3047. selector: 'a',
  3048. attribute: 'rel'
  3049. },
  3050. placeholder: {
  3051. type: 'string'
  3052. },
  3053. backgroundColor: {
  3054. type: 'string'
  3055. },
  3056. textColor: {
  3057. type: 'string'
  3058. },
  3059. gradient: {
  3060. type: 'string'
  3061. },
  3062. width: {
  3063. type: 'number'
  3064. }
  3065. },
  3066. isEligible(_ref3) {
  3067. var _style$border2;
  3068. let {
  3069. style
  3070. } = _ref3;
  3071. return typeof (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.radius) === 'number';
  3072. },
  3073. save(_ref4) {
  3074. var _style$border3, _style$border4, _style$typography3;
  3075. let {
  3076. attributes,
  3077. className
  3078. } = _ref4;
  3079. const {
  3080. fontSize,
  3081. linkTarget,
  3082. rel,
  3083. style,
  3084. text,
  3085. title,
  3086. url,
  3087. width
  3088. } = attributes;
  3089. if (!text) {
  3090. return null;
  3091. }
  3092. const borderRadius = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.radius;
  3093. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3094. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3095. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : _style$border4.radius) === 0
  3096. });
  3097. const buttonStyle = {
  3098. borderRadius: borderRadius ? borderRadius : undefined,
  3099. ...colorProps.style
  3100. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3101. // if it had already been assigned, for the sake of backward-compatibility.
  3102. // A title will no longer be assigned for new or updated button block links.
  3103. const wrapperClasses = classnames_default()(className, {
  3104. [`has-custom-width wp-block-button__width-${width}`]: width,
  3105. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography3 = style.typography) === null || _style$typography3 === void 0 ? void 0 : _style$typography3.fontSize)
  3106. });
  3107. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3108. className: wrapperClasses
  3109. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3110. tagName: "a",
  3111. className: buttonClasses,
  3112. href: url,
  3113. title: title,
  3114. style: buttonStyle,
  3115. value: text,
  3116. target: linkTarget,
  3117. rel: rel
  3118. }));
  3119. },
  3120. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3121. }, {
  3122. supports: {
  3123. anchor: true,
  3124. align: true,
  3125. alignWide: false,
  3126. color: {
  3127. __experimentalSkipSerialization: true
  3128. },
  3129. reusable: false,
  3130. __experimentalSelector: '.wp-block-button__link'
  3131. },
  3132. attributes: { ...blockAttributes,
  3133. linkTarget: {
  3134. type: 'string',
  3135. source: 'attribute',
  3136. selector: 'a',
  3137. attribute: 'target'
  3138. },
  3139. rel: {
  3140. type: 'string',
  3141. source: 'attribute',
  3142. selector: 'a',
  3143. attribute: 'rel'
  3144. },
  3145. placeholder: {
  3146. type: 'string'
  3147. },
  3148. borderRadius: {
  3149. type: 'number'
  3150. },
  3151. backgroundColor: {
  3152. type: 'string'
  3153. },
  3154. textColor: {
  3155. type: 'string'
  3156. },
  3157. gradient: {
  3158. type: 'string'
  3159. },
  3160. style: {
  3161. type: 'object'
  3162. },
  3163. width: {
  3164. type: 'number'
  3165. }
  3166. },
  3167. save(_ref5) {
  3168. let {
  3169. attributes,
  3170. className
  3171. } = _ref5;
  3172. const {
  3173. borderRadius,
  3174. linkTarget,
  3175. rel,
  3176. text,
  3177. title,
  3178. url,
  3179. width
  3180. } = attributes;
  3181. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3182. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3183. 'no-border-radius': borderRadius === 0
  3184. });
  3185. const buttonStyle = {
  3186. borderRadius: borderRadius ? borderRadius + 'px' : undefined,
  3187. ...colorProps.style
  3188. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3189. // if it had already been assigned, for the sake of backward-compatibility.
  3190. // A title will no longer be assigned for new or updated button block links.
  3191. const wrapperClasses = classnames_default()(className, {
  3192. [`has-custom-width wp-block-button__width-${width}`]: width
  3193. });
  3194. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3195. className: wrapperClasses
  3196. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3197. tagName: "a",
  3198. className: buttonClasses,
  3199. href: url,
  3200. title: title,
  3201. style: buttonStyle,
  3202. value: text,
  3203. target: linkTarget,
  3204. rel: rel
  3205. }));
  3206. },
  3207. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3208. }, {
  3209. supports: {
  3210. anchor: true,
  3211. align: true,
  3212. alignWide: false,
  3213. color: {
  3214. __experimentalSkipSerialization: true
  3215. },
  3216. reusable: false,
  3217. __experimentalSelector: '.wp-block-button__link'
  3218. },
  3219. attributes: { ...blockAttributes,
  3220. linkTarget: {
  3221. type: 'string',
  3222. source: 'attribute',
  3223. selector: 'a',
  3224. attribute: 'target'
  3225. },
  3226. rel: {
  3227. type: 'string',
  3228. source: 'attribute',
  3229. selector: 'a',
  3230. attribute: 'rel'
  3231. },
  3232. placeholder: {
  3233. type: 'string'
  3234. },
  3235. borderRadius: {
  3236. type: 'number'
  3237. },
  3238. backgroundColor: {
  3239. type: 'string'
  3240. },
  3241. textColor: {
  3242. type: 'string'
  3243. },
  3244. gradient: {
  3245. type: 'string'
  3246. },
  3247. style: {
  3248. type: 'object'
  3249. },
  3250. width: {
  3251. type: 'number'
  3252. }
  3253. },
  3254. save(_ref6) {
  3255. let {
  3256. attributes,
  3257. className
  3258. } = _ref6;
  3259. const {
  3260. borderRadius,
  3261. linkTarget,
  3262. rel,
  3263. text,
  3264. title,
  3265. url,
  3266. width
  3267. } = attributes;
  3268. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3269. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, {
  3270. 'no-border-radius': borderRadius === 0
  3271. });
  3272. const buttonStyle = {
  3273. borderRadius: borderRadius ? borderRadius + 'px' : undefined,
  3274. ...colorProps.style
  3275. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3276. // if it had already been assigned, for the sake of backward-compatibility.
  3277. // A title will no longer be assigned for new or updated button block links.
  3278. const wrapperClasses = classnames_default()(className, {
  3279. [`has-custom-width wp-block-button__width-${width}`]: width
  3280. });
  3281. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3282. className: wrapperClasses
  3283. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3284. tagName: "a",
  3285. className: buttonClasses,
  3286. href: url,
  3287. title: title,
  3288. style: buttonStyle,
  3289. value: text,
  3290. target: linkTarget,
  3291. rel: rel
  3292. }));
  3293. },
  3294. migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
  3295. }, {
  3296. supports: {
  3297. align: true,
  3298. alignWide: false,
  3299. color: {
  3300. gradients: true
  3301. }
  3302. },
  3303. attributes: { ...blockAttributes,
  3304. linkTarget: {
  3305. type: 'string',
  3306. source: 'attribute',
  3307. selector: 'a',
  3308. attribute: 'target'
  3309. },
  3310. rel: {
  3311. type: 'string',
  3312. source: 'attribute',
  3313. selector: 'a',
  3314. attribute: 'rel'
  3315. },
  3316. placeholder: {
  3317. type: 'string'
  3318. },
  3319. borderRadius: {
  3320. type: 'number'
  3321. },
  3322. backgroundColor: {
  3323. type: 'string'
  3324. },
  3325. textColor: {
  3326. type: 'string'
  3327. },
  3328. gradient: {
  3329. type: 'string'
  3330. },
  3331. style: {
  3332. type: 'object'
  3333. }
  3334. },
  3335. save(_ref7) {
  3336. let {
  3337. attributes
  3338. } = _ref7;
  3339. const {
  3340. borderRadius,
  3341. linkTarget,
  3342. rel,
  3343. text,
  3344. title,
  3345. url
  3346. } = attributes;
  3347. const buttonClasses = classnames_default()('wp-block-button__link', {
  3348. 'no-border-radius': borderRadius === 0
  3349. });
  3350. const buttonStyle = {
  3351. borderRadius: borderRadius ? borderRadius + 'px' : undefined
  3352. };
  3353. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3354. tagName: "a",
  3355. className: buttonClasses,
  3356. href: url,
  3357. title: title,
  3358. style: buttonStyle,
  3359. value: text,
  3360. target: linkTarget,
  3361. rel: rel
  3362. });
  3363. },
  3364. migrate: migrateBorderRadius
  3365. }, {
  3366. supports: {
  3367. align: true,
  3368. alignWide: false
  3369. },
  3370. attributes: { ...blockAttributes,
  3371. linkTarget: {
  3372. type: 'string',
  3373. source: 'attribute',
  3374. selector: 'a',
  3375. attribute: 'target'
  3376. },
  3377. rel: {
  3378. type: 'string',
  3379. source: 'attribute',
  3380. selector: 'a',
  3381. attribute: 'rel'
  3382. },
  3383. placeholder: {
  3384. type: 'string'
  3385. },
  3386. borderRadius: {
  3387. type: 'number'
  3388. },
  3389. backgroundColor: {
  3390. type: 'string'
  3391. },
  3392. textColor: {
  3393. type: 'string'
  3394. },
  3395. customBackgroundColor: {
  3396. type: 'string'
  3397. },
  3398. customTextColor: {
  3399. type: 'string'
  3400. },
  3401. customGradient: {
  3402. type: 'string'
  3403. },
  3404. gradient: {
  3405. type: 'string'
  3406. }
  3407. },
  3408. isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient,
  3409. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients),
  3410. save(_ref8) {
  3411. let {
  3412. attributes
  3413. } = _ref8;
  3414. const {
  3415. backgroundColor,
  3416. borderRadius,
  3417. customBackgroundColor,
  3418. customTextColor,
  3419. customGradient,
  3420. linkTarget,
  3421. gradient,
  3422. rel,
  3423. text,
  3424. textColor,
  3425. title,
  3426. url
  3427. } = attributes;
  3428. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  3429. const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  3430. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  3431. const buttonClasses = classnames_default()('wp-block-button__link', {
  3432. 'has-text-color': textColor || customTextColor,
  3433. [textClass]: textClass,
  3434. 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient,
  3435. [backgroundClass]: backgroundClass,
  3436. 'no-border-radius': borderRadius === 0,
  3437. [gradientClass]: gradientClass
  3438. });
  3439. const buttonStyle = {
  3440. background: customGradient ? customGradient : undefined,
  3441. backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor,
  3442. color: textClass ? undefined : customTextColor,
  3443. borderRadius: borderRadius ? borderRadius + 'px' : undefined
  3444. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3445. // if it had already been assigned, for the sake of backward-compatibility.
  3446. // A title will no longer be assigned for new or updated button block links.
  3447. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3448. tagName: "a",
  3449. className: buttonClasses,
  3450. href: url,
  3451. title: title,
  3452. style: buttonStyle,
  3453. value: text,
  3454. target: linkTarget,
  3455. rel: rel
  3456. }));
  3457. }
  3458. }, {
  3459. attributes: { ...blockAttributes,
  3460. align: {
  3461. type: 'string',
  3462. default: 'none'
  3463. },
  3464. backgroundColor: {
  3465. type: 'string'
  3466. },
  3467. textColor: {
  3468. type: 'string'
  3469. },
  3470. customBackgroundColor: {
  3471. type: 'string'
  3472. },
  3473. customTextColor: {
  3474. type: 'string'
  3475. },
  3476. linkTarget: {
  3477. type: 'string',
  3478. source: 'attribute',
  3479. selector: 'a',
  3480. attribute: 'target'
  3481. },
  3482. rel: {
  3483. type: 'string',
  3484. source: 'attribute',
  3485. selector: 'a',
  3486. attribute: 'rel'
  3487. },
  3488. placeholder: {
  3489. type: 'string'
  3490. }
  3491. },
  3492. isEligible(attribute) {
  3493. return attribute.className && attribute.className.includes('is-style-squared');
  3494. },
  3495. migrate(attributes) {
  3496. let newClassName = attributes.className;
  3497. if (newClassName) {
  3498. newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim();
  3499. }
  3500. return migrateBorderRadius(migrateCustomColorsAndGradients({ ...attributes,
  3501. className: newClassName ? newClassName : undefined,
  3502. borderRadius: 0
  3503. }));
  3504. },
  3505. save(_ref9) {
  3506. let {
  3507. attributes
  3508. } = _ref9;
  3509. const {
  3510. backgroundColor,
  3511. customBackgroundColor,
  3512. customTextColor,
  3513. linkTarget,
  3514. rel,
  3515. text,
  3516. textColor,
  3517. title,
  3518. url
  3519. } = attributes;
  3520. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  3521. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  3522. const buttonClasses = classnames_default()('wp-block-button__link', {
  3523. 'has-text-color': textColor || customTextColor,
  3524. [textClass]: textClass,
  3525. 'has-background': backgroundColor || customBackgroundColor,
  3526. [backgroundClass]: backgroundClass
  3527. });
  3528. const buttonStyle = {
  3529. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  3530. color: textClass ? undefined : customTextColor
  3531. };
  3532. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3533. tagName: "a",
  3534. className: buttonClasses,
  3535. href: url,
  3536. title: title,
  3537. style: buttonStyle,
  3538. value: text,
  3539. target: linkTarget,
  3540. rel: rel
  3541. }));
  3542. }
  3543. }, {
  3544. attributes: { ...blockAttributes,
  3545. align: {
  3546. type: 'string',
  3547. default: 'none'
  3548. },
  3549. backgroundColor: {
  3550. type: 'string'
  3551. },
  3552. textColor: {
  3553. type: 'string'
  3554. },
  3555. customBackgroundColor: {
  3556. type: 'string'
  3557. },
  3558. customTextColor: {
  3559. type: 'string'
  3560. }
  3561. },
  3562. migrate: oldColorsMigration,
  3563. save(_ref10) {
  3564. let {
  3565. attributes
  3566. } = _ref10;
  3567. const {
  3568. url,
  3569. text,
  3570. title,
  3571. backgroundColor,
  3572. textColor,
  3573. customBackgroundColor,
  3574. customTextColor
  3575. } = attributes;
  3576. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  3577. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  3578. const buttonClasses = classnames_default()('wp-block-button__link', {
  3579. 'has-text-color': textColor || customTextColor,
  3580. [textClass]: textClass,
  3581. 'has-background': backgroundColor || customBackgroundColor,
  3582. [backgroundClass]: backgroundClass
  3583. });
  3584. const buttonStyle = {
  3585. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  3586. color: textClass ? undefined : customTextColor
  3587. };
  3588. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3589. tagName: "a",
  3590. className: buttonClasses,
  3591. href: url,
  3592. title: title,
  3593. style: buttonStyle,
  3594. value: text
  3595. }));
  3596. }
  3597. }, {
  3598. attributes: { ...blockAttributes,
  3599. color: {
  3600. type: 'string'
  3601. },
  3602. textColor: {
  3603. type: 'string'
  3604. },
  3605. align: {
  3606. type: 'string',
  3607. default: 'none'
  3608. }
  3609. },
  3610. save(_ref11) {
  3611. let {
  3612. attributes
  3613. } = _ref11;
  3614. const {
  3615. url,
  3616. text,
  3617. title,
  3618. align,
  3619. color,
  3620. textColor
  3621. } = attributes;
  3622. const buttonStyle = {
  3623. backgroundColor: color,
  3624. color: textColor
  3625. };
  3626. const linkClass = 'wp-block-button__link';
  3627. return (0,external_wp_element_namespaceObject.createElement)("div", {
  3628. className: `align${align}`
  3629. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3630. tagName: "a",
  3631. className: linkClass,
  3632. href: url,
  3633. title: title,
  3634. style: buttonStyle,
  3635. value: text
  3636. }));
  3637. },
  3638. migrate: oldColorsMigration
  3639. }, {
  3640. attributes: { ...blockAttributes,
  3641. color: {
  3642. type: 'string'
  3643. },
  3644. textColor: {
  3645. type: 'string'
  3646. },
  3647. align: {
  3648. type: 'string',
  3649. default: 'none'
  3650. }
  3651. },
  3652. save(_ref12) {
  3653. let {
  3654. attributes
  3655. } = _ref12;
  3656. const {
  3657. url,
  3658. text,
  3659. title,
  3660. align,
  3661. color,
  3662. textColor
  3663. } = attributes;
  3664. return (0,external_wp_element_namespaceObject.createElement)("div", {
  3665. className: `align${align}`,
  3666. style: {
  3667. backgroundColor: color
  3668. }
  3669. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3670. tagName: "a",
  3671. href: url,
  3672. title: title,
  3673. style: {
  3674. color: textColor
  3675. },
  3676. value: text
  3677. }));
  3678. },
  3679. migrate: oldColorsMigration
  3680. }];
  3681. /* harmony default export */ var button_deprecated = (deprecated_deprecated);
  3682. ;// CONCATENATED MODULE: external ["wp","keycodes"]
  3683. var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
  3684. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
  3685. /**
  3686. * WordPress dependencies
  3687. */
  3688. const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3689. xmlns: "http://www.w3.org/2000/svg",
  3690. viewBox: "0 0 24 24"
  3691. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3692. d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
  3693. }));
  3694. /* harmony default export */ var library_link = (link_link);
  3695. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
  3696. /**
  3697. * WordPress dependencies
  3698. */
  3699. const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  3700. xmlns: "http://www.w3.org/2000/svg",
  3701. viewBox: "0 0 24 24"
  3702. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  3703. d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
  3704. }));
  3705. /* harmony default export */ var link_off = (linkOff);
  3706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js
  3707. /**
  3708. * External dependencies
  3709. */
  3710. /**
  3711. * WordPress dependencies
  3712. */
  3713. const NEW_TAB_REL = 'noreferrer noopener';
  3714. function WidthPanel(_ref) {
  3715. let {
  3716. selectedWidth,
  3717. setAttributes
  3718. } = _ref;
  3719. function handleChange(newWidth) {
  3720. // Check if we are toggling the width off
  3721. const width = selectedWidth === newWidth ? undefined : newWidth; // Update attributes.
  3722. setAttributes({
  3723. width
  3724. });
  3725. }
  3726. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  3727. title: (0,external_wp_i18n_namespaceObject.__)('Width settings')
  3728. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  3729. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button width')
  3730. }, [25, 50, 75, 100].map(widthValue => {
  3731. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  3732. key: widthValue,
  3733. isSmall: true,
  3734. variant: widthValue === selectedWidth ? 'primary' : undefined,
  3735. onClick: () => handleChange(widthValue)
  3736. }, widthValue, "%");
  3737. })));
  3738. }
  3739. function ButtonEdit(props) {
  3740. var _style$border;
  3741. const {
  3742. attributes,
  3743. setAttributes,
  3744. className,
  3745. isSelected,
  3746. onReplace,
  3747. mergeBlocks
  3748. } = props;
  3749. const {
  3750. linkTarget,
  3751. placeholder,
  3752. rel,
  3753. style,
  3754. text,
  3755. url,
  3756. width
  3757. } = attributes;
  3758. const onSetLinkRel = (0,external_wp_element_namespaceObject.useCallback)(value => {
  3759. setAttributes({
  3760. rel: value
  3761. });
  3762. }, [setAttributes]);
  3763. function onToggleOpenInNewTab(value) {
  3764. const newLinkTarget = value ? '_blank' : undefined;
  3765. let updatedRel = rel;
  3766. if (newLinkTarget && !rel) {
  3767. updatedRel = NEW_TAB_REL;
  3768. } else if (!newLinkTarget && rel === NEW_TAB_REL) {
  3769. updatedRel = undefined;
  3770. }
  3771. setAttributes({
  3772. linkTarget: newLinkTarget,
  3773. rel: updatedRel
  3774. });
  3775. }
  3776. function setButtonText(newText) {
  3777. // Remove anchor tags from button text content.
  3778. setAttributes({
  3779. text: newText.replace(/<\/?a[^>]*>/g, '')
  3780. });
  3781. }
  3782. function onKeyDown(event) {
  3783. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
  3784. startEditing(event);
  3785. } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) {
  3786. var _richTextRef$current;
  3787. unlink();
  3788. (_richTextRef$current = richTextRef.current) === null || _richTextRef$current === void 0 ? void 0 : _richTextRef$current.focus();
  3789. }
  3790. }
  3791. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  3792. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  3793. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  3794. const ref = (0,external_wp_element_namespaceObject.useRef)();
  3795. const richTextRef = (0,external_wp_element_namespaceObject.useRef)();
  3796. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  3797. ref,
  3798. onKeyDown
  3799. });
  3800. const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
  3801. const isURLSet = !!url;
  3802. const opensInNewTab = linkTarget === '_blank';
  3803. function startEditing(event) {
  3804. event.preventDefault();
  3805. setIsEditingURL(true);
  3806. }
  3807. function unlink() {
  3808. setAttributes({
  3809. url: undefined,
  3810. linkTarget: undefined,
  3811. rel: undefined
  3812. });
  3813. setIsEditingURL(false);
  3814. }
  3815. (0,external_wp_element_namespaceObject.useEffect)(() => {
  3816. if (!isSelected) {
  3817. setIsEditingURL(false);
  3818. }
  3819. }, [isSelected]);
  3820. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  3821. className: classnames_default()(blockProps.className, {
  3822. [`has-custom-width wp-block-button__width-${width}`]: width,
  3823. [`has-custom-font-size`]: blockProps.style.fontSize
  3824. })
  3825. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  3826. ref: richTextRef,
  3827. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
  3828. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'),
  3829. value: text,
  3830. onChange: value => setButtonText(value),
  3831. withoutInteractiveFormatting: true,
  3832. className: classnames_default()(className, 'wp-block-button__link', colorProps.className, borderProps.className, {
  3833. // For backwards compatibility add style that isn't
  3834. // provided via block support.
  3835. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  3836. }),
  3837. style: { ...borderProps.style,
  3838. ...colorProps.style,
  3839. ...spacingProps.style
  3840. },
  3841. onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { ...attributes,
  3842. text: value
  3843. }),
  3844. onReplace: onReplace,
  3845. onMerge: mergeBlocks,
  3846. identifier: "text"
  3847. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  3848. group: "block"
  3849. }, !isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  3850. name: "link",
  3851. icon: library_link,
  3852. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  3853. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  3854. onClick: startEditing
  3855. }), isURLSet && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  3856. name: "link",
  3857. icon: link_off,
  3858. title: (0,external_wp_i18n_namespaceObject.__)('Unlink'),
  3859. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'),
  3860. onClick: unlink,
  3861. isActive: true
  3862. })), isSelected && (isEditingURL || isURLSet) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  3863. position: "bottom center",
  3864. onClose: () => {
  3865. var _richTextRef$current2;
  3866. setIsEditingURL(false);
  3867. (_richTextRef$current2 = richTextRef.current) === null || _richTextRef$current2 === void 0 ? void 0 : _richTextRef$current2.focus();
  3868. },
  3869. anchorRef: ref === null || ref === void 0 ? void 0 : ref.current,
  3870. focusOnMount: isEditingURL ? 'firstElement' : false,
  3871. __unstableSlotName: '__unstable-block-tools-after'
  3872. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  3873. className: "wp-block-navigation-link__inline-link-input",
  3874. value: {
  3875. url,
  3876. opensInNewTab
  3877. },
  3878. onChange: _ref2 => {
  3879. let {
  3880. url: newURL = '',
  3881. opensInNewTab: newOpensInNewTab
  3882. } = _ref2;
  3883. setAttributes({
  3884. url: newURL
  3885. });
  3886. if (opensInNewTab !== newOpensInNewTab) {
  3887. onToggleOpenInNewTab(newOpensInNewTab);
  3888. }
  3889. },
  3890. onRemove: () => {
  3891. var _richTextRef$current3;
  3892. unlink();
  3893. (_richTextRef$current3 = richTextRef.current) === null || _richTextRef$current3 === void 0 ? void 0 : _richTextRef$current3.focus();
  3894. },
  3895. forceIsEditingLink: isEditingURL
  3896. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(WidthPanel, {
  3897. selectedWidth: width,
  3898. setAttributes: setAttributes
  3899. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  3900. __experimentalGroup: "advanced"
  3901. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  3902. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  3903. value: rel || '',
  3904. onChange: onSetLinkRel
  3905. })));
  3906. }
  3907. /* harmony default export */ var button_edit = (ButtonEdit);
  3908. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/save.js
  3909. /**
  3910. * External dependencies
  3911. */
  3912. /**
  3913. * WordPress dependencies
  3914. */
  3915. function save_save(_ref) {
  3916. var _style$border, _style$typography;
  3917. let {
  3918. attributes,
  3919. className
  3920. } = _ref;
  3921. const {
  3922. fontSize,
  3923. linkTarget,
  3924. rel,
  3925. style,
  3926. text,
  3927. title,
  3928. url,
  3929. width
  3930. } = attributes;
  3931. if (!text) {
  3932. return null;
  3933. }
  3934. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  3935. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  3936. const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  3937. const buttonClasses = classnames_default()('wp-block-button__link', colorProps.className, borderProps.className, {
  3938. // For backwards compatibility add style that isn't provided via
  3939. // block support.
  3940. 'no-border-radius': (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius) === 0
  3941. });
  3942. const buttonStyle = { ...borderProps.style,
  3943. ...colorProps.style,
  3944. ...spacingProps.style
  3945. }; // The use of a `title` attribute here is soft-deprecated, but still applied
  3946. // if it had already been assigned, for the sake of backward-compatibility.
  3947. // A title will no longer be assigned for new or updated button block links.
  3948. const wrapperClasses = classnames_default()(className, {
  3949. [`has-custom-width wp-block-button__width-${width}`]: width,
  3950. [`has-custom-font-size`]: fontSize || (style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize)
  3951. });
  3952. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  3953. className: wrapperClasses
  3954. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  3955. tagName: "a",
  3956. className: buttonClasses,
  3957. href: url,
  3958. title: title,
  3959. style: buttonStyle,
  3960. value: text,
  3961. target: linkTarget,
  3962. rel: rel
  3963. }));
  3964. }
  3965. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/index.js
  3966. /**
  3967. * WordPress dependencies
  3968. */
  3969. /**
  3970. * Internal dependencies
  3971. */
  3972. const button_metadata = {
  3973. $schema: "https://schemas.wp.org/trunk/block.json",
  3974. apiVersion: 2,
  3975. name: "core/button",
  3976. title: "Button",
  3977. category: "design",
  3978. parent: ["core/buttons"],
  3979. description: "Prompt visitors to take action with a button-style link.",
  3980. keywords: ["link"],
  3981. textdomain: "default",
  3982. attributes: {
  3983. url: {
  3984. type: "string",
  3985. source: "attribute",
  3986. selector: "a",
  3987. attribute: "href"
  3988. },
  3989. title: {
  3990. type: "string",
  3991. source: "attribute",
  3992. selector: "a",
  3993. attribute: "title"
  3994. },
  3995. text: {
  3996. type: "string",
  3997. source: "html",
  3998. selector: "a"
  3999. },
  4000. linkTarget: {
  4001. type: "string",
  4002. source: "attribute",
  4003. selector: "a",
  4004. attribute: "target"
  4005. },
  4006. rel: {
  4007. type: "string",
  4008. source: "attribute",
  4009. selector: "a",
  4010. attribute: "rel"
  4011. },
  4012. placeholder: {
  4013. type: "string"
  4014. },
  4015. backgroundColor: {
  4016. type: "string"
  4017. },
  4018. textColor: {
  4019. type: "string"
  4020. },
  4021. gradient: {
  4022. type: "string"
  4023. },
  4024. width: {
  4025. type: "number"
  4026. }
  4027. },
  4028. supports: {
  4029. anchor: true,
  4030. align: true,
  4031. alignWide: false,
  4032. color: {
  4033. __experimentalSkipSerialization: true,
  4034. gradients: true,
  4035. __experimentalDefaultControls: {
  4036. background: true,
  4037. text: true
  4038. }
  4039. },
  4040. typography: {
  4041. fontSize: true,
  4042. __experimentalFontFamily: true,
  4043. __experimentalDefaultControls: {
  4044. fontSize: true
  4045. }
  4046. },
  4047. reusable: false,
  4048. spacing: {
  4049. __experimentalSkipSerialization: true,
  4050. padding: ["horizontal", "vertical"],
  4051. __experimentalDefaultControls: {
  4052. padding: true
  4053. }
  4054. },
  4055. __experimentalBorder: {
  4056. radius: true,
  4057. __experimentalSkipSerialization: true,
  4058. __experimentalDefaultControls: {
  4059. radius: true
  4060. }
  4061. },
  4062. __experimentalSelector: ".wp-block-button__link"
  4063. },
  4064. styles: [{
  4065. name: "fill",
  4066. label: "Fill",
  4067. isDefault: true
  4068. }, {
  4069. name: "outline",
  4070. label: "Outline"
  4071. }],
  4072. editorStyle: "wp-block-button-editor",
  4073. style: "wp-block-button"
  4074. };
  4075. const {
  4076. name: button_name
  4077. } = button_metadata;
  4078. const button_settings = {
  4079. icon: library_button,
  4080. example: {
  4081. attributes: {
  4082. className: 'is-style-fill',
  4083. text: (0,external_wp_i18n_namespaceObject.__)('Call to Action')
  4084. }
  4085. },
  4086. edit: button_edit,
  4087. save: save_save,
  4088. deprecated: button_deprecated,
  4089. merge: (a, _ref) => {
  4090. let {
  4091. text = ''
  4092. } = _ref;
  4093. return { ...a,
  4094. text: (a.text || '') + text
  4095. };
  4096. }
  4097. };
  4098. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/buttons.js
  4099. /**
  4100. * WordPress dependencies
  4101. */
  4102. const buttons = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4103. viewBox: "0 0 24 24",
  4104. xmlns: "http://www.w3.org/2000/svg"
  4105. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4106. d: "M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"
  4107. }));
  4108. /* harmony default export */ var library_buttons = (buttons);
  4109. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js
  4110. /**
  4111. * External dependencies
  4112. */
  4113. /**
  4114. * WordPress dependencies
  4115. */
  4116. /**
  4117. * @param {Object} attributes Block's attributes.
  4118. */
  4119. const migrateWithLayout = attributes => {
  4120. if (!!attributes.layout) {
  4121. return attributes;
  4122. }
  4123. const {
  4124. contentJustification,
  4125. orientation,
  4126. ...updatedAttributes
  4127. } = attributes;
  4128. if (contentJustification || orientation) {
  4129. Object.assign(updatedAttributes, {
  4130. layout: {
  4131. type: 'flex',
  4132. ...(contentJustification && {
  4133. justifyContent: contentJustification
  4134. }),
  4135. ...(orientation && {
  4136. orientation
  4137. })
  4138. }
  4139. });
  4140. }
  4141. return updatedAttributes;
  4142. };
  4143. const buttons_deprecated_deprecated = [{
  4144. attributes: {
  4145. contentJustification: {
  4146. type: 'string'
  4147. },
  4148. orientation: {
  4149. type: 'string',
  4150. default: 'horizontal'
  4151. }
  4152. },
  4153. supports: {
  4154. anchor: true,
  4155. align: ['wide', 'full'],
  4156. __experimentalExposeControlsToChildren: true,
  4157. spacing: {
  4158. blockGap: true,
  4159. margin: ['top', 'bottom'],
  4160. __experimentalDefaultControls: {
  4161. blockGap: true
  4162. }
  4163. }
  4164. },
  4165. isEligible: _ref => {
  4166. let {
  4167. contentJustification,
  4168. orientation
  4169. } = _ref;
  4170. return !!contentJustification || !!orientation;
  4171. },
  4172. migrate: migrateWithLayout,
  4173. save(_ref2) {
  4174. let {
  4175. attributes: {
  4176. contentJustification,
  4177. orientation
  4178. }
  4179. } = _ref2;
  4180. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  4181. className: classnames_default()({
  4182. [`is-content-justification-${contentJustification}`]: contentJustification,
  4183. 'is-vertical': orientation === 'vertical'
  4184. })
  4185. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  4186. }
  4187. }, {
  4188. supports: {
  4189. align: ['center', 'left', 'right'],
  4190. anchor: true
  4191. },
  4192. save() {
  4193. return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  4194. },
  4195. isEligible(_ref3) {
  4196. let {
  4197. align
  4198. } = _ref3;
  4199. return align && ['center', 'left', 'right'].includes(align);
  4200. },
  4201. migrate(attributes) {
  4202. return migrateWithLayout({ ...attributes,
  4203. align: undefined,
  4204. // Floating Buttons blocks shouldn't have been supported in the
  4205. // first place. Most users using them probably expected them to
  4206. // act like content justification controls, so these blocks are
  4207. // migrated to use content justification.
  4208. // As for center-aligned Buttons blocks, the content justification
  4209. // equivalent will create an identical end result in most cases.
  4210. contentJustification: attributes.align
  4211. });
  4212. }
  4213. }];
  4214. /* harmony default export */ var buttons_deprecated = (buttons_deprecated_deprecated);
  4215. ;// CONCATENATED MODULE: external ["wp","richText"]
  4216. var external_wp_richText_namespaceObject = window["wp"]["richText"];
  4217. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js
  4218. /**
  4219. * WordPress dependencies
  4220. */
  4221. /**
  4222. * Internal dependencies
  4223. */
  4224. const {
  4225. name: transforms_name
  4226. } = {
  4227. $schema: "https://schemas.wp.org/trunk/block.json",
  4228. apiVersion: 2,
  4229. name: "core/buttons",
  4230. title: "Buttons",
  4231. category: "design",
  4232. description: "Prompt visitors to take action with a group of button-style links.",
  4233. keywords: ["link"],
  4234. textdomain: "default",
  4235. supports: {
  4236. anchor: true,
  4237. align: ["wide", "full"],
  4238. __experimentalExposeControlsToChildren: true,
  4239. spacing: {
  4240. blockGap: true,
  4241. margin: ["top", "bottom"],
  4242. __experimentalDefaultControls: {
  4243. blockGap: true
  4244. }
  4245. },
  4246. __experimentalLayout: {
  4247. allowSwitching: false,
  4248. allowInheriting: false,
  4249. "default": {
  4250. type: "flex"
  4251. }
  4252. }
  4253. },
  4254. editorStyle: "wp-block-buttons-editor",
  4255. style: "wp-block-buttons"
  4256. };
  4257. const transforms_transforms = {
  4258. from: [{
  4259. type: 'block',
  4260. isMultiBlock: true,
  4261. blocks: ['core/button'],
  4262. transform: buttons => // Creates the buttons block.
  4263. (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
  4264. buttons.map(attributes => // Create singular button in the buttons block.
  4265. (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes)))
  4266. }, {
  4267. type: 'block',
  4268. isMultiBlock: true,
  4269. blocks: ['core/paragraph'],
  4270. transform: buttons => // Creates the buttons block.
  4271. (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
  4272. buttons.map(attributes => {
  4273. const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); // Remove any HTML tags.
  4274. const text = element.innerText || ''; // Get first url.
  4275. const link = element.querySelector('a');
  4276. const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block.
  4277. return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', {
  4278. text,
  4279. url
  4280. });
  4281. })),
  4282. isMatch: paragraphs => {
  4283. return paragraphs.every(attributes => {
  4284. const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content);
  4285. const text = element.innerText || '';
  4286. const links = element.querySelectorAll('a');
  4287. return text.length <= 30 && links.length <= 1;
  4288. });
  4289. }
  4290. }]
  4291. };
  4292. /* harmony default export */ var buttons_transforms = (transforms_transforms);
  4293. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/edit.js
  4294. /**
  4295. * WordPress dependencies
  4296. */
  4297. /**
  4298. * Internal dependencies
  4299. */
  4300. const ALLOWED_BLOCKS = [button_name];
  4301. const DEFAULT_BLOCK = {
  4302. name: button_name,
  4303. attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width']
  4304. };
  4305. function ButtonsEdit(_ref) {
  4306. let {
  4307. attributes: {
  4308. layout = {}
  4309. }
  4310. } = _ref;
  4311. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  4312. const preferredStyle = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4313. var _preferredStyleVariat;
  4314. const preferredStyleVariations = select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations;
  4315. return preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat[button_name];
  4316. }, []);
  4317. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  4318. allowedBlocks: ALLOWED_BLOCKS,
  4319. __experimentalDefaultBlock: DEFAULT_BLOCK,
  4320. __experimentalDirectInsert: true,
  4321. template: [[button_name, {
  4322. className: preferredStyle && `is-style-${preferredStyle}`
  4323. }]],
  4324. __experimentalLayout: layout,
  4325. templateInsertUpdatesSelection: true
  4326. });
  4327. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  4328. }
  4329. /* harmony default export */ var buttons_edit = (ButtonsEdit);
  4330. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/save.js
  4331. /**
  4332. * WordPress dependencies
  4333. */
  4334. function buttons_save_save() {
  4335. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save());
  4336. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  4337. }
  4338. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
  4339. /**
  4340. * WordPress dependencies
  4341. */
  4342. /**
  4343. * Internal dependencies
  4344. */
  4345. const buttons_metadata = {
  4346. $schema: "https://schemas.wp.org/trunk/block.json",
  4347. apiVersion: 2,
  4348. name: "core/buttons",
  4349. title: "Buttons",
  4350. category: "design",
  4351. description: "Prompt visitors to take action with a group of button-style links.",
  4352. keywords: ["link"],
  4353. textdomain: "default",
  4354. supports: {
  4355. anchor: true,
  4356. align: ["wide", "full"],
  4357. __experimentalExposeControlsToChildren: true,
  4358. spacing: {
  4359. blockGap: true,
  4360. margin: ["top", "bottom"],
  4361. __experimentalDefaultControls: {
  4362. blockGap: true
  4363. }
  4364. },
  4365. __experimentalLayout: {
  4366. allowSwitching: false,
  4367. allowInheriting: false,
  4368. "default": {
  4369. type: "flex"
  4370. }
  4371. }
  4372. },
  4373. editorStyle: "wp-block-buttons-editor",
  4374. style: "wp-block-buttons"
  4375. };
  4376. const {
  4377. name: buttons_name
  4378. } = buttons_metadata;
  4379. const buttons_settings = {
  4380. icon: library_buttons,
  4381. example: {
  4382. innerBlocks: [{
  4383. name: 'core/button',
  4384. attributes: {
  4385. text: (0,external_wp_i18n_namespaceObject.__)('Find out more')
  4386. }
  4387. }, {
  4388. name: 'core/button',
  4389. attributes: {
  4390. text: (0,external_wp_i18n_namespaceObject.__)('Contact us')
  4391. }
  4392. }]
  4393. },
  4394. deprecated: buttons_deprecated,
  4395. transforms: buttons_transforms,
  4396. edit: buttons_edit,
  4397. save: buttons_save_save
  4398. };
  4399. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js
  4400. /**
  4401. * WordPress dependencies
  4402. */
  4403. const calendar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4404. viewBox: "0 0 24 24",
  4405. xmlns: "http://www.w3.org/2000/svg"
  4406. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4407. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"
  4408. }));
  4409. /* harmony default export */ var library_calendar = (calendar);
  4410. ;// CONCATENATED MODULE: external "moment"
  4411. var external_moment_namespaceObject = window["moment"];
  4412. var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject);
  4413. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/edit.js
  4414. /**
  4415. * External dependencies
  4416. */
  4417. /**
  4418. * WordPress dependencies
  4419. */
  4420. const getYearMonth = memize_default()(date => {
  4421. if (!date) {
  4422. return {};
  4423. }
  4424. const momentDate = external_moment_default()(date);
  4425. return {
  4426. year: momentDate.year(),
  4427. month: momentDate.month() + 1
  4428. };
  4429. });
  4430. function CalendarEdit(_ref) {
  4431. let {
  4432. attributes
  4433. } = _ref;
  4434. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  4435. const {
  4436. date,
  4437. hasPosts,
  4438. hasPostsResolved
  4439. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4440. const {
  4441. getEntityRecords,
  4442. hasFinishedResolution
  4443. } = select(external_wp_coreData_namespaceObject.store);
  4444. const singlePublishedPostQuery = {
  4445. status: 'publish',
  4446. per_page: 1
  4447. };
  4448. const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery);
  4449. const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]);
  4450. let _date; // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  4451. // Blocks can be loaded into a *non-post* block editor.
  4452. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  4453. const editorSelectors = select('core/editor');
  4454. if (editorSelectors) {
  4455. const postType = editorSelectors.getEditedPostAttribute('type'); // Dates are used to overwrite year and month used on the calendar.
  4456. // This overwrite should only happen for 'post' post types.
  4457. // For other post types the calendar always displays the current month.
  4458. if (postType === 'post') {
  4459. _date = editorSelectors.getEditedPostAttribute('date');
  4460. }
  4461. }
  4462. return {
  4463. date: _date,
  4464. hasPostsResolved: postsResolved,
  4465. hasPosts: postsResolved && (posts === null || posts === void 0 ? void 0 : posts.length) === 1
  4466. };
  4467. }, []);
  4468. if (!hasPosts) {
  4469. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  4470. icon: library_calendar,
  4471. label: (0,external_wp_i18n_namespaceObject.__)('Calendar')
  4472. }, !hasPostsResolved ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.')));
  4473. }
  4474. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  4475. block: "core/calendar",
  4476. attributes: { ...attributes,
  4477. ...getYearMonth(date)
  4478. }
  4479. })));
  4480. }
  4481. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js
  4482. /**
  4483. * WordPress dependencies
  4484. */
  4485. const calendar_transforms_transforms = {
  4486. from: [{
  4487. type: 'block',
  4488. blocks: ['core/archives'],
  4489. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar')
  4490. }],
  4491. to: [{
  4492. type: 'block',
  4493. blocks: ['core/archives'],
  4494. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives')
  4495. }]
  4496. };
  4497. /* harmony default export */ var calendar_transforms = (calendar_transforms_transforms);
  4498. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
  4499. /**
  4500. * WordPress dependencies
  4501. */
  4502. /**
  4503. * Internal dependencies
  4504. */
  4505. const calendar_metadata = {
  4506. $schema: "https://schemas.wp.org/trunk/block.json",
  4507. apiVersion: 2,
  4508. name: "core/calendar",
  4509. title: "Calendar",
  4510. category: "widgets",
  4511. description: "A calendar of your site\u2019s posts.",
  4512. keywords: ["posts", "archive"],
  4513. textdomain: "default",
  4514. attributes: {
  4515. month: {
  4516. type: "integer"
  4517. },
  4518. year: {
  4519. type: "integer"
  4520. }
  4521. },
  4522. supports: {
  4523. align: true
  4524. },
  4525. style: "wp-block-calendar"
  4526. };
  4527. const {
  4528. name: calendar_name
  4529. } = calendar_metadata;
  4530. const calendar_settings = {
  4531. icon: library_calendar,
  4532. example: {},
  4533. edit: CalendarEdit,
  4534. transforms: calendar_transforms
  4535. };
  4536. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js
  4537. /**
  4538. * WordPress dependencies
  4539. */
  4540. const category = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4541. viewBox: "0 0 24 24",
  4542. xmlns: "http://www.w3.org/2000/svg"
  4543. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4544. d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
  4545. fillRule: "evenodd",
  4546. clipRule: "evenodd"
  4547. }));
  4548. /* harmony default export */ var library_category = (category);
  4549. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js
  4550. /**
  4551. * WordPress dependencies
  4552. */
  4553. const pin = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4554. xmlns: "http://www.w3.org/2000/svg",
  4555. viewBox: "0 0 24 24"
  4556. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4557. d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"
  4558. }));
  4559. /* harmony default export */ var library_pin = (pin);
  4560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/edit.js
  4561. /**
  4562. * External dependencies
  4563. */
  4564. /**
  4565. * WordPress dependencies
  4566. */
  4567. function CategoriesEdit(_ref) {
  4568. let {
  4569. attributes: {
  4570. displayAsDropdown,
  4571. showHierarchy,
  4572. showPostCounts,
  4573. showOnlyTopLevel
  4574. },
  4575. setAttributes
  4576. } = _ref;
  4577. const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select');
  4578. const query = {
  4579. per_page: -1,
  4580. hide_empty: true,
  4581. context: 'view'
  4582. };
  4583. if (showOnlyTopLevel) {
  4584. query.parent = 0;
  4585. }
  4586. const {
  4587. records: categories,
  4588. isResolving
  4589. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('taxonomy', 'category', query);
  4590. const getCategoriesList = parentId => {
  4591. if (!(categories !== null && categories !== void 0 && categories.length)) {
  4592. return [];
  4593. }
  4594. if (parentId === null) {
  4595. return categories;
  4596. }
  4597. return categories.filter(_ref2 => {
  4598. let {
  4599. parent
  4600. } = _ref2;
  4601. return parent === parentId;
  4602. });
  4603. };
  4604. const getCategoryListClassName = level => {
  4605. return `wp-block-categories__list wp-block-categories__list-level-${level}`;
  4606. };
  4607. const toggleAttribute = attributeName => newValue => setAttributes({
  4608. [attributeName]: newValue
  4609. });
  4610. const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_lodash_namespaceObject.unescape)(name).trim();
  4611. const renderCategoryList = () => {
  4612. const parentId = showHierarchy ? 0 : null;
  4613. const categoriesList = getCategoriesList(parentId);
  4614. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  4615. className: getCategoryListClassName(0)
  4616. }, categoriesList.map(category => renderCategoryListItem(category, 0)));
  4617. };
  4618. const renderCategoryListItem = (category, level) => {
  4619. const childCategories = getCategoriesList(category.id);
  4620. const {
  4621. id,
  4622. link,
  4623. count,
  4624. name
  4625. } = category;
  4626. return (0,external_wp_element_namespaceObject.createElement)("li", {
  4627. key: id
  4628. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  4629. href: link,
  4630. target: "_blank",
  4631. rel: "noreferrer noopener"
  4632. }, renderCategoryName(name)), showPostCounts && (0,external_wp_element_namespaceObject.createElement)("span", {
  4633. className: "wp-block-categories__post-count"
  4634. }, ` (${count})`), showHierarchy && !!childCategories.length && (0,external_wp_element_namespaceObject.createElement)("ul", {
  4635. className: getCategoryListClassName(level + 1)
  4636. }, childCategories.map(childCategory => renderCategoryListItem(childCategory, level + 1))));
  4637. };
  4638. const renderCategoryDropdown = () => {
  4639. const parentId = showHierarchy ? 0 : null;
  4640. const categoriesList = getCategoriesList(parentId);
  4641. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
  4642. as: "label",
  4643. htmlFor: selectId
  4644. }, (0,external_wp_i18n_namespaceObject.__)('Categories')), (0,external_wp_element_namespaceObject.createElement)("select", {
  4645. id: selectId,
  4646. className: "wp-block-categories__dropdown"
  4647. }, categoriesList.map(category => renderCategoryDropdownItem(category, 0))));
  4648. };
  4649. const renderCategoryDropdownItem = (category, level) => {
  4650. const {
  4651. id,
  4652. count,
  4653. name
  4654. } = category;
  4655. const childCategories = getCategoriesList(id);
  4656. return [(0,external_wp_element_namespaceObject.createElement)("option", {
  4657. key: id
  4658. }, (0,external_lodash_namespaceObject.times)(level * 3, () => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
  4659. };
  4660. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  4661. title: (0,external_wp_i18n_namespaceObject.__)('Categories settings')
  4662. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4663. label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'),
  4664. checked: displayAsDropdown,
  4665. onChange: toggleAttribute('displayAsDropdown')
  4666. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4667. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  4668. checked: showPostCounts,
  4669. onChange: toggleAttribute('showPostCounts')
  4670. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4671. label: (0,external_wp_i18n_namespaceObject.__)('Show only top level categories'),
  4672. checked: showOnlyTopLevel,
  4673. onChange: toggleAttribute('showOnlyTopLevel')
  4674. }), !showOnlyTopLevel && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  4675. label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'),
  4676. checked: showHierarchy,
  4677. onChange: toggleAttribute('showHierarchy')
  4678. }))), isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  4679. icon: library_pin,
  4680. label: (0,external_wp_i18n_namespaceObject.__)('Categories')
  4681. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) === 0 && (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Your site does not have any posts, so there is nothing to display here at the moment.')), !isResolving && (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()));
  4682. }
  4683. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/categories/index.js
  4684. /**
  4685. * WordPress dependencies
  4686. */
  4687. /**
  4688. * Internal dependencies
  4689. */
  4690. const categories_metadata = {
  4691. $schema: "https://schemas.wp.org/trunk/block.json",
  4692. apiVersion: 2,
  4693. name: "core/categories",
  4694. title: "Categories",
  4695. category: "widgets",
  4696. description: "Display a list of all categories.",
  4697. textdomain: "default",
  4698. attributes: {
  4699. displayAsDropdown: {
  4700. type: "boolean",
  4701. "default": false
  4702. },
  4703. showHierarchy: {
  4704. type: "boolean",
  4705. "default": false
  4706. },
  4707. showPostCounts: {
  4708. type: "boolean",
  4709. "default": false
  4710. },
  4711. showOnlyTopLevel: {
  4712. type: "boolean",
  4713. "default": false
  4714. }
  4715. },
  4716. supports: {
  4717. align: true,
  4718. html: false
  4719. },
  4720. editorStyle: "wp-block-categories-editor",
  4721. style: "wp-block-categories"
  4722. };
  4723. const {
  4724. name: categories_name
  4725. } = categories_metadata;
  4726. const categories_settings = {
  4727. icon: library_category,
  4728. example: {},
  4729. edit: CategoriesEdit
  4730. };
  4731. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/classic.js
  4732. /**
  4733. * WordPress dependencies
  4734. */
  4735. const classic = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  4736. viewBox: "0 0 24 24",
  4737. xmlns: "http://www.w3.org/2000/svg"
  4738. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  4739. d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"
  4740. }));
  4741. /* harmony default export */ var library_classic = (classic);
  4742. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js
  4743. /**
  4744. * WordPress dependencies
  4745. */
  4746. const ConvertToBlocksButton = _ref => {
  4747. let {
  4748. clientId
  4749. } = _ref;
  4750. const {
  4751. replaceBlocks
  4752. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  4753. const block = (0,external_wp_data_namespaceObject.useSelect)(select => {
  4754. return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
  4755. }, [clientId]);
  4756. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  4757. onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
  4758. HTML: (0,external_wp_blocks_namespaceObject.serialize)(block)
  4759. }))
  4760. }, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks'));
  4761. };
  4762. /* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton);
  4763. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/edit.js
  4764. /**
  4765. * External dependencies
  4766. */
  4767. /**
  4768. * WordPress dependencies
  4769. */
  4770. /**
  4771. * Internal dependencies
  4772. */
  4773. const {
  4774. wp: edit_wp
  4775. } = window;
  4776. function isTmceEmpty(editor) {
  4777. // When tinyMce is empty the content seems to be:
  4778. // <p><br data-mce-bogus="1"></p>
  4779. // avoid expensive checks for large documents
  4780. const body = editor.getBody();
  4781. if (body.childNodes.length > 1) {
  4782. return false;
  4783. } else if (body.childNodes.length === 0) {
  4784. return true;
  4785. }
  4786. if (body.childNodes[0].childNodes.length > 1) {
  4787. return false;
  4788. }
  4789. return /^\n?$/.test(body.innerText || body.textContent);
  4790. }
  4791. function ClassicEdit(_ref) {
  4792. let {
  4793. clientId,
  4794. attributes: {
  4795. content
  4796. },
  4797. setAttributes,
  4798. onReplace
  4799. } = _ref;
  4800. const {
  4801. getMultiSelectedBlockClientIds
  4802. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  4803. const didMount = (0,external_wp_element_namespaceObject.useRef)(false);
  4804. (0,external_wp_element_namespaceObject.useEffect)(() => {
  4805. if (!didMount.current) {
  4806. return;
  4807. }
  4808. const editor = window.tinymce.get(`editor-${clientId}`);
  4809. const currentContent = editor === null || editor === void 0 ? void 0 : editor.getContent();
  4810. if (currentContent !== content) {
  4811. editor.setContent(content || '');
  4812. }
  4813. }, [content]);
  4814. (0,external_wp_element_namespaceObject.useEffect)(() => {
  4815. const {
  4816. baseURL,
  4817. suffix
  4818. } = window.wpEditorL10n.tinymce;
  4819. didMount.current = true;
  4820. window.tinymce.EditorManager.overrideDefaults({
  4821. base_url: baseURL,
  4822. suffix
  4823. });
  4824. function onSetup(editor) {
  4825. let bookmark;
  4826. if (content) {
  4827. editor.on('loadContent', () => editor.setContent(content));
  4828. }
  4829. editor.on('blur', () => {
  4830. var _getMultiSelectedBloc;
  4831. bookmark = editor.selection.getBookmark(2, true); // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451.
  4832. // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking
  4833. // scroll position until this is fixed in core.
  4834. const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
  4835. const scrollPosition = scrollContainer.scrollTop; // Only update attributes if we aren't multi-selecting blocks.
  4836. // Updating during multi-selection can overwrite attributes of other blocks.
  4837. if (!((_getMultiSelectedBloc = getMultiSelectedBlockClientIds()) !== null && _getMultiSelectedBloc !== void 0 && _getMultiSelectedBloc.length)) {
  4838. setAttributes({
  4839. content: editor.getContent()
  4840. });
  4841. }
  4842. editor.once('focus', () => {
  4843. if (bookmark) {
  4844. editor.selection.moveToBookmark(bookmark);
  4845. if (scrollContainer.scrollTop !== scrollPosition) {
  4846. scrollContainer.scrollTop = scrollPosition;
  4847. }
  4848. }
  4849. });
  4850. return false;
  4851. });
  4852. editor.on('mousedown touchstart', () => {
  4853. bookmark = null;
  4854. });
  4855. const debouncedOnChange = (0,external_lodash_namespaceObject.debounce)(() => {
  4856. const value = editor.getContent();
  4857. if (value !== editor._lastChange) {
  4858. editor._lastChange = value;
  4859. setAttributes({
  4860. content: value
  4861. });
  4862. }
  4863. }, 250);
  4864. editor.on('Paste Change input Undo Redo', debouncedOnChange); // We need to cancel the debounce call because when we remove
  4865. // the editor (onUnmount) this callback is executed in
  4866. // another tick. This results in setting the content to empty.
  4867. editor.on('remove', debouncedOnChange.cancel);
  4868. editor.on('keydown', event => {
  4869. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) {
  4870. // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected.
  4871. event.stopPropagation();
  4872. }
  4873. if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) {
  4874. // Delete the block.
  4875. onReplace([]);
  4876. event.preventDefault();
  4877. event.stopImmediatePropagation();
  4878. }
  4879. const {
  4880. altKey
  4881. } = event;
  4882. /*
  4883. * Prevent Mousetrap from kicking in: TinyMCE already uses its own
  4884. * `alt+f10` shortcut to focus its toolbar.
  4885. */
  4886. if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) {
  4887. event.stopPropagation();
  4888. }
  4889. });
  4890. editor.on('init', () => {
  4891. const rootNode = editor.getBody(); // Create the toolbar by refocussing the editor.
  4892. if (rootNode.ownerDocument.activeElement === rootNode) {
  4893. rootNode.blur();
  4894. editor.focus();
  4895. }
  4896. });
  4897. }
  4898. function initialize() {
  4899. const {
  4900. settings
  4901. } = window.wpEditorL10n.tinymce;
  4902. edit_wp.oldEditor.initialize(`editor-${clientId}`, {
  4903. tinymce: { ...settings,
  4904. inline: true,
  4905. content_css: false,
  4906. fixed_toolbar_container: `#toolbar-${clientId}`,
  4907. setup: onSetup
  4908. }
  4909. });
  4910. }
  4911. function onReadyStateChange() {
  4912. if (document.readyState === 'complete') {
  4913. initialize();
  4914. }
  4915. }
  4916. if (document.readyState === 'complete') {
  4917. initialize();
  4918. } else {
  4919. document.addEventListener('readystatechange', onReadyStateChange);
  4920. }
  4921. return () => {
  4922. document.removeEventListener('readystatechange', onReadyStateChange);
  4923. edit_wp.oldEditor.remove(`editor-${clientId}`);
  4924. };
  4925. }, []);
  4926. function focus() {
  4927. const editor = window.tinymce.get(`editor-${clientId}`);
  4928. if (editor) {
  4929. editor.focus();
  4930. }
  4931. }
  4932. function onToolbarKeyDown(event) {
  4933. // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar.
  4934. event.stopPropagation(); // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar.
  4935. event.nativeEvent.stopImmediatePropagation();
  4936. } // Disable reasons:
  4937. //
  4938. // jsx-a11y/no-static-element-interactions
  4939. // - the toolbar itself is non-interactive, but must capture events
  4940. // from the KeyboardShortcuts component to stop their propagation.
  4941. /* eslint-disable jsx-a11y/no-static-element-interactions */
  4942. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(convert_to_blocks_button, {
  4943. clientId: clientId
  4944. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  4945. key: "toolbar",
  4946. id: `toolbar-${clientId}`,
  4947. className: "block-library-classic__toolbar",
  4948. onClick: focus,
  4949. "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'),
  4950. onKeyDown: onToolbarKeyDown
  4951. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  4952. key: "editor",
  4953. id: `editor-${clientId}`,
  4954. className: "wp-block-freeform block-library-rich-text__tinymce"
  4955. })));
  4956. /* eslint-enable jsx-a11y/no-static-element-interactions */
  4957. }
  4958. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/save.js
  4959. /**
  4960. * WordPress dependencies
  4961. */
  4962. function freeform_save_save(_ref) {
  4963. let {
  4964. attributes
  4965. } = _ref;
  4966. const {
  4967. content
  4968. } = attributes;
  4969. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, content);
  4970. }
  4971. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
  4972. /**
  4973. * WordPress dependencies
  4974. */
  4975. /**
  4976. * Internal dependencies
  4977. */
  4978. const freeform_metadata = {
  4979. $schema: "https://schemas.wp.org/trunk/block.json",
  4980. apiVersion: 2,
  4981. name: "core/freeform",
  4982. title: "Classic",
  4983. category: "text",
  4984. description: "Use the classic WordPress editor.",
  4985. textdomain: "default",
  4986. attributes: {
  4987. content: {
  4988. type: "string",
  4989. source: "html"
  4990. }
  4991. },
  4992. supports: {
  4993. className: false,
  4994. customClassName: false,
  4995. reusable: false
  4996. },
  4997. editorStyle: "wp-block-freeform-editor"
  4998. };
  4999. const {
  5000. name: freeform_name
  5001. } = freeform_metadata;
  5002. const freeform_settings = {
  5003. icon: library_classic,
  5004. edit: ClassicEdit,
  5005. save: freeform_save_save
  5006. };
  5007. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
  5008. /**
  5009. * WordPress dependencies
  5010. */
  5011. const code = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5012. viewBox: "0 0 24 24",
  5013. xmlns: "http://www.w3.org/2000/svg"
  5014. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5015. d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
  5016. }));
  5017. /* harmony default export */ var library_code = (code);
  5018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/edit.js
  5019. /**
  5020. * WordPress dependencies
  5021. */
  5022. function CodeEdit(_ref) {
  5023. let {
  5024. attributes,
  5025. setAttributes,
  5026. onRemove
  5027. } = _ref;
  5028. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  5029. return (0,external_wp_element_namespaceObject.createElement)("pre", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  5030. tagName: "code",
  5031. value: attributes.content,
  5032. onChange: content => setAttributes({
  5033. content
  5034. }),
  5035. onRemove: onRemove,
  5036. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'),
  5037. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'),
  5038. preserveWhiteSpace: true,
  5039. __unstablePastePlainText: true
  5040. }));
  5041. }
  5042. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/utils.js
  5043. /**
  5044. * External dependencies
  5045. */
  5046. /**
  5047. * Escapes ampersands, shortcodes, and links.
  5048. *
  5049. * @param {string} content The content of a code block.
  5050. * @return {string} The given content with some characters escaped.
  5051. */
  5052. function utils_escape(content) {
  5053. return (0,external_lodash_namespaceObject.flow)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || '');
  5054. }
  5055. /**
  5056. * Returns the given content with all opening shortcode characters converted
  5057. * into their HTML entity counterpart (i.e. [ => &#91;). For instance, a
  5058. * shortcode like [embed] becomes &#91;embed]
  5059. *
  5060. * This function replicates the escaping of HTML tags, where a tag like
  5061. * <strong> becomes &lt;strong>.
  5062. *
  5063. * @param {string} content The content of a code block.
  5064. * @return {string} The given content with its opening shortcode characters
  5065. * converted into their HTML entity counterpart
  5066. * (i.e. [ => &#91;)
  5067. */
  5068. function escapeOpeningSquareBrackets(content) {
  5069. return content.replace(/\[/g, '&#91;');
  5070. }
  5071. /**
  5072. * Converts the first two forward slashes of any isolated URL into their HTML
  5073. * counterparts (i.e. // => &#47;&#47;). For instance, https://youtube.com/watch?x
  5074. * becomes https:&#47;&#47;youtube.com/watch?x.
  5075. *
  5076. * An isolated URL is a URL that sits in its own line, surrounded only by spacing
  5077. * characters.
  5078. *
  5079. * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403
  5080. *
  5081. * @param {string} content The content of a code block.
  5082. * @return {string} The given content with its ampersands converted into
  5083. * their HTML entity counterpart (i.e. & => &amp;)
  5084. */
  5085. function escapeProtocolInIsolatedUrls(content) {
  5086. return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1&#47;&#47;$2');
  5087. }
  5088. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/save.js
  5089. /**
  5090. * WordPress dependencies
  5091. */
  5092. /**
  5093. * Internal dependencies
  5094. */
  5095. function code_save_save(_ref) {
  5096. let {
  5097. attributes
  5098. } = _ref;
  5099. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  5100. tagName: "code",
  5101. value: utils_escape(attributes.content)
  5102. }));
  5103. }
  5104. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/transforms.js
  5105. /**
  5106. * WordPress dependencies
  5107. */
  5108. const code_transforms_transforms = {
  5109. from: [{
  5110. type: 'enter',
  5111. regExp: /^```$/,
  5112. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code')
  5113. }, {
  5114. type: 'block',
  5115. blocks: ['core/html', 'core/paragraph'],
  5116. transform: _ref => {
  5117. let {
  5118. content
  5119. } = _ref;
  5120. return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', {
  5121. content
  5122. });
  5123. }
  5124. }, {
  5125. type: 'raw',
  5126. isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE',
  5127. schema: {
  5128. pre: {
  5129. children: {
  5130. code: {
  5131. children: {
  5132. '#text': {}
  5133. }
  5134. }
  5135. }
  5136. }
  5137. }
  5138. }]
  5139. };
  5140. /* harmony default export */ var code_transforms = (code_transforms_transforms);
  5141. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/code/index.js
  5142. /**
  5143. * WordPress dependencies
  5144. */
  5145. /**
  5146. * Internal dependencies
  5147. */
  5148. const code_metadata = {
  5149. $schema: "https://schemas.wp.org/trunk/block.json",
  5150. apiVersion: 2,
  5151. name: "core/code",
  5152. title: "Code",
  5153. category: "text",
  5154. description: "Display code snippets that respect your spacing and tabs.",
  5155. textdomain: "default",
  5156. attributes: {
  5157. content: {
  5158. type: "string",
  5159. source: "html",
  5160. selector: "code"
  5161. }
  5162. },
  5163. supports: {
  5164. anchor: true,
  5165. typography: {
  5166. fontSize: true,
  5167. lineHeight: true,
  5168. __experimentalFontStyle: true,
  5169. __experimentalFontWeight: true,
  5170. __experimentalLetterSpacing: true,
  5171. __experimentalTextTransform: true,
  5172. __experimentalDefaultControls: {
  5173. fontSize: true
  5174. }
  5175. },
  5176. spacing: {
  5177. margin: ["top", "bottom"],
  5178. padding: true
  5179. },
  5180. __experimentalBorder: {
  5181. radius: true,
  5182. color: true,
  5183. width: true,
  5184. style: true,
  5185. __experimentalDefaultControls: {
  5186. width: true,
  5187. color: true
  5188. }
  5189. },
  5190. color: {
  5191. text: true,
  5192. background: true,
  5193. gradients: true,
  5194. __experimentalDefaultControls: {
  5195. background: true,
  5196. text: true
  5197. }
  5198. }
  5199. },
  5200. style: "wp-block-code"
  5201. };
  5202. const {
  5203. name: code_name
  5204. } = code_metadata;
  5205. const code_settings = {
  5206. icon: library_code,
  5207. example: {
  5208. attributes: {
  5209. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  5210. // translators: Preserve \n markers for line breaks
  5211. content: (0,external_wp_i18n_namespaceObject.__)('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')
  5212. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  5213. }
  5214. },
  5215. transforms: code_transforms,
  5216. edit: CodeEdit,
  5217. save: code_save_save
  5218. };
  5219. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/column.js
  5220. /**
  5221. * WordPress dependencies
  5222. */
  5223. const column = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5224. xmlns: "http://www.w3.org/2000/svg",
  5225. viewBox: "0 0 24 24"
  5226. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5227. d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"
  5228. }));
  5229. /* harmony default export */ var library_column = (column);
  5230. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/deprecated.js
  5231. /**
  5232. * External dependencies
  5233. */
  5234. /**
  5235. * WordPress dependencies
  5236. */
  5237. const column_deprecated_deprecated = [{
  5238. attributes: {
  5239. verticalAlignment: {
  5240. type: 'string'
  5241. },
  5242. width: {
  5243. type: 'number',
  5244. min: 0,
  5245. max: 100
  5246. }
  5247. },
  5248. isEligible(_ref) {
  5249. let {
  5250. width
  5251. } = _ref;
  5252. return isFinite(width);
  5253. },
  5254. migrate(attributes) {
  5255. return { ...attributes,
  5256. width: `${attributes.width}%`
  5257. };
  5258. },
  5259. save(_ref2) {
  5260. let {
  5261. attributes
  5262. } = _ref2;
  5263. const {
  5264. verticalAlignment,
  5265. width
  5266. } = attributes;
  5267. const wrapperClasses = classnames_default()({
  5268. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5269. });
  5270. const style = {
  5271. flexBasis: width + '%'
  5272. };
  5273. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5274. className: wrapperClasses,
  5275. style: style
  5276. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5277. }
  5278. }];
  5279. /* harmony default export */ var column_deprecated = (column_deprecated_deprecated);
  5280. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/edit.js
  5281. /**
  5282. * External dependencies
  5283. */
  5284. /**
  5285. * WordPress dependencies
  5286. */
  5287. function ColumnEdit(_ref) {
  5288. let {
  5289. attributes: {
  5290. verticalAlignment,
  5291. width,
  5292. templateLock = false,
  5293. allowedBlocks
  5294. },
  5295. setAttributes,
  5296. clientId
  5297. } = _ref;
  5298. const classes = classnames_default()('block-core-columns', {
  5299. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5300. });
  5301. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  5302. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
  5303. });
  5304. const {
  5305. columnsIds,
  5306. hasChildBlocks,
  5307. rootClientId
  5308. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5309. const {
  5310. getBlockOrder,
  5311. getBlockRootClientId
  5312. } = select(external_wp_blockEditor_namespaceObject.store);
  5313. const rootId = getBlockRootClientId(clientId);
  5314. return {
  5315. hasChildBlocks: getBlockOrder(clientId).length > 0,
  5316. rootClientId: rootId,
  5317. columnsIds: getBlockOrder(rootId)
  5318. };
  5319. }, [clientId]);
  5320. const {
  5321. updateBlockAttributes
  5322. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  5323. const updateAlignment = value => {
  5324. // Update own alignment.
  5325. setAttributes({
  5326. verticalAlignment: value
  5327. }); // Reset parent Columns block.
  5328. updateBlockAttributes(rootClientId, {
  5329. verticalAlignment: null
  5330. });
  5331. };
  5332. const widthWithUnit = Number.isFinite(width) ? width + '%' : width;
  5333. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  5334. className: classes,
  5335. style: widthWithUnit ? {
  5336. flexBasis: widthWithUnit
  5337. } : undefined
  5338. });
  5339. const columnsCount = columnsIds.length;
  5340. const currentColumnPosition = columnsIds.indexOf(clientId) + 1;
  5341. const label = (0,external_wp_i18n_namespaceObject.sprintf)(
  5342. /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
  5343. (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount);
  5344. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps,
  5345. 'aria-label': label
  5346. }, {
  5347. templateLock,
  5348. allowedBlocks,
  5349. renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  5350. });
  5351. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
  5352. onChange: updateAlignment,
  5353. value: verticalAlignment
  5354. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  5355. title: (0,external_wp_i18n_namespaceObject.__)('Column settings')
  5356. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  5357. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  5358. labelPosition: "edge",
  5359. __unstableInputWidth: "80px",
  5360. value: width || '',
  5361. onChange: nextWidth => {
  5362. nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
  5363. setAttributes({
  5364. width: nextWidth
  5365. });
  5366. },
  5367. units: units
  5368. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  5369. }
  5370. /* harmony default export */ var column_edit = (ColumnEdit);
  5371. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/save.js
  5372. /**
  5373. * External dependencies
  5374. */
  5375. /**
  5376. * WordPress dependencies
  5377. */
  5378. function column_save_save(_ref) {
  5379. let {
  5380. attributes
  5381. } = _ref;
  5382. const {
  5383. verticalAlignment,
  5384. width
  5385. } = attributes;
  5386. const wrapperClasses = classnames_default()({
  5387. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5388. });
  5389. let style;
  5390. if (width && /\d/.test(width)) {
  5391. // Numbers are handled for backward compatibility as they can be still provided with templates.
  5392. let flexBasis = Number.isFinite(width) ? width + '%' : width; // In some cases we need to round the width to a shorter float.
  5393. if (!Number.isFinite(width) && width !== null && width !== void 0 && width.endsWith('%')) {
  5394. const multiplier = 1000000000000; // Shrink the number back to a reasonable float.
  5395. flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%';
  5396. }
  5397. style = {
  5398. flexBasis
  5399. };
  5400. }
  5401. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  5402. className: wrapperClasses,
  5403. style
  5404. });
  5405. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  5406. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  5407. }
  5408. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/column/index.js
  5409. /**
  5410. * WordPress dependencies
  5411. */
  5412. /**
  5413. * Internal dependencies
  5414. */
  5415. const column_metadata = {
  5416. $schema: "https://schemas.wp.org/trunk/block.json",
  5417. apiVersion: 2,
  5418. name: "core/column",
  5419. title: "Column",
  5420. category: "text",
  5421. parent: ["core/columns"],
  5422. description: "A single column within a columns block.",
  5423. textdomain: "default",
  5424. attributes: {
  5425. verticalAlignment: {
  5426. type: "string"
  5427. },
  5428. width: {
  5429. type: "string"
  5430. },
  5431. allowedBlocks: {
  5432. type: "array"
  5433. },
  5434. templateLock: {
  5435. type: ["string", "boolean"],
  5436. "enum": ["all", "insert", false]
  5437. }
  5438. },
  5439. supports: {
  5440. anchor: true,
  5441. reusable: false,
  5442. html: false,
  5443. color: {
  5444. gradients: true,
  5445. link: true,
  5446. __experimentalDefaultControls: {
  5447. background: true,
  5448. text: true
  5449. }
  5450. },
  5451. spacing: {
  5452. blockGap: true,
  5453. padding: true,
  5454. __experimentalDefaultControls: {
  5455. padding: true
  5456. }
  5457. },
  5458. __experimentalLayout: true
  5459. }
  5460. };
  5461. const {
  5462. name: column_name
  5463. } = column_metadata;
  5464. const column_settings = {
  5465. icon: library_column,
  5466. edit: column_edit,
  5467. save: column_save_save,
  5468. deprecated: column_deprecated
  5469. };
  5470. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/columns.js
  5471. /**
  5472. * WordPress dependencies
  5473. */
  5474. const columns = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  5475. viewBox: "0 0 24 24",
  5476. xmlns: "http://www.w3.org/2000/svg"
  5477. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  5478. d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"
  5479. }));
  5480. /* harmony default export */ var library_columns = (columns);
  5481. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js
  5482. /**
  5483. * External dependencies
  5484. */
  5485. /**
  5486. * WordPress dependencies
  5487. */
  5488. /**
  5489. * Given an HTML string for a deprecated columns inner block, returns the
  5490. * column index to which the migrated inner block should be assigned. Returns
  5491. * undefined if the inner block was not assigned to a column.
  5492. *
  5493. * @param {string} originalContent Deprecated Columns inner block HTML.
  5494. *
  5495. * @return {?number} Column to which inner block is to be assigned.
  5496. */
  5497. function getDeprecatedLayoutColumn(originalContent) {
  5498. let {
  5499. doc
  5500. } = getDeprecatedLayoutColumn;
  5501. if (!doc) {
  5502. doc = document.implementation.createHTMLDocument('');
  5503. getDeprecatedLayoutColumn.doc = doc;
  5504. }
  5505. let columnMatch;
  5506. doc.body.innerHTML = originalContent;
  5507. for (const classListItem of doc.body.firstChild.classList) {
  5508. if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) {
  5509. return Number(columnMatch[1]) - 1;
  5510. }
  5511. }
  5512. }
  5513. const migrateCustomColors = attributes => {
  5514. if (!attributes.customTextColor && !attributes.customBackgroundColor) {
  5515. return attributes;
  5516. }
  5517. const style = {
  5518. color: {}
  5519. };
  5520. if (attributes.customTextColor) {
  5521. style.color.text = attributes.customTextColor;
  5522. }
  5523. if (attributes.customBackgroundColor) {
  5524. style.color.background = attributes.customBackgroundColor;
  5525. }
  5526. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']),
  5527. style,
  5528. isStackedOnMobile: true
  5529. };
  5530. };
  5531. /* harmony default export */ var columns_deprecated = ([{
  5532. attributes: {
  5533. verticalAlignment: {
  5534. type: 'string'
  5535. },
  5536. backgroundColor: {
  5537. type: 'string'
  5538. },
  5539. customBackgroundColor: {
  5540. type: 'string'
  5541. },
  5542. customTextColor: {
  5543. type: 'string'
  5544. },
  5545. textColor: {
  5546. type: 'string'
  5547. }
  5548. },
  5549. migrate: migrateCustomColors,
  5550. save(_ref) {
  5551. let {
  5552. attributes
  5553. } = _ref;
  5554. const {
  5555. verticalAlignment,
  5556. backgroundColor,
  5557. customBackgroundColor,
  5558. textColor,
  5559. customTextColor
  5560. } = attributes;
  5561. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  5562. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  5563. const className = classnames_default()({
  5564. 'has-background': backgroundColor || customBackgroundColor,
  5565. 'has-text-color': textColor || customTextColor,
  5566. [backgroundClass]: backgroundClass,
  5567. [textClass]: textClass,
  5568. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5569. });
  5570. const style = {
  5571. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  5572. color: textClass ? undefined : customTextColor
  5573. };
  5574. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5575. className: className ? className : undefined,
  5576. style: style
  5577. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5578. }
  5579. }, {
  5580. attributes: {
  5581. columns: {
  5582. type: 'number',
  5583. default: 2
  5584. }
  5585. },
  5586. isEligible(attributes, innerBlocks) {
  5587. // Since isEligible is called on every valid instance of the
  5588. // Columns block and a deprecation is the unlikely case due to
  5589. // its subsequent migration, optimize for the `false` condition
  5590. // by performing a naive, inaccurate pass at inner blocks.
  5591. const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent));
  5592. if (!isFastPassEligible) {
  5593. return false;
  5594. } // Only if the fast pass is considered eligible is the more
  5595. // accurate, durable, slower condition performed.
  5596. return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined);
  5597. },
  5598. migrate(attributes, innerBlocks) {
  5599. const columns = innerBlocks.reduce((accumulator, innerBlock) => {
  5600. const {
  5601. originalContent
  5602. } = innerBlock;
  5603. let columnIndex = getDeprecatedLayoutColumn(originalContent);
  5604. if (columnIndex === undefined) {
  5605. columnIndex = 0;
  5606. }
  5607. if (!accumulator[columnIndex]) {
  5608. accumulator[columnIndex] = [];
  5609. }
  5610. accumulator[columnIndex].push(innerBlock);
  5611. return accumulator;
  5612. }, []);
  5613. const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks));
  5614. return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']),
  5615. isStackedOnMobile: true
  5616. }, migratedInnerBlocks];
  5617. },
  5618. save(_ref2) {
  5619. let {
  5620. attributes
  5621. } = _ref2;
  5622. const {
  5623. columns
  5624. } = attributes;
  5625. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5626. className: `has-${columns}-columns`
  5627. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5628. }
  5629. }, {
  5630. attributes: {
  5631. columns: {
  5632. type: 'number',
  5633. default: 2
  5634. }
  5635. },
  5636. migrate(attributes, innerBlocks) {
  5637. attributes = { ...(0,external_lodash_namespaceObject.omit)(attributes, ['columns']),
  5638. isStackedOnMobile: true
  5639. };
  5640. return [attributes, innerBlocks];
  5641. },
  5642. save(_ref3) {
  5643. let {
  5644. attributes
  5645. } = _ref3;
  5646. const {
  5647. verticalAlignment,
  5648. columns
  5649. } = attributes;
  5650. const wrapperClasses = classnames_default()(`has-${columns}-columns`, {
  5651. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  5652. });
  5653. return (0,external_wp_element_namespaceObject.createElement)("div", {
  5654. className: wrapperClasses
  5655. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  5656. }
  5657. }]);
  5658. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/utils.js
  5659. /**
  5660. * External dependencies
  5661. */
  5662. /**
  5663. * Returns a column width attribute value rounded to standard precision.
  5664. * Returns `undefined` if the value is not a valid finite number.
  5665. *
  5666. * @param {?number} value Raw value.
  5667. *
  5668. * @return {number} Value rounded to standard precision.
  5669. */
  5670. const toWidthPrecision = value => {
  5671. const unitlessValue = parseFloat(value);
  5672. return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined;
  5673. };
  5674. /**
  5675. * Returns an effective width for a given block. An effective width is equal to
  5676. * its attribute value if set, or a computed value assuming equal distribution.
  5677. *
  5678. * @param {WPBlock} block Block object.
  5679. * @param {number} totalBlockCount Total number of blocks in Columns.
  5680. *
  5681. * @return {number} Effective column width.
  5682. */
  5683. function getEffectiveColumnWidth(block, totalBlockCount) {
  5684. const {
  5685. width = 100 / totalBlockCount
  5686. } = block.attributes;
  5687. return toWidthPrecision(width);
  5688. }
  5689. /**
  5690. * Returns the total width occupied by the given set of column blocks.
  5691. *
  5692. * @param {WPBlock[]} blocks Block objects.
  5693. * @param {?number} totalBlockCount Total number of blocks in Columns.
  5694. * Defaults to number of blocks passed.
  5695. *
  5696. * @return {number} Total width occupied by blocks.
  5697. */
  5698. function getTotalColumnsWidth(blocks) {
  5699. let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
  5700. return (0,external_lodash_namespaceObject.sumBy)(blocks, block => getEffectiveColumnWidth(block, totalBlockCount));
  5701. }
  5702. /**
  5703. * Returns an object of `clientId` → `width` of effective column widths.
  5704. *
  5705. * @param {WPBlock[]} blocks Block objects.
  5706. * @param {?number} totalBlockCount Total number of blocks in Columns.
  5707. * Defaults to number of blocks passed.
  5708. *
  5709. * @return {Object<string,number>} Column widths.
  5710. */
  5711. function getColumnWidths(blocks) {
  5712. let totalBlockCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : blocks.length;
  5713. return blocks.reduce((accumulator, block) => {
  5714. const width = getEffectiveColumnWidth(block, totalBlockCount);
  5715. return Object.assign(accumulator, {
  5716. [block.clientId]: width
  5717. });
  5718. }, {});
  5719. }
  5720. /**
  5721. * Returns an object of `clientId` → `width` of column widths as redistributed
  5722. * proportional to their current widths, constrained or expanded to fit within
  5723. * the given available width.
  5724. *
  5725. * @param {WPBlock[]} blocks Block objects.
  5726. * @param {number} availableWidth Maximum width to fit within.
  5727. * @param {?number} totalBlockCount Total number of blocks in Columns.
  5728. * Defaults to number of blocks passed.
  5729. *
  5730. * @return {Object<string,number>} Redistributed column widths.
  5731. */
  5732. function getRedistributedColumnWidths(blocks, availableWidth) {
  5733. let totalBlockCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : blocks.length;
  5734. const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount);
  5735. return (0,external_lodash_namespaceObject.mapValues)(getColumnWidths(blocks, totalBlockCount), width => {
  5736. const newWidth = availableWidth * width / totalWidth;
  5737. return toWidthPrecision(newWidth);
  5738. });
  5739. }
  5740. /**
  5741. * Returns true if column blocks within the provided set are assigned with
  5742. * explicit widths, or false otherwise.
  5743. *
  5744. * @param {WPBlock[]} blocks Block objects.
  5745. *
  5746. * @return {boolean} Whether columns have explicit widths.
  5747. */
  5748. function hasExplicitPercentColumnWidths(blocks) {
  5749. return blocks.every(block => {
  5750. var _blockWidth$endsWith;
  5751. const blockWidth = block.attributes.width;
  5752. return Number.isFinite(blockWidth !== null && blockWidth !== void 0 && (_blockWidth$endsWith = blockWidth.endsWith) !== null && _blockWidth$endsWith !== void 0 && _blockWidth$endsWith.call(blockWidth, '%') ? parseFloat(blockWidth) : blockWidth);
  5753. });
  5754. }
  5755. /**
  5756. * Returns a copy of the given set of blocks with new widths assigned from the
  5757. * provided object of redistributed column widths.
  5758. *
  5759. * @param {WPBlock[]} blocks Block objects.
  5760. * @param {Object<string,number>} widths Redistributed column widths.
  5761. *
  5762. * @return {WPBlock[]} blocks Mapped block objects.
  5763. */
  5764. function getMappedColumnWidths(blocks, widths) {
  5765. return blocks.map(block => (0,external_lodash_namespaceObject.merge)({}, block, {
  5766. attributes: {
  5767. width: `${widths[block.clientId]}%`
  5768. }
  5769. }));
  5770. }
  5771. /**
  5772. * Returns an array with columns widths values, parsed or no depends on `withParsing` flag.
  5773. *
  5774. * @param {WPBlock[]} blocks Block objects.
  5775. * @param {?boolean} withParsing Whether value has to be parsed.
  5776. *
  5777. * @return {Array<number,string>} Column widths.
  5778. */
  5779. function getWidths(blocks) {
  5780. let withParsing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  5781. return blocks.map(innerColumn => {
  5782. const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length;
  5783. return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth;
  5784. });
  5785. }
  5786. /**
  5787. * Returns a column width with unit.
  5788. *
  5789. * @param {string} width Column width.
  5790. * @param {string} unit Column width unit.
  5791. *
  5792. * @return {string} Column width with unit.
  5793. */
  5794. function getWidthWithUnit(width, unit) {
  5795. width = 0 > parseFloat(width) ? '0' : width;
  5796. if (isPercentageUnit(unit)) {
  5797. width = Math.min(width, 100);
  5798. }
  5799. return `${width}${unit}`;
  5800. }
  5801. /**
  5802. * Returns a boolean whether passed unit is percentage
  5803. *
  5804. * @param {string} unit Column width unit.
  5805. *
  5806. * @return {boolean} Whether unit is '%'.
  5807. */
  5808. function isPercentageUnit(unit) {
  5809. return unit === '%';
  5810. }
  5811. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/edit.js
  5812. /**
  5813. * External dependencies
  5814. */
  5815. /**
  5816. * WordPress dependencies
  5817. */
  5818. /**
  5819. * Internal dependencies
  5820. */
  5821. /**
  5822. * Allowed blocks constant is passed to InnerBlocks precisely as specified here.
  5823. * The contents of the array should never change.
  5824. * The array should contain the name of each block that is allowed.
  5825. * In columns block, the only block we allow is 'core/column'.
  5826. *
  5827. * @constant
  5828. * @type {string[]}
  5829. */
  5830. const edit_ALLOWED_BLOCKS = ['core/column'];
  5831. function ColumnsEditContainer(_ref) {
  5832. let {
  5833. attributes,
  5834. setAttributes,
  5835. updateAlignment,
  5836. updateColumns,
  5837. clientId
  5838. } = _ref;
  5839. const {
  5840. isStackedOnMobile,
  5841. verticalAlignment
  5842. } = attributes;
  5843. const {
  5844. count
  5845. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5846. return {
  5847. count: select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId)
  5848. };
  5849. }, [clientId]);
  5850. const classes = classnames_default()({
  5851. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  5852. [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  5853. });
  5854. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  5855. className: classes
  5856. });
  5857. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  5858. allowedBlocks: edit_ALLOWED_BLOCKS,
  5859. orientation: 'horizontal',
  5860. renderAppender: false
  5861. });
  5862. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
  5863. onChange: updateAlignment,
  5864. value: verticalAlignment
  5865. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  5866. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  5867. value: count,
  5868. onChange: value => updateColumns(count, value),
  5869. min: 1,
  5870. max: Math.max(6, count)
  5871. }), count > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  5872. status: "warning",
  5873. isDismissible: false
  5874. }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  5875. label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
  5876. checked: isStackedOnMobile,
  5877. onChange: () => setAttributes({
  5878. isStackedOnMobile: !isStackedOnMobile
  5879. })
  5880. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  5881. }
  5882. const ColumnsEditContainerWrapper = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({
  5883. /**
  5884. * Update all child Column blocks with a new vertical alignment setting
  5885. * based on whatever alignment is passed in. This allows change to parent
  5886. * to overide anything set on a individual column basis.
  5887. *
  5888. * @param {string} verticalAlignment the vertical alignment setting
  5889. */
  5890. updateAlignment(verticalAlignment) {
  5891. const {
  5892. clientId,
  5893. setAttributes
  5894. } = ownProps;
  5895. const {
  5896. updateBlockAttributes
  5897. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  5898. const {
  5899. getBlockOrder
  5900. } = registry.select(external_wp_blockEditor_namespaceObject.store); // Update own alignment.
  5901. setAttributes({
  5902. verticalAlignment
  5903. }); // Update all child Column Blocks to match.
  5904. const innerBlockClientIds = getBlockOrder(clientId);
  5905. innerBlockClientIds.forEach(innerBlockClientId => {
  5906. updateBlockAttributes(innerBlockClientId, {
  5907. verticalAlignment
  5908. });
  5909. });
  5910. },
  5911. /**
  5912. * Updates the column count, including necessary revisions to child Column
  5913. * blocks to grant required or redistribute available space.
  5914. *
  5915. * @param {number} previousColumns Previous column count.
  5916. * @param {number} newColumns New column count.
  5917. */
  5918. updateColumns(previousColumns, newColumns) {
  5919. const {
  5920. clientId
  5921. } = ownProps;
  5922. const {
  5923. replaceInnerBlocks
  5924. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  5925. const {
  5926. getBlocks
  5927. } = registry.select(external_wp_blockEditor_namespaceObject.store);
  5928. let innerBlocks = getBlocks(clientId);
  5929. const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks.
  5930. const isAddingColumn = newColumns > previousColumns;
  5931. if (isAddingColumn && hasExplicitWidths) {
  5932. // If adding a new column, assign width to the new column equal to
  5933. // as if it were `1 / columns` of the total available space.
  5934. const newColumnWidth = toWidthPrecision(100 / newColumns); // Redistribute in consideration of pending block insertion as
  5935. // constraining the available working width.
  5936. const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
  5937. innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => {
  5938. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {
  5939. width: `${newColumnWidth}%`
  5940. });
  5941. })];
  5942. } else if (isAddingColumn) {
  5943. innerBlocks = [...innerBlocks, ...(0,external_lodash_namespaceObject.times)(newColumns - previousColumns, () => {
  5944. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column');
  5945. })];
  5946. } else {
  5947. // The removed column will be the last of the inner blocks.
  5948. innerBlocks = (0,external_lodash_namespaceObject.dropRight)(innerBlocks, previousColumns - newColumns);
  5949. if (hasExplicitWidths) {
  5950. // Redistribute as if block is already removed.
  5951. const widths = getRedistributedColumnWidths(innerBlocks, 100);
  5952. innerBlocks = getMappedColumnWidths(innerBlocks, widths);
  5953. }
  5954. }
  5955. replaceInnerBlocks(clientId, innerBlocks);
  5956. }
  5957. }))(ColumnsEditContainer);
  5958. function Placeholder(_ref2) {
  5959. let {
  5960. clientId,
  5961. name,
  5962. setAttributes
  5963. } = _ref2;
  5964. const {
  5965. blockType,
  5966. defaultVariation,
  5967. variations
  5968. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  5969. const {
  5970. getBlockVariations,
  5971. getBlockType,
  5972. getDefaultBlockVariation
  5973. } = select(external_wp_blocks_namespaceObject.store);
  5974. return {
  5975. blockType: getBlockType(name),
  5976. defaultVariation: getDefaultBlockVariation(name, 'block'),
  5977. variations: getBlockVariations(name, 'block')
  5978. };
  5979. }, [name]);
  5980. const {
  5981. replaceInnerBlocks
  5982. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  5983. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  5984. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
  5985. icon: (0,external_lodash_namespaceObject.get)(blockType, ['icon', 'src']),
  5986. label: (0,external_lodash_namespaceObject.get)(blockType, ['title']),
  5987. variations: variations,
  5988. onSelect: function () {
  5989. let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
  5990. if (nextVariation.attributes) {
  5991. setAttributes(nextVariation.attributes);
  5992. }
  5993. if (nextVariation.innerBlocks) {
  5994. replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true);
  5995. }
  5996. },
  5997. allowSkip: true
  5998. }));
  5999. }
  6000. const ColumnsEdit = props => {
  6001. const {
  6002. clientId
  6003. } = props;
  6004. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]);
  6005. const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder;
  6006. return (0,external_wp_element_namespaceObject.createElement)(Component, props);
  6007. };
  6008. /* harmony default export */ var columns_edit = (ColumnsEdit);
  6009. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/save.js
  6010. /**
  6011. * External dependencies
  6012. */
  6013. /**
  6014. * WordPress dependencies
  6015. */
  6016. function columns_save_save(_ref) {
  6017. let {
  6018. attributes
  6019. } = _ref;
  6020. const {
  6021. isStackedOnMobile,
  6022. verticalAlignment
  6023. } = attributes;
  6024. const className = classnames_default()({
  6025. [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  6026. [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  6027. });
  6028. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  6029. className
  6030. });
  6031. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  6032. return (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps);
  6033. }
  6034. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/variations.js
  6035. /**
  6036. * WordPress dependencies
  6037. */
  6038. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  6039. /**
  6040. * Template option choices for predefined columns layouts.
  6041. *
  6042. * @type {WPBlockVariation[]}
  6043. */
  6044. const variations = [{
  6045. name: 'one-column-full',
  6046. title: (0,external_wp_i18n_namespaceObject.__)('100'),
  6047. description: (0,external_wp_i18n_namespaceObject.__)('One column'),
  6048. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6049. width: "48",
  6050. height: "48",
  6051. viewBox: "0 0 48 48",
  6052. xmlns: "http://www.w3.org/2000/svg"
  6053. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6054. fillRule: "evenodd",
  6055. clipRule: "evenodd",
  6056. d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"
  6057. })),
  6058. innerBlocks: [['core/column']],
  6059. scope: ['block']
  6060. }, {
  6061. name: 'two-columns-equal',
  6062. title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'),
  6063. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'),
  6064. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6065. width: "48",
  6066. height: "48",
  6067. viewBox: "0 0 48 48",
  6068. xmlns: "http://www.w3.org/2000/svg"
  6069. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6070. fillRule: "evenodd",
  6071. clipRule: "evenodd",
  6072. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"
  6073. })),
  6074. isDefault: true,
  6075. innerBlocks: [['core/column'], ['core/column']],
  6076. scope: ['block']
  6077. }, {
  6078. name: 'two-columns-one-third-two-thirds',
  6079. title: (0,external_wp_i18n_namespaceObject.__)('30 / 70'),
  6080. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'),
  6081. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6082. width: "48",
  6083. height: "48",
  6084. viewBox: "0 0 48 48",
  6085. xmlns: "http://www.w3.org/2000/svg"
  6086. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6087. fillRule: "evenodd",
  6088. clipRule: "evenodd",
  6089. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"
  6090. })),
  6091. innerBlocks: [['core/column', {
  6092. width: '33.33%'
  6093. }], ['core/column', {
  6094. width: '66.66%'
  6095. }]],
  6096. scope: ['block']
  6097. }, {
  6098. name: 'two-columns-two-thirds-one-third',
  6099. title: (0,external_wp_i18n_namespaceObject.__)('70 / 30'),
  6100. description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'),
  6101. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6102. width: "48",
  6103. height: "48",
  6104. viewBox: "0 0 48 48",
  6105. xmlns: "http://www.w3.org/2000/svg"
  6106. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6107. fillRule: "evenodd",
  6108. clipRule: "evenodd",
  6109. d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"
  6110. })),
  6111. innerBlocks: [['core/column', {
  6112. width: '66.66%'
  6113. }], ['core/column', {
  6114. width: '33.33%'
  6115. }]],
  6116. scope: ['block']
  6117. }, {
  6118. name: 'three-columns-equal',
  6119. title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'),
  6120. description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'),
  6121. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6122. width: "48",
  6123. height: "48",
  6124. viewBox: "0 0 48 48",
  6125. xmlns: "http://www.w3.org/2000/svg"
  6126. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6127. fillRule: "evenodd",
  6128. d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"
  6129. })),
  6130. innerBlocks: [['core/column'], ['core/column'], ['core/column']],
  6131. scope: ['block']
  6132. }, {
  6133. name: 'three-columns-wider-center',
  6134. title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'),
  6135. description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'),
  6136. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  6137. width: "48",
  6138. height: "48",
  6139. viewBox: "0 0 48 48",
  6140. xmlns: "http://www.w3.org/2000/svg"
  6141. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  6142. fillRule: "evenodd",
  6143. d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"
  6144. })),
  6145. innerBlocks: [['core/column', {
  6146. width: '25%'
  6147. }], ['core/column', {
  6148. width: '50%'
  6149. }], ['core/column', {
  6150. width: '25%'
  6151. }]],
  6152. scope: ['block']
  6153. }];
  6154. /* harmony default export */ var columns_variations = (variations);
  6155. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/transforms.js
  6156. /**
  6157. * WordPress dependencies
  6158. */
  6159. const MAXIMUM_SELECTED_BLOCKS = 6;
  6160. const columns_transforms_transforms = {
  6161. from: [{
  6162. type: 'block',
  6163. isMultiBlock: true,
  6164. blocks: ['*'],
  6165. __experimentalConvert: blocks => {
  6166. const columnWidth = +(100 / blocks.length).toFixed(2);
  6167. const innerBlocksTemplate = blocks.map(_ref => {
  6168. let {
  6169. name,
  6170. attributes,
  6171. innerBlocks
  6172. } = _ref;
  6173. return ['core/column', {
  6174. width: `${columnWidth}%`
  6175. }, [[name, { ...attributes
  6176. }, innerBlocks]]];
  6177. });
  6178. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
  6179. },
  6180. isMatch: _ref2 => {
  6181. let {
  6182. length: selectedBlocksLength
  6183. } = _ref2;
  6184. return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS;
  6185. }
  6186. }, {
  6187. type: 'block',
  6188. blocks: ['core/media-text'],
  6189. priority: 1,
  6190. transform: (attributes, innerBlocks) => {
  6191. const {
  6192. align,
  6193. backgroundColor,
  6194. textColor,
  6195. style,
  6196. mediaAlt: alt,
  6197. mediaId: id,
  6198. mediaPosition,
  6199. mediaSizeSlug: sizeSlug,
  6200. mediaType,
  6201. mediaUrl: url,
  6202. mediaWidth,
  6203. verticalAlignment
  6204. } = attributes;
  6205. let media;
  6206. if (mediaType === 'image' || !mediaType) {
  6207. const imageAttrs = {
  6208. id,
  6209. alt,
  6210. url,
  6211. sizeSlug
  6212. };
  6213. const linkAttrs = {
  6214. href: attributes.href,
  6215. linkClass: attributes.linkClass,
  6216. linkDestination: attributes.linkDestination,
  6217. linkTarget: attributes.linkTarget,
  6218. rel: attributes.rel
  6219. };
  6220. media = ['core/image', { ...imageAttrs,
  6221. ...linkAttrs
  6222. }];
  6223. } else {
  6224. media = ['core/video', {
  6225. id,
  6226. src: url
  6227. }];
  6228. }
  6229. const innerBlocksTemplate = [['core/column', {
  6230. width: `${mediaWidth}%`
  6231. }, [media]], ['core/column', {
  6232. width: `${100 - mediaWidth}%`
  6233. }, innerBlocks]];
  6234. if (mediaPosition === 'right') {
  6235. innerBlocksTemplate.reverse();
  6236. }
  6237. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
  6238. align,
  6239. backgroundColor,
  6240. textColor,
  6241. style,
  6242. verticalAlignment
  6243. }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
  6244. }
  6245. }]
  6246. };
  6247. /* harmony default export */ var columns_transforms = (columns_transforms_transforms);
  6248. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/columns/index.js
  6249. /**
  6250. * WordPress dependencies
  6251. */
  6252. /**
  6253. * Internal dependencies
  6254. */
  6255. const columns_metadata = {
  6256. $schema: "https://schemas.wp.org/trunk/block.json",
  6257. apiVersion: 2,
  6258. name: "core/columns",
  6259. title: "Columns",
  6260. category: "design",
  6261. description: "Display content in multiple columns, with blocks added to each column.",
  6262. textdomain: "default",
  6263. attributes: {
  6264. verticalAlignment: {
  6265. type: "string"
  6266. },
  6267. isStackedOnMobile: {
  6268. type: "boolean",
  6269. "default": true
  6270. }
  6271. },
  6272. supports: {
  6273. anchor: true,
  6274. align: ["wide", "full"],
  6275. html: false,
  6276. color: {
  6277. gradients: true,
  6278. link: true,
  6279. __experimentalDefaultControls: {
  6280. background: true,
  6281. text: true
  6282. }
  6283. },
  6284. spacing: {
  6285. blockGap: {
  6286. __experimentalDefault: "2em"
  6287. },
  6288. margin: ["top", "bottom"],
  6289. padding: true,
  6290. __experimentalDefaultControls: {
  6291. padding: true
  6292. }
  6293. },
  6294. __experimentalLayout: {
  6295. allowSwitching: false,
  6296. allowInheriting: false,
  6297. allowEditing: false,
  6298. "default": {
  6299. type: "flex",
  6300. flexWrap: "nowrap"
  6301. }
  6302. },
  6303. __experimentalBorder: {
  6304. color: true,
  6305. radius: true,
  6306. style: true,
  6307. width: true,
  6308. __experimentalDefaultControls: {
  6309. color: true,
  6310. radius: true,
  6311. style: true,
  6312. width: true
  6313. }
  6314. }
  6315. },
  6316. editorStyle: "wp-block-columns-editor",
  6317. style: "wp-block-columns"
  6318. };
  6319. const {
  6320. name: columns_name
  6321. } = columns_metadata;
  6322. const columns_settings = {
  6323. icon: library_columns,
  6324. variations: columns_variations,
  6325. example: {
  6326. viewportWidth: 600,
  6327. // Columns collapse "@media (max-width: 599px)".
  6328. innerBlocks: [{
  6329. name: 'core/column',
  6330. innerBlocks: [{
  6331. name: 'core/paragraph',
  6332. attributes: {
  6333. /* translators: example text. */
  6334. content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.')
  6335. }
  6336. }, {
  6337. name: 'core/image',
  6338. attributes: {
  6339. url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
  6340. }
  6341. }, {
  6342. name: 'core/paragraph',
  6343. attributes: {
  6344. /* translators: example text. */
  6345. content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.')
  6346. }
  6347. }]
  6348. }, {
  6349. name: 'core/column',
  6350. innerBlocks: [{
  6351. name: 'core/paragraph',
  6352. attributes: {
  6353. /* translators: example text. */
  6354. content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.')
  6355. }
  6356. }, {
  6357. name: 'core/paragraph',
  6358. attributes: {
  6359. /* translators: example text. */
  6360. content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.')
  6361. }
  6362. }]
  6363. }]
  6364. },
  6365. deprecated: columns_deprecated,
  6366. edit: columns_edit,
  6367. save: columns_save_save,
  6368. transforms: columns_transforms
  6369. };
  6370. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js
  6371. /**
  6372. * WordPress dependencies
  6373. */
  6374. const commentAuthorName = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6375. viewBox: "0 0 24 24",
  6376. xmlns: "http://www.w3.org/2000/svg"
  6377. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6378. d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",
  6379. fillRule: "evenodd",
  6380. clipRule: "evenodd"
  6381. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6382. d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",
  6383. fillRule: "evenodd",
  6384. clipRule: "evenodd"
  6385. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
  6386. cx: "12",
  6387. cy: "9",
  6388. r: "2",
  6389. fillRule: "evenodd",
  6390. clipRule: "evenodd"
  6391. }));
  6392. /* harmony default export */ var comment_author_name = (commentAuthorName);
  6393. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js
  6394. /**
  6395. * External dependencies
  6396. */
  6397. /**
  6398. * WordPress dependencies
  6399. */
  6400. /**
  6401. * Renders the `core/comment-author-name` block on the editor.
  6402. *
  6403. * @param {Object} props React props.
  6404. * @param {Object} props.setAttributes Callback for updating block attributes.
  6405. * @param {Object} props.attributes Block attributes.
  6406. * @param {string} props.attributes.isLink Whether the author name should be linked.
  6407. * @param {string} props.attributes.linkTarget Target of the link.
  6408. * @param {string} props.attributes.textAlign Text alignment.
  6409. * @param {Object} props.context Inherited context.
  6410. * @param {string} props.context.commentId The comment ID.
  6411. *
  6412. * @return {JSX.Element} React element.
  6413. */
  6414. function edit_Edit(_ref) {
  6415. let {
  6416. attributes: {
  6417. isLink,
  6418. linkTarget,
  6419. textAlign
  6420. },
  6421. context: {
  6422. commentId
  6423. },
  6424. setAttributes
  6425. } = _ref;
  6426. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6427. className: classnames_default()({
  6428. [`has-text-align-${textAlign}`]: textAlign
  6429. })
  6430. });
  6431. const displayName = (0,external_wp_data_namespaceObject.useSelect)(select => {
  6432. const {
  6433. getEntityRecord
  6434. } = select(external_wp_coreData_namespaceObject.store);
  6435. const comment = getEntityRecord('root', 'comment', commentId);
  6436. const authorName = comment === null || comment === void 0 ? void 0 : comment.author_name; // eslint-disable-line camelcase
  6437. if (comment && !authorName) {
  6438. var _user$name;
  6439. const user = getEntityRecord('root', 'user', comment.author);
  6440. return (_user$name = user === null || user === void 0 ? void 0 : user.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous');
  6441. }
  6442. return authorName !== null && authorName !== void 0 ? authorName : '';
  6443. }, [commentId]);
  6444. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  6445. group: "block"
  6446. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  6447. value: textAlign,
  6448. onChange: newAlign => setAttributes({
  6449. textAlign: newAlign
  6450. })
  6451. }));
  6452. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6453. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  6454. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6455. label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'),
  6456. onChange: () => setAttributes({
  6457. isLink: !isLink
  6458. }),
  6459. checked: isLink
  6460. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6461. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  6462. onChange: value => setAttributes({
  6463. linkTarget: value ? '_blank' : '_self'
  6464. }),
  6465. checked: linkTarget === '_blank'
  6466. })));
  6467. if (!commentId || !displayName) {
  6468. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title'))));
  6469. }
  6470. const displayAuthor = isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  6471. href: "#comment-author-pseudo-link",
  6472. onClick: event => event.preventDefault()
  6473. }, displayName) : (0,external_wp_element_namespaceObject.createElement)("p", null, displayName);
  6474. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayAuthor));
  6475. }
  6476. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js
  6477. /**
  6478. * Internal dependencies
  6479. */
  6480. const v1 = {
  6481. attributes: {
  6482. isLink: {
  6483. type: 'boolean',
  6484. default: false
  6485. },
  6486. linkTarget: {
  6487. type: 'string',
  6488. default: '_self'
  6489. }
  6490. },
  6491. supports: {
  6492. html: false,
  6493. color: {
  6494. gradients: true,
  6495. link: true
  6496. },
  6497. typography: {
  6498. fontSize: true,
  6499. lineHeight: true,
  6500. __experimentalFontFamily: true,
  6501. __experimentalFontWeight: true,
  6502. __experimentalFontStyle: true,
  6503. __experimentalTextTransform: true,
  6504. __experimentalLetterSpacing: true
  6505. }
  6506. },
  6507. save() {
  6508. return null;
  6509. },
  6510. migrate: migrate_font_family,
  6511. isEligible(_ref) {
  6512. var _style$typography;
  6513. let {
  6514. style
  6515. } = _ref;
  6516. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  6517. }
  6518. };
  6519. /**
  6520. * New deprecations need to be placed first
  6521. * for them to have higher priority.
  6522. *
  6523. * Old deprecations may need to be updated as well.
  6524. *
  6525. * See block-deprecation.md
  6526. */
  6527. /* harmony default export */ var comment_author_name_deprecated = ([v1]);
  6528. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
  6529. /**
  6530. * WordPress dependencies
  6531. */
  6532. /**
  6533. * Internal dependencies
  6534. */
  6535. const comment_author_name_metadata = {
  6536. $schema: "https://schemas.wp.org/trunk/block.json",
  6537. apiVersion: 2,
  6538. name: "core/comment-author-name",
  6539. title: "Comment Author Name",
  6540. category: "theme",
  6541. ancestor: ["core/comment-template"],
  6542. description: "Displays the name of the author of the comment.",
  6543. textdomain: "default",
  6544. attributes: {
  6545. isLink: {
  6546. type: "boolean",
  6547. "default": true
  6548. },
  6549. linkTarget: {
  6550. type: "string",
  6551. "default": "_self"
  6552. },
  6553. textAlign: {
  6554. type: "string"
  6555. },
  6556. fontSize: {
  6557. type: "string",
  6558. "default": "small"
  6559. }
  6560. },
  6561. usesContext: ["commentId"],
  6562. supports: {
  6563. html: false,
  6564. spacing: {
  6565. margin: true,
  6566. padding: true
  6567. },
  6568. color: {
  6569. gradients: true,
  6570. link: true,
  6571. __experimentalDefaultControls: {
  6572. background: true,
  6573. text: true,
  6574. link: true
  6575. }
  6576. },
  6577. typography: {
  6578. fontSize: true,
  6579. lineHeight: true,
  6580. __experimentalFontFamily: true,
  6581. __experimentalFontWeight: true,
  6582. __experimentalFontStyle: true,
  6583. __experimentalTextTransform: true,
  6584. __experimentalLetterSpacing: true
  6585. }
  6586. }
  6587. };
  6588. const {
  6589. name: comment_author_name_name
  6590. } = comment_author_name_metadata;
  6591. const comment_author_name_settings = {
  6592. icon: comment_author_name,
  6593. edit: edit_Edit,
  6594. deprecated: comment_author_name_deprecated
  6595. };
  6596. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-content.js
  6597. /**
  6598. * WordPress dependencies
  6599. */
  6600. const commentContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6601. viewBox: "0 0 24 24",
  6602. xmlns: "http://www.w3.org/2000/svg"
  6603. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6604. fillRule: "evenodd",
  6605. clipRule: "evenodd",
  6606. d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"
  6607. }));
  6608. /* harmony default export */ var comment_content = (commentContent);
  6609. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js
  6610. /**
  6611. * External dependencies
  6612. */
  6613. /**
  6614. * WordPress dependencies
  6615. */
  6616. /**
  6617. * Renders the `core/comment-content` block on the editor.
  6618. *
  6619. * @param {Object} props React props.
  6620. * @param {Object} props.setAttributes Callback for updating block attributes.
  6621. * @param {Object} props.attributes Block attributes.
  6622. * @param {string} props.attributes.textAlign The `textAlign` attribute.
  6623. * @param {Object} props.context Inherited context.
  6624. * @param {string} props.context.commentId The comment ID.
  6625. *
  6626. * @return {JSX.Element} React element.
  6627. */
  6628. function comment_content_edit_Edit(_ref) {
  6629. let {
  6630. setAttributes,
  6631. attributes: {
  6632. textAlign
  6633. },
  6634. context: {
  6635. commentId
  6636. }
  6637. } = _ref;
  6638. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6639. className: classnames_default()({
  6640. [`has-text-align-${textAlign}`]: textAlign
  6641. })
  6642. });
  6643. const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId);
  6644. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  6645. group: "block"
  6646. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  6647. value: textAlign,
  6648. onChange: newAlign => setAttributes({
  6649. textAlign: newAlign
  6650. })
  6651. }));
  6652. if (!commentId || !content) {
  6653. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title'))));
  6654. }
  6655. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
  6656. key: "html"
  6657. }, content.rendered))));
  6658. }
  6659. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
  6660. /**
  6661. * WordPress dependencies
  6662. */
  6663. /**
  6664. * Internal dependencies
  6665. */
  6666. const comment_content_metadata = {
  6667. $schema: "https://schemas.wp.org/trunk/block.json",
  6668. apiVersion: 2,
  6669. name: "core/comment-content",
  6670. title: "Comment Content",
  6671. category: "theme",
  6672. ancestor: ["core/comment-template"],
  6673. description: "Displays the contents of a comment.",
  6674. textdomain: "default",
  6675. usesContext: ["commentId"],
  6676. attributes: {
  6677. textAlign: {
  6678. type: "string"
  6679. }
  6680. },
  6681. supports: {
  6682. color: {
  6683. gradients: true,
  6684. link: true,
  6685. __experimentalDefaultControls: {
  6686. background: true,
  6687. text: true
  6688. }
  6689. },
  6690. typography: {
  6691. fontSize: true,
  6692. lineHeight: true,
  6693. __experimentalFontFamily: true,
  6694. __experimentalFontWeight: true,
  6695. __experimentalFontStyle: true,
  6696. __experimentalTextTransform: true,
  6697. __experimentalLetterSpacing: true
  6698. },
  6699. spacing: {
  6700. padding: ["horizontal", "vertical"],
  6701. __experimentalDefaultControls: {
  6702. padding: true
  6703. }
  6704. },
  6705. html: false
  6706. }
  6707. };
  6708. const {
  6709. name: comment_content_name
  6710. } = comment_content_metadata;
  6711. const comment_content_settings = {
  6712. icon: comment_content,
  6713. edit: comment_content_edit_Edit
  6714. };
  6715. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
  6716. /**
  6717. * WordPress dependencies
  6718. */
  6719. const postDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6720. xmlns: "http://www.w3.org/2000/svg",
  6721. viewBox: "0 0 24 24"
  6722. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6723. d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"
  6724. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6725. d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"
  6726. }));
  6727. /* harmony default export */ var post_date = (postDate);
  6728. ;// CONCATENATED MODULE: external ["wp","date"]
  6729. var external_wp_date_namespaceObject = window["wp"]["date"];
  6730. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js
  6731. /**
  6732. * WordPress dependencies
  6733. */
  6734. /**
  6735. * Renders the `core/comment-date` block on the editor.
  6736. *
  6737. * @param {Object} props React props.
  6738. * @param {Object} props.setAttributes Callback for updating block attributes.
  6739. * @param {Object} props.attributes Block attributes.
  6740. * @param {string} props.attributes.format Format of the date.
  6741. * @param {string} props.attributes.isLink Whether the author name should be linked.
  6742. * @param {Object} props.context Inherited context.
  6743. * @param {string} props.context.commentId The comment ID.
  6744. *
  6745. * @return {JSX.Element} React element.
  6746. */
  6747. function comment_date_edit_Edit(_ref) {
  6748. let {
  6749. attributes: {
  6750. format,
  6751. isLink
  6752. },
  6753. context: {
  6754. commentId
  6755. },
  6756. setAttributes
  6757. } = _ref;
  6758. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  6759. const [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId);
  6760. const [siteFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  6761. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6762. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  6763. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
  6764. format: format,
  6765. defaultFormat: siteFormat,
  6766. onChange: nextFormat => setAttributes({
  6767. format: nextFormat
  6768. })
  6769. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6770. label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'),
  6771. onChange: () => setAttributes({
  6772. isLink: !isLink
  6773. }),
  6774. checked: isLink
  6775. })));
  6776. if (!commentId || !date) {
  6777. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title'))));
  6778. }
  6779. let commentDate = (0,external_wp_element_namespaceObject.createElement)("time", {
  6780. dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date)
  6781. }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date));
  6782. if (isLink) {
  6783. commentDate = (0,external_wp_element_namespaceObject.createElement)("a", {
  6784. href: "#comment-date-pseudo-link",
  6785. onClick: event => event.preventDefault()
  6786. }, commentDate);
  6787. }
  6788. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, commentDate));
  6789. }
  6790. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js
  6791. /**
  6792. * Internal dependencies
  6793. */
  6794. const deprecated_v1 = {
  6795. attributes: {
  6796. format: {
  6797. type: 'string'
  6798. },
  6799. isLink: {
  6800. type: 'boolean',
  6801. default: false
  6802. }
  6803. },
  6804. supports: {
  6805. html: false,
  6806. color: {
  6807. gradients: true,
  6808. link: true
  6809. },
  6810. typography: {
  6811. fontSize: true,
  6812. lineHeight: true,
  6813. __experimentalFontFamily: true,
  6814. __experimentalFontWeight: true,
  6815. __experimentalFontStyle: true,
  6816. __experimentalTextTransform: true,
  6817. __experimentalLetterSpacing: true
  6818. }
  6819. },
  6820. save() {
  6821. return null;
  6822. },
  6823. migrate: migrate_font_family,
  6824. isEligible(_ref) {
  6825. var _style$typography;
  6826. let {
  6827. style
  6828. } = _ref;
  6829. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  6830. }
  6831. };
  6832. /**
  6833. * New deprecations need to be placed first
  6834. * for them to have higher priority.
  6835. *
  6836. * Old deprecations may need to be updated as well.
  6837. *
  6838. * See block-deprecation.md
  6839. */
  6840. /* harmony default export */ var comment_date_deprecated = ([deprecated_v1]);
  6841. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
  6842. /**
  6843. * WordPress dependencies
  6844. */
  6845. /**
  6846. * Internal dependencies
  6847. */
  6848. const comment_date_metadata = {
  6849. $schema: "https://schemas.wp.org/trunk/block.json",
  6850. apiVersion: 2,
  6851. name: "core/comment-date",
  6852. title: "Comment Date",
  6853. category: "theme",
  6854. ancestor: ["core/comment-template"],
  6855. description: "Displays the date on which the comment was posted.",
  6856. textdomain: "default",
  6857. attributes: {
  6858. format: {
  6859. type: "string"
  6860. },
  6861. isLink: {
  6862. type: "boolean",
  6863. "default": true
  6864. },
  6865. fontSize: {
  6866. type: "string",
  6867. "default": "small"
  6868. }
  6869. },
  6870. usesContext: ["commentId"],
  6871. supports: {
  6872. html: false,
  6873. color: {
  6874. gradients: true,
  6875. link: true,
  6876. __experimentalDefaultControls: {
  6877. background: true,
  6878. text: true,
  6879. link: true
  6880. }
  6881. },
  6882. typography: {
  6883. fontSize: true,
  6884. lineHeight: true,
  6885. __experimentalFontFamily: true,
  6886. __experimentalFontWeight: true,
  6887. __experimentalFontStyle: true,
  6888. __experimentalTextTransform: true,
  6889. __experimentalLetterSpacing: true,
  6890. __experimentalDefaultControls: {
  6891. fontSize: true
  6892. }
  6893. }
  6894. }
  6895. };
  6896. const {
  6897. name: comment_date_name
  6898. } = comment_date_metadata;
  6899. const comment_date_settings = {
  6900. icon: post_date,
  6901. edit: comment_date_edit_Edit,
  6902. deprecated: comment_date_deprecated
  6903. };
  6904. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js
  6905. /**
  6906. * WordPress dependencies
  6907. */
  6908. const commentEditLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  6909. width: "24",
  6910. height: "24",
  6911. viewBox: "0 0 24 24",
  6912. xmlns: "http://www.w3.org/2000/svg"
  6913. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  6914. d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"
  6915. }));
  6916. /* harmony default export */ var comment_edit_link = (commentEditLink);
  6917. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js
  6918. /**
  6919. * External dependencies
  6920. */
  6921. /**
  6922. * WordPress dependencies
  6923. */
  6924. function comment_edit_link_edit_Edit(_ref) {
  6925. let {
  6926. attributes: {
  6927. linkTarget,
  6928. textAlign
  6929. },
  6930. setAttributes
  6931. } = _ref;
  6932. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  6933. className: classnames_default()({
  6934. [`has-text-align-${textAlign}`]: textAlign
  6935. })
  6936. });
  6937. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  6938. group: "block"
  6939. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  6940. value: textAlign,
  6941. onChange: newAlign => setAttributes({
  6942. textAlign: newAlign
  6943. })
  6944. }));
  6945. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  6946. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  6947. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  6948. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  6949. onChange: value => setAttributes({
  6950. linkTarget: value ? '_blank' : '_self'
  6951. }),
  6952. checked: linkTarget === '_blank'
  6953. })));
  6954. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  6955. href: "#edit-comment-pseudo-link",
  6956. onClick: event => event.preventDefault()
  6957. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))));
  6958. }
  6959. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
  6960. /**
  6961. * WordPress dependencies
  6962. */
  6963. /**
  6964. * Internal dependencies
  6965. */
  6966. const comment_edit_link_metadata = {
  6967. $schema: "https://schemas.wp.org/trunk/block.json",
  6968. apiVersion: 2,
  6969. name: "core/comment-edit-link",
  6970. title: "Comment Edit Link",
  6971. category: "theme",
  6972. ancestor: ["core/comment-template"],
  6973. description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",
  6974. textdomain: "default",
  6975. usesContext: ["commentId"],
  6976. attributes: {
  6977. linkTarget: {
  6978. type: "string",
  6979. "default": "_self"
  6980. },
  6981. textAlign: {
  6982. type: "string"
  6983. },
  6984. fontSize: {
  6985. type: "string",
  6986. "default": "small"
  6987. }
  6988. },
  6989. supports: {
  6990. html: false,
  6991. color: {
  6992. link: true,
  6993. gradients: true,
  6994. text: false,
  6995. __experimentalDefaultControls: {
  6996. background: true,
  6997. link: true
  6998. }
  6999. },
  7000. typography: {
  7001. fontSize: true,
  7002. lineHeight: true,
  7003. __experimentalFontFamily: true,
  7004. __experimentalFontWeight: true,
  7005. __experimentalFontStyle: true,
  7006. __experimentalTextTransform: true,
  7007. __experimentalLetterSpacing: true
  7008. }
  7009. }
  7010. };
  7011. const {
  7012. name: comment_edit_link_name
  7013. } = comment_edit_link_metadata;
  7014. const comment_edit_link_settings = {
  7015. icon: comment_edit_link,
  7016. edit: comment_edit_link_edit_Edit
  7017. };
  7018. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js
  7019. /**
  7020. * WordPress dependencies
  7021. */
  7022. const commentReplyLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7023. width: "24",
  7024. height: "24",
  7025. viewBox: "0 0 24 24",
  7026. xmlns: "http://www.w3.org/2000/svg"
  7027. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7028. d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"
  7029. }));
  7030. /* harmony default export */ var comment_reply_link = (commentReplyLink);
  7031. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js
  7032. /**
  7033. * External dependencies
  7034. */
  7035. /**
  7036. * WordPress dependencies
  7037. */
  7038. /**
  7039. * Renders the `core/comment-reply-link` block on the editor.
  7040. *
  7041. * @param {Object} props React props.
  7042. * @param {Object} props.setAttributes Callback for updating block attributes.
  7043. * @param {Object} props.attributes Block attributes.
  7044. * @param {string} props.attributes.textAlign The `textAlign` attribute.
  7045. *
  7046. * @return {JSX.Element} React element.
  7047. */
  7048. function comment_reply_link_edit_Edit(_ref) {
  7049. let {
  7050. setAttributes,
  7051. attributes: {
  7052. textAlign
  7053. }
  7054. } = _ref;
  7055. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  7056. className: classnames_default()({
  7057. [`has-text-align-${textAlign}`]: textAlign
  7058. })
  7059. });
  7060. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  7061. group: "block"
  7062. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  7063. value: textAlign,
  7064. onChange: newAlign => setAttributes({
  7065. textAlign: newAlign
  7066. })
  7067. }));
  7068. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  7069. href: "#comment-reply-pseudo-link",
  7070. onClick: event => event.preventDefault()
  7071. }, (0,external_wp_i18n_namespaceObject.__)('Reply'))));
  7072. }
  7073. /* harmony default export */ var comment_reply_link_edit = (comment_reply_link_edit_Edit);
  7074. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
  7075. /**
  7076. * WordPress dependencies
  7077. */
  7078. /**
  7079. * Internal dependencies
  7080. */
  7081. const comment_reply_link_metadata = {
  7082. $schema: "https://schemas.wp.org/trunk/block.json",
  7083. apiVersion: 2,
  7084. name: "core/comment-reply-link",
  7085. title: "Comment Reply Link",
  7086. category: "theme",
  7087. ancestor: ["core/comment-template"],
  7088. description: "Displays a link to reply to a comment.",
  7089. textdomain: "default",
  7090. usesContext: ["commentId"],
  7091. attributes: {
  7092. textAlign: {
  7093. type: "string"
  7094. },
  7095. fontSize: {
  7096. type: "string",
  7097. "default": "small"
  7098. }
  7099. },
  7100. supports: {
  7101. color: {
  7102. gradients: true,
  7103. link: true,
  7104. text: false,
  7105. __experimentalDefaultControls: {
  7106. background: true,
  7107. link: true
  7108. }
  7109. },
  7110. typography: {
  7111. fontSize: true,
  7112. lineHeight: true,
  7113. __experimentalFontFamily: true,
  7114. __experimentalFontWeight: true,
  7115. __experimentalFontStyle: true,
  7116. __experimentalTextTransform: true,
  7117. __experimentalLetterSpacing: true
  7118. },
  7119. html: false
  7120. }
  7121. };
  7122. const {
  7123. name: comment_reply_link_name
  7124. } = comment_reply_link_metadata;
  7125. const comment_reply_link_settings = {
  7126. edit: comment_reply_link_edit,
  7127. icon: comment_reply_link
  7128. };
  7129. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
  7130. /**
  7131. * WordPress dependencies
  7132. */
  7133. const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7134. xmlns: "http://www.w3.org/2000/svg",
  7135. viewBox: "0 0 24 24"
  7136. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7137. d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  7138. }));
  7139. /* harmony default export */ var library_layout = (layout);
  7140. ;// CONCATENATED MODULE: external ["wp","apiFetch"]
  7141. var external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
  7142. var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
  7143. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js
  7144. /**
  7145. * WordPress dependencies
  7146. */
  7147. // This is limited by WP REST API
  7148. const MAX_COMMENTS_PER_PAGE = 100;
  7149. /**
  7150. * Return an object with the query args needed to fetch the default page of
  7151. * comments.
  7152. *
  7153. * @param {Object} props Hook props.
  7154. * @param {number} props.postId ID of the post that contains the comments.
  7155. * discussion settings.
  7156. *
  7157. * @return {Object} Query args to retrieve the comments.
  7158. */
  7159. const useCommentQueryArgs = _ref => {
  7160. let {
  7161. postId
  7162. } = _ref;
  7163. // Initialize the query args that are not going to change.
  7164. const queryArgs = {
  7165. status: 'approve',
  7166. order: 'asc',
  7167. context: 'embed',
  7168. parent: 0,
  7169. _embed: 'children'
  7170. }; // Get the Discussion settings that may be needed to query the comments.
  7171. const {
  7172. pageComments,
  7173. commentsPerPage,
  7174. defaultCommentsPage: defaultPage
  7175. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7176. const {
  7177. getSettings
  7178. } = select(external_wp_blockEditor_namespaceObject.store);
  7179. const {
  7180. __experimentalDiscussionSettings
  7181. } = getSettings();
  7182. return __experimentalDiscussionSettings;
  7183. }); // WP REST API doesn't allow fetching more than max items limit set per single page of data.
  7184. // As for the editor performance is more important than completeness of data and fetching only the
  7185. // max allowed for single page should be enough for the purpose of design and laying out the page.
  7186. // Fetching over the limit would return an error here but would work with backend query.
  7187. const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page.
  7188. const page = useDefaultPageIndex({
  7189. defaultPage,
  7190. postId,
  7191. perPage,
  7192. queryArgs
  7193. }); // Merge, memoize and return all query arguments, unless the default page's
  7194. // number is not known yet.
  7195. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  7196. return page ? { ...queryArgs,
  7197. post: postId,
  7198. per_page: perPage,
  7199. page
  7200. } : null;
  7201. }, [postId, perPage, page]);
  7202. };
  7203. /**
  7204. * Return the index of the default page, depending on whether `defaultPage` is
  7205. * `newest` or `oldest`. In the first case, the only way to know the page's
  7206. * index is by using the `X-WP-TotalPages` header, which forces to make an
  7207. * additional request.
  7208. *
  7209. * @param {Object} props Hook props.
  7210. * @param {string} props.defaultPage Page shown by default (newest/oldest).
  7211. * @param {number} props.postId ID of the post that contains the comments.
  7212. * @param {number} props.perPage The number of comments included per page.
  7213. * @param {Object} props.queryArgs Other query args.
  7214. *
  7215. * @return {number} Index of the default comments page.
  7216. */
  7217. const useDefaultPageIndex = _ref2 => {
  7218. let {
  7219. defaultPage,
  7220. postId,
  7221. perPage,
  7222. queryArgs
  7223. } = _ref2;
  7224. // Store the default page indices.
  7225. const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({});
  7226. const key = `${postId}_${perPage}`;
  7227. const page = defaultPages[key] || 0;
  7228. (0,external_wp_element_namespaceObject.useEffect)(() => {
  7229. // Do nothing if the page is already known or not the newest page.
  7230. if (page || defaultPage !== 'newest') {
  7231. return;
  7232. } // We need to fetch comments to know the index. Use HEAD and limit
  7233. // fields just to ID, to make this call as light as possible.
  7234. external_wp_apiFetch_default()({
  7235. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs,
  7236. post: postId,
  7237. per_page: perPage,
  7238. _fields: 'id'
  7239. }),
  7240. method: 'HEAD',
  7241. parse: false
  7242. }).then(res => {
  7243. const pages = parseInt(res.headers.get('X-WP-TotalPages'));
  7244. setDefaultPages({ ...defaultPages,
  7245. [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page.
  7246. });
  7247. });
  7248. }, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one.
  7249. return defaultPage === 'newest' ? page : 1;
  7250. };
  7251. /**
  7252. * Generate a tree structure of comment IDs from a list of comment entities. The
  7253. * children of each comment are obtained from `_embedded`.
  7254. *
  7255. * @typedef {{ commentId: number, children: CommentNode }} CommentNode
  7256. *
  7257. * @param {Object[]} topLevelComments List of comment entities.
  7258. * @return {{ commentTree: CommentNode[]}} Tree of comment IDs.
  7259. */
  7260. const useCommentTree = topLevelComments => {
  7261. const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments === null || topLevelComments === void 0 ? void 0 : topLevelComments.map(_ref3 => {
  7262. let {
  7263. id,
  7264. _embedded
  7265. } = _ref3;
  7266. const [children] = (_embedded === null || _embedded === void 0 ? void 0 : _embedded.children) || [[]];
  7267. return {
  7268. commentId: id,
  7269. children: children.map(child => ({
  7270. commentId: child.id
  7271. }))
  7272. };
  7273. }), [topLevelComments]);
  7274. return commentTree;
  7275. };
  7276. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js
  7277. /**
  7278. * WordPress dependencies
  7279. */
  7280. /**
  7281. * Internal dependencies
  7282. */
  7283. const TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']];
  7284. /**
  7285. * Function that returns a comment structure that will be rendered with default placehoders.
  7286. *
  7287. * Each comment has a `commentId` property that is always a negative number in
  7288. * case of the placeholders. This is to ensure that the comment does not
  7289. * conflict with the actual (real) comments.
  7290. *
  7291. * @param {Object} settings Discussion Settings.
  7292. * @param {number} [settings.perPage] - Comments per page setting or block attribute.
  7293. * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
  7294. * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
  7295. *
  7296. * @typedef {{id: null, children: EmptyComment[]}} EmptyComment
  7297. * @return {EmptyComment[]} Inner blocks of the Comment Template
  7298. */
  7299. const getCommentsPlaceholder = _ref => {
  7300. let {
  7301. perPage,
  7302. threadComments,
  7303. threadCommentsDepth
  7304. } = _ref;
  7305. // In case that `threadCommentsDepth` is falsy, we default to a somewhat
  7306. // arbitrary value of 3.
  7307. // In case that the value is set but larger than 3 we truncate it to 3.
  7308. const commentsDepth = Math.min(threadCommentsDepth || 3, 3); // We set a limit in order not to overload the editor of empty comments.
  7309. const defaultCommentsToShow = perPage <= commentsDepth ? perPage : commentsDepth;
  7310. if (!threadComments || defaultCommentsToShow === 1) {
  7311. // If displaying threaded comments is disabled, we only show one comment
  7312. // A commentId is negative in order to avoid conflicts with the actual comments.
  7313. return [{
  7314. commentId: -1,
  7315. children: []
  7316. }];
  7317. } else if (defaultCommentsToShow === 2) {
  7318. return [{
  7319. commentId: -1,
  7320. children: [{
  7321. commentId: -2,
  7322. children: []
  7323. }]
  7324. }];
  7325. } // In case that the value is set but larger than 3 we truncate it to 3.
  7326. return [{
  7327. commentId: -1,
  7328. children: [{
  7329. commentId: -2,
  7330. children: [{
  7331. commentId: -3,
  7332. children: []
  7333. }]
  7334. }]
  7335. }];
  7336. };
  7337. /**
  7338. * Component which renders the inner blocks of the Comment Template.
  7339. *
  7340. * @param {Object} props Component props.
  7341. * @param {Array} [props.comment] - A comment object.
  7342. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
  7343. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
  7344. * @param {Array} [props.firstCommentId] - ID of the first comment in the array.
  7345. * @param {Array} [props.blocks] - Array of blocks returned from
  7346. * getBlocks() in parent .
  7347. * @return {WPElement} Inner blocks of the Comment Template
  7348. */
  7349. function CommentTemplateInnerBlocks(_ref2) {
  7350. var _comment$children;
  7351. let {
  7352. comment,
  7353. activeCommentId,
  7354. setActiveCommentId,
  7355. firstCommentId,
  7356. blocks
  7357. } = _ref2;
  7358. const {
  7359. children,
  7360. ...innerBlocksProps
  7361. } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
  7362. template: TEMPLATE
  7363. });
  7364. return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedCommentTemplatePreview, {
  7365. blocks: blocks,
  7366. commentId: comment.commentId,
  7367. setActiveCommentId: setActiveCommentId,
  7368. isHidden: comment.commentId === (activeCommentId || firstCommentId)
  7369. }), (comment === null || comment === void 0 ? void 0 : (_comment$children = comment.children) === null || _comment$children === void 0 ? void 0 : _comment$children.length) > 0 ? (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
  7370. comments: comment.children,
  7371. activeCommentId: activeCommentId,
  7372. setActiveCommentId: setActiveCommentId,
  7373. blocks: blocks,
  7374. firstCommentId: firstCommentId
  7375. }) : null);
  7376. }
  7377. const CommentTemplatePreview = _ref3 => {
  7378. let {
  7379. blocks,
  7380. commentId,
  7381. setActiveCommentId,
  7382. isHidden
  7383. } = _ref3;
  7384. const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
  7385. blocks
  7386. });
  7387. const handleOnClick = () => {
  7388. setActiveCommentId(commentId);
  7389. }; // We have to hide the preview block if the `comment` props points to
  7390. // the curently active block!
  7391. // Or, to put it differently, every preview block is visible unless it is the
  7392. // currently active block - in this case we render its inner blocks.
  7393. const style = {
  7394. display: isHidden ? 'none' : undefined
  7395. };
  7396. return (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockPreviewProps, {
  7397. tabIndex: 0,
  7398. role: "button",
  7399. style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
  7400. ,
  7401. onClick: handleOnClick,
  7402. onKeyPress: handleOnClick
  7403. }));
  7404. };
  7405. const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview);
  7406. /**
  7407. * Component that renders a list of (nested) comments. It is called recursively.
  7408. *
  7409. * @param {Object} props Component props.
  7410. * @param {Array} [props.comments] - Array of comment objects.
  7411. * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`.
  7412. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active.
  7413. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId.
  7414. * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent.
  7415. * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of
  7416. * comment objects.
  7417. * @return {WPElement} List of comments.
  7418. */
  7419. const CommentsList = _ref4 => {
  7420. let {
  7421. comments,
  7422. blockProps,
  7423. activeCommentId,
  7424. setActiveCommentId,
  7425. blocks,
  7426. firstCommentId
  7427. } = _ref4;
  7428. return (0,external_wp_element_namespaceObject.createElement)("ol", blockProps, comments && comments.map((_ref5, index) => {
  7429. let {
  7430. commentId,
  7431. ...comment
  7432. } = _ref5;
  7433. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  7434. key: comment.commentId || index,
  7435. value: {
  7436. // If the commentId is negative it means that this comment is a
  7437. // "placeholder" and that the block is most likely being used in the
  7438. // site editor. In this case, we have to set the commentId to `null`
  7439. // because otherwise the (non-existent) comment with a negative ID
  7440. // would be reqested from the REST API.
  7441. commentId: commentId < 0 ? null : commentId
  7442. }
  7443. }, (0,external_wp_element_namespaceObject.createElement)(CommentTemplateInnerBlocks, {
  7444. comment: {
  7445. commentId,
  7446. ...comment
  7447. },
  7448. activeCommentId: activeCommentId,
  7449. setActiveCommentId: setActiveCommentId,
  7450. blocks: blocks,
  7451. firstCommentId: firstCommentId
  7452. }));
  7453. }));
  7454. };
  7455. function CommentTemplateEdit(_ref6) {
  7456. var _commentTree$;
  7457. let {
  7458. clientId,
  7459. context: {
  7460. postId
  7461. }
  7462. } = _ref6;
  7463. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7464. const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)();
  7465. const {
  7466. commentOrder,
  7467. threadCommentsDepth,
  7468. threadComments,
  7469. commentsPerPage
  7470. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7471. const {
  7472. getSettings
  7473. } = select(external_wp_blockEditor_namespaceObject.store);
  7474. return getSettings().__experimentalDiscussionSettings;
  7475. });
  7476. const commentQuery = useCommentQueryArgs({
  7477. postId
  7478. });
  7479. const {
  7480. topLevelComments,
  7481. blocks
  7482. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7483. const {
  7484. getEntityRecords
  7485. } = select(external_wp_coreData_namespaceObject.store);
  7486. const {
  7487. getBlocks
  7488. } = select(external_wp_blockEditor_namespaceObject.store);
  7489. return {
  7490. // Request only top-level comments. Replies are embedded.
  7491. topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null,
  7492. blocks: getBlocks(clientId)
  7493. };
  7494. }, [clientId, commentQuery]); // Generate a tree structure of comment IDs.
  7495. let commentTree = useCommentTree( // Reverse the order of top comments if needed.
  7496. commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments);
  7497. if (!topLevelComments) {
  7498. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  7499. }
  7500. if (!postId) {
  7501. commentTree = getCommentsPlaceholder({
  7502. perPage: commentsPerPage,
  7503. threadComments,
  7504. threadCommentsDepth
  7505. });
  7506. }
  7507. if (!commentTree.length) {
  7508. return (0,external_wp_element_namespaceObject.createElement)("p", _extends({}, blockProps, {
  7509. "data-testid": "noresults"
  7510. }), (0,external_wp_i18n_namespaceObject.__)('No results found.'));
  7511. }
  7512. return (0,external_wp_element_namespaceObject.createElement)(CommentsList, {
  7513. comments: commentTree,
  7514. blockProps: blockProps,
  7515. blocks: blocks,
  7516. activeCommentId: activeCommentId,
  7517. setActiveCommentId: setActiveCommentId,
  7518. firstCommentId: (_commentTree$ = commentTree[0]) === null || _commentTree$ === void 0 ? void 0 : _commentTree$.commentId
  7519. });
  7520. }
  7521. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js
  7522. /**
  7523. * WordPress dependencies
  7524. */
  7525. function CommentTemplateSave() {
  7526. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  7527. }
  7528. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
  7529. /**
  7530. * WordPress dependencies
  7531. */
  7532. /**
  7533. * Internal dependencies
  7534. */
  7535. const comment_template_metadata = {
  7536. $schema: "https://schemas.wp.org/trunk/block.json",
  7537. apiVersion: 2,
  7538. name: "core/comment-template",
  7539. title: "Comment Template",
  7540. category: "design",
  7541. parent: ["core/comments-query-loop"],
  7542. description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.",
  7543. textdomain: "default",
  7544. usesContext: ["postId"],
  7545. supports: {
  7546. reusable: false,
  7547. html: false,
  7548. align: true
  7549. },
  7550. style: "wp-block-comment-template"
  7551. };
  7552. const {
  7553. name: comment_template_name
  7554. } = comment_template_metadata;
  7555. const comment_template_settings = {
  7556. icon: library_layout,
  7557. edit: CommentTemplateEdit,
  7558. save: CommentTemplateSave
  7559. };
  7560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
  7561. /**
  7562. * WordPress dependencies
  7563. */
  7564. const queryPaginationPrevious = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7565. xmlns: "http://www.w3.org/2000/svg",
  7566. viewBox: "0 0 24 24"
  7567. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7568. d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"
  7569. }));
  7570. /* harmony default export */ var query_pagination_previous = (queryPaginationPrevious);
  7571. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js
  7572. /**
  7573. * WordPress dependencies
  7574. */
  7575. const arrowMap = {
  7576. none: '',
  7577. arrow: '←',
  7578. chevron: '«'
  7579. };
  7580. function CommentsPaginationPreviousEdit(_ref) {
  7581. let {
  7582. attributes: {
  7583. label
  7584. },
  7585. setAttributes,
  7586. context: {
  7587. 'comments/paginationArrow': paginationArrow
  7588. }
  7589. } = _ref;
  7590. const displayArrow = arrowMap[paginationArrow];
  7591. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  7592. href: "#comments-pagination-previous-pseudo-link",
  7593. onClick: event => event.preventDefault()
  7594. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  7595. className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`
  7596. }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  7597. __experimentalVersion: 2,
  7598. tagName: "span",
  7599. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'),
  7600. placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'),
  7601. value: label,
  7602. onChange: newLabel => setAttributes({
  7603. label: newLabel
  7604. })
  7605. }));
  7606. }
  7607. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
  7608. /**
  7609. * WordPress dependencies
  7610. */
  7611. /**
  7612. * Internal dependencies
  7613. */
  7614. const comments_pagination_previous_metadata = {
  7615. $schema: "https://schemas.wp.org/trunk/block.json",
  7616. apiVersion: 2,
  7617. name: "core/comments-pagination-previous",
  7618. title: "Previous Page",
  7619. category: "theme",
  7620. parent: ["core/comments-pagination"],
  7621. description: "Displays the previous comment's page link.",
  7622. textdomain: "default",
  7623. attributes: {
  7624. label: {
  7625. type: "string"
  7626. }
  7627. },
  7628. usesContext: ["postId", "comments/paginationArrow"],
  7629. supports: {
  7630. reusable: false,
  7631. html: false,
  7632. color: {
  7633. gradients: true,
  7634. text: false,
  7635. __experimentalDefaultControls: {
  7636. background: true
  7637. }
  7638. },
  7639. typography: {
  7640. fontSize: true,
  7641. lineHeight: true,
  7642. __experimentalFontStyle: true,
  7643. __experimentalFontWeight: true,
  7644. __experimentalLetterSpacing: true,
  7645. __experimentalTextTransform: true,
  7646. __experimentalDefaultControls: {
  7647. fontSize: true
  7648. }
  7649. }
  7650. }
  7651. };
  7652. const {
  7653. name: comments_pagination_previous_name
  7654. } = comments_pagination_previous_metadata;
  7655. const comments_pagination_previous_settings = {
  7656. icon: query_pagination_previous,
  7657. edit: CommentsPaginationPreviousEdit
  7658. };
  7659. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js
  7660. /**
  7661. * WordPress dependencies
  7662. */
  7663. const postComments = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7664. xmlns: "http://www.w3.org/2000/svg",
  7665. viewBox: "0 0 24 24"
  7666. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7667. d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"
  7668. }));
  7669. /* harmony default export */ var post_comments = (postComments);
  7670. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/edit/comments-inspector-controls.js
  7671. /**
  7672. * WordPress dependencies
  7673. */
  7674. function CommentsInspectorControls(_ref) {
  7675. let {
  7676. attributes: {
  7677. TagName
  7678. },
  7679. setAttributes
  7680. } = _ref;
  7681. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  7682. __experimentalGroup: "advanced"
  7683. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  7684. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  7685. options: [{
  7686. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  7687. value: 'div'
  7688. }, {
  7689. label: '<section>',
  7690. value: 'section'
  7691. }, {
  7692. label: '<aside>',
  7693. value: 'aside'
  7694. }],
  7695. value: TagName,
  7696. onChange: value => setAttributes({
  7697. tagName: value
  7698. })
  7699. })));
  7700. }
  7701. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/edit.js
  7702. /**
  7703. * WordPress dependencies
  7704. */
  7705. /**
  7706. * Internal dependencies
  7707. */
  7708. const edit_TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', {
  7709. width: '40px'
  7710. }, [['core/avatar', {
  7711. size: 40,
  7712. style: {
  7713. border: {
  7714. radius: '20px'
  7715. }
  7716. }
  7717. }]]], ['core/column', {}, [['core/comment-author-name'], ['core/group', {
  7718. layout: {
  7719. type: 'flex'
  7720. },
  7721. style: {
  7722. spacing: {
  7723. margin: {
  7724. top: '0px',
  7725. bottom: '0px'
  7726. }
  7727. }
  7728. }
  7729. }, [['core/comment-date'], ['core/comment-edit-link']]], ['core/comment-content'], ['core/comment-reply-link']]]]]]], ['core/comments-pagination'], ['core/post-comments-form']];
  7730. function CommentsQueryLoopEdit(_ref) {
  7731. let {
  7732. attributes,
  7733. setAttributes
  7734. } = _ref;
  7735. const {
  7736. tagName: TagName
  7737. } = attributes;
  7738. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7739. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  7740. template: edit_TEMPLATE
  7741. });
  7742. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(CommentsInspectorControls, {
  7743. attributes: attributes,
  7744. setAttributes: setAttributes
  7745. }), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
  7746. }
  7747. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/save.js
  7748. /**
  7749. * WordPress dependencies
  7750. */
  7751. function CommentsQueryLoopSave(_ref) {
  7752. let {
  7753. attributes: {
  7754. tagName: Tag
  7755. }
  7756. } = _ref;
  7757. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  7758. }
  7759. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-query-loop/index.js
  7760. /**
  7761. * WordPress dependencies
  7762. */
  7763. /**
  7764. * Internal dependencies
  7765. */
  7766. const comments_query_loop_metadata = {
  7767. $schema: "https://schemas.wp.org/trunk/block.json",
  7768. apiVersion: 2,
  7769. name: "core/comments-query-loop",
  7770. title: "Comments Query Loop",
  7771. category: "theme",
  7772. description: "An advanced block that allows displaying post comments using different visual configurations.",
  7773. textdomain: "default",
  7774. attributes: {
  7775. tagName: {
  7776. type: "string",
  7777. "default": "div"
  7778. }
  7779. },
  7780. supports: {
  7781. align: ["wide", "full"],
  7782. html: false,
  7783. color: {
  7784. gradients: true,
  7785. link: true,
  7786. __experimentalDefaultControls: {
  7787. background: true,
  7788. text: true,
  7789. link: true
  7790. }
  7791. }
  7792. },
  7793. editorStyle: "wp-block-comments-editor"
  7794. };
  7795. const {
  7796. name: comments_query_loop_name
  7797. } = comments_query_loop_metadata;
  7798. const comments_query_loop_settings = {
  7799. icon: post_comments,
  7800. edit: CommentsQueryLoopEdit,
  7801. save: CommentsQueryLoopSave
  7802. };
  7803. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
  7804. /**
  7805. * WordPress dependencies
  7806. */
  7807. const queryPagination = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7808. xmlns: "http://www.w3.org/2000/svg",
  7809. viewBox: "0 0 24 24"
  7810. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7811. d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"
  7812. }));
  7813. /* harmony default export */ var query_pagination = (queryPagination);
  7814. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js
  7815. /**
  7816. * WordPress dependencies
  7817. */
  7818. function CommentsPaginationArrowControls(_ref) {
  7819. let {
  7820. value,
  7821. onChange
  7822. } = _ref;
  7823. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  7824. label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
  7825. value: value,
  7826. onChange: onChange,
  7827. help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'),
  7828. isBlock: true
  7829. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7830. value: "none",
  7831. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks')
  7832. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7833. value: "arrow",
  7834. label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks')
  7835. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  7836. value: "chevron",
  7837. label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks')
  7838. }));
  7839. }
  7840. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js
  7841. /**
  7842. * WordPress dependencies
  7843. */
  7844. /**
  7845. * Internal dependencies
  7846. */
  7847. const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
  7848. const getDefaultBlockLayout = blockTypeOrName => {
  7849. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  7850. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  7851. };
  7852. function QueryPaginationEdit(_ref) {
  7853. let {
  7854. attributes: {
  7855. paginationArrow,
  7856. layout
  7857. },
  7858. setAttributes,
  7859. clientId,
  7860. name
  7861. } = _ref;
  7862. const usedLayout = layout || getDefaultBlockLayout(name);
  7863. const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7864. const {
  7865. getBlocks
  7866. } = select(external_wp_blockEditor_namespaceObject.store);
  7867. const innerBlocks = getBlocks(clientId);
  7868. /**
  7869. * Show the `paginationArrow` control only if a
  7870. * Comments Pagination Next or Comments Pagination Previous
  7871. * block exists.
  7872. */
  7873. return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
  7874. return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name);
  7875. });
  7876. }, []);
  7877. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  7878. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  7879. template: comments_pagination_edit_TEMPLATE,
  7880. allowedBlocks: ['core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next'],
  7881. __experimentalLayout: usedLayout
  7882. }); // Get the Discussion settings
  7883. const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  7884. const {
  7885. getSettings
  7886. } = select(external_wp_blockEditor_namespaceObject.store);
  7887. const {
  7888. __experimentalDiscussionSettings
  7889. } = getSettings();
  7890. return __experimentalDiscussionSettings === null || __experimentalDiscussionSettings === void 0 ? void 0 : __experimentalDiscussionSettings.pageComments;
  7891. }, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination
  7892. // controls. We don't want to remove them from the template so that when the user enables
  7893. // paging comments, the controls will be visible.
  7894. if (!pageComments) {
  7895. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings'));
  7896. }
  7897. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  7898. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  7899. }, (0,external_wp_element_namespaceObject.createElement)(CommentsPaginationArrowControls, {
  7900. value: paginationArrow,
  7901. onChange: value => {
  7902. setAttributes({
  7903. paginationArrow: value
  7904. });
  7905. }
  7906. }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  7907. }
  7908. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js
  7909. /**
  7910. * WordPress dependencies
  7911. */
  7912. function comments_pagination_save_save() {
  7913. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  7914. }
  7915. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
  7916. /**
  7917. * WordPress dependencies
  7918. */
  7919. /**
  7920. * Internal dependencies
  7921. */
  7922. const comments_pagination_metadata = {
  7923. $schema: "https://schemas.wp.org/trunk/block.json",
  7924. apiVersion: 2,
  7925. name: "core/comments-pagination",
  7926. title: "Comments Pagination",
  7927. category: "theme",
  7928. parent: ["core/comments-query-loop"],
  7929. description: "Displays a paginated navigation to next/previous set of comments, when applicable.",
  7930. textdomain: "default",
  7931. attributes: {
  7932. paginationArrow: {
  7933. type: "string",
  7934. "default": "none"
  7935. }
  7936. },
  7937. providesContext: {
  7938. "comments/paginationArrow": "paginationArrow"
  7939. },
  7940. supports: {
  7941. align: true,
  7942. reusable: false,
  7943. html: false,
  7944. color: {
  7945. gradients: true,
  7946. link: true,
  7947. __experimentalDefaultControls: {
  7948. background: true,
  7949. text: true,
  7950. link: true
  7951. }
  7952. },
  7953. __experimentalLayout: {
  7954. allowSwitching: false,
  7955. allowInheriting: false,
  7956. "default": {
  7957. type: "flex"
  7958. }
  7959. }
  7960. },
  7961. editorStyle: "wp-block-comments-pagination-editor",
  7962. style: "wp-block-comments-pagination"
  7963. };
  7964. const {
  7965. name: comments_pagination_name
  7966. } = comments_pagination_metadata;
  7967. const comments_pagination_settings = {
  7968. icon: query_pagination,
  7969. edit: QueryPaginationEdit,
  7970. save: comments_pagination_save_save
  7971. };
  7972. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
  7973. /**
  7974. * WordPress dependencies
  7975. */
  7976. const queryPaginationNext = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  7977. xmlns: "http://www.w3.org/2000/svg",
  7978. viewBox: "0 0 24 24"
  7979. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  7980. d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"
  7981. }));
  7982. /* harmony default export */ var query_pagination_next = (queryPaginationNext);
  7983. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js
  7984. /**
  7985. * WordPress dependencies
  7986. */
  7987. const edit_arrowMap = {
  7988. none: '',
  7989. arrow: '→',
  7990. chevron: '»'
  7991. };
  7992. function CommentsPaginationNextEdit(_ref) {
  7993. let {
  7994. attributes: {
  7995. label
  7996. },
  7997. setAttributes,
  7998. context: {
  7999. 'comments/paginationArrow': paginationArrow
  8000. }
  8001. } = _ref;
  8002. const displayArrow = edit_arrowMap[paginationArrow];
  8003. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  8004. href: "#comments-pagination-next-pseudo-link",
  8005. onClick: event => event.preventDefault()
  8006. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  8007. __experimentalVersion: 2,
  8008. tagName: "span",
  8009. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'),
  8010. placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'),
  8011. value: label,
  8012. onChange: newLabel => setAttributes({
  8013. label: newLabel
  8014. })
  8015. }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  8016. className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`
  8017. }, displayArrow));
  8018. }
  8019. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
  8020. /**
  8021. * WordPress dependencies
  8022. */
  8023. /**
  8024. * Internal dependencies
  8025. */
  8026. const comments_pagination_next_metadata = {
  8027. $schema: "https://schemas.wp.org/trunk/block.json",
  8028. apiVersion: 2,
  8029. name: "core/comments-pagination-next",
  8030. title: "Next Page",
  8031. category: "theme",
  8032. parent: ["core/comments-pagination"],
  8033. description: "Displays the next comment's page link.",
  8034. textdomain: "default",
  8035. attributes: {
  8036. label: {
  8037. type: "string"
  8038. }
  8039. },
  8040. usesContext: ["postId", "comments/paginationArrow"],
  8041. supports: {
  8042. reusable: false,
  8043. html: false,
  8044. color: {
  8045. gradients: true,
  8046. text: false,
  8047. __experimentalDefaultControls: {
  8048. background: true
  8049. }
  8050. },
  8051. typography: {
  8052. fontSize: true,
  8053. lineHeight: true,
  8054. __experimentalFontStyle: true,
  8055. __experimentalFontWeight: true,
  8056. __experimentalLetterSpacing: true,
  8057. __experimentalTextTransform: true,
  8058. __experimentalDefaultControls: {
  8059. fontSize: true
  8060. }
  8061. }
  8062. }
  8063. };
  8064. const {
  8065. name: comments_pagination_next_name
  8066. } = comments_pagination_next_metadata;
  8067. const comments_pagination_next_settings = {
  8068. icon: query_pagination_next,
  8069. edit: CommentsPaginationNextEdit
  8070. };
  8071. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
  8072. /**
  8073. * WordPress dependencies
  8074. */
  8075. const queryPaginationNumbers = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8076. xmlns: "http://www.w3.org/2000/svg",
  8077. viewBox: "0 0 24 24"
  8078. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8079. d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"
  8080. }));
  8081. /* harmony default export */ var query_pagination_numbers = (queryPaginationNumbers);
  8082. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js
  8083. /**
  8084. * WordPress dependencies
  8085. */
  8086. const PaginationItem = _ref => {
  8087. let {
  8088. content,
  8089. tag: Tag = 'a',
  8090. extraClass = ''
  8091. } = _ref;
  8092. return (0,external_wp_element_namespaceObject.createElement)(Tag, {
  8093. className: `page-numbers ${extraClass}`
  8094. }, content);
  8095. };
  8096. function CommentsPaginationNumbersEdit() {
  8097. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8098. content: "1"
  8099. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8100. content: "2"
  8101. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8102. content: "3",
  8103. tag: "span",
  8104. extraClass: "current"
  8105. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8106. content: "4"
  8107. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8108. content: "5"
  8109. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8110. content: "...",
  8111. tag: "span",
  8112. extraClass: "dots"
  8113. }), (0,external_wp_element_namespaceObject.createElement)(PaginationItem, {
  8114. content: "8"
  8115. }));
  8116. }
  8117. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
  8118. /**
  8119. * WordPress dependencies
  8120. */
  8121. /**
  8122. * Internal dependencies
  8123. */
  8124. const comments_pagination_numbers_metadata = {
  8125. $schema: "https://schemas.wp.org/trunk/block.json",
  8126. apiVersion: 2,
  8127. name: "core/comments-pagination-numbers",
  8128. title: "Page Numbers",
  8129. category: "theme",
  8130. parent: ["core/comments-pagination"],
  8131. description: "Displays a list of page numbers for comments pagination.",
  8132. textdomain: "default",
  8133. usesContext: ["postId"],
  8134. supports: {
  8135. reusable: false,
  8136. html: false
  8137. }
  8138. };
  8139. const {
  8140. name: comments_pagination_numbers_name
  8141. } = comments_pagination_numbers_metadata;
  8142. const comments_pagination_numbers_settings = {
  8143. icon: query_pagination_numbers,
  8144. edit: CommentsPaginationNumbersEdit
  8145. };
  8146. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-title.js
  8147. /**
  8148. * WordPress dependencies
  8149. */
  8150. const commentTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8151. xmlns: "http://www.w3.org/2000/svg",
  8152. viewBox: "0 0 24 24"
  8153. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8154. d: "M6 11.9c.6.3 1.3.5 2.1.5.4 0 .8 0 1.2-.1.4-.1.7-.2 1-.3l-.1-1.3c-.3.1-.6.3-.9.3-.3.1-.7.1-1.1.1-.6 0-1.1-.1-1.5-.4-.4-.3-.7-.6-.9-1-.2-.5-.3-1-.3-1.5 0-.6.1-1.1.3-1.5.2-.4.5-.8.9-1 .4-.3.9-.4 1.5-.4.4 0 .7 0 1.1.1l.9.3.1-1.3c-.3-.1-.6-.2-1-.3C9 4 8.6 4 8.2 4c-.9 0-1.6.2-2.2.5-.6.4-1.1.8-1.5 1.5-.3.6-.5 1.3-.5 2.2s.2 1.6.5 2.2c.4.6.9 1.1 1.5 1.5zm-2 2.6V16h16v-1.5H4zM4 20h9v-1.5H4V20z"
  8155. }));
  8156. /* harmony default export */ var comment_title = (commentTitle);
  8157. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
  8158. /**
  8159. * WordPress dependencies
  8160. */
  8161. /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
  8162. /**
  8163. * HeadingLevelIcon props.
  8164. *
  8165. * @typedef WPHeadingLevelIconProps
  8166. *
  8167. * @property {number} level The heading level to show an icon for.
  8168. * @property {?boolean} isPressed Whether or not the icon should appear pressed; default: false.
  8169. */
  8170. /**
  8171. * Heading level icon.
  8172. *
  8173. * @param {WPHeadingLevelIconProps} props Component props.
  8174. *
  8175. * @return {?WPComponent} The icon.
  8176. */
  8177. function HeadingLevelIcon(_ref) {
  8178. let {
  8179. level,
  8180. isPressed = false
  8181. } = _ref;
  8182. const levelToPath = {
  8183. 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
  8184. 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
  8185. 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
  8186. 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
  8187. 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
  8188. 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
  8189. };
  8190. if (!levelToPath.hasOwnProperty(level)) {
  8191. return null;
  8192. }
  8193. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  8194. width: "24",
  8195. height: "24",
  8196. viewBox: "0 0 20 20",
  8197. xmlns: "http://www.w3.org/2000/svg",
  8198. isPressed: isPressed
  8199. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  8200. d: levelToPath[level]
  8201. }));
  8202. }
  8203. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
  8204. /**
  8205. * WordPress dependencies
  8206. */
  8207. /**
  8208. * Internal dependencies
  8209. */
  8210. const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
  8211. const POPOVER_PROPS = {
  8212. className: 'block-library-heading-level-dropdown'
  8213. };
  8214. /** @typedef {import('@wordpress/element').WPComponent} WPComponent */
  8215. /**
  8216. * HeadingLevelDropdown props.
  8217. *
  8218. * @typedef WPHeadingLevelDropdownProps
  8219. *
  8220. * @property {number} selectedLevel The chosen heading level.
  8221. * @property {(newValue:number)=>any} onChange Callback to run when
  8222. * toolbar value is changed.
  8223. */
  8224. /**
  8225. * Dropdown for selecting a heading level (1 through 6).
  8226. *
  8227. * @param {WPHeadingLevelDropdownProps} props Component props.
  8228. *
  8229. * @return {WPComponent} The toolbar.
  8230. */
  8231. function HeadingLevelDropdown(_ref) {
  8232. let {
  8233. selectedLevel,
  8234. onChange
  8235. } = _ref;
  8236. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  8237. popoverProps: POPOVER_PROPS,
  8238. icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
  8239. level: selectedLevel
  8240. }),
  8241. label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
  8242. controls: HEADING_LEVELS.map(targetLevel => {
  8243. {
  8244. const isActive = targetLevel === selectedLevel;
  8245. return {
  8246. icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
  8247. level: targetLevel,
  8248. isPressed: isActive
  8249. }),
  8250. label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: heading level e.g: "1", "2", "3"
  8251. (0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel),
  8252. isActive,
  8253. onClick() {
  8254. onChange(targetLevel);
  8255. }
  8256. };
  8257. }
  8258. })
  8259. });
  8260. }
  8261. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js
  8262. /**
  8263. * External dependencies
  8264. */
  8265. /**
  8266. * WordPress dependencies
  8267. */
  8268. /**
  8269. * Internal dependencies
  8270. */
  8271. function comments_title_edit_Edit(_ref) {
  8272. let {
  8273. attributes: {
  8274. textAlign,
  8275. showPostTitle,
  8276. showCommentsCount,
  8277. level
  8278. },
  8279. setAttributes,
  8280. context: {
  8281. postType,
  8282. postId
  8283. }
  8284. } = _ref;
  8285. const TagName = 'h' + level;
  8286. const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
  8287. const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  8288. const isSiteEditor = typeof postId === 'undefined';
  8289. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  8290. className: classnames_default()({
  8291. [`has-text-align-${textAlign}`]: textAlign
  8292. })
  8293. });
  8294. (0,external_wp_element_namespaceObject.useEffect)(() => {
  8295. if (isSiteEditor) {
  8296. setCommentsCount(3);
  8297. return;
  8298. }
  8299. const currentPostId = postId;
  8300. external_wp_apiFetch_default()({
  8301. path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', {
  8302. post: postId,
  8303. _fields: 'id'
  8304. }),
  8305. method: 'HEAD',
  8306. parse: false
  8307. }).then(res => {
  8308. // Stale requests will have the `currentPostId` of an older closure.
  8309. if (currentPostId === postId) {
  8310. setCommentsCount(parseInt(res.headers.get('X-WP-Total')));
  8311. }
  8312. }).catch(() => {
  8313. setCommentsCount(0);
  8314. });
  8315. }, [postId]);
  8316. const blockControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  8317. group: "block"
  8318. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  8319. value: textAlign,
  8320. onChange: newAlign => setAttributes({
  8321. textAlign: newAlign
  8322. })
  8323. }), (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  8324. selectedLevel: level,
  8325. onChange: newLevel => setAttributes({
  8326. level: newLevel
  8327. })
  8328. }));
  8329. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  8330. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  8331. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8332. label: (0,external_wp_i18n_namespaceObject.__)('Show post title'),
  8333. checked: showPostTitle,
  8334. onChange: value => setAttributes({
  8335. showPostTitle: value
  8336. })
  8337. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  8338. label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'),
  8339. checked: showCommentsCount,
  8340. onChange: value => setAttributes({
  8341. showCommentsCount: value
  8342. })
  8343. })));
  8344. const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('"Post Title"') : `"${rawTitle}"`;
  8345. let placeholder;
  8346. if (showCommentsCount && commentsCount !== undefined) {
  8347. if (showPostTitle) {
  8348. if (commentsCount === 1) {
  8349. /* translators: %s: Post title. */
  8350. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle);
  8351. } else {
  8352. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
  8353. /* translators: 1: Number of comments, 2: Post title. */
  8354. (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
  8355. }
  8356. } else if (commentsCount === 1) {
  8357. placeholder = (0,external_wp_i18n_namespaceObject.__)('One response');
  8358. } else {
  8359. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
  8360. /* translators: %s: Number of comments. */
  8361. (0,external_wp_i18n_namespaceObject._n)('%s responses', '%s responses', commentsCount), commentsCount);
  8362. }
  8363. } else if (showPostTitle) {
  8364. if (commentsCount === 1) {
  8365. /* translators: %s: Post title. */
  8366. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle);
  8367. } else {
  8368. /* translators: %s: Post title. */
  8369. placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle);
  8370. }
  8371. } else if (commentsCount === 1) {
  8372. placeholder = (0,external_wp_i18n_namespaceObject.__)('Response');
  8373. } else {
  8374. placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses');
  8375. }
  8376. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, placeholder));
  8377. }
  8378. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
  8379. /**
  8380. * Internal dependencies
  8381. */
  8382. const deprecated_metadata = {
  8383. $schema: "https://schemas.wp.org/trunk/block.json",
  8384. apiVersion: 2,
  8385. name: "core/comments-title",
  8386. title: "Comments Title",
  8387. category: "theme",
  8388. ancestor: ["core/comments-query-loop"],
  8389. description: "Displays a title with the number of comments",
  8390. textdomain: "default",
  8391. usesContext: ["postId", "postType"],
  8392. attributes: {
  8393. textAlign: {
  8394. type: "string"
  8395. },
  8396. showPostTitle: {
  8397. type: "boolean",
  8398. "default": true
  8399. },
  8400. showCommentsCount: {
  8401. type: "boolean",
  8402. "default": true
  8403. },
  8404. level: {
  8405. type: "number",
  8406. "default": 2
  8407. }
  8408. },
  8409. supports: {
  8410. anchor: false,
  8411. align: true,
  8412. html: false,
  8413. __experimentalBorder: {
  8414. radius: true,
  8415. color: true,
  8416. width: true,
  8417. style: true
  8418. },
  8419. color: {
  8420. gradients: true,
  8421. __experimentalDefaultControls: {
  8422. background: true,
  8423. text: true
  8424. }
  8425. },
  8426. spacing: {
  8427. margin: true,
  8428. padding: true
  8429. },
  8430. typography: {
  8431. fontSize: true,
  8432. lineHeight: true,
  8433. __experimentalFontStyle: true,
  8434. __experimentalFontWeight: true,
  8435. __experimentalFontFamily: true,
  8436. __experimentalTextTransform: true,
  8437. __experimentalDefaultControls: {
  8438. fontSize: true,
  8439. __experimentalFontFamily: true,
  8440. __experimentalFontStyle: true,
  8441. __experimentalFontWeight: true
  8442. }
  8443. }
  8444. }
  8445. };
  8446. const {
  8447. attributes,
  8448. supports
  8449. } = deprecated_metadata;
  8450. /* harmony default export */ var comments_title_deprecated = ([{
  8451. attributes: { ...attributes,
  8452. singleCommentLabel: {
  8453. type: 'string'
  8454. },
  8455. multipleCommentsLabel: {
  8456. type: 'string'
  8457. }
  8458. },
  8459. supports,
  8460. migrate: oldAttributes => {
  8461. /* eslint-disable no-unused-vars */
  8462. const {
  8463. singleCommentLabel,
  8464. multipleCommentsLabel,
  8465. ...newAttributes
  8466. } = oldAttributes;
  8467. /* eslint-enable no-unused-vars */
  8468. return newAttributes;
  8469. },
  8470. isEligible: _ref => {
  8471. let {
  8472. multipleCommentsLabel,
  8473. singleCommentLabel
  8474. } = _ref;
  8475. return multipleCommentsLabel || singleCommentLabel;
  8476. },
  8477. save: () => null
  8478. }]);
  8479. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
  8480. /**
  8481. * WordPress dependencies
  8482. */
  8483. /**
  8484. * Internal dependencies
  8485. */
  8486. const comments_title_metadata = {
  8487. $schema: "https://schemas.wp.org/trunk/block.json",
  8488. apiVersion: 2,
  8489. name: "core/comments-title",
  8490. title: "Comments Title",
  8491. category: "theme",
  8492. ancestor: ["core/comments-query-loop"],
  8493. description: "Displays a title with the number of comments",
  8494. textdomain: "default",
  8495. usesContext: ["postId", "postType"],
  8496. attributes: {
  8497. textAlign: {
  8498. type: "string"
  8499. },
  8500. showPostTitle: {
  8501. type: "boolean",
  8502. "default": true
  8503. },
  8504. showCommentsCount: {
  8505. type: "boolean",
  8506. "default": true
  8507. },
  8508. level: {
  8509. type: "number",
  8510. "default": 2
  8511. }
  8512. },
  8513. supports: {
  8514. anchor: false,
  8515. align: true,
  8516. html: false,
  8517. __experimentalBorder: {
  8518. radius: true,
  8519. color: true,
  8520. width: true,
  8521. style: true
  8522. },
  8523. color: {
  8524. gradients: true,
  8525. __experimentalDefaultControls: {
  8526. background: true,
  8527. text: true
  8528. }
  8529. },
  8530. spacing: {
  8531. margin: true,
  8532. padding: true
  8533. },
  8534. typography: {
  8535. fontSize: true,
  8536. lineHeight: true,
  8537. __experimentalFontStyle: true,
  8538. __experimentalFontWeight: true,
  8539. __experimentalFontFamily: true,
  8540. __experimentalTextTransform: true,
  8541. __experimentalDefaultControls: {
  8542. fontSize: true,
  8543. __experimentalFontFamily: true,
  8544. __experimentalFontStyle: true,
  8545. __experimentalFontWeight: true
  8546. }
  8547. }
  8548. }
  8549. };
  8550. const {
  8551. name: comments_title_name
  8552. } = comments_title_metadata;
  8553. const comments_title_settings = {
  8554. icon: comment_title,
  8555. edit: comments_title_edit_Edit,
  8556. deprecated: comments_title_deprecated
  8557. };
  8558. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js
  8559. /**
  8560. * WordPress dependencies
  8561. */
  8562. const cover = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  8563. xmlns: "http://www.w3.org/2000/svg",
  8564. viewBox: "0 0 24 24"
  8565. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  8566. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"
  8567. }));
  8568. /* harmony default export */ var library_cover = (cover);
  8569. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js
  8570. /**
  8571. * WordPress dependencies
  8572. */
  8573. const POSITION_CLASSNAMES = {
  8574. 'top left': 'is-position-top-left',
  8575. 'top center': 'is-position-top-center',
  8576. 'top right': 'is-position-top-right',
  8577. 'center left': 'is-position-center-left',
  8578. 'center center': 'is-position-center-center',
  8579. center: 'is-position-center-center',
  8580. 'center right': 'is-position-center-right',
  8581. 'bottom left': 'is-position-bottom-left',
  8582. 'bottom center': 'is-position-bottom-center',
  8583. 'bottom right': 'is-position-bottom-right'
  8584. };
  8585. const IMAGE_BACKGROUND_TYPE = 'image';
  8586. const VIDEO_BACKGROUND_TYPE = 'video';
  8587. const COVER_MIN_HEIGHT = 50;
  8588. const COVER_MAX_HEIGHT = 1000;
  8589. const COVER_DEFAULT_HEIGHT = 300;
  8590. function backgroundImageStyles(url) {
  8591. return url ? {
  8592. backgroundImage: `url(${url})`
  8593. } : {};
  8594. }
  8595. const shared_ALLOWED_MEDIA_TYPES = ['image', 'video'];
  8596. function dimRatioToClass(ratio) {
  8597. return ratio === 50 || !ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  8598. }
  8599. function attributesFromMedia(setAttributes, dimRatio) {
  8600. return media => {
  8601. if (!media || !media.url) {
  8602. setAttributes({
  8603. url: undefined,
  8604. id: undefined
  8605. });
  8606. return;
  8607. }
  8608. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  8609. media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
  8610. }
  8611. let mediaType; // For media selections originated from a file upload.
  8612. if (media.media_type) {
  8613. if (media.media_type === IMAGE_BACKGROUND_TYPE) {
  8614. mediaType = IMAGE_BACKGROUND_TYPE;
  8615. } else {
  8616. // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
  8617. // Videos contain the media type of 'file' in the object returned from the rest api.
  8618. mediaType = VIDEO_BACKGROUND_TYPE;
  8619. }
  8620. } else {
  8621. // For media selections originated from existing files in the media library.
  8622. if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) {
  8623. return;
  8624. }
  8625. mediaType = media.type;
  8626. }
  8627. setAttributes({
  8628. dimRatio: dimRatio === 100 ? 50 : dimRatio,
  8629. url: media.url,
  8630. id: media.id,
  8631. alt: media === null || media === void 0 ? void 0 : media.alt,
  8632. backgroundType: mediaType,
  8633. ...(mediaType === VIDEO_BACKGROUND_TYPE ? {
  8634. focalPoint: undefined,
  8635. hasParallax: undefined
  8636. } : {})
  8637. });
  8638. };
  8639. }
  8640. /**
  8641. * Checks of the contentPosition is the center (default) position.
  8642. *
  8643. * @param {string} contentPosition The current content position.
  8644. * @return {boolean} Whether the contentPosition is center.
  8645. */
  8646. function isContentPositionCenter(contentPosition) {
  8647. return !contentPosition || contentPosition === 'center center' || contentPosition === 'center';
  8648. }
  8649. /**
  8650. * Retrieves the className for the current contentPosition.
  8651. * The default position (center) will not have a className.
  8652. *
  8653. * @param {string} contentPosition The current content position.
  8654. * @return {string} The className assigned to the contentPosition.
  8655. */
  8656. function getPositionClassName(contentPosition) {
  8657. /*
  8658. * Only render a className if the contentPosition is not center (the default).
  8659. */
  8660. if (isContentPositionCenter(contentPosition)) return '';
  8661. return POSITION_CLASSNAMES[contentPosition];
  8662. }
  8663. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js
  8664. /**
  8665. * External dependencies
  8666. */
  8667. /**
  8668. * WordPress dependencies
  8669. */
  8670. /**
  8671. * Internal dependencies
  8672. */
  8673. /**
  8674. * Original function to determine the background opacity classname
  8675. *
  8676. * Used in deprecations: v1-7.
  8677. *
  8678. * @param {number} ratio ratio to use for opacity.
  8679. * @return {string} background opacity class .
  8680. */
  8681. function dimRatioToClassV1(ratio) {
  8682. return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
  8683. }
  8684. function migrateDimRatio(attributes) {
  8685. return { ...attributes,
  8686. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  8687. };
  8688. }
  8689. const deprecated_blockAttributes = {
  8690. url: {
  8691. type: 'string'
  8692. },
  8693. id: {
  8694. type: 'number'
  8695. },
  8696. hasParallax: {
  8697. type: 'boolean',
  8698. default: false
  8699. },
  8700. dimRatio: {
  8701. type: 'number',
  8702. default: 50
  8703. },
  8704. overlayColor: {
  8705. type: 'string'
  8706. },
  8707. customOverlayColor: {
  8708. type: 'string'
  8709. },
  8710. backgroundType: {
  8711. type: 'string',
  8712. default: 'image'
  8713. },
  8714. focalPoint: {
  8715. type: 'object'
  8716. }
  8717. }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
  8718. const v9 = {
  8719. attributes: {
  8720. url: {
  8721. type: 'string'
  8722. },
  8723. id: {
  8724. type: 'number'
  8725. },
  8726. alt: {
  8727. type: 'string',
  8728. source: 'attribute',
  8729. selector: 'img',
  8730. attribute: 'alt',
  8731. default: ''
  8732. },
  8733. hasParallax: {
  8734. type: 'boolean',
  8735. default: false
  8736. },
  8737. isRepeated: {
  8738. type: 'boolean',
  8739. default: false
  8740. },
  8741. dimRatio: {
  8742. type: 'number',
  8743. default: 100
  8744. },
  8745. overlayColor: {
  8746. type: 'string'
  8747. },
  8748. customOverlayColor: {
  8749. type: 'string'
  8750. },
  8751. backgroundType: {
  8752. type: 'string',
  8753. default: 'image'
  8754. },
  8755. focalPoint: {
  8756. type: 'object'
  8757. },
  8758. minHeight: {
  8759. type: 'number'
  8760. },
  8761. minHeightUnit: {
  8762. type: 'string'
  8763. },
  8764. gradient: {
  8765. type: 'string'
  8766. },
  8767. customGradient: {
  8768. type: 'string'
  8769. },
  8770. contentPosition: {
  8771. type: 'string'
  8772. },
  8773. isDark: {
  8774. type: 'boolean',
  8775. default: true
  8776. },
  8777. allowedBlocks: {
  8778. type: 'array'
  8779. },
  8780. templateLock: {
  8781. type: ['string', 'boolean'],
  8782. enum: ['all', 'insert', false]
  8783. }
  8784. },
  8785. supports: {
  8786. anchor: true,
  8787. align: true,
  8788. html: false,
  8789. spacing: {
  8790. padding: true,
  8791. __experimentalDefaultControls: {
  8792. padding: true
  8793. }
  8794. },
  8795. color: {
  8796. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  8797. text: false,
  8798. background: false
  8799. }
  8800. },
  8801. save(_ref) {
  8802. let {
  8803. attributes
  8804. } = _ref;
  8805. const {
  8806. backgroundType,
  8807. gradient,
  8808. contentPosition,
  8809. customGradient,
  8810. customOverlayColor,
  8811. dimRatio,
  8812. focalPoint,
  8813. hasParallax,
  8814. isDark,
  8815. isRepeated,
  8816. overlayColor,
  8817. url,
  8818. alt,
  8819. id,
  8820. minHeight: minHeightProp,
  8821. minHeightUnit
  8822. } = attributes;
  8823. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  8824. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  8825. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  8826. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  8827. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  8828. const isImgElement = !(hasParallax || isRepeated);
  8829. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  8830. minHeight: minHeight || undefined
  8831. };
  8832. const bgStyle = {
  8833. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  8834. background: customGradient ? customGradient : undefined
  8835. };
  8836. const objectPosition = // prettier-ignore
  8837. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  8838. const classes = classnames_default()({
  8839. 'is-light': !isDark,
  8840. 'has-parallax': hasParallax,
  8841. 'is-repeated': isRepeated,
  8842. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  8843. }, getPositionClassName(contentPosition));
  8844. const gradientValue = gradient || customGradient;
  8845. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  8846. className: classes,
  8847. style
  8848. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  8849. "aria-hidden": "true",
  8850. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  8851. 'has-background-dim': dimRatio !== undefined,
  8852. // For backwards compatibility. Former versions of the Cover Block applied
  8853. // `.wp-block-cover__gradient-background` in the presence of
  8854. // media, a gradient and a dim.
  8855. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  8856. 'has-background-gradient': gradientValue,
  8857. [gradientClass]: gradientClass
  8858. }),
  8859. style: bgStyle
  8860. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  8861. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  8862. alt: alt,
  8863. src: url,
  8864. style: {
  8865. objectPosition
  8866. },
  8867. "data-object-fit": "cover",
  8868. "data-object-position": objectPosition
  8869. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  8870. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  8871. autoPlay: true,
  8872. muted: true,
  8873. loop: true,
  8874. playsInline: true,
  8875. src: url,
  8876. style: {
  8877. objectPosition
  8878. },
  8879. "data-object-fit": "cover",
  8880. "data-object-position": objectPosition
  8881. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  8882. className: 'wp-block-cover__inner-container'
  8883. })));
  8884. }
  8885. }; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
  8886. const v8 = {
  8887. attributes: {
  8888. url: {
  8889. type: 'string'
  8890. },
  8891. id: {
  8892. type: 'number'
  8893. },
  8894. alt: {
  8895. type: 'string',
  8896. source: 'attribute',
  8897. selector: 'img',
  8898. attribute: 'alt',
  8899. default: ''
  8900. },
  8901. hasParallax: {
  8902. type: 'boolean',
  8903. default: false
  8904. },
  8905. isRepeated: {
  8906. type: 'boolean',
  8907. default: false
  8908. },
  8909. dimRatio: {
  8910. type: 'number',
  8911. default: 100
  8912. },
  8913. overlayColor: {
  8914. type: 'string'
  8915. },
  8916. customOverlayColor: {
  8917. type: 'string'
  8918. },
  8919. backgroundType: {
  8920. type: 'string',
  8921. default: 'image'
  8922. },
  8923. focalPoint: {
  8924. type: 'object'
  8925. },
  8926. minHeight: {
  8927. type: 'number'
  8928. },
  8929. minHeightUnit: {
  8930. type: 'string'
  8931. },
  8932. gradient: {
  8933. type: 'string'
  8934. },
  8935. customGradient: {
  8936. type: 'string'
  8937. },
  8938. contentPosition: {
  8939. type: 'string'
  8940. },
  8941. isDark: {
  8942. type: 'boolean',
  8943. default: true
  8944. },
  8945. allowedBlocks: {
  8946. type: 'array'
  8947. },
  8948. templateLock: {
  8949. type: ['string', 'boolean'],
  8950. enum: ['all', 'insert', false]
  8951. }
  8952. },
  8953. supports: {
  8954. anchor: true,
  8955. align: true,
  8956. html: false,
  8957. spacing: {
  8958. padding: true,
  8959. __experimentalDefaultControls: {
  8960. padding: true
  8961. }
  8962. },
  8963. color: {
  8964. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  8965. text: false,
  8966. background: false
  8967. }
  8968. },
  8969. save(_ref2) {
  8970. let {
  8971. attributes
  8972. } = _ref2;
  8973. const {
  8974. backgroundType,
  8975. gradient,
  8976. contentPosition,
  8977. customGradient,
  8978. customOverlayColor,
  8979. dimRatio,
  8980. focalPoint,
  8981. hasParallax,
  8982. isDark,
  8983. isRepeated,
  8984. overlayColor,
  8985. url,
  8986. alt,
  8987. id,
  8988. minHeight: minHeightProp,
  8989. minHeightUnit
  8990. } = attributes;
  8991. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  8992. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  8993. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  8994. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  8995. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  8996. const isImgElement = !(hasParallax || isRepeated);
  8997. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  8998. minHeight: minHeight || undefined
  8999. };
  9000. const bgStyle = {
  9001. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  9002. background: customGradient ? customGradient : undefined
  9003. };
  9004. const objectPosition = // prettier-ignore
  9005. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  9006. const classes = classnames_default()({
  9007. 'is-light': !isDark,
  9008. 'has-parallax': hasParallax,
  9009. 'is-repeated': isRepeated,
  9010. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  9011. }, getPositionClassName(contentPosition));
  9012. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  9013. className: classes,
  9014. style
  9015. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  9016. "aria-hidden": "true",
  9017. className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, {
  9018. 'has-background-dim': dimRatio !== undefined,
  9019. 'has-background-gradient': gradient || customGradient,
  9020. [gradientClass]: !url && gradientClass
  9021. }),
  9022. style: bgStyle
  9023. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  9024. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  9025. alt: alt,
  9026. src: url,
  9027. style: {
  9028. objectPosition
  9029. },
  9030. "data-object-fit": "cover",
  9031. "data-object-position": objectPosition
  9032. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9033. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  9034. autoPlay: true,
  9035. muted: true,
  9036. loop: true,
  9037. playsInline: true,
  9038. src: url,
  9039. style: {
  9040. objectPosition
  9041. },
  9042. "data-object-fit": "cover",
  9043. "data-object-position": objectPosition
  9044. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  9045. className: 'wp-block-cover__inner-container'
  9046. })));
  9047. }
  9048. };
  9049. const v7 = {
  9050. attributes: { ...deprecated_blockAttributes,
  9051. isRepeated: {
  9052. type: 'boolean',
  9053. default: false
  9054. },
  9055. minHeight: {
  9056. type: 'number'
  9057. },
  9058. minHeightUnit: {
  9059. type: 'string'
  9060. },
  9061. gradient: {
  9062. type: 'string'
  9063. },
  9064. customGradient: {
  9065. type: 'string'
  9066. },
  9067. contentPosition: {
  9068. type: 'string'
  9069. },
  9070. alt: {
  9071. type: 'string',
  9072. source: 'attribute',
  9073. selector: 'img',
  9074. attribute: 'alt',
  9075. default: ''
  9076. }
  9077. },
  9078. supports: {
  9079. anchor: true,
  9080. align: true,
  9081. html: false,
  9082. spacing: {
  9083. padding: true,
  9084. __experimentalDefaultControls: {
  9085. padding: true
  9086. }
  9087. },
  9088. color: {
  9089. __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
  9090. text: false,
  9091. background: false
  9092. }
  9093. },
  9094. save(_ref3) {
  9095. let {
  9096. attributes
  9097. } = _ref3;
  9098. const {
  9099. backgroundType,
  9100. gradient,
  9101. contentPosition,
  9102. customGradient,
  9103. customOverlayColor,
  9104. dimRatio,
  9105. focalPoint,
  9106. hasParallax,
  9107. isRepeated,
  9108. overlayColor,
  9109. url,
  9110. alt,
  9111. id,
  9112. minHeight: minHeightProp,
  9113. minHeightUnit
  9114. } = attributes;
  9115. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9116. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9117. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  9118. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  9119. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  9120. const isImgElement = !(hasParallax || isRepeated);
  9121. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
  9122. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  9123. background: customGradient && !url ? customGradient : undefined,
  9124. minHeight: minHeight || undefined
  9125. };
  9126. const objectPosition = // prettier-ignore
  9127. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  9128. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9129. 'has-background-dim': dimRatio !== 0,
  9130. 'has-parallax': hasParallax,
  9131. 'is-repeated': isRepeated,
  9132. 'has-background-gradient': gradient || customGradient,
  9133. [gradientClass]: !url && gradientClass,
  9134. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  9135. }, getPositionClassName(contentPosition));
  9136. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  9137. className: classes,
  9138. style
  9139. }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9140. "aria-hidden": "true",
  9141. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9142. style: customGradient ? {
  9143. background: customGradient
  9144. } : undefined
  9145. }), isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  9146. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  9147. alt: alt,
  9148. src: url,
  9149. style: {
  9150. objectPosition
  9151. },
  9152. "data-object-fit": "cover",
  9153. "data-object-position": objectPosition
  9154. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9155. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  9156. autoPlay: true,
  9157. muted: true,
  9158. loop: true,
  9159. playsInline: true,
  9160. src: url,
  9161. style: {
  9162. objectPosition
  9163. },
  9164. "data-object-fit": "cover",
  9165. "data-object-position": objectPosition
  9166. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9167. className: "wp-block-cover__inner-container"
  9168. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9169. },
  9170. migrate: migrateDimRatio
  9171. };
  9172. const v6 = {
  9173. attributes: { ...deprecated_blockAttributes,
  9174. isRepeated: {
  9175. type: 'boolean',
  9176. default: false
  9177. },
  9178. minHeight: {
  9179. type: 'number'
  9180. },
  9181. minHeightUnit: {
  9182. type: 'string'
  9183. },
  9184. gradient: {
  9185. type: 'string'
  9186. },
  9187. customGradient: {
  9188. type: 'string'
  9189. },
  9190. contentPosition: {
  9191. type: 'string'
  9192. }
  9193. },
  9194. supports: {
  9195. align: true
  9196. },
  9197. save(_ref4) {
  9198. let {
  9199. attributes
  9200. } = _ref4;
  9201. const {
  9202. backgroundType,
  9203. gradient,
  9204. contentPosition,
  9205. customGradient,
  9206. customOverlayColor,
  9207. dimRatio,
  9208. focalPoint,
  9209. hasParallax,
  9210. isRepeated,
  9211. overlayColor,
  9212. url,
  9213. minHeight: minHeightProp,
  9214. minHeightUnit
  9215. } = attributes;
  9216. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9217. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9218. const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  9219. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  9220. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  9221. const style = isImageBackground ? backgroundImageStyles(url) : {};
  9222. const videoStyle = {};
  9223. if (!overlayColorClass) {
  9224. style.backgroundColor = customOverlayColor;
  9225. }
  9226. if (customGradient && !url) {
  9227. style.background = customGradient;
  9228. }
  9229. style.minHeight = minHeight || undefined;
  9230. let positionValue;
  9231. if (focalPoint) {
  9232. positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
  9233. if (isImageBackground && !hasParallax) {
  9234. style.backgroundPosition = positionValue;
  9235. }
  9236. if (isVideoBackground) {
  9237. videoStyle.objectPosition = positionValue;
  9238. }
  9239. }
  9240. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9241. 'has-background-dim': dimRatio !== 0,
  9242. 'has-parallax': hasParallax,
  9243. 'is-repeated': isRepeated,
  9244. 'has-background-gradient': gradient || customGradient,
  9245. [gradientClass]: !url && gradientClass,
  9246. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  9247. }, getPositionClassName(contentPosition));
  9248. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  9249. className: classes,
  9250. style
  9251. }), url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9252. "aria-hidden": "true",
  9253. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9254. style: customGradient ? {
  9255. background: customGradient
  9256. } : undefined
  9257. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9258. className: "wp-block-cover__video-background",
  9259. autoPlay: true,
  9260. muted: true,
  9261. loop: true,
  9262. playsInline: true,
  9263. src: url,
  9264. style: videoStyle
  9265. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9266. className: "wp-block-cover__inner-container"
  9267. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9268. },
  9269. migrate: migrateDimRatio
  9270. };
  9271. const v5 = {
  9272. attributes: { ...deprecated_blockAttributes,
  9273. minHeight: {
  9274. type: 'number'
  9275. },
  9276. gradient: {
  9277. type: 'string'
  9278. },
  9279. customGradient: {
  9280. type: 'string'
  9281. }
  9282. },
  9283. supports: {
  9284. align: true
  9285. },
  9286. save(_ref5) {
  9287. let {
  9288. attributes
  9289. } = _ref5;
  9290. const {
  9291. backgroundType,
  9292. gradient,
  9293. customGradient,
  9294. customOverlayColor,
  9295. dimRatio,
  9296. focalPoint,
  9297. hasParallax,
  9298. overlayColor,
  9299. url,
  9300. minHeight
  9301. } = attributes;
  9302. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9303. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9304. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  9305. if (!overlayColorClass) {
  9306. style.backgroundColor = customOverlayColor;
  9307. }
  9308. if (focalPoint && !hasParallax) {
  9309. style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`;
  9310. }
  9311. if (customGradient && !url) {
  9312. style.background = customGradient;
  9313. }
  9314. style.minHeight = minHeight || undefined;
  9315. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9316. 'has-background-dim': dimRatio !== 0,
  9317. 'has-parallax': hasParallax,
  9318. 'has-background-gradient': customGradient,
  9319. [gradientClass]: !url && gradientClass
  9320. });
  9321. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9322. className: classes,
  9323. style: style
  9324. }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9325. "aria-hidden": "true",
  9326. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9327. style: customGradient ? {
  9328. background: customGradient
  9329. } : undefined
  9330. }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9331. className: "wp-block-cover__video-background",
  9332. autoPlay: true,
  9333. muted: true,
  9334. loop: true,
  9335. src: url
  9336. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9337. className: "wp-block-cover__inner-container"
  9338. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9339. },
  9340. migrate: migrateDimRatio
  9341. };
  9342. const v4 = {
  9343. attributes: { ...deprecated_blockAttributes,
  9344. minHeight: {
  9345. type: 'number'
  9346. },
  9347. gradient: {
  9348. type: 'string'
  9349. },
  9350. customGradient: {
  9351. type: 'string'
  9352. }
  9353. },
  9354. supports: {
  9355. align: true
  9356. },
  9357. save(_ref6) {
  9358. let {
  9359. attributes
  9360. } = _ref6;
  9361. const {
  9362. backgroundType,
  9363. gradient,
  9364. customGradient,
  9365. customOverlayColor,
  9366. dimRatio,
  9367. focalPoint,
  9368. hasParallax,
  9369. overlayColor,
  9370. url,
  9371. minHeight
  9372. } = attributes;
  9373. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9374. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  9375. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  9376. if (!overlayColorClass) {
  9377. style.backgroundColor = customOverlayColor;
  9378. }
  9379. if (focalPoint && !hasParallax) {
  9380. style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
  9381. }
  9382. if (customGradient && !url) {
  9383. style.background = customGradient;
  9384. }
  9385. style.minHeight = minHeight || undefined;
  9386. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9387. 'has-background-dim': dimRatio !== 0,
  9388. 'has-parallax': hasParallax,
  9389. 'has-background-gradient': customGradient,
  9390. [gradientClass]: !url && gradientClass
  9391. });
  9392. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9393. className: classes,
  9394. style: style
  9395. }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_wp_element_namespaceObject.createElement)("span", {
  9396. "aria-hidden": "true",
  9397. className: classnames_default()('wp-block-cover__gradient-background', gradientClass),
  9398. style: customGradient ? {
  9399. background: customGradient
  9400. } : undefined
  9401. }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9402. className: "wp-block-cover__video-background",
  9403. autoPlay: true,
  9404. muted: true,
  9405. loop: true,
  9406. src: url
  9407. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  9408. className: "wp-block-cover__inner-container"
  9409. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  9410. },
  9411. migrate: migrateDimRatio
  9412. };
  9413. const v3 = {
  9414. attributes: { ...deprecated_blockAttributes,
  9415. title: {
  9416. type: 'string',
  9417. source: 'html',
  9418. selector: 'p'
  9419. },
  9420. contentAlign: {
  9421. type: 'string',
  9422. default: 'center'
  9423. }
  9424. },
  9425. supports: {
  9426. align: true
  9427. },
  9428. save(_ref7) {
  9429. let {
  9430. attributes
  9431. } = _ref7;
  9432. const {
  9433. backgroundType,
  9434. contentAlign,
  9435. customOverlayColor,
  9436. dimRatio,
  9437. focalPoint,
  9438. hasParallax,
  9439. overlayColor,
  9440. title,
  9441. url
  9442. } = attributes;
  9443. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9444. const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
  9445. if (!overlayColorClass) {
  9446. style.backgroundColor = customOverlayColor;
  9447. }
  9448. if (focalPoint && !hasParallax) {
  9449. style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
  9450. }
  9451. const classes = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
  9452. 'has-background-dim': dimRatio !== 0,
  9453. 'has-parallax': hasParallax,
  9454. [`has-${contentAlign}-content`]: contentAlign !== 'center'
  9455. });
  9456. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9457. className: classes,
  9458. style: style
  9459. }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  9460. className: "wp-block-cover__video-background",
  9461. autoPlay: true,
  9462. muted: true,
  9463. loop: true,
  9464. src: url
  9465. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  9466. tagName: "p",
  9467. className: "wp-block-cover-text",
  9468. value: title
  9469. }));
  9470. },
  9471. migrate(attributes) {
  9472. const newAttribs = { ...attributes,
  9473. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  9474. };
  9475. return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  9476. content: attributes.title,
  9477. align: attributes.contentAlign,
  9478. fontSize: 'large',
  9479. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  9480. })]];
  9481. }
  9482. };
  9483. const v2 = {
  9484. attributes: { ...deprecated_blockAttributes,
  9485. title: {
  9486. type: 'string',
  9487. source: 'html',
  9488. selector: 'p'
  9489. },
  9490. contentAlign: {
  9491. type: 'string',
  9492. default: 'center'
  9493. },
  9494. align: {
  9495. type: 'string'
  9496. }
  9497. },
  9498. supports: {
  9499. className: false
  9500. },
  9501. save(_ref8) {
  9502. let {
  9503. attributes
  9504. } = _ref8;
  9505. const {
  9506. url,
  9507. title,
  9508. hasParallax,
  9509. dimRatio,
  9510. align,
  9511. contentAlign,
  9512. overlayColor,
  9513. customOverlayColor
  9514. } = attributes;
  9515. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  9516. const style = backgroundImageStyles(url);
  9517. if (!overlayColorClass) {
  9518. style.backgroundColor = customOverlayColor;
  9519. }
  9520. const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, {
  9521. 'has-background-dim': dimRatio !== 0,
  9522. 'has-parallax': hasParallax,
  9523. [`has-${contentAlign}-content`]: contentAlign !== 'center'
  9524. }, align ? `align${align}` : null);
  9525. return (0,external_wp_element_namespaceObject.createElement)("div", {
  9526. className: classes,
  9527. style: style
  9528. }, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  9529. tagName: "p",
  9530. className: "wp-block-cover-image-text",
  9531. value: title
  9532. }));
  9533. },
  9534. migrate(attributes) {
  9535. const newAttribs = { ...attributes,
  9536. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  9537. };
  9538. return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  9539. content: attributes.title,
  9540. align: attributes.contentAlign,
  9541. fontSize: 'large',
  9542. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  9543. })]];
  9544. }
  9545. };
  9546. const cover_deprecated_v1 = {
  9547. attributes: { ...deprecated_blockAttributes,
  9548. title: {
  9549. type: 'string',
  9550. source: 'html',
  9551. selector: 'h2'
  9552. },
  9553. align: {
  9554. type: 'string'
  9555. },
  9556. contentAlign: {
  9557. type: 'string',
  9558. default: 'center'
  9559. }
  9560. },
  9561. supports: {
  9562. className: false
  9563. },
  9564. save(_ref9) {
  9565. let {
  9566. attributes
  9567. } = _ref9;
  9568. const {
  9569. url,
  9570. title,
  9571. hasParallax,
  9572. dimRatio,
  9573. align
  9574. } = attributes;
  9575. const style = backgroundImageStyles(url);
  9576. const classes = classnames_default()('wp-block-cover-image', dimRatioToClassV1(dimRatio), {
  9577. 'has-background-dim': dimRatio !== 0,
  9578. 'has-parallax': hasParallax
  9579. }, align ? `align${align}` : null);
  9580. return (0,external_wp_element_namespaceObject.createElement)("section", {
  9581. className: classes,
  9582. style: style
  9583. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  9584. tagName: "h2",
  9585. value: title
  9586. }));
  9587. },
  9588. migrate(attributes) {
  9589. const newAttribs = { ...attributes,
  9590. dimRatio: !attributes.url ? 100 : attributes.dimRatio
  9591. };
  9592. return [(0,external_lodash_namespaceObject.omit)(newAttribs, ['title', 'contentAlign', 'align']), [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  9593. content: attributes.title,
  9594. align: attributes.contentAlign,
  9595. fontSize: 'large',
  9596. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…')
  9597. })]];
  9598. }
  9599. };
  9600. /* harmony default export */ var cover_deprecated = ([v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]);
  9601. // EXTERNAL MODULE: ./node_modules/fast-average-color/dist/index.js
  9602. var dist = __webpack_require__(5027);
  9603. var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
  9604. ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs
  9605. var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
  9606. ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs
  9607. /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
  9608. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
  9609. /**
  9610. * WordPress dependencies
  9611. */
  9612. const postFeaturedImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  9613. xmlns: "http://www.w3.org/2000/svg",
  9614. viewBox: "0 0 24 24"
  9615. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  9616. d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
  9617. }));
  9618. /* harmony default export */ var post_featured_image = (postFeaturedImage);
  9619. ;// CONCATENATED MODULE: external ["wp","notices"]
  9620. var external_wp_notices_namespaceObject = window["wp"]["notices"];
  9621. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit.js
  9622. /**
  9623. * External dependencies
  9624. */
  9625. /**
  9626. * WordPress dependencies
  9627. */
  9628. /**
  9629. * Internal dependencies
  9630. */
  9631. k([names]);
  9632. const {
  9633. __Visualizer: BoxControlVisualizer
  9634. } = external_wp_components_namespaceObject.__experimentalBoxControl;
  9635. function getInnerBlocksTemplate(attributes) {
  9636. return [['core/paragraph', {
  9637. align: 'center',
  9638. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'),
  9639. ...attributes
  9640. }]];
  9641. }
  9642. function retrieveFastAverageColor() {
  9643. if (!retrieveFastAverageColor.fastAverageColor) {
  9644. retrieveFastAverageColor.fastAverageColor = new (dist_default())();
  9645. }
  9646. return retrieveFastAverageColor.fastAverageColor;
  9647. }
  9648. function CoverHeightInput(_ref) {
  9649. let {
  9650. onChange,
  9651. onUnitChange,
  9652. unit = 'px',
  9653. value = ''
  9654. } = _ref;
  9655. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
  9656. const inputId = `block-cover-height-input-${instanceId}`;
  9657. const isPx = unit === 'px';
  9658. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  9659. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
  9660. defaultValues: {
  9661. px: 430,
  9662. '%': 20,
  9663. em: 20,
  9664. rem: 20,
  9665. vw: 20,
  9666. vh: 50
  9667. }
  9668. });
  9669. const handleOnChange = unprocessedValue => {
  9670. const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined;
  9671. if (isNaN(inputValue) && inputValue !== undefined) {
  9672. return;
  9673. }
  9674. onChange(inputValue);
  9675. };
  9676. const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
  9677. const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  9678. return [parsedQuantity, unit].join('');
  9679. }, [unit, value]);
  9680. const min = isPx ? COVER_MIN_HEIGHT : 0;
  9681. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  9682. label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'),
  9683. id: inputId
  9684. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  9685. id: inputId,
  9686. isResetValueOnUnitChange: true,
  9687. min: min,
  9688. onChange: handleOnChange,
  9689. onUnitChange: onUnitChange,
  9690. style: {
  9691. maxWidth: 80
  9692. },
  9693. units: units,
  9694. value: computedValue
  9695. }));
  9696. }
  9697. const RESIZABLE_BOX_ENABLE_OPTION = {
  9698. top: false,
  9699. right: false,
  9700. bottom: true,
  9701. left: false,
  9702. topRight: false,
  9703. bottomRight: false,
  9704. bottomLeft: false,
  9705. topLeft: false
  9706. };
  9707. function ResizableCover(_ref2) {
  9708. let {
  9709. className,
  9710. onResizeStart,
  9711. onResize,
  9712. onResizeStop,
  9713. ...props
  9714. } = _ref2;
  9715. const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
  9716. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  9717. className: classnames_default()(className, {
  9718. 'is-resizing': isResizing
  9719. }),
  9720. enable: RESIZABLE_BOX_ENABLE_OPTION,
  9721. onResizeStart: (_event, _direction, elt) => {
  9722. onResizeStart(elt.clientHeight);
  9723. onResize(elt.clientHeight);
  9724. },
  9725. onResize: (_event, _direction, elt) => {
  9726. onResize(elt.clientHeight);
  9727. if (!isResizing) {
  9728. setIsResizing(true);
  9729. }
  9730. },
  9731. onResizeStop: (_event, _direction, elt) => {
  9732. onResizeStop(elt.clientHeight);
  9733. setIsResizing(false);
  9734. }
  9735. }, props));
  9736. }
  9737. /**
  9738. * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
  9739. * background is dark or not.
  9740. *
  9741. * @param {?string} url Url of the media background.
  9742. * @param {?number} dimRatio Transparency of the overlay color. If an image and
  9743. * color are set, dimRatio is used to decide what is used
  9744. * for background darkness checking purposes.
  9745. * @param {?string} overlayColor String containing the overlay color value if one exists.
  9746. * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
  9747. * dom element that renders that media.
  9748. *
  9749. * @return {boolean} True if the cover background is considered "dark" and false otherwise.
  9750. */
  9751. function useCoverIsDark(url) {
  9752. let dimRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
  9753. let overlayColor = arguments.length > 2 ? arguments[2] : undefined;
  9754. let elementRef = arguments.length > 3 ? arguments[3] : undefined;
  9755. const [isDark, setIsDark] = (0,external_wp_element_namespaceObject.useState)(false);
  9756. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9757. // If opacity is lower than 50 the dominant color is the image or video color,
  9758. // so use that color for the dark mode computation.
  9759. if (url && dimRatio <= 50 && elementRef.current) {
  9760. retrieveFastAverageColor().getColorAsync(elementRef.current, color => {
  9761. setIsDark(color.isDark);
  9762. });
  9763. }
  9764. }, [url, url && dimRatio <= 50 && elementRef.current, setIsDark]);
  9765. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9766. // If opacity is greater than 50 the dominant color is the overlay color,
  9767. // so use that color for the dark mode computation.
  9768. if (dimRatio > 50 || !url) {
  9769. if (!overlayColor) {
  9770. // If no overlay color exists the overlay color is black (isDark )
  9771. setIsDark(true);
  9772. return;
  9773. }
  9774. setIsDark(w(overlayColor).isDark());
  9775. }
  9776. }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
  9777. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9778. if (!url && !overlayColor) {
  9779. // Reset isDark.
  9780. setIsDark(false);
  9781. }
  9782. }, [!url && !overlayColor, setIsDark]);
  9783. return isDark;
  9784. }
  9785. function mediaPosition(_ref3) {
  9786. let {
  9787. x,
  9788. y
  9789. } = _ref3;
  9790. return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`;
  9791. }
  9792. /**
  9793. * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while
  9794. * the media (image or video) is being uploaded and will not have an id allocated yet.
  9795. *
  9796. * @param {number} id The id of the media.
  9797. * @param {string} url The url of the media.
  9798. *
  9799. * @return {boolean} Is the URL a Blob URL.
  9800. */
  9801. const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  9802. function CoverPlaceholder(_ref4) {
  9803. let {
  9804. disableMediaButtons = false,
  9805. children,
  9806. onSelectMedia,
  9807. onError,
  9808. style
  9809. } = _ref4;
  9810. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  9811. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  9812. icon: library_cover
  9813. }),
  9814. labels: {
  9815. title: (0,external_wp_i18n_namespaceObject.__)('Cover'),
  9816. instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.')
  9817. },
  9818. onSelect: onSelectMedia,
  9819. accept: "image/*,video/*",
  9820. allowedTypes: shared_ALLOWED_MEDIA_TYPES,
  9821. disableMediaButtons: disableMediaButtons,
  9822. onError: onError,
  9823. style: style
  9824. }, children);
  9825. }
  9826. function CoverEdit(_ref5) {
  9827. var _useSetting, _styleAttribute$spaci, _styleAttribute$visua;
  9828. let {
  9829. attributes,
  9830. clientId,
  9831. isSelected,
  9832. overlayColor,
  9833. setAttributes,
  9834. setOverlayColor,
  9835. toggleSelection,
  9836. context: {
  9837. postId,
  9838. postType
  9839. }
  9840. } = _ref5;
  9841. const {
  9842. contentPosition,
  9843. id,
  9844. useFeaturedImage,
  9845. dimRatio,
  9846. focalPoint,
  9847. hasParallax,
  9848. isDark,
  9849. isRepeated,
  9850. minHeight,
  9851. minHeightUnit,
  9852. style: styleAttribute,
  9853. alt,
  9854. allowedBlocks,
  9855. templateLock
  9856. } = attributes;
  9857. const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
  9858. const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, {
  9859. context: 'view'
  9860. }), [featuredImage]);
  9861. const mediaUrl = media === null || media === void 0 ? void 0 : media.source_url; // instead of destructuring the attributes
  9862. // we define the url and background type
  9863. // depending on the value of the useFeaturedImage flag
  9864. // to preview in edit the dynamic featured image
  9865. const url = useFeaturedImage ? mediaUrl : attributes.url;
  9866. const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : attributes.backgroundType;
  9867. const {
  9868. __unstableMarkNextChangeAsNotPersistent
  9869. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  9870. const {
  9871. createErrorNotice
  9872. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  9873. const {
  9874. gradientClass,
  9875. gradientValue,
  9876. setGradient
  9877. } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
  9878. const onSelectMedia = attributesFromMedia(setAttributes, dimRatio);
  9879. const isUploadingMedia = isTemporaryMedia(id, url);
  9880. const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight);
  9881. const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit);
  9882. const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;
  9883. const toggleMinFullHeight = () => {
  9884. if (isMinFullHeight) {
  9885. // If there aren't previous values, take the default ones.
  9886. if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) {
  9887. return setAttributes({
  9888. minHeight: undefined,
  9889. minHeightUnit: undefined
  9890. });
  9891. } // Set the previous values of height.
  9892. return setAttributes({
  9893. minHeight: prevMinHeightValue,
  9894. minHeightUnit: prevMinHeightUnit
  9895. });
  9896. }
  9897. setPrevMinHeightValue(minHeight);
  9898. setPrevMinHeightUnit(minHeightUnit); // Set full height.
  9899. return setAttributes({
  9900. minHeight: 100,
  9901. minHeightUnit: 'vh'
  9902. });
  9903. };
  9904. const toggleParallax = () => {
  9905. setAttributes({
  9906. hasParallax: !hasParallax,
  9907. ...(!hasParallax ? {
  9908. focalPoint: undefined
  9909. } : {})
  9910. });
  9911. };
  9912. const toggleIsRepeated = () => {
  9913. setAttributes({
  9914. isRepeated: !isRepeated
  9915. });
  9916. };
  9917. const toggleUseFeaturedImage = () => {
  9918. setAttributes({
  9919. id: undefined,
  9920. url: undefined,
  9921. useFeaturedImage: !useFeaturedImage,
  9922. dimRatio: dimRatio === 100 ? 50 : dimRatio,
  9923. backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
  9924. });
  9925. };
  9926. const onUploadError = message => {
  9927. createErrorNotice(Array.isArray(message) ? message[2] : message, {
  9928. type: 'snackbar'
  9929. });
  9930. };
  9931. const isDarkElement = (0,external_wp_element_namespaceObject.useRef)();
  9932. const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color, isDarkElement);
  9933. (0,external_wp_element_namespaceObject.useEffect)(() => {
  9934. // This side-effect should not create an undo level.
  9935. __unstableMarkNextChangeAsNotPersistent();
  9936. setAttributes({
  9937. isDark: isCoverDark
  9938. });
  9939. }, [isCoverDark]);
  9940. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  9941. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  9942. const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight;
  9943. const isImgElement = !(hasParallax || isRepeated);
  9944. const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : undefined),
  9945. minHeight: minHeightWithUnit || undefined
  9946. };
  9947. const bgStyle = {
  9948. backgroundColor: overlayColor.color
  9949. };
  9950. const mediaStyle = {
  9951. objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined
  9952. };
  9953. const hasBackground = !!(url || overlayColor.color || gradientValue);
  9954. const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
  9955. const imperativeFocalPointPreview = value => {
  9956. const [styleOfRef, property] = isDarkElement.current ? [isDarkElement.current.style, 'objectPosition'] : [ref.current.style, 'backgroundPosition'];
  9957. styleOfRef[property] = mediaPosition(value);
  9958. };
  9959. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]);
  9960. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  9961. group: "block"
  9962. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, {
  9963. label: (0,external_wp_i18n_namespaceObject.__)('Change content position'),
  9964. value: contentPosition,
  9965. onChange: nextPosition => setAttributes({
  9966. contentPosition: nextPosition
  9967. }),
  9968. isDisabled: !hasInnerBlocks
  9969. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, {
  9970. isActive: isMinFullHeight,
  9971. onToggle: toggleMinFullHeight,
  9972. isDisabled: !hasInnerBlocks
  9973. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  9974. group: "other"
  9975. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  9976. icon: post_featured_image,
  9977. label: (0,external_wp_i18n_namespaceObject.__)('Use featured image'),
  9978. isPressed: useFeaturedImage,
  9979. onClick: toggleUseFeaturedImage
  9980. }), !useFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  9981. mediaId: id,
  9982. mediaURL: url,
  9983. allowedTypes: shared_ALLOWED_MEDIA_TYPES,
  9984. accept: "image/*,video/*",
  9985. onSelect: onSelectMedia,
  9986. name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace')
  9987. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  9988. title: (0,external_wp_i18n_namespaceObject.__)('Media settings')
  9989. }, isImageBackground && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  9990. label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'),
  9991. checked: hasParallax,
  9992. onChange: toggleParallax
  9993. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  9994. label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'),
  9995. checked: isRepeated,
  9996. onChange: toggleIsRepeated
  9997. })), showFocalPointPicker && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
  9998. label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
  9999. url: url,
  10000. value: focalPoint,
  10001. onDragStart: imperativeFocalPointPreview,
  10002. onDrag: imperativeFocalPointPreview,
  10003. onChange: newFocalPoint => setAttributes({
  10004. focalPoint: newFocalPoint
  10005. })
  10006. }), !useFeaturedImage && url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  10007. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  10008. value: alt,
  10009. onChange: newAlt => setAttributes({
  10010. alt: newAlt
  10011. }),
  10012. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  10013. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  10014. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  10015. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10016. variant: "secondary",
  10017. isSmall: true,
  10018. className: "block-library-cover__reset-button",
  10019. onClick: () => setAttributes({
  10020. url: undefined,
  10021. id: undefined,
  10022. backgroundType: undefined,
  10023. focalPoint: undefined,
  10024. hasParallax: undefined,
  10025. isRepeated: undefined,
  10026. useFeaturedImage: false
  10027. })
  10028. }, (0,external_wp_i18n_namespaceObject.__)('Clear Media')))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalPanelColorGradientSettings, {
  10029. __experimentalHasMultipleOrigins: true,
  10030. __experimentalIsRenderedInSidebar: true,
  10031. title: (0,external_wp_i18n_namespaceObject.__)('Overlay'),
  10032. initialOpen: true,
  10033. settings: [{
  10034. colorValue: overlayColor.color,
  10035. gradientValue,
  10036. onColorChange: setOverlayColor,
  10037. onGradientChange: setGradient,
  10038. label: (0,external_wp_i18n_namespaceObject.__)('Color')
  10039. }]
  10040. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  10041. label: (0,external_wp_i18n_namespaceObject.__)('Opacity'),
  10042. value: dimRatio,
  10043. onChange: newDimRation => setAttributes({
  10044. dimRatio: newDimRation
  10045. }),
  10046. min: 0,
  10047. max: 100,
  10048. step: 10,
  10049. required: true
  10050. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  10051. __experimentalGroup: "dimensions"
  10052. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  10053. hasValue: () => !!minHeight,
  10054. label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
  10055. onDeselect: () => setAttributes({
  10056. minHeight: undefined,
  10057. minHeightUnit: undefined
  10058. }),
  10059. resetAllFilter: () => ({
  10060. minHeight: undefined,
  10061. minHeightUnit: undefined
  10062. }),
  10063. isShownByDefault: true,
  10064. panelId: clientId
  10065. }, (0,external_wp_element_namespaceObject.createElement)(CoverHeightInput, {
  10066. value: minHeight,
  10067. unit: minHeightUnit,
  10068. onChange: newMinHeight => setAttributes({
  10069. minHeight: newMinHeight
  10070. }),
  10071. onUnitChange: nextUnit => setAttributes({
  10072. minHeightUnit: nextUnit
  10073. })
  10074. }))));
  10075. const ref = (0,external_wp_element_namespaceObject.useRef)();
  10076. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  10077. ref
  10078. }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks.
  10079. const hasFontSizes = !!((_useSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fontSizes')) !== null && _useSetting !== void 0 && _useSetting.length);
  10080. const innerBlocksTemplate = getInnerBlocksTemplate({
  10081. fontSize: hasFontSizes ? 'large' : undefined
  10082. });
  10083. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  10084. className: 'wp-block-cover__inner-container'
  10085. }, {
  10086. template: innerBlocksTemplate,
  10087. templateInsertUpdatesSelection: true,
  10088. allowedBlocks,
  10089. templateLock
  10090. });
  10091. if (!hasInnerBlocks && !hasBackground) {
  10092. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  10093. className: classnames_default()('is-placeholder', blockProps.className)
  10094. }), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
  10095. onSelectMedia: onSelectMedia,
  10096. onError: onUploadError,
  10097. style: {
  10098. minHeight: minHeightWithUnit || undefined
  10099. }
  10100. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  10101. className: "wp-block-cover__placeholder-background-options"
  10102. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ColorPalette, {
  10103. disableCustomColors: true,
  10104. value: overlayColor.color,
  10105. onChange: setOverlayColor,
  10106. clearable: false
  10107. }))), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
  10108. className: "block-library-cover__resize-container",
  10109. onResizeStart: () => {
  10110. setAttributes({
  10111. minHeightUnit: 'px'
  10112. });
  10113. toggleSelection(false);
  10114. },
  10115. onResize: value => {
  10116. setAttributes({
  10117. minHeight: value
  10118. });
  10119. },
  10120. onResizeStop: newMinHeight => {
  10121. toggleSelection(true);
  10122. setAttributes({
  10123. minHeight: newMinHeight
  10124. });
  10125. },
  10126. showHandle: isSelected
  10127. })));
  10128. }
  10129. const classes = classnames_default()({
  10130. 'is-dark-theme': isDark,
  10131. 'is-light': !isDark,
  10132. 'is-transient': isUploadingMedia,
  10133. 'has-parallax': hasParallax,
  10134. 'is-repeated': isRepeated,
  10135. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10136. }, getPositionClassName(contentPosition));
  10137. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  10138. className: classnames_default()(classes, blockProps.className),
  10139. style: { ...style,
  10140. ...blockProps.style
  10141. },
  10142. "data-url": url
  10143. }), (0,external_wp_element_namespaceObject.createElement)(BoxControlVisualizer, {
  10144. values: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$spaci = styleAttribute.spacing) === null || _styleAttribute$spaci === void 0 ? void 0 : _styleAttribute$spaci.padding,
  10145. showValues: styleAttribute === null || styleAttribute === void 0 ? void 0 : (_styleAttribute$visua = styleAttribute.visualizers) === null || _styleAttribute$visua === void 0 ? void 0 : _styleAttribute$visua.padding,
  10146. className: "block-library-cover__padding-visualizer"
  10147. }), (0,external_wp_element_namespaceObject.createElement)(ResizableCover, {
  10148. className: "block-library-cover__resize-container",
  10149. onResizeStart: () => {
  10150. setAttributes({
  10151. minHeightUnit: 'px'
  10152. });
  10153. toggleSelection(false);
  10154. },
  10155. onResize: value => {
  10156. setAttributes({
  10157. minHeight: value
  10158. });
  10159. },
  10160. onResizeStop: newMinHeight => {
  10161. toggleSelection(true);
  10162. setAttributes({
  10163. minHeight: newMinHeight
  10164. });
  10165. },
  10166. showHandle: isSelected
  10167. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10168. "aria-hidden": "true",
  10169. className: classnames_default()('wp-block-cover__background', dimRatioToClass(dimRatio), {
  10170. [overlayColor.class]: overlayColor.class,
  10171. 'has-background-dim': dimRatio !== undefined,
  10172. // For backwards compatibility. Former versions of the Cover Block applied
  10173. // `.wp-block-cover__gradient-background` in the presence of
  10174. // media, a gradient and a dim.
  10175. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  10176. 'has-background-gradient': gradientValue,
  10177. [gradientClass]: gradientClass
  10178. }),
  10179. style: {
  10180. backgroundImage: gradientValue,
  10181. ...bgStyle
  10182. }
  10183. }), url && isImageBackground && isImgElement && (0,external_wp_element_namespaceObject.createElement)("img", {
  10184. ref: isDarkElement,
  10185. className: "wp-block-cover__image-background",
  10186. alt: alt,
  10187. src: url,
  10188. style: mediaStyle
  10189. }), url && isVideoBackground && (0,external_wp_element_namespaceObject.createElement)("video", {
  10190. ref: isDarkElement,
  10191. className: "wp-block-cover__video-background",
  10192. autoPlay: true,
  10193. muted: true,
  10194. loop: true,
  10195. src: url,
  10196. style: mediaStyle
  10197. }), isUploadingMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(CoverPlaceholder, {
  10198. disableMediaButtons: true,
  10199. onSelectMedia: onSelectMedia,
  10200. onError: onUploadError
  10201. }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  10202. }
  10203. /* harmony default export */ var cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({
  10204. overlayColor: 'background-color'
  10205. })])(CoverEdit));
  10206. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js
  10207. /**
  10208. * External dependencies
  10209. */
  10210. /**
  10211. * WordPress dependencies
  10212. */
  10213. /**
  10214. * Internal dependencies
  10215. */
  10216. function cover_save_save(_ref) {
  10217. let {
  10218. attributes
  10219. } = _ref;
  10220. const {
  10221. backgroundType,
  10222. gradient,
  10223. contentPosition,
  10224. customGradient,
  10225. customOverlayColor,
  10226. dimRatio,
  10227. focalPoint,
  10228. useFeaturedImage,
  10229. hasParallax,
  10230. isDark,
  10231. isRepeated,
  10232. overlayColor,
  10233. url,
  10234. alt,
  10235. id,
  10236. minHeight: minHeightProp,
  10237. minHeightUnit
  10238. } = attributes;
  10239. const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
  10240. const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
  10241. const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
  10242. const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  10243. const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  10244. const isImgElement = !(hasParallax || isRepeated);
  10245. const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}),
  10246. minHeight: minHeight || undefined
  10247. };
  10248. const bgStyle = {
  10249. backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
  10250. background: customGradient ? customGradient : undefined
  10251. };
  10252. const objectPosition = // prettier-ignore
  10253. focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
  10254. const classes = classnames_default()({
  10255. 'is-light': !isDark,
  10256. 'has-parallax': hasParallax,
  10257. 'is-repeated': isRepeated,
  10258. 'has-custom-content-position': !isContentPositionCenter(contentPosition)
  10259. }, getPositionClassName(contentPosition));
  10260. const gradientValue = gradient || customGradient;
  10261. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  10262. className: classes,
  10263. style
  10264. }), (0,external_wp_element_namespaceObject.createElement)("span", {
  10265. "aria-hidden": "true",
  10266. className: classnames_default()('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
  10267. 'has-background-dim': dimRatio !== undefined,
  10268. // For backwards compatibility. Former versions of the Cover Block applied
  10269. // `.wp-block-cover__gradient-background` in the presence of
  10270. // media, a gradient and a dim.
  10271. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
  10272. 'has-background-gradient': gradientValue,
  10273. [gradientClass]: gradientClass
  10274. }),
  10275. style: bgStyle
  10276. }), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_wp_element_namespaceObject.createElement)("img", {
  10277. className: classnames_default()('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
  10278. alt: alt,
  10279. src: url,
  10280. style: {
  10281. objectPosition
  10282. },
  10283. "data-object-fit": "cover",
  10284. "data-object-position": objectPosition
  10285. }), isVideoBackground && url && (0,external_wp_element_namespaceObject.createElement)("video", {
  10286. className: classnames_default()('wp-block-cover__video-background', 'intrinsic-ignore'),
  10287. autoPlay: true,
  10288. muted: true,
  10289. loop: true,
  10290. playsInline: true,
  10291. src: url,
  10292. style: {
  10293. objectPosition
  10294. },
  10295. "data-object-fit": "cover",
  10296. "data-object-position": objectPosition
  10297. }), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  10298. className: 'wp-block-cover__inner-container'
  10299. })));
  10300. }
  10301. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js
  10302. /**
  10303. * WordPress dependencies
  10304. */
  10305. /**
  10306. * Internal dependencies
  10307. */
  10308. const cover_transforms_transforms = {
  10309. from: [{
  10310. type: 'block',
  10311. blocks: ['core/image'],
  10312. transform: _ref => {
  10313. var _style$color;
  10314. let {
  10315. caption,
  10316. url,
  10317. alt,
  10318. align,
  10319. id,
  10320. anchor,
  10321. style
  10322. } = _ref;
  10323. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
  10324. dimRatio: 50,
  10325. url,
  10326. alt,
  10327. align,
  10328. id,
  10329. anchor,
  10330. style: {
  10331. color: {
  10332. duotone: style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone
  10333. }
  10334. }
  10335. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  10336. content: caption,
  10337. fontSize: 'large',
  10338. align: 'center'
  10339. })]);
  10340. }
  10341. }, {
  10342. type: 'block',
  10343. blocks: ['core/video'],
  10344. transform: _ref2 => {
  10345. let {
  10346. caption,
  10347. src,
  10348. align,
  10349. id,
  10350. anchor
  10351. } = _ref2;
  10352. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', {
  10353. dimRatio: 50,
  10354. url: src,
  10355. align,
  10356. id,
  10357. backgroundType: VIDEO_BACKGROUND_TYPE,
  10358. anchor
  10359. }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  10360. content: caption,
  10361. fontSize: 'large',
  10362. align: 'center'
  10363. })]);
  10364. }
  10365. }, {
  10366. type: 'block',
  10367. blocks: ['core/group'],
  10368. transform: (attributes, innerBlocks) => {
  10369. var _style$color2, _style$color3, _style$color4, _style$color5, _attributes$style;
  10370. const {
  10371. align,
  10372. anchor,
  10373. backgroundColor,
  10374. gradient,
  10375. style
  10376. } = attributes; // If no background or gradient color is provided, default to 50% opacity.
  10377. // This matches the styling of a Cover block with a background image,
  10378. // in the state where a background image has been removed.
  10379. const dimRatio = backgroundColor || gradient || style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background || style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block.
  10380. const parentAttributes = {
  10381. align,
  10382. anchor,
  10383. dimRatio,
  10384. overlayColor: backgroundColor,
  10385. customOverlayColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background,
  10386. gradient,
  10387. customGradient: style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient
  10388. };
  10389. const attributesWithoutBackgroundColors = { ...attributes,
  10390. backgroundColor: undefined,
  10391. gradient: undefined,
  10392. style: { ...(attributes === null || attributes === void 0 ? void 0 : attributes.style),
  10393. color: { ...(attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.color),
  10394. background: undefined,
  10395. gradient: undefined
  10396. }
  10397. }
  10398. }; // Preserve the block by nesting it within the Cover block,
  10399. // instead of converting the Group block directly to the Cover block.
  10400. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]);
  10401. }
  10402. }],
  10403. to: [{
  10404. type: 'block',
  10405. blocks: ['core/image'],
  10406. isMatch: _ref3 => {
  10407. let {
  10408. backgroundType,
  10409. url,
  10410. overlayColor,
  10411. customOverlayColor,
  10412. gradient,
  10413. customGradient
  10414. } = _ref3;
  10415. if (url) {
  10416. // If a url exists the transform could happen if that URL represents an image background.
  10417. return backgroundType === IMAGE_BACKGROUND_TYPE;
  10418. } // If a url is not set the transform could happen if the cover has no background color or gradient;
  10419. return !overlayColor && !customOverlayColor && !gradient && !customGradient;
  10420. },
  10421. transform: _ref4 => {
  10422. var _style$color6;
  10423. let {
  10424. title,
  10425. url,
  10426. alt,
  10427. align,
  10428. id,
  10429. anchor,
  10430. style
  10431. } = _ref4;
  10432. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  10433. caption: title,
  10434. url,
  10435. alt,
  10436. align,
  10437. id,
  10438. anchor,
  10439. style: {
  10440. color: {
  10441. duotone: style === null || style === void 0 ? void 0 : (_style$color6 = style.color) === null || _style$color6 === void 0 ? void 0 : _style$color6.duotone
  10442. }
  10443. }
  10444. });
  10445. }
  10446. }, {
  10447. type: 'block',
  10448. blocks: ['core/video'],
  10449. isMatch: _ref5 => {
  10450. let {
  10451. backgroundType,
  10452. url,
  10453. overlayColor,
  10454. customOverlayColor,
  10455. gradient,
  10456. customGradient
  10457. } = _ref5;
  10458. if (url) {
  10459. // If a url exists the transform could happen if that URL represents a video background.
  10460. return backgroundType === VIDEO_BACKGROUND_TYPE;
  10461. } // If a url is not set the transform could happen if the cover has no background color or gradient;
  10462. return !overlayColor && !customOverlayColor && !gradient && !customGradient;
  10463. },
  10464. transform: _ref6 => {
  10465. let {
  10466. title,
  10467. url,
  10468. align,
  10469. id,
  10470. anchor
  10471. } = _ref6;
  10472. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  10473. caption: title,
  10474. src: url,
  10475. id,
  10476. align,
  10477. anchor
  10478. });
  10479. }
  10480. }]
  10481. };
  10482. /* harmony default export */ var cover_transforms = (cover_transforms_transforms);
  10483. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js
  10484. /**
  10485. * WordPress dependencies
  10486. */
  10487. /**
  10488. * Internal dependencies
  10489. */
  10490. const cover_metadata = {
  10491. $schema: "https://schemas.wp.org/trunk/block.json",
  10492. apiVersion: 2,
  10493. name: "core/cover",
  10494. title: "Cover",
  10495. category: "media",
  10496. description: "Add an image or video with a text overlay \u2014 great for headers.",
  10497. textdomain: "default",
  10498. attributes: {
  10499. url: {
  10500. type: "string"
  10501. },
  10502. useFeaturedImage: {
  10503. type: "boolean",
  10504. "default": false
  10505. },
  10506. id: {
  10507. type: "number"
  10508. },
  10509. alt: {
  10510. type: "string",
  10511. source: "attribute",
  10512. selector: "img",
  10513. attribute: "alt",
  10514. "default": ""
  10515. },
  10516. hasParallax: {
  10517. type: "boolean",
  10518. "default": false
  10519. },
  10520. isRepeated: {
  10521. type: "boolean",
  10522. "default": false
  10523. },
  10524. dimRatio: {
  10525. type: "number",
  10526. "default": 100
  10527. },
  10528. overlayColor: {
  10529. type: "string"
  10530. },
  10531. customOverlayColor: {
  10532. type: "string"
  10533. },
  10534. backgroundType: {
  10535. type: "string",
  10536. "default": "image"
  10537. },
  10538. focalPoint: {
  10539. type: "object"
  10540. },
  10541. minHeight: {
  10542. type: "number"
  10543. },
  10544. minHeightUnit: {
  10545. type: "string"
  10546. },
  10547. gradient: {
  10548. type: "string"
  10549. },
  10550. customGradient: {
  10551. type: "string"
  10552. },
  10553. contentPosition: {
  10554. type: "string"
  10555. },
  10556. isDark: {
  10557. type: "boolean",
  10558. "default": true
  10559. },
  10560. allowedBlocks: {
  10561. type: "array"
  10562. },
  10563. templateLock: {
  10564. type: ["string", "boolean"],
  10565. "enum": ["all", "insert", false]
  10566. }
  10567. },
  10568. usesContext: ["postId", "postType"],
  10569. supports: {
  10570. anchor: true,
  10571. align: true,
  10572. html: false,
  10573. spacing: {
  10574. padding: true,
  10575. __experimentalDefaultControls: {
  10576. padding: true
  10577. }
  10578. },
  10579. color: {
  10580. __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
  10581. text: false,
  10582. background: false
  10583. }
  10584. },
  10585. editorStyle: "wp-block-cover-editor",
  10586. style: "wp-block-cover"
  10587. };
  10588. const {
  10589. name: cover_name
  10590. } = cover_metadata;
  10591. const cover_settings = {
  10592. icon: library_cover,
  10593. example: {
  10594. attributes: {
  10595. customOverlayColor: '#065174',
  10596. dimRatio: 40,
  10597. url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
  10598. },
  10599. innerBlocks: [{
  10600. name: 'core/paragraph',
  10601. attributes: {
  10602. customFontSize: 48,
  10603. content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'),
  10604. align: 'center'
  10605. }
  10606. }]
  10607. },
  10608. transforms: cover_transforms,
  10609. save: cover_save_save,
  10610. edit: cover_edit,
  10611. deprecated: cover_deprecated
  10612. };
  10613. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
  10614. /**
  10615. * WordPress dependencies
  10616. */
  10617. const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  10618. xmlns: "http://www.w3.org/2000/svg",
  10619. viewBox: "0 0 24 24"
  10620. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  10621. d: "M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"
  10622. }));
  10623. /* harmony default export */ var library_pencil = (pencil);
  10624. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
  10625. /**
  10626. * Internal dependencies
  10627. */
  10628. /* harmony default export */ var library_edit = (library_pencil);
  10629. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js
  10630. /**
  10631. * WordPress dependencies
  10632. */
  10633. function getResponsiveHelp(checked) {
  10634. return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.');
  10635. }
  10636. const EmbedControls = _ref => {
  10637. let {
  10638. blockSupportsResponsive,
  10639. showEditButton,
  10640. themeSupportsResponsive,
  10641. allowResponsive,
  10642. toggleResponsive,
  10643. switchBackToURLInput
  10644. } = _ref;
  10645. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  10646. className: "components-toolbar__control",
  10647. label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'),
  10648. icon: library_edit,
  10649. onClick: switchBackToURLInput
  10650. }))), themeSupportsResponsive && blockSupportsResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  10651. title: (0,external_wp_i18n_namespaceObject.__)('Media settings'),
  10652. className: "blocks-responsive"
  10653. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  10654. label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'),
  10655. checked: allowResponsive,
  10656. help: getResponsiveHelp,
  10657. onChange: toggleResponsive
  10658. }))));
  10659. };
  10660. /* harmony default export */ var embed_controls = (EmbedControls);
  10661. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js
  10662. /**
  10663. * WordPress dependencies
  10664. */
  10665. const embedContentIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10666. viewBox: "0 0 24 24",
  10667. xmlns: "http://www.w3.org/2000/svg"
  10668. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10669. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"
  10670. }));
  10671. const embedAudioIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10672. viewBox: "0 0 24 24",
  10673. xmlns: "http://www.w3.org/2000/svg"
  10674. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10675. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"
  10676. }));
  10677. const embedPhotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10678. viewBox: "0 0 24 24",
  10679. xmlns: "http://www.w3.org/2000/svg"
  10680. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10681. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
  10682. }));
  10683. const embedVideoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10684. viewBox: "0 0 24 24",
  10685. xmlns: "http://www.w3.org/2000/svg"
  10686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10687. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"
  10688. }));
  10689. const embedTwitterIcon = {
  10690. foreground: '#1da1f2',
  10691. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10692. xmlns: "http://www.w3.org/2000/svg",
  10693. viewBox: "0 0 24 24"
  10694. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10695. d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"
  10696. })))
  10697. };
  10698. const embedYouTubeIcon = {
  10699. foreground: '#ff0000',
  10700. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10701. viewBox: "0 0 24 24"
  10702. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10703. d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"
  10704. }))
  10705. };
  10706. const embedFacebookIcon = {
  10707. foreground: '#3b5998',
  10708. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10709. viewBox: "0 0 24 24"
  10710. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10711. d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"
  10712. }))
  10713. };
  10714. const embedInstagramIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10715. viewBox: "0 0 24 24"
  10716. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10717. d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"
  10718. })));
  10719. const embedWordPressIcon = {
  10720. foreground: '#0073AA',
  10721. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10722. viewBox: "0 0 24 24"
  10723. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10724. d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"
  10725. })))
  10726. };
  10727. const embedSpotifyIcon = {
  10728. foreground: '#1db954',
  10729. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10730. viewBox: "0 0 24 24"
  10731. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10732. d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"
  10733. }))
  10734. };
  10735. const embedFlickrIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10736. viewBox: "0 0 24 24"
  10737. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10738. d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"
  10739. }));
  10740. const embedVimeoIcon = {
  10741. foreground: '#1ab7ea',
  10742. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10743. xmlns: "http://www.w3.org/2000/svg",
  10744. viewBox: "0 0 24 24"
  10745. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.G, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10746. d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"
  10747. })))
  10748. };
  10749. const embedRedditIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10750. viewBox: "0 0 24 24"
  10751. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10752. d: "M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z"
  10753. }));
  10754. const embedTumblrIcon = {
  10755. foreground: '#35465c',
  10756. src: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10757. viewBox: "0 0 24 24"
  10758. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10759. d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"
  10760. }))
  10761. };
  10762. const embedAmazonIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10763. viewBox: "0 0 24 24"
  10764. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10765. d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"
  10766. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10767. d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"
  10768. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10769. d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"
  10770. }));
  10771. const embedAnimotoIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10772. viewBox: "0 0 24 24"
  10773. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10774. d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",
  10775. fill: "#4bc7ee"
  10776. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10777. d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",
  10778. fill: "#d4cdcb"
  10779. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10780. d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",
  10781. fill: "#c3d82e"
  10782. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10783. d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",
  10784. fill: "#e4ecb0"
  10785. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10786. d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z",
  10787. fill: "#209dbd"
  10788. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10789. d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",
  10790. fill: "#7cb3c9"
  10791. }));
  10792. const embedDailymotionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10793. viewBox: "0 0 24 24"
  10794. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10795. d: "m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",
  10796. fill: "#333436"
  10797. }));
  10798. const embedPinterestIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10799. width: "24",
  10800. height: "24",
  10801. viewBox: "0 0 24 24",
  10802. version: "1.1"
  10803. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10804. d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
  10805. }));
  10806. const embedWolframIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  10807. viewBox: "0 0 44 44"
  10808. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  10809. d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"
  10810. }));
  10811. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js
  10812. /**
  10813. * WordPress dependencies
  10814. */
  10815. const EmbedLoading = () => (0,external_wp_element_namespaceObject.createElement)("div", {
  10816. className: "wp-block-embed is-loading"
  10817. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  10818. /* harmony default export */ var embed_loading = (EmbedLoading);
  10819. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js
  10820. /**
  10821. * WordPress dependencies
  10822. */
  10823. const EmbedPlaceholder = _ref => {
  10824. let {
  10825. icon,
  10826. label,
  10827. value,
  10828. onSubmit,
  10829. onChange,
  10830. cannotEmbed,
  10831. fallback,
  10832. tryAgain
  10833. } = _ref;
  10834. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  10835. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  10836. icon: icon,
  10837. showColors: true
  10838. }),
  10839. label: label,
  10840. className: "wp-block-embed",
  10841. instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.')
  10842. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  10843. onSubmit: onSubmit
  10844. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  10845. type: "url",
  10846. value: value || '',
  10847. className: "components-placeholder__input",
  10848. "aria-label": label,
  10849. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'),
  10850. onChange: onChange
  10851. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10852. variant: "primary",
  10853. type: "submit"
  10854. }, (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  10855. className: "components-placeholder__learn-more"
  10856. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  10857. href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/support/article/embeds/')
  10858. }, (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds'))), cannotEmbed && (0,external_wp_element_namespaceObject.createElement)("div", {
  10859. className: "components-placeholder__error"
  10860. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  10861. className: "components-placeholder__instructions"
  10862. }, (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10863. variant: "secondary",
  10864. onClick: tryAgain
  10865. }, (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label')), ' ', (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  10866. variant: "secondary",
  10867. onClick: fallback
  10868. }, (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label'))));
  10869. };
  10870. /* harmony default export */ var embed_placeholder = (EmbedPlaceholder);
  10871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js
  10872. /**
  10873. * WordPress dependencies
  10874. */
  10875. /** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */
  10876. const attributeMap = {
  10877. class: 'className',
  10878. frameborder: 'frameBorder',
  10879. marginheight: 'marginHeight',
  10880. marginwidth: 'marginWidth'
  10881. };
  10882. function WpEmbedPreview(_ref) {
  10883. let {
  10884. html
  10885. } = _ref;
  10886. const ref = (0,external_wp_element_namespaceObject.useRef)();
  10887. const props = (0,external_wp_element_namespaceObject.useMemo)(() => {
  10888. const doc = new window.DOMParser().parseFromString(html, 'text/html');
  10889. const iframe = doc.querySelector('iframe');
  10890. const iframeProps = {};
  10891. if (!iframe) return iframeProps;
  10892. Array.from(iframe.attributes).forEach(_ref2 => {
  10893. let {
  10894. name,
  10895. value
  10896. } = _ref2;
  10897. if (name === 'style') return;
  10898. iframeProps[attributeMap[name] || name] = value;
  10899. });
  10900. return iframeProps;
  10901. }, [html]);
  10902. (0,external_wp_element_namespaceObject.useEffect)(() => {
  10903. const {
  10904. ownerDocument
  10905. } = ref.current;
  10906. const {
  10907. defaultView
  10908. } = ownerDocument;
  10909. /**
  10910. * Checks for WordPress embed events signaling the height change when
  10911. * iframe content loads or iframe's window is resized. The event is
  10912. * sent from WordPress core via the window.postMessage API.
  10913. *
  10914. * References:
  10915. * window.postMessage:
  10916. * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
  10917. * WordPress core embed-template on load:
  10918. * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143
  10919. * WordPress core embed-template on resize:
  10920. * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187
  10921. *
  10922. * @param {MessageEvent} event Message event.
  10923. */
  10924. function resizeWPembeds(_ref3) {
  10925. let {
  10926. data: {
  10927. secret,
  10928. message,
  10929. value
  10930. } = {}
  10931. } = _ref3;
  10932. if (message !== 'height' || secret !== props['data-secret']) {
  10933. return;
  10934. }
  10935. ref.current.height = value;
  10936. }
  10937. defaultView.addEventListener('message', resizeWPembeds);
  10938. return () => {
  10939. defaultView.removeEventListener('message', resizeWPembeds);
  10940. };
  10941. }, []);
  10942. return (0,external_wp_element_namespaceObject.createElement)("div", {
  10943. className: "wp-block-embed__wrapper"
  10944. }, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({
  10945. ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]),
  10946. title: props.title
  10947. }, props)));
  10948. }
  10949. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js
  10950. /**
  10951. * Internal dependencies
  10952. */
  10953. /**
  10954. * External dependencies
  10955. */
  10956. /**
  10957. * WordPress dependencies
  10958. */
  10959. /**
  10960. * Internal dependencies
  10961. */
  10962. class EmbedPreview extends external_wp_element_namespaceObject.Component {
  10963. constructor() {
  10964. super(...arguments);
  10965. this.hideOverlay = this.hideOverlay.bind(this);
  10966. this.state = {
  10967. interactive: false
  10968. };
  10969. }
  10970. static getDerivedStateFromProps(nextProps, state) {
  10971. if (!nextProps.isSelected && state.interactive) {
  10972. // We only want to change this when the block is not selected, because changing it when
  10973. // the block becomes selected makes the overlap disappear too early. Hiding the overlay
  10974. // happens on mouseup when the overlay is clicked.
  10975. return {
  10976. interactive: false
  10977. };
  10978. }
  10979. return null;
  10980. }
  10981. hideOverlay() {
  10982. // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop
  10983. // changing, because that happens on mouse down, and the overlay immediately disappears,
  10984. // and the mouse event can end up in the preview content. We can't use onClick on
  10985. // the overlay to hide it either, because then the editor misses the mouseup event, and
  10986. // thinks we're multi-selecting blocks.
  10987. this.setState({
  10988. interactive: true
  10989. });
  10990. }
  10991. render() {
  10992. const {
  10993. preview,
  10994. previewable,
  10995. url,
  10996. type,
  10997. caption,
  10998. onCaptionChange,
  10999. isSelected,
  11000. className,
  11001. icon,
  11002. label,
  11003. insertBlocksAfter
  11004. } = this.props;
  11005. const {
  11006. scripts
  11007. } = preview;
  11008. const {
  11009. interactive
  11010. } = this.state;
  11011. const html = 'photo' === type ? getPhotoHtml(preview) : preview.html;
  11012. const parsedHost = new URL(url).host.split('.');
  11013. const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
  11014. const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com
  11015. (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl);
  11016. const sandboxClassnames = dedupe_default()(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality
  11017. // as far as the user is concerned. We're just catching the first click so that
  11018. // the block can be selected without interacting with the embed preview that the overlay covers.
  11019. /* eslint-disable jsx-a11y/no-static-element-interactions */
  11020. const embedWrapper = 'wp-embed' === type ? (0,external_wp_element_namespaceObject.createElement)(WpEmbedPreview, {
  11021. html: html
  11022. }) : (0,external_wp_element_namespaceObject.createElement)("div", {
  11023. className: "wp-block-embed__wrapper"
  11024. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
  11025. html: html,
  11026. scripts: scripts,
  11027. title: iframeTitle,
  11028. type: sandboxClassnames,
  11029. onFocus: this.hideOverlay
  11030. }), !interactive && (0,external_wp_element_namespaceObject.createElement)("div", {
  11031. className: "block-library-embed__interactive-overlay",
  11032. onMouseUp: this.hideOverlay
  11033. }));
  11034. /* eslint-enable jsx-a11y/no-static-element-interactions */
  11035. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  11036. className: dedupe_default()(className, 'wp-block-embed', {
  11037. 'is-type-video': 'video' === type
  11038. })
  11039. }, previewable ? embedWrapper : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  11040. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  11041. icon: icon,
  11042. showColors: true
  11043. }),
  11044. label: label
  11045. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  11046. className: "components-placeholder__error"
  11047. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  11048. href: url
  11049. }, url)), (0,external_wp_element_namespaceObject.createElement)("p", {
  11050. className: "components-placeholder__error"
  11051. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  11052. /* translators: %s: host providing embed content e.g: www.youtube.com */
  11053. (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl))), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  11054. tagName: "figcaption",
  11055. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  11056. value: caption,
  11057. onChange: onCaptionChange,
  11058. inlineToolbar: true,
  11059. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  11060. }));
  11061. }
  11062. }
  11063. /* harmony default export */ var embed_preview = (EmbedPreview);
  11064. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js
  11065. /**
  11066. * Internal dependencies
  11067. */
  11068. /**
  11069. * External dependencies
  11070. */
  11071. /**
  11072. * WordPress dependencies
  11073. */
  11074. const EmbedEdit = props => {
  11075. const {
  11076. attributes: {
  11077. providerNameSlug,
  11078. previewable,
  11079. responsive,
  11080. url: attributesUrl
  11081. },
  11082. attributes,
  11083. isSelected,
  11084. onReplace,
  11085. setAttributes,
  11086. insertBlocksAfter,
  11087. onFocus
  11088. } = props;
  11089. const defaultEmbedInfo = {
  11090. title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'),
  11091. icon: embedContentIcon
  11092. };
  11093. const {
  11094. icon,
  11095. title
  11096. } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo;
  11097. const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl);
  11098. const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
  11099. const {
  11100. invalidateResolution
  11101. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  11102. const {
  11103. preview,
  11104. fetching,
  11105. themeSupportsResponsive,
  11106. cannotEmbed
  11107. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  11108. var _embedPreview$data;
  11109. const {
  11110. getEmbedPreview,
  11111. isPreviewEmbedFallback,
  11112. isRequestingEmbedPreview,
  11113. getThemeSupports
  11114. } = select(external_wp_coreData_namespaceObject.store);
  11115. if (!attributesUrl) {
  11116. return {
  11117. fetching: false,
  11118. cannotEmbed: false
  11119. };
  11120. }
  11121. const embedPreview = getEmbedPreview(attributesUrl);
  11122. const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html.
  11123. const badEmbedProvider = (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.html) === false && (embedPreview === null || embedPreview === void 0 ? void 0 : embedPreview.type) === undefined; // Some WordPress URLs that can't be embedded will cause the API to return
  11124. // a valid JSON response with no HTML and `data.status` set to 404, rather
  11125. // than generating a fallback response as other embeds do.
  11126. const wordpressCantEmbed = (embedPreview === null || embedPreview === void 0 ? void 0 : (_embedPreview$data = embedPreview.data) === null || _embedPreview$data === void 0 ? void 0 : _embedPreview$data.status) === 404;
  11127. const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed;
  11128. return {
  11129. preview: validPreview ? embedPreview : undefined,
  11130. fetching: isRequestingEmbedPreview(attributesUrl),
  11131. themeSupportsResponsive: getThemeSupports()['responsive-embeds'],
  11132. cannotEmbed: !validPreview || previewIsFallback
  11133. };
  11134. }, [attributesUrl]);
  11135. /**
  11136. * @return {Object} Attributes derived from the preview, merged with the current attributes.
  11137. */
  11138. const getMergedAttributes = () => {
  11139. const {
  11140. allowResponsive,
  11141. className
  11142. } = attributes;
  11143. return { ...attributes,
  11144. ...getAttributesFromPreview(preview, title, className, responsive, allowResponsive)
  11145. };
  11146. };
  11147. const toggleResponsive = () => {
  11148. const {
  11149. allowResponsive,
  11150. className
  11151. } = attributes;
  11152. const {
  11153. html
  11154. } = preview;
  11155. const newAllowResponsive = !allowResponsive;
  11156. setAttributes({
  11157. allowResponsive: newAllowResponsive,
  11158. className: getClassNames(html, className, responsive && newAllowResponsive)
  11159. });
  11160. };
  11161. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11162. if (!(preview !== null && preview !== void 0 && preview.html) || !cannotEmbed || fetching) {
  11163. return;
  11164. } // At this stage, we're not fetching the preview and know it can't be embedded,
  11165. // so try removing any trailing slash, and resubmit.
  11166. const newURL = attributesUrl.replace(/\/$/, '');
  11167. setURL(newURL);
  11168. setIsEditingURL(false);
  11169. setAttributes({
  11170. url: newURL
  11171. });
  11172. }, [preview === null || preview === void 0 ? void 0 : preview.html, attributesUrl]); // Handle incoming preview.
  11173. (0,external_wp_element_namespaceObject.useEffect)(() => {
  11174. if (preview && !isEditingURL) {
  11175. // Even though we set attributes that get derived from the preview,
  11176. // we don't access them directly because for the initial render,
  11177. // the `setAttributes` call will not have taken effect. If we're
  11178. // rendering responsive content, setting the responsive classes
  11179. // after the preview has been rendered can result in unwanted
  11180. // clipping or scrollbars. The `getAttributesFromPreview` function
  11181. // that `getMergedAttributes` uses is memoized so that we're not
  11182. // calculating them on every render.
  11183. setAttributes(getMergedAttributes());
  11184. if (onReplace) {
  11185. const upgradedBlock = createUpgradedEmbedBlock(props, getMergedAttributes());
  11186. if (upgradedBlock) {
  11187. onReplace(upgradedBlock);
  11188. }
  11189. }
  11190. }
  11191. }, [preview, isEditingURL]);
  11192. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  11193. if (fetching) {
  11194. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_loading, null));
  11195. } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists
  11196. const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button.
  11197. const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL;
  11198. if (showEmbedPlaceholder) {
  11199. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_placeholder, {
  11200. icon: icon,
  11201. label: label,
  11202. onFocus: onFocus,
  11203. onSubmit: event => {
  11204. if (event) {
  11205. event.preventDefault();
  11206. }
  11207. setIsEditingURL(false);
  11208. setAttributes({
  11209. url
  11210. });
  11211. },
  11212. value: url,
  11213. cannotEmbed: cannotEmbed,
  11214. onChange: event => setURL(event.target.value),
  11215. fallback: () => fallback(url, onReplace),
  11216. tryAgain: () => {
  11217. invalidateResolution('getEmbedPreview', [url]);
  11218. }
  11219. }));
  11220. } // Even though we set attributes that get derived from the preview,
  11221. // we don't access them directly because for the initial render,
  11222. // the `setAttributes` call will not have taken effect. If we're
  11223. // rendering responsive content, setting the responsive classes
  11224. // after the preview has been rendered can result in unwanted
  11225. // clipping or scrollbars. The `getAttributesFromPreview` function
  11226. // that `getMergedAttributes` uses is memoized so that we're not
  11227. // calculating them on every render.
  11228. const {
  11229. caption,
  11230. type,
  11231. allowResponsive,
  11232. className: classFromPreview
  11233. } = getMergedAttributes();
  11234. const className = classnames_default()(classFromPreview, props.className);
  11235. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(embed_controls, {
  11236. showEditButton: preview && !cannotEmbed,
  11237. themeSupportsResponsive: themeSupportsResponsive,
  11238. blockSupportsResponsive: responsive,
  11239. allowResponsive: allowResponsive,
  11240. toggleResponsive: toggleResponsive,
  11241. switchBackToURLInput: () => setIsEditingURL(true)
  11242. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, (0,external_wp_element_namespaceObject.createElement)(embed_preview, {
  11243. preview: preview,
  11244. previewable: previewable,
  11245. className: className,
  11246. url: url,
  11247. type: type,
  11248. caption: caption,
  11249. onCaptionChange: value => setAttributes({
  11250. caption: value
  11251. }),
  11252. isSelected: isSelected,
  11253. icon: icon,
  11254. label: label,
  11255. insertBlocksAfter: insertBlocksAfter
  11256. })));
  11257. };
  11258. /* harmony default export */ var embed_edit = (EmbedEdit);
  11259. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js
  11260. /**
  11261. * External dependencies
  11262. */
  11263. /**
  11264. * WordPress dependencies
  11265. */
  11266. function embed_save_save(_ref) {
  11267. let {
  11268. attributes
  11269. } = _ref;
  11270. const {
  11271. url,
  11272. caption,
  11273. type,
  11274. providerNameSlug
  11275. } = attributes;
  11276. if (!url) {
  11277. return null;
  11278. }
  11279. const className = dedupe_default()('wp-block-embed', {
  11280. [`is-type-${type}`]: type,
  11281. [`is-provider-${providerNameSlug}`]: providerNameSlug,
  11282. [`wp-block-embed-${providerNameSlug}`]: providerNameSlug
  11283. });
  11284. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  11285. className
  11286. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  11287. className: "wp-block-embed__wrapper"
  11288. }, `\n${url}\n`
  11289. /* URL needs to be on its own line. */
  11290. ), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11291. tagName: "figcaption",
  11292. value: caption
  11293. }));
  11294. }
  11295. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js
  11296. /**
  11297. * WordPress dependencies
  11298. */
  11299. /**
  11300. * Internal dependencies
  11301. */
  11302. const transforms_metadata = {
  11303. $schema: "https://schemas.wp.org/trunk/block.json",
  11304. apiVersion: 2,
  11305. name: "core/embed",
  11306. title: "Embed",
  11307. category: "embed",
  11308. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  11309. textdomain: "default",
  11310. attributes: {
  11311. url: {
  11312. type: "string"
  11313. },
  11314. caption: {
  11315. type: "string",
  11316. source: "html",
  11317. selector: "figcaption"
  11318. },
  11319. type: {
  11320. type: "string"
  11321. },
  11322. providerNameSlug: {
  11323. type: "string"
  11324. },
  11325. allowResponsive: {
  11326. type: "boolean",
  11327. "default": true
  11328. },
  11329. responsive: {
  11330. type: "boolean",
  11331. "default": false
  11332. },
  11333. previewable: {
  11334. type: "boolean",
  11335. "default": true
  11336. }
  11337. },
  11338. supports: {
  11339. align: true
  11340. },
  11341. editorStyle: "wp-block-embed-editor",
  11342. style: "wp-block-embed"
  11343. };
  11344. const {
  11345. name: EMBED_BLOCK
  11346. } = transforms_metadata;
  11347. /**
  11348. * Default transforms for generic embeds.
  11349. */
  11350. const embed_transforms_transforms = {
  11351. from: [{
  11352. type: 'raw',
  11353. isMatch: node => {
  11354. var _node$textContent, _node$textContent$mat;
  11355. return node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && ((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$mat = _node$textContent.match(/https/gi)) === null || _node$textContent$mat === void 0 ? void 0 : _node$textContent$mat.length) === 1;
  11356. },
  11357. transform: node => {
  11358. return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, {
  11359. url: node.textContent.trim()
  11360. });
  11361. }
  11362. }],
  11363. to: [{
  11364. type: 'block',
  11365. blocks: ['core/paragraph'],
  11366. isMatch: _ref => {
  11367. let {
  11368. url
  11369. } = _ref;
  11370. return !!url;
  11371. },
  11372. transform: _ref2 => {
  11373. let {
  11374. url,
  11375. caption
  11376. } = _ref2;
  11377. let value = `<a href="${url}">${url}</a>`;
  11378. if (caption !== null && caption !== void 0 && caption.trim()) {
  11379. value += `<br />${caption}`;
  11380. }
  11381. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  11382. content: value
  11383. });
  11384. }
  11385. }]
  11386. };
  11387. /* harmony default export */ var embed_transforms = (embed_transforms_transforms);
  11388. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js
  11389. /**
  11390. * WordPress dependencies
  11391. */
  11392. /**
  11393. * Internal dependencies
  11394. */
  11395. /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
  11396. /**
  11397. * Template option choices for predefined columns layouts.
  11398. *
  11399. * @type {WPBlockVariation[]}
  11400. */
  11401. const variations_variations = [{
  11402. name: 'twitter',
  11403. title: 'Twitter',
  11404. icon: embedTwitterIcon,
  11405. keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')],
  11406. description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'),
  11407. patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i],
  11408. attributes: {
  11409. providerNameSlug: 'twitter',
  11410. responsive: true
  11411. }
  11412. }, {
  11413. name: 'youtube',
  11414. title: 'YouTube',
  11415. icon: embedYouTubeIcon,
  11416. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')],
  11417. description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'),
  11418. patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i],
  11419. attributes: {
  11420. providerNameSlug: 'youtube',
  11421. responsive: true
  11422. }
  11423. }, {
  11424. // Deprecate Facebook Embed per FB policy
  11425. // See: https://developers.facebook.com/docs/plugins/oembed-legacy
  11426. name: 'facebook',
  11427. title: 'Facebook',
  11428. icon: embedFacebookIcon,
  11429. keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
  11430. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'),
  11431. scope: ['block'],
  11432. patterns: [],
  11433. attributes: {
  11434. providerNameSlug: 'facebook',
  11435. previewable: false,
  11436. responsive: true
  11437. }
  11438. }, {
  11439. // Deprecate Instagram per FB policy
  11440. // See: https://developers.facebook.com/docs/instagram/oembed-legacy
  11441. name: 'instagram',
  11442. title: 'Instagram',
  11443. icon: embedInstagramIcon,
  11444. keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')],
  11445. description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'),
  11446. scope: ['block'],
  11447. patterns: [],
  11448. attributes: {
  11449. providerNameSlug: 'instagram',
  11450. responsive: true
  11451. }
  11452. }, {
  11453. name: 'wordpress',
  11454. title: 'WordPress',
  11455. icon: embedWordPressIcon,
  11456. keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')],
  11457. description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'),
  11458. attributes: {
  11459. providerNameSlug: 'wordpress'
  11460. }
  11461. }, {
  11462. name: 'soundcloud',
  11463. title: 'SoundCloud',
  11464. icon: embedAudioIcon,
  11465. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  11466. description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'),
  11467. patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],
  11468. attributes: {
  11469. providerNameSlug: 'soundcloud',
  11470. responsive: true
  11471. }
  11472. }, {
  11473. name: 'spotify',
  11474. title: 'Spotify',
  11475. icon: embedSpotifyIcon,
  11476. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  11477. description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'),
  11478. patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i],
  11479. attributes: {
  11480. providerNameSlug: 'spotify',
  11481. responsive: true
  11482. }
  11483. }, {
  11484. name: 'flickr',
  11485. title: 'Flickr',
  11486. icon: embedFlickrIcon,
  11487. keywords: [(0,external_wp_i18n_namespaceObject.__)('image')],
  11488. description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'),
  11489. patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i],
  11490. attributes: {
  11491. providerNameSlug: 'flickr',
  11492. responsive: true
  11493. }
  11494. }, {
  11495. name: 'vimeo',
  11496. title: 'Vimeo',
  11497. icon: embedVimeoIcon,
  11498. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11499. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'),
  11500. patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i],
  11501. attributes: {
  11502. providerNameSlug: 'vimeo',
  11503. responsive: true
  11504. }
  11505. }, {
  11506. name: 'animoto',
  11507. title: 'Animoto',
  11508. icon: embedAnimotoIcon,
  11509. description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'),
  11510. patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],
  11511. attributes: {
  11512. providerNameSlug: 'animoto',
  11513. responsive: true
  11514. }
  11515. }, {
  11516. name: 'cloudup',
  11517. title: 'Cloudup',
  11518. icon: embedContentIcon,
  11519. description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'),
  11520. patterns: [/^https?:\/\/cloudup\.com\/.+/i],
  11521. attributes: {
  11522. providerNameSlug: 'cloudup',
  11523. responsive: true
  11524. }
  11525. }, {
  11526. // Deprecated since CollegeHumor content is now powered by YouTube.
  11527. name: 'collegehumor',
  11528. title: 'CollegeHumor',
  11529. icon: embedVideoIcon,
  11530. description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'),
  11531. scope: ['block'],
  11532. patterns: [],
  11533. attributes: {
  11534. providerNameSlug: 'collegehumor',
  11535. responsive: true
  11536. }
  11537. }, {
  11538. name: 'crowdsignal',
  11539. title: 'Crowdsignal',
  11540. icon: embedContentIcon,
  11541. keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')],
  11542. description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'),
  11543. patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],
  11544. attributes: {
  11545. providerNameSlug: 'crowdsignal',
  11546. responsive: true
  11547. }
  11548. }, {
  11549. name: 'dailymotion',
  11550. title: 'Dailymotion',
  11551. icon: embedDailymotionIcon,
  11552. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11553. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'),
  11554. patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],
  11555. attributes: {
  11556. providerNameSlug: 'dailymotion',
  11557. responsive: true
  11558. }
  11559. }, {
  11560. name: 'imgur',
  11561. title: 'Imgur',
  11562. icon: embedPhotoIcon,
  11563. description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'),
  11564. patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i],
  11565. attributes: {
  11566. providerNameSlug: 'imgur',
  11567. responsive: true
  11568. }
  11569. }, {
  11570. name: 'issuu',
  11571. title: 'Issuu',
  11572. icon: embedContentIcon,
  11573. description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'),
  11574. patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i],
  11575. attributes: {
  11576. providerNameSlug: 'issuu',
  11577. responsive: true
  11578. }
  11579. }, {
  11580. name: 'kickstarter',
  11581. title: 'Kickstarter',
  11582. icon: embedContentIcon,
  11583. description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'),
  11584. patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i],
  11585. attributes: {
  11586. providerNameSlug: 'kickstarter',
  11587. responsive: true
  11588. }
  11589. }, {
  11590. name: 'mixcloud',
  11591. title: 'Mixcloud',
  11592. icon: embedAudioIcon,
  11593. keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')],
  11594. description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'),
  11595. patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],
  11596. attributes: {
  11597. providerNameSlug: 'mixcloud',
  11598. responsive: true
  11599. }
  11600. }, {
  11601. name: 'reddit',
  11602. title: 'Reddit',
  11603. icon: embedRedditIcon,
  11604. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'),
  11605. patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i],
  11606. attributes: {
  11607. providerNameSlug: 'reddit',
  11608. responsive: true
  11609. }
  11610. }, {
  11611. name: 'reverbnation',
  11612. title: 'ReverbNation',
  11613. icon: embedAudioIcon,
  11614. description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'),
  11615. patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],
  11616. attributes: {
  11617. providerNameSlug: 'reverbnation',
  11618. responsive: true
  11619. }
  11620. }, {
  11621. name: 'screencast',
  11622. title: 'Screencast',
  11623. icon: embedVideoIcon,
  11624. description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'),
  11625. patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i],
  11626. attributes: {
  11627. providerNameSlug: 'screencast',
  11628. responsive: true
  11629. }
  11630. }, {
  11631. name: 'scribd',
  11632. title: 'Scribd',
  11633. icon: embedContentIcon,
  11634. description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'),
  11635. patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i],
  11636. attributes: {
  11637. providerNameSlug: 'scribd',
  11638. responsive: true
  11639. }
  11640. }, {
  11641. name: 'slideshare',
  11642. title: 'Slideshare',
  11643. icon: embedContentIcon,
  11644. description: (0,external_wp_i18n_namespaceObject.__)('Embed Slideshare content.'),
  11645. patterns: [/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],
  11646. attributes: {
  11647. providerNameSlug: 'slideshare',
  11648. responsive: true
  11649. }
  11650. }, {
  11651. name: 'smugmug',
  11652. title: 'SmugMug',
  11653. icon: embedPhotoIcon,
  11654. description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'),
  11655. patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],
  11656. attributes: {
  11657. providerNameSlug: 'smugmug',
  11658. previewable: false,
  11659. responsive: true
  11660. }
  11661. }, {
  11662. name: 'speaker-deck',
  11663. title: 'Speaker Deck',
  11664. icon: embedContentIcon,
  11665. description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'),
  11666. patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],
  11667. attributes: {
  11668. providerNameSlug: 'speaker-deck',
  11669. responsive: true
  11670. }
  11671. }, {
  11672. name: 'tiktok',
  11673. title: 'TikTok',
  11674. icon: embedVideoIcon,
  11675. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11676. description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'),
  11677. patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i],
  11678. attributes: {
  11679. providerNameSlug: 'tiktok',
  11680. responsive: true
  11681. }
  11682. }, {
  11683. name: 'ted',
  11684. title: 'TED',
  11685. icon: embedVideoIcon,
  11686. description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'),
  11687. patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],
  11688. attributes: {
  11689. providerNameSlug: 'ted',
  11690. responsive: true
  11691. }
  11692. }, {
  11693. name: 'tumblr',
  11694. title: 'Tumblr',
  11695. icon: embedTumblrIcon,
  11696. keywords: [(0,external_wp_i18n_namespaceObject.__)('social')],
  11697. description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'),
  11698. patterns: [/^https?:\/\/(www\.)?tumblr\.com\/.+/i],
  11699. attributes: {
  11700. providerNameSlug: 'tumblr',
  11701. responsive: true
  11702. }
  11703. }, {
  11704. name: 'videopress',
  11705. title: 'VideoPress',
  11706. icon: embedVideoIcon,
  11707. keywords: [(0,external_wp_i18n_namespaceObject.__)('video')],
  11708. description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'),
  11709. patterns: [/^https?:\/\/videopress\.com\/.+/i],
  11710. attributes: {
  11711. providerNameSlug: 'videopress',
  11712. responsive: true
  11713. }
  11714. }, {
  11715. name: 'wordpress-tv',
  11716. title: 'WordPress.tv',
  11717. icon: embedVideoIcon,
  11718. description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'),
  11719. patterns: [/^https?:\/\/wordpress\.tv\/.+/i],
  11720. attributes: {
  11721. providerNameSlug: 'wordpress-tv',
  11722. responsive: true
  11723. }
  11724. }, {
  11725. name: 'amazon-kindle',
  11726. title: 'Amazon Kindle',
  11727. icon: embedAmazonIcon,
  11728. keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')],
  11729. description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'),
  11730. patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],
  11731. attributes: {
  11732. providerNameSlug: 'amazon-kindle'
  11733. }
  11734. }, {
  11735. name: 'pinterest',
  11736. title: 'Pinterest',
  11737. icon: embedPinterestIcon,
  11738. keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')],
  11739. description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'),
  11740. patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],
  11741. attributes: {
  11742. providerNameSlug: 'pinterest'
  11743. }
  11744. }, {
  11745. name: 'wolfram-cloud',
  11746. title: 'Wolfram',
  11747. icon: embedWolframIcon,
  11748. description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'),
  11749. patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],
  11750. attributes: {
  11751. providerNameSlug: 'wolfram-cloud',
  11752. responsive: true
  11753. }
  11754. }];
  11755. /**
  11756. * Add `isActive` function to all `embed` variations, if not defined.
  11757. * `isActive` function is used to find a variation match from a created
  11758. * Block by providing its attributes.
  11759. */
  11760. variations_variations.forEach(variation => {
  11761. if (variation.isActive) return;
  11762. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug;
  11763. });
  11764. /* harmony default export */ var embed_variations = (variations_variations);
  11765. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js
  11766. /**
  11767. * External dependencies
  11768. */
  11769. /**
  11770. * Internal dependencies
  11771. */
  11772. const embed_deprecated_metadata = {
  11773. $schema: "https://schemas.wp.org/trunk/block.json",
  11774. apiVersion: 2,
  11775. name: "core/embed",
  11776. title: "Embed",
  11777. category: "embed",
  11778. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  11779. textdomain: "default",
  11780. attributes: {
  11781. url: {
  11782. type: "string"
  11783. },
  11784. caption: {
  11785. type: "string",
  11786. source: "html",
  11787. selector: "figcaption"
  11788. },
  11789. type: {
  11790. type: "string"
  11791. },
  11792. providerNameSlug: {
  11793. type: "string"
  11794. },
  11795. allowResponsive: {
  11796. type: "boolean",
  11797. "default": true
  11798. },
  11799. responsive: {
  11800. type: "boolean",
  11801. "default": false
  11802. },
  11803. previewable: {
  11804. type: "boolean",
  11805. "default": true
  11806. }
  11807. },
  11808. supports: {
  11809. align: true
  11810. },
  11811. editorStyle: "wp-block-embed-editor",
  11812. style: "wp-block-embed"
  11813. };
  11814. /**
  11815. * WordPress dependencies
  11816. */
  11817. const {
  11818. attributes: embed_deprecated_blockAttributes
  11819. } = embed_deprecated_metadata;
  11820. const embed_deprecated_deprecated = [{
  11821. attributes: embed_deprecated_blockAttributes,
  11822. save(_ref) {
  11823. let {
  11824. attributes: {
  11825. url,
  11826. caption,
  11827. type,
  11828. providerNameSlug
  11829. }
  11830. } = _ref;
  11831. if (!url) {
  11832. return null;
  11833. }
  11834. const embedClassName = classnames_default()('wp-block-embed', {
  11835. [`is-type-${type}`]: type,
  11836. [`is-provider-${providerNameSlug}`]: providerNameSlug
  11837. });
  11838. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  11839. className: embedClassName
  11840. }, `\n${url}\n`
  11841. /* URL needs to be on its own line. */
  11842. , !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11843. tagName: "figcaption",
  11844. value: caption
  11845. }));
  11846. }
  11847. }];
  11848. /* harmony default export */ var embed_deprecated = (embed_deprecated_deprecated);
  11849. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js
  11850. /**
  11851. * Internal dependencies
  11852. */
  11853. const embed_metadata = {
  11854. $schema: "https://schemas.wp.org/trunk/block.json",
  11855. apiVersion: 2,
  11856. name: "core/embed",
  11857. title: "Embed",
  11858. category: "embed",
  11859. description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.",
  11860. textdomain: "default",
  11861. attributes: {
  11862. url: {
  11863. type: "string"
  11864. },
  11865. caption: {
  11866. type: "string",
  11867. source: "html",
  11868. selector: "figcaption"
  11869. },
  11870. type: {
  11871. type: "string"
  11872. },
  11873. providerNameSlug: {
  11874. type: "string"
  11875. },
  11876. allowResponsive: {
  11877. type: "boolean",
  11878. "default": true
  11879. },
  11880. responsive: {
  11881. type: "boolean",
  11882. "default": false
  11883. },
  11884. previewable: {
  11885. type: "boolean",
  11886. "default": true
  11887. }
  11888. },
  11889. supports: {
  11890. align: true
  11891. },
  11892. editorStyle: "wp-block-embed-editor",
  11893. style: "wp-block-embed"
  11894. };
  11895. const {
  11896. name: embed_name
  11897. } = embed_metadata;
  11898. const embed_settings = {
  11899. icon: embedContentIcon,
  11900. edit: embed_edit,
  11901. save: embed_save_save,
  11902. transforms: embed_transforms,
  11903. variations: embed_variations,
  11904. deprecated: embed_deprecated
  11905. };
  11906. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js
  11907. /**
  11908. * WordPress dependencies
  11909. */
  11910. const file = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  11911. viewBox: "0 0 24 24",
  11912. xmlns: "http://www.w3.org/2000/svg"
  11913. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  11914. d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"
  11915. }));
  11916. /* harmony default export */ var library_file = (file);
  11917. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js
  11918. /**
  11919. * WordPress dependencies
  11920. */
  11921. // Version of the file block without PR#28062 accessibility fix.
  11922. const file_deprecated_deprecated = [{
  11923. attributes: {
  11924. id: {
  11925. type: 'number'
  11926. },
  11927. href: {
  11928. type: 'string'
  11929. },
  11930. fileName: {
  11931. type: 'string',
  11932. source: 'html',
  11933. selector: 'a:not([download])'
  11934. },
  11935. textLinkHref: {
  11936. type: 'string',
  11937. source: 'attribute',
  11938. selector: 'a:not([download])',
  11939. attribute: 'href'
  11940. },
  11941. textLinkTarget: {
  11942. type: 'string',
  11943. source: 'attribute',
  11944. selector: 'a:not([download])',
  11945. attribute: 'target'
  11946. },
  11947. showDownloadButton: {
  11948. type: 'boolean',
  11949. default: true
  11950. },
  11951. downloadButtonText: {
  11952. type: 'string',
  11953. source: 'html',
  11954. selector: 'a[download]'
  11955. },
  11956. displayPreview: {
  11957. type: 'boolean'
  11958. },
  11959. previewHeight: {
  11960. type: 'number',
  11961. default: 600
  11962. }
  11963. },
  11964. supports: {
  11965. anchor: true,
  11966. align: true
  11967. },
  11968. save(_ref) {
  11969. let {
  11970. attributes
  11971. } = _ref;
  11972. const {
  11973. href,
  11974. fileName,
  11975. textLinkHref,
  11976. textLinkTarget,
  11977. showDownloadButton,
  11978. downloadButtonText,
  11979. displayPreview,
  11980. previewHeight
  11981. } = attributes;
  11982. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  11983. /* translators: %s: filename. */
  11984. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  11985. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  11986. className: "wp-block-file__embed",
  11987. data: href,
  11988. type: "application/pdf",
  11989. style: {
  11990. width: '100%',
  11991. height: `${previewHeight}px`
  11992. },
  11993. "aria-label": pdfEmbedLabel
  11994. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_wp_element_namespaceObject.createElement)("a", {
  11995. href: textLinkHref,
  11996. target: textLinkTarget,
  11997. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  11998. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  11999. value: fileName
  12000. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  12001. href: href,
  12002. className: "wp-block-file__button",
  12003. download: true
  12004. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12005. value: downloadButtonText
  12006. })));
  12007. }
  12008. }];
  12009. /* harmony default export */ var file_deprecated = (file_deprecated_deprecated);
  12010. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js
  12011. /**
  12012. * WordPress dependencies
  12013. */
  12014. /**
  12015. * Internal dependencies
  12016. */
  12017. function FileBlockInspector(_ref) {
  12018. let {
  12019. hrefs,
  12020. openInNewWindow,
  12021. showDownloadButton,
  12022. changeLinkDestinationOption,
  12023. changeOpenInNewWindow,
  12024. changeShowDownloadButton,
  12025. displayPreview,
  12026. changeDisplayPreview,
  12027. previewHeight,
  12028. changePreviewHeight
  12029. } = _ref;
  12030. const {
  12031. href,
  12032. textLinkHref,
  12033. attachmentPage
  12034. } = hrefs;
  12035. let linkDestinationOptions = [{
  12036. value: href,
  12037. label: (0,external_wp_i18n_namespaceObject.__)('URL')
  12038. }];
  12039. if (attachmentPage) {
  12040. linkDestinationOptions = [{
  12041. value: href,
  12042. label: (0,external_wp_i18n_namespaceObject.__)('Media file')
  12043. }, {
  12044. value: attachmentPage,
  12045. label: (0,external_wp_i18n_namespaceObject.__)('Attachment page')
  12046. }];
  12047. }
  12048. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12049. title: (0,external_wp_i18n_namespaceObject.__)('PDF settings')
  12050. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12051. label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'),
  12052. help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
  12053. checked: !!displayPreview,
  12054. onChange: changeDisplayPreview
  12055. }), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  12056. label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'),
  12057. min: MIN_PREVIEW_HEIGHT,
  12058. max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight),
  12059. value: previewHeight,
  12060. onChange: changePreviewHeight
  12061. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12062. title: (0,external_wp_i18n_namespaceObject.__)('Text link settings')
  12063. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  12064. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  12065. value: textLinkHref,
  12066. options: linkDestinationOptions,
  12067. onChange: changeLinkDestinationOption
  12068. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12069. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  12070. checked: openInNewWindow,
  12071. onChange: changeOpenInNewWindow
  12072. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  12073. title: (0,external_wp_i18n_namespaceObject.__)('Download button settings')
  12074. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  12075. label: (0,external_wp_i18n_namespaceObject.__)('Show download button'),
  12076. checked: showDownloadButton,
  12077. onChange: changeShowDownloadButton
  12078. }))));
  12079. }
  12080. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js
  12081. /**
  12082. * Uses a combination of user agent matching and feature detection to determine whether
  12083. * the current browser supports rendering PDFs inline.
  12084. *
  12085. * @return {boolean} Whether or not the browser supports inline PDFs.
  12086. */
  12087. const browserSupportsPdfs = () => {
  12088. // Most mobile devices include "Mobi" in their UA.
  12089. if (window.navigator.userAgent.indexOf('Mobi') > -1) {
  12090. return false;
  12091. } // Android tablets are the noteable exception.
  12092. if (window.navigator.userAgent.indexOf('Android') > -1) {
  12093. return false;
  12094. } // iPad pretends to be a Mac.
  12095. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
  12096. return false;
  12097. } // IE only supports PDFs when there's an ActiveX object available for it.
  12098. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
  12099. return false;
  12100. }
  12101. return true;
  12102. };
  12103. /**
  12104. * Helper function for creating ActiveX objects, catching any errors that are thrown
  12105. * when it's generated.
  12106. *
  12107. * @param {string} type The name of the ActiveX object to create.
  12108. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
  12109. */
  12110. const createActiveXObject = type => {
  12111. let ax;
  12112. try {
  12113. ax = new window.ActiveXObject(type);
  12114. } catch (e) {
  12115. ax = undefined;
  12116. }
  12117. return ax;
  12118. };
  12119. /**
  12120. * Hides all .wp-block-file__embed elements on the document. This function is only intended
  12121. * to be run on the front-end, it may have weird side effects running in the block editor.
  12122. */
  12123. const hidePdfEmbedsOnUnsupportedBrowsers = () => {
  12124. if (!browserSupportsPdfs()) {
  12125. const embeds = document.getElementsByClassName('wp-block-file__embed');
  12126. Array.from(embeds).forEach(embed => {
  12127. embed.style.display = 'none';
  12128. });
  12129. }
  12130. };
  12131. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js
  12132. /**
  12133. * External dependencies
  12134. */
  12135. /**
  12136. * WordPress dependencies
  12137. */
  12138. /**
  12139. * Internal dependencies
  12140. */
  12141. const MIN_PREVIEW_HEIGHT = 200;
  12142. const MAX_PREVIEW_HEIGHT = 2000;
  12143. function ClipboardToolbarButton(_ref) {
  12144. let {
  12145. text,
  12146. disabled
  12147. } = _ref;
  12148. const {
  12149. createNotice
  12150. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  12151. const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => {
  12152. createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), {
  12153. isDismissible: true,
  12154. type: 'snackbar'
  12155. });
  12156. });
  12157. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  12158. className: "components-clipboard-toolbar-button",
  12159. ref: ref,
  12160. disabled: disabled
  12161. }, (0,external_wp_i18n_namespaceObject.__)('Copy URL'));
  12162. }
  12163. function FileEdit(_ref2) {
  12164. let {
  12165. attributes,
  12166. isSelected,
  12167. setAttributes,
  12168. noticeUI,
  12169. noticeOperations,
  12170. clientId
  12171. } = _ref2;
  12172. const {
  12173. id,
  12174. fileId,
  12175. fileName,
  12176. href,
  12177. textLinkHref,
  12178. textLinkTarget,
  12179. showDownloadButton,
  12180. downloadButtonText,
  12181. displayPreview,
  12182. previewHeight
  12183. } = attributes;
  12184. const {
  12185. media,
  12186. mediaUpload
  12187. } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
  12188. media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id),
  12189. mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
  12190. }), [id]);
  12191. const {
  12192. toggleSelection,
  12193. __unstableMarkNextChangeAsNotPersistent
  12194. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  12195. (0,external_wp_element_namespaceObject.useEffect)(() => {
  12196. // Upload a file drag-and-dropped into the editor.
  12197. if ((0,external_wp_blob_namespaceObject.isBlobURL)(href)) {
  12198. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(href);
  12199. mediaUpload({
  12200. filesList: [file],
  12201. onFileChange: _ref3 => {
  12202. let [newMedia] = _ref3;
  12203. return onSelectFile(newMedia);
  12204. },
  12205. onError: onUploadError
  12206. });
  12207. (0,external_wp_blob_namespaceObject.revokeBlobURL)(href);
  12208. }
  12209. if (downloadButtonText === undefined) {
  12210. changeDownloadButtonText((0,external_wp_i18n_namespaceObject._x)('Download', 'button label'));
  12211. }
  12212. }, []);
  12213. (0,external_wp_element_namespaceObject.useEffect)(() => {
  12214. if (!fileId && href) {
  12215. // Add a unique fileId to each file block.
  12216. __unstableMarkNextChangeAsNotPersistent();
  12217. setAttributes({
  12218. fileId: `wp-block-file--media-${clientId}`
  12219. });
  12220. }
  12221. }, [href, fileId, clientId]);
  12222. function onSelectFile(newMedia) {
  12223. if (newMedia && newMedia.url) {
  12224. const isPdf = newMedia.url.endsWith('.pdf');
  12225. setAttributes({
  12226. href: newMedia.url,
  12227. fileName: newMedia.title,
  12228. textLinkHref: newMedia.url,
  12229. id: newMedia.id,
  12230. displayPreview: isPdf ? true : undefined,
  12231. previewHeight: isPdf ? 600 : undefined
  12232. });
  12233. }
  12234. }
  12235. function onUploadError(message) {
  12236. setAttributes({
  12237. href: undefined
  12238. });
  12239. noticeOperations.removeAllNotices();
  12240. noticeOperations.createErrorNotice(message);
  12241. }
  12242. function changeLinkDestinationOption(newHref) {
  12243. // Choose Media File or Attachment Page (when file is in Media Library).
  12244. setAttributes({
  12245. textLinkHref: newHref
  12246. });
  12247. }
  12248. function changeOpenInNewWindow(newValue) {
  12249. setAttributes({
  12250. textLinkTarget: newValue ? '_blank' : false
  12251. });
  12252. }
  12253. function changeShowDownloadButton(newValue) {
  12254. setAttributes({
  12255. showDownloadButton: newValue
  12256. });
  12257. }
  12258. function changeDownloadButtonText(newValue) {
  12259. // Remove anchor tags from button text content.
  12260. setAttributes({
  12261. downloadButtonText: newValue.replace(/<\/?a[^>]*>/g, '')
  12262. });
  12263. }
  12264. function changeDisplayPreview(newValue) {
  12265. setAttributes({
  12266. displayPreview: newValue
  12267. });
  12268. }
  12269. function handleOnResizeStop(event, direction, elt, delta) {
  12270. toggleSelection(true);
  12271. const newHeight = parseInt(previewHeight + delta.height, 10);
  12272. setAttributes({
  12273. previewHeight: newHeight
  12274. });
  12275. }
  12276. function changePreviewHeight(newValue) {
  12277. const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT);
  12278. setAttributes({
  12279. previewHeight: newHeight
  12280. });
  12281. }
  12282. const attachmentPage = media && media.link;
  12283. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  12284. className: classnames_default()((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
  12285. type: 'loading'
  12286. }), {
  12287. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href)
  12288. })
  12289. });
  12290. const displayPreviewInEditor = browserSupportsPdfs() && displayPreview;
  12291. if (!href) {
  12292. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  12293. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  12294. icon: library_file
  12295. }),
  12296. labels: {
  12297. title: (0,external_wp_i18n_namespaceObject.__)('File'),
  12298. instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.')
  12299. },
  12300. onSelect: onSelectFile,
  12301. notices: noticeUI,
  12302. onError: onUploadError,
  12303. accept: "*"
  12304. }));
  12305. }
  12306. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(FileBlockInspector, {
  12307. hrefs: {
  12308. href,
  12309. textLinkHref,
  12310. attachmentPage
  12311. },
  12312. openInNewWindow: !!textLinkTarget,
  12313. showDownloadButton,
  12314. changeLinkDestinationOption,
  12315. changeOpenInNewWindow,
  12316. changeShowDownloadButton,
  12317. displayPreview,
  12318. changeDisplayPreview,
  12319. previewHeight,
  12320. changePreviewHeight
  12321. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  12322. group: "other"
  12323. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  12324. mediaId: id,
  12325. mediaURL: href,
  12326. accept: "*",
  12327. onSelect: onSelectFile,
  12328. onError: onUploadError
  12329. }), (0,external_wp_element_namespaceObject.createElement)(ClipboardToolbarButton, {
  12330. text: href,
  12331. disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href)
  12332. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, displayPreviewInEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  12333. size: {
  12334. height: previewHeight
  12335. },
  12336. minHeight: MIN_PREVIEW_HEIGHT,
  12337. maxHeight: MAX_PREVIEW_HEIGHT,
  12338. minWidth: "100%",
  12339. grid: [10, 10],
  12340. enable: {
  12341. top: false,
  12342. right: false,
  12343. bottom: true,
  12344. left: false,
  12345. topRight: false,
  12346. bottomRight: false,
  12347. bottomLeft: false,
  12348. topLeft: false
  12349. },
  12350. onResizeStart: () => toggleSelection(false),
  12351. onResizeStop: handleOnResizeStop,
  12352. showHandle: isSelected
  12353. }, (0,external_wp_element_namespaceObject.createElement)("object", {
  12354. className: "wp-block-file__preview",
  12355. data: href,
  12356. type: "application/pdf",
  12357. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.')
  12358. }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
  12359. className: "wp-block-file__preview-overlay"
  12360. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  12361. className: 'wp-block-file__content-wrapper'
  12362. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  12363. tagName: "a",
  12364. value: fileName,
  12365. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'),
  12366. withoutInteractiveFormatting: true,
  12367. onChange: text => setAttributes({
  12368. fileName: text
  12369. }),
  12370. href: textLinkHref
  12371. }), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("div", {
  12372. className: 'wp-block-file__button-richtext-wrapper'
  12373. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  12374. tagName: "div" // Must be block-level or else cursor disappears.
  12375. ,
  12376. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'),
  12377. className: 'wp-block-file__button',
  12378. value: downloadButtonText,
  12379. withoutInteractiveFormatting: true,
  12380. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'),
  12381. onChange: text => changeDownloadButtonText(text)
  12382. })))));
  12383. }
  12384. /* harmony default export */ var file_edit = ((0,external_wp_components_namespaceObject.withNotices)(FileEdit));
  12385. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js
  12386. /**
  12387. * WordPress dependencies
  12388. */
  12389. function file_save_save(_ref) {
  12390. let {
  12391. attributes
  12392. } = _ref;
  12393. const {
  12394. href,
  12395. fileId,
  12396. fileName,
  12397. textLinkHref,
  12398. textLinkTarget,
  12399. showDownloadButton,
  12400. downloadButtonText,
  12401. displayPreview,
  12402. previewHeight
  12403. } = attributes;
  12404. const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(
  12405. /* translators: %s: filename. */
  12406. (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName);
  12407. const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is
  12408. // actually rendered.
  12409. const describedById = hasFilename ? fileId : undefined;
  12410. return href && (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), displayPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("object", {
  12411. className: "wp-block-file__embed",
  12412. data: href,
  12413. type: "application/pdf",
  12414. style: {
  12415. width: '100%',
  12416. height: `${previewHeight}px`
  12417. },
  12418. "aria-label": pdfEmbedLabel
  12419. })), hasFilename && (0,external_wp_element_namespaceObject.createElement)("a", {
  12420. id: describedById,
  12421. href: textLinkHref,
  12422. target: textLinkTarget,
  12423. rel: textLinkTarget ? 'noreferrer noopener' : undefined
  12424. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12425. value: fileName
  12426. })), showDownloadButton && (0,external_wp_element_namespaceObject.createElement)("a", {
  12427. href: href,
  12428. className: "wp-block-file__button",
  12429. download: true,
  12430. "aria-describedby": describedById
  12431. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12432. value: downloadButtonText
  12433. })));
  12434. }
  12435. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js
  12436. /**
  12437. * External dependencies
  12438. */
  12439. /**
  12440. * WordPress dependencies
  12441. */
  12442. const file_transforms_transforms = {
  12443. from: [{
  12444. type: 'files',
  12445. isMatch(files) {
  12446. return files.length > 0;
  12447. },
  12448. // We define a lower priorty (higher number) than the default of 10. This
  12449. // ensures that the File block is only created as a fallback.
  12450. priority: 15,
  12451. transform: files => {
  12452. const blocks = [];
  12453. files.forEach(file => {
  12454. const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount()
  12455. blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12456. href: blobURL,
  12457. fileName: file.name,
  12458. textLinkHref: blobURL
  12459. }));
  12460. });
  12461. return blocks;
  12462. }
  12463. }, {
  12464. type: 'block',
  12465. blocks: ['core/audio'],
  12466. transform: attributes => {
  12467. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12468. href: attributes.src,
  12469. fileName: attributes.caption,
  12470. textLinkHref: attributes.src,
  12471. id: attributes.id,
  12472. anchor: attributes.anchor
  12473. });
  12474. }
  12475. }, {
  12476. type: 'block',
  12477. blocks: ['core/video'],
  12478. transform: attributes => {
  12479. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12480. href: attributes.src,
  12481. fileName: attributes.caption,
  12482. textLinkHref: attributes.src,
  12483. id: attributes.id,
  12484. anchor: attributes.anchor
  12485. });
  12486. }
  12487. }, {
  12488. type: 'block',
  12489. blocks: ['core/image'],
  12490. transform: attributes => {
  12491. return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', {
  12492. href: attributes.url,
  12493. fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url),
  12494. textLinkHref: attributes.url,
  12495. id: attributes.id,
  12496. anchor: attributes.anchor
  12497. });
  12498. }
  12499. }],
  12500. to: [{
  12501. type: 'block',
  12502. blocks: ['core/audio'],
  12503. isMatch: _ref => {
  12504. let {
  12505. id
  12506. } = _ref;
  12507. if (!id) {
  12508. return false;
  12509. }
  12510. const {
  12511. getMedia
  12512. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  12513. const media = getMedia(id);
  12514. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'audio');
  12515. },
  12516. transform: attributes => {
  12517. return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', {
  12518. src: attributes.href,
  12519. caption: attributes.fileName,
  12520. id: attributes.id,
  12521. anchor: attributes.anchor
  12522. });
  12523. }
  12524. }, {
  12525. type: 'block',
  12526. blocks: ['core/video'],
  12527. isMatch: _ref2 => {
  12528. let {
  12529. id
  12530. } = _ref2;
  12531. if (!id) {
  12532. return false;
  12533. }
  12534. const {
  12535. getMedia
  12536. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  12537. const media = getMedia(id);
  12538. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'video');
  12539. },
  12540. transform: attributes => {
  12541. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  12542. src: attributes.href,
  12543. caption: attributes.fileName,
  12544. id: attributes.id,
  12545. anchor: attributes.anchor
  12546. });
  12547. }
  12548. }, {
  12549. type: 'block',
  12550. blocks: ['core/image'],
  12551. isMatch: _ref3 => {
  12552. let {
  12553. id
  12554. } = _ref3;
  12555. if (!id) {
  12556. return false;
  12557. }
  12558. const {
  12559. getMedia
  12560. } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store);
  12561. const media = getMedia(id);
  12562. return !!media && (0,external_lodash_namespaceObject.includes)(media.mime_type, 'image');
  12563. },
  12564. transform: attributes => {
  12565. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  12566. url: attributes.href,
  12567. caption: attributes.fileName,
  12568. id: attributes.id,
  12569. anchor: attributes.anchor
  12570. });
  12571. }
  12572. }]
  12573. };
  12574. /* harmony default export */ var file_transforms = (file_transforms_transforms);
  12575. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js
  12576. /**
  12577. * WordPress dependencies
  12578. */
  12579. /**
  12580. * Internal dependencies
  12581. */
  12582. const file_metadata = {
  12583. $schema: "https://schemas.wp.org/trunk/block.json",
  12584. apiVersion: 2,
  12585. name: "core/file",
  12586. title: "File",
  12587. category: "media",
  12588. description: "Add a link to a downloadable file.",
  12589. keywords: ["document", "pdf", "download"],
  12590. textdomain: "default",
  12591. attributes: {
  12592. id: {
  12593. type: "number"
  12594. },
  12595. href: {
  12596. type: "string"
  12597. },
  12598. fileId: {
  12599. type: "string",
  12600. source: "attribute",
  12601. selector: "a:not([download])",
  12602. attribute: "id"
  12603. },
  12604. fileName: {
  12605. type: "string",
  12606. source: "html",
  12607. selector: "a:not([download])"
  12608. },
  12609. textLinkHref: {
  12610. type: "string",
  12611. source: "attribute",
  12612. selector: "a:not([download])",
  12613. attribute: "href"
  12614. },
  12615. textLinkTarget: {
  12616. type: "string",
  12617. source: "attribute",
  12618. selector: "a:not([download])",
  12619. attribute: "target"
  12620. },
  12621. showDownloadButton: {
  12622. type: "boolean",
  12623. "default": true
  12624. },
  12625. downloadButtonText: {
  12626. type: "string",
  12627. source: "html",
  12628. selector: "a[download]"
  12629. },
  12630. displayPreview: {
  12631. type: "boolean"
  12632. },
  12633. previewHeight: {
  12634. type: "number",
  12635. "default": 600
  12636. }
  12637. },
  12638. supports: {
  12639. anchor: true,
  12640. align: true
  12641. },
  12642. viewScript: "file:./view.min.js",
  12643. editorStyle: "wp-block-file-editor",
  12644. style: "wp-block-file"
  12645. };
  12646. const {
  12647. name: file_name
  12648. } = file_metadata;
  12649. const file_settings = {
  12650. icon: library_file,
  12651. example: {
  12652. attributes: {
  12653. href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',
  12654. fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file')
  12655. }
  12656. },
  12657. transforms: file_transforms,
  12658. deprecated: file_deprecated,
  12659. edit: file_edit,
  12660. save: file_save_save
  12661. };
  12662. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js
  12663. /**
  12664. * WordPress dependencies
  12665. */
  12666. const gallery = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  12667. viewBox: "0 0 24 24",
  12668. xmlns: "http://www.w3.org/2000/svg"
  12669. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  12670. d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"
  12671. }));
  12672. /* harmony default export */ var library_gallery = (gallery);
  12673. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js
  12674. const LINK_DESTINATION_NONE = 'none';
  12675. const LINK_DESTINATION_MEDIA = 'media';
  12676. const LINK_DESTINATION_ATTACHMENT = 'attachment';
  12677. const LINK_DESTINATION_MEDIA_WP_CORE = 'file';
  12678. const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post';
  12679. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js
  12680. /**
  12681. * External dependencies
  12682. */
  12683. function defaultColumnsNumber(imageCount) {
  12684. return imageCount ? Math.min(3, imageCount) : 3;
  12685. }
  12686. const pickRelevantMediaFiles = function (image) {
  12687. let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
  12688. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  12689. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
  12690. const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
  12691. if (fullUrl) {
  12692. imageProps.fullUrl = fullUrl;
  12693. }
  12694. return imageProps;
  12695. };
  12696. /**
  12697. * The new gallery block format is not compatible with the use_BalanceTags option
  12698. * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
  12699. * window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method
  12700. * can be removed when minimum supported WP version >=5.9.
  12701. */
  12702. function isGalleryV2Enabled() {
  12703. // Only run the Gallery version compat check if the plugin is running, otherwise
  12704. // assume we are in 5.9 core and enable by default.
  12705. if (false) {}
  12706. return true;
  12707. }
  12708. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js
  12709. /**
  12710. * External dependencies
  12711. */
  12712. /**
  12713. * WordPress dependencies
  12714. */
  12715. /**
  12716. * Internal dependencies
  12717. */
  12718. const DEPRECATED_LINK_DESTINATION_MEDIA = 'file';
  12719. const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post';
  12720. /**
  12721. * Original function to determine default number of columns from a block's
  12722. * attributes.
  12723. *
  12724. * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks.
  12725. *
  12726. * @param {Object} attributes Block attributes.
  12727. * @return {number} Default number of columns for the gallery.
  12728. */
  12729. function defaultColumnsNumberV1(attributes) {
  12730. var _attributes$images;
  12731. return Math.min(3, attributes === null || attributes === void 0 ? void 0 : (_attributes$images = attributes.images) === null || _attributes$images === void 0 ? void 0 : _attributes$images.length);
  12732. }
  12733. /**
  12734. * Original function to determine new href and linkDestination values for an image block from the
  12735. * supplied Gallery link destination.
  12736. *
  12737. * Used in deprecations: v1-6.
  12738. *
  12739. * @param {Object} image Gallery image.
  12740. * @param {string} destination Gallery's selected link destination.
  12741. * @return {Object} New attributes to assign to image block.
  12742. */
  12743. function getHrefAndDestination(image, destination) {
  12744. // Need to determine the URL that the selected destination maps to.
  12745. // Gutenberg and WordPress use different constants so the new link
  12746. // destination also needs to be tweaked.
  12747. switch (destination) {
  12748. case DEPRECATED_LINK_DESTINATION_MEDIA:
  12749. return {
  12750. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  12751. // eslint-disable-line camelcase
  12752. linkDestination: LINK_DESTINATION_MEDIA
  12753. };
  12754. case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
  12755. return {
  12756. href: image === null || image === void 0 ? void 0 : image.link,
  12757. linkDestination: LINK_DESTINATION_ATTACHMENT
  12758. };
  12759. case LINK_DESTINATION_MEDIA:
  12760. return {
  12761. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  12762. // eslint-disable-line camelcase
  12763. linkDestination: LINK_DESTINATION_MEDIA
  12764. };
  12765. case LINK_DESTINATION_ATTACHMENT:
  12766. return {
  12767. href: image === null || image === void 0 ? void 0 : image.link,
  12768. linkDestination: LINK_DESTINATION_ATTACHMENT
  12769. };
  12770. case LINK_DESTINATION_NONE:
  12771. return {
  12772. href: undefined,
  12773. linkDestination: LINK_DESTINATION_NONE
  12774. };
  12775. }
  12776. return {};
  12777. }
  12778. function runV2Migration(attributes) {
  12779. let linkTo = attributes.linkTo ? attributes.linkTo : 'none';
  12780. if (linkTo === 'post') {
  12781. linkTo = 'attachment';
  12782. } else if (linkTo === 'file') {
  12783. linkTo = 'media';
  12784. }
  12785. const imageBlocks = attributes.images.map(image => {
  12786. return getImageBlock(image, attributes.sizeSlug, linkTo);
  12787. });
  12788. return [{ ...(0,external_lodash_namespaceObject.omit)(attributes, ['images', 'ids']),
  12789. linkTo,
  12790. allowResize: false
  12791. }, imageBlocks];
  12792. }
  12793. /**
  12794. * Gets an Image block from gallery image data
  12795. *
  12796. * Used to migrate Galleries to nested Image InnerBlocks.
  12797. *
  12798. * @param {Object} image Image properties.
  12799. * @param {string} sizeSlug Gallery sizeSlug attribute.
  12800. * @param {string} linkTo Gallery linkTo attribute.
  12801. * @return {Object} Image block.
  12802. */
  12803. function getImageBlock(image, sizeSlug, linkTo) {
  12804. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && {
  12805. id: parseInt(image.id)
  12806. }),
  12807. url: image.url,
  12808. alt: image.alt,
  12809. caption: image.caption,
  12810. sizeSlug,
  12811. ...getHrefAndDestination(image, linkTo)
  12812. });
  12813. }
  12814. const deprecated_v6 = {
  12815. attributes: {
  12816. images: {
  12817. type: 'array',
  12818. default: [],
  12819. source: 'query',
  12820. selector: '.blocks-gallery-item',
  12821. query: {
  12822. url: {
  12823. type: 'string',
  12824. source: 'attribute',
  12825. selector: 'img',
  12826. attribute: 'src'
  12827. },
  12828. fullUrl: {
  12829. type: 'string',
  12830. source: 'attribute',
  12831. selector: 'img',
  12832. attribute: 'data-full-url'
  12833. },
  12834. link: {
  12835. type: 'string',
  12836. source: 'attribute',
  12837. selector: 'img',
  12838. attribute: 'data-link'
  12839. },
  12840. alt: {
  12841. type: 'string',
  12842. source: 'attribute',
  12843. selector: 'img',
  12844. attribute: 'alt',
  12845. default: ''
  12846. },
  12847. id: {
  12848. type: 'string',
  12849. source: 'attribute',
  12850. selector: 'img',
  12851. attribute: 'data-id'
  12852. },
  12853. caption: {
  12854. type: 'string',
  12855. source: 'html',
  12856. selector: '.blocks-gallery-item__caption'
  12857. }
  12858. }
  12859. },
  12860. ids: {
  12861. type: 'array',
  12862. items: {
  12863. type: 'number'
  12864. },
  12865. default: []
  12866. },
  12867. columns: {
  12868. type: 'number',
  12869. minimum: 1,
  12870. maximum: 8
  12871. },
  12872. caption: {
  12873. type: 'string',
  12874. source: 'html',
  12875. selector: '.blocks-gallery-caption'
  12876. },
  12877. imageCrop: {
  12878. type: 'boolean',
  12879. default: true
  12880. },
  12881. fixedHeight: {
  12882. type: 'boolean',
  12883. default: true
  12884. },
  12885. linkTo: {
  12886. type: 'string'
  12887. },
  12888. sizeSlug: {
  12889. type: 'string',
  12890. default: 'large'
  12891. }
  12892. },
  12893. supports: {
  12894. anchor: true,
  12895. align: true
  12896. },
  12897. save(_ref) {
  12898. let {
  12899. attributes
  12900. } = _ref;
  12901. const {
  12902. images,
  12903. columns = defaultColumnsNumberV1(attributes),
  12904. imageCrop,
  12905. caption,
  12906. linkTo
  12907. } = attributes;
  12908. const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  12909. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  12910. className
  12911. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  12912. className: "blocks-gallery-grid"
  12913. }, images.map(image => {
  12914. let href;
  12915. switch (linkTo) {
  12916. case DEPRECATED_LINK_DESTINATION_MEDIA:
  12917. href = image.fullUrl || image.url;
  12918. break;
  12919. case DEPRECATED_LINK_DESTINATION_ATTACHMENT:
  12920. href = image.link;
  12921. break;
  12922. }
  12923. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  12924. src: image.url,
  12925. alt: image.alt,
  12926. "data-id": image.id,
  12927. "data-full-url": image.fullUrl,
  12928. "data-link": image.link,
  12929. className: image.id ? `wp-image-${image.id}` : null
  12930. });
  12931. return (0,external_wp_element_namespaceObject.createElement)("li", {
  12932. key: image.id || image.url,
  12933. className: "blocks-gallery-item"
  12934. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  12935. href: href
  12936. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12937. tagName: "figcaption",
  12938. className: "blocks-gallery-item__caption",
  12939. value: image.caption
  12940. })));
  12941. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  12942. tagName: "figcaption",
  12943. className: "blocks-gallery-caption",
  12944. value: caption
  12945. }));
  12946. },
  12947. migrate(attributes) {
  12948. if (isGalleryV2Enabled()) {
  12949. return runV2Migration(attributes);
  12950. }
  12951. return attributes;
  12952. }
  12953. };
  12954. const deprecated_v5 = {
  12955. attributes: {
  12956. images: {
  12957. type: 'array',
  12958. default: [],
  12959. source: 'query',
  12960. selector: '.blocks-gallery-item',
  12961. query: {
  12962. url: {
  12963. type: 'string',
  12964. source: 'attribute',
  12965. selector: 'img',
  12966. attribute: 'src'
  12967. },
  12968. fullUrl: {
  12969. type: 'string',
  12970. source: 'attribute',
  12971. selector: 'img',
  12972. attribute: 'data-full-url'
  12973. },
  12974. link: {
  12975. type: 'string',
  12976. source: 'attribute',
  12977. selector: 'img',
  12978. attribute: 'data-link'
  12979. },
  12980. alt: {
  12981. type: 'string',
  12982. source: 'attribute',
  12983. selector: 'img',
  12984. attribute: 'alt',
  12985. default: ''
  12986. },
  12987. id: {
  12988. type: 'string',
  12989. source: 'attribute',
  12990. selector: 'img',
  12991. attribute: 'data-id'
  12992. },
  12993. caption: {
  12994. type: 'string',
  12995. source: 'html',
  12996. selector: '.blocks-gallery-item__caption'
  12997. }
  12998. }
  12999. },
  13000. ids: {
  13001. type: 'array',
  13002. items: {
  13003. type: 'number'
  13004. },
  13005. default: []
  13006. },
  13007. columns: {
  13008. type: 'number',
  13009. minimum: 1,
  13010. maximum: 8
  13011. },
  13012. caption: {
  13013. type: 'string',
  13014. source: 'html',
  13015. selector: '.blocks-gallery-caption'
  13016. },
  13017. imageCrop: {
  13018. type: 'boolean',
  13019. default: true
  13020. },
  13021. linkTo: {
  13022. type: 'string',
  13023. default: 'none'
  13024. },
  13025. sizeSlug: {
  13026. type: 'string',
  13027. default: 'large'
  13028. }
  13029. },
  13030. supports: {
  13031. align: true
  13032. },
  13033. isEligible(_ref2) {
  13034. let {
  13035. linkTo
  13036. } = _ref2;
  13037. return !linkTo || linkTo === 'attachment' || linkTo === 'media';
  13038. },
  13039. migrate(attributes) {
  13040. if (isGalleryV2Enabled()) {
  13041. return runV2Migration(attributes);
  13042. }
  13043. let linkTo = attributes.linkTo;
  13044. if (!attributes.linkTo) {
  13045. linkTo = 'none';
  13046. } else if (attributes.linkTo === 'attachment') {
  13047. linkTo = 'post';
  13048. } else if (attributes.linkTo === 'media') {
  13049. linkTo = 'file';
  13050. }
  13051. return { ...attributes,
  13052. linkTo
  13053. };
  13054. },
  13055. save(_ref3) {
  13056. let {
  13057. attributes
  13058. } = _ref3;
  13059. const {
  13060. images,
  13061. columns = defaultColumnsNumberV1(attributes),
  13062. imageCrop,
  13063. caption,
  13064. linkTo
  13065. } = attributes;
  13066. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13067. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13068. }, (0,external_wp_element_namespaceObject.createElement)("ul", {
  13069. className: "blocks-gallery-grid"
  13070. }, images.map(image => {
  13071. let href;
  13072. switch (linkTo) {
  13073. case 'media':
  13074. href = image.fullUrl || image.url;
  13075. break;
  13076. case 'attachment':
  13077. href = image.link;
  13078. break;
  13079. }
  13080. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13081. src: image.url,
  13082. alt: image.alt,
  13083. "data-id": image.id,
  13084. "data-full-url": image.fullUrl,
  13085. "data-link": image.link,
  13086. className: image.id ? `wp-image-${image.id}` : null
  13087. });
  13088. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13089. key: image.id || image.url,
  13090. className: "blocks-gallery-item"
  13091. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13092. href: href
  13093. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13094. tagName: "figcaption",
  13095. className: "blocks-gallery-item__caption",
  13096. value: image.caption
  13097. })));
  13098. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13099. tagName: "figcaption",
  13100. className: "blocks-gallery-caption",
  13101. value: caption
  13102. }));
  13103. }
  13104. };
  13105. const deprecated_v4 = {
  13106. attributes: {
  13107. images: {
  13108. type: 'array',
  13109. default: [],
  13110. source: 'query',
  13111. selector: '.blocks-gallery-item',
  13112. query: {
  13113. url: {
  13114. source: 'attribute',
  13115. selector: 'img',
  13116. attribute: 'src'
  13117. },
  13118. fullUrl: {
  13119. source: 'attribute',
  13120. selector: 'img',
  13121. attribute: 'data-full-url'
  13122. },
  13123. link: {
  13124. source: 'attribute',
  13125. selector: 'img',
  13126. attribute: 'data-link'
  13127. },
  13128. alt: {
  13129. source: 'attribute',
  13130. selector: 'img',
  13131. attribute: 'alt',
  13132. default: ''
  13133. },
  13134. id: {
  13135. source: 'attribute',
  13136. selector: 'img',
  13137. attribute: 'data-id'
  13138. },
  13139. caption: {
  13140. type: 'string',
  13141. source: 'html',
  13142. selector: '.blocks-gallery-item__caption'
  13143. }
  13144. }
  13145. },
  13146. ids: {
  13147. type: 'array',
  13148. default: []
  13149. },
  13150. columns: {
  13151. type: 'number'
  13152. },
  13153. caption: {
  13154. type: 'string',
  13155. source: 'html',
  13156. selector: '.blocks-gallery-caption'
  13157. },
  13158. imageCrop: {
  13159. type: 'boolean',
  13160. default: true
  13161. },
  13162. linkTo: {
  13163. type: 'string',
  13164. default: 'none'
  13165. }
  13166. },
  13167. supports: {
  13168. align: true
  13169. },
  13170. isEligible(_ref4) {
  13171. let {
  13172. ids
  13173. } = _ref4;
  13174. return ids && ids.some(id => typeof id === 'string');
  13175. },
  13176. migrate(attributes) {
  13177. if (isGalleryV2Enabled()) {
  13178. return runV2Migration(attributes);
  13179. }
  13180. return { ...attributes,
  13181. ids: (0,external_lodash_namespaceObject.map)(attributes.ids, id => {
  13182. const parsedId = parseInt(id, 10);
  13183. return Number.isInteger(parsedId) ? parsedId : null;
  13184. })
  13185. };
  13186. },
  13187. save(_ref5) {
  13188. let {
  13189. attributes
  13190. } = _ref5;
  13191. const {
  13192. images,
  13193. columns = defaultColumnsNumberV1(attributes),
  13194. imageCrop,
  13195. caption,
  13196. linkTo
  13197. } = attributes;
  13198. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13199. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13200. }, (0,external_wp_element_namespaceObject.createElement)("ul", {
  13201. className: "blocks-gallery-grid"
  13202. }, images.map(image => {
  13203. let href;
  13204. switch (linkTo) {
  13205. case 'media':
  13206. href = image.fullUrl || image.url;
  13207. break;
  13208. case 'attachment':
  13209. href = image.link;
  13210. break;
  13211. }
  13212. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13213. src: image.url,
  13214. alt: image.alt,
  13215. "data-id": image.id,
  13216. "data-full-url": image.fullUrl,
  13217. "data-link": image.link,
  13218. className: image.id ? `wp-image-${image.id}` : null
  13219. });
  13220. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13221. key: image.id || image.url,
  13222. className: "blocks-gallery-item"
  13223. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13224. href: href
  13225. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13226. tagName: "figcaption",
  13227. className: "blocks-gallery-item__caption",
  13228. value: image.caption
  13229. })));
  13230. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13231. tagName: "figcaption",
  13232. className: "blocks-gallery-caption",
  13233. value: caption
  13234. }));
  13235. }
  13236. };
  13237. const deprecated_v3 = {
  13238. attributes: {
  13239. images: {
  13240. type: 'array',
  13241. default: [],
  13242. source: 'query',
  13243. selector: 'ul.wp-block-gallery .blocks-gallery-item',
  13244. query: {
  13245. url: {
  13246. source: 'attribute',
  13247. selector: 'img',
  13248. attribute: 'src'
  13249. },
  13250. fullUrl: {
  13251. source: 'attribute',
  13252. selector: 'img',
  13253. attribute: 'data-full-url'
  13254. },
  13255. alt: {
  13256. source: 'attribute',
  13257. selector: 'img',
  13258. attribute: 'alt',
  13259. default: ''
  13260. },
  13261. id: {
  13262. source: 'attribute',
  13263. selector: 'img',
  13264. attribute: 'data-id'
  13265. },
  13266. link: {
  13267. source: 'attribute',
  13268. selector: 'img',
  13269. attribute: 'data-link'
  13270. },
  13271. caption: {
  13272. type: 'array',
  13273. source: 'children',
  13274. selector: 'figcaption'
  13275. }
  13276. }
  13277. },
  13278. ids: {
  13279. type: 'array',
  13280. default: []
  13281. },
  13282. columns: {
  13283. type: 'number'
  13284. },
  13285. imageCrop: {
  13286. type: 'boolean',
  13287. default: true
  13288. },
  13289. linkTo: {
  13290. type: 'string',
  13291. default: 'none'
  13292. }
  13293. },
  13294. supports: {
  13295. align: true
  13296. },
  13297. save(_ref6) {
  13298. let {
  13299. attributes
  13300. } = _ref6;
  13301. const {
  13302. images,
  13303. columns = defaultColumnsNumberV1(attributes),
  13304. imageCrop,
  13305. linkTo
  13306. } = attributes;
  13307. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  13308. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13309. }, images.map(image => {
  13310. let href;
  13311. switch (linkTo) {
  13312. case 'media':
  13313. href = image.fullUrl || image.url;
  13314. break;
  13315. case 'attachment':
  13316. href = image.link;
  13317. break;
  13318. }
  13319. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13320. src: image.url,
  13321. alt: image.alt,
  13322. "data-id": image.id,
  13323. "data-full-url": image.fullUrl,
  13324. "data-link": image.link,
  13325. className: image.id ? `wp-image-${image.id}` : null
  13326. });
  13327. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13328. key: image.id || image.url,
  13329. className: "blocks-gallery-item"
  13330. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13331. href: href
  13332. }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13333. tagName: "figcaption",
  13334. value: image.caption
  13335. })));
  13336. }));
  13337. },
  13338. migrate(attributes) {
  13339. if (isGalleryV2Enabled()) {
  13340. return runV2Migration(attributes);
  13341. }
  13342. return attributes;
  13343. }
  13344. };
  13345. const deprecated_v2 = {
  13346. attributes: {
  13347. images: {
  13348. type: 'array',
  13349. default: [],
  13350. source: 'query',
  13351. selector: 'ul.wp-block-gallery .blocks-gallery-item',
  13352. query: {
  13353. url: {
  13354. source: 'attribute',
  13355. selector: 'img',
  13356. attribute: 'src'
  13357. },
  13358. alt: {
  13359. source: 'attribute',
  13360. selector: 'img',
  13361. attribute: 'alt',
  13362. default: ''
  13363. },
  13364. id: {
  13365. source: 'attribute',
  13366. selector: 'img',
  13367. attribute: 'data-id'
  13368. },
  13369. link: {
  13370. source: 'attribute',
  13371. selector: 'img',
  13372. attribute: 'data-link'
  13373. },
  13374. caption: {
  13375. type: 'array',
  13376. source: 'children',
  13377. selector: 'figcaption'
  13378. }
  13379. }
  13380. },
  13381. columns: {
  13382. type: 'number'
  13383. },
  13384. imageCrop: {
  13385. type: 'boolean',
  13386. default: true
  13387. },
  13388. linkTo: {
  13389. type: 'string',
  13390. default: 'none'
  13391. }
  13392. },
  13393. isEligible(_ref7) {
  13394. let {
  13395. images,
  13396. ids
  13397. } = _ref7;
  13398. return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || (0,external_lodash_namespaceObject.some)(images, (id, index) => {
  13399. if (!id && ids[index] !== null) {
  13400. return true;
  13401. }
  13402. return parseInt(id, 10) !== ids[index];
  13403. }));
  13404. },
  13405. migrate(attributes) {
  13406. if (isGalleryV2Enabled()) {
  13407. return runV2Migration(attributes);
  13408. }
  13409. return { ...attributes,
  13410. ids: (0,external_lodash_namespaceObject.map)(attributes.images, _ref8 => {
  13411. let {
  13412. id
  13413. } = _ref8;
  13414. if (!id) {
  13415. return null;
  13416. }
  13417. return parseInt(id, 10);
  13418. })
  13419. };
  13420. },
  13421. supports: {
  13422. align: true
  13423. },
  13424. save(_ref9) {
  13425. let {
  13426. attributes
  13427. } = _ref9;
  13428. const {
  13429. images,
  13430. columns = defaultColumnsNumberV1(attributes),
  13431. imageCrop,
  13432. linkTo
  13433. } = attributes;
  13434. return (0,external_wp_element_namespaceObject.createElement)("ul", {
  13435. className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
  13436. }, images.map(image => {
  13437. let href;
  13438. switch (linkTo) {
  13439. case 'media':
  13440. href = image.url;
  13441. break;
  13442. case 'attachment':
  13443. href = image.link;
  13444. break;
  13445. }
  13446. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13447. src: image.url,
  13448. alt: image.alt,
  13449. "data-id": image.id,
  13450. "data-link": image.link,
  13451. className: image.id ? `wp-image-${image.id}` : null
  13452. });
  13453. return (0,external_wp_element_namespaceObject.createElement)("li", {
  13454. key: image.id || image.url,
  13455. className: "blocks-gallery-item"
  13456. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13457. href: href
  13458. }, img) : img, image.caption && image.caption.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  13459. tagName: "figcaption",
  13460. value: image.caption
  13461. })));
  13462. }));
  13463. }
  13464. };
  13465. const gallery_deprecated_v1 = {
  13466. attributes: {
  13467. images: {
  13468. type: 'array',
  13469. default: [],
  13470. source: 'query',
  13471. selector: 'div.wp-block-gallery figure.blocks-gallery-image img',
  13472. query: {
  13473. url: {
  13474. source: 'attribute',
  13475. attribute: 'src'
  13476. },
  13477. alt: {
  13478. source: 'attribute',
  13479. attribute: 'alt',
  13480. default: ''
  13481. },
  13482. id: {
  13483. source: 'attribute',
  13484. attribute: 'data-id'
  13485. }
  13486. }
  13487. },
  13488. columns: {
  13489. type: 'number'
  13490. },
  13491. imageCrop: {
  13492. type: 'boolean',
  13493. default: true
  13494. },
  13495. linkTo: {
  13496. type: 'string',
  13497. default: 'none'
  13498. },
  13499. align: {
  13500. type: 'string',
  13501. default: 'none'
  13502. }
  13503. },
  13504. supports: {
  13505. align: true
  13506. },
  13507. save(_ref10) {
  13508. let {
  13509. attributes
  13510. } = _ref10;
  13511. const {
  13512. images,
  13513. columns = defaultColumnsNumberV1(attributes),
  13514. align,
  13515. imageCrop,
  13516. linkTo
  13517. } = attributes;
  13518. const className = classnames_default()(`columns-${columns}`, {
  13519. alignnone: align === 'none',
  13520. 'is-cropped': imageCrop
  13521. });
  13522. return (0,external_wp_element_namespaceObject.createElement)("div", {
  13523. className: className
  13524. }, images.map(image => {
  13525. let href;
  13526. switch (linkTo) {
  13527. case 'media':
  13528. href = image.url;
  13529. break;
  13530. case 'attachment':
  13531. href = image.link;
  13532. break;
  13533. }
  13534. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  13535. src: image.url,
  13536. alt: image.alt,
  13537. "data-id": image.id
  13538. });
  13539. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  13540. key: image.id || image.url,
  13541. className: "blocks-gallery-image"
  13542. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  13543. href: href
  13544. }, img) : img);
  13545. }));
  13546. },
  13547. migrate(attributes) {
  13548. if (isGalleryV2Enabled()) {
  13549. return runV2Migration(attributes);
  13550. }
  13551. return attributes;
  13552. }
  13553. };
  13554. /* harmony default export */ var gallery_deprecated = ([deprecated_v6, deprecated_v5, deprecated_v4, deprecated_v3, deprecated_v2, gallery_deprecated_v1]);
  13555. ;// CONCATENATED MODULE: external ["wp","viewport"]
  13556. var external_wp_viewport_namespaceObject = window["wp"]["viewport"];
  13557. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js
  13558. /**
  13559. * WordPress dependencies
  13560. */
  13561. const sharedIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  13562. icon: library_gallery
  13563. });
  13564. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/constants.js
  13565. const MIN_SIZE = 20;
  13566. const constants_LINK_DESTINATION_NONE = 'none';
  13567. const constants_LINK_DESTINATION_MEDIA = 'media';
  13568. const constants_LINK_DESTINATION_ATTACHMENT = 'attachment';
  13569. const LINK_DESTINATION_CUSTOM = 'custom';
  13570. const constants_NEW_TAB_REL = ['noreferrer', 'noopener'];
  13571. const constants_ALLOWED_MEDIA_TYPES = ['image'];
  13572. const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0;
  13573. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/utils.js
  13574. /**
  13575. * Internal dependencies
  13576. */
  13577. /**
  13578. * Determines new href and linkDestination values for an image block from the
  13579. * supplied Gallery link destination.
  13580. *
  13581. * @param {Object} image Gallery image.
  13582. * @param {string} destination Gallery's selected link destination.
  13583. * @return {Object} New attributes to assign to image block.
  13584. */
  13585. function utils_getHrefAndDestination(image, destination) {
  13586. // Gutenberg and WordPress use different constants so if image_default_link_type
  13587. // option is set we need to map from the WP Core values.
  13588. switch (destination) {
  13589. case LINK_DESTINATION_MEDIA_WP_CORE:
  13590. case LINK_DESTINATION_MEDIA:
  13591. return {
  13592. href: (image === null || image === void 0 ? void 0 : image.source_url) || (image === null || image === void 0 ? void 0 : image.url),
  13593. // eslint-disable-line camelcase
  13594. linkDestination: constants_LINK_DESTINATION_MEDIA
  13595. };
  13596. case LINK_DESTINATION_ATTACHMENT_WP_CORE:
  13597. case LINK_DESTINATION_ATTACHMENT:
  13598. return {
  13599. href: image === null || image === void 0 ? void 0 : image.link,
  13600. linkDestination: constants_LINK_DESTINATION_ATTACHMENT
  13601. };
  13602. case LINK_DESTINATION_NONE:
  13603. return {
  13604. href: undefined,
  13605. linkDestination: constants_LINK_DESTINATION_NONE
  13606. };
  13607. }
  13608. return {};
  13609. }
  13610. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/utils.js
  13611. /**
  13612. * External dependencies
  13613. */
  13614. /**
  13615. * Internal dependencies
  13616. */
  13617. function removeNewTabRel(currentRel) {
  13618. let newRel = currentRel;
  13619. if (currentRel !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  13620. if (!(0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  13621. (0,external_lodash_namespaceObject.each)(constants_NEW_TAB_REL, relVal => {
  13622. const regExp = new RegExp('\\b' + relVal + '\\b', 'gi');
  13623. newRel = newRel.replace(regExp, '');
  13624. }); // Only trim if NEW_TAB_REL values was replaced.
  13625. if (newRel !== currentRel) {
  13626. newRel = newRel.trim();
  13627. }
  13628. if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) {
  13629. newRel = undefined;
  13630. }
  13631. }
  13632. }
  13633. return newRel;
  13634. }
  13635. /**
  13636. * Helper to get the link target settings to be stored.
  13637. *
  13638. * @param {boolean} value The new link target value.
  13639. * @param {Object} attributes Block attributes.
  13640. * @param {Object} attributes.rel Image block's rel attribute.
  13641. *
  13642. * @return {Object} Updated link target settings.
  13643. */
  13644. function getUpdatedLinkTargetSettings(value, _ref) {
  13645. let {
  13646. rel
  13647. } = _ref;
  13648. const linkTarget = value ? '_blank' : undefined;
  13649. let updatedRel;
  13650. if (!linkTarget && !rel) {
  13651. updatedRel = undefined;
  13652. } else {
  13653. updatedRel = removeNewTabRel(rel);
  13654. }
  13655. return {
  13656. linkTarget,
  13657. rel: updatedRel
  13658. };
  13659. }
  13660. /**
  13661. * Determines new Image block attributes size selection.
  13662. *
  13663. * @param {Object} image Media file object for gallery image.
  13664. * @param {string} size Selected size slug to apply.
  13665. */
  13666. function getImageSizeAttributes(image, size) {
  13667. const url = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']);
  13668. if (url) {
  13669. return {
  13670. url,
  13671. width: undefined,
  13672. height: undefined,
  13673. sizeSlug: size
  13674. };
  13675. }
  13676. return {};
  13677. }
  13678. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js
  13679. /**
  13680. * External dependencies
  13681. */
  13682. /**
  13683. * WordPress dependencies
  13684. */
  13685. const allowedBlocks = ['core/image'];
  13686. const Gallery = props => {
  13687. const {
  13688. attributes,
  13689. isSelected,
  13690. setAttributes,
  13691. mediaPlaceholder,
  13692. insertBlocksAfter,
  13693. blockProps
  13694. } = props;
  13695. const {
  13696. align,
  13697. columns,
  13698. caption,
  13699. imageCrop
  13700. } = attributes;
  13701. const {
  13702. children,
  13703. ...innerBlocksProps
  13704. } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  13705. allowedBlocks,
  13706. orientation: 'horizontal',
  13707. renderAppender: false,
  13708. __experimentalLayout: {
  13709. type: 'default',
  13710. alignments: []
  13711. }
  13712. });
  13713. const [captionFocused, setCaptionFocused] = (0,external_wp_element_namespaceObject.useState)(false);
  13714. function onFocusCaption() {
  13715. if (!captionFocused) {
  13716. setCaptionFocused(true);
  13717. }
  13718. }
  13719. function removeCaptionFocus() {
  13720. if (captionFocused) {
  13721. setCaptionFocused(false);
  13722. }
  13723. }
  13724. (0,external_wp_element_namespaceObject.useEffect)(() => {
  13725. if (!isSelected) {
  13726. setCaptionFocused(false);
  13727. }
  13728. }, [isSelected]);
  13729. return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, innerBlocksProps, {
  13730. className: classnames_default()(blockProps.className, 'blocks-gallery-grid', {
  13731. [`align${align}`]: align,
  13732. [`columns-${columns}`]: columns !== undefined,
  13733. [`columns-default`]: columns === undefined,
  13734. 'is-cropped': imageCrop
  13735. })
  13736. }), children, isSelected && !children && (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
  13737. className: "blocks-gallery-media-placeholder-wrapper",
  13738. onClick: removeCaptionFocus
  13739. }, mediaPlaceholder), (0,external_wp_element_namespaceObject.createElement)(RichTextVisibilityHelper, {
  13740. isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
  13741. captionFocused: captionFocused,
  13742. onFocusCaption: onFocusCaption,
  13743. tagName: "figcaption",
  13744. className: "blocks-gallery-caption",
  13745. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
  13746. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
  13747. value: caption,
  13748. onChange: value => setAttributes({
  13749. caption: value
  13750. }),
  13751. inlineToolbar: true,
  13752. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  13753. }));
  13754. };
  13755. function RichTextVisibilityHelper(_ref) {
  13756. let {
  13757. isHidden,
  13758. captionFocused,
  13759. onFocusCaption,
  13760. className,
  13761. value,
  13762. placeholder,
  13763. tagName,
  13764. captionRef,
  13765. ...richTextProps
  13766. } = _ref;
  13767. if (isHidden) {
  13768. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
  13769. as: external_wp_blockEditor_namespaceObject.RichText
  13770. }, richTextProps));
  13771. }
  13772. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  13773. ref: captionRef,
  13774. value: value,
  13775. placeholder: placeholder,
  13776. className: className,
  13777. tagName: tagName,
  13778. isSelected: captionFocused,
  13779. onClick: onFocusCaption
  13780. }, richTextProps));
  13781. }
  13782. /* harmony default export */ var gallery_gallery = (Gallery);
  13783. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js
  13784. /**
  13785. * External dependencies
  13786. */
  13787. /**
  13788. * WordPress dependencies
  13789. */
  13790. /**
  13791. * Calculates the image sizes that are avaible for the current gallery images in order to
  13792. * populate the 'Image size' selector.
  13793. *
  13794. * @param {Array} images Basic image block data taken from current gallery innerBlock
  13795. * @param {boolean} isSelected Is the block currently selected in the editor.
  13796. * @param {Function} getSettings Block editor store selector.
  13797. *
  13798. * @return {Array} An array of image size options.
  13799. */
  13800. function useImageSizes(images, isSelected, getSettings) {
  13801. return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]);
  13802. function getImageSizing() {
  13803. if (!images || images.length === 0) {
  13804. return;
  13805. }
  13806. const {
  13807. imageSizes
  13808. } = getSettings();
  13809. let resizedImages = {};
  13810. if (isSelected) {
  13811. resizedImages = images.reduce((currentResizedImages, img) => {
  13812. if (!img.id) {
  13813. return currentResizedImages;
  13814. }
  13815. const sizes = imageSizes.reduce((currentSizes, size) => {
  13816. const defaultUrl = (0,external_lodash_namespaceObject.get)(img, ['sizes', size.slug, 'url']);
  13817. const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(img, ['media_details', 'sizes', size.slug, 'source_url']);
  13818. return { ...currentSizes,
  13819. [size.slug]: defaultUrl || mediaDetailsUrl
  13820. };
  13821. }, {});
  13822. return { ...currentResizedImages,
  13823. [parseInt(img.id, 10)]: sizes
  13824. };
  13825. }, {});
  13826. }
  13827. return imageSizes.filter(_ref => {
  13828. let {
  13829. slug
  13830. } = _ref;
  13831. return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
  13832. }).map(_ref2 => {
  13833. let {
  13834. name,
  13835. slug
  13836. } = _ref2;
  13837. return {
  13838. value: slug,
  13839. label: name
  13840. };
  13841. });
  13842. }
  13843. }
  13844. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-short-code-transform.js
  13845. /**
  13846. * External dependencies
  13847. */
  13848. /**
  13849. * WordPress dependencies
  13850. */
  13851. /**
  13852. * Shortcode transforms don't currently have a tranform method and so can't use a selector to
  13853. * retrieve the data for each image being transformer, so this selector handle this post transformation.
  13854. *
  13855. * @param {Array} shortCodeTransforms An array of image data passed from the shortcode transform.
  13856. *
  13857. * @return {Array} An array of extended image data objects for each of the shortcode transform images.
  13858. */
  13859. function useShortCodeTransform(shortCodeTransforms) {
  13860. const newImageData = (0,external_wp_data_namespaceObject.useSelect)(select => {
  13861. if (!shortCodeTransforms || shortCodeTransforms.length === 0) {
  13862. return;
  13863. }
  13864. const getMedia = select(external_wp_coreData_namespaceObject.store).getMedia;
  13865. return shortCodeTransforms.map(image => {
  13866. const imageData = getMedia(image.id);
  13867. if (imageData) {
  13868. return {
  13869. id: imageData.id,
  13870. type: 'image',
  13871. url: imageData.source_url,
  13872. mime: imageData.mime_type,
  13873. alt: imageData.alt_text,
  13874. link: imageData.link
  13875. };
  13876. }
  13877. return undefined;
  13878. });
  13879. }, [shortCodeTransforms]);
  13880. if (!newImageData) {
  13881. return;
  13882. }
  13883. if ((0,external_lodash_namespaceObject.every)(newImageData, img => img && img.url)) {
  13884. return newImageData;
  13885. }
  13886. }
  13887. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js
  13888. /**
  13889. * WordPress dependencies
  13890. */
  13891. /**
  13892. * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This
  13893. * is required so default gallery attributes can be applied without overwriting any custom
  13894. * attributes applied to existing images.
  13895. *
  13896. * @param {Array} images Basic image block data taken from current gallery innerBlock
  13897. * @param {Array} imageData The related image data for each of the current gallery images.
  13898. *
  13899. * @return {Array} An array of any new images that have been added to the gallery.
  13900. */
  13901. function useGetNewImages(images, imageData) {
  13902. const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]);
  13903. return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]);
  13904. function getNewImages() {
  13905. let imagesUpdated = false; // First lets check if any images have been deleted.
  13906. const newCurrentImages = currentImages.filter(currentImg => images.find(img => {
  13907. return currentImg.clientId === img.clientId;
  13908. }));
  13909. if (newCurrentImages.length < currentImages.length) {
  13910. imagesUpdated = true;
  13911. } // Now lets see if we have any images hydrated from saved content and if so
  13912. // add them to currentImages state.
  13913. images.forEach(image => {
  13914. if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) {
  13915. imagesUpdated = true;
  13916. newCurrentImages.push(image);
  13917. }
  13918. }); // Now check for any new images that have been added to InnerBlocks and for which
  13919. // we have the imageData we need for setting default block attributes.
  13920. const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && (imageData === null || imageData === void 0 ? void 0 : imageData.find(img => img.id === image.id)) && !image.fromSavedConent);
  13921. if (imagesUpdated || (newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
  13922. setCurrentImages([...newCurrentImages, ...newImages]);
  13923. }
  13924. return newImages.length > 0 ? newImages : null;
  13925. }
  13926. }
  13927. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js
  13928. /**
  13929. * WordPress dependencies
  13930. */
  13931. /**
  13932. * Retrieves the extended media info for each gallery image from the store. This is used to
  13933. * determine which image size options are available for the current gallery.
  13934. *
  13935. * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery.
  13936. *
  13937. * @return {Array} An array of media info options for each gallery image.
  13938. */
  13939. function useGetMedia(innerBlockImages) {
  13940. const [currentImageMedia, setCurrentImageMedia] = (0,external_wp_element_namespaceObject.useState)([]);
  13941. const imageMedia = (0,external_wp_data_namespaceObject.useSelect)(select => {
  13942. if (!(innerBlockImages !== null && innerBlockImages !== void 0 && innerBlockImages.length)) {
  13943. return currentImageMedia;
  13944. }
  13945. const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined);
  13946. if (imageIds.length === 0) {
  13947. return currentImageMedia;
  13948. }
  13949. return select(external_wp_coreData_namespaceObject.store).getMediaItems({
  13950. include: imageIds.join(','),
  13951. per_page: -1
  13952. });
  13953. }, [innerBlockImages]);
  13954. if ((imageMedia === null || imageMedia === void 0 ? void 0 : imageMedia.length) !== (currentImageMedia === null || currentImageMedia === void 0 ? void 0 : currentImageMedia.length) || imageMedia !== null && imageMedia !== void 0 && imageMedia.some(newImage => !currentImageMedia.find(currentImage => currentImage.id === newImage.id))) {
  13955. setCurrentImageMedia(imageMedia);
  13956. return imageMedia;
  13957. }
  13958. return currentImageMedia;
  13959. }
  13960. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js
  13961. /**
  13962. * WordPress dependencies
  13963. */
  13964. function GapStyles(_ref) {
  13965. let {
  13966. blockGap,
  13967. clientId
  13968. } = _ref;
  13969. const styleElement = (0,external_wp_element_namespaceObject.useContext)(external_wp_blockEditor_namespaceObject.BlockList.__unstableElementContext); // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
  13970. // gap on the gallery.
  13971. const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
  13972. let gapValue = fallbackValue;
  13973. let column = fallbackValue;
  13974. let row; // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736
  13975. if (!!blockGap) {
  13976. row = typeof blockGap === 'string' ? blockGap : (blockGap === null || blockGap === void 0 ? void 0 : blockGap.top) || fallbackValue;
  13977. column = typeof blockGap === 'string' ? blockGap : (blockGap === null || blockGap === void 0 ? void 0 : blockGap.left) || fallbackValue;
  13978. gapValue = row === column ? row : `${row} ${column}`;
  13979. }
  13980. const gap = `#block-${clientId} {
  13981. --wp--style--unstable-gallery-gap: ${column};
  13982. gap: ${gapValue}
  13983. }`;
  13984. const GapStyle = () => {
  13985. return (0,external_wp_element_namespaceObject.createElement)("style", null, gap);
  13986. };
  13987. return gap && styleElement ? (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(GapStyle, null), styleElement) : null;
  13988. }
  13989. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit.js
  13990. /**
  13991. * External dependencies
  13992. */
  13993. /**
  13994. * WordPress dependencies
  13995. */
  13996. /**
  13997. * Internal dependencies
  13998. */
  13999. const MAX_COLUMNS = 8;
  14000. const linkOptions = [{
  14001. value: LINK_DESTINATION_ATTACHMENT,
  14002. label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
  14003. }, {
  14004. value: LINK_DESTINATION_MEDIA,
  14005. label: (0,external_wp_i18n_namespaceObject.__)('Media File')
  14006. }, {
  14007. value: LINK_DESTINATION_NONE,
  14008. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option')
  14009. }];
  14010. const edit_ALLOWED_MEDIA_TYPES = ['image'];
  14011. const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA') : (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.');
  14012. const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? {
  14013. type: 'stepper'
  14014. } : {};
  14015. function GalleryEdit(props) {
  14016. var _attributes$style, _attributes$style$spa;
  14017. const {
  14018. setAttributes,
  14019. attributes,
  14020. className,
  14021. clientId,
  14022. noticeOperations,
  14023. isSelected,
  14024. noticeUI,
  14025. insertBlocksAfter
  14026. } = props;
  14027. const {
  14028. columns,
  14029. imageCrop,
  14030. linkTarget,
  14031. linkTo,
  14032. shortCodeTransforms,
  14033. sizeSlug
  14034. } = attributes;
  14035. const {
  14036. __unstableMarkNextChangeAsNotPersistent,
  14037. replaceInnerBlocks,
  14038. updateBlockAttributes,
  14039. selectBlock,
  14040. clearSelectedBlock
  14041. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  14042. const {
  14043. createSuccessNotice
  14044. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  14045. const {
  14046. getBlock,
  14047. getSettings,
  14048. preferredStyle
  14049. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14050. var _preferredStyleVariat;
  14051. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  14052. const preferredStyleVariations = settings.__experimentalPreferredStyleVariations;
  14053. return {
  14054. getBlock: select(external_wp_blockEditor_namespaceObject.store).getBlock,
  14055. getSettings: select(external_wp_blockEditor_namespaceObject.store).getSettings,
  14056. preferredStyle: preferredStyleVariations === null || preferredStyleVariations === void 0 ? void 0 : (_preferredStyleVariat = preferredStyleVariations.value) === null || _preferredStyleVariat === void 0 ? void 0 : _preferredStyleVariat['core/image']
  14057. };
  14058. }, []);
  14059. const innerBlockImages = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14060. var _select$getBlock;
  14061. return (_select$getBlock = select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId)) === null || _select$getBlock === void 0 ? void 0 : _select$getBlock.innerBlocks;
  14062. }, [clientId]);
  14063. const wasBlockJustInserted = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14064. return select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu');
  14065. }, [clientId]);
  14066. const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages === null || innerBlockImages === void 0 ? void 0 : innerBlockImages.map(block => ({
  14067. clientId: block.clientId,
  14068. id: block.attributes.id,
  14069. url: block.attributes.url,
  14070. attributes: block.attributes,
  14071. fromSavedContent: Boolean(block.originalContent)
  14072. })), [innerBlockImages]);
  14073. const imageData = useGetMedia(innerBlockImages);
  14074. const newImages = useGetNewImages(images, imageData);
  14075. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14076. newImages === null || newImages === void 0 ? void 0 : newImages.forEach(newImage => {
  14077. updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(newImage.attributes),
  14078. id: newImage.id,
  14079. align: undefined
  14080. });
  14081. });
  14082. if ((newImages === null || newImages === void 0 ? void 0 : newImages.length) > 0) {
  14083. clearSelectedBlock();
  14084. }
  14085. }, [newImages]);
  14086. const shortCodeImages = useShortCodeTransform(shortCodeTransforms);
  14087. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14088. if (!shortCodeTransforms || !shortCodeImages) {
  14089. return;
  14090. }
  14091. updateImages(shortCodeImages);
  14092. setAttributes({
  14093. shortCodeTransforms: undefined
  14094. });
  14095. }, [shortCodeTransforms, shortCodeImages]);
  14096. const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings);
  14097. /**
  14098. * Determines the image attributes that should be applied to an image block
  14099. * after the gallery updates.
  14100. *
  14101. * The gallery will receive the full collection of images when a new image
  14102. * is added. As a result we need to reapply the image's original settings if
  14103. * it already existed in the gallery. If the image is in fact new, we need
  14104. * to apply the gallery's current settings to the image.
  14105. *
  14106. * @param {Object} imageAttributes Media object for the actual image.
  14107. * @return {Object} Attributes to set on the new image block.
  14108. */
  14109. function buildImageAttributes(imageAttributes) {
  14110. const image = imageAttributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  14111. id: imageAttributes.id
  14112. }) : null;
  14113. let newClassName;
  14114. if (imageAttributes.className && imageAttributes.className !== '') {
  14115. newClassName = imageAttributes.className;
  14116. } else {
  14117. newClassName = preferredStyle ? `is-style-${preferredStyle}` : undefined;
  14118. }
  14119. return { ...pickRelevantMediaFiles(imageAttributes, sizeSlug),
  14120. ...utils_getHrefAndDestination(image, linkTo),
  14121. ...getUpdatedLinkTargetSettings(linkTarget, attributes),
  14122. className: newClassName,
  14123. sizeSlug
  14124. };
  14125. }
  14126. function isValidFileType(file) {
  14127. var _file$url;
  14128. return edit_ALLOWED_MEDIA_TYPES.some(mediaType => {
  14129. var _file$type;
  14130. return ((_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf(mediaType)) === 0;
  14131. }) || ((_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.indexOf('blob:')) === 0;
  14132. }
  14133. function updateImages(selectedImages) {
  14134. const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]';
  14135. const imageArray = newFileUploads ? Array.from(selectedImages).map(file => {
  14136. if (!file.url) {
  14137. return pickRelevantMediaFiles({
  14138. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  14139. });
  14140. }
  14141. return file;
  14142. }) : selectedImages;
  14143. if (!imageArray.every(isValidFileType)) {
  14144. noticeOperations.removeAllNotices();
  14145. noticeOperations.createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
  14146. id: 'gallery-upload-invalid-file'
  14147. });
  14148. }
  14149. const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => {
  14150. if (!file.url) {
  14151. return pickRelevantMediaFiles({
  14152. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  14153. });
  14154. }
  14155. return file;
  14156. }); // Because we are reusing existing innerImage blocks any reordering
  14157. // done in the media library will be lost so we need to reapply that ordering
  14158. // once the new image blocks are merged in with existing.
  14159. const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {});
  14160. const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages;
  14161. const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id));
  14162. const newBlocks = newImageList.map(image => {
  14163. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  14164. id: image.id,
  14165. url: image.url,
  14166. caption: image.caption,
  14167. alt: image.alt
  14168. });
  14169. });
  14170. if ((newBlocks === null || newBlocks === void 0 ? void 0 : newBlocks.length) > 0) {
  14171. selectBlock(newBlocks[0].clientId);
  14172. }
  14173. replaceInnerBlocks(clientId, (0,external_lodash_namespaceObject.concat)(existingImageBlocks, newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id]));
  14174. }
  14175. function onUploadError(message) {
  14176. noticeOperations.removeAllNotices();
  14177. noticeOperations.createErrorNotice(message);
  14178. }
  14179. function setLinkTo(value) {
  14180. setAttributes({
  14181. linkTo: value
  14182. });
  14183. const changedAttributes = {};
  14184. const blocks = [];
  14185. getBlock(clientId).innerBlocks.forEach(block => {
  14186. blocks.push(block.clientId);
  14187. const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  14188. id: block.attributes.id
  14189. }) : null;
  14190. changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value);
  14191. });
  14192. updateBlockAttributes(blocks, changedAttributes, true);
  14193. const linkToText = [...linkOptions].find(linkType => linkType.value === value);
  14194. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  14195. /* translators: %s: image size settings */
  14196. (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.label), {
  14197. id: 'gallery-attributes-linkTo',
  14198. type: 'snackbar'
  14199. });
  14200. }
  14201. function setColumnsNumber(value) {
  14202. setAttributes({
  14203. columns: value
  14204. });
  14205. }
  14206. function toggleImageCrop() {
  14207. setAttributes({
  14208. imageCrop: !imageCrop
  14209. });
  14210. }
  14211. function getImageCropHelp(checked) {
  14212. return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
  14213. }
  14214. function toggleOpenInNewTab(openInNewTab) {
  14215. const newLinkTarget = openInNewTab ? '_blank' : undefined;
  14216. setAttributes({
  14217. linkTarget: newLinkTarget
  14218. });
  14219. const changedAttributes = {};
  14220. const blocks = [];
  14221. getBlock(clientId).innerBlocks.forEach(block => {
  14222. blocks.push(block.clientId);
  14223. changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes);
  14224. });
  14225. updateBlockAttributes(blocks, changedAttributes, true);
  14226. const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab');
  14227. createSuccessNotice(noticeText, {
  14228. id: 'gallery-attributes-openInNewTab',
  14229. type: 'snackbar'
  14230. });
  14231. }
  14232. function updateImagesSize(newSizeSlug) {
  14233. setAttributes({
  14234. sizeSlug: newSizeSlug
  14235. });
  14236. const changedAttributes = {};
  14237. const blocks = [];
  14238. getBlock(clientId).innerBlocks.forEach(block => {
  14239. blocks.push(block.clientId);
  14240. const image = block.attributes.id ? (0,external_lodash_namespaceObject.find)(imageData, {
  14241. id: block.attributes.id
  14242. }) : null;
  14243. changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug);
  14244. });
  14245. updateBlockAttributes(blocks, changedAttributes, true);
  14246. const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug);
  14247. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  14248. /* translators: %s: image size settings */
  14249. (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), {
  14250. id: 'gallery-attributes-sizeSlug',
  14251. type: 'snackbar'
  14252. });
  14253. }
  14254. (0,external_wp_element_namespaceObject.useEffect)(() => {
  14255. // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.
  14256. if (!linkTo) {
  14257. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  14258. __unstableMarkNextChangeAsNotPersistent();
  14259. setAttributes({
  14260. linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || LINK_DESTINATION_NONE
  14261. });
  14262. }
  14263. }, [linkTo]);
  14264. const hasImages = !!images.length;
  14265. const hasImageIds = hasImages && images.some(image => !!image.id);
  14266. const imagesUploading = images.some(img => {
  14267. var _img$url;
  14268. return !img.id && ((_img$url = img.url) === null || _img$url === void 0 ? void 0 : _img$url.indexOf('blob:')) === 0;
  14269. }); // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set.
  14270. const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({
  14271. web: {
  14272. addToGallery: false,
  14273. disableMediaButtons: imagesUploading,
  14274. value: {}
  14275. },
  14276. native: {
  14277. addToGallery: hasImageIds,
  14278. isAppender: hasImages,
  14279. disableMediaButtons: hasImages && !isSelected || imagesUploading,
  14280. value: hasImageIds ? images : {},
  14281. autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  14282. }
  14283. });
  14284. const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, _extends({
  14285. handleUpload: false,
  14286. icon: sharedIcon,
  14287. labels: {
  14288. title: (0,external_wp_i18n_namespaceObject.__)('Gallery'),
  14289. instructions: PLACEHOLDER_TEXT
  14290. },
  14291. onSelect: updateImages,
  14292. accept: "image/*",
  14293. allowedTypes: edit_ALLOWED_MEDIA_TYPES,
  14294. multiple: true,
  14295. onError: onUploadError,
  14296. notices: noticeUI
  14297. }, mediaPlaceholderProps));
  14298. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  14299. className: classnames_default()(className, 'has-nested-images')
  14300. });
  14301. if (!hasImages) {
  14302. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
  14303. }
  14304. const hasLinkTo = linkTo && linkTo !== 'none';
  14305. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  14306. title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings')
  14307. }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
  14308. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  14309. value: columns ? columns : defaultColumnsNumber(images.length),
  14310. onChange: setColumnsNumber,
  14311. min: 1,
  14312. max: Math.min(MAX_COLUMNS, images.length)
  14313. }, MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
  14314. required: true
  14315. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14316. label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
  14317. checked: !!imageCrop,
  14318. onChange: toggleImageCrop,
  14319. help: getImageCropHelp
  14320. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  14321. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  14322. value: linkTo,
  14323. onChange: setLinkTo,
  14324. options: linkOptions,
  14325. hideCancelButton: true
  14326. }), hasLinkTo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  14327. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  14328. checked: linkTarget === '_blank',
  14329. onChange: toggleOpenInNewTab
  14330. }), (imageSizeOptions === null || imageSizeOptions === void 0 ? void 0 : imageSizeOptions.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  14331. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  14332. value: sizeSlug,
  14333. options: imageSizeOptions,
  14334. onChange: updateImagesSize,
  14335. hideCancelButton: true
  14336. }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  14337. className: 'gallery-image-sizes'
  14338. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image size')), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, {
  14339. className: 'gallery-image-sizes__loading'
  14340. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_i18n_namespaceObject.__)('Loading options…'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  14341. group: "other"
  14342. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  14343. allowedTypes: edit_ALLOWED_MEDIA_TYPES,
  14344. accept: "image/*",
  14345. handleUpload: false,
  14346. onSelect: updateImages,
  14347. name: (0,external_wp_i18n_namespaceObject.__)('Add'),
  14348. multiple: true,
  14349. mediaIds: images.map(image => image.id),
  14350. addToGallery: hasImageIds
  14351. })), noticeUI, external_wp_element_namespaceObject.Platform.isWeb && (0,external_wp_element_namespaceObject.createElement)(GapStyles, {
  14352. blockGap: (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.blockGap,
  14353. clientId: clientId
  14354. }), (0,external_wp_element_namespaceObject.createElement)(gallery_gallery, _extends({}, props, {
  14355. images: images,
  14356. mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined,
  14357. blockProps: blockProps,
  14358. insertBlocksAfter: insertBlocksAfter
  14359. })));
  14360. }
  14361. /* harmony default export */ var gallery_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
  14362. isNarrow: '< small'
  14363. })])(GalleryEdit));
  14364. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/shared.js
  14365. /**
  14366. * External dependencies
  14367. */
  14368. const shared_pickRelevantMediaFiles = function (image) {
  14369. let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
  14370. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  14371. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', sizeSlug, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
  14372. const fullUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', 'full', 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
  14373. if (fullUrl) {
  14374. imageProps.fullUrl = fullUrl;
  14375. }
  14376. return imageProps;
  14377. };
  14378. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/image.js
  14379. /**
  14380. * WordPress dependencies
  14381. */
  14382. const image_image = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14383. viewBox: "0 0 24 24",
  14384. xmlns: "http://www.w3.org/2000/svg"
  14385. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14386. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"
  14387. }));
  14388. /* harmony default export */ var library_image = (image_image);
  14389. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
  14390. /**
  14391. * WordPress dependencies
  14392. */
  14393. const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14394. xmlns: "http://www.w3.org/2000/svg",
  14395. viewBox: "0 0 24 24"
  14396. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14397. d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
  14398. }));
  14399. /* harmony default export */ var chevron_left = (chevronLeft);
  14400. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
  14401. /**
  14402. * WordPress dependencies
  14403. */
  14404. const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14405. xmlns: "http://www.w3.org/2000/svg",
  14406. viewBox: "0 0 24 24"
  14407. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14408. d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
  14409. }));
  14410. /* harmony default export */ var chevron_right = (chevronRight);
  14411. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
  14412. /**
  14413. * WordPress dependencies
  14414. */
  14415. const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  14416. xmlns: "http://www.w3.org/2000/svg",
  14417. viewBox: "0 0 24 24"
  14418. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  14419. d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
  14420. }));
  14421. /* harmony default export */ var close_small = (closeSmall);
  14422. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/constants.js
  14423. const v1_constants_LINK_DESTINATION_NONE = 'none';
  14424. const v1_constants_LINK_DESTINATION_MEDIA = 'file';
  14425. const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post';
  14426. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery-image.js
  14427. /**
  14428. * External dependencies
  14429. */
  14430. /**
  14431. * WordPress dependencies
  14432. */
  14433. /**
  14434. * Internal dependencies
  14435. */
  14436. const isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  14437. class GalleryImage extends external_wp_element_namespaceObject.Component {
  14438. constructor() {
  14439. super(...arguments);
  14440. this.onSelectImage = this.onSelectImage.bind(this);
  14441. this.onRemoveImage = this.onRemoveImage.bind(this);
  14442. this.bindContainer = this.bindContainer.bind(this);
  14443. this.onEdit = this.onEdit.bind(this);
  14444. this.onSelectImageFromLibrary = this.onSelectImageFromLibrary.bind(this);
  14445. this.onSelectCustomURL = this.onSelectCustomURL.bind(this);
  14446. this.state = {
  14447. isEditing: false
  14448. };
  14449. }
  14450. bindContainer(ref) {
  14451. this.container = ref;
  14452. }
  14453. onSelectImage() {
  14454. if (!this.props.isSelected) {
  14455. this.props.onSelect();
  14456. }
  14457. }
  14458. onRemoveImage(event) {
  14459. if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) {
  14460. event.preventDefault();
  14461. this.props.onRemove();
  14462. }
  14463. }
  14464. onEdit() {
  14465. this.setState({
  14466. isEditing: true
  14467. });
  14468. }
  14469. componentDidUpdate() {
  14470. const {
  14471. image,
  14472. url,
  14473. __unstableMarkNextChangeAsNotPersistent
  14474. } = this.props;
  14475. if (image && !url) {
  14476. __unstableMarkNextChangeAsNotPersistent();
  14477. this.props.setAttributes({
  14478. url: image.source_url,
  14479. alt: image.alt_text
  14480. });
  14481. }
  14482. }
  14483. deselectOnBlur() {
  14484. this.props.onDeselect();
  14485. }
  14486. onSelectImageFromLibrary(media) {
  14487. const {
  14488. setAttributes,
  14489. id,
  14490. url,
  14491. alt,
  14492. caption,
  14493. sizeSlug
  14494. } = this.props;
  14495. if (!media || !media.url) {
  14496. return;
  14497. }
  14498. let mediaAttributes = shared_pickRelevantMediaFiles(media, sizeSlug); // If the current image is temporary but an alt text was meanwhile
  14499. // written by the user, make sure the text is not overwritten.
  14500. if (isTemporaryImage(id, url)) {
  14501. if (alt) {
  14502. mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['alt']);
  14503. }
  14504. } // If a caption text was meanwhile written by the user,
  14505. // make sure the text is not overwritten by empty captions.
  14506. if (caption && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
  14507. mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
  14508. }
  14509. setAttributes(mediaAttributes);
  14510. this.setState({
  14511. isEditing: false
  14512. });
  14513. }
  14514. onSelectCustomURL(newURL) {
  14515. const {
  14516. setAttributes,
  14517. url
  14518. } = this.props;
  14519. if (newURL !== url) {
  14520. setAttributes({
  14521. url: newURL,
  14522. id: undefined
  14523. });
  14524. this.setState({
  14525. isEditing: false
  14526. });
  14527. }
  14528. }
  14529. render() {
  14530. const {
  14531. url,
  14532. alt,
  14533. id,
  14534. linkTo,
  14535. link,
  14536. isFirstItem,
  14537. isLastItem,
  14538. isSelected,
  14539. caption,
  14540. onRemove,
  14541. onMoveForward,
  14542. onMoveBackward,
  14543. setAttributes,
  14544. 'aria-label': ariaLabel
  14545. } = this.props;
  14546. const {
  14547. isEditing
  14548. } = this.state;
  14549. let href;
  14550. switch (linkTo) {
  14551. case v1_constants_LINK_DESTINATION_MEDIA:
  14552. href = url;
  14553. break;
  14554. case v1_constants_LINK_DESTINATION_ATTACHMENT:
  14555. href = link;
  14556. break;
  14557. }
  14558. const img = // Disable reason: Image itself is not meant to be interactive, but should
  14559. // direct image selection and unfocus caption fields.
  14560. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
  14561. (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
  14562. src: url,
  14563. alt: alt,
  14564. "data-id": id,
  14565. onKeyDown: this.onRemoveImage,
  14566. tabIndex: "0",
  14567. "aria-label": ariaLabel,
  14568. ref: this.bindContainer
  14569. }), (0,external_wp_blob_namespaceObject.isBlobURL)(url) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
  14570. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
  14571. ;
  14572. const className = classnames_default()({
  14573. 'is-selected': isSelected,
  14574. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(url)
  14575. });
  14576. return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
  14577. (0,external_wp_element_namespaceObject.createElement)("figure", {
  14578. className: className,
  14579. onClick: this.onSelectImage,
  14580. onFocus: this.onSelectImage
  14581. }, !isEditing && (href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  14582. href: href
  14583. }, img) : img), isEditing && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  14584. labels: {
  14585. title: (0,external_wp_i18n_namespaceObject.__)('Edit gallery image')
  14586. },
  14587. icon: library_image,
  14588. onSelect: this.onSelectImageFromLibrary,
  14589. onSelectURL: this.onSelectCustomURL,
  14590. accept: "image/*",
  14591. allowedTypes: ['image'],
  14592. value: {
  14593. id,
  14594. src: url
  14595. }
  14596. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  14597. className: "block-library-gallery-item__inline-menu is-left"
  14598. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14599. icon: chevron_left,
  14600. onClick: isFirstItem ? undefined : onMoveBackward,
  14601. label: (0,external_wp_i18n_namespaceObject.__)('Move image backward'),
  14602. "aria-disabled": isFirstItem,
  14603. disabled: !isSelected
  14604. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14605. icon: chevron_right,
  14606. onClick: isLastItem ? undefined : onMoveForward,
  14607. label: (0,external_wp_i18n_namespaceObject.__)('Move image forward'),
  14608. "aria-disabled": isLastItem,
  14609. disabled: !isSelected
  14610. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  14611. className: "block-library-gallery-item__inline-menu is-right"
  14612. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14613. icon: library_edit,
  14614. onClick: this.onEdit,
  14615. label: (0,external_wp_i18n_namespaceObject.__)('Replace image'),
  14616. disabled: !isSelected
  14617. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  14618. icon: close_small,
  14619. onClick: onRemove,
  14620. label: (0,external_wp_i18n_namespaceObject.__)('Remove image'),
  14621. disabled: !isSelected
  14622. })), !isEditing && (isSelected || caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  14623. tagName: "figcaption",
  14624. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
  14625. placeholder: isSelected ? (0,external_wp_i18n_namespaceObject.__)('Add caption') : null,
  14626. value: caption,
  14627. onChange: newCaption => setAttributes({
  14628. caption: newCaption
  14629. }),
  14630. inlineToolbar: true
  14631. }))
  14632. );
  14633. }
  14634. }
  14635. /* harmony default export */ var gallery_image = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, ownProps) => {
  14636. const {
  14637. getMedia
  14638. } = select(external_wp_coreData_namespaceObject.store);
  14639. const {
  14640. id
  14641. } = ownProps;
  14642. return {
  14643. image: id ? getMedia(parseInt(id, 10)) : null
  14644. };
  14645. }), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
  14646. const {
  14647. __unstableMarkNextChangeAsNotPersistent
  14648. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  14649. return {
  14650. __unstableMarkNextChangeAsNotPersistent
  14651. };
  14652. })])(GalleryImage));
  14653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/gallery.js
  14654. /**
  14655. * External dependencies
  14656. */
  14657. /**
  14658. * WordPress dependencies
  14659. */
  14660. /**
  14661. * Internal dependencies
  14662. */
  14663. const gallery_Gallery = props => {
  14664. const {
  14665. attributes,
  14666. isSelected,
  14667. setAttributes,
  14668. selectedImage,
  14669. mediaPlaceholder,
  14670. onMoveBackward,
  14671. onMoveForward,
  14672. onRemoveImage,
  14673. onSelectImage,
  14674. onDeselectImage,
  14675. onSetImageAttributes,
  14676. insertBlocksAfter,
  14677. blockProps
  14678. } = props;
  14679. const {
  14680. align,
  14681. columns = defaultColumnsNumberV1(attributes),
  14682. caption,
  14683. imageCrop,
  14684. images
  14685. } = attributes;
  14686. return (0,external_wp_element_namespaceObject.createElement)("figure", _extends({}, blockProps, {
  14687. className: classnames_default()(blockProps.className, {
  14688. [`align${align}`]: align,
  14689. [`columns-${columns}`]: columns,
  14690. 'is-cropped': imageCrop
  14691. })
  14692. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  14693. className: "blocks-gallery-grid"
  14694. }, images.map((img, index) => {
  14695. const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(
  14696. /* translators: 1: the order number of the image. 2: the total number of images. */
  14697. (0,external_wp_i18n_namespaceObject.__)('image %1$d of %2$d in gallery'), index + 1, images.length);
  14698. return (0,external_wp_element_namespaceObject.createElement)("li", {
  14699. className: "blocks-gallery-item",
  14700. key: img.id ? `${img.id}-${index}` : img.url
  14701. }, (0,external_wp_element_namespaceObject.createElement)(gallery_image, {
  14702. url: img.url,
  14703. alt: img.alt,
  14704. id: img.id,
  14705. isFirstItem: index === 0,
  14706. isLastItem: index + 1 === images.length,
  14707. isSelected: isSelected && selectedImage === index,
  14708. onMoveBackward: onMoveBackward(index),
  14709. onMoveForward: onMoveForward(index),
  14710. onRemove: onRemoveImage(index),
  14711. onSelect: onSelectImage(index),
  14712. onDeselect: onDeselectImage(index),
  14713. setAttributes: attrs => onSetImageAttributes(index, attrs),
  14714. caption: img.caption,
  14715. "aria-label": ariaLabel,
  14716. sizeSlug: attributes.sizeSlug
  14717. }));
  14718. })), mediaPlaceholder, (0,external_wp_element_namespaceObject.createElement)(gallery_RichTextVisibilityHelper, {
  14719. isHidden: !isSelected && external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption),
  14720. tagName: "figcaption",
  14721. className: "blocks-gallery-caption",
  14722. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'),
  14723. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write gallery caption…'),
  14724. value: caption,
  14725. onChange: value => setAttributes({
  14726. caption: value
  14727. }),
  14728. inlineToolbar: true,
  14729. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  14730. }));
  14731. };
  14732. function gallery_RichTextVisibilityHelper(_ref) {
  14733. let {
  14734. isHidden,
  14735. ...richTextProps
  14736. } = _ref;
  14737. return isHidden ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, _extends({
  14738. as: external_wp_blockEditor_namespaceObject.RichText
  14739. }, richTextProps)) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, richTextProps);
  14740. }
  14741. /* harmony default export */ var v1_gallery = (gallery_Gallery);
  14742. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/edit.js
  14743. /**
  14744. * External dependencies
  14745. */
  14746. /**
  14747. * WordPress dependencies
  14748. */
  14749. /**
  14750. * Internal dependencies
  14751. */
  14752. const edit_MAX_COLUMNS = 8;
  14753. const edit_linkOptions = [{
  14754. value: v1_constants_LINK_DESTINATION_ATTACHMENT,
  14755. label: (0,external_wp_i18n_namespaceObject.__)('Attachment Page')
  14756. }, {
  14757. value: v1_constants_LINK_DESTINATION_MEDIA,
  14758. label: (0,external_wp_i18n_namespaceObject.__)('Media File')
  14759. }, {
  14760. value: v1_constants_LINK_DESTINATION_NONE,
  14761. label: (0,external_wp_i18n_namespaceObject.__)('None')
  14762. }];
  14763. const v1_edit_ALLOWED_MEDIA_TYPES = ['image'];
  14764. const edit_PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.select({
  14765. web: (0,external_wp_i18n_namespaceObject.__)('Drag images, upload new ones or select files from your library.'),
  14766. native: (0,external_wp_i18n_namespaceObject.__)('ADD MEDIA')
  14767. });
  14768. const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.select({
  14769. web: {},
  14770. native: {
  14771. type: 'stepper'
  14772. }
  14773. });
  14774. function edit_GalleryEdit(props) {
  14775. const {
  14776. attributes,
  14777. clientId,
  14778. isSelected,
  14779. noticeUI,
  14780. noticeOperations,
  14781. onFocus
  14782. } = props;
  14783. const {
  14784. columns = defaultColumnsNumberV1(attributes),
  14785. imageCrop,
  14786. images,
  14787. linkTo,
  14788. sizeSlug
  14789. } = attributes;
  14790. const [selectedImage, setSelectedImage] = (0,external_wp_element_namespaceObject.useState)();
  14791. const [attachmentCaptions, setAttachmentCaptions] = (0,external_wp_element_namespaceObject.useState)();
  14792. const {
  14793. __unstableMarkNextChangeAsNotPersistent
  14794. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  14795. const {
  14796. imageSizes,
  14797. mediaUpload,
  14798. getMedia,
  14799. wasBlockJustInserted
  14800. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  14801. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  14802. return {
  14803. imageSizes: settings.imageSizes,
  14804. mediaUpload: settings.mediaUpload,
  14805. getMedia: select(external_wp_coreData_namespaceObject.store).getMedia,
  14806. wasBlockJustInserted: select(external_wp_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu')
  14807. };
  14808. });
  14809. const resizedImages = (0,external_wp_element_namespaceObject.useMemo)(() => {
  14810. if (isSelected) {
  14811. return (0,external_lodash_namespaceObject.reduce)(attributes.ids, (currentResizedImages, id) => {
  14812. if (!id) {
  14813. return currentResizedImages;
  14814. }
  14815. const image = getMedia(id);
  14816. const sizes = (0,external_lodash_namespaceObject.reduce)(imageSizes, (currentSizes, size) => {
  14817. const defaultUrl = (0,external_lodash_namespaceObject.get)(image, ['sizes', size.slug, 'url']);
  14818. const mediaDetailsUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size.slug, 'source_url']);
  14819. return { ...currentSizes,
  14820. [size.slug]: defaultUrl || mediaDetailsUrl
  14821. };
  14822. }, {});
  14823. return { ...currentResizedImages,
  14824. [parseInt(id, 10)]: sizes
  14825. };
  14826. }, {});
  14827. }
  14828. return {};
  14829. }, [isSelected, attributes.ids, imageSizes]);
  14830. function onFocusGalleryCaption() {
  14831. setSelectedImage();
  14832. }
  14833. function setAttributes(newAttrs) {
  14834. if (newAttrs.ids) {
  14835. throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');
  14836. }
  14837. if (newAttrs.images) {
  14838. newAttrs = { ...newAttrs,
  14839. // Unlike images[ n ].id which is a string, always ensure the
  14840. // ids array contains numbers as per its attribute type.
  14841. ids: (0,external_lodash_namespaceObject.map)(newAttrs.images, _ref => {
  14842. let {
  14843. id
  14844. } = _ref;
  14845. return parseInt(id, 10);
  14846. })
  14847. };
  14848. }
  14849. props.setAttributes(newAttrs);
  14850. }
  14851. function onSelectImage(index) {
  14852. return () => {
  14853. setSelectedImage(index);
  14854. };
  14855. }
  14856. function onDeselectImage() {
  14857. return () => {
  14858. setSelectedImage();
  14859. };
  14860. }
  14861. function onMove(oldIndex, newIndex) {
  14862. const newImages = [...images];
  14863. newImages.splice(newIndex, 1, images[oldIndex]);
  14864. newImages.splice(oldIndex, 1, images[newIndex]);
  14865. setSelectedImage(newIndex);
  14866. setAttributes({
  14867. images: newImages
  14868. });
  14869. }
  14870. function onMoveForward(oldIndex) {
  14871. return () => {
  14872. if (oldIndex === images.length - 1) {
  14873. return;
  14874. }
  14875. onMove(oldIndex, oldIndex + 1);
  14876. };
  14877. }
  14878. function onMoveBackward(oldIndex) {
  14879. return () => {
  14880. if (oldIndex === 0) {
  14881. return;
  14882. }
  14883. onMove(oldIndex, oldIndex - 1);
  14884. };
  14885. }
  14886. function onRemoveImage(index) {
  14887. return () => {
  14888. const newImages = (0,external_lodash_namespaceObject.filter)(images, (img, i) => index !== i);
  14889. setSelectedImage();
  14890. setAttributes({
  14891. images: newImages,
  14892. columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
  14893. });
  14894. };
  14895. }
  14896. function selectCaption(newImage) {
  14897. // The image id in both the images and attachmentCaptions arrays is a
  14898. // string, so ensure comparison works correctly by converting the
  14899. // newImage.id to a string.
  14900. const newImageId = (0,external_lodash_namespaceObject.toString)(newImage.id);
  14901. const currentImage = (0,external_lodash_namespaceObject.find)(images, {
  14902. id: newImageId
  14903. });
  14904. const currentImageCaption = currentImage ? currentImage.caption : newImage.caption;
  14905. if (!attachmentCaptions) {
  14906. return currentImageCaption;
  14907. }
  14908. const attachment = (0,external_lodash_namespaceObject.find)(attachmentCaptions, {
  14909. id: newImageId
  14910. }); // If the attachment caption is updated.
  14911. if (attachment && attachment.caption !== newImage.caption) {
  14912. return newImage.caption;
  14913. }
  14914. return currentImageCaption;
  14915. }
  14916. function onSelectImages(newImages) {
  14917. setAttachmentCaptions(newImages.map(newImage => ({
  14918. // Store the attachmentCaption id as a string for consistency
  14919. // with the type of the id in the images attribute.
  14920. id: (0,external_lodash_namespaceObject.toString)(newImage.id),
  14921. caption: newImage.caption
  14922. })));
  14923. setAttributes({
  14924. images: newImages.map(newImage => ({ ...shared_pickRelevantMediaFiles(newImage, sizeSlug),
  14925. caption: selectCaption(newImage, images, attachmentCaptions),
  14926. // The id value is stored in a data attribute, so when the
  14927. // block is parsed it's converted to a string. Converting
  14928. // to a string here ensures it's type is consistent.
  14929. id: (0,external_lodash_namespaceObject.toString)(newImage.id)
  14930. })),
  14931. columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
  14932. });
  14933. }
  14934. function onUploadError(message) {
  14935. noticeOperations.removeAllNotices();
  14936. noticeOperations.createErrorNotice(message);
  14937. }
  14938. function setLinkTo(value) {
  14939. setAttributes({
  14940. linkTo: value
  14941. });
  14942. }
  14943. function setColumnsNumber(value) {
  14944. setAttributes({
  14945. columns: value
  14946. });
  14947. }
  14948. function toggleImageCrop() {
  14949. setAttributes({
  14950. imageCrop: !imageCrop
  14951. });
  14952. }
  14953. function getImageCropHelp(checked) {
  14954. return checked ? (0,external_wp_i18n_namespaceObject.__)('Thumbnails are cropped to align.') : (0,external_wp_i18n_namespaceObject.__)('Thumbnails are not cropped.');
  14955. }
  14956. function setImageAttributes(index, newAttributes) {
  14957. if (!images[index]) {
  14958. return;
  14959. }
  14960. setAttributes({
  14961. images: [...images.slice(0, index), { ...images[index],
  14962. ...newAttributes
  14963. }, ...images.slice(index + 1)]
  14964. });
  14965. }
  14966. function getImagesSizeOptions() {
  14967. return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
  14968. let {
  14969. slug
  14970. } = _ref2;
  14971. return (0,external_lodash_namespaceObject.some)(resizedImages, sizes => sizes[slug]);
  14972. }), _ref3 => {
  14973. let {
  14974. name,
  14975. slug
  14976. } = _ref3;
  14977. return {
  14978. value: slug,
  14979. label: name
  14980. };
  14981. });
  14982. }
  14983. function updateImagesSize(newSizeSlug) {
  14984. const updatedImages = (0,external_lodash_namespaceObject.map)(images, image => {
  14985. if (!image.id) {
  14986. return image;
  14987. }
  14988. const url = (0,external_lodash_namespaceObject.get)(resizedImages, [parseInt(image.id, 10), newSizeSlug]);
  14989. return { ...image,
  14990. ...(url && {
  14991. url
  14992. })
  14993. };
  14994. });
  14995. setAttributes({
  14996. images: updatedImages,
  14997. sizeSlug: newSizeSlug
  14998. });
  14999. }
  15000. (0,external_wp_element_namespaceObject.useEffect)(() => {
  15001. if (external_wp_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && (0,external_lodash_namespaceObject.every)(images, _ref4 => {
  15002. let {
  15003. url
  15004. } = _ref4;
  15005. return (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  15006. })) {
  15007. const filesList = (0,external_lodash_namespaceObject.map)(images, _ref5 => {
  15008. let {
  15009. url
  15010. } = _ref5;
  15011. return (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
  15012. });
  15013. (0,external_lodash_namespaceObject.forEach)(images, _ref6 => {
  15014. let {
  15015. url
  15016. } = _ref6;
  15017. return (0,external_wp_blob_namespaceObject.revokeBlobURL)(url);
  15018. });
  15019. mediaUpload({
  15020. filesList,
  15021. onFileChange: onSelectImages,
  15022. allowedTypes: ['image']
  15023. });
  15024. }
  15025. }, []);
  15026. (0,external_wp_element_namespaceObject.useEffect)(() => {
  15027. // Deselect images when deselecting the block.
  15028. if (!isSelected) {
  15029. setSelectedImage();
  15030. }
  15031. }, [isSelected]);
  15032. (0,external_wp_element_namespaceObject.useEffect)(() => {
  15033. // linkTo attribute must be saved so blocks don't break when changing
  15034. // image_default_link_type in options.php.
  15035. if (!linkTo) {
  15036. var _window, _window$wp, _window$wp$media, _window$wp$media$view, _window$wp$media$view2, _window$wp$media$view3;
  15037. __unstableMarkNextChangeAsNotPersistent();
  15038. setAttributes({
  15039. linkTo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$wp = _window.wp) === null || _window$wp === void 0 ? void 0 : (_window$wp$media = _window$wp.media) === null || _window$wp$media === void 0 ? void 0 : (_window$wp$media$view = _window$wp$media.view) === null || _window$wp$media$view === void 0 ? void 0 : (_window$wp$media$view2 = _window$wp$media$view.settings) === null || _window$wp$media$view2 === void 0 ? void 0 : (_window$wp$media$view3 = _window$wp$media$view2.defaultProps) === null || _window$wp$media$view3 === void 0 ? void 0 : _window$wp$media$view3.link) || v1_constants_LINK_DESTINATION_NONE
  15040. });
  15041. }
  15042. }, [linkTo]);
  15043. const hasImages = !!images.length;
  15044. const hasImageIds = hasImages && images.some(image => !!image.id);
  15045. const mediaPlaceholder = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  15046. addToGallery: hasImageIds,
  15047. isAppender: hasImages,
  15048. disableMediaButtons: hasImages && !isSelected,
  15049. icon: !hasImages && sharedIcon,
  15050. labels: {
  15051. title: !hasImages && (0,external_wp_i18n_namespaceObject.__)('Gallery'),
  15052. instructions: !hasImages && edit_PLACEHOLDER_TEXT
  15053. },
  15054. onSelect: onSelectImages,
  15055. accept: "image/*",
  15056. allowedTypes: v1_edit_ALLOWED_MEDIA_TYPES,
  15057. multiple: true,
  15058. value: hasImageIds ? images : {},
  15059. onError: onUploadError,
  15060. notices: hasImages ? undefined : noticeUI,
  15061. onFocus: onFocus,
  15062. autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  15063. });
  15064. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  15065. if (!hasImages) {
  15066. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, blockProps, mediaPlaceholder);
  15067. }
  15068. const imageSizeOptions = getImagesSizeOptions();
  15069. const shouldShowSizeOptions = hasImages && !(0,external_lodash_namespaceObject.isEmpty)(imageSizeOptions);
  15070. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  15071. title: (0,external_wp_i18n_namespaceObject.__)('Gallery settings')
  15072. }, images.length > 1 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, _extends({
  15073. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  15074. value: columns,
  15075. onChange: setColumnsNumber,
  15076. min: 1,
  15077. max: Math.min(edit_MAX_COLUMNS, images.length)
  15078. }, edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL, {
  15079. required: true
  15080. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  15081. label: (0,external_wp_i18n_namespaceObject.__)('Crop images'),
  15082. checked: !!imageCrop,
  15083. onChange: toggleImageCrop,
  15084. help: getImageCropHelp
  15085. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  15086. label: (0,external_wp_i18n_namespaceObject.__)('Link to'),
  15087. value: linkTo,
  15088. onChange: setLinkTo,
  15089. options: edit_linkOptions,
  15090. hideCancelButton: true
  15091. }), shouldShowSizeOptions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  15092. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  15093. value: sizeSlug,
  15094. options: imageSizeOptions,
  15095. onChange: updateImagesSize,
  15096. hideCancelButton: true
  15097. }))), noticeUI, (0,external_wp_element_namespaceObject.createElement)(v1_gallery, _extends({}, props, {
  15098. selectedImage: selectedImage,
  15099. mediaPlaceholder: mediaPlaceholder,
  15100. onMoveBackward: onMoveBackward,
  15101. onMoveForward: onMoveForward,
  15102. onRemoveImage: onRemoveImage,
  15103. onSelectImage: onSelectImage,
  15104. onDeselectImage: onDeselectImage,
  15105. onSetImageAttributes: setImageAttributes,
  15106. blockProps: blockProps // This prop is used by gallery.native.js.
  15107. ,
  15108. onFocusGalleryCaption: onFocusGalleryCaption
  15109. })));
  15110. }
  15111. /* harmony default export */ var v1_edit = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices, (0,external_wp_viewport_namespaceObject.withViewportMatch)({
  15112. isNarrow: '< small'
  15113. })])(edit_GalleryEdit));
  15114. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/edit-wrapper.js
  15115. /**
  15116. * WordPress dependencies
  15117. */
  15118. /**
  15119. * Internal dependencies
  15120. */
  15121. /*
  15122. * Using a wrapper around the logic to load the edit for v1 of Gallery block
  15123. * or the refactored version with InnerBlocks. This is to prevent conditional
  15124. * use of hooks lint errors if adding this logic to the top of the edit component.
  15125. */
  15126. function GalleryEditWrapper(props) {
  15127. if (!isGalleryV2Enabled()) {
  15128. return (0,external_wp_element_namespaceObject.createElement)(v1_edit, props);
  15129. }
  15130. return (0,external_wp_element_namespaceObject.createElement)(gallery_edit, props);
  15131. }
  15132. /* harmony default export */ var edit_wrapper = ((0,external_wp_compose_namespaceObject.compose)([external_wp_components_namespaceObject.withNotices])(GalleryEditWrapper));
  15133. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/v1/save.js
  15134. /**
  15135. * WordPress dependencies
  15136. */
  15137. /**
  15138. * Internal dependencies
  15139. */
  15140. function saveV1(_ref) {
  15141. let {
  15142. attributes
  15143. } = _ref;
  15144. const {
  15145. images,
  15146. columns = defaultColumnsNumberV1(attributes),
  15147. imageCrop,
  15148. caption,
  15149. linkTo
  15150. } = attributes;
  15151. const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  15152. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  15153. className
  15154. }), (0,external_wp_element_namespaceObject.createElement)("ul", {
  15155. className: "blocks-gallery-grid"
  15156. }, images.map(image => {
  15157. let href;
  15158. switch (linkTo) {
  15159. case v1_constants_LINK_DESTINATION_MEDIA:
  15160. href = image.fullUrl || image.url;
  15161. break;
  15162. case v1_constants_LINK_DESTINATION_ATTACHMENT:
  15163. href = image.link;
  15164. break;
  15165. }
  15166. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  15167. src: image.url,
  15168. alt: image.alt,
  15169. "data-id": image.id,
  15170. "data-full-url": image.fullUrl,
  15171. "data-link": image.link,
  15172. className: image.id ? `wp-image-${image.id}` : null
  15173. });
  15174. return (0,external_wp_element_namespaceObject.createElement)("li", {
  15175. key: image.id || image.url,
  15176. className: "blocks-gallery-item"
  15177. }, (0,external_wp_element_namespaceObject.createElement)("figure", null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  15178. href: href
  15179. }, img) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15180. tagName: "figcaption",
  15181. className: "blocks-gallery-item__caption",
  15182. value: image.caption
  15183. })));
  15184. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15185. tagName: "figcaption",
  15186. className: "blocks-gallery-caption",
  15187. value: caption
  15188. }));
  15189. }
  15190. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/save.js
  15191. /**
  15192. * External dependencies
  15193. */
  15194. /**
  15195. * WordPress dependencies
  15196. */
  15197. /**
  15198. * Internal dependencies
  15199. */
  15200. function saveWithInnerBlocks(_ref) {
  15201. let {
  15202. attributes
  15203. } = _ref;
  15204. if (!isGalleryV2Enabled()) {
  15205. return saveV1({
  15206. attributes
  15207. });
  15208. }
  15209. const {
  15210. caption,
  15211. columns,
  15212. imageCrop
  15213. } = attributes;
  15214. const className = classnames_default()('has-nested-images', {
  15215. [`columns-${columns}`]: columns !== undefined,
  15216. [`columns-default`]: columns === undefined,
  15217. 'is-cropped': imageCrop
  15218. });
  15219. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  15220. className
  15221. });
  15222. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  15223. return (0,external_wp_element_namespaceObject.createElement)("figure", innerBlocksProps, innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  15224. tagName: "figcaption",
  15225. className: "blocks-gallery-caption",
  15226. value: caption
  15227. }));
  15228. }
  15229. ;// CONCATENATED MODULE: external ["wp","hooks"]
  15230. var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
  15231. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js
  15232. /**
  15233. * External dependencies
  15234. */
  15235. /**
  15236. * WordPress dependencies
  15237. */
  15238. /**
  15239. * Internal dependencies
  15240. */
  15241. const parseShortcodeIds = ids => {
  15242. if (!ids) {
  15243. return [];
  15244. }
  15245. return ids.split(',').map(id => parseInt(id, 10));
  15246. };
  15247. /**
  15248. * Third party block plugins don't have an easy way to detect if the
  15249. * innerBlocks version of the Gallery is running when they run a
  15250. * 3rdPartyBlock -> GalleryBlock transform so this tranform filter
  15251. * will handle this. Once the innerBlocks version is the default
  15252. * in a core release, this could be deprecated and removed after
  15253. * plugin authors have been given time to update transforms.
  15254. *
  15255. * @typedef {Object} Attributes
  15256. * @typedef {Object} Block
  15257. * @property {Attributes} attributes The attributes of the block.
  15258. * @param {Block} block The transformed block.
  15259. * @return {Block} The transformed block.
  15260. */
  15261. function updateThirdPartyTransformToGallery(block) {
  15262. var _block$attributes;
  15263. if (isGalleryV2Enabled() && block.name === 'core/gallery' && ((_block$attributes = block.attributes) === null || _block$attributes === void 0 ? void 0 : _block$attributes.images.length) > 0) {
  15264. const innerBlocks = block.attributes.images.map(_ref => {
  15265. let {
  15266. url,
  15267. id,
  15268. alt
  15269. } = _ref;
  15270. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15271. url,
  15272. id: id ? parseInt(id, 10) : null,
  15273. alt,
  15274. sizeSlug: block.attributes.sizeSlug,
  15275. linkDestination: block.attributes.linkDestination
  15276. });
  15277. });
  15278. delete block.attributes.ids;
  15279. delete block.attributes.images;
  15280. block.innerBlocks = innerBlocks;
  15281. }
  15282. return block;
  15283. }
  15284. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery);
  15285. /**
  15286. * Third party block plugins don't have an easy way to detect if the
  15287. * innerBlocks version of the Gallery is running when they run a
  15288. * GalleryBlock -> 3rdPartyBlock transform so this transform filter
  15289. * will handle this. Once the innerBlocks version is the default
  15290. * in a core release, this could be deprecated and removed after
  15291. * plugin authors have been given time to update transforms.
  15292. *
  15293. * @typedef {Object} Attributes
  15294. * @typedef {Object} Block
  15295. * @property {Attributes} attributes The attributes of the block.
  15296. * @param {Block} toBlock The block to transform to.
  15297. * @param {Block[]} fromBlocks The blocks to transform from.
  15298. * @return {Block} The transformed block.
  15299. */
  15300. function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) {
  15301. const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks];
  15302. const galleryBlock = from.find(transformedBlock => {
  15303. var _transformedBlock$att;
  15304. return transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !((_transformedBlock$att = transformedBlock.attributes.images) !== null && _transformedBlock$att !== void 0 && _transformedBlock$att.length) > 0 && !toBlock.name.includes('core/');
  15305. });
  15306. if (galleryBlock) {
  15307. const images = galleryBlock.innerBlocks.map(_ref2 => {
  15308. let {
  15309. attributes: {
  15310. url,
  15311. id,
  15312. alt
  15313. }
  15314. } = _ref2;
  15315. return {
  15316. url,
  15317. id: id ? parseInt(id, 10) : null,
  15318. alt
  15319. };
  15320. });
  15321. const ids = images.map(_ref3 => {
  15322. let {
  15323. id
  15324. } = _ref3;
  15325. return id;
  15326. });
  15327. galleryBlock.attributes.images = images;
  15328. galleryBlock.attributes.ids = ids;
  15329. }
  15330. return toBlock;
  15331. }
  15332. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery);
  15333. const gallery_transforms_transforms = {
  15334. from: [{
  15335. type: 'block',
  15336. isMultiBlock: true,
  15337. blocks: ['core/image'],
  15338. transform: attributes => {
  15339. // Init the align and size from the first item which may be either the placeholder or an image.
  15340. let {
  15341. align,
  15342. sizeSlug
  15343. } = attributes[0]; // Loop through all the images and check if they have the same align and size.
  15344. align = (0,external_lodash_namespaceObject.every)(attributes, ['align', align]) ? align : undefined;
  15345. sizeSlug = (0,external_lodash_namespaceObject.every)(attributes, ['sizeSlug', sizeSlug]) ? sizeSlug : undefined;
  15346. const validImages = (0,external_lodash_namespaceObject.filter)(attributes, _ref4 => {
  15347. let {
  15348. url
  15349. } = _ref4;
  15350. return url;
  15351. });
  15352. if (isGalleryV2Enabled()) {
  15353. const innerBlocks = validImages.map(image => {
  15354. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image);
  15355. });
  15356. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  15357. align,
  15358. sizeSlug
  15359. }, innerBlocks);
  15360. }
  15361. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  15362. images: validImages.map(_ref5 => {
  15363. let {
  15364. id,
  15365. url,
  15366. alt,
  15367. caption
  15368. } = _ref5;
  15369. return {
  15370. id: (0,external_lodash_namespaceObject.toString)(id),
  15371. url,
  15372. alt,
  15373. caption
  15374. };
  15375. }),
  15376. ids: validImages.map(_ref6 => {
  15377. let {
  15378. id
  15379. } = _ref6;
  15380. return parseInt(id, 10);
  15381. }),
  15382. align,
  15383. sizeSlug
  15384. });
  15385. }
  15386. }, {
  15387. type: 'shortcode',
  15388. tag: 'gallery',
  15389. attributes: {
  15390. images: {
  15391. type: 'array',
  15392. shortcode: _ref7 => {
  15393. let {
  15394. named: {
  15395. ids
  15396. }
  15397. } = _ref7;
  15398. if (!isGalleryV2Enabled()) {
  15399. return parseShortcodeIds(ids).map(id => ({
  15400. id: (0,external_lodash_namespaceObject.toString)(id)
  15401. }));
  15402. }
  15403. }
  15404. },
  15405. ids: {
  15406. type: 'array',
  15407. shortcode: _ref8 => {
  15408. let {
  15409. named: {
  15410. ids
  15411. }
  15412. } = _ref8;
  15413. if (!isGalleryV2Enabled()) {
  15414. return parseShortcodeIds(ids);
  15415. }
  15416. }
  15417. },
  15418. shortCodeTransforms: {
  15419. type: 'array',
  15420. shortcode: _ref9 => {
  15421. let {
  15422. named: {
  15423. ids
  15424. }
  15425. } = _ref9;
  15426. if (isGalleryV2Enabled()) {
  15427. return parseShortcodeIds(ids).map(id => ({
  15428. id: parseInt(id)
  15429. }));
  15430. }
  15431. }
  15432. },
  15433. columns: {
  15434. type: 'number',
  15435. shortcode: _ref10 => {
  15436. let {
  15437. named: {
  15438. columns = '3'
  15439. }
  15440. } = _ref10;
  15441. return parseInt(columns, 10);
  15442. }
  15443. },
  15444. linkTo: {
  15445. type: 'string',
  15446. shortcode: _ref11 => {
  15447. let {
  15448. named: {
  15449. link
  15450. }
  15451. } = _ref11;
  15452. if (!isGalleryV2Enabled()) {
  15453. switch (link) {
  15454. case 'post':
  15455. return v1_constants_LINK_DESTINATION_ATTACHMENT;
  15456. case 'file':
  15457. return v1_constants_LINK_DESTINATION_MEDIA;
  15458. default:
  15459. return v1_constants_LINK_DESTINATION_ATTACHMENT;
  15460. }
  15461. }
  15462. switch (link) {
  15463. case 'post':
  15464. return LINK_DESTINATION_ATTACHMENT;
  15465. case 'file':
  15466. return LINK_DESTINATION_MEDIA;
  15467. default:
  15468. return LINK_DESTINATION_NONE;
  15469. }
  15470. }
  15471. }
  15472. },
  15473. isMatch(_ref12) {
  15474. let {
  15475. named
  15476. } = _ref12;
  15477. return undefined !== named.ids;
  15478. }
  15479. }, {
  15480. // When created by drag and dropping multiple files on an insertion point. Because multiple
  15481. // files must not be transformed to a gallery when dropped within a gallery there is another transform
  15482. // within the image block to handle that case. Therefore this transform has to have priority 1
  15483. // set so that it overrrides the image block transformation when mulitple images are dropped outside
  15484. // of a gallery block.
  15485. type: 'files',
  15486. priority: 1,
  15487. isMatch(files) {
  15488. return files.length !== 1 && (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
  15489. },
  15490. transform(files) {
  15491. if (isGalleryV2Enabled()) {
  15492. const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15493. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  15494. }));
  15495. return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks);
  15496. }
  15497. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {
  15498. images: files.map(file => pickRelevantMediaFiles({
  15499. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  15500. }))
  15501. });
  15502. return block;
  15503. }
  15504. }],
  15505. to: [{
  15506. type: 'block',
  15507. blocks: ['core/image'],
  15508. transform: (_ref13, innerBlocks) => {
  15509. let {
  15510. align,
  15511. images,
  15512. ids,
  15513. sizeSlug
  15514. } = _ref13;
  15515. if (isGalleryV2Enabled()) {
  15516. if (innerBlocks.length > 0) {
  15517. return innerBlocks.map(_ref14 => {
  15518. let {
  15519. attributes: {
  15520. id,
  15521. url,
  15522. alt,
  15523. caption,
  15524. sizeSlug: imageSizeSlug,
  15525. linkDestination,
  15526. href,
  15527. linkTarget
  15528. }
  15529. } = _ref14;
  15530. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15531. id,
  15532. url,
  15533. alt,
  15534. caption,
  15535. sizeSlug: imageSizeSlug,
  15536. align,
  15537. linkDestination,
  15538. href,
  15539. linkTarget
  15540. });
  15541. });
  15542. }
  15543. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15544. align
  15545. });
  15546. }
  15547. if (images.length > 0) {
  15548. return images.map((_ref15, index) => {
  15549. let {
  15550. url,
  15551. alt,
  15552. caption
  15553. } = _ref15;
  15554. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15555. id: ids[index],
  15556. url,
  15557. alt,
  15558. caption,
  15559. align,
  15560. sizeSlug
  15561. });
  15562. });
  15563. }
  15564. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  15565. align
  15566. });
  15567. }
  15568. }]
  15569. };
  15570. /* harmony default export */ var gallery_transforms = (gallery_transforms_transforms);
  15571. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
  15572. /**
  15573. * WordPress dependencies
  15574. */
  15575. /**
  15576. * Internal dependencies
  15577. */
  15578. const gallery_metadata = {
  15579. $schema: "https://schemas.wp.org/trunk/block.json",
  15580. apiVersion: 2,
  15581. name: "core/gallery",
  15582. title: "Gallery",
  15583. category: "media",
  15584. description: "Display multiple images in a rich gallery.",
  15585. keywords: ["images", "photos"],
  15586. textdomain: "default",
  15587. attributes: {
  15588. images: {
  15589. type: "array",
  15590. "default": [],
  15591. source: "query",
  15592. selector: ".blocks-gallery-item",
  15593. query: {
  15594. url: {
  15595. type: "string",
  15596. source: "attribute",
  15597. selector: "img",
  15598. attribute: "src"
  15599. },
  15600. fullUrl: {
  15601. type: "string",
  15602. source: "attribute",
  15603. selector: "img",
  15604. attribute: "data-full-url"
  15605. },
  15606. link: {
  15607. type: "string",
  15608. source: "attribute",
  15609. selector: "img",
  15610. attribute: "data-link"
  15611. },
  15612. alt: {
  15613. type: "string",
  15614. source: "attribute",
  15615. selector: "img",
  15616. attribute: "alt",
  15617. "default": ""
  15618. },
  15619. id: {
  15620. type: "string",
  15621. source: "attribute",
  15622. selector: "img",
  15623. attribute: "data-id"
  15624. },
  15625. caption: {
  15626. type: "string",
  15627. source: "html",
  15628. selector: ".blocks-gallery-item__caption"
  15629. }
  15630. }
  15631. },
  15632. ids: {
  15633. type: "array",
  15634. items: {
  15635. type: "number"
  15636. },
  15637. "default": []
  15638. },
  15639. shortCodeTransforms: {
  15640. type: "array",
  15641. "default": [],
  15642. items: {
  15643. type: "object"
  15644. }
  15645. },
  15646. columns: {
  15647. type: "number",
  15648. minimum: 1,
  15649. maximum: 8
  15650. },
  15651. caption: {
  15652. type: "string",
  15653. source: "html",
  15654. selector: ".blocks-gallery-caption"
  15655. },
  15656. imageCrop: {
  15657. type: "boolean",
  15658. "default": true
  15659. },
  15660. fixedHeight: {
  15661. type: "boolean",
  15662. "default": true
  15663. },
  15664. linkTarget: {
  15665. type: "string"
  15666. },
  15667. linkTo: {
  15668. type: "string"
  15669. },
  15670. sizeSlug: {
  15671. type: "string",
  15672. "default": "large"
  15673. },
  15674. allowResize: {
  15675. type: "boolean",
  15676. "default": false
  15677. }
  15678. },
  15679. providesContext: {
  15680. allowResize: "allowResize",
  15681. imageCrop: "imageCrop",
  15682. fixedHeight: "fixedHeight"
  15683. },
  15684. supports: {
  15685. anchor: true,
  15686. align: true,
  15687. html: false,
  15688. units: ["px", "em", "rem", "vh", "vw"],
  15689. spacing: {
  15690. blockGap: true,
  15691. __experimentalSkipSerialization: ["blockGap"],
  15692. __experimentalDefaultControls: {
  15693. blockGap: true
  15694. }
  15695. },
  15696. __experimentalLayout: {
  15697. allowSwitching: false,
  15698. allowInheriting: false,
  15699. allowEditing: false,
  15700. "default": {
  15701. type: "flex"
  15702. }
  15703. }
  15704. },
  15705. editorStyle: "wp-block-gallery-editor",
  15706. style: "wp-block-gallery"
  15707. };
  15708. const {
  15709. name: gallery_name
  15710. } = gallery_metadata;
  15711. const gallery_settings = {
  15712. icon: library_gallery,
  15713. example: {
  15714. attributes: {
  15715. columns: 2
  15716. },
  15717. innerBlocks: [{
  15718. name: 'core/image',
  15719. attributes: {
  15720. url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg'
  15721. }
  15722. }, {
  15723. name: 'core/image',
  15724. attributes: {
  15725. url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg'
  15726. }
  15727. }]
  15728. },
  15729. transforms: gallery_transforms,
  15730. edit: edit_wrapper,
  15731. save: saveWithInnerBlocks,
  15732. deprecated: gallery_deprecated
  15733. };
  15734. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js
  15735. /**
  15736. * WordPress dependencies
  15737. */
  15738. const group = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  15739. viewBox: "0 0 24 24",
  15740. xmlns: "http://www.w3.org/2000/svg"
  15741. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  15742. d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"
  15743. }));
  15744. /* harmony default export */ var library_group = (group);
  15745. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/deprecated.js
  15746. /**
  15747. * External dependencies
  15748. */
  15749. /**
  15750. * WordPress dependencies
  15751. */
  15752. const migrateAttributes = attributes => {
  15753. if (!attributes.tagName) {
  15754. attributes = { ...attributes,
  15755. tagName: 'div'
  15756. };
  15757. }
  15758. if (!attributes.customTextColor && !attributes.customBackgroundColor) {
  15759. return attributes;
  15760. }
  15761. const style = {
  15762. color: {}
  15763. };
  15764. if (attributes.customTextColor) {
  15765. style.color.text = attributes.customTextColor;
  15766. }
  15767. if (attributes.customBackgroundColor) {
  15768. style.color.background = attributes.customBackgroundColor;
  15769. }
  15770. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor']),
  15771. style
  15772. };
  15773. };
  15774. const group_deprecated_deprecated = [// Version of the block with the double div.
  15775. {
  15776. attributes: {
  15777. tagName: {
  15778. type: 'string',
  15779. default: 'div'
  15780. },
  15781. templateLock: {
  15782. type: 'string'
  15783. }
  15784. },
  15785. supports: {
  15786. align: ['wide', 'full'],
  15787. anchor: true,
  15788. color: {
  15789. gradients: true,
  15790. link: true
  15791. },
  15792. spacing: {
  15793. padding: true
  15794. },
  15795. __experimentalBorder: {
  15796. radius: true
  15797. }
  15798. },
  15799. save(_ref) {
  15800. let {
  15801. attributes
  15802. } = _ref;
  15803. const {
  15804. tagName: Tag
  15805. } = attributes;
  15806. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("div", {
  15807. className: "wp-block-group__inner-container"
  15808. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  15809. }
  15810. }, // Version of the block without global styles support
  15811. {
  15812. attributes: {
  15813. backgroundColor: {
  15814. type: 'string'
  15815. },
  15816. customBackgroundColor: {
  15817. type: 'string'
  15818. },
  15819. textColor: {
  15820. type: 'string'
  15821. },
  15822. customTextColor: {
  15823. type: 'string'
  15824. }
  15825. },
  15826. supports: {
  15827. align: ['wide', 'full'],
  15828. anchor: true,
  15829. html: false
  15830. },
  15831. migrate: migrateAttributes,
  15832. save(_ref2) {
  15833. let {
  15834. attributes
  15835. } = _ref2;
  15836. const {
  15837. backgroundColor,
  15838. customBackgroundColor,
  15839. textColor,
  15840. customTextColor
  15841. } = attributes;
  15842. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  15843. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  15844. const className = classnames_default()(backgroundClass, textClass, {
  15845. 'has-text-color': textColor || customTextColor,
  15846. 'has-background': backgroundColor || customBackgroundColor
  15847. });
  15848. const styles = {
  15849. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  15850. color: textClass ? undefined : customTextColor
  15851. };
  15852. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15853. className: className,
  15854. style: styles
  15855. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  15856. className: "wp-block-group__inner-container"
  15857. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  15858. }
  15859. }, // Version of the group block with a bug that made text color class not applied.
  15860. {
  15861. attributes: {
  15862. backgroundColor: {
  15863. type: 'string'
  15864. },
  15865. customBackgroundColor: {
  15866. type: 'string'
  15867. },
  15868. textColor: {
  15869. type: 'string'
  15870. },
  15871. customTextColor: {
  15872. type: 'string'
  15873. }
  15874. },
  15875. migrate: migrateAttributes,
  15876. supports: {
  15877. align: ['wide', 'full'],
  15878. anchor: true,
  15879. html: false
  15880. },
  15881. save(_ref3) {
  15882. let {
  15883. attributes
  15884. } = _ref3;
  15885. const {
  15886. backgroundColor,
  15887. customBackgroundColor,
  15888. textColor,
  15889. customTextColor
  15890. } = attributes;
  15891. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  15892. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  15893. const className = classnames_default()(backgroundClass, {
  15894. 'has-text-color': textColor || customTextColor,
  15895. 'has-background': backgroundColor || customBackgroundColor
  15896. });
  15897. const styles = {
  15898. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  15899. color: textClass ? undefined : customTextColor
  15900. };
  15901. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15902. className: className,
  15903. style: styles
  15904. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  15905. className: "wp-block-group__inner-container"
  15906. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  15907. }
  15908. }, // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`.
  15909. {
  15910. attributes: {
  15911. backgroundColor: {
  15912. type: 'string'
  15913. },
  15914. customBackgroundColor: {
  15915. type: 'string'
  15916. }
  15917. },
  15918. supports: {
  15919. align: ['wide', 'full'],
  15920. anchor: true,
  15921. html: false
  15922. },
  15923. migrate: migrateAttributes,
  15924. save(_ref4) {
  15925. let {
  15926. attributes
  15927. } = _ref4;
  15928. const {
  15929. backgroundColor,
  15930. customBackgroundColor
  15931. } = attributes;
  15932. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  15933. const className = classnames_default()(backgroundClass, {
  15934. 'has-background': backgroundColor || customBackgroundColor
  15935. });
  15936. const styles = {
  15937. backgroundColor: backgroundClass ? undefined : customBackgroundColor
  15938. };
  15939. return (0,external_wp_element_namespaceObject.createElement)("div", {
  15940. className: className,
  15941. style: styles
  15942. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  15943. }
  15944. }];
  15945. /* harmony default export */ var group_deprecated = (group_deprecated_deprecated);
  15946. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/edit.js
  15947. /**
  15948. * WordPress dependencies
  15949. */
  15950. const htmlElementMessages = {
  15951. header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
  15952. main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
  15953. section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
  15954. article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self contained, syndicatable portion of the document.'),
  15955. aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
  15956. footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
  15957. };
  15958. function GroupEdit(_ref) {
  15959. let {
  15960. attributes,
  15961. setAttributes,
  15962. clientId
  15963. } = _ref;
  15964. const {
  15965. hasInnerBlocks,
  15966. themeSupportsLayout
  15967. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  15968. var _getSettings;
  15969. const {
  15970. getBlock,
  15971. getSettings
  15972. } = select(external_wp_blockEditor_namespaceObject.store);
  15973. const block = getBlock(clientId);
  15974. return {
  15975. hasInnerBlocks: !!(block && block.innerBlocks.length),
  15976. themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
  15977. };
  15978. }, [clientId]);
  15979. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  15980. const {
  15981. tagName: TagName = 'div',
  15982. templateLock,
  15983. layout = {}
  15984. } = attributes;
  15985. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  15986. const {
  15987. type = 'default'
  15988. } = usedLayout;
  15989. const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
  15990. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  15991. className: `is-layout-${type}`
  15992. });
  15993. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
  15994. className: 'wp-block-group__inner-container'
  15995. }, {
  15996. templateLock,
  15997. renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
  15998. __experimentalLayout: layoutSupportEnabled ? usedLayout : undefined
  15999. });
  16000. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  16001. __experimentalGroup: "advanced"
  16002. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  16003. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  16004. options: [{
  16005. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  16006. value: 'div'
  16007. }, {
  16008. label: '<header>',
  16009. value: 'header'
  16010. }, {
  16011. label: '<main>',
  16012. value: 'main'
  16013. }, {
  16014. label: '<section>',
  16015. value: 'section'
  16016. }, {
  16017. label: '<article>',
  16018. value: 'article'
  16019. }, {
  16020. label: '<aside>',
  16021. value: 'aside'
  16022. }, {
  16023. label: '<footer>',
  16024. value: 'footer'
  16025. }],
  16026. value: TagName,
  16027. onChange: value => setAttributes({
  16028. tagName: value
  16029. }),
  16030. help: htmlElementMessages[TagName]
  16031. })), layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  16032. }
  16033. /* harmony default export */ var group_edit = (GroupEdit);
  16034. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js
  16035. /**
  16036. * WordPress dependencies
  16037. */
  16038. function group_save_save(_ref) {
  16039. let {
  16040. attributes: {
  16041. tagName: Tag
  16042. }
  16043. } = _ref;
  16044. return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()));
  16045. }
  16046. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/transforms.js
  16047. /**
  16048. * WordPress dependencies
  16049. */
  16050. const group_transforms_transforms = {
  16051. from: [{
  16052. type: 'block',
  16053. isMultiBlock: true,
  16054. blocks: ['*'],
  16055. __experimentalConvert(blocks) {
  16056. const alignments = ['wide', 'full']; // Determine the widest setting of all the blocks to be grouped
  16057. const widestAlignment = blocks.reduce((accumulator, block) => {
  16058. const {
  16059. align
  16060. } = block.attributes;
  16061. return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator;
  16062. }, undefined); // Clone the Blocks to be Grouped
  16063. // Failing to create new block references causes the original blocks
  16064. // to be replaced in the switchToBlockType call thereby meaning they
  16065. // are removed both from their original location and within the
  16066. // new group block.
  16067. const groupInnerBlocks = blocks.map(block => {
  16068. return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks);
  16069. });
  16070. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
  16071. align: widestAlignment
  16072. }, groupInnerBlocks);
  16073. }
  16074. }]
  16075. };
  16076. /* harmony default export */ var group_transforms = (group_transforms_transforms);
  16077. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/row.js
  16078. /**
  16079. * WordPress dependencies
  16080. */
  16081. const row = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16082. xmlns: "http://www.w3.org/2000/svg",
  16083. viewBox: "0 0 24 24"
  16084. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16085. d: "M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"
  16086. }));
  16087. /* harmony default export */ var library_row = (row);
  16088. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js
  16089. /**
  16090. * WordPress dependencies
  16091. */
  16092. const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16093. xmlns: "http://www.w3.org/2000/svg",
  16094. viewBox: "0 0 24 24"
  16095. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16096. d: "M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"
  16097. }));
  16098. /* harmony default export */ var library_stack = (stack);
  16099. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js
  16100. /**
  16101. * WordPress dependencies
  16102. */
  16103. const group_variations_variations = [{
  16104. name: 'group',
  16105. title: (0,external_wp_i18n_namespaceObject.__)('Group'),
  16106. description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a layout container.'),
  16107. attributes: {
  16108. layout: {
  16109. type: 'default'
  16110. }
  16111. },
  16112. scope: ['transform'],
  16113. isActive: blockAttributes => {
  16114. var _blockAttributes$layo, _blockAttributes$layo2;
  16115. return !blockAttributes.layout || !((_blockAttributes$layo = blockAttributes.layout) !== null && _blockAttributes$layo !== void 0 && _blockAttributes$layo.type) || ((_blockAttributes$layo2 = blockAttributes.layout) === null || _blockAttributes$layo2 === void 0 ? void 0 : _blockAttributes$layo2.type) === 'default';
  16116. },
  16117. icon: library_group
  16118. }, {
  16119. name: 'group-row',
  16120. title: (0,external_wp_i18n_namespaceObject.__)('Row'),
  16121. description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'),
  16122. attributes: {
  16123. layout: {
  16124. type: 'flex',
  16125. flexWrap: 'nowrap'
  16126. }
  16127. },
  16128. scope: ['inserter', 'transform'],
  16129. isActive: blockAttributes => {
  16130. var _blockAttributes$layo3, _blockAttributes$layo4, _blockAttributes$layo5;
  16131. return ((_blockAttributes$layo3 = blockAttributes.layout) === null || _blockAttributes$layo3 === void 0 ? void 0 : _blockAttributes$layo3.type) === 'flex' && (!((_blockAttributes$layo4 = blockAttributes.layout) !== null && _blockAttributes$layo4 !== void 0 && _blockAttributes$layo4.orientation) || ((_blockAttributes$layo5 = blockAttributes.layout) === null || _blockAttributes$layo5 === void 0 ? void 0 : _blockAttributes$layo5.orientation) === 'horizontal');
  16132. },
  16133. icon: library_row
  16134. }, {
  16135. name: 'group-stack',
  16136. title: (0,external_wp_i18n_namespaceObject.__)('Stack'),
  16137. description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'),
  16138. attributes: {
  16139. layout: {
  16140. type: 'flex',
  16141. orientation: 'vertical'
  16142. }
  16143. },
  16144. scope: ['inserter', 'transform'],
  16145. isActive: blockAttributes => {
  16146. var _blockAttributes$layo6, _blockAttributes$layo7;
  16147. return ((_blockAttributes$layo6 = blockAttributes.layout) === null || _blockAttributes$layo6 === void 0 ? void 0 : _blockAttributes$layo6.type) === 'flex' && ((_blockAttributes$layo7 = blockAttributes.layout) === null || _blockAttributes$layo7 === void 0 ? void 0 : _blockAttributes$layo7.orientation) === 'vertical';
  16148. },
  16149. icon: library_stack
  16150. }];
  16151. /* harmony default export */ var group_variations = (group_variations_variations);
  16152. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js
  16153. /**
  16154. * WordPress dependencies
  16155. */
  16156. /**
  16157. * Internal dependencies
  16158. */
  16159. const group_metadata = {
  16160. $schema: "https://schemas.wp.org/trunk/block.json",
  16161. apiVersion: 2,
  16162. name: "core/group",
  16163. title: "Group",
  16164. category: "design",
  16165. description: "Gather blocks in a layout container.",
  16166. keywords: ["container", "wrapper", "row", "section"],
  16167. textdomain: "default",
  16168. attributes: {
  16169. tagName: {
  16170. type: "string",
  16171. "default": "div"
  16172. },
  16173. templateLock: {
  16174. type: ["string", "boolean"],
  16175. "enum": ["all", "insert", false]
  16176. }
  16177. },
  16178. supports: {
  16179. align: ["wide", "full"],
  16180. anchor: true,
  16181. html: false,
  16182. color: {
  16183. gradients: true,
  16184. link: true,
  16185. __experimentalDefaultControls: {
  16186. background: true,
  16187. text: true
  16188. }
  16189. },
  16190. spacing: {
  16191. margin: ["top", "bottom"],
  16192. padding: true,
  16193. blockGap: true,
  16194. __experimentalDefaultControls: {
  16195. padding: true,
  16196. blockGap: true
  16197. }
  16198. },
  16199. __experimentalBorder: {
  16200. color: true,
  16201. radius: true,
  16202. style: true,
  16203. width: true,
  16204. __experimentalDefaultControls: {
  16205. color: true,
  16206. radius: true,
  16207. style: true,
  16208. width: true
  16209. }
  16210. },
  16211. typography: {
  16212. fontSize: true,
  16213. lineHeight: true,
  16214. __experimentalFontStyle: true,
  16215. __experimentalFontWeight: true,
  16216. __experimentalLetterSpacing: true,
  16217. __experimentalTextTransform: true,
  16218. __experimentalDefaultControls: {
  16219. fontSize: true
  16220. }
  16221. },
  16222. __experimentalLayout: true
  16223. },
  16224. editorStyle: "wp-block-group-editor",
  16225. style: "wp-block-group"
  16226. };
  16227. const {
  16228. name: group_name
  16229. } = group_metadata;
  16230. const group_settings = {
  16231. icon: library_group,
  16232. example: {
  16233. attributes: {
  16234. style: {
  16235. color: {
  16236. text: '#000000',
  16237. background: '#ffffff'
  16238. }
  16239. }
  16240. },
  16241. innerBlocks: [{
  16242. name: 'core/paragraph',
  16243. attributes: {
  16244. customTextColor: '#cf2e2e',
  16245. fontSize: 'large',
  16246. content: (0,external_wp_i18n_namespaceObject.__)('One.')
  16247. }
  16248. }, {
  16249. name: 'core/paragraph',
  16250. attributes: {
  16251. customTextColor: '#ff6900',
  16252. fontSize: 'large',
  16253. content: (0,external_wp_i18n_namespaceObject.__)('Two.')
  16254. }
  16255. }, {
  16256. name: 'core/paragraph',
  16257. attributes: {
  16258. customTextColor: '#fcb900',
  16259. fontSize: 'large',
  16260. content: (0,external_wp_i18n_namespaceObject.__)('Three.')
  16261. }
  16262. }, {
  16263. name: 'core/paragraph',
  16264. attributes: {
  16265. customTextColor: '#00d084',
  16266. fontSize: 'large',
  16267. content: (0,external_wp_i18n_namespaceObject.__)('Four.')
  16268. }
  16269. }, {
  16270. name: 'core/paragraph',
  16271. attributes: {
  16272. customTextColor: '#0693e3',
  16273. fontSize: 'large',
  16274. content: (0,external_wp_i18n_namespaceObject.__)('Five.')
  16275. }
  16276. }, {
  16277. name: 'core/paragraph',
  16278. attributes: {
  16279. customTextColor: '#9b51e0',
  16280. fontSize: 'large',
  16281. content: (0,external_wp_i18n_namespaceObject.__)('Six.')
  16282. }
  16283. }]
  16284. },
  16285. transforms: group_transforms,
  16286. edit: group_edit,
  16287. save: group_save_save,
  16288. deprecated: group_deprecated,
  16289. variations: group_variations
  16290. };
  16291. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js
  16292. /**
  16293. * WordPress dependencies
  16294. */
  16295. const heading = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16296. xmlns: "http://www.w3.org/2000/svg",
  16297. viewBox: "0 0 24 24"
  16298. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16299. d: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"
  16300. }));
  16301. /* harmony default export */ var library_heading = (heading);
  16302. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js
  16303. /**
  16304. * External dependencies
  16305. */
  16306. /**
  16307. * WordPress dependencies
  16308. */
  16309. const blockSupports = {
  16310. className: false,
  16311. anchor: true
  16312. };
  16313. const heading_deprecated_blockAttributes = {
  16314. align: {
  16315. type: 'string'
  16316. },
  16317. content: {
  16318. type: 'string',
  16319. source: 'html',
  16320. selector: 'h1,h2,h3,h4,h5,h6',
  16321. default: ''
  16322. },
  16323. level: {
  16324. type: 'number',
  16325. default: 2
  16326. },
  16327. placeholder: {
  16328. type: 'string'
  16329. }
  16330. };
  16331. const deprecated_migrateCustomColors = attributes => {
  16332. if (!attributes.customTextColor) {
  16333. return attributes;
  16334. }
  16335. const style = {
  16336. color: {
  16337. text: attributes.customTextColor
  16338. }
  16339. };
  16340. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor']),
  16341. style
  16342. };
  16343. };
  16344. const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center'];
  16345. const migrateTextAlign = attributes => {
  16346. const {
  16347. align,
  16348. ...rest
  16349. } = attributes;
  16350. return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest,
  16351. textAlign: align
  16352. } : attributes;
  16353. };
  16354. const heading_deprecated_deprecated = [{
  16355. supports: {
  16356. align: ['wide', 'full'],
  16357. anchor: true,
  16358. className: false,
  16359. color: {
  16360. link: true
  16361. },
  16362. fontSize: true,
  16363. lineHeight: true,
  16364. __experimentalSelector: {
  16365. 'core/heading/h1': 'h1',
  16366. 'core/heading/h2': 'h2',
  16367. 'core/heading/h3': 'h3',
  16368. 'core/heading/h4': 'h4',
  16369. 'core/heading/h5': 'h5',
  16370. 'core/heading/h6': 'h6'
  16371. },
  16372. __unstablePasteTextInline: true
  16373. },
  16374. attributes: heading_deprecated_blockAttributes,
  16375. isEligible: _ref => {
  16376. let {
  16377. align
  16378. } = _ref;
  16379. return TEXT_ALIGN_OPTIONS.includes(align);
  16380. },
  16381. migrate: migrateTextAlign,
  16382. save(_ref2) {
  16383. let {
  16384. attributes
  16385. } = _ref2;
  16386. const {
  16387. align,
  16388. content,
  16389. level
  16390. } = attributes;
  16391. const TagName = 'h' + level;
  16392. const className = classnames_default()({
  16393. [`has-text-align-${align}`]: align
  16394. });
  16395. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  16396. className
  16397. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16398. value: content
  16399. }));
  16400. }
  16401. }, {
  16402. supports: blockSupports,
  16403. attributes: { ...heading_deprecated_blockAttributes,
  16404. customTextColor: {
  16405. type: 'string'
  16406. },
  16407. textColor: {
  16408. type: 'string'
  16409. }
  16410. },
  16411. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  16412. save(_ref3) {
  16413. let {
  16414. attributes
  16415. } = _ref3;
  16416. const {
  16417. align,
  16418. content,
  16419. customTextColor,
  16420. level,
  16421. textColor
  16422. } = attributes;
  16423. const tagName = 'h' + level;
  16424. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  16425. const className = classnames_default()({
  16426. [textClass]: textClass,
  16427. 'has-text-color': textColor || customTextColor,
  16428. [`has-text-align-${align}`]: align
  16429. });
  16430. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16431. className: className ? className : undefined,
  16432. tagName: tagName,
  16433. style: {
  16434. color: textClass ? undefined : customTextColor
  16435. },
  16436. value: content
  16437. });
  16438. }
  16439. }, {
  16440. attributes: { ...heading_deprecated_blockAttributes,
  16441. customTextColor: {
  16442. type: 'string'
  16443. },
  16444. textColor: {
  16445. type: 'string'
  16446. }
  16447. },
  16448. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  16449. save(_ref4) {
  16450. let {
  16451. attributes
  16452. } = _ref4;
  16453. const {
  16454. align,
  16455. content,
  16456. customTextColor,
  16457. level,
  16458. textColor
  16459. } = attributes;
  16460. const tagName = 'h' + level;
  16461. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  16462. const className = classnames_default()({
  16463. [textClass]: textClass,
  16464. [`has-text-align-${align}`]: align
  16465. });
  16466. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16467. className: className ? className : undefined,
  16468. tagName: tagName,
  16469. style: {
  16470. color: textClass ? undefined : customTextColor
  16471. },
  16472. value: content
  16473. });
  16474. },
  16475. supports: blockSupports
  16476. }, {
  16477. supports: blockSupports,
  16478. attributes: { ...heading_deprecated_blockAttributes,
  16479. customTextColor: {
  16480. type: 'string'
  16481. },
  16482. textColor: {
  16483. type: 'string'
  16484. }
  16485. },
  16486. migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)),
  16487. save(_ref5) {
  16488. let {
  16489. attributes
  16490. } = _ref5;
  16491. const {
  16492. align,
  16493. level,
  16494. content,
  16495. textColor,
  16496. customTextColor
  16497. } = attributes;
  16498. const tagName = 'h' + level;
  16499. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  16500. const className = classnames_default()({
  16501. [textClass]: textClass
  16502. });
  16503. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16504. className: className ? className : undefined,
  16505. tagName: tagName,
  16506. style: {
  16507. textAlign: align,
  16508. color: textClass ? undefined : customTextColor
  16509. },
  16510. value: content
  16511. });
  16512. }
  16513. }];
  16514. /* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated);
  16515. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js
  16516. /**
  16517. * External dependencies
  16518. */
  16519. /**
  16520. * Object map tracking anchors.
  16521. *
  16522. * @type {Record<string, string | null>}
  16523. */
  16524. const autogenerate_anchors_anchors = {};
  16525. /**
  16526. * Returns the text without markup.
  16527. *
  16528. * @param {string} text The text.
  16529. *
  16530. * @return {string} The text without markup.
  16531. */
  16532. const getTextWithoutMarkup = text => {
  16533. const dummyElement = document.createElement('div');
  16534. dummyElement.innerHTML = text;
  16535. return dummyElement.innerText;
  16536. };
  16537. /**
  16538. * Get the slug from the content.
  16539. *
  16540. * @param {string} content The block content.
  16541. *
  16542. * @return {string} Returns the slug.
  16543. */
  16544. const getSlug = content => {
  16545. // Get the slug.
  16546. return (0,external_lodash_namespaceObject.trim)((0,external_lodash_namespaceObject.deburr)(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, '-').toLowerCase(), '-');
  16547. };
  16548. /**
  16549. * Generate the anchor for a heading.
  16550. *
  16551. * @param {string} clientId The block ID.
  16552. * @param {string} content The block content.
  16553. *
  16554. * @return {string|null} Return the heading anchor.
  16555. */
  16556. const generateAnchor = (clientId, content) => {
  16557. const slug = getSlug(content); // If slug is empty, then return null.
  16558. // Returning null instead of an empty string allows us to check again when the content changes.
  16559. if ('' === slug) {
  16560. return null;
  16561. }
  16562. delete autogenerate_anchors_anchors[clientId];
  16563. let anchor = slug;
  16564. let i = 0; // If the anchor already exists in another heading, append -i.
  16565. while (Object.values(autogenerate_anchors_anchors).includes(anchor)) {
  16566. i += 1;
  16567. anchor = slug + '-' + i;
  16568. }
  16569. return anchor;
  16570. };
  16571. /**
  16572. * Set the anchor for a heading.
  16573. *
  16574. * @param {string} clientId The block ID.
  16575. * @param {string|null} anchor The block anchor.
  16576. */
  16577. const setAnchor = (clientId, anchor) => {
  16578. autogenerate_anchors_anchors[clientId] = anchor;
  16579. };
  16580. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js
  16581. /**
  16582. * External dependencies
  16583. */
  16584. /**
  16585. * WordPress dependencies
  16586. */
  16587. /**
  16588. * Internal dependencies
  16589. */
  16590. function HeadingEdit(_ref) {
  16591. let {
  16592. attributes,
  16593. setAttributes,
  16594. mergeBlocks,
  16595. onReplace,
  16596. style,
  16597. clientId
  16598. } = _ref;
  16599. const {
  16600. textAlign,
  16601. content,
  16602. level,
  16603. placeholder,
  16604. anchor
  16605. } = attributes;
  16606. const tagName = 'h' + level;
  16607. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  16608. className: classnames_default()({
  16609. [`has-text-align-${textAlign}`]: textAlign
  16610. }),
  16611. style
  16612. });
  16613. const {
  16614. canGenerateAnchors
  16615. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  16616. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  16617. return {
  16618. canGenerateAnchors: !!settings.generateAnchors
  16619. };
  16620. }, []);
  16621. const {
  16622. __unstableMarkNextChangeAsNotPersistent
  16623. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Initially set anchor for headings that have content but no anchor set.
  16624. // This is used when transforming a block to heading, or for legacy anchors.
  16625. (0,external_wp_element_namespaceObject.useEffect)(() => {
  16626. if (!canGenerateAnchors) {
  16627. return;
  16628. }
  16629. if (!anchor && content) {
  16630. // This side-effect should not create an undo level.
  16631. __unstableMarkNextChangeAsNotPersistent();
  16632. setAttributes({
  16633. anchor: generateAnchor(clientId, content)
  16634. });
  16635. }
  16636. setAnchor(clientId, anchor); // Remove anchor map when block unmounts.
  16637. return () => setAnchor(clientId, null);
  16638. }, [anchor, content, clientId, canGenerateAnchors]);
  16639. const onContentChange = value => {
  16640. const newAttrs = {
  16641. content: value
  16642. };
  16643. if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) {
  16644. newAttrs.anchor = generateAnchor(clientId, value);
  16645. }
  16646. setAttributes(newAttrs);
  16647. };
  16648. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  16649. group: "block"
  16650. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  16651. selectedLevel: level,
  16652. onChange: newLevel => setAttributes({
  16653. level: newLevel
  16654. })
  16655. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  16656. value: textAlign,
  16657. onChange: nextAlign => {
  16658. setAttributes({
  16659. textAlign: nextAlign
  16660. });
  16661. }
  16662. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  16663. identifier: "content",
  16664. tagName: tagName,
  16665. value: content,
  16666. onChange: onContentChange,
  16667. onMerge: mergeBlocks,
  16668. onSplit: (value, isOriginal) => {
  16669. let block;
  16670. if (isOriginal || value) {
  16671. block = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { ...attributes,
  16672. content: value
  16673. });
  16674. } else {
  16675. var _getDefaultBlockName;
  16676. block = (0,external_wp_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
  16677. }
  16678. if (isOriginal) {
  16679. block.clientId = clientId;
  16680. }
  16681. return block;
  16682. },
  16683. onReplace: onReplace,
  16684. onRemove: () => onReplace([]),
  16685. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading text'),
  16686. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'),
  16687. textAlign: textAlign
  16688. }, external_wp_element_namespaceObject.Platform.isNative && {
  16689. deleteEnter: true
  16690. }, blockProps)));
  16691. }
  16692. /* harmony default export */ var heading_edit = (HeadingEdit);
  16693. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js
  16694. /**
  16695. * External dependencies
  16696. */
  16697. /**
  16698. * WordPress dependencies
  16699. */
  16700. function heading_save_save(_ref) {
  16701. let {
  16702. attributes
  16703. } = _ref;
  16704. const {
  16705. textAlign,
  16706. content,
  16707. level
  16708. } = attributes;
  16709. const TagName = 'h' + level;
  16710. const className = classnames_default()({
  16711. [`has-text-align-${textAlign}`]: textAlign
  16712. });
  16713. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  16714. className
  16715. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  16716. value: content
  16717. }));
  16718. }
  16719. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js
  16720. /**
  16721. * Given a node name string for a heading node, returns its numeric level.
  16722. *
  16723. * @param {string} nodeName Heading node name.
  16724. *
  16725. * @return {number} Heading level.
  16726. */
  16727. function getLevelFromHeadingNodeName(nodeName) {
  16728. return Number(nodeName.substr(1));
  16729. }
  16730. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js
  16731. /**
  16732. * WordPress dependencies
  16733. */
  16734. /**
  16735. * Internal dependencies
  16736. */
  16737. const {
  16738. name: heading_transforms_name
  16739. } = {
  16740. $schema: "https://schemas.wp.org/trunk/block.json",
  16741. apiVersion: 2,
  16742. name: "core/heading",
  16743. title: "Heading",
  16744. category: "text",
  16745. description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
  16746. keywords: ["title", "subtitle"],
  16747. textdomain: "default",
  16748. attributes: {
  16749. textAlign: {
  16750. type: "string"
  16751. },
  16752. content: {
  16753. type: "string",
  16754. source: "html",
  16755. selector: "h1,h2,h3,h4,h5,h6",
  16756. "default": "",
  16757. __experimentalRole: "content"
  16758. },
  16759. level: {
  16760. type: "number",
  16761. "default": 2
  16762. },
  16763. placeholder: {
  16764. type: "string"
  16765. }
  16766. },
  16767. supports: {
  16768. align: ["wide", "full"],
  16769. anchor: true,
  16770. className: false,
  16771. color: {
  16772. link: true,
  16773. __experimentalDefaultControls: {
  16774. background: true,
  16775. text: true
  16776. }
  16777. },
  16778. spacing: {
  16779. margin: true
  16780. },
  16781. typography: {
  16782. fontSize: true,
  16783. lineHeight: true,
  16784. __experimentalFontStyle: true,
  16785. __experimentalFontWeight: true,
  16786. __experimentalLetterSpacing: true,
  16787. __experimentalTextTransform: true,
  16788. __experimentalDefaultControls: {
  16789. fontSize: true,
  16790. fontAppearance: true,
  16791. textTransform: true
  16792. }
  16793. },
  16794. __experimentalSelector: "h1,h2,h3,h4,h5,h6",
  16795. __unstablePasteTextInline: true,
  16796. __experimentalSlashInserter: true
  16797. },
  16798. editorStyle: "wp-block-heading-editor",
  16799. style: "wp-block-heading"
  16800. };
  16801. const heading_transforms_transforms = {
  16802. from: [{
  16803. type: 'block',
  16804. isMultiBlock: true,
  16805. blocks: ['core/paragraph'],
  16806. transform: attributes => attributes.map(_ref => {
  16807. let {
  16808. content,
  16809. anchor
  16810. } = _ref;
  16811. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  16812. content,
  16813. anchor
  16814. });
  16815. })
  16816. }, {
  16817. type: 'raw',
  16818. selector: 'h1,h2,h3,h4,h5,h6',
  16819. schema: _ref2 => {
  16820. let {
  16821. phrasingContentSchema,
  16822. isPaste
  16823. } = _ref2;
  16824. const schema = {
  16825. children: phrasingContentSchema,
  16826. attributes: isPaste ? [] : ['style', 'id']
  16827. };
  16828. return {
  16829. h1: schema,
  16830. h2: schema,
  16831. h3: schema,
  16832. h4: schema,
  16833. h5: schema,
  16834. h6: schema
  16835. };
  16836. },
  16837. transform(node) {
  16838. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(heading_transforms_name, node.outerHTML);
  16839. const {
  16840. textAlign
  16841. } = node.style || {};
  16842. attributes.level = getLevelFromHeadingNodeName(node.nodeName);
  16843. if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
  16844. attributes.align = textAlign;
  16845. }
  16846. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, attributes);
  16847. }
  16848. }, ...[1, 2, 3, 4, 5, 6].map(level => ({
  16849. type: 'prefix',
  16850. prefix: Array(level + 1).join('#'),
  16851. transform(content) {
  16852. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  16853. level,
  16854. content
  16855. });
  16856. }
  16857. })), ...[1, 2, 3, 4, 5, 6].map(level => ({
  16858. type: 'enter',
  16859. regExp: new RegExp(`^/(h|H)${level}$`),
  16860. transform(content) {
  16861. return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
  16862. level,
  16863. content
  16864. });
  16865. }
  16866. }))],
  16867. to: [{
  16868. type: 'block',
  16869. isMultiBlock: true,
  16870. blocks: ['core/paragraph'],
  16871. transform: attributes => attributes.map(_ref3 => {
  16872. let {
  16873. content
  16874. } = _ref3;
  16875. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  16876. content
  16877. });
  16878. })
  16879. }]
  16880. };
  16881. /* harmony default export */ var heading_transforms = (heading_transforms_transforms);
  16882. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js
  16883. /**
  16884. * External dependencies
  16885. */
  16886. /**
  16887. * WordPress dependencies
  16888. */
  16889. /**
  16890. * Internal dependencies
  16891. */
  16892. const heading_metadata = {
  16893. $schema: "https://schemas.wp.org/trunk/block.json",
  16894. apiVersion: 2,
  16895. name: "core/heading",
  16896. title: "Heading",
  16897. category: "text",
  16898. description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",
  16899. keywords: ["title", "subtitle"],
  16900. textdomain: "default",
  16901. attributes: {
  16902. textAlign: {
  16903. type: "string"
  16904. },
  16905. content: {
  16906. type: "string",
  16907. source: "html",
  16908. selector: "h1,h2,h3,h4,h5,h6",
  16909. "default": "",
  16910. __experimentalRole: "content"
  16911. },
  16912. level: {
  16913. type: "number",
  16914. "default": 2
  16915. },
  16916. placeholder: {
  16917. type: "string"
  16918. }
  16919. },
  16920. supports: {
  16921. align: ["wide", "full"],
  16922. anchor: true,
  16923. className: false,
  16924. color: {
  16925. link: true,
  16926. __experimentalDefaultControls: {
  16927. background: true,
  16928. text: true
  16929. }
  16930. },
  16931. spacing: {
  16932. margin: true
  16933. },
  16934. typography: {
  16935. fontSize: true,
  16936. lineHeight: true,
  16937. __experimentalFontStyle: true,
  16938. __experimentalFontWeight: true,
  16939. __experimentalLetterSpacing: true,
  16940. __experimentalTextTransform: true,
  16941. __experimentalDefaultControls: {
  16942. fontSize: true,
  16943. fontAppearance: true,
  16944. textTransform: true
  16945. }
  16946. },
  16947. __experimentalSelector: "h1,h2,h3,h4,h5,h6",
  16948. __unstablePasteTextInline: true,
  16949. __experimentalSlashInserter: true
  16950. },
  16951. editorStyle: "wp-block-heading-editor",
  16952. style: "wp-block-heading"
  16953. };
  16954. const {
  16955. name: heading_name
  16956. } = heading_metadata;
  16957. const heading_settings = {
  16958. icon: library_heading,
  16959. example: {
  16960. attributes: {
  16961. content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'),
  16962. level: 2
  16963. }
  16964. },
  16965. __experimentalLabel(attributes, _ref) {
  16966. let {
  16967. context
  16968. } = _ref;
  16969. if (context === 'accessibility') {
  16970. const {
  16971. content,
  16972. level
  16973. } = attributes;
  16974. return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.sprintf)(
  16975. /* translators: accessibility text. %s: heading level. */
  16976. (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(
  16977. /* translators: accessibility text. 1: heading level. 2: heading content. */
  16978. (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content);
  16979. }
  16980. },
  16981. transforms: heading_transforms,
  16982. deprecated: heading_deprecated,
  16983. merge(attributes, attributesToMerge) {
  16984. return {
  16985. content: (attributes.content || '') + (attributesToMerge.content || '')
  16986. };
  16987. },
  16988. edit: heading_edit,
  16989. save: heading_save_save
  16990. };
  16991. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js
  16992. /**
  16993. * WordPress dependencies
  16994. */
  16995. const home = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  16996. xmlns: "http://www.w3.org/2000/svg",
  16997. viewBox: "0 0 24 24"
  16998. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  16999. d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"
  17000. }));
  17001. /* harmony default export */ var library_home = (home);
  17002. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/edit.js
  17003. /**
  17004. * External dependencies
  17005. */
  17006. /**
  17007. * WordPress dependencies
  17008. */
  17009. const preventDefault = event => event.preventDefault();
  17010. function HomeEdit(_ref) {
  17011. var _style$color, _style$color2, _style$color3, _style$color4;
  17012. let {
  17013. attributes,
  17014. setAttributes,
  17015. context,
  17016. clientId
  17017. } = _ref;
  17018. const {
  17019. homeUrl
  17020. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17021. var _getUnstableBase;
  17022. const {
  17023. getUnstableBase // Site index.
  17024. } = select(external_wp_coreData_namespaceObject.store);
  17025. return {
  17026. homeUrl: (_getUnstableBase = getUnstableBase()) === null || _getUnstableBase === void 0 ? void 0 : _getUnstableBase.home
  17027. };
  17028. }, [clientId]);
  17029. const {
  17030. textColor,
  17031. backgroundColor,
  17032. style
  17033. } = context;
  17034. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  17035. className: classnames_default()('wp-block-navigation-item', {
  17036. 'has-text-color': !!textColor || !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text),
  17037. [`has-${textColor}-color`]: !!textColor,
  17038. 'has-background': !!backgroundColor || !!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background),
  17039. [`has-${backgroundColor}-background-color`]: !!backgroundColor
  17040. }),
  17041. style: {
  17042. color: style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.text,
  17043. backgroundColor: style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.background
  17044. }
  17045. });
  17046. const {
  17047. label
  17048. } = attributes;
  17049. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17050. if (label === undefined) {
  17051. setAttributes({
  17052. label: (0,external_wp_i18n_namespaceObject.__)('Home')
  17053. });
  17054. }
  17055. }, [clientId, label]);
  17056. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  17057. className: "wp-block-home-link__content wp-block-navigation-item__content",
  17058. href: homeUrl,
  17059. onClick: preventDefault
  17060. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  17061. identifier: "label",
  17062. className: "wp-block-home-link__label",
  17063. value: label,
  17064. onChange: labelValue => {
  17065. setAttributes({
  17066. label: labelValue
  17067. });
  17068. },
  17069. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'),
  17070. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'),
  17071. withoutInteractiveFormatting: true,
  17072. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
  17073. }))));
  17074. }
  17075. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/save.js
  17076. /**
  17077. * WordPress dependencies
  17078. */
  17079. function home_link_save_save() {
  17080. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  17081. }
  17082. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
  17083. /**
  17084. * WordPress dependencies
  17085. */
  17086. /**
  17087. * Internal dependencies
  17088. */
  17089. const home_link_metadata = {
  17090. $schema: "https://schemas.wp.org/trunk/block.json",
  17091. apiVersion: 2,
  17092. name: "core/home-link",
  17093. category: "design",
  17094. parent: ["core/navigation"],
  17095. title: "Home Link",
  17096. description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",
  17097. textdomain: "default",
  17098. attributes: {
  17099. label: {
  17100. type: "string"
  17101. }
  17102. },
  17103. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"],
  17104. supports: {
  17105. reusable: false,
  17106. html: false
  17107. },
  17108. editorStyle: "wp-block-home-link-editor",
  17109. style: "wp-block-home-link"
  17110. };
  17111. const {
  17112. name: home_link_name
  17113. } = home_link_metadata;
  17114. const home_link_settings = {
  17115. icon: library_home,
  17116. edit: HomeEdit,
  17117. save: home_link_save_save,
  17118. example: {
  17119. attributes: {
  17120. label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example')
  17121. }
  17122. }
  17123. };
  17124. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js
  17125. /**
  17126. * WordPress dependencies
  17127. */
  17128. const html = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17129. viewBox: "0 0 24 24",
  17130. xmlns: "http://www.w3.org/2000/svg"
  17131. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17132. d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"
  17133. }));
  17134. /* harmony default export */ var library_html = (html);
  17135. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js
  17136. /**
  17137. * WordPress dependencies
  17138. */
  17139. function HTMLEdit(_ref) {
  17140. let {
  17141. attributes,
  17142. setAttributes,
  17143. isSelected
  17144. } = _ref;
  17145. const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)();
  17146. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
  17147. const styles = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17148. // Default styles used to unset some of the styles
  17149. // that might be inherited from the editor style.
  17150. const defaultStyles = `
  17151. html,body,:root {
  17152. margin: 0 !important;
  17153. padding: 0 !important;
  17154. overflow: visible !important;
  17155. min-height: auto !important;
  17156. }
  17157. `;
  17158. return [defaultStyles, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)(select(external_wp_blockEditor_namespaceObject.store).getSettings().styles)];
  17159. }, []);
  17160. function switchToPreview() {
  17161. setIsPreview(true);
  17162. }
  17163. function switchToHTML() {
  17164. setIsPreview(false);
  17165. }
  17166. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  17167. className: 'block-library-html__edit'
  17168. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17169. className: "components-tab-button",
  17170. isPressed: !isPreview,
  17171. onClick: switchToHTML
  17172. }, (0,external_wp_element_namespaceObject.createElement)("span", null, "HTML")), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17173. className: "components-tab-button",
  17174. isPressed: isPreview,
  17175. onClick: switchToPreview
  17176. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Preview'))))), isPreview || isDisabled ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
  17177. html: attributes.content,
  17178. styles: styles
  17179. }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
  17180. className: "block-library-html__preview-overlay"
  17181. })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  17182. value: attributes.content,
  17183. onChange: content => setAttributes({
  17184. content
  17185. }),
  17186. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'),
  17187. "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML')
  17188. }));
  17189. }
  17190. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js
  17191. /**
  17192. * WordPress dependencies
  17193. */
  17194. function html_save_save(_ref) {
  17195. let {
  17196. attributes
  17197. } = _ref;
  17198. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
  17199. }
  17200. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js
  17201. /**
  17202. * WordPress dependencies
  17203. */
  17204. const html_transforms_transforms = {
  17205. from: [{
  17206. type: 'block',
  17207. blocks: ['core/code'],
  17208. transform: _ref => {
  17209. let {
  17210. content
  17211. } = _ref;
  17212. return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
  17213. content
  17214. });
  17215. }
  17216. }]
  17217. };
  17218. /* harmony default export */ var html_transforms = (html_transforms_transforms);
  17219. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js
  17220. /**
  17221. * WordPress dependencies
  17222. */
  17223. /**
  17224. * Internal dependencies
  17225. */
  17226. const html_metadata = {
  17227. $schema: "https://schemas.wp.org/trunk/block.json",
  17228. apiVersion: 2,
  17229. name: "core/html",
  17230. title: "Custom HTML",
  17231. category: "widgets",
  17232. description: "Add custom HTML code and preview it as you edit.",
  17233. keywords: ["embed"],
  17234. textdomain: "default",
  17235. attributes: {
  17236. content: {
  17237. type: "string",
  17238. source: "html"
  17239. }
  17240. },
  17241. supports: {
  17242. customClassName: false,
  17243. className: false,
  17244. html: false
  17245. },
  17246. editorStyle: "wp-block-html-editor"
  17247. };
  17248. const {
  17249. name: html_name
  17250. } = html_metadata;
  17251. const html_settings = {
  17252. icon: library_html,
  17253. example: {
  17254. attributes: {
  17255. content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>'
  17256. }
  17257. },
  17258. edit: HTMLEdit,
  17259. save: html_save_save,
  17260. transforms: html_transforms
  17261. };
  17262. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js
  17263. /**
  17264. * External dependencies
  17265. */
  17266. /**
  17267. * WordPress dependencies
  17268. */
  17269. const image_deprecated_blockAttributes = {
  17270. align: {
  17271. type: 'string'
  17272. },
  17273. url: {
  17274. type: 'string',
  17275. source: 'attribute',
  17276. selector: 'img',
  17277. attribute: 'src'
  17278. },
  17279. alt: {
  17280. type: 'string',
  17281. source: 'attribute',
  17282. selector: 'img',
  17283. attribute: 'alt',
  17284. default: ''
  17285. },
  17286. caption: {
  17287. type: 'string',
  17288. source: 'html',
  17289. selector: 'figcaption'
  17290. },
  17291. href: {
  17292. type: 'string',
  17293. source: 'attribute',
  17294. selector: 'figure > a',
  17295. attribute: 'href'
  17296. },
  17297. rel: {
  17298. type: 'string',
  17299. source: 'attribute',
  17300. selector: 'figure > a',
  17301. attribute: 'rel'
  17302. },
  17303. linkClass: {
  17304. type: 'string',
  17305. source: 'attribute',
  17306. selector: 'figure > a',
  17307. attribute: 'class'
  17308. },
  17309. id: {
  17310. type: 'number'
  17311. },
  17312. width: {
  17313. type: 'number'
  17314. },
  17315. height: {
  17316. type: 'number'
  17317. },
  17318. linkDestination: {
  17319. type: 'string'
  17320. },
  17321. linkTarget: {
  17322. type: 'string',
  17323. source: 'attribute',
  17324. selector: 'figure > a',
  17325. attribute: 'target'
  17326. }
  17327. };
  17328. const deprecated_blockSupports = {
  17329. anchor: true,
  17330. color: {
  17331. __experimentalDuotone: 'img',
  17332. text: false,
  17333. background: false
  17334. },
  17335. __experimentalBorder: {
  17336. radius: true,
  17337. __experimentalDefaultControls: {
  17338. radius: true
  17339. }
  17340. }
  17341. };
  17342. const image_deprecated_deprecated = [{
  17343. attributes: { ...image_deprecated_blockAttributes,
  17344. title: {
  17345. type: 'string',
  17346. source: 'attribute',
  17347. selector: 'img',
  17348. attribute: 'title'
  17349. },
  17350. sizeSlug: {
  17351. type: 'string'
  17352. }
  17353. },
  17354. supports: deprecated_blockSupports,
  17355. save(_ref) {
  17356. let {
  17357. attributes
  17358. } = _ref;
  17359. const {
  17360. url,
  17361. alt,
  17362. caption,
  17363. align,
  17364. href,
  17365. rel,
  17366. linkClass,
  17367. width,
  17368. height,
  17369. id,
  17370. linkTarget,
  17371. sizeSlug,
  17372. title
  17373. } = attributes;
  17374. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  17375. const classes = classnames_default()({
  17376. [`align${align}`]: align,
  17377. [`size-${sizeSlug}`]: sizeSlug,
  17378. 'is-resized': width || height
  17379. });
  17380. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  17381. src: url,
  17382. alt: alt,
  17383. className: id ? `wp-image-${id}` : null,
  17384. width: width,
  17385. height: height,
  17386. title: title
  17387. });
  17388. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17389. className: linkClass,
  17390. href: href,
  17391. target: linkTarget,
  17392. rel: newRel
  17393. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17394. tagName: "figcaption",
  17395. value: caption
  17396. }));
  17397. if ('left' === align || 'right' === align || 'center' === align) {
  17398. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("figure", {
  17399. className: classes
  17400. }, figure));
  17401. }
  17402. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  17403. className: classes
  17404. }), figure);
  17405. }
  17406. }, {
  17407. attributes: image_deprecated_blockAttributes,
  17408. save(_ref2) {
  17409. let {
  17410. attributes
  17411. } = _ref2;
  17412. const {
  17413. url,
  17414. alt,
  17415. caption,
  17416. align,
  17417. href,
  17418. width,
  17419. height,
  17420. id
  17421. } = attributes;
  17422. const classes = classnames_default()({
  17423. [`align${align}`]: align,
  17424. 'is-resized': width || height
  17425. });
  17426. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  17427. src: url,
  17428. alt: alt,
  17429. className: id ? `wp-image-${id}` : null,
  17430. width: width,
  17431. height: height
  17432. });
  17433. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  17434. className: classes
  17435. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17436. href: href
  17437. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17438. tagName: "figcaption",
  17439. value: caption
  17440. }));
  17441. }
  17442. }, {
  17443. attributes: image_deprecated_blockAttributes,
  17444. save(_ref3) {
  17445. let {
  17446. attributes
  17447. } = _ref3;
  17448. const {
  17449. url,
  17450. alt,
  17451. caption,
  17452. align,
  17453. href,
  17454. width,
  17455. height,
  17456. id
  17457. } = attributes;
  17458. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  17459. src: url,
  17460. alt: alt,
  17461. className: id ? `wp-image-${id}` : null,
  17462. width: width,
  17463. height: height
  17464. });
  17465. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  17466. className: align ? `align${align}` : null
  17467. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17468. href: href
  17469. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17470. tagName: "figcaption",
  17471. value: caption
  17472. }));
  17473. }
  17474. }, {
  17475. attributes: image_deprecated_blockAttributes,
  17476. save(_ref4) {
  17477. let {
  17478. attributes
  17479. } = _ref4;
  17480. const {
  17481. url,
  17482. alt,
  17483. caption,
  17484. align,
  17485. href,
  17486. width,
  17487. height
  17488. } = attributes;
  17489. const extraImageProps = width || height ? {
  17490. width,
  17491. height
  17492. } : {};
  17493. const image = (0,external_wp_element_namespaceObject.createElement)("img", _extends({
  17494. src: url,
  17495. alt: alt
  17496. }, extraImageProps));
  17497. let figureStyle = {};
  17498. if (width) {
  17499. figureStyle = {
  17500. width
  17501. };
  17502. } else if (align === 'left' || align === 'right') {
  17503. figureStyle = {
  17504. maxWidth: '50%'
  17505. };
  17506. }
  17507. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  17508. className: align ? `align${align}` : null,
  17509. style: figureStyle
  17510. }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  17511. href: href
  17512. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  17513. tagName: "figcaption",
  17514. value: caption
  17515. }));
  17516. }
  17517. }];
  17518. /* harmony default export */ var image_deprecated = (image_deprecated_deprecated);
  17519. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js
  17520. /**
  17521. * WordPress dependencies
  17522. */
  17523. const crop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17524. xmlns: "http://www.w3.org/2000/svg",
  17525. viewBox: "0 0 24 24"
  17526. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17527. d: "M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"
  17528. }));
  17529. /* harmony default export */ var library_crop = (crop);
  17530. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
  17531. /**
  17532. * WordPress dependencies
  17533. */
  17534. const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17535. xmlns: "http://www.w3.org/2000/svg",
  17536. viewBox: "0 0 24 24"
  17537. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17538. d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
  17539. }));
  17540. /* harmony default export */ var library_upload = (upload);
  17541. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/overlay-text.js
  17542. /**
  17543. * WordPress dependencies
  17544. */
  17545. const overlayText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  17546. xmlns: "http://www.w3.org/2000/svg",
  17547. viewBox: "0 0 24 24"
  17548. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  17549. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"
  17550. }));
  17551. /* harmony default export */ var overlay_text = (overlayText);
  17552. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js
  17553. /**
  17554. * WordPress dependencies
  17555. */
  17556. function useClientWidth(ref, dependencies) {
  17557. const [clientWidth, setClientWidth] = (0,external_wp_element_namespaceObject.useState)();
  17558. function calculateClientWidth() {
  17559. setClientWidth(ref.current.clientWidth);
  17560. }
  17561. (0,external_wp_element_namespaceObject.useEffect)(calculateClientWidth, dependencies);
  17562. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17563. const {
  17564. defaultView
  17565. } = ref.current.ownerDocument;
  17566. defaultView.addEventListener('resize', calculateClientWidth);
  17567. return () => {
  17568. defaultView.removeEventListener('resize', calculateClientWidth);
  17569. };
  17570. }, []);
  17571. return clientWidth;
  17572. }
  17573. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js
  17574. /**
  17575. * External dependencies
  17576. */
  17577. /**
  17578. * WordPress dependencies
  17579. */
  17580. /**
  17581. * Internal dependencies
  17582. */
  17583. /**
  17584. * Module constants
  17585. */
  17586. function Image(_ref) {
  17587. var _imageRef$current3;
  17588. let {
  17589. temporaryURL,
  17590. attributes: {
  17591. url = '',
  17592. alt,
  17593. caption,
  17594. align,
  17595. id,
  17596. href,
  17597. rel,
  17598. linkClass,
  17599. linkDestination,
  17600. title,
  17601. width,
  17602. height,
  17603. linkTarget,
  17604. sizeSlug
  17605. },
  17606. setAttributes,
  17607. isSelected,
  17608. insertBlocksAfter,
  17609. onReplace,
  17610. onSelectImage,
  17611. onSelectURL,
  17612. onUploadError,
  17613. containerRef,
  17614. context,
  17615. clientId
  17616. } = _ref;
  17617. const imageRef = (0,external_wp_element_namespaceObject.useRef)();
  17618. const captionRef = (0,external_wp_element_namespaceObject.useRef)();
  17619. const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url);
  17620. const {
  17621. allowResize = true
  17622. } = context;
  17623. const {
  17624. getBlock
  17625. } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
  17626. const {
  17627. image,
  17628. multiImageSelection
  17629. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17630. const {
  17631. getMedia
  17632. } = select(external_wp_coreData_namespaceObject.store);
  17633. const {
  17634. getMultiSelectedBlockClientIds,
  17635. getBlockName
  17636. } = select(external_wp_blockEditor_namespaceObject.store);
  17637. const multiSelectedClientIds = getMultiSelectedBlockClientIds();
  17638. return {
  17639. image: id && isSelected ? getMedia(id, {
  17640. context: 'view'
  17641. }) : null,
  17642. multiImageSelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/image')
  17643. };
  17644. }, [id, isSelected]);
  17645. const {
  17646. canInsertCover,
  17647. imageEditing,
  17648. imageSizes,
  17649. maxWidth,
  17650. mediaUpload
  17651. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  17652. const {
  17653. getBlockRootClientId,
  17654. getSettings,
  17655. canInsertBlockType
  17656. } = select(external_wp_blockEditor_namespaceObject.store);
  17657. const rootClientId = getBlockRootClientId(clientId);
  17658. const settings = (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']);
  17659. return { ...settings,
  17660. canInsertCover: canInsertBlockType('core/cover', rootClientId)
  17661. };
  17662. }, [clientId]);
  17663. const {
  17664. replaceBlocks,
  17665. toggleSelection
  17666. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  17667. const {
  17668. createErrorNotice,
  17669. createSuccessNotice
  17670. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  17671. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  17672. const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
  17673. const [{
  17674. loadedNaturalWidth,
  17675. loadedNaturalHeight
  17676. }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
  17677. const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
  17678. const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)();
  17679. const clientWidth = useClientWidth(containerRef, [align]);
  17680. const isResizable = allowResize && !(isWideAligned && isLargeViewport);
  17681. const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
  17682. let {
  17683. slug
  17684. } = _ref2;
  17685. return (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', slug, 'source_url']);
  17686. }), _ref3 => {
  17687. let {
  17688. name,
  17689. slug
  17690. } = _ref3;
  17691. return {
  17692. value: slug,
  17693. label: name
  17694. };
  17695. }); // If an image is externally hosted, try to fetch the image data. This may
  17696. // fail if the image host doesn't allow CORS with the domain. If it works,
  17697. // we can enable a button in the toolbar to upload the image.
  17698. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17699. if (!isExternalImage(id, url) || !isSelected || externalBlob) {
  17700. return;
  17701. }
  17702. window.fetch(url).then(response => response.blob()).then(blob => setExternalBlob(blob)) // Do nothing, cannot upload.
  17703. .catch(() => {});
  17704. }, [id, url, isSelected, externalBlob]); // Focus the caption after inserting an image from the placeholder. This is
  17705. // done to preserve the behaviour of focussing the first tabbable element
  17706. // when a block is mounted. Previously, the image block would remount when
  17707. // the placeholder is removed. Maybe this behaviour could be removed.
  17708. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17709. if (url && !prevUrl && isSelected) {
  17710. captionRef.current.focus();
  17711. }
  17712. }, [url, prevUrl]); // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
  17713. // width and height. This resolves an issue in Safari where the loaded natural
  17714. // witdth and height is otherwise lost when switching between alignments.
  17715. // See: https://github.com/WordPress/gutenberg/pull/37210.
  17716. const {
  17717. naturalWidth,
  17718. naturalHeight
  17719. } = (0,external_wp_element_namespaceObject.useMemo)(() => {
  17720. var _imageRef$current, _imageRef$current2;
  17721. return {
  17722. naturalWidth: ((_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalWidth) || loadedNaturalWidth || undefined,
  17723. naturalHeight: ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.naturalHeight) || loadedNaturalHeight || undefined
  17724. };
  17725. }, [loadedNaturalWidth, loadedNaturalHeight, (_imageRef$current3 = imageRef.current) === null || _imageRef$current3 === void 0 ? void 0 : _imageRef$current3.complete]);
  17726. function onResizeStart() {
  17727. toggleSelection(false);
  17728. }
  17729. function onResizeStop() {
  17730. toggleSelection(true);
  17731. }
  17732. function onImageError() {
  17733. // Check if there's an embed block that handles this URL.
  17734. const embedBlock = createUpgradedEmbedBlock({
  17735. attributes: {
  17736. url
  17737. }
  17738. });
  17739. if (undefined !== embedBlock) {
  17740. onReplace(embedBlock);
  17741. }
  17742. }
  17743. function onSetHref(props) {
  17744. setAttributes(props);
  17745. }
  17746. function onSetTitle(value) {
  17747. // This is the HTML title attribute, separate from the media object
  17748. // title.
  17749. setAttributes({
  17750. title: value
  17751. });
  17752. }
  17753. function updateAlt(newAlt) {
  17754. setAttributes({
  17755. alt: newAlt
  17756. });
  17757. }
  17758. function updateImage(newSizeSlug) {
  17759. const newUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', newSizeSlug, 'source_url']);
  17760. if (!newUrl) {
  17761. return null;
  17762. }
  17763. setAttributes({
  17764. url: newUrl,
  17765. width: undefined,
  17766. height: undefined,
  17767. sizeSlug: newSizeSlug
  17768. });
  17769. }
  17770. function uploadExternal() {
  17771. mediaUpload({
  17772. filesList: [externalBlob],
  17773. onFileChange(_ref4) {
  17774. let [img] = _ref4;
  17775. onSelectImage(img);
  17776. if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) {
  17777. return;
  17778. }
  17779. setExternalBlob();
  17780. createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), {
  17781. type: 'snackbar'
  17782. });
  17783. },
  17784. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  17785. onError(message) {
  17786. createErrorNotice(message, {
  17787. type: 'snackbar'
  17788. });
  17789. }
  17790. });
  17791. }
  17792. function updateAlignment(nextAlign) {
  17793. const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
  17794. width: undefined,
  17795. height: undefined
  17796. } : {};
  17797. setAttributes({ ...extraUpdatedAttributes,
  17798. align: nextAlign
  17799. });
  17800. }
  17801. (0,external_wp_element_namespaceObject.useEffect)(() => {
  17802. if (!isSelected) {
  17803. setIsEditingImage(false);
  17804. }
  17805. }, [isSelected]);
  17806. const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
  17807. const allowCrop = !multiImageSelection && canEditImage && !isEditingImage;
  17808. function switchToCover() {
  17809. replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover'));
  17810. }
  17811. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  17812. group: "block"
  17813. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
  17814. value: align,
  17815. onChange: updateAlignment
  17816. }), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
  17817. url: href || '',
  17818. onChangeUrl: onSetHref,
  17819. linkDestination: linkDestination,
  17820. mediaUrl: image && image.source_url || url,
  17821. mediaLink: image && image.link,
  17822. linkTarget: linkTarget,
  17823. linkClass: linkClass,
  17824. rel: rel
  17825. }), allowCrop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17826. onClick: () => setIsEditingImage(true),
  17827. icon: library_crop,
  17828. label: (0,external_wp_i18n_namespaceObject.__)('Crop')
  17829. }), externalBlob && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17830. onClick: uploadExternal,
  17831. icon: library_upload,
  17832. label: (0,external_wp_i18n_namespaceObject.__)('Upload external image')
  17833. }), !multiImageSelection && canInsertCover && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  17834. icon: overlay_text,
  17835. label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'),
  17836. onClick: switchToCover
  17837. })), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  17838. group: "other"
  17839. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  17840. mediaId: id,
  17841. mediaURL: url,
  17842. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  17843. accept: "image/*",
  17844. onSelect: onSelectImage,
  17845. onSelectURL: onSelectURL,
  17846. onError: onUploadError
  17847. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  17848. title: (0,external_wp_i18n_namespaceObject.__)('Image settings')
  17849. }, !multiImageSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  17850. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  17851. value: alt,
  17852. onChange: updateAlt,
  17853. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  17854. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  17855. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  17856. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  17857. onChangeImage: updateImage,
  17858. onChange: value => setAttributes(value),
  17859. slug: sizeSlug,
  17860. width: width,
  17861. height: height,
  17862. imageSizeOptions: imageSizeOptions,
  17863. isResizable: isResizable,
  17864. imageWidth: naturalWidth,
  17865. imageHeight: naturalHeight
  17866. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  17867. __experimentalGroup: "advanced"
  17868. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  17869. label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'),
  17870. value: title || '',
  17871. onChange: onSetTitle,
  17872. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  17873. href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute"
  17874. }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)')))
  17875. })));
  17876. const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
  17877. let defaultedAlt;
  17878. if (alt) {
  17879. defaultedAlt = alt;
  17880. } else if (filename) {
  17881. defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(
  17882. /* translators: %s: file name */
  17883. (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename);
  17884. } else {
  17885. defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute');
  17886. }
  17887. let img = // Disable reason: Image itself is not meant to be interactive, but
  17888. // should direct focus to block.
  17889. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  17890. (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("img", {
  17891. src: temporaryURL || url,
  17892. alt: defaultedAlt,
  17893. onError: () => onImageError(),
  17894. onLoad: event => {
  17895. var _event$target, _event$target2;
  17896. setLoadedNaturalSize({
  17897. loadedNaturalWidth: (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.naturalWidth,
  17898. loadedNaturalHeight: (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.naturalHeight
  17899. });
  17900. },
  17901. ref: imageRef
  17902. }), temporaryURL && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
  17903. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  17904. ;
  17905. let imageWidthWithinContainer;
  17906. let imageHeightWithinContainer;
  17907. if (clientWidth && naturalWidth && naturalHeight) {
  17908. const exceedMaxWidth = naturalWidth > clientWidth;
  17909. const ratio = naturalHeight / naturalWidth;
  17910. imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  17911. imageHeightWithinContainer = exceedMaxWidth ? clientWidth * ratio : naturalHeight;
  17912. }
  17913. if (canEditImage && isEditingImage) {
  17914. img = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
  17915. url: url,
  17916. width: width,
  17917. height: height,
  17918. clientWidth: clientWidth,
  17919. naturalHeight: naturalHeight,
  17920. naturalWidth: naturalWidth
  17921. });
  17922. } else if (!isResizable || !imageWidthWithinContainer) {
  17923. img = (0,external_wp_element_namespaceObject.createElement)("div", {
  17924. style: {
  17925. width,
  17926. height
  17927. }
  17928. }, img);
  17929. } else {
  17930. const currentWidth = width || imageWidthWithinContainer;
  17931. const currentHeight = height || imageHeightWithinContainer;
  17932. const ratio = naturalWidth / naturalHeight;
  17933. const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;
  17934. const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio; // With the current implementation of ResizableBox, an image needs an
  17935. // explicit pixel value for the max-width. In absence of being able to
  17936. // set the content-width, this max-width is currently dictated by the
  17937. // vanilla editor style. The following variable adds a buffer to this
  17938. // vanilla style, so 3rd party themes have some wiggleroom. This does,
  17939. // in most cases, allow you to scale the image beyond the width of the
  17940. // main column, though not infinitely.
  17941. // @todo It would be good to revisit this once a content-width variable
  17942. // becomes available.
  17943. const maxWidthBuffer = maxWidth * 2.5;
  17944. let showRightHandle = false;
  17945. let showLeftHandle = false;
  17946. /* eslint-disable no-lonely-if */
  17947. // See https://github.com/WordPress/gutenberg/issues/7584.
  17948. if (align === 'center') {
  17949. // When the image is centered, show both handles.
  17950. showRightHandle = true;
  17951. showLeftHandle = true;
  17952. } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
  17953. // In RTL mode the image is on the right by default.
  17954. // Show the right handle and hide the left handle only when it is
  17955. // aligned left. Otherwise always show the left handle.
  17956. if (align === 'left') {
  17957. showRightHandle = true;
  17958. } else {
  17959. showLeftHandle = true;
  17960. }
  17961. } else {
  17962. // Show the left handle and hide the right handle only when the
  17963. // image is aligned right. Otherwise always show the right handle.
  17964. if (align === 'right') {
  17965. showLeftHandle = true;
  17966. } else {
  17967. showRightHandle = true;
  17968. }
  17969. }
  17970. /* eslint-enable no-lonely-if */
  17971. img = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  17972. size: {
  17973. width: width !== null && width !== void 0 ? width : 'auto',
  17974. height: height !== null && height !== void 0 ? height : 'auto'
  17975. },
  17976. showHandle: isSelected,
  17977. minWidth: minWidth,
  17978. maxWidth: maxWidthBuffer,
  17979. minHeight: minHeight,
  17980. maxHeight: maxWidthBuffer / ratio,
  17981. lockAspectRatio: true,
  17982. enable: {
  17983. top: false,
  17984. right: showRightHandle,
  17985. bottom: true,
  17986. left: showLeftHandle
  17987. },
  17988. onResizeStart: onResizeStart,
  17989. onResizeStop: (event, direction, elt, delta) => {
  17990. onResizeStop();
  17991. setAttributes({
  17992. width: parseInt(currentWidth + delta.width, 10),
  17993. height: parseInt(currentHeight + delta.height, 10)
  17994. });
  17995. }
  17996. }, img);
  17997. }
  17998. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
  17999. id: id,
  18000. url: url,
  18001. naturalWidth: naturalWidth,
  18002. naturalHeight: naturalHeight,
  18003. clientWidth: clientWidth,
  18004. onSaveImage: imageAttributes => setAttributes(imageAttributes),
  18005. isEditing: isEditingImage,
  18006. onFinishEditing: () => setIsEditingImage(false)
  18007. }, !temporaryURL && controls, img, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  18008. ref: captionRef,
  18009. tagName: "figcaption",
  18010. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image caption text'),
  18011. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  18012. value: caption,
  18013. onChange: value => setAttributes({
  18014. caption: value
  18015. }),
  18016. inlineToolbar: true,
  18017. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  18018. }));
  18019. }
  18020. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js
  18021. /**
  18022. * External dependencies
  18023. */
  18024. /**
  18025. * WordPress dependencies
  18026. */
  18027. /* global wp */
  18028. /**
  18029. * Internal dependencies
  18030. */
  18031. /**
  18032. * Module constants
  18033. */
  18034. const edit_pickRelevantMediaFiles = (image, size) => {
  18035. const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
  18036. imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', size, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']) || image.url;
  18037. return imageProps;
  18038. };
  18039. /**
  18040. * Is the URL a temporary blob URL? A blob URL is one that is used temporarily
  18041. * while the image is being uploaded and will not have an id yet allocated.
  18042. *
  18043. * @param {number=} id The id of the image.
  18044. * @param {string=} url The url of the image.
  18045. *
  18046. * @return {boolean} Is the URL a Blob URL
  18047. */
  18048. const edit_isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
  18049. /**
  18050. * Is the url for the image hosted externally. An externally hosted image has no
  18051. * id and is not a blob url.
  18052. *
  18053. * @param {number=} id The id of the image.
  18054. * @param {string=} url The url of the image.
  18055. *
  18056. * @return {boolean} Is the url an externally hosted url?
  18057. */
  18058. const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url);
  18059. /**
  18060. * Checks if WP generated default image size. Size generation is skipped
  18061. * when the image is smaller than the said size.
  18062. *
  18063. * @param {Object} image
  18064. * @param {string} defaultSize
  18065. *
  18066. * @return {boolean} Whether or not it has default image size.
  18067. */
  18068. function hasDefaultSize(image, defaultSize) {
  18069. return (0,external_lodash_namespaceObject.has)(image, ['sizes', defaultSize, 'url']) || (0,external_lodash_namespaceObject.has)(image, ['media_details', 'sizes', defaultSize, 'source_url']);
  18070. }
  18071. function ImageEdit(_ref) {
  18072. let {
  18073. attributes,
  18074. setAttributes,
  18075. isSelected,
  18076. className,
  18077. noticeUI,
  18078. insertBlocksAfter,
  18079. noticeOperations,
  18080. onReplace,
  18081. context,
  18082. clientId
  18083. } = _ref;
  18084. const {
  18085. url = '',
  18086. alt,
  18087. caption,
  18088. align,
  18089. id,
  18090. width,
  18091. height,
  18092. sizeSlug
  18093. } = attributes;
  18094. const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
  18095. const altRef = (0,external_wp_element_namespaceObject.useRef)();
  18096. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18097. altRef.current = alt;
  18098. }, [alt]);
  18099. const captionRef = (0,external_wp_element_namespaceObject.useRef)();
  18100. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18101. captionRef.current = caption;
  18102. }, [caption]);
  18103. const ref = (0,external_wp_element_namespaceObject.useRef)();
  18104. const {
  18105. imageDefaultSize,
  18106. mediaUpload
  18107. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  18108. const {
  18109. getSettings
  18110. } = select(external_wp_blockEditor_namespaceObject.store);
  18111. return (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageDefaultSize', 'mediaUpload']);
  18112. }, []);
  18113. function onUploadError(message) {
  18114. noticeOperations.removeAllNotices();
  18115. noticeOperations.createErrorNotice(message);
  18116. setAttributes({
  18117. src: undefined,
  18118. id: undefined,
  18119. url: undefined
  18120. });
  18121. setTemporaryURL(undefined);
  18122. }
  18123. function onSelectImage(media) {
  18124. var _wp, _wp$media, _wp$media$view, _wp$media$view$settin, _wp$media$view$settin2;
  18125. if (!media || !media.url) {
  18126. setAttributes({
  18127. url: undefined,
  18128. alt: undefined,
  18129. id: undefined,
  18130. title: undefined,
  18131. caption: undefined
  18132. });
  18133. return;
  18134. }
  18135. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  18136. setTemporaryURL(media.url);
  18137. return;
  18138. }
  18139. setTemporaryURL();
  18140. let mediaAttributes = edit_pickRelevantMediaFiles(media, imageDefaultSize); // If a caption text was meanwhile written by the user,
  18141. // make sure the text is not overwritten by empty captions.
  18142. if (captionRef.current && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
  18143. mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
  18144. }
  18145. let additionalAttributes; // Reset the dimension attributes if changing to a different image.
  18146. if (!media.id || media.id !== id) {
  18147. additionalAttributes = {
  18148. width: undefined,
  18149. height: undefined,
  18150. // Fallback to size "full" if there's no default image size.
  18151. // It means the image is smaller, and the block will use a full-size URL.
  18152. sizeSlug: hasDefaultSize(media, imageDefaultSize) ? imageDefaultSize : 'full'
  18153. };
  18154. } else {
  18155. // Keep the same url when selecting the same file, so "Image Size"
  18156. // option is not changed.
  18157. additionalAttributes = {
  18158. url
  18159. };
  18160. } // Check if default link setting should be used.
  18161. let linkDestination = attributes.linkDestination;
  18162. if (!linkDestination) {
  18163. // Use the WordPress option to determine the proper default.
  18164. // The constants used in Gutenberg do not match WP options so a little more complicated than ideal.
  18165. // TODO: fix this in a follow up PR, requires updating media-text and ui component.
  18166. switch (((_wp = wp) === null || _wp === void 0 ? void 0 : (_wp$media = _wp.media) === null || _wp$media === void 0 ? void 0 : (_wp$media$view = _wp$media.view) === null || _wp$media$view === void 0 ? void 0 : (_wp$media$view$settin = _wp$media$view.settings) === null || _wp$media$view$settin === void 0 ? void 0 : (_wp$media$view$settin2 = _wp$media$view$settin.defaultProps) === null || _wp$media$view$settin2 === void 0 ? void 0 : _wp$media$view$settin2.link) || constants_LINK_DESTINATION_NONE) {
  18167. case 'file':
  18168. case constants_LINK_DESTINATION_MEDIA:
  18169. linkDestination = constants_LINK_DESTINATION_MEDIA;
  18170. break;
  18171. case 'post':
  18172. case constants_LINK_DESTINATION_ATTACHMENT:
  18173. linkDestination = constants_LINK_DESTINATION_ATTACHMENT;
  18174. break;
  18175. case LINK_DESTINATION_CUSTOM:
  18176. linkDestination = LINK_DESTINATION_CUSTOM;
  18177. break;
  18178. case constants_LINK_DESTINATION_NONE:
  18179. linkDestination = constants_LINK_DESTINATION_NONE;
  18180. break;
  18181. }
  18182. } // Check if the image is linked to it's media.
  18183. let href;
  18184. switch (linkDestination) {
  18185. case constants_LINK_DESTINATION_MEDIA:
  18186. href = media.url;
  18187. break;
  18188. case constants_LINK_DESTINATION_ATTACHMENT:
  18189. href = media.link;
  18190. break;
  18191. }
  18192. mediaAttributes.href = href;
  18193. setAttributes({ ...mediaAttributes,
  18194. ...additionalAttributes,
  18195. linkDestination
  18196. });
  18197. }
  18198. function onSelectURL(newURL) {
  18199. if (newURL !== url) {
  18200. setAttributes({
  18201. url: newURL,
  18202. id: undefined,
  18203. width: undefined,
  18204. height: undefined,
  18205. sizeSlug: imageDefaultSize
  18206. });
  18207. }
  18208. }
  18209. function updateAlignment(nextAlign) {
  18210. const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
  18211. width: undefined,
  18212. height: undefined
  18213. } : {};
  18214. setAttributes({ ...extraUpdatedAttributes,
  18215. align: nextAlign
  18216. });
  18217. }
  18218. let isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount.
  18219. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18220. if (!isTemp) {
  18221. return;
  18222. }
  18223. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
  18224. if (file) {
  18225. mediaUpload({
  18226. filesList: [file],
  18227. onFileChange: _ref2 => {
  18228. let [img] = _ref2;
  18229. onSelectImage(img);
  18230. },
  18231. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  18232. onError: message => {
  18233. isTemp = false;
  18234. onUploadError(message);
  18235. }
  18236. });
  18237. }
  18238. }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is
  18239. // no longer temporary).
  18240. (0,external_wp_element_namespaceObject.useEffect)(() => {
  18241. if (isTemp) {
  18242. setTemporaryURL(url);
  18243. return;
  18244. }
  18245. (0,external_wp_blob_namespaceObject.revokeBlobURL)(temporaryURL);
  18246. }, [isTemp, url]);
  18247. const isExternal = isExternalImage(id, url);
  18248. const src = isExternal ? url : undefined;
  18249. const mediaPreview = !!url && (0,external_wp_element_namespaceObject.createElement)("img", {
  18250. alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
  18251. title: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
  18252. className: 'edit-image-preview',
  18253. src: url
  18254. });
  18255. const classes = classnames_default()(className, {
  18256. 'is-transient': temporaryURL,
  18257. 'is-resized': !!width || !!height,
  18258. [`size-${sizeSlug}`]: sizeSlug
  18259. });
  18260. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  18261. ref,
  18262. className: classes
  18263. });
  18264. return (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (temporaryURL || url) && (0,external_wp_element_namespaceObject.createElement)(Image, {
  18265. temporaryURL: temporaryURL,
  18266. attributes: attributes,
  18267. setAttributes: setAttributes,
  18268. isSelected: isSelected,
  18269. insertBlocksAfter: insertBlocksAfter,
  18270. onReplace: onReplace,
  18271. onSelectImage: onSelectImage,
  18272. onSelectURL: onSelectURL,
  18273. onUploadError: onUploadError,
  18274. containerRef: ref,
  18275. context: context,
  18276. clientId: clientId
  18277. }), !url && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  18278. group: "block"
  18279. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
  18280. value: align,
  18281. onChange: updateAlignment
  18282. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  18283. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  18284. icon: library_image
  18285. }),
  18286. onSelect: onSelectImage,
  18287. onSelectURL: onSelectURL,
  18288. notices: noticeUI,
  18289. onError: onUploadError,
  18290. accept: "image/*",
  18291. allowedTypes: constants_ALLOWED_MEDIA_TYPES,
  18292. value: {
  18293. id,
  18294. src
  18295. },
  18296. mediaPreview: mediaPreview,
  18297. disableMediaButtons: temporaryURL || url
  18298. }));
  18299. }
  18300. /* harmony default export */ var image_edit = ((0,external_wp_components_namespaceObject.withNotices)(ImageEdit));
  18301. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js
  18302. /**
  18303. * External dependencies
  18304. */
  18305. /**
  18306. * WordPress dependencies
  18307. */
  18308. function image_save_save(_ref) {
  18309. let {
  18310. attributes
  18311. } = _ref;
  18312. const {
  18313. url,
  18314. alt,
  18315. caption,
  18316. align,
  18317. href,
  18318. rel,
  18319. linkClass,
  18320. width,
  18321. height,
  18322. id,
  18323. linkTarget,
  18324. sizeSlug,
  18325. title
  18326. } = attributes;
  18327. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  18328. const classes = classnames_default()({
  18329. [`align${align}`]: align,
  18330. [`size-${sizeSlug}`]: sizeSlug,
  18331. 'is-resized': width || height
  18332. });
  18333. const image = (0,external_wp_element_namespaceObject.createElement)("img", {
  18334. src: url,
  18335. alt: alt,
  18336. className: id ? `wp-image-${id}` : null,
  18337. width: width,
  18338. height: height,
  18339. title: title
  18340. });
  18341. const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
  18342. className: linkClass,
  18343. href: href,
  18344. target: linkTarget,
  18345. rel: newRel
  18346. }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  18347. tagName: "figcaption",
  18348. value: caption
  18349. }));
  18350. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  18351. className: classes
  18352. }), figure);
  18353. }
  18354. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js
  18355. /**
  18356. * External dependencies
  18357. */
  18358. /**
  18359. * WordPress dependencies
  18360. */
  18361. function stripFirstImage(attributes, _ref) {
  18362. let {
  18363. shortcode
  18364. } = _ref;
  18365. const {
  18366. body
  18367. } = document.implementation.createHTMLDocument('');
  18368. body.innerHTML = shortcode.content;
  18369. let nodeToRemove = body.querySelector('img'); // If an image has parents, find the topmost node to remove.
  18370. while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) {
  18371. nodeToRemove = nodeToRemove.parentNode;
  18372. }
  18373. if (nodeToRemove) {
  18374. nodeToRemove.parentNode.removeChild(nodeToRemove);
  18375. }
  18376. return body.innerHTML.trim();
  18377. }
  18378. function getFirstAnchorAttributeFormHTML(html, attributeName) {
  18379. const {
  18380. body
  18381. } = document.implementation.createHTMLDocument('');
  18382. body.innerHTML = html;
  18383. const {
  18384. firstElementChild
  18385. } = body;
  18386. if (firstElementChild && firstElementChild.nodeName === 'A') {
  18387. return firstElementChild.getAttribute(attributeName) || undefined;
  18388. }
  18389. }
  18390. const imageSchema = {
  18391. img: {
  18392. attributes: ['src', 'alt', 'title'],
  18393. classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/]
  18394. }
  18395. };
  18396. const schema = _ref2 => {
  18397. let {
  18398. phrasingContentSchema
  18399. } = _ref2;
  18400. return {
  18401. figure: {
  18402. require: ['img'],
  18403. children: { ...imageSchema,
  18404. a: {
  18405. attributes: ['href', 'rel', 'target'],
  18406. children: imageSchema
  18407. },
  18408. figcaption: {
  18409. children: phrasingContentSchema
  18410. }
  18411. }
  18412. }
  18413. };
  18414. };
  18415. const image_transforms_transforms = {
  18416. from: [{
  18417. type: 'raw',
  18418. isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'),
  18419. schema,
  18420. transform: node => {
  18421. // Search both figure and image classes. Alignment could be
  18422. // set on either. ID is set on the image.
  18423. const className = node.className + ' ' + node.querySelector('img').className;
  18424. const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className);
  18425. const anchor = node.id === '' ? undefined : node.id;
  18426. const align = alignMatches ? alignMatches[1] : undefined;
  18427. const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className);
  18428. const id = idMatches ? Number(idMatches[1]) : undefined;
  18429. const anchorElement = node.querySelector('a');
  18430. const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined;
  18431. const href = anchorElement && anchorElement.href ? anchorElement.href : undefined;
  18432. const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined;
  18433. const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined;
  18434. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, {
  18435. align,
  18436. id,
  18437. linkDestination,
  18438. href,
  18439. rel,
  18440. linkClass,
  18441. anchor
  18442. });
  18443. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes);
  18444. }
  18445. }, {
  18446. // Note: when dragging and dropping multiple files onto a gallery this overrides the
  18447. // gallery transform in order to add new images to the gallery instead of
  18448. // creating a new gallery.
  18449. type: 'files',
  18450. isMatch(files) {
  18451. // The following check is intended to catch non-image files when dropped together with images.
  18452. if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) {
  18453. const {
  18454. createErrorNotice
  18455. } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
  18456. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
  18457. id: 'gallery-transform-invalid-file'
  18458. });
  18459. }
  18460. return (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
  18461. },
  18462. transform(files) {
  18463. const blocks = files.map(file => {
  18464. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  18465. url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  18466. });
  18467. });
  18468. return blocks;
  18469. }
  18470. }, {
  18471. type: 'shortcode',
  18472. tag: 'caption',
  18473. attributes: {
  18474. url: {
  18475. type: 'string',
  18476. source: 'attribute',
  18477. attribute: 'src',
  18478. selector: 'img'
  18479. },
  18480. alt: {
  18481. type: 'string',
  18482. source: 'attribute',
  18483. attribute: 'alt',
  18484. selector: 'img'
  18485. },
  18486. caption: {
  18487. shortcode: stripFirstImage
  18488. },
  18489. href: {
  18490. shortcode: (attributes, _ref3) => {
  18491. let {
  18492. shortcode
  18493. } = _ref3;
  18494. return getFirstAnchorAttributeFormHTML(shortcode.content, 'href');
  18495. }
  18496. },
  18497. rel: {
  18498. shortcode: (attributes, _ref4) => {
  18499. let {
  18500. shortcode
  18501. } = _ref4;
  18502. return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel');
  18503. }
  18504. },
  18505. linkClass: {
  18506. shortcode: (attributes, _ref5) => {
  18507. let {
  18508. shortcode
  18509. } = _ref5;
  18510. return getFirstAnchorAttributeFormHTML(shortcode.content, 'class');
  18511. }
  18512. },
  18513. id: {
  18514. type: 'number',
  18515. shortcode: _ref6 => {
  18516. let {
  18517. named: {
  18518. id
  18519. }
  18520. } = _ref6;
  18521. if (!id) {
  18522. return;
  18523. }
  18524. return parseInt(id.replace('attachment_', ''), 10);
  18525. }
  18526. },
  18527. align: {
  18528. type: 'string',
  18529. shortcode: _ref7 => {
  18530. let {
  18531. named: {
  18532. align = 'alignnone'
  18533. }
  18534. } = _ref7;
  18535. return align.replace('align', '');
  18536. }
  18537. }
  18538. }
  18539. }]
  18540. };
  18541. /* harmony default export */ var image_transforms = (image_transforms_transforms);
  18542. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js
  18543. /**
  18544. * WordPress dependencies
  18545. */
  18546. /**
  18547. * Internal dependencies
  18548. */
  18549. const image_metadata = {
  18550. $schema: "https://schemas.wp.org/trunk/block.json",
  18551. apiVersion: 2,
  18552. name: "core/image",
  18553. title: "Image",
  18554. category: "media",
  18555. usesContext: ["allowResize", "imageCrop", "fixedHeight"],
  18556. description: "Insert an image to make a visual statement.",
  18557. keywords: ["img", "photo", "picture"],
  18558. textdomain: "default",
  18559. attributes: {
  18560. align: {
  18561. type: "string"
  18562. },
  18563. url: {
  18564. type: "string",
  18565. source: "attribute",
  18566. selector: "img",
  18567. attribute: "src"
  18568. },
  18569. alt: {
  18570. type: "string",
  18571. source: "attribute",
  18572. selector: "img",
  18573. attribute: "alt",
  18574. "default": ""
  18575. },
  18576. caption: {
  18577. type: "string",
  18578. source: "html",
  18579. selector: "figcaption"
  18580. },
  18581. title: {
  18582. type: "string",
  18583. source: "attribute",
  18584. selector: "img",
  18585. attribute: "title"
  18586. },
  18587. href: {
  18588. type: "string",
  18589. source: "attribute",
  18590. selector: "figure > a",
  18591. attribute: "href"
  18592. },
  18593. rel: {
  18594. type: "string",
  18595. source: "attribute",
  18596. selector: "figure > a",
  18597. attribute: "rel"
  18598. },
  18599. linkClass: {
  18600. type: "string",
  18601. source: "attribute",
  18602. selector: "figure > a",
  18603. attribute: "class"
  18604. },
  18605. id: {
  18606. type: "number"
  18607. },
  18608. width: {
  18609. type: "number"
  18610. },
  18611. height: {
  18612. type: "number"
  18613. },
  18614. sizeSlug: {
  18615. type: "string"
  18616. },
  18617. linkDestination: {
  18618. type: "string"
  18619. },
  18620. linkTarget: {
  18621. type: "string",
  18622. source: "attribute",
  18623. selector: "figure > a",
  18624. attribute: "target"
  18625. }
  18626. },
  18627. supports: {
  18628. anchor: true,
  18629. color: {
  18630. __experimentalDuotone: "img",
  18631. text: false,
  18632. background: false
  18633. },
  18634. __experimentalBorder: {
  18635. radius: true,
  18636. __experimentalDefaultControls: {
  18637. radius: true
  18638. }
  18639. }
  18640. },
  18641. styles: [{
  18642. name: "default",
  18643. label: "Default",
  18644. isDefault: true
  18645. }, {
  18646. name: "rounded",
  18647. label: "Rounded"
  18648. }],
  18649. editorStyle: "wp-block-image-editor",
  18650. style: "wp-block-image"
  18651. };
  18652. const {
  18653. name: image_name
  18654. } = image_metadata;
  18655. const image_settings = {
  18656. icon: library_image,
  18657. example: {
  18658. attributes: {
  18659. sizeSlug: 'large',
  18660. url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',
  18661. // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.
  18662. caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.')
  18663. }
  18664. },
  18665. __experimentalLabel(attributes, _ref) {
  18666. let {
  18667. context
  18668. } = _ref;
  18669. if (context === 'accessibility') {
  18670. const {
  18671. caption,
  18672. alt,
  18673. url
  18674. } = attributes;
  18675. if (!url) {
  18676. return (0,external_wp_i18n_namespaceObject.__)('Empty');
  18677. }
  18678. if (!alt) {
  18679. return caption || '';
  18680. } // This is intended to be read by a screen reader.
  18681. // A period simply means a pause, no need to translate it.
  18682. return alt + (caption ? '. ' + caption : '');
  18683. }
  18684. },
  18685. getEditWrapperProps(attributes) {
  18686. return {
  18687. 'data-align': attributes.align
  18688. };
  18689. },
  18690. transforms: image_transforms,
  18691. edit: image_edit,
  18692. save: image_save_save,
  18693. deprecated: image_deprecated
  18694. };
  18695. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js
  18696. /**
  18697. * WordPress dependencies
  18698. */
  18699. const comment = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18700. viewBox: "0 0 24 24",
  18701. xmlns: "http://www.w3.org/2000/svg"
  18702. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18703. d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"
  18704. }));
  18705. /* harmony default export */ var library_comment = (comment);
  18706. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js
  18707. /**
  18708. * WordPress dependencies
  18709. */
  18710. /**
  18711. * Minimum number of comments a user can show using this block.
  18712. *
  18713. * @type {number}
  18714. */
  18715. const MIN_COMMENTS = 1;
  18716. /**
  18717. * Maximum number of comments a user can show using this block.
  18718. *
  18719. * @type {number}
  18720. */
  18721. const MAX_COMMENTS = 100;
  18722. function LatestComments(_ref) {
  18723. let {
  18724. attributes,
  18725. setAttributes
  18726. } = _ref;
  18727. const {
  18728. commentsToShow,
  18729. displayAvatar,
  18730. displayDate,
  18731. displayExcerpt
  18732. } = attributes;
  18733. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  18734. title: (0,external_wp_i18n_namespaceObject.__)('Latest comments settings')
  18735. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  18736. label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'),
  18737. checked: displayAvatar,
  18738. onChange: () => setAttributes({
  18739. displayAvatar: !displayAvatar
  18740. })
  18741. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  18742. label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
  18743. checked: displayDate,
  18744. onChange: () => setAttributes({
  18745. displayDate: !displayDate
  18746. })
  18747. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  18748. label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
  18749. checked: displayExcerpt,
  18750. onChange: () => setAttributes({
  18751. displayExcerpt: !displayExcerpt
  18752. })
  18753. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  18754. label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'),
  18755. value: commentsToShow,
  18756. onChange: value => setAttributes({
  18757. commentsToShow: value
  18758. }),
  18759. min: MIN_COMMENTS,
  18760. max: MAX_COMMENTS,
  18761. required: true
  18762. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  18763. block: "core/latest-comments",
  18764. attributes: attributes // The preview uses the site's locale to make it more true to how
  18765. // the block appears on the frontend. Setting the locale
  18766. // explicitly prevents any middleware from setting it to 'user'.
  18767. ,
  18768. urlQueryArgs: {
  18769. _locale: 'site'
  18770. }
  18771. })));
  18772. }
  18773. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
  18774. /**
  18775. * WordPress dependencies
  18776. */
  18777. /**
  18778. * Internal dependencies
  18779. */
  18780. const latest_comments_metadata = {
  18781. $schema: "https://schemas.wp.org/trunk/block.json",
  18782. apiVersion: 2,
  18783. name: "core/latest-comments",
  18784. title: "Latest Comments",
  18785. category: "widgets",
  18786. description: "Display a list of your most recent comments.",
  18787. keywords: ["recent comments"],
  18788. textdomain: "default",
  18789. attributes: {
  18790. commentsToShow: {
  18791. type: "number",
  18792. "default": 5,
  18793. minimum: 1,
  18794. maximum: 100
  18795. },
  18796. displayAvatar: {
  18797. type: "boolean",
  18798. "default": true
  18799. },
  18800. displayDate: {
  18801. type: "boolean",
  18802. "default": true
  18803. },
  18804. displayExcerpt: {
  18805. type: "boolean",
  18806. "default": true
  18807. }
  18808. },
  18809. supports: {
  18810. align: true,
  18811. html: false
  18812. },
  18813. editorStyle: "wp-block-latest-comments-editor",
  18814. style: "wp-block-latest-comments"
  18815. };
  18816. const {
  18817. name: latest_comments_name
  18818. } = latest_comments_metadata;
  18819. const latest_comments_settings = {
  18820. icon: library_comment,
  18821. example: {},
  18822. edit: LatestComments
  18823. };
  18824. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js
  18825. /**
  18826. * WordPress dependencies
  18827. */
  18828. const postList = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18829. viewBox: "0 0 24 24",
  18830. xmlns: "http://www.w3.org/2000/svg"
  18831. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18832. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
  18833. }));
  18834. /* harmony default export */ var post_list = (postList);
  18835. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js
  18836. /**
  18837. * Internal dependencies
  18838. */
  18839. const latest_posts_deprecated_metadata = {
  18840. $schema: "https://schemas.wp.org/trunk/block.json",
  18841. apiVersion: 2,
  18842. name: "core/latest-posts",
  18843. title: "Latest Posts",
  18844. category: "widgets",
  18845. description: "Display a list of your most recent posts.",
  18846. keywords: ["recent posts"],
  18847. textdomain: "default",
  18848. attributes: {
  18849. categories: {
  18850. type: "array",
  18851. items: {
  18852. type: "object"
  18853. }
  18854. },
  18855. selectedAuthor: {
  18856. type: "number"
  18857. },
  18858. postsToShow: {
  18859. type: "number",
  18860. "default": 5
  18861. },
  18862. displayPostContent: {
  18863. type: "boolean",
  18864. "default": false
  18865. },
  18866. displayPostContentRadio: {
  18867. type: "string",
  18868. "default": "excerpt"
  18869. },
  18870. excerptLength: {
  18871. type: "number",
  18872. "default": 55
  18873. },
  18874. displayAuthor: {
  18875. type: "boolean",
  18876. "default": false
  18877. },
  18878. displayPostDate: {
  18879. type: "boolean",
  18880. "default": false
  18881. },
  18882. postLayout: {
  18883. type: "string",
  18884. "default": "list"
  18885. },
  18886. columns: {
  18887. type: "number",
  18888. "default": 3
  18889. },
  18890. order: {
  18891. type: "string",
  18892. "default": "desc"
  18893. },
  18894. orderBy: {
  18895. type: "string",
  18896. "default": "date"
  18897. },
  18898. displayFeaturedImage: {
  18899. type: "boolean",
  18900. "default": false
  18901. },
  18902. featuredImageAlign: {
  18903. type: "string",
  18904. "enum": ["left", "center", "right"]
  18905. },
  18906. featuredImageSizeSlug: {
  18907. type: "string",
  18908. "default": "thumbnail"
  18909. },
  18910. featuredImageSizeWidth: {
  18911. type: "number",
  18912. "default": null
  18913. },
  18914. featuredImageSizeHeight: {
  18915. type: "number",
  18916. "default": null
  18917. },
  18918. addLinkToFeaturedImage: {
  18919. type: "boolean",
  18920. "default": false
  18921. }
  18922. },
  18923. supports: {
  18924. align: true,
  18925. html: false
  18926. },
  18927. editorStyle: "wp-block-latest-posts-editor",
  18928. style: "wp-block-latest-posts"
  18929. };
  18930. const {
  18931. attributes: deprecated_attributes
  18932. } = latest_posts_deprecated_metadata;
  18933. /* harmony default export */ var latest_posts_deprecated = ([{
  18934. attributes: { ...deprecated_attributes,
  18935. categories: {
  18936. type: 'string'
  18937. }
  18938. },
  18939. supports: {
  18940. align: true,
  18941. html: false
  18942. },
  18943. migrate: oldAttributes => {
  18944. // This needs the full category object, not just the ID.
  18945. return { ...oldAttributes,
  18946. categories: [{
  18947. id: Number(oldAttributes.categories)
  18948. }]
  18949. };
  18950. },
  18951. isEligible: _ref => {
  18952. let {
  18953. categories
  18954. } = _ref;
  18955. return categories && 'string' === typeof categories;
  18956. },
  18957. save: () => null
  18958. }]);
  18959. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
  18960. /**
  18961. * WordPress dependencies
  18962. */
  18963. const list = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18964. viewBox: "0 0 24 24",
  18965. xmlns: "http://www.w3.org/2000/svg"
  18966. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18967. d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"
  18968. }));
  18969. /* harmony default export */ var library_list = (list);
  18970. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
  18971. /**
  18972. * WordPress dependencies
  18973. */
  18974. const grid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  18975. xmlns: "http://www.w3.org/2000/svg",
  18976. viewBox: "0 0 24 24"
  18977. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  18978. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",
  18979. fillRule: "evenodd",
  18980. clipRule: "evenodd"
  18981. }));
  18982. /* harmony default export */ var library_grid = (grid);
  18983. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js
  18984. const MIN_EXCERPT_LENGTH = 10;
  18985. const MAX_EXCERPT_LENGTH = 100;
  18986. const MAX_POSTS_COLUMNS = 6;
  18987. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js
  18988. /**
  18989. * External dependencies
  18990. */
  18991. /**
  18992. * WordPress dependencies
  18993. */
  18994. /**
  18995. * Internal dependencies
  18996. */
  18997. /**
  18998. * Module Constants
  18999. */
  19000. const CATEGORIES_LIST_QUERY = {
  19001. per_page: -1,
  19002. context: 'view'
  19003. };
  19004. const USERS_LIST_QUERY = {
  19005. per_page: -1,
  19006. has_published_posts: ['post'],
  19007. context: 'view'
  19008. };
  19009. function getFeaturedImageDetails(post, size) {
  19010. var _image$media_details$, _image$media_details, _image$media_details$2, _image$media_details$3;
  19011. const image = (0,external_lodash_namespaceObject.get)(post, ['_embedded', 'wp:featuredmedia', '0']);
  19012. return {
  19013. url: (_image$media_details$ = image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$2 = _image$media_details.sizes) === null || _image$media_details$2 === void 0 ? void 0 : (_image$media_details$3 = _image$media_details$2[size]) === null || _image$media_details$3 === void 0 ? void 0 : _image$media_details$3.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image === null || image === void 0 ? void 0 : image.source_url,
  19014. alt: image === null || image === void 0 ? void 0 : image.alt_text
  19015. };
  19016. }
  19017. function LatestPostsEdit(_ref) {
  19018. var _categoriesList$reduc;
  19019. let {
  19020. attributes,
  19021. setAttributes
  19022. } = _ref;
  19023. const {
  19024. postsToShow,
  19025. order,
  19026. orderBy,
  19027. categories,
  19028. selectedAuthor,
  19029. displayFeaturedImage,
  19030. displayPostContentRadio,
  19031. displayPostContent,
  19032. displayPostDate,
  19033. displayAuthor,
  19034. postLayout,
  19035. columns,
  19036. excerptLength,
  19037. featuredImageAlign,
  19038. featuredImageSizeSlug,
  19039. featuredImageSizeWidth,
  19040. featuredImageSizeHeight,
  19041. addLinkToFeaturedImage
  19042. } = attributes;
  19043. const {
  19044. imageSizes,
  19045. latestPosts,
  19046. defaultImageWidth,
  19047. defaultImageHeight,
  19048. categoriesList,
  19049. authorList
  19050. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  19051. const {
  19052. getEntityRecords,
  19053. getUsers
  19054. } = select(external_wp_coreData_namespaceObject.store);
  19055. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  19056. const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : [];
  19057. const latestPostsQuery = (0,external_lodash_namespaceObject.pickBy)({
  19058. categories: catIds,
  19059. author: selectedAuthor,
  19060. order,
  19061. orderby: orderBy,
  19062. per_page: postsToShow,
  19063. _embed: 'wp:featuredmedia'
  19064. }, value => !(0,external_lodash_namespaceObject.isUndefined)(value));
  19065. return {
  19066. defaultImageWidth: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'width'], 0),
  19067. defaultImageHeight: (0,external_lodash_namespaceObject.get)(settings.imageDimensions, [featuredImageSizeSlug, 'height'], 0),
  19068. imageSizes: settings.imageSizes,
  19069. latestPosts: getEntityRecords('postType', 'post', latestPostsQuery),
  19070. categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY),
  19071. authorList: getUsers(USERS_LIST_QUERY)
  19072. };
  19073. }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]);
  19074. const imageSizeOptions = imageSizes.filter(_ref2 => {
  19075. let {
  19076. slug
  19077. } = _ref2;
  19078. return slug !== 'full';
  19079. }).map(_ref3 => {
  19080. let {
  19081. name,
  19082. slug
  19083. } = _ref3;
  19084. return {
  19085. value: slug,
  19086. label: name
  19087. };
  19088. });
  19089. const categorySuggestions = (_categoriesList$reduc = categoriesList === null || categoriesList === void 0 ? void 0 : categoriesList.reduce((accumulator, category) => ({ ...accumulator,
  19090. [category.name]: category
  19091. }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {};
  19092. const selectCategories = tokens => {
  19093. const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]);
  19094. if (hasNoSuggestion) {
  19095. return;
  19096. } // Categories that are already will be objects, while new additions will be strings (the name).
  19097. // allCategories nomalizes the array so that they are all objects.
  19098. const allCategories = tokens.map(token => {
  19099. return typeof token === 'string' ? categorySuggestions[token] : token;
  19100. }); // We do nothing if the category is not selected
  19101. // from suggestions.
  19102. if ((0,external_lodash_namespaceObject.includes)(allCategories, null)) {
  19103. return false;
  19104. }
  19105. setAttributes({
  19106. categories: allCategories
  19107. });
  19108. };
  19109. const hasPosts = !!(latestPosts !== null && latestPosts !== void 0 && latestPosts.length);
  19110. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19111. title: (0,external_wp_i18n_namespaceObject.__)('Post content settings')
  19112. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19113. label: (0,external_wp_i18n_namespaceObject.__)('Post content'),
  19114. checked: displayPostContent,
  19115. onChange: value => setAttributes({
  19116. displayPostContent: value
  19117. })
  19118. }), displayPostContent && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RadioControl, {
  19119. label: (0,external_wp_i18n_namespaceObject.__)('Show:'),
  19120. selected: displayPostContentRadio,
  19121. options: [{
  19122. label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
  19123. value: 'excerpt'
  19124. }, {
  19125. label: (0,external_wp_i18n_namespaceObject.__)('Full post'),
  19126. value: 'full_post'
  19127. }],
  19128. onChange: value => setAttributes({
  19129. displayPostContentRadio: value
  19130. })
  19131. }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  19132. label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
  19133. value: excerptLength,
  19134. onChange: value => setAttributes({
  19135. excerptLength: value
  19136. }),
  19137. min: MIN_EXCERPT_LENGTH,
  19138. max: MAX_EXCERPT_LENGTH
  19139. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19140. title: (0,external_wp_i18n_namespaceObject.__)('Post meta settings')
  19141. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19142. label: (0,external_wp_i18n_namespaceObject.__)('Display author name'),
  19143. checked: displayAuthor,
  19144. onChange: value => setAttributes({
  19145. displayAuthor: value
  19146. })
  19147. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19148. label: (0,external_wp_i18n_namespaceObject.__)('Display post date'),
  19149. checked: displayPostDate,
  19150. onChange: value => setAttributes({
  19151. displayPostDate: value
  19152. })
  19153. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19154. title: (0,external_wp_i18n_namespaceObject.__)('Featured image settings')
  19155. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19156. label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'),
  19157. checked: displayFeaturedImage,
  19158. onChange: value => setAttributes({
  19159. displayFeaturedImage: value
  19160. })
  19161. }), displayFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  19162. onChange: value => {
  19163. const newAttrs = {};
  19164. if (value.hasOwnProperty('width')) {
  19165. newAttrs.featuredImageSizeWidth = value.width;
  19166. }
  19167. if (value.hasOwnProperty('height')) {
  19168. newAttrs.featuredImageSizeHeight = value.height;
  19169. }
  19170. setAttributes(newAttrs);
  19171. },
  19172. slug: featuredImageSizeSlug,
  19173. width: featuredImageSizeWidth,
  19174. height: featuredImageSizeHeight,
  19175. imageWidth: defaultImageWidth,
  19176. imageHeight: defaultImageHeight,
  19177. imageSizeOptions: imageSizeOptions,
  19178. onChangeImage: value => setAttributes({
  19179. featuredImageSizeSlug: value,
  19180. featuredImageSizeWidth: undefined,
  19181. featuredImageSizeHeight: undefined
  19182. })
  19183. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  19184. className: "editor-latest-posts-image-alignment-control"
  19185. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image alignment')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
  19186. value: featuredImageAlign,
  19187. onChange: value => setAttributes({
  19188. featuredImageAlign: value
  19189. }),
  19190. controls: ['left', 'center', 'right'],
  19191. isCollapsed: false
  19192. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19193. label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'),
  19194. checked: addLinkToFeaturedImage,
  19195. onChange: value => setAttributes({
  19196. addLinkToFeaturedImage: value
  19197. })
  19198. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19199. title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering')
  19200. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
  19201. order,
  19202. orderBy,
  19203. numberOfItems: postsToShow,
  19204. onOrderChange: value => setAttributes({
  19205. order: value
  19206. }),
  19207. onOrderByChange: value => setAttributes({
  19208. orderBy: value
  19209. }),
  19210. onNumberOfItemsChange: value => setAttributes({
  19211. postsToShow: value
  19212. }),
  19213. categorySuggestions: categorySuggestions,
  19214. onCategoryChange: selectCategories,
  19215. selectedCategories: categories,
  19216. onAuthorChange: value => setAttributes({
  19217. selectedAuthor: '' !== value ? Number(value) : undefined
  19218. }),
  19219. authorList: authorList !== null && authorList !== void 0 ? authorList : [],
  19220. selectedAuthorId: selectedAuthor
  19221. }), postLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  19222. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  19223. value: columns,
  19224. onChange: value => setAttributes({
  19225. columns: value
  19226. }),
  19227. min: 2,
  19228. max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length),
  19229. required: true
  19230. })));
  19231. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19232. className: classnames_default()({
  19233. 'wp-block-latest-posts__list': true,
  19234. 'is-grid': postLayout === 'grid',
  19235. 'has-dates': displayPostDate,
  19236. 'has-author': displayAuthor,
  19237. [`columns-${columns}`]: postLayout === 'grid'
  19238. })
  19239. });
  19240. if (!hasPosts) {
  19241. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  19242. icon: library_pin,
  19243. label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts')
  19244. }, !Array.isArray(latestPosts) ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No posts found.')));
  19245. } // Removing posts from display should be instant.
  19246. const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts;
  19247. const layoutControls = [{
  19248. icon: library_list,
  19249. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  19250. onClick: () => setAttributes({
  19251. postLayout: 'list'
  19252. }),
  19253. isActive: postLayout === 'list'
  19254. }, {
  19255. icon: library_grid,
  19256. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  19257. onClick: () => setAttributes({
  19258. postLayout: 'grid'
  19259. }),
  19260. isActive: postLayout === 'grid'
  19261. }];
  19262. const dateFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date;
  19263. return (0,external_wp_element_namespaceObject.createElement)("div", null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  19264. controls: layoutControls
  19265. })), (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, displayPosts.map((post, i) => {
  19266. const titleTrimmed = (0,external_lodash_namespaceObject.invoke)(post, ['title', 'rendered', 'trim']);
  19267. let excerpt = post.excerpt.rendered;
  19268. const currentAuthor = authorList === null || authorList === void 0 ? void 0 : authorList.find(author => author.id === post.author);
  19269. const excerptElement = document.createElement('div');
  19270. excerptElement.innerHTML = excerpt;
  19271. excerpt = excerptElement.textContent || excerptElement.innerText || '';
  19272. const {
  19273. url: imageSourceUrl,
  19274. alt: featuredImageAlt
  19275. } = getFeaturedImageDetails(post, featuredImageSizeSlug);
  19276. const imageClasses = classnames_default()({
  19277. 'wp-block-latest-posts__featured-image': true,
  19278. [`align${featuredImageAlign}`]: !!featuredImageAlign
  19279. });
  19280. const renderFeaturedImage = displayFeaturedImage && imageSourceUrl;
  19281. const featuredImage = renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("img", {
  19282. src: imageSourceUrl,
  19283. alt: featuredImageAlt,
  19284. style: {
  19285. maxWidth: featuredImageSizeWidth,
  19286. maxHeight: featuredImageSizeHeight
  19287. }
  19288. });
  19289. const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
  19290. const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_i18n_namespaceObject.__)(' … '), (0,external_wp_element_namespaceObject.createElement)("a", {
  19291. href: post.link,
  19292. rel: "noopener noreferrer"
  19293. }, (0,external_wp_i18n_namespaceObject.__)('Read more'))) : excerpt;
  19294. return (0,external_wp_element_namespaceObject.createElement)("li", {
  19295. key: i
  19296. }, renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("div", {
  19297. className: imageClasses
  19298. }, addLinkToFeaturedImage ? (0,external_wp_element_namespaceObject.createElement)("a", {
  19299. className: "wp-block-latest-posts__post-title",
  19300. href: post.link,
  19301. rel: "noreferrer noopener"
  19302. }, featuredImage) : featuredImage), (0,external_wp_element_namespaceObject.createElement)("a", {
  19303. href: post.link,
  19304. rel: "noreferrer noopener",
  19305. dangerouslySetInnerHTML: !!titleTrimmed ? {
  19306. __html: titleTrimmed
  19307. } : undefined
  19308. }, !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null), displayAuthor && currentAuthor && (0,external_wp_element_namespaceObject.createElement)("div", {
  19309. className: "wp-block-latest-posts__post-author"
  19310. }, (0,external_wp_i18n_namespaceObject.sprintf)(
  19311. /* translators: byline. %s: current author. */
  19312. (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_wp_element_namespaceObject.createElement)("time", {
  19313. dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt),
  19314. className: "wp-block-latest-posts__post-date"
  19315. }, (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)("div", {
  19316. className: "wp-block-latest-posts__post-excerpt"
  19317. }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_wp_element_namespaceObject.createElement)("div", {
  19318. className: "wp-block-latest-posts__post-full-content",
  19319. dangerouslySetInnerHTML: {
  19320. __html: post.content.raw.trim()
  19321. }
  19322. }));
  19323. })));
  19324. }
  19325. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
  19326. /**
  19327. * WordPress dependencies
  19328. */
  19329. /**
  19330. * Internal dependencies
  19331. */
  19332. const latest_posts_metadata = {
  19333. $schema: "https://schemas.wp.org/trunk/block.json",
  19334. apiVersion: 2,
  19335. name: "core/latest-posts",
  19336. title: "Latest Posts",
  19337. category: "widgets",
  19338. description: "Display a list of your most recent posts.",
  19339. keywords: ["recent posts"],
  19340. textdomain: "default",
  19341. attributes: {
  19342. categories: {
  19343. type: "array",
  19344. items: {
  19345. type: "object"
  19346. }
  19347. },
  19348. selectedAuthor: {
  19349. type: "number"
  19350. },
  19351. postsToShow: {
  19352. type: "number",
  19353. "default": 5
  19354. },
  19355. displayPostContent: {
  19356. type: "boolean",
  19357. "default": false
  19358. },
  19359. displayPostContentRadio: {
  19360. type: "string",
  19361. "default": "excerpt"
  19362. },
  19363. excerptLength: {
  19364. type: "number",
  19365. "default": 55
  19366. },
  19367. displayAuthor: {
  19368. type: "boolean",
  19369. "default": false
  19370. },
  19371. displayPostDate: {
  19372. type: "boolean",
  19373. "default": false
  19374. },
  19375. postLayout: {
  19376. type: "string",
  19377. "default": "list"
  19378. },
  19379. columns: {
  19380. type: "number",
  19381. "default": 3
  19382. },
  19383. order: {
  19384. type: "string",
  19385. "default": "desc"
  19386. },
  19387. orderBy: {
  19388. type: "string",
  19389. "default": "date"
  19390. },
  19391. displayFeaturedImage: {
  19392. type: "boolean",
  19393. "default": false
  19394. },
  19395. featuredImageAlign: {
  19396. type: "string",
  19397. "enum": ["left", "center", "right"]
  19398. },
  19399. featuredImageSizeSlug: {
  19400. type: "string",
  19401. "default": "thumbnail"
  19402. },
  19403. featuredImageSizeWidth: {
  19404. type: "number",
  19405. "default": null
  19406. },
  19407. featuredImageSizeHeight: {
  19408. type: "number",
  19409. "default": null
  19410. },
  19411. addLinkToFeaturedImage: {
  19412. type: "boolean",
  19413. "default": false
  19414. }
  19415. },
  19416. supports: {
  19417. align: true,
  19418. html: false
  19419. },
  19420. editorStyle: "wp-block-latest-posts-editor",
  19421. style: "wp-block-latest-posts"
  19422. };
  19423. const {
  19424. name: latest_posts_name
  19425. } = latest_posts_metadata;
  19426. const latest_posts_settings = {
  19427. icon: post_list,
  19428. example: {},
  19429. edit: LatestPostsEdit,
  19430. deprecated: latest_posts_deprecated
  19431. };
  19432. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js
  19433. /**
  19434. * WordPress dependencies
  19435. */
  19436. /**
  19437. * Internal dependencies
  19438. */
  19439. const v0 = {
  19440. attributes: {
  19441. ordered: {
  19442. type: 'boolean',
  19443. default: false,
  19444. __experimentalRole: 'content'
  19445. },
  19446. values: {
  19447. type: 'string',
  19448. source: 'html',
  19449. selector: 'ol,ul',
  19450. multiline: 'li',
  19451. __unstableMultilineWrapperTags: ['ol', 'ul'],
  19452. default: '',
  19453. __experimentalRole: 'content'
  19454. },
  19455. type: {
  19456. type: 'string'
  19457. },
  19458. start: {
  19459. type: 'number'
  19460. },
  19461. reversed: {
  19462. type: 'boolean'
  19463. },
  19464. placeholder: {
  19465. type: 'string'
  19466. }
  19467. },
  19468. supports: {
  19469. anchor: true,
  19470. className: false,
  19471. typography: {
  19472. fontSize: true,
  19473. __experimentalFontFamily: true
  19474. },
  19475. color: {
  19476. gradients: true,
  19477. link: true
  19478. },
  19479. __unstablePasteTextInline: true,
  19480. __experimentalSelector: 'ol,ul',
  19481. __experimentalSlashInserter: true
  19482. },
  19483. save(_ref) {
  19484. let {
  19485. attributes
  19486. } = _ref;
  19487. const {
  19488. ordered,
  19489. values,
  19490. type,
  19491. reversed,
  19492. start
  19493. } = attributes;
  19494. const TagName = ordered ? 'ol' : 'ul';
  19495. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19496. type,
  19497. reversed,
  19498. start
  19499. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19500. value: values,
  19501. multiline: "li"
  19502. }));
  19503. },
  19504. migrate: migrate_font_family,
  19505. isEligible(_ref2) {
  19506. var _style$typography;
  19507. let {
  19508. style
  19509. } = _ref2;
  19510. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  19511. }
  19512. };
  19513. /**
  19514. * New deprecations need to be placed first
  19515. * for them to have higher priority.
  19516. *
  19517. * Old deprecations may need to be updated as well.
  19518. *
  19519. * See block-deprecation.md
  19520. */
  19521. /* harmony default export */ var list_deprecated = ([v0]);
  19522. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
  19523. /**
  19524. * WordPress dependencies
  19525. */
  19526. const formatListBulletsRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19527. xmlns: "http://www.w3.org/2000/svg",
  19528. viewBox: "0 0 24 24"
  19529. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19530. d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"
  19531. }));
  19532. /* harmony default export */ var format_list_bullets_rtl = (formatListBulletsRTL);
  19533. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
  19534. /**
  19535. * WordPress dependencies
  19536. */
  19537. const formatListBullets = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19538. xmlns: "http://www.w3.org/2000/svg",
  19539. viewBox: "0 0 24 24"
  19540. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19541. d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
  19542. }));
  19543. /* harmony default export */ var format_list_bullets = (formatListBullets);
  19544. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js
  19545. /**
  19546. * WordPress dependencies
  19547. */
  19548. const formatListNumberedRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19549. xmlns: "http://www.w3.org/2000/svg",
  19550. viewBox: "0 0 24 24"
  19551. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19552. d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"
  19553. }));
  19554. /* harmony default export */ var format_list_numbered_rtl = (formatListNumberedRTL);
  19555. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js
  19556. /**
  19557. * WordPress dependencies
  19558. */
  19559. const formatListNumbered = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19560. xmlns: "http://www.w3.org/2000/svg",
  19561. viewBox: "0 0 24 24"
  19562. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19563. d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"
  19564. }));
  19565. /* harmony default export */ var format_list_numbered = (formatListNumbered);
  19566. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js
  19567. /**
  19568. * WordPress dependencies
  19569. */
  19570. const formatOutdentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19571. xmlns: "http://www.w3.org/2000/svg",
  19572. viewBox: "0 0 24 24"
  19573. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19574. d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"
  19575. }));
  19576. /* harmony default export */ var format_outdent_rtl = (formatOutdentRTL);
  19577. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js
  19578. /**
  19579. * WordPress dependencies
  19580. */
  19581. const formatOutdent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19582. xmlns: "http://www.w3.org/2000/svg",
  19583. viewBox: "0 0 24 24"
  19584. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19585. d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"
  19586. }));
  19587. /* harmony default export */ var format_outdent = (formatOutdent);
  19588. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js
  19589. /**
  19590. * WordPress dependencies
  19591. */
  19592. const formatIndentRTL = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19593. xmlns: "http://www.w3.org/2000/svg",
  19594. viewBox: "0 0 24 24"
  19595. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19596. d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"
  19597. }));
  19598. /* harmony default export */ var format_indent_rtl = (formatIndentRTL);
  19599. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js
  19600. /**
  19601. * WordPress dependencies
  19602. */
  19603. const formatIndent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  19604. xmlns: "http://www.w3.org/2000/svg",
  19605. viewBox: "0 0 24 24"
  19606. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  19607. d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"
  19608. }));
  19609. /* harmony default export */ var format_indent = (formatIndent);
  19610. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js
  19611. /**
  19612. * WordPress dependencies
  19613. */
  19614. const OrderedListSettings = _ref => {
  19615. let {
  19616. setAttributes,
  19617. reversed,
  19618. start
  19619. } = _ref;
  19620. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  19621. title: (0,external_wp_i18n_namespaceObject.__)('Ordered list settings')
  19622. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  19623. label: (0,external_wp_i18n_namespaceObject.__)('Start value'),
  19624. type: "number",
  19625. onChange: value => {
  19626. const int = parseInt(value, 10);
  19627. setAttributes({
  19628. // It should be possible to unset the value,
  19629. // e.g. with an empty string.
  19630. start: isNaN(int) ? undefined : int
  19631. });
  19632. },
  19633. value: Number.isInteger(start) ? start.toString(10) : '',
  19634. step: "1"
  19635. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  19636. label: (0,external_wp_i18n_namespaceObject.__)('Reverse list numbering'),
  19637. checked: reversed || false,
  19638. onChange: value => {
  19639. setAttributes({
  19640. // Unset the attribute if not reversed.
  19641. reversed: value || undefined
  19642. });
  19643. }
  19644. })));
  19645. };
  19646. /* harmony default export */ var ordered_list_settings = (OrderedListSettings);
  19647. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js
  19648. /**
  19649. * WordPress dependencies
  19650. */
  19651. /**
  19652. * Internal dependencies
  19653. */
  19654. function ListEdit(_ref) {
  19655. let {
  19656. attributes,
  19657. setAttributes,
  19658. mergeBlocks,
  19659. onReplace,
  19660. style
  19661. } = _ref;
  19662. const {
  19663. ordered,
  19664. values,
  19665. type,
  19666. reversed,
  19667. start,
  19668. placeholder
  19669. } = attributes;
  19670. const tagName = ordered ? 'ol' : 'ul';
  19671. const controls = _ref2 => {
  19672. let {
  19673. value,
  19674. onChange,
  19675. onFocus
  19676. } = _ref2;
  19677. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19678. type: "primary",
  19679. character: "[",
  19680. onUse: () => {
  19681. onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
  19682. }
  19683. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19684. type: "primary",
  19685. character: "]",
  19686. onUse: () => {
  19687. onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
  19688. type: tagName
  19689. }));
  19690. }
  19691. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19692. type: "primary",
  19693. character: "m",
  19694. onUse: () => {
  19695. onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
  19696. type: tagName
  19697. }));
  19698. }
  19699. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
  19700. type: "primaryShift",
  19701. character: "m",
  19702. onUse: () => {
  19703. onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
  19704. }
  19705. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  19706. group: "block"
  19707. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19708. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets,
  19709. title: (0,external_wp_i18n_namespaceObject.__)('Unordered'),
  19710. describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'),
  19711. isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ul', tagName),
  19712. onClick: () => {
  19713. onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
  19714. type: 'ul'
  19715. }));
  19716. onFocus();
  19717. if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
  19718. setAttributes({
  19719. ordered: false
  19720. });
  19721. }
  19722. }
  19723. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19724. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered,
  19725. title: (0,external_wp_i18n_namespaceObject.__)('Ordered'),
  19726. describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'),
  19727. isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ol', tagName),
  19728. onClick: () => {
  19729. onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
  19730. type: 'ol'
  19731. }));
  19732. onFocus();
  19733. if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
  19734. setAttributes({
  19735. ordered: true
  19736. });
  19737. }
  19738. }
  19739. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19740. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
  19741. title: (0,external_wp_i18n_namespaceObject.__)('Outdent'),
  19742. describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'),
  19743. shortcut: (0,external_wp_i18n_namespaceObject._x)('Backspace', 'keyboard key'),
  19744. isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanOutdentListItems)(value),
  19745. onClick: () => {
  19746. onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
  19747. onFocus();
  19748. }
  19749. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  19750. icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent,
  19751. title: (0,external_wp_i18n_namespaceObject.__)('Indent'),
  19752. describedBy: (0,external_wp_i18n_namespaceObject.__)('Indent list item'),
  19753. shortcut: (0,external_wp_i18n_namespaceObject._x)('Space', 'keyboard key'),
  19754. isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanIndentListItems)(value),
  19755. onClick: () => {
  19756. onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
  19757. type: tagName
  19758. }));
  19759. onFocus();
  19760. }
  19761. })));
  19762. };
  19763. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  19764. style
  19765. });
  19766. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  19767. identifier: "values",
  19768. multiline: "li",
  19769. tagName: tagName,
  19770. onChange: nextValues => setAttributes({
  19771. values: nextValues
  19772. }),
  19773. value: values,
  19774. "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'),
  19775. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'),
  19776. onMerge: mergeBlocks,
  19777. onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)(list_name, { ...attributes,
  19778. values: value
  19779. }),
  19780. __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
  19781. onReplace: onReplace,
  19782. onRemove: () => onReplace([]),
  19783. start: start,
  19784. reversed: reversed,
  19785. type: type
  19786. }, blockProps), controls), ordered && (0,external_wp_element_namespaceObject.createElement)(ordered_list_settings, {
  19787. setAttributes: setAttributes,
  19788. ordered: ordered,
  19789. reversed: reversed,
  19790. start: start,
  19791. placeholder: placeholder
  19792. }));
  19793. }
  19794. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js
  19795. /**
  19796. * WordPress dependencies
  19797. */
  19798. function list_save_save(_ref) {
  19799. let {
  19800. attributes
  19801. } = _ref;
  19802. const {
  19803. ordered,
  19804. values,
  19805. type,
  19806. reversed,
  19807. start
  19808. } = attributes;
  19809. const TagName = ordered ? 'ol' : 'ul';
  19810. return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
  19811. type,
  19812. reversed,
  19813. start
  19814. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  19815. value: values,
  19816. multiline: "li"
  19817. }));
  19818. }
  19819. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js
  19820. /**
  19821. * WordPress dependencies
  19822. */
  19823. function getListContentSchema(_ref) {
  19824. let {
  19825. phrasingContentSchema
  19826. } = _ref;
  19827. const listContentSchema = { ...phrasingContentSchema,
  19828. ul: {},
  19829. ol: {
  19830. attributes: ['type', 'start', 'reversed']
  19831. }
  19832. }; // Recursion is needed.
  19833. // Possible: ul > li > ul.
  19834. // Impossible: ul > ul.
  19835. ['ul', 'ol'].forEach(tag => {
  19836. listContentSchema[tag].children = {
  19837. li: {
  19838. children: listContentSchema
  19839. }
  19840. };
  19841. });
  19842. return listContentSchema;
  19843. }
  19844. const list_transforms_transforms = {
  19845. from: [{
  19846. type: 'block',
  19847. isMultiBlock: true,
  19848. blocks: ['core/paragraph', 'core/heading'],
  19849. transform: blockAttributes => {
  19850. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19851. values: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19852. value: (0,external_wp_richText_namespaceObject.join)(blockAttributes.map(_ref2 => {
  19853. let {
  19854. content
  19855. } = _ref2;
  19856. const value = (0,external_wp_richText_namespaceObject.create)({
  19857. html: content
  19858. });
  19859. if (blockAttributes.length > 1) {
  19860. return value;
  19861. } // When converting only one block, transform
  19862. // every line to a list item.
  19863. return (0,external_wp_richText_namespaceObject.replace)(value, /\n/g, external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR);
  19864. }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR),
  19865. multilineTag: 'li'
  19866. }),
  19867. anchor: blockAttributes.anchor
  19868. });
  19869. }
  19870. }, {
  19871. type: 'block',
  19872. blocks: ['core/quote', 'core/pullquote'],
  19873. transform: _ref3 => {
  19874. let {
  19875. value,
  19876. anchor
  19877. } = _ref3;
  19878. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19879. values: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19880. value: (0,external_wp_richText_namespaceObject.create)({
  19881. html: value,
  19882. multilineTag: 'p'
  19883. }),
  19884. multilineTag: 'li'
  19885. }),
  19886. anchor
  19887. });
  19888. }
  19889. }, {
  19890. type: 'raw',
  19891. selector: 'ol,ul',
  19892. schema: args => ({
  19893. ol: getListContentSchema(args).ol,
  19894. ul: getListContentSchema(args).ul
  19895. }),
  19896. transform(node) {
  19897. const attributes = {
  19898. ordered: node.nodeName === 'OL',
  19899. anchor: node.id === '' ? undefined : node.id
  19900. };
  19901. if (attributes.ordered) {
  19902. const type = node.getAttribute('type');
  19903. if (type) {
  19904. attributes.type = type;
  19905. }
  19906. if (node.getAttribute('reversed') !== null) {
  19907. attributes.reversed = true;
  19908. }
  19909. const start = parseInt(node.getAttribute('start'), 10);
  19910. if (!isNaN(start) && ( // start=1 only makes sense if the list is reversed.
  19911. start !== 1 || attributes.reversed)) {
  19912. attributes.start = start;
  19913. }
  19914. }
  19915. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { ...(0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/list', node.outerHTML),
  19916. ...attributes
  19917. });
  19918. }
  19919. }, ...['*', '-'].map(prefix => ({
  19920. type: 'prefix',
  19921. prefix,
  19922. transform(content) {
  19923. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19924. values: `<li>${content}</li>`
  19925. });
  19926. }
  19927. })), ...['1.', '1)'].map(prefix => ({
  19928. type: 'prefix',
  19929. prefix,
  19930. transform(content) {
  19931. return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
  19932. ordered: true,
  19933. values: `<li>${content}</li>`
  19934. });
  19935. }
  19936. }))],
  19937. to: [{
  19938. type: 'block',
  19939. blocks: ['core/paragraph'],
  19940. transform: _ref4 => {
  19941. let {
  19942. values
  19943. } = _ref4;
  19944. return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  19945. html: values,
  19946. multilineTag: 'li',
  19947. multilineWrapperTags: ['ul', 'ol']
  19948. }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  19949. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19950. value: piece
  19951. })
  19952. }));
  19953. }
  19954. }, {
  19955. type: 'block',
  19956. blocks: ['core/heading'],
  19957. transform: _ref5 => {
  19958. let {
  19959. values
  19960. } = _ref5;
  19961. return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  19962. html: values,
  19963. multilineTag: 'li',
  19964. multilineWrapperTags: ['ul', 'ol']
  19965. }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  19966. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19967. value: piece
  19968. })
  19969. }));
  19970. }
  19971. }, {
  19972. type: 'block',
  19973. blocks: ['core/quote'],
  19974. transform: _ref6 => {
  19975. let {
  19976. values,
  19977. anchor
  19978. } = _ref6;
  19979. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  19980. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  19981. value: (0,external_wp_richText_namespaceObject.create)({
  19982. html: values,
  19983. multilineTag: 'li',
  19984. multilineWrapperTags: ['ul', 'ol']
  19985. }),
  19986. multilineTag: 'p'
  19987. }),
  19988. anchor
  19989. });
  19990. }
  19991. }, {
  19992. type: 'block',
  19993. blocks: ['core/pullquote'],
  19994. transform: _ref7 => {
  19995. let {
  19996. values,
  19997. anchor
  19998. } = _ref7;
  19999. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  20000. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  20001. value: (0,external_wp_richText_namespaceObject.create)({
  20002. html: values,
  20003. multilineTag: 'li',
  20004. multilineWrapperTags: ['ul', 'ol']
  20005. }),
  20006. multilineTag: 'p'
  20007. }),
  20008. anchor
  20009. });
  20010. }
  20011. }]
  20012. };
  20013. /* harmony default export */ var list_transforms = (list_transforms_transforms);
  20014. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js
  20015. /**
  20016. * WordPress dependencies
  20017. */
  20018. /**
  20019. * Internal dependencies
  20020. */
  20021. const list_metadata = {
  20022. $schema: "https://schemas.wp.org/trunk/block.json",
  20023. apiVersion: 2,
  20024. name: "core/list",
  20025. title: "List",
  20026. category: "text",
  20027. description: "Create a bulleted or numbered list.",
  20028. keywords: ["bullet list", "ordered list", "numbered list"],
  20029. textdomain: "default",
  20030. attributes: {
  20031. ordered: {
  20032. type: "boolean",
  20033. "default": false,
  20034. __experimentalRole: "content"
  20035. },
  20036. values: {
  20037. type: "string",
  20038. source: "html",
  20039. selector: "ol,ul",
  20040. multiline: "li",
  20041. __unstableMultilineWrapperTags: ["ol", "ul"],
  20042. "default": "",
  20043. __experimentalRole: "content"
  20044. },
  20045. type: {
  20046. type: "string"
  20047. },
  20048. start: {
  20049. type: "number"
  20050. },
  20051. reversed: {
  20052. type: "boolean"
  20053. },
  20054. placeholder: {
  20055. type: "string"
  20056. }
  20057. },
  20058. supports: {
  20059. anchor: true,
  20060. className: false,
  20061. typography: {
  20062. fontSize: true,
  20063. __experimentalFontFamily: true,
  20064. lineHeight: true,
  20065. __experimentalFontStyle: true,
  20066. __experimentalFontWeight: true,
  20067. __experimentalLetterSpacing: true,
  20068. __experimentalTextTransform: true,
  20069. __experimentalDefaultControls: {
  20070. fontSize: true
  20071. }
  20072. },
  20073. color: {
  20074. gradients: true,
  20075. link: true,
  20076. __experimentalDefaultControls: {
  20077. background: true,
  20078. text: true
  20079. }
  20080. },
  20081. __unstablePasteTextInline: true,
  20082. __experimentalSelector: "ol,ul",
  20083. __experimentalSlashInserter: true
  20084. },
  20085. editorStyle: "wp-block-list-editor",
  20086. style: "wp-block-list"
  20087. };
  20088. const {
  20089. name: list_name
  20090. } = list_metadata;
  20091. const settingsV1 = {
  20092. icon: library_list,
  20093. example: {
  20094. attributes: {
  20095. values: '<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>'
  20096. }
  20097. },
  20098. transforms: list_transforms,
  20099. merge(attributes, attributesToMerge) {
  20100. const {
  20101. values
  20102. } = attributesToMerge;
  20103. if (!values || values === '<li></li>') {
  20104. return attributes;
  20105. }
  20106. return { ...attributes,
  20107. values: attributes.values + values
  20108. };
  20109. },
  20110. edit: ListEdit,
  20111. save: list_save_save,
  20112. deprecated: list_deprecated
  20113. };
  20114. let list_settings = settingsV1;
  20115. if (false) { var _window; }
  20116. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js
  20117. /**
  20118. * WordPress dependencies
  20119. */
  20120. const login = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20121. xmlns: "http://www.w3.org/2000/svg",
  20122. viewBox: "0 0 24 24"
  20123. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20124. d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"
  20125. }));
  20126. /* harmony default export */ var library_login = (login);
  20127. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js
  20128. /**
  20129. * WordPress dependencies
  20130. */
  20131. function LoginOutEdit(_ref) {
  20132. let {
  20133. attributes,
  20134. setAttributes
  20135. } = _ref;
  20136. const {
  20137. displayLoginAsForm,
  20138. redirectToCurrent
  20139. } = attributes;
  20140. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  20141. title: (0,external_wp_i18n_namespaceObject.__)('Login/out settings')
  20142. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20143. label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'),
  20144. checked: displayLoginAsForm,
  20145. onChange: () => setAttributes({
  20146. displayLoginAsForm: !displayLoginAsForm
  20147. })
  20148. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20149. label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'),
  20150. checked: redirectToCurrent,
  20151. onChange: () => setAttributes({
  20152. redirectToCurrent: !redirectToCurrent
  20153. })
  20154. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  20155. className: 'logged-in'
  20156. }), (0,external_wp_element_namespaceObject.createElement)("a", {
  20157. href: "#login-pseudo-link"
  20158. }, (0,external_wp_i18n_namespaceObject.__)('Log out'))));
  20159. }
  20160. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
  20161. /**
  20162. * WordPress dependencies
  20163. */
  20164. /**
  20165. * Internal dependencies
  20166. */
  20167. const loginout_metadata = {
  20168. $schema: "https://schemas.wp.org/trunk/block.json",
  20169. apiVersion: 2,
  20170. name: "core/loginout",
  20171. title: "Login/out",
  20172. category: "theme",
  20173. description: "Show login & logout links.",
  20174. keywords: ["login", "logout", "form"],
  20175. textdomain: "default",
  20176. attributes: {
  20177. displayLoginAsForm: {
  20178. type: "boolean",
  20179. "default": false
  20180. },
  20181. redirectToCurrent: {
  20182. type: "boolean",
  20183. "default": true
  20184. }
  20185. },
  20186. supports: {
  20187. className: true,
  20188. typography: {
  20189. fontSize: false
  20190. }
  20191. }
  20192. };
  20193. const {
  20194. name: loginout_name
  20195. } = loginout_metadata;
  20196. const loginout_settings = {
  20197. icon: library_login,
  20198. edit: LoginOutEdit
  20199. };
  20200. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js
  20201. /**
  20202. * WordPress dependencies
  20203. */
  20204. const mediaAndText = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20205. xmlns: "http://www.w3.org/2000/svg",
  20206. viewBox: "0 0 24 24"
  20207. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20208. d: "M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"
  20209. }));
  20210. /* harmony default export */ var media_and_text = (mediaAndText);
  20211. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container-icon.js
  20212. /**
  20213. * WordPress dependencies
  20214. */
  20215. /* harmony default export */ var media_container_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  20216. xmlns: "http://www.w3.org/2000/svg",
  20217. viewBox: "0 0 24 24"
  20218. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  20219. d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
  20220. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  20221. d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
  20222. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  20223. d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
  20224. })));
  20225. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js
  20226. /**
  20227. * External dependencies
  20228. */
  20229. /**
  20230. * WordPress dependencies
  20231. */
  20232. /**
  20233. * Internal dependencies
  20234. */
  20235. /**
  20236. * Constants
  20237. */
  20238. const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video'];
  20239. function imageFillStyles(url, focalPoint) {
  20240. return url ? {
  20241. backgroundImage: `url(${url})`,
  20242. backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%`
  20243. } : {};
  20244. }
  20245. const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
  20246. let {
  20247. isSelected,
  20248. isStackedOnMobile,
  20249. ...props
  20250. } = _ref;
  20251. const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
  20252. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  20253. ref: ref,
  20254. showHandle: isSelected && (!isMobile || !isStackedOnMobile)
  20255. }, props));
  20256. });
  20257. function ToolbarEditButton(_ref2) {
  20258. let {
  20259. mediaId,
  20260. mediaUrl,
  20261. onSelectMedia
  20262. } = _ref2;
  20263. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20264. group: "other"
  20265. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  20266. mediaId: mediaId,
  20267. mediaURL: mediaUrl,
  20268. allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
  20269. accept: "image/*,video/*",
  20270. onSelect: onSelectMedia
  20271. }));
  20272. }
  20273. function PlaceholderContainer(_ref3) {
  20274. let {
  20275. className,
  20276. noticeOperations,
  20277. noticeUI,
  20278. mediaUrl,
  20279. onSelectMedia
  20280. } = _ref3;
  20281. const onUploadError = message => {
  20282. noticeOperations.removeAllNotices();
  20283. noticeOperations.createErrorNotice(message);
  20284. };
  20285. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  20286. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  20287. icon: media_container_icon
  20288. }),
  20289. labels: {
  20290. title: (0,external_wp_i18n_namespaceObject.__)('Media area')
  20291. },
  20292. className: className,
  20293. onSelect: onSelectMedia,
  20294. accept: "image/*,video/*",
  20295. allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
  20296. notices: noticeUI,
  20297. onError: onUploadError,
  20298. disableMediaButtons: mediaUrl
  20299. });
  20300. }
  20301. function MediaContainer(props, ref) {
  20302. const {
  20303. className,
  20304. commitWidthChange,
  20305. focalPoint,
  20306. imageFill,
  20307. isSelected,
  20308. isStackedOnMobile,
  20309. mediaAlt,
  20310. mediaId,
  20311. mediaPosition,
  20312. mediaType,
  20313. mediaUrl,
  20314. mediaWidth,
  20315. onSelectMedia,
  20316. onWidthChange
  20317. } = props;
  20318. const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl);
  20319. const {
  20320. toggleSelection
  20321. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  20322. if (mediaUrl) {
  20323. const onResizeStart = () => {
  20324. toggleSelection(false);
  20325. };
  20326. const onResize = (event, direction, elt) => {
  20327. onWidthChange(parseInt(elt.style.width));
  20328. };
  20329. const onResizeStop = (event, direction, elt) => {
  20330. toggleSelection(true);
  20331. commitWidthChange(parseInt(elt.style.width));
  20332. };
  20333. const enablePositions = {
  20334. right: mediaPosition === 'left',
  20335. left: mediaPosition === 'right'
  20336. };
  20337. const backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  20338. const mediaTypeRenderers = {
  20339. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  20340. src: mediaUrl,
  20341. alt: mediaAlt
  20342. }),
  20343. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20344. controls: true,
  20345. src: mediaUrl
  20346. })
  20347. };
  20348. return (0,external_wp_element_namespaceObject.createElement)(ResizableBoxContainer, {
  20349. as: "figure",
  20350. className: classnames_default()(className, 'editor-media-container__resizer', {
  20351. 'is-transient': isTemporaryMedia
  20352. }),
  20353. style: backgroundStyles,
  20354. size: {
  20355. width: mediaWidth + '%'
  20356. },
  20357. minWidth: "10%",
  20358. maxWidth: "100%",
  20359. enable: enablePositions,
  20360. onResizeStart: onResizeStart,
  20361. onResize: onResize,
  20362. onResizeStop: onResizeStop,
  20363. axis: "x",
  20364. isSelected: isSelected,
  20365. isStackedOnMobile: isStackedOnMobile,
  20366. ref: ref
  20367. }, (0,external_wp_element_namespaceObject.createElement)(ToolbarEditButton, {
  20368. onSelectMedia: onSelectMedia,
  20369. mediaUrl: mediaUrl,
  20370. mediaId: mediaId
  20371. }), (mediaTypeRenderers[mediaType] || external_lodash_namespaceObject.noop)(), isTemporaryMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props));
  20372. }
  20373. return (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props);
  20374. }
  20375. /* harmony default export */ var media_container = ((0,external_wp_components_namespaceObject.withNotices)((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)));
  20376. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js
  20377. /**
  20378. * External dependencies
  20379. */
  20380. /**
  20381. * WordPress dependencies
  20382. */
  20383. /**
  20384. * Internal dependencies
  20385. */
  20386. const DEFAULT_MEDIA_WIDTH = 50;
  20387. const media_text_deprecated_migrateCustomColors = attributes => {
  20388. if (!attributes.customBackgroundColor) {
  20389. return attributes;
  20390. }
  20391. const style = {
  20392. color: {
  20393. background: attributes.customBackgroundColor
  20394. }
  20395. };
  20396. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customBackgroundColor']),
  20397. style
  20398. };
  20399. };
  20400. const baseAttributes = {
  20401. align: {
  20402. type: 'string',
  20403. default: 'wide'
  20404. },
  20405. backgroundColor: {
  20406. type: 'string'
  20407. },
  20408. mediaAlt: {
  20409. type: 'string',
  20410. source: 'attribute',
  20411. selector: 'figure img',
  20412. attribute: 'alt',
  20413. default: ''
  20414. },
  20415. mediaPosition: {
  20416. type: 'string',
  20417. default: 'left'
  20418. },
  20419. mediaId: {
  20420. type: 'number'
  20421. },
  20422. mediaType: {
  20423. type: 'string'
  20424. },
  20425. mediaWidth: {
  20426. type: 'number',
  20427. default: 50
  20428. },
  20429. isStackedOnMobile: {
  20430. type: 'boolean',
  20431. default: true
  20432. }
  20433. };
  20434. /* harmony default export */ var media_text_deprecated = ([{
  20435. attributes: { ...baseAttributes,
  20436. customBackgroundColor: {
  20437. type: 'string'
  20438. },
  20439. mediaLink: {
  20440. type: 'string'
  20441. },
  20442. linkDestination: {
  20443. type: 'string'
  20444. },
  20445. linkTarget: {
  20446. type: 'string',
  20447. source: 'attribute',
  20448. selector: 'figure a',
  20449. attribute: 'target'
  20450. },
  20451. href: {
  20452. type: 'string',
  20453. source: 'attribute',
  20454. selector: 'figure a',
  20455. attribute: 'href'
  20456. },
  20457. rel: {
  20458. type: 'string',
  20459. source: 'attribute',
  20460. selector: 'figure a',
  20461. attribute: 'rel'
  20462. },
  20463. linkClass: {
  20464. type: 'string',
  20465. source: 'attribute',
  20466. selector: 'figure a',
  20467. attribute: 'class'
  20468. },
  20469. verticalAlignment: {
  20470. type: 'string'
  20471. },
  20472. imageFill: {
  20473. type: 'boolean'
  20474. },
  20475. focalPoint: {
  20476. type: 'object'
  20477. }
  20478. },
  20479. migrate: media_text_deprecated_migrateCustomColors,
  20480. save(_ref) {
  20481. let {
  20482. attributes
  20483. } = _ref;
  20484. const {
  20485. backgroundColor,
  20486. customBackgroundColor,
  20487. isStackedOnMobile,
  20488. mediaAlt,
  20489. mediaPosition,
  20490. mediaType,
  20491. mediaUrl,
  20492. mediaWidth,
  20493. mediaId,
  20494. verticalAlignment,
  20495. imageFill,
  20496. focalPoint,
  20497. linkClass,
  20498. href,
  20499. linkTarget,
  20500. rel
  20501. } = attributes;
  20502. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  20503. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  20504. src: mediaUrl,
  20505. alt: mediaAlt,
  20506. className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
  20507. });
  20508. if (href) {
  20509. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  20510. className: linkClass,
  20511. href: href,
  20512. target: linkTarget,
  20513. rel: newRel
  20514. }, image);
  20515. }
  20516. const mediaTypeRenders = {
  20517. image: () => image,
  20518. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20519. controls: true,
  20520. src: mediaUrl
  20521. })
  20522. };
  20523. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  20524. const className = classnames_default()({
  20525. 'has-media-on-the-right': 'right' === mediaPosition,
  20526. 'has-background': backgroundClass || customBackgroundColor,
  20527. [backgroundClass]: backgroundClass,
  20528. 'is-stacked-on-mobile': isStackedOnMobile,
  20529. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  20530. 'is-image-fill': imageFill
  20531. });
  20532. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  20533. let gridTemplateColumns;
  20534. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  20535. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  20536. }
  20537. const style = {
  20538. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  20539. gridTemplateColumns
  20540. };
  20541. return (0,external_wp_element_namespaceObject.createElement)("div", {
  20542. className: className,
  20543. style: style
  20544. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  20545. className: "wp-block-media-text__media",
  20546. style: backgroundStyles
  20547. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  20548. className: "wp-block-media-text__content"
  20549. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  20550. }
  20551. }, {
  20552. attributes: { ...baseAttributes,
  20553. customBackgroundColor: {
  20554. type: 'string'
  20555. },
  20556. mediaUrl: {
  20557. type: 'string',
  20558. source: 'attribute',
  20559. selector: 'figure video,figure img',
  20560. attribute: 'src'
  20561. },
  20562. verticalAlignment: {
  20563. type: 'string'
  20564. },
  20565. imageFill: {
  20566. type: 'boolean'
  20567. },
  20568. focalPoint: {
  20569. type: 'object'
  20570. }
  20571. },
  20572. migrate: media_text_deprecated_migrateCustomColors,
  20573. save(_ref2) {
  20574. let {
  20575. attributes
  20576. } = _ref2;
  20577. const {
  20578. backgroundColor,
  20579. customBackgroundColor,
  20580. isStackedOnMobile,
  20581. mediaAlt,
  20582. mediaPosition,
  20583. mediaType,
  20584. mediaUrl,
  20585. mediaWidth,
  20586. mediaId,
  20587. verticalAlignment,
  20588. imageFill,
  20589. focalPoint
  20590. } = attributes;
  20591. const mediaTypeRenders = {
  20592. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  20593. src: mediaUrl,
  20594. alt: mediaAlt,
  20595. className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
  20596. }),
  20597. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20598. controls: true,
  20599. src: mediaUrl
  20600. })
  20601. };
  20602. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  20603. const className = classnames_default()({
  20604. 'has-media-on-the-right': 'right' === mediaPosition,
  20605. [backgroundClass]: backgroundClass,
  20606. 'is-stacked-on-mobile': isStackedOnMobile,
  20607. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  20608. 'is-image-fill': imageFill
  20609. });
  20610. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  20611. let gridTemplateColumns;
  20612. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  20613. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  20614. }
  20615. const style = {
  20616. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  20617. gridTemplateColumns
  20618. };
  20619. return (0,external_wp_element_namespaceObject.createElement)("div", {
  20620. className: className,
  20621. style: style
  20622. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  20623. className: "wp-block-media-text__media",
  20624. style: backgroundStyles
  20625. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  20626. className: "wp-block-media-text__content"
  20627. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  20628. }
  20629. }, {
  20630. attributes: { ...baseAttributes,
  20631. customBackgroundColor: {
  20632. type: 'string'
  20633. },
  20634. mediaUrl: {
  20635. type: 'string',
  20636. source: 'attribute',
  20637. selector: 'figure video,figure img',
  20638. attribute: 'src'
  20639. }
  20640. },
  20641. save(_ref3) {
  20642. let {
  20643. attributes
  20644. } = _ref3;
  20645. const {
  20646. backgroundColor,
  20647. customBackgroundColor,
  20648. isStackedOnMobile,
  20649. mediaAlt,
  20650. mediaPosition,
  20651. mediaType,
  20652. mediaUrl,
  20653. mediaWidth
  20654. } = attributes;
  20655. const mediaTypeRenders = {
  20656. image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
  20657. src: mediaUrl,
  20658. alt: mediaAlt
  20659. }),
  20660. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  20661. controls: true,
  20662. src: mediaUrl
  20663. })
  20664. };
  20665. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  20666. const className = classnames_default()({
  20667. 'has-media-on-the-right': 'right' === mediaPosition,
  20668. [backgroundClass]: backgroundClass,
  20669. 'is-stacked-on-mobile': isStackedOnMobile
  20670. });
  20671. let gridTemplateColumns;
  20672. if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
  20673. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  20674. }
  20675. const style = {
  20676. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  20677. gridTemplateColumns
  20678. };
  20679. return (0,external_wp_element_namespaceObject.createElement)("div", {
  20680. className: className,
  20681. style: style
  20682. }, (0,external_wp_element_namespaceObject.createElement)("figure", {
  20683. className: "wp-block-media-text__media"
  20684. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
  20685. className: "wp-block-media-text__content"
  20686. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  20687. }
  20688. }]);
  20689. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-left.js
  20690. /**
  20691. * WordPress dependencies
  20692. */
  20693. const pullLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20694. xmlns: "http://www.w3.org/2000/svg",
  20695. viewBox: "0 0 24 24"
  20696. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20697. d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"
  20698. }));
  20699. /* harmony default export */ var pull_left = (pullLeft);
  20700. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js
  20701. /**
  20702. * WordPress dependencies
  20703. */
  20704. const pullRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  20705. xmlns: "http://www.w3.org/2000/svg",
  20706. viewBox: "0 0 24 24"
  20707. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  20708. d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"
  20709. }));
  20710. /* harmony default export */ var pull_right = (pullRight);
  20711. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js
  20712. const DEFAULT_MEDIA_SIZE_SLUG = 'full';
  20713. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js
  20714. /**
  20715. * External dependencies
  20716. */
  20717. /**
  20718. * WordPress dependencies
  20719. */
  20720. /**
  20721. * Internal dependencies
  20722. */
  20723. /**
  20724. * Constants
  20725. */
  20726. const media_text_edit_TEMPLATE = [['core/paragraph', {
  20727. fontSize: 'large',
  20728. placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder')
  20729. }]]; // this limits the resize to a safe zone to avoid making broken layouts
  20730. const WIDTH_CONSTRAINT_PERCENTAGE = 15;
  20731. const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE));
  20732. const edit_LINK_DESTINATION_MEDIA = 'media';
  20733. const edit_LINK_DESTINATION_ATTACHMENT = 'attachment';
  20734. function getImageSourceUrlBySizeSlug(image, slug) {
  20735. var _image$media_details, _image$media_details$, _image$media_details$2;
  20736. // eslint-disable-next-line camelcase
  20737. return image === null || image === void 0 ? void 0 : (_image$media_details = image.media_details) === null || _image$media_details === void 0 ? void 0 : (_image$media_details$ = _image$media_details.sizes) === null || _image$media_details$ === void 0 ? void 0 : (_image$media_details$2 = _image$media_details$[slug]) === null || _image$media_details$2 === void 0 ? void 0 : _image$media_details$2.source_url;
  20738. }
  20739. function edit_attributesFromMedia(_ref) {
  20740. let {
  20741. attributes: {
  20742. linkDestination,
  20743. href
  20744. },
  20745. setAttributes
  20746. } = _ref;
  20747. return media => {
  20748. if (!media || !media.url) {
  20749. setAttributes({
  20750. mediaAlt: undefined,
  20751. mediaId: undefined,
  20752. mediaType: undefined,
  20753. mediaUrl: undefined,
  20754. mediaLink: undefined,
  20755. href: undefined,
  20756. focalPoint: undefined
  20757. });
  20758. return;
  20759. }
  20760. if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
  20761. media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
  20762. }
  20763. let mediaType;
  20764. let src; // For media selections originated from a file upload.
  20765. if (media.media_type) {
  20766. if (media.media_type === 'image') {
  20767. mediaType = 'image';
  20768. } else {
  20769. // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
  20770. // video contain the media type of 'file' in the object returned from the rest api.
  20771. mediaType = 'video';
  20772. }
  20773. } else {
  20774. // For media selections originated from existing files in the media library.
  20775. mediaType = media.type;
  20776. }
  20777. if (mediaType === 'image') {
  20778. var _media$sizes, _media$sizes$large, _media$media_details, _media$media_details$, _media$media_details$2;
  20779. // Try the "large" size URL, falling back to the "full" size URL below.
  20780. src = ((_media$sizes = media.sizes) === null || _media$sizes === void 0 ? void 0 : (_media$sizes$large = _media$sizes.large) === null || _media$sizes$large === void 0 ? void 0 : _media$sizes$large.url) || ( // eslint-disable-next-line camelcase
  20781. (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$.large) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url);
  20782. }
  20783. let newHref = href;
  20784. if (linkDestination === edit_LINK_DESTINATION_MEDIA) {
  20785. // Update the media link.
  20786. newHref = media.url;
  20787. } // Check if the image is linked to the attachment page.
  20788. if (linkDestination === edit_LINK_DESTINATION_ATTACHMENT) {
  20789. // Update the media link.
  20790. newHref = media.link;
  20791. }
  20792. setAttributes({
  20793. mediaAlt: media.alt,
  20794. mediaId: media.id,
  20795. mediaType,
  20796. mediaUrl: src || media.url,
  20797. mediaLink: media.link || undefined,
  20798. href: newHref,
  20799. focalPoint: undefined
  20800. });
  20801. };
  20802. }
  20803. function MediaTextEdit(_ref2) {
  20804. let {
  20805. attributes,
  20806. isSelected,
  20807. setAttributes
  20808. } = _ref2;
  20809. const {
  20810. focalPoint,
  20811. href,
  20812. imageFill,
  20813. isStackedOnMobile,
  20814. linkClass,
  20815. linkDestination,
  20816. linkTarget,
  20817. mediaAlt,
  20818. mediaId,
  20819. mediaPosition,
  20820. mediaType,
  20821. mediaUrl,
  20822. mediaWidth,
  20823. rel,
  20824. verticalAlignment
  20825. } = attributes;
  20826. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  20827. const image = (0,external_wp_data_namespaceObject.useSelect)(select => mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, {
  20828. context: 'view'
  20829. }) : null, [isSelected, mediaId]);
  20830. const refMediaContainer = (0,external_wp_element_namespaceObject.useRef)();
  20831. const imperativeFocalPointPreview = value => {
  20832. const {
  20833. style
  20834. } = refMediaContainer.current.resizable;
  20835. const {
  20836. x,
  20837. y
  20838. } = value;
  20839. style.backgroundPosition = `${x * 100}% ${y * 100}%`;
  20840. };
  20841. const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null);
  20842. const onSelectMedia = edit_attributesFromMedia({
  20843. attributes,
  20844. setAttributes
  20845. });
  20846. const onSetHref = props => {
  20847. setAttributes(props);
  20848. };
  20849. const onWidthChange = width => {
  20850. setTemporaryMediaWidth(applyWidthConstraints(width));
  20851. };
  20852. const commitWidthChange = width => {
  20853. setAttributes({
  20854. mediaWidth: applyWidthConstraints(width)
  20855. });
  20856. setTemporaryMediaWidth(applyWidthConstraints(width));
  20857. };
  20858. const classNames = classnames_default()({
  20859. 'has-media-on-the-right': 'right' === mediaPosition,
  20860. 'is-selected': isSelected,
  20861. 'is-stacked-on-mobile': isStackedOnMobile,
  20862. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  20863. 'is-image-fill': imageFill
  20864. });
  20865. const widthString = `${temporaryMediaWidth || mediaWidth}%`;
  20866. const gridTemplateColumns = 'right' === mediaPosition ? `1fr ${widthString}` : `${widthString} 1fr`;
  20867. const style = {
  20868. gridTemplateColumns,
  20869. msGridColumns: gridTemplateColumns
  20870. };
  20871. const onMediaAltChange = newMediaAlt => {
  20872. setAttributes({
  20873. mediaAlt: newMediaAlt
  20874. });
  20875. };
  20876. const onVerticalAlignmentChange = alignment => {
  20877. setAttributes({
  20878. verticalAlignment: alignment
  20879. });
  20880. };
  20881. const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => {
  20882. const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
  20883. return settings === null || settings === void 0 ? void 0 : settings.imageSizes;
  20884. }, []);
  20885. const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref3 => {
  20886. let {
  20887. slug
  20888. } = _ref3;
  20889. return getImageSourceUrlBySizeSlug(image, slug);
  20890. }), _ref4 => {
  20891. let {
  20892. name,
  20893. slug
  20894. } = _ref4;
  20895. return {
  20896. value: slug,
  20897. label: name
  20898. };
  20899. });
  20900. const updateImage = newMediaSizeSlug => {
  20901. const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug);
  20902. if (!newUrl) {
  20903. return null;
  20904. }
  20905. setAttributes({
  20906. mediaUrl: newUrl,
  20907. mediaSizeSlug: newMediaSizeSlug
  20908. });
  20909. };
  20910. const mediaTextGeneralSettings = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  20911. title: (0,external_wp_i18n_namespaceObject.__)('Media & Text settings')
  20912. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20913. label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'),
  20914. checked: isStackedOnMobile,
  20915. onChange: () => setAttributes({
  20916. isStackedOnMobile: !isStackedOnMobile
  20917. })
  20918. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  20919. label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill entire column'),
  20920. checked: imageFill,
  20921. onChange: () => setAttributes({
  20922. imageFill: !imageFill
  20923. })
  20924. }), imageFill && mediaUrl && mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
  20925. label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
  20926. url: mediaUrl,
  20927. value: focalPoint,
  20928. onChange: value => setAttributes({
  20929. focalPoint: value
  20930. }),
  20931. onDragStart: imperativeFocalPointPreview,
  20932. onDrag: imperativeFocalPointPreview
  20933. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  20934. label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
  20935. value: mediaAlt,
  20936. onChange: onMediaAltChange,
  20937. help: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
  20938. href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
  20939. }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
  20940. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
  20941. onChangeImage: updateImage,
  20942. slug: mediaSizeSlug,
  20943. imageSizeOptions: imageSizeOptions,
  20944. isResizable: false
  20945. }), mediaUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  20946. label: (0,external_wp_i18n_namespaceObject.__)('Media width'),
  20947. value: temporaryMediaWidth || mediaWidth,
  20948. onChange: commitWidthChange,
  20949. min: WIDTH_CONSTRAINT_PERCENTAGE,
  20950. max: 100 - WIDTH_CONSTRAINT_PERCENTAGE
  20951. }));
  20952. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  20953. className: classNames,
  20954. style
  20955. });
  20956. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  20957. className: 'wp-block-media-text__content'
  20958. }, {
  20959. template: media_text_edit_TEMPLATE
  20960. });
  20961. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, mediaTextGeneralSettings), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  20962. group: "block"
  20963. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, {
  20964. onChange: onVerticalAlignmentChange,
  20965. value: verticalAlignment
  20966. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20967. icon: pull_left,
  20968. title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'),
  20969. isActive: mediaPosition === 'left',
  20970. onClick: () => setAttributes({
  20971. mediaPosition: 'left'
  20972. })
  20973. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  20974. icon: pull_right,
  20975. title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'),
  20976. isActive: mediaPosition === 'right',
  20977. onClick: () => setAttributes({
  20978. mediaPosition: 'right'
  20979. })
  20980. }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
  20981. url: href || '',
  20982. onChangeUrl: onSetHref,
  20983. linkDestination: linkDestination,
  20984. mediaType: mediaType,
  20985. mediaUrl: image && image.source_url,
  20986. mediaLink: image && image.link,
  20987. linkTarget: linkTarget,
  20988. linkClass: linkClass,
  20989. rel: rel
  20990. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(media_container, {
  20991. className: "wp-block-media-text__media",
  20992. onSelectMedia: onSelectMedia,
  20993. onWidthChange: onWidthChange,
  20994. commitWidthChange: commitWidthChange,
  20995. ref: refMediaContainer,
  20996. focalPoint,
  20997. imageFill,
  20998. isSelected,
  20999. isStackedOnMobile,
  21000. mediaAlt,
  21001. mediaId,
  21002. mediaPosition,
  21003. mediaType,
  21004. mediaUrl,
  21005. mediaWidth
  21006. }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  21007. }
  21008. /* harmony default export */ var media_text_edit = (MediaTextEdit);
  21009. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js
  21010. /**
  21011. * External dependencies
  21012. */
  21013. /**
  21014. * WordPress dependencies
  21015. */
  21016. /**
  21017. * Internal dependencies
  21018. */
  21019. const save_DEFAULT_MEDIA_WIDTH = 50;
  21020. function media_text_save_save(_ref) {
  21021. let {
  21022. attributes
  21023. } = _ref;
  21024. const {
  21025. isStackedOnMobile,
  21026. mediaAlt,
  21027. mediaPosition,
  21028. mediaType,
  21029. mediaUrl,
  21030. mediaWidth,
  21031. mediaId,
  21032. verticalAlignment,
  21033. imageFill,
  21034. focalPoint,
  21035. linkClass,
  21036. href,
  21037. linkTarget,
  21038. rel
  21039. } = attributes;
  21040. const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  21041. const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
  21042. const imageClasses = classnames_default()({
  21043. [`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
  21044. [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
  21045. });
  21046. let image = (0,external_wp_element_namespaceObject.createElement)("img", {
  21047. src: mediaUrl,
  21048. alt: mediaAlt,
  21049. className: imageClasses || null
  21050. });
  21051. if (href) {
  21052. image = (0,external_wp_element_namespaceObject.createElement)("a", {
  21053. className: linkClass,
  21054. href: href,
  21055. target: linkTarget,
  21056. rel: newRel
  21057. }, image);
  21058. }
  21059. const mediaTypeRenders = {
  21060. image: () => image,
  21061. video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
  21062. controls: true,
  21063. src: mediaUrl
  21064. })
  21065. };
  21066. const className = classnames_default()({
  21067. 'has-media-on-the-right': 'right' === mediaPosition,
  21068. 'is-stacked-on-mobile': isStackedOnMobile,
  21069. [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
  21070. 'is-image-fill': imageFill
  21071. });
  21072. const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  21073. let gridTemplateColumns;
  21074. if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) {
  21075. gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  21076. }
  21077. const style = {
  21078. gridTemplateColumns
  21079. };
  21080. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  21081. className,
  21082. style
  21083. }), (0,external_wp_element_namespaceObject.createElement)("figure", {
  21084. className: "wp-block-media-text__media",
  21085. style: backgroundStyles
  21086. }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
  21087. className: 'wp-block-media-text__content'
  21088. })));
  21089. }
  21090. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js
  21091. /**
  21092. * WordPress dependencies
  21093. */
  21094. const media_text_transforms_transforms = {
  21095. from: [{
  21096. type: 'block',
  21097. blocks: ['core/image'],
  21098. transform: _ref => {
  21099. let {
  21100. alt,
  21101. url,
  21102. id,
  21103. anchor
  21104. } = _ref;
  21105. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  21106. mediaAlt: alt,
  21107. mediaId: id,
  21108. mediaUrl: url,
  21109. mediaType: 'image',
  21110. anchor
  21111. });
  21112. }
  21113. }, {
  21114. type: 'block',
  21115. blocks: ['core/video'],
  21116. transform: _ref2 => {
  21117. let {
  21118. src,
  21119. id,
  21120. anchor
  21121. } = _ref2;
  21122. return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
  21123. mediaId: id,
  21124. mediaUrl: src,
  21125. mediaType: 'video',
  21126. anchor
  21127. });
  21128. }
  21129. }],
  21130. to: [{
  21131. type: 'block',
  21132. blocks: ['core/image'],
  21133. isMatch: _ref3 => {
  21134. let {
  21135. mediaType,
  21136. mediaUrl
  21137. } = _ref3;
  21138. return !mediaUrl || mediaType === 'image';
  21139. },
  21140. transform: _ref4 => {
  21141. let {
  21142. mediaAlt,
  21143. mediaId,
  21144. mediaUrl,
  21145. anchor
  21146. } = _ref4;
  21147. return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
  21148. alt: mediaAlt,
  21149. id: mediaId,
  21150. url: mediaUrl,
  21151. anchor
  21152. });
  21153. }
  21154. }, {
  21155. type: 'block',
  21156. blocks: ['core/video'],
  21157. isMatch: _ref5 => {
  21158. let {
  21159. mediaType,
  21160. mediaUrl
  21161. } = _ref5;
  21162. return !mediaUrl || mediaType === 'video';
  21163. },
  21164. transform: _ref6 => {
  21165. let {
  21166. mediaId,
  21167. mediaUrl,
  21168. anchor
  21169. } = _ref6;
  21170. return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  21171. id: mediaId,
  21172. src: mediaUrl,
  21173. anchor
  21174. });
  21175. }
  21176. }]
  21177. };
  21178. /* harmony default export */ var media_text_transforms = (media_text_transforms_transforms);
  21179. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
  21180. /**
  21181. * WordPress dependencies
  21182. */
  21183. /**
  21184. * Internal dependencies
  21185. */
  21186. const media_text_metadata = {
  21187. $schema: "https://schemas.wp.org/trunk/block.json",
  21188. apiVersion: 2,
  21189. name: "core/media-text",
  21190. title: "Media & Text",
  21191. category: "media",
  21192. description: "Set media and words side-by-side for a richer layout.",
  21193. keywords: ["image", "video"],
  21194. textdomain: "default",
  21195. attributes: {
  21196. align: {
  21197. type: "string",
  21198. "default": "wide"
  21199. },
  21200. mediaAlt: {
  21201. type: "string",
  21202. source: "attribute",
  21203. selector: "figure img",
  21204. attribute: "alt",
  21205. "default": ""
  21206. },
  21207. mediaPosition: {
  21208. type: "string",
  21209. "default": "left"
  21210. },
  21211. mediaId: {
  21212. type: "number"
  21213. },
  21214. mediaUrl: {
  21215. type: "string",
  21216. source: "attribute",
  21217. selector: "figure video,figure img",
  21218. attribute: "src"
  21219. },
  21220. mediaLink: {
  21221. type: "string"
  21222. },
  21223. linkDestination: {
  21224. type: "string"
  21225. },
  21226. linkTarget: {
  21227. type: "string",
  21228. source: "attribute",
  21229. selector: "figure a",
  21230. attribute: "target"
  21231. },
  21232. href: {
  21233. type: "string",
  21234. source: "attribute",
  21235. selector: "figure a",
  21236. attribute: "href"
  21237. },
  21238. rel: {
  21239. type: "string",
  21240. source: "attribute",
  21241. selector: "figure a",
  21242. attribute: "rel"
  21243. },
  21244. linkClass: {
  21245. type: "string",
  21246. source: "attribute",
  21247. selector: "figure a",
  21248. attribute: "class"
  21249. },
  21250. mediaType: {
  21251. type: "string"
  21252. },
  21253. mediaWidth: {
  21254. type: "number",
  21255. "default": 50
  21256. },
  21257. mediaSizeSlug: {
  21258. type: "string"
  21259. },
  21260. isStackedOnMobile: {
  21261. type: "boolean",
  21262. "default": true
  21263. },
  21264. verticalAlignment: {
  21265. type: "string"
  21266. },
  21267. imageFill: {
  21268. type: "boolean"
  21269. },
  21270. focalPoint: {
  21271. type: "object"
  21272. }
  21273. },
  21274. supports: {
  21275. anchor: true,
  21276. align: ["wide", "full"],
  21277. html: false,
  21278. color: {
  21279. gradients: true,
  21280. link: true,
  21281. __experimentalDefaultControls: {
  21282. background: true,
  21283. text: true
  21284. }
  21285. }
  21286. },
  21287. editorStyle: "wp-block-media-text-editor",
  21288. style: "wp-block-media-text"
  21289. };
  21290. const {
  21291. name: media_text_name
  21292. } = media_text_metadata;
  21293. const media_text_settings = {
  21294. icon: media_and_text,
  21295. example: {
  21296. viewportWidth: 601,
  21297. // Columns collapse "@media (max-width: 600px)".
  21298. attributes: {
  21299. mediaType: 'image',
  21300. mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg'
  21301. },
  21302. innerBlocks: [{
  21303. name: 'core/paragraph',
  21304. attributes: {
  21305. content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.')
  21306. }
  21307. }, {
  21308. name: 'core/paragraph',
  21309. attributes: {
  21310. content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)')
  21311. }
  21312. }]
  21313. },
  21314. transforms: media_text_transforms,
  21315. edit: media_text_edit,
  21316. save: media_text_save_save,
  21317. deprecated: media_text_deprecated
  21318. };
  21319. ;// CONCATENATED MODULE: external ["wp","dom"]
  21320. var external_wp_dom_namespaceObject = window["wp"]["dom"];
  21321. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
  21322. /**
  21323. * WordPress dependencies
  21324. */
  21325. function MissingBlockWarning(_ref) {
  21326. let {
  21327. attributes,
  21328. convertToHTML
  21329. } = _ref;
  21330. const {
  21331. originalName,
  21332. originalUndelimitedContent
  21333. } = attributes;
  21334. const hasContent = !!originalUndelimitedContent;
  21335. const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
  21336. const actions = [];
  21337. let messageHTML;
  21338. if (hasContent && hasHTMLBlock) {
  21339. messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
  21340. /* translators: %s: block name */
  21341. (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), originalName);
  21342. actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  21343. key: "convert",
  21344. onClick: convertToHTML,
  21345. variant: "primary"
  21346. }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')));
  21347. } else {
  21348. messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(
  21349. /* translators: %s: block name */
  21350. (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'), originalName);
  21351. }
  21352. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  21353. className: 'has-warning'
  21354. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
  21355. actions: actions
  21356. }, messageHTML), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent)));
  21357. }
  21358. const MissingEdit = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref2) => {
  21359. let {
  21360. clientId,
  21361. attributes
  21362. } = _ref2;
  21363. const {
  21364. replaceBlock
  21365. } = dispatch(external_wp_blockEditor_namespaceObject.store);
  21366. return {
  21367. convertToHTML() {
  21368. replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
  21369. content: attributes.originalUndelimitedContent
  21370. }));
  21371. }
  21372. };
  21373. })(MissingBlockWarning);
  21374. /* harmony default export */ var missing_edit = (MissingEdit);
  21375. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js
  21376. /**
  21377. * WordPress dependencies
  21378. */
  21379. function missing_save_save(_ref) {
  21380. let {
  21381. attributes
  21382. } = _ref;
  21383. // Preserve the missing block's content.
  21384. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.originalContent);
  21385. }
  21386. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js
  21387. /**
  21388. * WordPress dependencies
  21389. */
  21390. /**
  21391. * Internal dependencies
  21392. */
  21393. const missing_metadata = {
  21394. $schema: "https://schemas.wp.org/trunk/block.json",
  21395. apiVersion: 2,
  21396. name: "core/missing",
  21397. title: "Unsupported",
  21398. category: "text",
  21399. description: "Your site doesn\u2019t include support for this block.",
  21400. textdomain: "default",
  21401. attributes: {
  21402. originalName: {
  21403. type: "string"
  21404. },
  21405. originalUndelimitedContent: {
  21406. type: "string"
  21407. },
  21408. originalContent: {
  21409. type: "string",
  21410. source: "html"
  21411. }
  21412. },
  21413. supports: {
  21414. className: false,
  21415. customClassName: false,
  21416. inserter: false,
  21417. html: false,
  21418. reusable: false
  21419. }
  21420. };
  21421. const {
  21422. name: missing_name
  21423. } = missing_metadata;
  21424. const missing_settings = {
  21425. name: missing_name,
  21426. __experimentalLabel(attributes, _ref) {
  21427. let {
  21428. context
  21429. } = _ref;
  21430. if (context === 'accessibility') {
  21431. const {
  21432. originalName
  21433. } = attributes;
  21434. const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined;
  21435. if (originalBlockType) {
  21436. return originalBlockType.settings.title || originalName;
  21437. }
  21438. return '';
  21439. }
  21440. },
  21441. edit: missing_edit,
  21442. save: missing_save_save
  21443. };
  21444. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js
  21445. /**
  21446. * WordPress dependencies
  21447. */
  21448. const more = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21449. viewBox: "0 0 24 24",
  21450. xmlns: "http://www.w3.org/2000/svg"
  21451. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21452. d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"
  21453. }));
  21454. /* harmony default export */ var library_more = (more);
  21455. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js
  21456. /**
  21457. * WordPress dependencies
  21458. */
  21459. const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more');
  21460. function MoreEdit(_ref) {
  21461. let {
  21462. attributes: {
  21463. customText,
  21464. noTeaser
  21465. },
  21466. insertBlocksAfter,
  21467. setAttributes
  21468. } = _ref;
  21469. const onChangeInput = event => {
  21470. setAttributes({
  21471. customText: event.target.value !== '' ? event.target.value : undefined
  21472. });
  21473. };
  21474. const onKeyDown = _ref2 => {
  21475. let {
  21476. keyCode
  21477. } = _ref2;
  21478. if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  21479. insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]);
  21480. }
  21481. };
  21482. const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.');
  21483. const toggleHideExcerpt = () => setAttributes({
  21484. noTeaser: !noTeaser
  21485. });
  21486. const style = {
  21487. width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em`
  21488. };
  21489. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  21490. label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'),
  21491. checked: !!noTeaser,
  21492. onChange: toggleHideExcerpt,
  21493. help: getHideExcerptHelp
  21494. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  21495. className: "wp-block-more"
  21496. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  21497. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Read more link text'),
  21498. type: "text",
  21499. value: customText,
  21500. placeholder: DEFAULT_TEXT,
  21501. onChange: onChangeInput,
  21502. onKeyDown: onKeyDown,
  21503. style: style
  21504. }))));
  21505. }
  21506. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js
  21507. /**
  21508. * External dependencies
  21509. */
  21510. /**
  21511. * WordPress dependencies
  21512. */
  21513. function more_save_save(_ref) {
  21514. let {
  21515. attributes: {
  21516. customText,
  21517. noTeaser
  21518. }
  21519. } = _ref;
  21520. const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->';
  21521. const noTeaserTag = noTeaser ? '<!--noteaser-->' : '';
  21522. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_lodash_namespaceObject.compact)([moreTag, noTeaserTag]).join('\n'));
  21523. }
  21524. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js
  21525. /**
  21526. * WordPress dependencies
  21527. */
  21528. const more_transforms_transforms = {
  21529. from: [{
  21530. type: 'raw',
  21531. schema: {
  21532. 'wp-block': {
  21533. attributes: ['data-block']
  21534. }
  21535. },
  21536. isMatch: node => node.dataset && node.dataset.block === 'core/more',
  21537. transform(node) {
  21538. const {
  21539. customText,
  21540. noTeaser
  21541. } = node.dataset;
  21542. const attrs = {}; // Don't copy unless defined and not an empty string.
  21543. if (customText) {
  21544. attrs.customText = customText;
  21545. } // Special handling for boolean.
  21546. if (noTeaser === '') {
  21547. attrs.noTeaser = true;
  21548. }
  21549. return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs);
  21550. }
  21551. }]
  21552. };
  21553. /* harmony default export */ var more_transforms = (more_transforms_transforms);
  21554. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js
  21555. /**
  21556. * WordPress dependencies
  21557. */
  21558. /**
  21559. * Internal dependencies
  21560. */
  21561. const more_metadata = {
  21562. $schema: "https://schemas.wp.org/trunk/block.json",
  21563. apiVersion: 2,
  21564. name: "core/more",
  21565. title: "More",
  21566. category: "design",
  21567. description: "Content before this block will be shown in the excerpt on your archives page.",
  21568. keywords: ["read more"],
  21569. textdomain: "default",
  21570. attributes: {
  21571. customText: {
  21572. type: "string"
  21573. },
  21574. noTeaser: {
  21575. type: "boolean",
  21576. "default": false
  21577. }
  21578. },
  21579. supports: {
  21580. customClassName: false,
  21581. className: false,
  21582. html: false,
  21583. multiple: false
  21584. },
  21585. editorStyle: "wp-block-more-editor"
  21586. };
  21587. const {
  21588. name: more_name
  21589. } = more_metadata;
  21590. const more_settings = {
  21591. icon: library_more,
  21592. example: {},
  21593. __experimentalLabel(attributes, _ref) {
  21594. let {
  21595. context
  21596. } = _ref;
  21597. if (context === 'accessibility') {
  21598. return attributes.customText;
  21599. }
  21600. },
  21601. transforms: more_transforms,
  21602. edit: MoreEdit,
  21603. save: more_save_save
  21604. };
  21605. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
  21606. /**
  21607. * WordPress dependencies
  21608. */
  21609. const navigation = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21610. viewBox: "0 0 24 24",
  21611. xmlns: "http://www.w3.org/2000/svg"
  21612. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21613. d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
  21614. }));
  21615. /* harmony default export */ var library_navigation = (navigation);
  21616. ;// CONCATENATED MODULE: external ["wp","a11y"]
  21617. var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
  21618. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js
  21619. /**
  21620. * WordPress dependencies
  21621. */
  21622. function useNavigationMenu(ref) {
  21623. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  21624. var _navigationMenu;
  21625. const {
  21626. getEntityRecord,
  21627. getEditedEntityRecord,
  21628. getEntityRecords,
  21629. hasFinishedResolution,
  21630. isResolving,
  21631. canUser
  21632. } = select(external_wp_coreData_namespaceObject.store);
  21633. const navigationMenuSingleArgs = ['postType', 'wp_navigation', ref];
  21634. const rawNavigationMenu = ref ? getEntityRecord(...navigationMenuSingleArgs) : null;
  21635. let navigationMenu = ref ? getEditedEntityRecord(...navigationMenuSingleArgs) : null; // getEditedEntityRecord will return the post regardless of status.
  21636. // Therefore if the found post is not published then we should ignore it.
  21637. if (((_navigationMenu = navigationMenu) === null || _navigationMenu === void 0 ? void 0 : _navigationMenu.status) !== 'publish') {
  21638. navigationMenu = null;
  21639. }
  21640. const hasResolvedNavigationMenu = ref ? hasFinishedResolution('getEditedEntityRecord', navigationMenuSingleArgs) : false;
  21641. const navigationMenuMultipleArgs = ['postType', 'wp_navigation', {
  21642. per_page: -1,
  21643. status: 'publish'
  21644. }];
  21645. const navigationMenus = getEntityRecords(...navigationMenuMultipleArgs);
  21646. const canSwitchNavigationMenu = ref ? (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1 : (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 0;
  21647. return {
  21648. isNavigationMenuResolved: hasResolvedNavigationMenu,
  21649. isNavigationMenuMissing: !ref || hasResolvedNavigationMenu && !rawNavigationMenu,
  21650. canSwitchNavigationMenu,
  21651. isResolvingNavigationMenus: isResolving('getEntityRecords', navigationMenuMultipleArgs),
  21652. hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenuMultipleArgs),
  21653. navigationMenu,
  21654. navigationMenus,
  21655. canUserUpdateNavigationMenu: ref ? canUser('update', 'navigation', ref) : undefined,
  21656. hasResolvedCanUserUpdateNavigationMenu: hasFinishedResolution('canUser', ['update', 'navigation', ref]),
  21657. canUserDeleteNavigationMenu: ref ? canUser('delete', 'navigation', ref) : undefined,
  21658. hasResolvedCanUserDeleteNavigationMenu: hasFinishedResolution('canUser', ['delete', 'navigation', ref]),
  21659. canUserCreateNavigationMenu: canUser('create', 'navigation'),
  21660. isResolvingCanUserCreateNavigationMenu: isResolving('canUser', ['create', 'navigation']),
  21661. hasResolvedCanUserCreateNavigationMenu: hasFinishedResolution('canUser', ['create', 'navigation'])
  21662. };
  21663. }, [ref]);
  21664. }
  21665. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js
  21666. /**
  21667. * WordPress dependencies
  21668. */
  21669. /**
  21670. * @typedef {Object} NavigationEntitiesData
  21671. * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page".
  21672. * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving.
  21673. * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving.
  21674. * @property {Array|undefined} menus - a collection of Menu entity objects.
  21675. * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving.
  21676. * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving.
  21677. * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId.
  21678. * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving.
  21679. * @property {boolean} hasPages - indicates whether there is currently any data for pages.
  21680. * @property {boolean} hasMenus - indicates whether there is currently any data for menus.
  21681. */
  21682. /**
  21683. * Manages fetching and resolution state for all entities required
  21684. * for the Navigation block.
  21685. *
  21686. * @param {number} menuId the menu for which to retrieve menuItem data.
  21687. * @return { NavigationEntitiesData } the entity data.
  21688. */
  21689. function useNavigationEntities(menuId) {
  21690. const {
  21691. records: menus,
  21692. isResolving: isResolvingMenus,
  21693. hasResolved: hasResolvedMenus
  21694. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('root', 'menu', {
  21695. per_page: -1,
  21696. context: 'view'
  21697. });
  21698. const {
  21699. records: pages,
  21700. isResolving: isResolvingPages,
  21701. hasResolved: hasResolvedPages
  21702. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
  21703. parent: 0,
  21704. order: 'asc',
  21705. orderby: 'id',
  21706. per_page: -1,
  21707. context: 'view'
  21708. });
  21709. const {
  21710. records: menuItems,
  21711. hasResolved: hasResolvedMenuItems
  21712. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('root', 'menuItem', {
  21713. menus: menuId,
  21714. per_page: -1,
  21715. context: 'view'
  21716. }, {
  21717. enabled: !!menuId
  21718. });
  21719. return {
  21720. pages,
  21721. isResolvingPages,
  21722. hasResolvedPages,
  21723. hasPages: !!(hasResolvedPages && pages !== null && pages !== void 0 && pages.length),
  21724. menus,
  21725. isResolvingMenus,
  21726. hasResolvedMenus,
  21727. hasMenus: !!(hasResolvedMenus && menus !== null && menus !== void 0 && menus.length),
  21728. menuItems,
  21729. hasResolvedMenuItems
  21730. };
  21731. }
  21732. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
  21733. /**
  21734. * WordPress dependencies
  21735. */
  21736. /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
  21737. /**
  21738. * Return an SVG icon.
  21739. *
  21740. * @param {IconProps} props icon is the SVG component to render
  21741. * size is a number specifiying the icon size in pixels
  21742. * Other props will be passed to wrapped SVG component
  21743. *
  21744. * @return {JSX.Element} Icon component
  21745. */
  21746. function Icon(_ref) {
  21747. let {
  21748. icon,
  21749. size = 24,
  21750. ...props
  21751. } = _ref;
  21752. return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
  21753. width: size,
  21754. height: size,
  21755. ...props
  21756. });
  21757. }
  21758. /* harmony default export */ var icon = (Icon);
  21759. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js
  21760. /**
  21761. * WordPress dependencies
  21762. */
  21763. const PlaceholderPreview = _ref => {
  21764. let {
  21765. isVisible = true
  21766. } = _ref;
  21767. return (0,external_wp_element_namespaceObject.createElement)("div", {
  21768. "aria-hidden": !isVisible ? true : undefined,
  21769. className: "wp-block-navigation-placeholder__preview"
  21770. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  21771. className: "wp-block-navigation-placeholder__actions__indicator"
  21772. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  21773. icon: library_navigation
  21774. }), (0,external_wp_i18n_namespaceObject.__)('Navigation')));
  21775. };
  21776. /* harmony default export */ var placeholder_preview = (PlaceholderPreview);
  21777. ;// CONCATENATED MODULE: external ["wp","htmlEntities"]
  21778. var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
  21779. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js
  21780. /**
  21781. * WordPress dependencies
  21782. */
  21783. /**
  21784. * Internal dependencies
  21785. */
  21786. function NavigationMenuSelector(_ref, forwardedRef) {
  21787. let {
  21788. currentMenuId,
  21789. onSelect,
  21790. onCreateNew,
  21791. showManageActions = false,
  21792. actionLabel,
  21793. toggleProps = {}
  21794. } = _ref;
  21795. /* translators: %s: The name of a menu. */
  21796. const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'");
  21797. actionLabel = actionLabel || createActionLabel;
  21798. const {
  21799. menus: classicMenus
  21800. } = useNavigationEntities();
  21801. const {
  21802. navigationMenus,
  21803. canUserCreateNavigationMenu,
  21804. canUserUpdateNavigationMenu,
  21805. canSwitchNavigationMenu
  21806. } = useNavigationMenu();
  21807. const handleSelect = (0,external_wp_element_namespaceObject.useCallback)(_onClose => selectedId => {
  21808. _onClose();
  21809. onSelect(navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.find(post => post.id === selectedId));
  21810. }, [navigationMenus]);
  21811. const handleSelectClassic = (0,external_wp_element_namespaceObject.useCallback)((_onClose, menu) => () => {
  21812. _onClose();
  21813. onSelect(menu);
  21814. }, []);
  21815. const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => {
  21816. return (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.map(_ref2 => {
  21817. let {
  21818. id,
  21819. title
  21820. } = _ref2;
  21821. const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title.rendered);
  21822. return {
  21823. value: id,
  21824. label,
  21825. ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label)
  21826. };
  21827. })) || [];
  21828. }, [navigationMenus]);
  21829. const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
  21830. const hasClassicMenus = !!(classicMenus !== null && classicMenus !== void 0 && classicMenus.length);
  21831. const showNavigationMenus = !!canSwitchNavigationMenu;
  21832. const showClassicMenus = !!canUserCreateNavigationMenu;
  21833. const hasManagePermissions = canUserCreateNavigationMenu || canUserUpdateNavigationMenu; // Show the selector if:
  21834. // - has switch or create permissions and there are block or classic menus.
  21835. // - user has create or update permisisons and component should show the menu actions.
  21836. const showSelectMenus = (canSwitchNavigationMenu || canUserCreateNavigationMenu) && (hasNavigationMenus || hasClassicMenus) || hasManagePermissions && showManageActions;
  21837. if (!showSelectMenus) {
  21838. return null;
  21839. }
  21840. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  21841. ref: forwardedRef,
  21842. label: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
  21843. text: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
  21844. icon: null,
  21845. toggleProps: toggleProps
  21846. }, _ref3 => {
  21847. let {
  21848. onClose
  21849. } = _ref3;
  21850. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showNavigationMenus && hasNavigationMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  21851. label: (0,external_wp_i18n_namespaceObject.__)('Menus')
  21852. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
  21853. value: currentMenuId,
  21854. onSelect: handleSelect(onClose),
  21855. choices: menuChoices
  21856. })), showClassicMenus && hasClassicMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  21857. label: (0,external_wp_i18n_namespaceObject.__)('Classic Menus')
  21858. }, classicMenus === null || classicMenus === void 0 ? void 0 : classicMenus.map(menu => {
  21859. const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name);
  21860. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  21861. onClick: handleSelectClassic(onClose, menu),
  21862. key: menu.id,
  21863. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label)
  21864. }, label);
  21865. })), showManageActions && hasManagePermissions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  21866. label: (0,external_wp_i18n_namespaceObject.__)('Tools')
  21867. }, canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  21868. onClick: onCreateNew
  21869. }, (0,external_wp_i18n_namespaceObject.__)('Create new menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  21870. href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
  21871. post_type: 'wp_navigation'
  21872. })
  21873. }, (0,external_wp_i18n_namespaceObject.__)('Manage menus'))));
  21874. });
  21875. }
  21876. /* harmony default export */ var navigation_menu_selector = ((0,external_wp_element_namespaceObject.forwardRef)(NavigationMenuSelector));
  21877. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js
  21878. /**
  21879. * WordPress dependencies
  21880. */
  21881. /**
  21882. * Internal dependencies
  21883. */
  21884. function NavigationPlaceholder(_ref) {
  21885. let {
  21886. isSelected,
  21887. currentMenuId,
  21888. clientId,
  21889. canUserCreateNavigationMenu = false,
  21890. isResolvingCanUserCreateNavigationMenu,
  21891. onFinish,
  21892. onCreateEmpty
  21893. } = _ref;
  21894. const {
  21895. isResolvingMenus,
  21896. hasResolvedMenus
  21897. } = useNavigationEntities();
  21898. (0,external_wp_element_namespaceObject.useEffect)(() => {
  21899. if (!isSelected) {
  21900. return;
  21901. }
  21902. if (isResolvingMenus) {
  21903. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading Navigation block setup options.'));
  21904. }
  21905. if (hasResolvedMenus) {
  21906. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.'));
  21907. }
  21908. }, [isResolvingMenus, isSelected]);
  21909. const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenu;
  21910. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  21911. className: "wp-block-navigation-placeholder"
  21912. }, (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, {
  21913. isVisible: !isSelected
  21914. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  21915. "aria-hidden": !isSelected ? true : undefined,
  21916. className: "wp-block-navigation-placeholder__controls"
  21917. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  21918. className: "wp-block-navigation-placeholder__actions"
  21919. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  21920. className: "wp-block-navigation-placeholder__actions__indicator"
  21921. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  21922. icon: library_navigation
  21923. }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)("hr", null), isResolvingActions && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  21924. currentMenuId: currentMenuId,
  21925. clientId: clientId,
  21926. onSelect: onFinish,
  21927. toggleProps: {
  21928. variant: 'tertiary',
  21929. iconPosition: 'right',
  21930. className: 'wp-block-navigation-placeholder__actions__dropdown'
  21931. }
  21932. }), (0,external_wp_element_namespaceObject.createElement)("hr", null), canUserCreateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  21933. variant: "tertiary",
  21934. onClick: onCreateEmpty
  21935. }, (0,external_wp_i18n_namespaceObject.__)('Start empty'))))));
  21936. }
  21937. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  21938. /**
  21939. * WordPress dependencies
  21940. */
  21941. const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21942. xmlns: "http://www.w3.org/2000/svg",
  21943. viewBox: "0 0 24 24"
  21944. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  21945. d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
  21946. }));
  21947. /* harmony default export */ var library_close = (close_close);
  21948. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js
  21949. /**
  21950. * WordPress dependencies
  21951. */
  21952. function OverlayMenuIcon() {
  21953. return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  21954. xmlns: "http://www.w3.org/2000/svg",
  21955. viewBox: "0 0 24 24",
  21956. width: "24",
  21957. height: "24",
  21958. "aria-hidden": "true",
  21959. focusable: "false"
  21960. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  21961. x: "4",
  21962. y: "7.5",
  21963. width: "16",
  21964. height: "1.5"
  21965. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  21966. x: "4",
  21967. y: "15",
  21968. width: "16",
  21969. height: "1.5"
  21970. }));
  21971. }
  21972. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js
  21973. /**
  21974. * External dependencies
  21975. */
  21976. /**
  21977. * WordPress dependencies
  21978. */
  21979. /**
  21980. * Internal dependencies
  21981. */
  21982. function ResponsiveWrapper(_ref) {
  21983. let {
  21984. children,
  21985. id,
  21986. isOpen,
  21987. isResponsive,
  21988. onToggle,
  21989. isHiddenByDefault,
  21990. classNames,
  21991. styles,
  21992. hasIcon
  21993. } = _ref;
  21994. if (!isResponsive) {
  21995. return children;
  21996. }
  21997. const responsiveContainerClasses = classnames_default()('wp-block-navigation__responsive-container', classNames, {
  21998. 'is-menu-open': isOpen,
  21999. 'hidden-by-default': isHiddenByDefault
  22000. });
  22001. const openButtonClasses = classnames_default()('wp-block-navigation__responsive-container-open', {
  22002. 'always-shown': isHiddenByDefault
  22003. });
  22004. const modalId = `${id}-modal`;
  22005. const dialogProps = {
  22006. className: 'wp-block-navigation__responsive-dialog',
  22007. ...(isOpen && {
  22008. role: 'dialog',
  22009. 'aria-modal': true,
  22010. 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu')
  22011. })
  22012. };
  22013. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22014. "aria-haspopup": "true",
  22015. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Open menu'),
  22016. className: openButtonClasses,
  22017. onClick: () => onToggle(true)
  22018. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, null), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", {
  22019. className: "wp-block-navigation__toggle_button_label"
  22020. }, (0,external_wp_i18n_namespaceObject.__)('Menu'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  22021. className: responsiveContainerClasses,
  22022. style: styles,
  22023. id: modalId
  22024. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  22025. className: "wp-block-navigation__responsive-close",
  22026. tabIndex: "-1"
  22027. }, (0,external_wp_element_namespaceObject.createElement)("div", dialogProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22028. className: "wp-block-navigation__responsive-container-close",
  22029. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close menu'),
  22030. onClick: () => onToggle(false)
  22031. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  22032. icon: library_close
  22033. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  22034. className: "wp-block-navigation__responsive-container-content",
  22035. id: `${modalId}-content`
  22036. }, children)))));
  22037. }
  22038. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js
  22039. /**
  22040. * WordPress dependencies
  22041. */
  22042. /**
  22043. * Internal dependencies
  22044. */
  22045. const inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
  22046. const inner_blocks_DEFAULT_BLOCK = {
  22047. name: 'core/navigation-link'
  22048. };
  22049. const LAYOUT = {
  22050. type: 'default',
  22051. alignments: []
  22052. };
  22053. function NavigationInnerBlocks(_ref) {
  22054. let {
  22055. clientId,
  22056. hasCustomPlaceholder,
  22057. orientation
  22058. } = _ref;
  22059. const {
  22060. isImmediateParentOfSelectedBlock,
  22061. selectedBlockHasChildren,
  22062. isSelected
  22063. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  22064. const {
  22065. getBlockCount,
  22066. hasSelectedInnerBlock,
  22067. getSelectedBlockClientId
  22068. } = select(external_wp_blockEditor_namespaceObject.store);
  22069. const selectedBlockId = getSelectedBlockClientId();
  22070. return {
  22071. isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
  22072. selectedBlockHasChildren: !!getBlockCount(selectedBlockId),
  22073. // This prop is already available but computing it here ensures it's
  22074. // fresh compared to isImmediateParentOfSelectedBlock.
  22075. isSelected: selectedBlockId === clientId
  22076. };
  22077. }, [clientId]);
  22078. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation');
  22079. const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
  22080. let {
  22081. name
  22082. } = _ref2;
  22083. return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
  22084. }), [blocks]); // When the block is selected itself or has a top level item selected that
  22085. // doesn't itself have children, show the standard appender. Else show no
  22086. // appender.
  22087. const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren;
  22088. const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, null), []);
  22089. const hasMenuItems = !!(blocks !== null && blocks !== void 0 && blocks.length); // If there is a `ref` attribute pointing to a `wp_navigation` but
  22090. // that menu has no **items** (i.e. empty) then show a placeholder.
  22091. // The block must also be selected else the placeholder will display
  22092. // alongside the appender.
  22093. const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected;
  22094. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  22095. className: 'wp-block-navigation__container'
  22096. }, {
  22097. value: blocks,
  22098. onInput,
  22099. onChange,
  22100. allowedBlocks: inner_blocks_ALLOWED_BLOCKS,
  22101. __experimentalDefaultBlock: inner_blocks_DEFAULT_BLOCK,
  22102. __experimentalDirectInsert: shouldDirectInsert,
  22103. orientation,
  22104. // As an exception to other blocks which feature nesting, show
  22105. // the block appender even when a child block is selected.
  22106. // This should be a temporary fix, to be replaced by improvements to
  22107. // the sibling inserter.
  22108. // See https://github.com/WordPress/gutenberg/issues/37572.
  22109. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
  22110. parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false,
  22111. // Template lock set to false here so that the Nav
  22112. // Block on the experimental menus screen does not
  22113. // inherit templateLock={ 'all' }.
  22114. templateLock: false,
  22115. __experimentalLayout: LAYOUT,
  22116. placeholder: showPlaceholder ? placeholder : undefined
  22117. });
  22118. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
  22119. clientId: clientId,
  22120. tagName: 'div',
  22121. wrapperProps: innerBlocksProps
  22122. });
  22123. }
  22124. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
  22125. /**
  22126. * WordPress dependencies
  22127. */
  22128. function NavigationMenuNameControl() {
  22129. const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  22130. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  22131. label: (0,external_wp_i18n_namespaceObject.__)('Menu name'),
  22132. value: title,
  22133. onChange: updateTitle
  22134. });
  22135. }
  22136. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
  22137. /**
  22138. * Generates a template part Id based on slug and theme inputs.
  22139. *
  22140. * @param {string} theme the template part's theme.
  22141. * @param {string} slug the template part's slug
  22142. * @return {string|null} the template part's Id.
  22143. */
  22144. function createTemplatePartId(theme, slug) {
  22145. return theme && slug ? theme + '//' + slug : null;
  22146. }
  22147. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js
  22148. /**
  22149. * WordPress dependencies
  22150. */
  22151. /**
  22152. * Internal dependencies
  22153. */
  22154. // TODO: this util should perhaps be refactored somewhere like core-data.
  22155. function useTemplatePartAreaLabel(clientId) {
  22156. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  22157. // Use the lack of a clientId as an opportunity to bypass the rest
  22158. // of this hook.
  22159. if (!clientId) {
  22160. return;
  22161. }
  22162. const {
  22163. getBlock,
  22164. getBlockParentsByBlockName
  22165. } = select(external_wp_blockEditor_namespaceObject.store);
  22166. const withAscendingResults = true;
  22167. const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults);
  22168. if (!(parentTemplatePartClientIds !== null && parentTemplatePartClientIds !== void 0 && parentTemplatePartClientIds.length)) {
  22169. return;
  22170. } // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  22171. // Blocks can be loaded into a *non-post* block editor.
  22172. // This code is lifted from this file:
  22173. // packages/block-library/src/template-part/edit/advanced-controls.js
  22174. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  22175. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  22176. const {
  22177. getEditedEntityRecord
  22178. } = select(external_wp_coreData_namespaceObject.store);
  22179. for (const templatePartClientId of parentTemplatePartClientIds) {
  22180. const templatePartBlock = getBlock(templatePartClientId); // The 'area' usually isn't stored on the block, but instead
  22181. // on the entity.
  22182. const {
  22183. theme,
  22184. slug
  22185. } = templatePartBlock.attributes;
  22186. const templatePartEntityId = createTemplatePartId(theme, slug);
  22187. const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); // Look up the `label` for the area in the defined areas so
  22188. // that an internationalized label can be used.
  22189. if (templatePartEntity !== null && templatePartEntity !== void 0 && templatePartEntity.area) {
  22190. var _definedAreas$find;
  22191. return (_definedAreas$find = definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)) === null || _definedAreas$find === void 0 ? void 0 : _definedAreas$find.label;
  22192. }
  22193. }
  22194. }, [clientId]);
  22195. }
  22196. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
  22197. /**
  22198. * WordPress dependencies
  22199. */
  22200. /**
  22201. * Internal dependencies
  22202. */
  22203. const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
  22204. status: 'draft',
  22205. per_page: -1
  22206. }];
  22207. const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', {
  22208. per_page: -1,
  22209. status: 'publish'
  22210. }];
  22211. function useGenerateDefaultNavigationTitle(clientId) {
  22212. // The block will be disabled in a block preview, use this as a way of
  22213. // avoiding the side-effects of this component for block previews.
  22214. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // Because we can't conditionally call hooks, pass an undefined client id
  22215. // arg to bypass the expensive `useTemplateArea` code. The hook will return
  22216. // early.
  22217. const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId);
  22218. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22219. return (0,external_wp_element_namespaceObject.useCallback)(async () => {
  22220. // Ensure other navigation menus have loaded so an
  22221. // accurate name can be created.
  22222. if (isDisabled) {
  22223. return '';
  22224. }
  22225. const {
  22226. getEntityRecords
  22227. } = registry.resolveSelect(external_wp_coreData_namespaceObject.store);
  22228. const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]);
  22229. const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22230. (0,external_wp_i18n_namespaceObject.__)('%s navigation'), area) : // translators: 'navigation' as in website navigation.
  22231. (0,external_wp_i18n_namespaceObject.__)('Navigation'); // Determine how many menus start with the automatic title.
  22232. const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => {
  22233. var _menu$title, _menu$title$raw;
  22234. return menu !== null && menu !== void 0 && (_menu$title = menu.title) !== null && _menu$title !== void 0 && (_menu$title$raw = _menu$title.raw) !== null && _menu$title$raw !== void 0 && _menu$title$raw.startsWith(title) ? count + 1 : count;
  22235. }, 0); // Append a number to the end of the title if a menu with
  22236. // the same name exists.
  22237. const titleWithCount = matchingMenuTitleCount > 0 ? `${title} ${matchingMenuTitleCount + 1}` : title;
  22238. return titleWithCount || '';
  22239. }, [isDisabled, area]);
  22240. }
  22241. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js
  22242. /**
  22243. * WordPress dependencies
  22244. */
  22245. /**
  22246. * Internal dependencies
  22247. */
  22248. const CREATE_NAVIGATION_MENU_SUCCESS = 'success';
  22249. const CREATE_NAVIGATION_MENU_ERROR = 'error';
  22250. const CREATE_NAVIGATION_MENU_PENDING = 'pending';
  22251. const CREATE_NAVIGATION_MENU_IDLE = 'idle';
  22252. function useCreateNavigationMenu(clientId) {
  22253. const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE);
  22254. const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
  22255. const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
  22256. const {
  22257. saveEntityRecord
  22258. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  22259. const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); // This callback uses data from the two placeholder steps and only creates
  22260. // a new navigation menu when the user completes the final step.
  22261. const create = (0,external_wp_element_namespaceObject.useCallback)(async function () {
  22262. let title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  22263. let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22264. // Guard against creating Navigations without a title.
  22265. // Note you can pass no title, but if one is passed it must be
  22266. // a string otherwise the title may end up being empty.
  22267. if (title && typeof title !== 'string') {
  22268. setError('Invalid title supplied when creating Navigation Menu.');
  22269. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  22270. throw new Error(`Value of supplied title argument was not a string.`);
  22271. }
  22272. setStatus(CREATE_NAVIGATION_MENU_PENDING);
  22273. setValue(null);
  22274. setError(null);
  22275. if (!title) {
  22276. title = await generateDefaultTitle().catch(err => {
  22277. setError(err === null || err === void 0 ? void 0 : err.message);
  22278. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  22279. throw new Error('Failed to create title when saving new Navigation Menu.', {
  22280. cause: err
  22281. });
  22282. });
  22283. }
  22284. const record = {
  22285. title,
  22286. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  22287. status: 'publish'
  22288. }; // Return affords ability to await on this function directly
  22289. return saveEntityRecord('postType', 'wp_navigation', record).then(response => {
  22290. setValue(response);
  22291. setStatus(CREATE_NAVIGATION_MENU_SUCCESS);
  22292. return response;
  22293. }).catch(err => {
  22294. setError(err === null || err === void 0 ? void 0 : err.message);
  22295. setStatus(CREATE_NAVIGATION_MENU_ERROR);
  22296. throw new Error('Unable to save new Navigation Menu', {
  22297. cause: err
  22298. });
  22299. });
  22300. }, [external_wp_blocks_namespaceObject.serialize, saveEntityRecord]);
  22301. return {
  22302. create,
  22303. status,
  22304. value,
  22305. error
  22306. };
  22307. }
  22308. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js
  22309. /**
  22310. * External dependencies
  22311. */
  22312. /**
  22313. * WordPress dependencies
  22314. */
  22315. /**
  22316. * Internal dependencies
  22317. */
  22318. const EMPTY_OBJECT = {};
  22319. const unsaved_inner_blocks_DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', {
  22320. status: 'draft',
  22321. per_page: -1
  22322. }];
  22323. const unsaved_inner_blocks_DEFAULT_BLOCK = {
  22324. name: 'core/navigation-link'
  22325. };
  22326. const unsaved_inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
  22327. function UnsavedInnerBlocks(_ref) {
  22328. let {
  22329. blockProps,
  22330. blocks,
  22331. clientId,
  22332. hasSavedUnsavedInnerBlocks,
  22333. onSave,
  22334. hasSelection
  22335. } = _ref;
  22336. const originalBlocks = (0,external_wp_element_namespaceObject.useRef)();
  22337. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22338. // Initially store the uncontrolled inner blocks for
  22339. // dirty state comparison.
  22340. if (!(originalBlocks !== null && originalBlocks !== void 0 && originalBlocks.current)) {
  22341. originalBlocks.current = blocks;
  22342. }
  22343. }, [blocks]); // If the current inner blocks object is different in any way
  22344. // from the original inner blocks from the post content then the
  22345. // user has made changes to the inner blocks. At this point the inner
  22346. // blocks can be considered "dirty".
  22347. const innerBlocksAreDirty = blocks !== originalBlocks.current;
  22348. const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
  22349. let {
  22350. name
  22351. } = _ref2;
  22352. return name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list';
  22353. }), [blocks]); // The block will be disabled in a block preview, use this as a way of
  22354. // avoiding the side-effects of this component for block previews.
  22355. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
  22356. const savingLock = (0,external_wp_element_namespaceObject.useRef)(false);
  22357. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  22358. renderAppender: hasSelection ? undefined : false,
  22359. allowedBlocks: unsaved_inner_blocks_ALLOWED_BLOCKS,
  22360. __experimentalDefaultBlock: unsaved_inner_blocks_DEFAULT_BLOCK,
  22361. __experimentalDirectInsert: shouldDirectInsert
  22362. });
  22363. const {
  22364. isSaving,
  22365. draftNavigationMenus,
  22366. hasResolvedDraftNavigationMenus
  22367. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  22368. if (isDisabled) {
  22369. return EMPTY_OBJECT;
  22370. }
  22371. const {
  22372. getEntityRecords,
  22373. hasFinishedResolution,
  22374. isSavingEntityRecord
  22375. } = select(external_wp_coreData_namespaceObject.store);
  22376. return {
  22377. isSaving: isSavingEntityRecord('postType', 'wp_navigation'),
  22378. draftNavigationMenus: getEntityRecords(...unsaved_inner_blocks_DRAFT_MENU_PARAMS),
  22379. hasResolvedDraftNavigationMenus: hasFinishedResolution('getEntityRecords', unsaved_inner_blocks_DRAFT_MENU_PARAMS)
  22380. };
  22381. }, [isDisabled]);
  22382. const {
  22383. hasResolvedNavigationMenus,
  22384. navigationMenus
  22385. } = useNavigationMenu();
  22386. const {
  22387. create: createNavigationMenu
  22388. } = useCreateNavigationMenu(clientId); // Automatically save the uncontrolled blocks.
  22389. (0,external_wp_element_namespaceObject.useEffect)(async () => {
  22390. // The block will be disabled when used in a BlockPreview.
  22391. // In this case avoid automatic creation of a wp_navigation post.
  22392. // Otherwise the user will be spammed with lots of menus!
  22393. //
  22394. // Also ensure other navigation menus have loaded so an
  22395. // accurate name can be created.
  22396. //
  22397. // Don't try saving when another save is already
  22398. // in progress.
  22399. //
  22400. // And finally only create the menu when the block is selected,
  22401. // which is an indication they want to start editing.
  22402. if (isDisabled || hasSavedUnsavedInnerBlocks || isSaving || savingLock.current || !hasResolvedDraftNavigationMenus || !hasResolvedNavigationMenus || !hasSelection || !innerBlocksAreDirty) {
  22403. return;
  22404. }
  22405. savingLock.current = true;
  22406. const menu = await createNavigationMenu(null, blocks);
  22407. onSave(menu);
  22408. savingLock.current = false;
  22409. }, [isDisabled, isSaving, hasResolvedDraftNavigationMenus, hasResolvedNavigationMenus, draftNavigationMenus, navigationMenus, hasSelection, createNavigationMenu, blocks]);
  22410. const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div';
  22411. return (0,external_wp_element_namespaceObject.createElement)(Wrapper, {
  22412. className: "wp-block-navigation__unsaved-changes"
  22413. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  22414. className: classnames_default()('wp-block-navigation__unsaved-changes-overlay', {
  22415. 'is-saving': isSaving
  22416. })
  22417. }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)), isSaving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  22418. }
  22419. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js
  22420. /**
  22421. * WordPress dependencies
  22422. */
  22423. function NavigationMenuDeleteControl(_ref) {
  22424. let {
  22425. onDelete
  22426. } = _ref;
  22427. const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
  22428. const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation');
  22429. const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
  22430. const {
  22431. deleteEntityRecord
  22432. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  22433. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22434. className: "wp-block-navigation-delete-menu-button",
  22435. variant: "secondary",
  22436. isDestructive: true,
  22437. onClick: () => {
  22438. setIsConfirmModalVisible(true);
  22439. }
  22440. }, (0,external_wp_i18n_namespaceObject.__)('Delete menu')), isConfirmModalVisible && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  22441. title: (0,external_wp_i18n_namespaceObject.sprintf)(
  22442. /* translators: %s: the name of a menu to delete */
  22443. (0,external_wp_i18n_namespaceObject.__)('Delete %s'), title),
  22444. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  22445. onRequestClose: () => setIsConfirmModalVisible(false)
  22446. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation menu?')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  22447. justify: "flex-end"
  22448. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22449. variant: "secondary",
  22450. onClick: () => {
  22451. setIsConfirmModalVisible(false);
  22452. }
  22453. }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  22454. variant: "primary",
  22455. onClick: () => {
  22456. deleteEntityRecord('postType', 'wp_navigation', id, {
  22457. force: true
  22458. });
  22459. onDelete(title);
  22460. }
  22461. }, (0,external_wp_i18n_namespaceObject.__)('Confirm'))))));
  22462. }
  22463. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js
  22464. /**
  22465. * WordPress dependencies
  22466. */
  22467. function useNavigationNotice() {
  22468. let {
  22469. name,
  22470. message = ''
  22471. } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22472. const noticeRef = (0,external_wp_element_namespaceObject.useRef)();
  22473. const {
  22474. createWarningNotice,
  22475. removeNotice
  22476. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  22477. const showNotice = customMsg => {
  22478. if (noticeRef.current) {
  22479. return;
  22480. }
  22481. noticeRef.current = name;
  22482. createWarningNotice(customMsg || message, {
  22483. id: noticeRef.current,
  22484. type: 'snackbar'
  22485. });
  22486. };
  22487. const hideNotice = () => {
  22488. if (!noticeRef.current) {
  22489. return;
  22490. }
  22491. removeNotice(noticeRef.current);
  22492. noticeRef.current = null;
  22493. };
  22494. return [showNotice, hideNotice];
  22495. }
  22496. /* harmony default export */ var use_navigation_notice = (useNavigationNotice);
  22497. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
  22498. /**
  22499. * External dependencies
  22500. */
  22501. /**
  22502. * WordPress dependencies
  22503. */
  22504. /**
  22505. * Convert a flat menu item structure to a nested blocks structure.
  22506. *
  22507. * @param {Object[]} menuItems An array of menu items.
  22508. *
  22509. * @return {WPBlock[]} An array of blocks.
  22510. */
  22511. function menuItemsToBlocks(menuItems) {
  22512. if (!menuItems) {
  22513. return null;
  22514. }
  22515. const menuTree = createDataTree(menuItems);
  22516. const blocks = mapMenuItemsToBlocks(menuTree);
  22517. return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
  22518. }
  22519. /**
  22520. * A recursive function that maps menu item nodes to blocks.
  22521. *
  22522. * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
  22523. * @return {Object} Object containing innerBlocks and mapping.
  22524. */
  22525. function mapMenuItemsToBlocks(menuItems) {
  22526. let mapping = {}; // The menuItem should be in menu_order sort order.
  22527. const sortedItems = (0,external_lodash_namespaceObject.sortBy)(menuItems, 'menu_order');
  22528. const innerBlocks = sortedItems.map(menuItem => {
  22529. var _menuItem$children, _menuItem$children2;
  22530. if (menuItem.type === 'block') {
  22531. const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
  22532. if (!block) {
  22533. return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
  22534. content: menuItem.content
  22535. });
  22536. }
  22537. return block;
  22538. }
  22539. const attributes = menuItemToBlockAttributes(menuItem); // If there are children recurse to build those nested blocks.
  22540. const {
  22541. innerBlocks: nestedBlocks = [],
  22542. // alias to avoid shadowing
  22543. mapping: nestedMapping = {} // alias to avoid shadowing
  22544. } = (_menuItem$children = menuItem.children) !== null && _menuItem$children !== void 0 && _menuItem$children.length ? mapMenuItemsToBlocks(menuItem.children) : {}; // Update parent mapping with nested mapping.
  22545. mapping = { ...mapping,
  22546. ...nestedMapping
  22547. };
  22548. const blockType = (_menuItem$children2 = menuItem.children) !== null && _menuItem$children2 !== void 0 && _menuItem$children2.length ? 'core/navigation-submenu' : 'core/navigation-link'; // Create block with nested "innerBlocks".
  22549. const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.
  22550. mapping[menuItem.id] = block.clientId;
  22551. return block;
  22552. });
  22553. return {
  22554. innerBlocks,
  22555. mapping
  22556. };
  22557. }
  22558. /**
  22559. * A WP nav_menu_item object.
  22560. * For more documentation on the individual fields present on a menu item please see:
  22561. * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789
  22562. *
  22563. * Changes made here should also be mirrored in packages/edit-navigation/src/store/utils.js.
  22564. *
  22565. * @typedef WPNavMenuItem
  22566. *
  22567. * @property {Object} title stores the raw and rendered versions of the title/label for this menu item.
  22568. * @property {Array} xfn the XFN relationships expressed in the link of this menu item.
  22569. * @property {Array} classes the HTML class attributes for this menu item.
  22570. * @property {string} attr_title the HTML title attribute for this menu item.
  22571. * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'.
  22572. * @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
  22573. * @property {string} description The description of this menu item.
  22574. * @property {string} url The URL to which this menu item points.
  22575. * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'.
  22576. * @property {string} target The target attribute of the link element for this menu item.
  22577. */
  22578. /**
  22579. * Convert block attributes to menu item.
  22580. *
  22581. * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
  22582. * @return {Object} the block attributes converted from the WPNavMenuItem item.
  22583. */
  22584. function menuItemToBlockAttributes(_ref) {
  22585. var _object;
  22586. let {
  22587. title: menuItemTitleField,
  22588. xfn,
  22589. classes,
  22590. // eslint-disable-next-line camelcase
  22591. attr_title,
  22592. object,
  22593. // eslint-disable-next-line camelcase
  22594. object_id,
  22595. description,
  22596. url,
  22597. type: menuItemTypeField,
  22598. target
  22599. } = _ref;
  22600. // For historical reasons, the `core/navigation-link` variation type is `tag`
  22601. // whereas WP Core expects `post_tag` as the `object` type.
  22602. // To avoid writing a block migration we perform a conversion here.
  22603. // See also inverse equivalent in `blockAttributesToMenuItem`.
  22604. if (object && object === 'post_tag') {
  22605. object = 'tag';
  22606. }
  22607. return {
  22608. label: (menuItemTitleField === null || menuItemTitleField === void 0 ? void 0 : menuItemTitleField.rendered) || '',
  22609. ...(((_object = object) === null || _object === void 0 ? void 0 : _object.length) && {
  22610. type: object
  22611. }),
  22612. kind: (menuItemTypeField === null || menuItemTypeField === void 0 ? void 0 : menuItemTypeField.replace('_', '-')) || 'custom',
  22613. url: url || '',
  22614. ...((xfn === null || xfn === void 0 ? void 0 : xfn.length) && xfn.join(' ').trim() && {
  22615. rel: xfn.join(' ').trim()
  22616. }),
  22617. ...((classes === null || classes === void 0 ? void 0 : classes.length) && classes.join(' ').trim() && {
  22618. className: classes.join(' ').trim()
  22619. }),
  22620. /* eslint-disable camelcase */
  22621. ...((attr_title === null || attr_title === void 0 ? void 0 : attr_title.length) && {
  22622. title: attr_title
  22623. }),
  22624. ...(object_id && 'custom' !== object && {
  22625. id: object_id
  22626. }),
  22627. /* eslint-enable camelcase */
  22628. ...((description === null || description === void 0 ? void 0 : description.length) && {
  22629. description
  22630. }),
  22631. ...(target === '_blank' && {
  22632. opensInNewTab: true
  22633. })
  22634. };
  22635. }
  22636. /**
  22637. * Creates a nested, hierarchical tree representation from unstructured data that
  22638. * has an inherent relationship defined between individual items.
  22639. *
  22640. * For example, by default, each element in the dataset should have an `id` and
  22641. * `parent` property where the `parent` property indicates a relationship between
  22642. * the current item and another item with a matching `id` properties.
  22643. *
  22644. * This is useful for building linked lists of data from flat data structures.
  22645. *
  22646. * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields.
  22647. * @param {string} id the property which uniquely identifies each entry within the array.
  22648. * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all).
  22649. * @return {Array} a nested array of parent/child relationships
  22650. */
  22651. function createDataTree(dataset) {
  22652. let id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
  22653. let relation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent';
  22654. const hashTable = Object.create(null);
  22655. const dataTree = [];
  22656. for (const data of dataset) {
  22657. hashTable[data[id]] = { ...data,
  22658. children: []
  22659. };
  22660. if (data[relation]) {
  22661. hashTable[data[relation]] = hashTable[data[relation]] || {};
  22662. hashTable[data[relation]].children = hashTable[data[relation]].children || [];
  22663. hashTable[data[relation]].children.push(hashTable[data[id]]);
  22664. } else {
  22665. dataTree.push(hashTable[data[id]]);
  22666. }
  22667. }
  22668. return dataTree;
  22669. }
  22670. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
  22671. /**
  22672. * WordPress dependencies
  22673. */
  22674. /**
  22675. * Internal dependencies
  22676. */
  22677. const CLASSIC_MENU_CONVERSION_SUCCESS = 'success';
  22678. const CLASSIC_MENU_CONVERSION_ERROR = 'error';
  22679. const CLASSIC_MENU_CONVERSION_PENDING = 'pending';
  22680. const CLASSIC_MENU_CONVERSION_IDLE = 'idle';
  22681. function useConvertClassicToBlockMenu(clientId) {
  22682. const {
  22683. create: createNavigationMenu
  22684. } = useCreateNavigationMenu(clientId);
  22685. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22686. const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
  22687. const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null);
  22688. const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
  22689. async function convertClassicMenuToBlockMenu(menuId, menuName) {
  22690. let navigationMenu;
  22691. let classicMenuItems; // 1. Fetch the classic Menu items.
  22692. try {
  22693. classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({
  22694. menus: menuId,
  22695. per_page: -1,
  22696. context: 'view'
  22697. });
  22698. } catch (err) {
  22699. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22700. (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), {
  22701. cause: err
  22702. });
  22703. } // Handle offline response which resolves to `null`.
  22704. if (classicMenuItems === null) {
  22705. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22706. (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName));
  22707. } // 2. Convert the classic items into blocks.
  22708. const {
  22709. innerBlocks
  22710. } = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks.
  22711. try {
  22712. navigationMenu = await createNavigationMenu(menuName, innerBlocks);
  22713. } catch (err) {
  22714. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22715. (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
  22716. cause: err
  22717. });
  22718. }
  22719. return navigationMenu;
  22720. }
  22721. const convert = (0,external_wp_element_namespaceObject.useCallback)((menuId, menuName) => {
  22722. if (!menuId || !menuName) {
  22723. setError('Unable to convert menu. Missing menu details.');
  22724. setStatus(CLASSIC_MENU_CONVERSION_ERROR);
  22725. return;
  22726. }
  22727. setStatus(CLASSIC_MENU_CONVERSION_PENDING);
  22728. setValue(null);
  22729. setError(null);
  22730. convertClassicMenuToBlockMenu(menuId, menuName).then(navMenu => {
  22731. setValue(navMenu);
  22732. setStatus(CLASSIC_MENU_CONVERSION_SUCCESS);
  22733. }).catch(err => {
  22734. setError(err === null || err === void 0 ? void 0 : err.message);
  22735. setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Rethrow error for debugging.
  22736. throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  22737. (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
  22738. cause: err
  22739. });
  22740. });
  22741. }, [clientId]);
  22742. return {
  22743. convert,
  22744. status,
  22745. value,
  22746. error
  22747. };
  22748. }
  22749. /* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);
  22750. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js
  22751. /**
  22752. * External dependencies
  22753. */
  22754. /**
  22755. * WordPress dependencies
  22756. */
  22757. /**
  22758. * Internal dependencies
  22759. */
  22760. const EMPTY_ARRAY = [];
  22761. function getComputedStyle(node) {
  22762. return node.ownerDocument.defaultView.getComputedStyle(node);
  22763. }
  22764. function detectColors(colorsDetectionElement, setColor, setBackground) {
  22765. if (!colorsDetectionElement) {
  22766. return;
  22767. }
  22768. setColor(getComputedStyle(colorsDetectionElement).color);
  22769. let backgroundColorNode = colorsDetectionElement;
  22770. let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
  22771. while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) {
  22772. backgroundColorNode = backgroundColorNode.parentNode;
  22773. backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
  22774. }
  22775. setBackground(backgroundColor);
  22776. }
  22777. function Navigation(_ref) {
  22778. var _attributes$style, _attributes$style$typ;
  22779. let {
  22780. attributes,
  22781. setAttributes,
  22782. clientId,
  22783. isSelected,
  22784. className,
  22785. backgroundColor,
  22786. setBackgroundColor,
  22787. textColor,
  22788. setTextColor,
  22789. overlayBackgroundColor,
  22790. setOverlayBackgroundColor,
  22791. overlayTextColor,
  22792. setOverlayTextColor,
  22793. // These props are used by the navigation editor to override specific
  22794. // navigation block settings.
  22795. hasSubmenuIndicatorSetting = true,
  22796. hasColorSettings = true,
  22797. customPlaceholder: CustomPlaceholder = null
  22798. } = _ref;
  22799. const {
  22800. openSubmenusOnClick,
  22801. overlayMenu,
  22802. showSubmenuIcon,
  22803. layout: {
  22804. justifyContent,
  22805. orientation = 'horizontal',
  22806. flexWrap = 'wrap'
  22807. } = {},
  22808. hasIcon
  22809. } = attributes;
  22810. const ref = attributes.ref;
  22811. const registry = (0,external_wp_data_namespaceObject.useRegistry)();
  22812. const setRef = postId => {
  22813. setAttributes({
  22814. ref: postId
  22815. });
  22816. };
  22817. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(`navigationMenu/${ref}`); // Preload classic menus, so that they don't suddenly pop-in when viewing
  22818. // the Select Menu dropdown.
  22819. useNavigationEntities();
  22820. const [showNavigationMenuDeleteNotice] = use_navigation_notice({
  22821. name: 'block-library/core/navigation/delete'
  22822. });
  22823. const [showNavigationMenuCreateNotice, hideNavigationMenuCreateNotice] = use_navigation_notice({
  22824. name: 'block-library/core/navigation/create'
  22825. });
  22826. const {
  22827. create: createNavigationMenu,
  22828. status: createNavigationMenuStatus,
  22829. error: createNavigationMenuError,
  22830. value: createNavigationMenuPost
  22831. } = useCreateNavigationMenu(clientId);
  22832. const isCreatingNavigationMenu = createNavigationMenuStatus === CREATE_NAVIGATION_MENU_PENDING;
  22833. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22834. hideNavigationMenuCreateNotice();
  22835. if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_PENDING) {
  22836. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`));
  22837. }
  22838. if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_SUCCESS) {
  22839. setRef(createNavigationMenuPost.id);
  22840. selectBlock(clientId);
  22841. showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`));
  22842. }
  22843. if (createNavigationMenuStatus === CREATE_NAVIGATION_MENU_ERROR) {
  22844. showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.'));
  22845. }
  22846. }, [createNavigationMenu, createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost]);
  22847. const {
  22848. hasUncontrolledInnerBlocks,
  22849. uncontrolledInnerBlocks,
  22850. isInnerBlockSelected,
  22851. hasSubmenus
  22852. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  22853. const {
  22854. getBlock,
  22855. getBlocks,
  22856. hasSelectedInnerBlock
  22857. } = select(external_wp_blockEditor_namespaceObject.store); // This relies on the fact that `getBlock` won't return controlled
  22858. // inner blocks, while `getBlocks` does. It might be more stable to
  22859. // introduce a selector like `getUncontrolledInnerBlocks`, just in
  22860. // case `getBlock` is fixed.
  22861. const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks;
  22862. const _hasUncontrolledInnerBlocks = !!(_uncontrolledInnerBlocks !== null && _uncontrolledInnerBlocks !== void 0 && _uncontrolledInnerBlocks.length);
  22863. const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? EMPTY_ARRAY : getBlocks(clientId);
  22864. const innerBlocks = _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks;
  22865. return {
  22866. hasSubmenus: !!innerBlocks.find(block => block.name === 'core/navigation-submenu'),
  22867. hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks,
  22868. uncontrolledInnerBlocks: _uncontrolledInnerBlocks,
  22869. isInnerBlockSelected: hasSelectedInnerBlock(clientId, true)
  22870. };
  22871. }, [clientId]);
  22872. const {
  22873. replaceInnerBlocks,
  22874. selectBlock,
  22875. __unstableMarkNextChangeAsNotPersistent
  22876. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  22877. const [hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks] = (0,external_wp_element_namespaceObject.useState)(false);
  22878. const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false);
  22879. const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false);
  22880. const {
  22881. hasResolvedNavigationMenus,
  22882. isNavigationMenuResolved,
  22883. isNavigationMenuMissing,
  22884. navigationMenus,
  22885. navigationMenu,
  22886. canUserUpdateNavigationMenu,
  22887. hasResolvedCanUserUpdateNavigationMenu,
  22888. canUserDeleteNavigationMenu,
  22889. hasResolvedCanUserDeleteNavigationMenu,
  22890. canUserCreateNavigationMenu,
  22891. isResolvingCanUserCreateNavigationMenu,
  22892. hasResolvedCanUserCreateNavigationMenu
  22893. } = useNavigationMenu(ref); // Attempt to retrieve and prioritize any existing navigation menu unless
  22894. // a specific ref is allocated or the user is explicitly creating a new menu. The aim is
  22895. // for the block to "just work" from a user perspective using existing data.
  22896. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22897. if (isCreatingNavigationMenu || ref || !(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length) || (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1) {
  22898. return;
  22899. }
  22900. setRef(navigationMenus[0].id);
  22901. }, [navigationMenus]);
  22902. const navRef = (0,external_wp_element_namespaceObject.useRef)();
  22903. const isDraftNavigationMenu = (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.status) === 'draft';
  22904. const {
  22905. convert,
  22906. status: classicMenuConversionStatus,
  22907. error: classicMenuConversionError,
  22908. value: classicMenuConversionResult
  22909. } = use_convert_classic_menu_to_block_menu(clientId);
  22910. const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; // The standard HTML5 tag for the block wrapper.
  22911. const TagName = 'nav'; // "placeholder" shown if:
  22912. // - there is no ref attribute pointing to a Navigation Post.
  22913. // - there is no classic menu conversion process in progress.
  22914. // - there is no menu creation process in progress.
  22915. // - there are no uncontrolled blocks.
  22916. const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && !hasUncontrolledInnerBlocks;
  22917. const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; // "loading" state:
  22918. // - there is a menu creation process in progress.
  22919. // - there is a classic menu conversion process in progress.
  22920. // OR
  22921. // - there is a ref attribute pointing to a Navigation Post
  22922. // - the Navigation Post isn't available (hasn't resolved) yet.
  22923. const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu);
  22924. const textDecoration = (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$typ = _attributes$style.typography) === null || _attributes$style$typ === void 0 ? void 0 : _attributes$style$typ.textDecoration;
  22925. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  22926. ref: navRef,
  22927. className: classnames_default()(className, {
  22928. 'items-justified-right': justifyContent === 'right',
  22929. 'items-justified-space-between': justifyContent === 'space-between',
  22930. 'items-justified-left': justifyContent === 'left',
  22931. 'items-justified-center': justifyContent === 'center',
  22932. 'is-vertical': orientation === 'vertical',
  22933. 'no-wrap': flexWrap === 'nowrap',
  22934. 'is-responsive': 'never' !== overlayMenu,
  22935. 'has-text-color': !!textColor.color || !!(textColor !== null && textColor !== void 0 && textColor.class),
  22936. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor === null || textColor === void 0 ? void 0 : textColor.slug)]: !!(textColor !== null && textColor !== void 0 && textColor.slug),
  22937. 'has-background': !!backgroundColor.color || backgroundColor.class,
  22938. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.slug)]: !!(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug),
  22939. [`has-text-decoration-${textDecoration}`]: textDecoration
  22940. }),
  22941. style: {
  22942. color: !(textColor !== null && textColor !== void 0 && textColor.slug) && (textColor === null || textColor === void 0 ? void 0 : textColor.color),
  22943. backgroundColor: !(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug) && (backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.color)
  22944. }
  22945. });
  22946. const overlayClassnames = classnames_default()({
  22947. 'has-text-color': !!overlayTextColor.color || !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.class),
  22948. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.slug)]: !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug),
  22949. 'has-background': !!overlayBackgroundColor.color || (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.class),
  22950. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.slug)]: !!(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug)
  22951. });
  22952. const overlayStyles = {
  22953. color: !(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug) && (overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.color),
  22954. backgroundColor: !(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug) && (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.color) && overlayBackgroundColor.color
  22955. }; // Turn on contrast checker for web only since it's not supported on mobile yet.
  22956. const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web';
  22957. const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
  22958. const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
  22959. const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
  22960. const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)();
  22961. const [showClassicMenuConversionErrorNotice, hideClassicMenuConversionErrorNotice] = use_navigation_notice({
  22962. name: 'block-library/core/navigation/classic-menu-conversion/error'
  22963. });
  22964. function handleUpdateMenu(menuId) {
  22965. setRef(menuId);
  22966. selectBlock(clientId);
  22967. }
  22968. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22969. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) {
  22970. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.'));
  22971. }
  22972. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS && classicMenuConversionResult) {
  22973. handleUpdateMenu(classicMenuConversionResult === null || classicMenuConversionResult === void 0 ? void 0 : classicMenuConversionResult.id);
  22974. hideClassicMenuConversionErrorNotice();
  22975. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.'));
  22976. }
  22977. if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) {
  22978. showClassicMenuConversionErrorNotice(classicMenuConversionError);
  22979. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.'));
  22980. }
  22981. }, [classicMenuConversionStatus, classicMenuConversionResult, classicMenuConversionError]); // Spacer block needs orientation from context. This is a patch until
  22982. // https://github.com/WordPress/gutenberg/issues/36197 is addressed.
  22983. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22984. if (orientation) {
  22985. __unstableMarkNextChangeAsNotPersistent();
  22986. setAttributes({
  22987. orientation
  22988. });
  22989. }
  22990. }, [orientation]);
  22991. (0,external_wp_element_namespaceObject.useEffect)(() => {
  22992. var _navRef$current;
  22993. if (!enableContrastChecking) {
  22994. return;
  22995. }
  22996. detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor);
  22997. const subMenuElement = (_navRef$current = navRef.current) === null || _navRef$current === void 0 ? void 0 : _navRef$current.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');
  22998. if (subMenuElement) {
  22999. detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor);
  23000. }
  23001. });
  23002. const [showCantEditNotice, hideCantEditNotice] = use_navigation_notice({
  23003. name: 'block-library/core/navigation/permissions/update',
  23004. message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')
  23005. });
  23006. const [showCantCreateNotice, hideCantCreateNotice] = use_navigation_notice({
  23007. name: 'block-library/core/navigation/permissions/create',
  23008. message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')
  23009. });
  23010. (0,external_wp_element_namespaceObject.useEffect)(() => {
  23011. if (!isSelected && !isInnerBlockSelected) {
  23012. hideCantEditNotice();
  23013. hideCantCreateNotice();
  23014. }
  23015. if (isSelected || isInnerBlockSelected) {
  23016. if (hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) {
  23017. showCantEditNotice();
  23018. }
  23019. if (!ref && hasResolvedCanUserCreateNavigationMenu && !canUserCreateNavigationMenu) {
  23020. showCantCreateNotice();
  23021. }
  23022. }
  23023. }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenu, hasResolvedCanUserCreateNavigationMenu, ref]);
  23024. const navigationSelectorRef = (0,external_wp_element_namespaceObject.useRef)();
  23025. const [shouldFocusNavigationSelector, setShouldFocusNavigationSelector] = (0,external_wp_element_namespaceObject.useState)(false);
  23026. const handleSelectNavigation = (0,external_wp_element_namespaceObject.useCallback)(navPostOrClassicMenu => {
  23027. if (!navPostOrClassicMenu) {
  23028. return;
  23029. }
  23030. const isClassicMenu = navPostOrClassicMenu.hasOwnProperty('auto_add');
  23031. if (isClassicMenu) {
  23032. convert(navPostOrClassicMenu.id, navPostOrClassicMenu.name);
  23033. } else {
  23034. handleUpdateMenu(navPostOrClassicMenu.id);
  23035. }
  23036. setShouldFocusNavigationSelector(true);
  23037. }, [convert, handleUpdateMenu]); // Focus support after menu selection.
  23038. (0,external_wp_element_namespaceObject.useEffect)(() => {
  23039. var _navigationSelectorRe;
  23040. if (isDraftNavigationMenu || !isEntityAvailable || !shouldFocusNavigationSelector) {
  23041. return;
  23042. }
  23043. navigationSelectorRef === null || navigationSelectorRef === void 0 ? void 0 : (_navigationSelectorRe = navigationSelectorRef.current) === null || _navigationSelectorRe === void 0 ? void 0 : _navigationSelectorRe.focus();
  23044. setShouldFocusNavigationSelector(false);
  23045. }, [isDraftNavigationMenu, isEntityAvailable, shouldFocusNavigationSelector]);
  23046. const resetToEmptyBlock = (0,external_wp_element_namespaceObject.useCallback)(() => {
  23047. registry.batch(() => {
  23048. setAttributes({
  23049. ref: undefined
  23050. });
  23051. if (!ref) {
  23052. replaceInnerBlocks(clientId, []);
  23053. }
  23054. });
  23055. }, [clientId, ref]);
  23056. const isResponsive = 'never' !== overlayMenu;
  23057. const overlayMenuPreviewClasses = classnames_default()('wp-block-navigation__overlay-menu-preview', {
  23058. open: overlayMenuPreview
  23059. });
  23060. const stylingInspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  23061. title: (0,external_wp_i18n_namespaceObject.__)('Display')
  23062. }, isResponsive && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  23063. className: overlayMenuPreviewClasses,
  23064. onClick: () => {
  23065. setOverlayMenuPreview(!overlayMenuPreview);
  23066. }
  23067. }, hasIcon && (0,external_wp_element_namespaceObject.createElement)(OverlayMenuIcon, null), !hasIcon && (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Menu'))), overlayMenuPreview && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23068. label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'),
  23069. help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button opening the overlay menu.'),
  23070. onChange: value => setAttributes({
  23071. hasIcon: value
  23072. }),
  23073. checked: hasIcon
  23074. }), (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Overlay Menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  23075. label: (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'),
  23076. value: overlayMenu,
  23077. help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'),
  23078. onChange: value => setAttributes({
  23079. overlayMenu: value
  23080. }),
  23081. isBlock: true,
  23082. hideLabelFromVision: true
  23083. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  23084. value: "never",
  23085. label: (0,external_wp_i18n_namespaceObject.__)('Off')
  23086. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  23087. value: "mobile",
  23088. label: (0,external_wp_i18n_namespaceObject.__)('Mobile')
  23089. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  23090. value: "always",
  23091. label: (0,external_wp_i18n_namespaceObject.__)('Always')
  23092. })), hasSubmenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Submenus')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23093. checked: openSubmenusOnClick,
  23094. onChange: value => {
  23095. setAttributes({
  23096. openSubmenusOnClick: value,
  23097. ...(value && {
  23098. showSubmenuIcon: true
  23099. }) // Make sure arrows are shown when we toggle this on.
  23100. });
  23101. },
  23102. label: (0,external_wp_i18n_namespaceObject.__)('Open on click')
  23103. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  23104. checked: showSubmenuIcon,
  23105. onChange: value => {
  23106. setAttributes({
  23107. showSubmenuIcon: value
  23108. });
  23109. },
  23110. disabled: attributes.openSubmenusOnClick,
  23111. label: (0,external_wp_i18n_namespaceObject.__)('Show arrow')
  23112. }))), hasColorSettings && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
  23113. __experimentalHasMultipleOrigins: true,
  23114. __experimentalIsRenderedInSidebar: true,
  23115. title: (0,external_wp_i18n_namespaceObject.__)('Color'),
  23116. initialOpen: false,
  23117. colorSettings: [{
  23118. value: textColor.color,
  23119. onChange: setTextColor,
  23120. label: (0,external_wp_i18n_namespaceObject.__)('Text')
  23121. }, {
  23122. value: backgroundColor.color,
  23123. onChange: setBackgroundColor,
  23124. label: (0,external_wp_i18n_namespaceObject.__)('Background')
  23125. }, {
  23126. value: overlayTextColor.color,
  23127. onChange: setOverlayTextColor,
  23128. label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text')
  23129. }, {
  23130. value: overlayBackgroundColor.color,
  23131. onChange: setOverlayBackgroundColor,
  23132. label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background')
  23133. }]
  23134. }, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  23135. backgroundColor: detectedBackgroundColor,
  23136. textColor: detectedColor
  23137. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  23138. backgroundColor: detectedOverlayBackgroundColor,
  23139. textColor: detectedOverlayColor
  23140. })))); // If the block has inner blocks, but no menu id, then these blocks are either:
  23141. // - inserted via a pattern.
  23142. // - inserted directly via Code View (or otherwise).
  23143. // - from an older version of navigation block added before the block used a wp_navigation entity.
  23144. // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks,
  23145. // that automatically saves the menu as an entity when changes are made to the inner blocks.
  23146. const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable;
  23147. if (hasUnsavedBlocks) {
  23148. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, stylingInspectorControls, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
  23149. id: clientId,
  23150. onToggle: setResponsiveMenuVisibility,
  23151. isOpen: isResponsiveMenuOpen,
  23152. isResponsive: 'never' !== overlayMenu,
  23153. isHiddenByDefault: 'always' === overlayMenu,
  23154. classNames: overlayClassnames,
  23155. styles: overlayStyles
  23156. }, (0,external_wp_element_namespaceObject.createElement)(UnsavedInnerBlocks, {
  23157. blockProps: blockProps,
  23158. blocks: uncontrolledInnerBlocks,
  23159. clientId: clientId,
  23160. navigationMenus: navigationMenus,
  23161. hasSelection: isSelected || isInnerBlockSelected,
  23162. hasSavedUnsavedInnerBlocks: hasSavedUnsavedInnerBlocks,
  23163. onSave: post => {
  23164. // Set some state used as a guard to prevent the creation of multiple posts.
  23165. setHasSavedUnsavedInnerBlocks(true); // Switch to using the wp_navigation entity.
  23166. setRef(post.id);
  23167. showNavigationMenuCreateNotice((0,external_wp_i18n_namespaceObject.__)(`New Navigation Menu created.`));
  23168. }
  23169. })));
  23170. } // Show a warning if the selected menu is no longer available.
  23171. // TODO - the user should be able to select a new one?
  23172. if (ref && isNavigationMenuMissing) {
  23173. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  23174. onClick: resetToEmptyBlock,
  23175. variant: "link"
  23176. }, (0,external_wp_i18n_namespaceObject.__)('Create a new menu?'))));
  23177. }
  23178. if (isEntityAvailable && hasAlreadyRendered) {
  23179. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  23180. }
  23181. const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder;
  23182. if (isPlaceholder) {
  23183. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(PlaceholderComponent, {
  23184. isSelected: isSelected,
  23185. currentMenuId: ref,
  23186. clientId: clientId,
  23187. canUserCreateNavigationMenu: canUserCreateNavigationMenu,
  23188. isResolvingCanUserCreateNavigationMenu: isResolvingCanUserCreateNavigationMenu,
  23189. onFinish: handleSelectNavigation,
  23190. onCreateEmpty: () => createNavigationMenu('', [])
  23191. }));
  23192. }
  23193. return (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
  23194. kind: "postType",
  23195. type: "wp_navigation",
  23196. id: ref
  23197. }, (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, !isDraftNavigationMenu && isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  23198. className: "wp-block-navigation__toolbar-menu-selector"
  23199. }, (0,external_wp_element_namespaceObject.createElement)(navigation_menu_selector, {
  23200. ref: navigationSelectorRef,
  23201. currentMenuId: ref,
  23202. clientId: clientId,
  23203. onSelect: handleSelectNavigation,
  23204. onCreateNew: resetToEmptyBlock
  23205. /* translators: %s: The name of a menu. */
  23206. ,
  23207. actionLabel: (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"),
  23208. showManageActions: true
  23209. }))), stylingInspectorControls, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  23210. __experimentalGroup: "advanced"
  23211. }, hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuDeleteControl, {
  23212. onDelete: function () {
  23213. let deletedMenuTitle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  23214. resetToEmptyBlock();
  23215. showNavigationMenuDeleteNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
  23216. (0,external_wp_i18n_namespaceObject.__)('Navigation menu %s successfully deleted.'), deletedMenuTitle));
  23217. }
  23218. })), isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
  23219. className: "wp-block-navigation__loading-indicator"
  23220. })), !isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
  23221. id: clientId,
  23222. onToggle: setResponsiveMenuVisibility,
  23223. label: (0,external_wp_i18n_namespaceObject.__)('Menu'),
  23224. hasIcon: hasIcon,
  23225. isOpen: isResponsiveMenuOpen,
  23226. isResponsive: isResponsive,
  23227. isHiddenByDefault: 'always' === overlayMenu,
  23228. classNames: overlayClassnames,
  23229. styles: overlayStyles
  23230. }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(NavigationInnerBlocks, {
  23231. clientId: clientId,
  23232. hasCustomPlaceholder: !!CustomPlaceholder,
  23233. orientation: orientation
  23234. })))));
  23235. }
  23236. /* harmony default export */ var navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({
  23237. textColor: 'color'
  23238. }, {
  23239. backgroundColor: 'color'
  23240. }, {
  23241. overlayBackgroundColor: 'color'
  23242. }, {
  23243. overlayTextColor: 'color'
  23244. })(Navigation));
  23245. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js
  23246. /**
  23247. * WordPress dependencies
  23248. */
  23249. function navigation_save_save(_ref) {
  23250. let {
  23251. attributes
  23252. } = _ref;
  23253. if (attributes.ref) {
  23254. // Avoid rendering inner blocks when a ref is defined.
  23255. // When this id is defined the inner blocks are loaded from the
  23256. // `wp_navigation` entity rather than the hard-coded block html.
  23257. return;
  23258. }
  23259. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23260. }
  23261. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js
  23262. /**
  23263. * External dependencies
  23264. */
  23265. /**
  23266. * WordPress dependencies
  23267. */
  23268. /**
  23269. * Internal dependencies
  23270. */
  23271. const TYPOGRAPHY_PRESET_DEPRECATION_MAP = {
  23272. fontStyle: 'var:preset|font-style|',
  23273. fontWeight: 'var:preset|font-weight|',
  23274. textDecoration: 'var:preset|text-decoration|',
  23275. textTransform: 'var:preset|text-transform|'
  23276. };
  23277. const migrateIdToRef = _ref => {
  23278. let {
  23279. navigationMenuId,
  23280. ...attributes
  23281. } = _ref;
  23282. return { ...attributes,
  23283. ref: navigationMenuId
  23284. };
  23285. };
  23286. const deprecated_migrateWithLayout = attributes => {
  23287. if (!!attributes.layout) {
  23288. return attributes;
  23289. }
  23290. const {
  23291. itemsJustification,
  23292. orientation,
  23293. ...updatedAttributes
  23294. } = attributes;
  23295. if (itemsJustification || orientation) {
  23296. Object.assign(updatedAttributes, {
  23297. layout: {
  23298. type: 'flex',
  23299. ...(itemsJustification && {
  23300. justifyContent: itemsJustification
  23301. }),
  23302. ...(orientation && {
  23303. orientation
  23304. })
  23305. }
  23306. });
  23307. }
  23308. return updatedAttributes;
  23309. };
  23310. const navigation_deprecated_v6 = {
  23311. attributes: {
  23312. navigationMenuId: {
  23313. type: 'number'
  23314. },
  23315. textColor: {
  23316. type: 'string'
  23317. },
  23318. customTextColor: {
  23319. type: 'string'
  23320. },
  23321. rgbTextColor: {
  23322. type: 'string'
  23323. },
  23324. backgroundColor: {
  23325. type: 'string'
  23326. },
  23327. customBackgroundColor: {
  23328. type: 'string'
  23329. },
  23330. rgbBackgroundColor: {
  23331. type: 'string'
  23332. },
  23333. showSubmenuIcon: {
  23334. type: 'boolean',
  23335. default: true
  23336. },
  23337. openSubmenusOnClick: {
  23338. type: 'boolean',
  23339. default: false
  23340. },
  23341. overlayMenu: {
  23342. type: 'string',
  23343. default: 'mobile'
  23344. },
  23345. __unstableLocation: {
  23346. type: 'string'
  23347. },
  23348. overlayBackgroundColor: {
  23349. type: 'string'
  23350. },
  23351. customOverlayBackgroundColor: {
  23352. type: 'string'
  23353. },
  23354. overlayTextColor: {
  23355. type: 'string'
  23356. },
  23357. customOverlayTextColor: {
  23358. type: 'string'
  23359. }
  23360. },
  23361. supports: {
  23362. align: ['wide', 'full'],
  23363. anchor: true,
  23364. html: false,
  23365. inserter: true,
  23366. typography: {
  23367. fontSize: true,
  23368. lineHeight: true,
  23369. __experimentalFontStyle: true,
  23370. __experimentalFontWeight: true,
  23371. __experimentalTextTransform: true,
  23372. __experimentalFontFamily: true,
  23373. __experimentalTextDecoration: true,
  23374. __experimentalDefaultControls: {
  23375. fontSize: true
  23376. }
  23377. },
  23378. spacing: {
  23379. blockGap: true,
  23380. units: ['px', 'em', 'rem', 'vh', 'vw'],
  23381. __experimentalDefaultControls: {
  23382. blockGap: true
  23383. }
  23384. },
  23385. __experimentalLayout: {
  23386. allowSwitching: false,
  23387. allowInheriting: false,
  23388. default: {
  23389. type: 'flex'
  23390. }
  23391. }
  23392. },
  23393. save() {
  23394. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23395. },
  23396. isEligible: _ref2 => {
  23397. let {
  23398. navigationMenuId
  23399. } = _ref2;
  23400. return !!navigationMenuId;
  23401. },
  23402. migrate: migrateIdToRef
  23403. };
  23404. const navigation_deprecated_v5 = {
  23405. attributes: {
  23406. navigationMenuId: {
  23407. type: 'number'
  23408. },
  23409. orientation: {
  23410. type: 'string',
  23411. default: 'horizontal'
  23412. },
  23413. textColor: {
  23414. type: 'string'
  23415. },
  23416. customTextColor: {
  23417. type: 'string'
  23418. },
  23419. rgbTextColor: {
  23420. type: 'string'
  23421. },
  23422. backgroundColor: {
  23423. type: 'string'
  23424. },
  23425. customBackgroundColor: {
  23426. type: 'string'
  23427. },
  23428. rgbBackgroundColor: {
  23429. type: 'string'
  23430. },
  23431. itemsJustification: {
  23432. type: 'string'
  23433. },
  23434. showSubmenuIcon: {
  23435. type: 'boolean',
  23436. default: true
  23437. },
  23438. openSubmenusOnClick: {
  23439. type: 'boolean',
  23440. default: false
  23441. },
  23442. overlayMenu: {
  23443. type: 'string',
  23444. default: 'never'
  23445. },
  23446. __unstableLocation: {
  23447. type: 'string'
  23448. },
  23449. overlayBackgroundColor: {
  23450. type: 'string'
  23451. },
  23452. customOverlayBackgroundColor: {
  23453. type: 'string'
  23454. },
  23455. overlayTextColor: {
  23456. type: 'string'
  23457. },
  23458. customOverlayTextColor: {
  23459. type: 'string'
  23460. }
  23461. },
  23462. supports: {
  23463. align: ['wide', 'full'],
  23464. anchor: true,
  23465. html: false,
  23466. inserter: true,
  23467. typography: {
  23468. fontSize: true,
  23469. lineHeight: true,
  23470. __experimentalFontStyle: true,
  23471. __experimentalFontWeight: true,
  23472. __experimentalTextTransform: true,
  23473. __experimentalFontFamily: true,
  23474. __experimentalTextDecoration: true,
  23475. __experimentalDefaultControls: {
  23476. fontSize: true
  23477. }
  23478. },
  23479. spacing: {
  23480. blockGap: true,
  23481. units: ['px', 'em', 'rem', 'vh', 'vw'],
  23482. __experimentalDefaultControls: {
  23483. blockGap: true
  23484. }
  23485. }
  23486. },
  23487. save() {
  23488. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23489. },
  23490. isEligible: _ref3 => {
  23491. let {
  23492. itemsJustification,
  23493. orientation
  23494. } = _ref3;
  23495. return !!itemsJustification || !!orientation;
  23496. },
  23497. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout)
  23498. };
  23499. const navigation_deprecated_v4 = {
  23500. attributes: {
  23501. orientation: {
  23502. type: 'string',
  23503. default: 'horizontal'
  23504. },
  23505. textColor: {
  23506. type: 'string'
  23507. },
  23508. customTextColor: {
  23509. type: 'string'
  23510. },
  23511. rgbTextColor: {
  23512. type: 'string'
  23513. },
  23514. backgroundColor: {
  23515. type: 'string'
  23516. },
  23517. customBackgroundColor: {
  23518. type: 'string'
  23519. },
  23520. rgbBackgroundColor: {
  23521. type: 'string'
  23522. },
  23523. itemsJustification: {
  23524. type: 'string'
  23525. },
  23526. showSubmenuIcon: {
  23527. type: 'boolean',
  23528. default: true
  23529. },
  23530. openSubmenusOnClick: {
  23531. type: 'boolean',
  23532. default: false
  23533. },
  23534. overlayMenu: {
  23535. type: 'string',
  23536. default: 'never'
  23537. },
  23538. __unstableLocation: {
  23539. type: 'string'
  23540. },
  23541. overlayBackgroundColor: {
  23542. type: 'string'
  23543. },
  23544. customOverlayBackgroundColor: {
  23545. type: 'string'
  23546. },
  23547. overlayTextColor: {
  23548. type: 'string'
  23549. },
  23550. customOverlayTextColor: {
  23551. type: 'string'
  23552. }
  23553. },
  23554. supports: {
  23555. align: ['wide', 'full'],
  23556. anchor: true,
  23557. html: false,
  23558. inserter: true,
  23559. typography: {
  23560. fontSize: true,
  23561. lineHeight: true,
  23562. __experimentalFontStyle: true,
  23563. __experimentalFontWeight: true,
  23564. __experimentalTextTransform: true,
  23565. __experimentalFontFamily: true,
  23566. __experimentalTextDecoration: true
  23567. },
  23568. spacing: {
  23569. blockGap: true,
  23570. units: ['px', 'em', 'rem', 'vh', 'vw'],
  23571. __experimentalDefaultControls: {
  23572. blockGap: true
  23573. }
  23574. }
  23575. },
  23576. save() {
  23577. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23578. },
  23579. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family),
  23580. isEligible(_ref4) {
  23581. var _style$typography;
  23582. let {
  23583. style
  23584. } = _ref4;
  23585. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  23586. }
  23587. };
  23588. const migrateIsResponsive = function (attributes) {
  23589. delete attributes.isResponsive;
  23590. return { ...attributes,
  23591. overlayMenu: 'mobile'
  23592. };
  23593. };
  23594. const migrateTypographyPresets = function (attributes) {
  23595. return { ...attributes,
  23596. style: { ...attributes.style,
  23597. typography: (0,external_lodash_namespaceObject.mapValues)(attributes.style.typography, (value, key) => {
  23598. const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key];
  23599. if (prefix && value.startsWith(prefix)) {
  23600. const newValue = value.slice(prefix.length);
  23601. if ('textDecoration' === key && 'strikethrough' === newValue) {
  23602. return 'line-through';
  23603. }
  23604. return newValue;
  23605. }
  23606. return value;
  23607. })
  23608. }
  23609. };
  23610. };
  23611. const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, // Remove `isResponsive` attribute.
  23612. {
  23613. attributes: {
  23614. orientation: {
  23615. type: 'string',
  23616. default: 'horizontal'
  23617. },
  23618. textColor: {
  23619. type: 'string'
  23620. },
  23621. customTextColor: {
  23622. type: 'string'
  23623. },
  23624. rgbTextColor: {
  23625. type: 'string'
  23626. },
  23627. backgroundColor: {
  23628. type: 'string'
  23629. },
  23630. customBackgroundColor: {
  23631. type: 'string'
  23632. },
  23633. rgbBackgroundColor: {
  23634. type: 'string'
  23635. },
  23636. itemsJustification: {
  23637. type: 'string'
  23638. },
  23639. showSubmenuIcon: {
  23640. type: 'boolean',
  23641. default: true
  23642. },
  23643. openSubmenusOnClick: {
  23644. type: 'boolean',
  23645. default: false
  23646. },
  23647. isResponsive: {
  23648. type: 'boolean',
  23649. default: 'false'
  23650. },
  23651. __unstableLocation: {
  23652. type: 'string'
  23653. },
  23654. overlayBackgroundColor: {
  23655. type: 'string'
  23656. },
  23657. customOverlayBackgroundColor: {
  23658. type: 'string'
  23659. },
  23660. overlayTextColor: {
  23661. type: 'string'
  23662. },
  23663. customOverlayTextColor: {
  23664. type: 'string'
  23665. }
  23666. },
  23667. supports: {
  23668. align: ['wide', 'full'],
  23669. anchor: true,
  23670. html: false,
  23671. inserter: true,
  23672. typography: {
  23673. fontSize: true,
  23674. lineHeight: true,
  23675. __experimentalFontStyle: true,
  23676. __experimentalFontWeight: true,
  23677. __experimentalTextTransform: true,
  23678. __experimentalFontFamily: true,
  23679. __experimentalTextDecoration: true
  23680. }
  23681. },
  23682. isEligible(attributes) {
  23683. return attributes.isResponsive;
  23684. },
  23685. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),
  23686. save() {
  23687. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23688. }
  23689. }, {
  23690. attributes: {
  23691. orientation: {
  23692. type: 'string'
  23693. },
  23694. textColor: {
  23695. type: 'string'
  23696. },
  23697. customTextColor: {
  23698. type: 'string'
  23699. },
  23700. rgbTextColor: {
  23701. type: 'string'
  23702. },
  23703. backgroundColor: {
  23704. type: 'string'
  23705. },
  23706. customBackgroundColor: {
  23707. type: 'string'
  23708. },
  23709. rgbBackgroundColor: {
  23710. type: 'string'
  23711. },
  23712. itemsJustification: {
  23713. type: 'string'
  23714. },
  23715. showSubmenuIcon: {
  23716. type: 'boolean',
  23717. default: true
  23718. }
  23719. },
  23720. supports: {
  23721. align: ['wide', 'full'],
  23722. anchor: true,
  23723. html: false,
  23724. inserter: true,
  23725. fontSize: true,
  23726. __experimentalFontStyle: true,
  23727. __experimentalFontWeight: true,
  23728. __experimentalTextTransform: true,
  23729. color: true,
  23730. __experimentalFontFamily: true,
  23731. __experimentalTextDecoration: true
  23732. },
  23733. save() {
  23734. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23735. },
  23736. isEligible(attributes) {
  23737. if (!attributes.style || !attributes.style.typography) {
  23738. return false;
  23739. }
  23740. for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) {
  23741. const attributeValue = attributes.style.typography[styleAttribute];
  23742. if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) {
  23743. return true;
  23744. }
  23745. }
  23746. return false;
  23747. },
  23748. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets)
  23749. }, {
  23750. attributes: {
  23751. className: {
  23752. type: 'string'
  23753. },
  23754. textColor: {
  23755. type: 'string'
  23756. },
  23757. rgbTextColor: {
  23758. type: 'string'
  23759. },
  23760. backgroundColor: {
  23761. type: 'string'
  23762. },
  23763. rgbBackgroundColor: {
  23764. type: 'string'
  23765. },
  23766. fontSize: {
  23767. type: 'string'
  23768. },
  23769. customFontSize: {
  23770. type: 'number'
  23771. },
  23772. itemsJustification: {
  23773. type: 'string'
  23774. },
  23775. showSubmenuIcon: {
  23776. type: 'boolean'
  23777. }
  23778. },
  23779. isEligible(attribute) {
  23780. return attribute.rgbTextColor || attribute.rgbBackgroundColor;
  23781. },
  23782. supports: {
  23783. align: ['wide', 'full'],
  23784. anchor: true,
  23785. html: false,
  23786. inserter: true
  23787. },
  23788. migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => {
  23789. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['rgbTextColor', 'rgbBackgroundColor']),
  23790. customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor,
  23791. customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor
  23792. };
  23793. }),
  23794. save() {
  23795. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  23796. }
  23797. }];
  23798. /* harmony default export */ var navigation_deprecated = (navigation_deprecated_deprecated);
  23799. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
  23800. /**
  23801. * WordPress dependencies
  23802. */
  23803. /**
  23804. * Internal dependencies
  23805. */
  23806. const navigation_metadata = {
  23807. $schema: "https://schemas.wp.org/trunk/block.json",
  23808. apiVersion: 2,
  23809. name: "core/navigation",
  23810. title: "Navigation",
  23811. category: "theme",
  23812. description: "A collection of blocks that allow visitors to get around your site.",
  23813. keywords: ["menu", "navigation", "links"],
  23814. textdomain: "default",
  23815. attributes: {
  23816. ref: {
  23817. type: "number"
  23818. },
  23819. textColor: {
  23820. type: "string"
  23821. },
  23822. customTextColor: {
  23823. type: "string"
  23824. },
  23825. rgbTextColor: {
  23826. type: "string"
  23827. },
  23828. backgroundColor: {
  23829. type: "string"
  23830. },
  23831. customBackgroundColor: {
  23832. type: "string"
  23833. },
  23834. rgbBackgroundColor: {
  23835. type: "string"
  23836. },
  23837. showSubmenuIcon: {
  23838. type: "boolean",
  23839. "default": true
  23840. },
  23841. openSubmenusOnClick: {
  23842. type: "boolean",
  23843. "default": false
  23844. },
  23845. overlayMenu: {
  23846. type: "string",
  23847. "default": "mobile"
  23848. },
  23849. hasIcon: {
  23850. type: "boolean",
  23851. "default": true
  23852. },
  23853. __unstableLocation: {
  23854. type: "string"
  23855. },
  23856. overlayBackgroundColor: {
  23857. type: "string"
  23858. },
  23859. customOverlayBackgroundColor: {
  23860. type: "string"
  23861. },
  23862. overlayTextColor: {
  23863. type: "string"
  23864. },
  23865. customOverlayTextColor: {
  23866. type: "string"
  23867. },
  23868. maxNestingLevel: {
  23869. type: "number",
  23870. "default": 5
  23871. }
  23872. },
  23873. providesContext: {
  23874. textColor: "textColor",
  23875. customTextColor: "customTextColor",
  23876. backgroundColor: "backgroundColor",
  23877. customBackgroundColor: "customBackgroundColor",
  23878. overlayTextColor: "overlayTextColor",
  23879. customOverlayTextColor: "customOverlayTextColor",
  23880. overlayBackgroundColor: "overlayBackgroundColor",
  23881. customOverlayBackgroundColor: "customOverlayBackgroundColor",
  23882. fontSize: "fontSize",
  23883. customFontSize: "customFontSize",
  23884. showSubmenuIcon: "showSubmenuIcon",
  23885. openSubmenusOnClick: "openSubmenusOnClick",
  23886. style: "style",
  23887. orientation: "orientation",
  23888. maxNestingLevel: "maxNestingLevel"
  23889. },
  23890. supports: {
  23891. align: ["wide", "full"],
  23892. anchor: true,
  23893. html: false,
  23894. inserter: true,
  23895. typography: {
  23896. fontSize: true,
  23897. lineHeight: true,
  23898. __experimentalFontStyle: true,
  23899. __experimentalFontWeight: true,
  23900. __experimentalTextTransform: true,
  23901. __experimentalFontFamily: true,
  23902. __experimentalTextDecoration: true,
  23903. __experimentalSkipSerialization: ["textDecoration"],
  23904. __experimentalDefaultControls: {
  23905. fontSize: true
  23906. }
  23907. },
  23908. spacing: {
  23909. blockGap: true,
  23910. units: ["px", "em", "rem", "vh", "vw"],
  23911. __experimentalDefaultControls: {
  23912. blockGap: true
  23913. }
  23914. },
  23915. __experimentalLayout: {
  23916. allowSwitching: false,
  23917. allowInheriting: false,
  23918. allowVerticalAlignment: false,
  23919. "default": {
  23920. type: "flex"
  23921. }
  23922. }
  23923. },
  23924. viewScript: "file:./view.min.js",
  23925. editorStyle: "wp-block-navigation-editor",
  23926. style: "wp-block-navigation"
  23927. };
  23928. const {
  23929. name: navigation_name
  23930. } = navigation_metadata;
  23931. const navigation_settings = {
  23932. icon: library_navigation,
  23933. example: {
  23934. innerBlocks: [{
  23935. name: 'core/navigation-link',
  23936. attributes: {
  23937. // translators: 'Home' as in a website's home page.
  23938. label: (0,external_wp_i18n_namespaceObject.__)('Home'),
  23939. url: 'https://make.wordpress.org/'
  23940. }
  23941. }, {
  23942. name: 'core/navigation-link',
  23943. attributes: {
  23944. // translators: 'About' as in a website's about page.
  23945. label: (0,external_wp_i18n_namespaceObject.__)('About'),
  23946. url: 'https://make.wordpress.org/'
  23947. }
  23948. }, {
  23949. name: 'core/navigation-link',
  23950. attributes: {
  23951. // translators: 'Contact' as in a website's contact page.
  23952. label: (0,external_wp_i18n_namespaceObject.__)('Contact'),
  23953. url: 'https://make.wordpress.org/'
  23954. }
  23955. }]
  23956. },
  23957. edit: navigation_edit,
  23958. save: navigation_save_save,
  23959. deprecated: navigation_deprecated
  23960. };
  23961. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js
  23962. /**
  23963. * WordPress dependencies
  23964. */
  23965. const customLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  23966. xmlns: "https://www.w3.org/2000/svg",
  23967. viewBox: "0 0 24 24"
  23968. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  23969. d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"
  23970. }));
  23971. /* harmony default export */ var custom_link = (customLink);
  23972. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
  23973. /**
  23974. * WordPress dependencies
  23975. */
  23976. const addSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  23977. xmlns: "http://www.w3.org/2000/svg",
  23978. viewBox: "0 0 24 24"
  23979. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  23980. d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
  23981. }));
  23982. /* harmony default export */ var add_submenu = (addSubmenu);
  23983. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js
  23984. /**
  23985. * External dependencies
  23986. */
  23987. /**
  23988. * WordPress dependencies
  23989. */
  23990. /**
  23991. * Internal dependencies
  23992. */
  23993. const {
  23994. name: edit_name
  23995. } = {
  23996. $schema: "https://schemas.wp.org/trunk/block.json",
  23997. apiVersion: 2,
  23998. name: "core/navigation-link",
  23999. title: "Custom Link",
  24000. category: "design",
  24001. parent: ["core/navigation"],
  24002. description: "Add a page, link, or another item to your navigation.",
  24003. textdomain: "default",
  24004. attributes: {
  24005. label: {
  24006. type: "string"
  24007. },
  24008. type: {
  24009. type: "string"
  24010. },
  24011. description: {
  24012. type: "string"
  24013. },
  24014. rel: {
  24015. type: "string"
  24016. },
  24017. id: {
  24018. type: "number"
  24019. },
  24020. opensInNewTab: {
  24021. type: "boolean",
  24022. "default": false
  24023. },
  24024. url: {
  24025. type: "string"
  24026. },
  24027. title: {
  24028. type: "string"
  24029. },
  24030. kind: {
  24031. type: "string"
  24032. },
  24033. isTopLevelLink: {
  24034. type: "boolean"
  24035. }
  24036. },
  24037. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
  24038. supports: {
  24039. reusable: false,
  24040. html: false,
  24041. __experimentalSlashInserter: true
  24042. },
  24043. editorStyle: "wp-block-navigation-link-editor",
  24044. style: "wp-block-navigation-link"
  24045. };
  24046. /**
  24047. * A React hook to determine if it's dragging within the target element.
  24048. *
  24049. * @typedef {import('@wordpress/element').RefObject} RefObject
  24050. *
  24051. * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
  24052. *
  24053. * @return {boolean} Is dragging within the target element.
  24054. */
  24055. const useIsDraggingWithin = elementRef => {
  24056. const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
  24057. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24058. const {
  24059. ownerDocument
  24060. } = elementRef.current;
  24061. function handleDragStart(event) {
  24062. // Check the first time when the dragging starts.
  24063. handleDragEnter(event);
  24064. } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
  24065. function handleDragEnd() {
  24066. setIsDraggingWithin(false);
  24067. }
  24068. function handleDragEnter(event) {
  24069. // Check if the current target is inside the item element.
  24070. if (elementRef.current.contains(event.target)) {
  24071. setIsDraggingWithin(true);
  24072. } else {
  24073. setIsDraggingWithin(false);
  24074. }
  24075. } // Bind these events to the document to catch all drag events.
  24076. // Ideally, we can also use `event.relatedTarget`, but sadly that
  24077. // doesn't work in Safari.
  24078. ownerDocument.addEventListener('dragstart', handleDragStart);
  24079. ownerDocument.addEventListener('dragend', handleDragEnd);
  24080. ownerDocument.addEventListener('dragenter', handleDragEnter);
  24081. return () => {
  24082. ownerDocument.removeEventListener('dragstart', handleDragStart);
  24083. ownerDocument.removeEventListener('dragend', handleDragEnd);
  24084. ownerDocument.removeEventListener('dragenter', handleDragEnter);
  24085. };
  24086. }, []);
  24087. return isDraggingWithin;
  24088. };
  24089. /**
  24090. * Given the Link block's type attribute, return the query params to give to
  24091. * /wp/v2/search.
  24092. *
  24093. * @param {string} type Link block's type attribute.
  24094. * @param {string} kind Link block's entity of kind (post-type|taxonomy)
  24095. * @return {{ type?: string, subtype?: string }} Search query params.
  24096. */
  24097. function getSuggestionsQuery(type, kind) {
  24098. switch (type) {
  24099. case 'post':
  24100. case 'page':
  24101. return {
  24102. type: 'post',
  24103. subtype: type
  24104. };
  24105. case 'category':
  24106. return {
  24107. type: 'term',
  24108. subtype: 'category'
  24109. };
  24110. case 'tag':
  24111. return {
  24112. type: 'term',
  24113. subtype: 'post_tag'
  24114. };
  24115. case 'post_format':
  24116. return {
  24117. type: 'post-format'
  24118. };
  24119. default:
  24120. if (kind === 'taxonomy') {
  24121. return {
  24122. type: 'term',
  24123. subtype: type
  24124. };
  24125. }
  24126. if (kind === 'post-type') {
  24127. return {
  24128. type: 'post',
  24129. subtype: type
  24130. };
  24131. }
  24132. return {};
  24133. }
  24134. }
  24135. /**
  24136. * Determine the colors for a menu.
  24137. *
  24138. * Order of priority is:
  24139. * 1: Overlay custom colors (if submenu)
  24140. * 2: Overlay theme colors (if submenu)
  24141. * 3: Custom colors
  24142. * 4: Theme colors
  24143. * 5: Global styles
  24144. *
  24145. * @param {Object} context
  24146. * @param {boolean} isSubMenu
  24147. */
  24148. function getColors(context, isSubMenu) {
  24149. var _style$color, _style$color2;
  24150. const {
  24151. textColor,
  24152. customTextColor,
  24153. backgroundColor,
  24154. customBackgroundColor,
  24155. overlayTextColor,
  24156. customOverlayTextColor,
  24157. overlayBackgroundColor,
  24158. customOverlayBackgroundColor,
  24159. style
  24160. } = context;
  24161. const colors = {};
  24162. if (isSubMenu && !!customOverlayTextColor) {
  24163. colors.customTextColor = customOverlayTextColor;
  24164. } else if (isSubMenu && !!overlayTextColor) {
  24165. colors.textColor = overlayTextColor;
  24166. } else if (!!customTextColor) {
  24167. colors.customTextColor = customTextColor;
  24168. } else if (!!textColor) {
  24169. colors.textColor = textColor;
  24170. } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
  24171. colors.customTextColor = style.color.text;
  24172. }
  24173. if (isSubMenu && !!customOverlayBackgroundColor) {
  24174. colors.customBackgroundColor = customOverlayBackgroundColor;
  24175. } else if (isSubMenu && !!overlayBackgroundColor) {
  24176. colors.backgroundColor = overlayBackgroundColor;
  24177. } else if (!!customBackgroundColor) {
  24178. colors.customBackgroundColor = customBackgroundColor;
  24179. } else if (!!backgroundColor) {
  24180. colors.backgroundColor = backgroundColor;
  24181. } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
  24182. colors.customTextColor = style.color.background;
  24183. }
  24184. return colors;
  24185. }
  24186. /**
  24187. * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
  24188. */
  24189. /**
  24190. * Navigation Link Block Attributes
  24191. *
  24192. * @typedef {Object} WPNavigationLinkBlockAttributes
  24193. *
  24194. * @property {string} [label] Link text.
  24195. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
  24196. * @property {string} [type] The type such as post, page, tag, category and other custom types.
  24197. * @property {string} [rel] The relationship of the linked URL.
  24198. * @property {number} [id] A post or term id.
  24199. * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
  24200. * @property {string} [url] Link href.
  24201. * @property {string} [title] Link title attribute.
  24202. */
  24203. /**
  24204. * Link Control onChange handler that updates block attributes when a setting is changed.
  24205. *
  24206. * @param {Object} updatedValue New block attributes to update.
  24207. * @param {Function} setAttributes Block attribute update function.
  24208. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
  24209. *
  24210. */
  24211. const updateNavigationLinkBlockAttributes = function () {
  24212. let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  24213. let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
  24214. let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  24215. const {
  24216. label: originalLabel = '',
  24217. kind: originalKind = '',
  24218. type: originalType = ''
  24219. } = blockAttributes;
  24220. const {
  24221. title = '',
  24222. // the title of any provided Post.
  24223. url = '',
  24224. opensInNewTab,
  24225. id,
  24226. kind: newKind = originalKind,
  24227. type: newType = originalType
  24228. } = updatedValue;
  24229. const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
  24230. const normalizedURL = url.replace(/http(s?):\/\//gi, '');
  24231. const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
  24232. const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
  24233. const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
  24234. const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
  24235. const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
  24236. const kind = isCustomLink ? 'custom' : newKind;
  24237. setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
  24238. ...(url && {
  24239. url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
  24240. }),
  24241. ...(label && {
  24242. label
  24243. }),
  24244. ...(undefined !== opensInNewTab && {
  24245. opensInNewTab
  24246. }),
  24247. ...(id && Number.isInteger(id) && {
  24248. id
  24249. }),
  24250. ...(kind && {
  24251. kind
  24252. }),
  24253. ...(type && type !== 'URL' && {
  24254. type
  24255. })
  24256. });
  24257. };
  24258. const useIsInvalidLink = (kind, type, id) => {
  24259. const isPostType = kind === 'post-type' || type === 'post' || type === 'page';
  24260. const hasId = Number.isInteger(id);
  24261. const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24262. var _getEntityRecord;
  24263. if (!isPostType) {
  24264. return null;
  24265. }
  24266. const {
  24267. getEntityRecord
  24268. } = select(external_wp_coreData_namespaceObject.store);
  24269. return (_getEntityRecord = getEntityRecord('postType', type, id)) === null || _getEntityRecord === void 0 ? void 0 : _getEntityRecord.status;
  24270. }, [isPostType, type, id]); // Check Navigation Link validity if:
  24271. // 1. Link is 'post-type'.
  24272. // 2. It has an id.
  24273. // 3. It's neither null, nor undefined, as valid items might be either of those while loading.
  24274. // If those conditions are met, check if
  24275. // 1. The post status is published.
  24276. // 2. The Navigation Link item has no label.
  24277. // If either of those is true, invalidate.
  24278. const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus;
  24279. const isDraft = 'draft' === postStatus;
  24280. return [isInvalid, isDraft];
  24281. };
  24282. const useMissingText = type => {
  24283. let missingText = '';
  24284. switch (type) {
  24285. case 'post':
  24286. /* translators: label for missing post in navigation link block */
  24287. missingText = (0,external_wp_i18n_namespaceObject.__)('Select post');
  24288. break;
  24289. case 'page':
  24290. /* translators: label for missing page in navigation link block */
  24291. missingText = (0,external_wp_i18n_namespaceObject.__)('Select page');
  24292. break;
  24293. case 'category':
  24294. /* translators: label for missing category in navigation link block */
  24295. missingText = (0,external_wp_i18n_namespaceObject.__)('Select category');
  24296. break;
  24297. case 'tag':
  24298. /* translators: label for missing tag in navigation link block */
  24299. missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag');
  24300. break;
  24301. default:
  24302. /* translators: label for missing values in navigation link block */
  24303. missingText = (0,external_wp_i18n_namespaceObject.__)('Add link');
  24304. }
  24305. return missingText;
  24306. };
  24307. /**
  24308. * Removes HTML from a given string.
  24309. * Note the does not provide XSS protection or otherwise attempt
  24310. * to filter strings with malicious intent.
  24311. *
  24312. * See also: https://github.com/WordPress/gutenberg/pull/35539
  24313. *
  24314. * @param {string} html the string from which HTML should be removed.
  24315. * @return {string} the "cleaned" string.
  24316. */
  24317. function navStripHTML(html) {
  24318. const doc = document.implementation.createHTMLDocument('');
  24319. doc.body.innerHTML = html;
  24320. return doc.body.textContent || '';
  24321. }
  24322. /**
  24323. * Add transforms to Link Control
  24324. */
  24325. function LinkControlTransforms(_ref) {
  24326. let {
  24327. clientId,
  24328. replace
  24329. } = _ref;
  24330. const {
  24331. getBlock,
  24332. blockTransforms
  24333. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24334. const {
  24335. getBlock: _getBlock,
  24336. getBlockRootClientId,
  24337. getBlockTransformItems
  24338. } = select(external_wp_blockEditor_namespaceObject.store);
  24339. return {
  24340. getBlock: _getBlock,
  24341. blockTransforms: getBlockTransformItems([_getBlock(clientId)], getBlockRootClientId(clientId))
  24342. };
  24343. }, [clientId]);
  24344. const featuredBlocks = ['core/site-logo', 'core/social-links', 'core/search'];
  24345. const transforms = blockTransforms.filter(item => {
  24346. return featuredBlocks.includes(item.name);
  24347. });
  24348. if (!(transforms !== null && transforms !== void 0 && transforms.length)) {
  24349. return null;
  24350. }
  24351. return (0,external_wp_element_namespaceObject.createElement)("div", {
  24352. className: "link-control-transform"
  24353. }, (0,external_wp_element_namespaceObject.createElement)("h3", {
  24354. className: "link-control-transform__subheading"
  24355. }, (0,external_wp_i18n_namespaceObject.__)('Transform')), (0,external_wp_element_namespaceObject.createElement)("div", {
  24356. className: "link-control-transform__items"
  24357. }, transforms.map((item, index) => {
  24358. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  24359. key: `transform-${index}`,
  24360. onClick: () => replace(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), item.name)),
  24361. className: "link-control-transform__item"
  24362. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  24363. icon: item.icon
  24364. }), item.title);
  24365. })));
  24366. }
  24367. function NavigationLinkEdit(_ref2) {
  24368. let {
  24369. attributes,
  24370. isSelected,
  24371. setAttributes,
  24372. insertBlocksAfter,
  24373. mergeBlocks,
  24374. onReplace,
  24375. context,
  24376. clientId
  24377. } = _ref2;
  24378. const {
  24379. id,
  24380. label,
  24381. type,
  24382. opensInNewTab,
  24383. url,
  24384. description,
  24385. rel,
  24386. title,
  24387. kind
  24388. } = attributes;
  24389. const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id);
  24390. const {
  24391. maxNestingLevel
  24392. } = context;
  24393. const link = {
  24394. url,
  24395. opensInNewTab,
  24396. title: label && navStripHTML(label) // don't allow HTML to display inside the <LinkControl>
  24397. };
  24398. const {
  24399. saveEntityRecord
  24400. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  24401. const {
  24402. replaceBlock,
  24403. __unstableMarkNextChangeAsNotPersistent
  24404. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  24405. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  24406. const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
  24407. const isDraggingWithin = useIsDraggingWithin(listItemRef);
  24408. const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add link…');
  24409. const ref = (0,external_wp_element_namespaceObject.useRef)();
  24410. const {
  24411. innerBlocks,
  24412. isAtMaxNesting,
  24413. isTopLevelLink,
  24414. isParentOfSelectedBlock,
  24415. hasChildren,
  24416. userCanCreatePages,
  24417. userCanCreatePosts
  24418. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  24419. const {
  24420. getBlocks,
  24421. getBlockCount,
  24422. getBlockName,
  24423. getBlockRootClientId,
  24424. hasSelectedInnerBlock,
  24425. getBlockParentsByBlockName
  24426. } = select(external_wp_blockEditor_namespaceObject.store);
  24427. return {
  24428. innerBlocks: getBlocks(clientId),
  24429. isAtMaxNesting: getBlockParentsByBlockName(clientId, [edit_name, 'core/navigation-submenu']).length >= maxNestingLevel,
  24430. isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation',
  24431. isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
  24432. hasChildren: !!getBlockCount(clientId),
  24433. userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
  24434. userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts')
  24435. };
  24436. }, [clientId]);
  24437. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24438. // This side-effect should not create an undo level as those should
  24439. // only be created via user interactions. Mark this change as
  24440. // not persistent to avoid undo level creation.
  24441. // See https://github.com/WordPress/gutenberg/issues/34564.
  24442. __unstableMarkNextChangeAsNotPersistent();
  24443. setAttributes({
  24444. isTopLevelLink
  24445. });
  24446. }, [isTopLevelLink]);
  24447. /**
  24448. * Transform to submenu block.
  24449. */
  24450. function transformToSubmenu() {
  24451. const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
  24452. replaceBlock(clientId, newSubmenu);
  24453. }
  24454. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24455. // Show the LinkControl on mount if the URL is empty
  24456. // ( When adding a new menu item)
  24457. // This can't be done in the useState call because it conflicts
  24458. // with the autofocus behavior of the BlockListBlock component.
  24459. if (!url) {
  24460. setIsLinkOpen(true);
  24461. } // If block has inner blocks, transform to Submenu.
  24462. if (hasChildren) {
  24463. transformToSubmenu();
  24464. }
  24465. }, []);
  24466. /**
  24467. * The hook shouldn't be necessary but due to a focus loss happening
  24468. * when selecting a suggestion in the link popover, we force close on block unselection.
  24469. */
  24470. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24471. if (!isSelected) {
  24472. setIsLinkOpen(false);
  24473. }
  24474. }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
  24475. (0,external_wp_element_namespaceObject.useEffect)(() => {
  24476. if (isLinkOpen && url) {
  24477. // Does this look like a URL and have something TLD-ish?
  24478. if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
  24479. // Focus and select the label text.
  24480. selectLabelText();
  24481. } else {
  24482. // Focus it (but do not select).
  24483. (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
  24484. }
  24485. }
  24486. }, [url]);
  24487. /**
  24488. * Focus the Link label text and select it.
  24489. */
  24490. function selectLabelText() {
  24491. ref.current.focus();
  24492. const {
  24493. ownerDocument
  24494. } = ref.current;
  24495. const {
  24496. defaultView
  24497. } = ownerDocument;
  24498. const selection = defaultView.getSelection();
  24499. const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
  24500. range.selectNodeContents(ref.current);
  24501. selection.removeAllRanges();
  24502. selection.addRange(range);
  24503. }
  24504. /**
  24505. * Removes the current link if set.
  24506. */
  24507. function removeLink() {
  24508. // Reset all attributes that comprise the link.
  24509. setAttributes({
  24510. url: '',
  24511. label: '',
  24512. id: '',
  24513. kind: '',
  24514. type: ''
  24515. }); // Close the link editing UI.
  24516. setIsLinkOpen(false);
  24517. }
  24518. let userCanCreate = false;
  24519. if (!type || type === 'page') {
  24520. userCanCreate = userCanCreatePages;
  24521. } else if (type === 'post') {
  24522. userCanCreate = userCanCreatePosts;
  24523. }
  24524. async function handleCreate(pageTitle) {
  24525. const postType = type || 'page';
  24526. const page = await saveEntityRecord('postType', postType, {
  24527. title: pageTitle,
  24528. status: 'draft'
  24529. });
  24530. return {
  24531. id: page.id,
  24532. type: postType,
  24533. title: page.title.rendered,
  24534. url: page.link,
  24535. kind: 'post-type'
  24536. };
  24537. }
  24538. const {
  24539. textColor,
  24540. customTextColor,
  24541. backgroundColor,
  24542. customBackgroundColor
  24543. } = getColors(context, !isTopLevelLink);
  24544. function onKeyDown(event) {
  24545. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || !url && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
  24546. setIsLinkOpen(true);
  24547. }
  24548. }
  24549. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  24550. ref: listItemRef,
  24551. className: classnames_default()('wp-block-navigation-item', {
  24552. 'is-editing': isSelected || isParentOfSelectedBlock,
  24553. 'is-dragging-within': isDraggingWithin,
  24554. 'has-link': !!url,
  24555. 'has-child': hasChildren,
  24556. 'has-text-color': !!textColor || !!customTextColor,
  24557. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
  24558. 'has-background': !!backgroundColor || customBackgroundColor,
  24559. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor
  24560. }),
  24561. style: {
  24562. color: !textColor && customTextColor,
  24563. backgroundColor: !backgroundColor && customBackgroundColor
  24564. },
  24565. onKeyDown
  24566. });
  24567. if (!url || isInvalid || isDraft) {
  24568. blockProps.onClick = () => setIsLinkOpen(true);
  24569. }
  24570. const classes = classnames_default()('wp-block-navigation-item__content', {
  24571. 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft
  24572. });
  24573. const missingText = useMissingText(type, isInvalid, isDraft);
  24574. /* translators: Whether the navigation link is Invalid or a Draft. */
  24575. const placeholderText = `(${isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`;
  24576. const tooltipText = isInvalid || isDraft ? (0,external_wp_i18n_namespaceObject.__)('This item has been deleted, or is a draft') : (0,external_wp_i18n_namespaceObject.__)('This item is missing a link');
  24577. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  24578. name: "link",
  24579. icon: library_link,
  24580. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  24581. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  24582. onClick: () => setIsLinkOpen(true)
  24583. }), !isAtMaxNesting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  24584. name: "submenu",
  24585. icon: add_submenu,
  24586. title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'),
  24587. onClick: transformToSubmenu
  24588. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  24589. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  24590. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  24591. value: description || '',
  24592. onChange: descriptionValue => {
  24593. setAttributes({
  24594. description: descriptionValue
  24595. });
  24596. },
  24597. label: (0,external_wp_i18n_namespaceObject.__)('Description'),
  24598. help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
  24599. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  24600. value: title || '',
  24601. onChange: titleValue => {
  24602. setAttributes({
  24603. title: titleValue
  24604. });
  24605. },
  24606. label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
  24607. autoComplete: "off"
  24608. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  24609. value: rel || '',
  24610. onChange: relValue => {
  24611. setAttributes({
  24612. rel: relValue
  24613. });
  24614. },
  24615. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  24616. autoComplete: "off"
  24617. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  24618. className: classes
  24619. }, !url ? (0,external_wp_element_namespaceObject.createElement)("div", {
  24620. className: "wp-block-navigation-link__placeholder-text"
  24621. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  24622. position: "top center",
  24623. text: tooltipText
  24624. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null, missingText), (0,external_wp_element_namespaceObject.createElement)("span", {
  24625. className: "wp-block-navigation-link__missing_text-tooltip"
  24626. }, tooltipText)))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isInvalid && !isDraft && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  24627. ref: ref,
  24628. identifier: "label",
  24629. className: "wp-block-navigation-item__label",
  24630. value: label,
  24631. onChange: labelValue => setAttributes({
  24632. label: labelValue
  24633. }),
  24634. onMerge: mergeBlocks,
  24635. onReplace: onReplace,
  24636. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')),
  24637. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
  24638. placeholder: itemLabelPlaceholder,
  24639. withoutInteractiveFormatting: true,
  24640. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
  24641. onClick: () => {
  24642. if (!url) {
  24643. setIsLinkOpen(true);
  24644. }
  24645. }
  24646. }), description && (0,external_wp_element_namespaceObject.createElement)("span", {
  24647. className: "wp-block-navigation-item__description"
  24648. }, description)), (isInvalid || isDraft) && (0,external_wp_element_namespaceObject.createElement)("div", {
  24649. className: "wp-block-navigation-link__placeholder-text wp-block-navigation-link__label"
  24650. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.KeyboardShortcuts, {
  24651. shortcuts: {
  24652. enter: () => isSelected && setIsLinkOpen(true)
  24653. }
  24654. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
  24655. position: "top center",
  24656. text: tooltipText
  24657. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", null,
  24658. /* Trim to avoid trailing white space when the placeholder text is not present */
  24659. `${label} ${placeholderText}`.trim()), (0,external_wp_element_namespaceObject.createElement)("span", {
  24660. className: "wp-block-navigation-link__missing_text-tooltip"
  24661. }, tooltipText))))), isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  24662. position: "bottom center",
  24663. onClose: () => setIsLinkOpen(false),
  24664. anchorRef: listItemRef.current
  24665. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  24666. hasTextControl: true,
  24667. hasRichPreviews: true,
  24668. className: "wp-block-navigation-link__inline-link-input",
  24669. value: link,
  24670. showInitialSuggestions: true,
  24671. withCreateSuggestion: userCanCreate,
  24672. createSuggestion: handleCreate,
  24673. createSuggestionButtonText: searchTerm => {
  24674. let format;
  24675. if (type === 'post') {
  24676. /* translators: %s: search term. */
  24677. format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
  24678. } else {
  24679. /* translators: %s: search term. */
  24680. format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
  24681. }
  24682. return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
  24683. mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
  24684. });
  24685. },
  24686. noDirectEntry: !!type,
  24687. noURLSuggestion: !!type,
  24688. suggestionsQuery: getSuggestionsQuery(type, kind),
  24689. onChange: updatedValue => updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
  24690. onRemove: removeLink,
  24691. renderControlBottom: !url ? () => (0,external_wp_element_namespaceObject.createElement)(LinkControlTransforms, {
  24692. clientId: clientId,
  24693. replace: replaceBlock
  24694. }) : null
  24695. })))));
  24696. }
  24697. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js
  24698. /**
  24699. * WordPress dependencies
  24700. */
  24701. function navigation_link_save_save() {
  24702. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  24703. }
  24704. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-title.js
  24705. /**
  24706. * WordPress dependencies
  24707. */
  24708. const postTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24709. viewBox: "0 0 24 24",
  24710. xmlns: "http://www.w3.org/2000/svg"
  24711. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24712. d: "M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"
  24713. }));
  24714. /* harmony default export */ var post_title = (postTitle);
  24715. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
  24716. /**
  24717. * WordPress dependencies
  24718. */
  24719. const page = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24720. xmlns: "http://www.w3.org/2000/svg",
  24721. viewBox: "0 0 24 24"
  24722. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24723. d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
  24724. }));
  24725. /* harmony default export */ var library_page = (page);
  24726. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
  24727. /**
  24728. * WordPress dependencies
  24729. */
  24730. const tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24731. xmlns: "http://www.w3.org/2000/svg",
  24732. viewBox: "0 0 24 24"
  24733. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24734. d: "M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
  24735. }));
  24736. /* harmony default export */ var library_tag = (tag);
  24737. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js
  24738. /**
  24739. * WordPress dependencies
  24740. */
  24741. const customPostType = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  24742. xmlns: "http://www.w3.org/2000/svg",
  24743. viewBox: "0 0 24 24"
  24744. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  24745. d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"
  24746. }));
  24747. /* harmony default export */ var custom_post_type = (customPostType);
  24748. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/fallback-variations.js
  24749. /**
  24750. * WordPress dependencies
  24751. */
  24752. // FALLBACK: this is only used when the server does not understand the variations property in the
  24753. // register_block_type call. see navigation-link/index.php.
  24754. // Delete this file when supported WP ranges understand the `variations` property when passed to
  24755. // register_block_type in index.php.
  24756. const fallbackVariations = [{
  24757. name: 'link',
  24758. isDefault: true,
  24759. title: (0,external_wp_i18n_namespaceObject.__)('Custom Link'),
  24760. description: (0,external_wp_i18n_namespaceObject.__)('A link to a custom URL.'),
  24761. attributes: {}
  24762. }, {
  24763. name: 'post',
  24764. icon: post_title,
  24765. title: (0,external_wp_i18n_namespaceObject.__)('Post Link'),
  24766. description: (0,external_wp_i18n_namespaceObject.__)('A link to a post.'),
  24767. attributes: {
  24768. type: 'post',
  24769. kind: 'post-type'
  24770. }
  24771. }, {
  24772. name: 'page',
  24773. icon: library_page,
  24774. title: (0,external_wp_i18n_namespaceObject.__)('Page Link'),
  24775. description: (0,external_wp_i18n_namespaceObject.__)('A link to a page.'),
  24776. attributes: {
  24777. type: 'page',
  24778. kind: 'post-type'
  24779. }
  24780. }, {
  24781. name: 'category',
  24782. icon: library_category,
  24783. title: (0,external_wp_i18n_namespaceObject.__)('Category Link'),
  24784. description: (0,external_wp_i18n_namespaceObject.__)('A link to a category.'),
  24785. attributes: {
  24786. type: 'category',
  24787. kind: 'taxonomy'
  24788. }
  24789. }, {
  24790. name: 'tag',
  24791. icon: library_tag,
  24792. title: (0,external_wp_i18n_namespaceObject.__)('Tag Link'),
  24793. description: (0,external_wp_i18n_namespaceObject.__)('A link to a tag.'),
  24794. attributes: {
  24795. type: 'tag',
  24796. kind: 'taxonomy'
  24797. }
  24798. }];
  24799. /**
  24800. * Add `isActive` function to all `navigation link` variations, if not defined.
  24801. * `isActive` function is used to find a variation match from a created
  24802. * Block by providing its attributes.
  24803. */
  24804. fallbackVariations.forEach(variation => {
  24805. if (variation.isActive) return;
  24806. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  24807. });
  24808. /* harmony default export */ var fallback_variations = (fallbackVariations);
  24809. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js
  24810. /**
  24811. * WordPress dependencies
  24812. */
  24813. /**
  24814. * Internal dependencies
  24815. */
  24816. function getIcon(variationName) {
  24817. switch (variationName) {
  24818. case 'post':
  24819. return post_title;
  24820. case 'page':
  24821. return library_page;
  24822. case 'tag':
  24823. return library_tag;
  24824. case 'category':
  24825. return library_category;
  24826. default:
  24827. return custom_post_type;
  24828. }
  24829. }
  24830. function enhanceNavigationLinkVariations(settings, name) {
  24831. if (name !== 'core/navigation-link') {
  24832. return settings;
  24833. } // Fallback handling may be deleted after supported WP ranges understand the `variations`
  24834. // property when passed to register_block_type in index.php.
  24835. if (!settings.variations) {
  24836. return { ...settings,
  24837. variations: fallback_variations
  24838. };
  24839. } // Otherwise decorate server passed variations with an icon and isActive function.
  24840. if (settings.variations) {
  24841. const isActive = (blockAttributes, variationAttributes) => {
  24842. return blockAttributes.type === variationAttributes.type;
  24843. };
  24844. const variations = settings.variations.map(variation => {
  24845. return { ...variation,
  24846. ...(!variation.icon && {
  24847. icon: getIcon(variation.name)
  24848. }),
  24849. ...(!variation.isActive && {
  24850. isActive
  24851. })
  24852. };
  24853. });
  24854. return { ...settings,
  24855. variations
  24856. };
  24857. }
  24858. return settings;
  24859. }
  24860. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js
  24861. /**
  24862. * WordPress dependencies
  24863. */
  24864. const navigation_link_transforms_transforms = {
  24865. from: [{
  24866. type: 'block',
  24867. blocks: ['core/site-logo'],
  24868. transform: () => {
  24869. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24870. }
  24871. }, {
  24872. type: 'block',
  24873. blocks: ['core/spacer'],
  24874. transform: () => {
  24875. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24876. }
  24877. }, {
  24878. type: 'block',
  24879. blocks: ['core/home-link'],
  24880. transform: () => {
  24881. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24882. }
  24883. }, {
  24884. type: 'block',
  24885. blocks: ['core/social-links'],
  24886. transform: () => {
  24887. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24888. }
  24889. }, {
  24890. type: 'block',
  24891. blocks: ['core/search'],
  24892. transform: () => {
  24893. return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
  24894. }
  24895. }],
  24896. to: [{
  24897. type: 'block',
  24898. blocks: ['core/navigation-submenu'],
  24899. transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks)
  24900. }, {
  24901. type: 'block',
  24902. blocks: ['core/spacer'],
  24903. transform: () => {
  24904. return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
  24905. }
  24906. }, {
  24907. type: 'block',
  24908. blocks: ['core/site-logo'],
  24909. transform: () => {
  24910. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
  24911. }
  24912. }, {
  24913. type: 'block',
  24914. blocks: ['core/home-link'],
  24915. transform: () => {
  24916. return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
  24917. }
  24918. }, {
  24919. type: 'block',
  24920. blocks: ['core/social-links'],
  24921. transform: () => {
  24922. return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
  24923. }
  24924. }, {
  24925. type: 'block',
  24926. blocks: ['core/search'],
  24927. transform: () => {
  24928. return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', {
  24929. showLabel: false,
  24930. buttonUseIcon: true,
  24931. buttonPosition: 'button-inside'
  24932. });
  24933. }
  24934. }]
  24935. };
  24936. /* harmony default export */ var navigation_link_transforms = (navigation_link_transforms_transforms);
  24937. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
  24938. /**
  24939. * WordPress dependencies
  24940. */
  24941. /**
  24942. * Internal dependencies
  24943. */
  24944. const navigation_link_metadata = {
  24945. $schema: "https://schemas.wp.org/trunk/block.json",
  24946. apiVersion: 2,
  24947. name: "core/navigation-link",
  24948. title: "Custom Link",
  24949. category: "design",
  24950. parent: ["core/navigation"],
  24951. description: "Add a page, link, or another item to your navigation.",
  24952. textdomain: "default",
  24953. attributes: {
  24954. label: {
  24955. type: "string"
  24956. },
  24957. type: {
  24958. type: "string"
  24959. },
  24960. description: {
  24961. type: "string"
  24962. },
  24963. rel: {
  24964. type: "string"
  24965. },
  24966. id: {
  24967. type: "number"
  24968. },
  24969. opensInNewTab: {
  24970. type: "boolean",
  24971. "default": false
  24972. },
  24973. url: {
  24974. type: "string"
  24975. },
  24976. title: {
  24977. type: "string"
  24978. },
  24979. kind: {
  24980. type: "string"
  24981. },
  24982. isTopLevelLink: {
  24983. type: "boolean"
  24984. }
  24985. },
  24986. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"],
  24987. supports: {
  24988. reusable: false,
  24989. html: false,
  24990. __experimentalSlashInserter: true
  24991. },
  24992. editorStyle: "wp-block-navigation-link-editor",
  24993. style: "wp-block-navigation-link"
  24994. };
  24995. const {
  24996. name: navigation_link_name
  24997. } = navigation_link_metadata;
  24998. const navigation_link_settings = {
  24999. icon: custom_link,
  25000. __experimentalLabel: _ref => {
  25001. let {
  25002. label
  25003. } = _ref;
  25004. return label;
  25005. },
  25006. merge(leftAttributes, _ref2) {
  25007. let {
  25008. label: rightLabel = ''
  25009. } = _ref2;
  25010. return { ...leftAttributes,
  25011. label: leftAttributes.label + rightLabel
  25012. };
  25013. },
  25014. edit: NavigationLinkEdit,
  25015. save: navigation_link_save_save,
  25016. example: {
  25017. attributes: {
  25018. label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'),
  25019. url: 'https://example.com'
  25020. }
  25021. },
  25022. deprecated: [{
  25023. isEligible(attributes) {
  25024. return attributes.nofollow;
  25025. },
  25026. attributes: {
  25027. label: {
  25028. type: 'string'
  25029. },
  25030. type: {
  25031. type: 'string'
  25032. },
  25033. nofollow: {
  25034. type: 'boolean'
  25035. },
  25036. description: {
  25037. type: 'string'
  25038. },
  25039. id: {
  25040. type: 'number'
  25041. },
  25042. opensInNewTab: {
  25043. type: 'boolean',
  25044. default: false
  25045. },
  25046. url: {
  25047. type: 'string'
  25048. }
  25049. },
  25050. migrate(_ref3) {
  25051. let {
  25052. nofollow,
  25053. ...rest
  25054. } = _ref3;
  25055. return {
  25056. rel: nofollow ? 'nofollow' : '',
  25057. ...rest
  25058. };
  25059. },
  25060. save() {
  25061. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  25062. }
  25063. }],
  25064. transforms: navigation_link_transforms
  25065. }; // importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
  25066. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
  25067. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js
  25068. /**
  25069. * WordPress dependencies
  25070. */
  25071. const removeSubmenu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25072. xmlns: "http://www.w3.org/2000/svg",
  25073. viewBox: "0 0 24 24"
  25074. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25075. fillRule: "evenodd",
  25076. clipRule: "evenodd",
  25077. d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"
  25078. }));
  25079. /* harmony default export */ var remove_submenu = (removeSubmenu);
  25080. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js
  25081. /**
  25082. * WordPress dependencies
  25083. */
  25084. const ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  25085. xmlns: "http://www.w3.org/2000/svg",
  25086. width: "12",
  25087. height: "12",
  25088. viewBox: "0 0 12 12",
  25089. fill: "none"
  25090. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  25091. d: "M1.50002 4L6.00002 8L10.5 4",
  25092. strokeWidth: "1.5"
  25093. }));
  25094. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js
  25095. /**
  25096. * External dependencies
  25097. */
  25098. /**
  25099. * WordPress dependencies
  25100. */
  25101. /**
  25102. * Internal dependencies
  25103. */
  25104. const {
  25105. name: navigation_submenu_edit_name
  25106. } = {
  25107. $schema: "https://schemas.wp.org/trunk/block.json",
  25108. apiVersion: 2,
  25109. name: "core/navigation-submenu",
  25110. title: "Submenu",
  25111. category: "design",
  25112. parent: ["core/navigation"],
  25113. description: "Add a submenu to your navigation.",
  25114. textdomain: "default",
  25115. attributes: {
  25116. label: {
  25117. type: "string"
  25118. },
  25119. type: {
  25120. type: "string"
  25121. },
  25122. description: {
  25123. type: "string"
  25124. },
  25125. rel: {
  25126. type: "string"
  25127. },
  25128. id: {
  25129. type: "number"
  25130. },
  25131. opensInNewTab: {
  25132. type: "boolean",
  25133. "default": false
  25134. },
  25135. url: {
  25136. type: "string"
  25137. },
  25138. title: {
  25139. type: "string"
  25140. },
  25141. kind: {
  25142. type: "string"
  25143. },
  25144. isTopLevelItem: {
  25145. type: "boolean"
  25146. }
  25147. },
  25148. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
  25149. supports: {
  25150. reusable: false,
  25151. html: false
  25152. },
  25153. editorStyle: "wp-block-navigation-submenu-editor",
  25154. style: "wp-block-navigation-submenu"
  25155. };
  25156. const navigation_submenu_edit_ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu'];
  25157. const edit_DEFAULT_BLOCK = {
  25158. name: 'core/navigation-link'
  25159. };
  25160. /**
  25161. * A React hook to determine if it's dragging within the target element.
  25162. *
  25163. * @typedef {import('@wordpress/element').RefObject} RefObject
  25164. *
  25165. * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
  25166. *
  25167. * @return {boolean} Is dragging within the target element.
  25168. */
  25169. const edit_useIsDraggingWithin = elementRef => {
  25170. const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
  25171. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25172. const {
  25173. ownerDocument
  25174. } = elementRef.current;
  25175. function handleDragStart(event) {
  25176. // Check the first time when the dragging starts.
  25177. handleDragEnter(event);
  25178. } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
  25179. function handleDragEnd() {
  25180. setIsDraggingWithin(false);
  25181. }
  25182. function handleDragEnter(event) {
  25183. // Check if the current target is inside the item element.
  25184. if (elementRef.current.contains(event.target)) {
  25185. setIsDraggingWithin(true);
  25186. } else {
  25187. setIsDraggingWithin(false);
  25188. }
  25189. } // Bind these events to the document to catch all drag events.
  25190. // Ideally, we can also use `event.relatedTarget`, but sadly that
  25191. // doesn't work in Safari.
  25192. ownerDocument.addEventListener('dragstart', handleDragStart);
  25193. ownerDocument.addEventListener('dragend', handleDragEnd);
  25194. ownerDocument.addEventListener('dragenter', handleDragEnter);
  25195. return () => {
  25196. ownerDocument.removeEventListener('dragstart', handleDragStart);
  25197. ownerDocument.removeEventListener('dragend', handleDragEnd);
  25198. ownerDocument.removeEventListener('dragenter', handleDragEnter);
  25199. };
  25200. }, []);
  25201. return isDraggingWithin;
  25202. };
  25203. /**
  25204. * Given the Link block's type attribute, return the query params to give to
  25205. * /wp/v2/search.
  25206. *
  25207. * @param {string} type Link block's type attribute.
  25208. * @param {string} kind Link block's entity of kind (post-type|taxonomy)
  25209. * @return {{ type?: string, subtype?: string }} Search query params.
  25210. */
  25211. function edit_getSuggestionsQuery(type, kind) {
  25212. switch (type) {
  25213. case 'post':
  25214. case 'page':
  25215. return {
  25216. type: 'post',
  25217. subtype: type
  25218. };
  25219. case 'category':
  25220. return {
  25221. type: 'term',
  25222. subtype: 'category'
  25223. };
  25224. case 'tag':
  25225. return {
  25226. type: 'term',
  25227. subtype: 'post_tag'
  25228. };
  25229. case 'post_format':
  25230. return {
  25231. type: 'post-format'
  25232. };
  25233. default:
  25234. if (kind === 'taxonomy') {
  25235. return {
  25236. type: 'term',
  25237. subtype: type
  25238. };
  25239. }
  25240. if (kind === 'post-type') {
  25241. return {
  25242. type: 'post',
  25243. subtype: type
  25244. };
  25245. }
  25246. return {};
  25247. }
  25248. }
  25249. /**
  25250. * Determine the colors for a menu.
  25251. *
  25252. * Order of priority is:
  25253. * 1: Overlay custom colors (if submenu)
  25254. * 2: Overlay theme colors (if submenu)
  25255. * 3: Custom colors
  25256. * 4: Theme colors
  25257. * 5: Global styles
  25258. *
  25259. * @param {Object} context
  25260. * @param {boolean} isSubMenu
  25261. */
  25262. function edit_getColors(context, isSubMenu) {
  25263. var _style$color, _style$color2;
  25264. const {
  25265. textColor,
  25266. customTextColor,
  25267. backgroundColor,
  25268. customBackgroundColor,
  25269. overlayTextColor,
  25270. customOverlayTextColor,
  25271. overlayBackgroundColor,
  25272. customOverlayBackgroundColor,
  25273. style
  25274. } = context;
  25275. const colors = {};
  25276. if (isSubMenu && !!customOverlayTextColor) {
  25277. colors.customTextColor = customOverlayTextColor;
  25278. } else if (isSubMenu && !!overlayTextColor) {
  25279. colors.textColor = overlayTextColor;
  25280. } else if (!!customTextColor) {
  25281. colors.customTextColor = customTextColor;
  25282. } else if (!!textColor) {
  25283. colors.textColor = textColor;
  25284. } else if (!!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.text)) {
  25285. colors.customTextColor = style.color.text;
  25286. }
  25287. if (isSubMenu && !!customOverlayBackgroundColor) {
  25288. colors.customBackgroundColor = customOverlayBackgroundColor;
  25289. } else if (isSubMenu && !!overlayBackgroundColor) {
  25290. colors.backgroundColor = overlayBackgroundColor;
  25291. } else if (!!customBackgroundColor) {
  25292. colors.customBackgroundColor = customBackgroundColor;
  25293. } else if (!!backgroundColor) {
  25294. colors.backgroundColor = backgroundColor;
  25295. } else if (!!(style !== null && style !== void 0 && (_style$color2 = style.color) !== null && _style$color2 !== void 0 && _style$color2.background)) {
  25296. colors.customTextColor = style.color.background;
  25297. }
  25298. return colors;
  25299. }
  25300. /**
  25301. * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind
  25302. */
  25303. /**
  25304. * Navigation Link Block Attributes
  25305. *
  25306. * @typedef {Object} WPNavigationLinkBlockAttributes
  25307. *
  25308. * @property {string} [label] Link text.
  25309. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.
  25310. * @property {string} [type] The type such as post, page, tag, category and other custom types.
  25311. * @property {string} [rel] The relationship of the linked URL.
  25312. * @property {number} [id] A post or term id.
  25313. * @property {boolean} [opensInNewTab] Sets link target to _blank when true.
  25314. * @property {string} [url] Link href.
  25315. * @property {string} [title] Link title attribute.
  25316. */
  25317. /**
  25318. * Link Control onChange handler that updates block attributes when a setting is changed.
  25319. *
  25320. * @param {Object} updatedValue New block attributes to update.
  25321. * @param {Function} setAttributes Block attribute update function.
  25322. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
  25323. *
  25324. */
  25325. const edit_updateNavigationLinkBlockAttributes = function () {
  25326. let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  25327. let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
  25328. let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  25329. const {
  25330. label: originalLabel = '',
  25331. kind: originalKind = '',
  25332. type: originalType = ''
  25333. } = blockAttributes;
  25334. const {
  25335. title = '',
  25336. url = '',
  25337. opensInNewTab,
  25338. id,
  25339. kind: newKind = originalKind,
  25340. type: newType = originalType
  25341. } = updatedValue;
  25342. const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
  25343. const normalizedURL = url.replace(/http(s?):\/\//gi, '');
  25344. const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
  25345. const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
  25346. const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
  25347. const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
  25348. const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
  25349. const kind = isCustomLink ? 'custom' : newKind;
  25350. setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
  25351. ...(url && {
  25352. url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
  25353. }),
  25354. ...(label && {
  25355. label
  25356. }),
  25357. ...(undefined !== opensInNewTab && {
  25358. opensInNewTab
  25359. }),
  25360. ...(id && Number.isInteger(id) && {
  25361. id
  25362. }),
  25363. ...(kind && {
  25364. kind
  25365. }),
  25366. ...(type && type !== 'URL' && {
  25367. type
  25368. })
  25369. });
  25370. };
  25371. function NavigationSubmenuEdit(_ref) {
  25372. let {
  25373. attributes,
  25374. isSelected,
  25375. setAttributes,
  25376. mergeBlocks,
  25377. onReplace,
  25378. context,
  25379. clientId
  25380. } = _ref;
  25381. const {
  25382. label,
  25383. type,
  25384. opensInNewTab,
  25385. url,
  25386. description,
  25387. rel,
  25388. title,
  25389. kind
  25390. } = attributes;
  25391. const link = {
  25392. url,
  25393. opensInNewTab
  25394. };
  25395. const {
  25396. showSubmenuIcon,
  25397. maxNestingLevel,
  25398. openSubmenusOnClick
  25399. } = context;
  25400. const {
  25401. saveEntityRecord
  25402. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  25403. const {
  25404. __unstableMarkNextChangeAsNotPersistent,
  25405. replaceBlock
  25406. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  25407. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  25408. const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
  25409. const isDraggingWithin = edit_useIsDraggingWithin(listItemRef);
  25410. const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…');
  25411. const ref = (0,external_wp_element_namespaceObject.useRef)();
  25412. const {
  25413. isAtMaxNesting,
  25414. isTopLevelItem,
  25415. isParentOfSelectedBlock,
  25416. isImmediateParentOfSelectedBlock,
  25417. hasChildren,
  25418. selectedBlockHasChildren,
  25419. userCanCreatePages,
  25420. userCanCreatePosts,
  25421. onlyDescendantIsEmptyLink
  25422. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  25423. const {
  25424. hasSelectedInnerBlock,
  25425. getSelectedBlockClientId,
  25426. getBlockParentsByBlockName,
  25427. getBlock,
  25428. getBlockCount,
  25429. getBlockOrder
  25430. } = select(external_wp_blockEditor_namespaceObject.store);
  25431. let _onlyDescendantIsEmptyLink;
  25432. const selectedBlockId = getSelectedBlockClientId();
  25433. const selectedBlockChildren = getBlockOrder(selectedBlockId); // Check for a single descendant in the submenu. If that block
  25434. // is a link block in a "placeholder" state with no label then
  25435. // we can consider as an "empty" link.
  25436. if ((selectedBlockChildren === null || selectedBlockChildren === void 0 ? void 0 : selectedBlockChildren.length) === 1) {
  25437. var _singleBlock$attribut;
  25438. const singleBlock = getBlock(selectedBlockChildren[0]);
  25439. _onlyDescendantIsEmptyLink = (singleBlock === null || singleBlock === void 0 ? void 0 : singleBlock.name) === 'core/navigation-link' && !(singleBlock !== null && singleBlock !== void 0 && (_singleBlock$attribut = singleBlock.attributes) !== null && _singleBlock$attribut !== void 0 && _singleBlock$attribut.label);
  25440. }
  25441. return {
  25442. isAtMaxNesting: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length >= maxNestingLevel,
  25443. isTopLevelItem: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length === 0,
  25444. isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
  25445. isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
  25446. hasChildren: !!getBlockCount(clientId),
  25447. selectedBlockHasChildren: !!(selectedBlockChildren !== null && selectedBlockChildren !== void 0 && selectedBlockChildren.length),
  25448. userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
  25449. userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts'),
  25450. onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink
  25451. };
  25452. }, [clientId]); // Show the LinkControl on mount if the URL is empty
  25453. // ( When adding a new menu item)
  25454. // This can't be done in the useState call because it conflicts
  25455. // with the autofocus behavior of the BlockListBlock component.
  25456. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25457. if (!openSubmenusOnClick && !url) {
  25458. setIsLinkOpen(true);
  25459. }
  25460. }, []); // Store the colors from context as attributes for rendering.
  25461. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25462. // This side-effect should not create an undo level as those should
  25463. // only be created via user interactions. Mark this change as
  25464. // not persistent to avoid undo level creation.
  25465. // See https://github.com/WordPress/gutenberg/issues/34564.
  25466. __unstableMarkNextChangeAsNotPersistent();
  25467. setAttributes({
  25468. isTopLevelItem
  25469. });
  25470. }, [isTopLevelItem]);
  25471. /**
  25472. * The hook shouldn't be necessary but due to a focus loss happening
  25473. * when selecting a suggestion in the link popover, we force close on block unselection.
  25474. */
  25475. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25476. if (!isSelected) {
  25477. setIsLinkOpen(false);
  25478. }
  25479. }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
  25480. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25481. if (isLinkOpen && url) {
  25482. // Does this look like a URL and have something TLD-ish?
  25483. if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
  25484. // Focus and select the label text.
  25485. selectLabelText();
  25486. } else {
  25487. // Focus it (but do not select).
  25488. (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
  25489. }
  25490. }
  25491. }, [url]);
  25492. /**
  25493. * Focus the Link label text and select it.
  25494. */
  25495. function selectLabelText() {
  25496. ref.current.focus();
  25497. const {
  25498. ownerDocument
  25499. } = ref.current;
  25500. const {
  25501. defaultView
  25502. } = ownerDocument;
  25503. const selection = defaultView.getSelection();
  25504. const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection.
  25505. range.selectNodeContents(ref.current);
  25506. selection.removeAllRanges();
  25507. selection.addRange(range);
  25508. }
  25509. let userCanCreate = false;
  25510. if (!type || type === 'page') {
  25511. userCanCreate = userCanCreatePages;
  25512. } else if (type === 'post') {
  25513. userCanCreate = userCanCreatePosts;
  25514. }
  25515. async function handleCreate(pageTitle) {
  25516. const postType = type || 'page';
  25517. const page = await saveEntityRecord('postType', postType, {
  25518. title: pageTitle,
  25519. status: 'draft'
  25520. });
  25521. return {
  25522. id: page.id,
  25523. type: postType,
  25524. title: page.title.rendered,
  25525. url: page.link,
  25526. kind: 'post-type'
  25527. };
  25528. }
  25529. const {
  25530. textColor,
  25531. customTextColor,
  25532. backgroundColor,
  25533. customBackgroundColor
  25534. } = edit_getColors(context, !isTopLevelItem);
  25535. function onKeyDown(event) {
  25536. if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
  25537. setIsLinkOpen(true);
  25538. }
  25539. }
  25540. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  25541. ref: listItemRef,
  25542. className: classnames_default()('wp-block-navigation-item', {
  25543. 'is-editing': isSelected || isParentOfSelectedBlock,
  25544. 'is-dragging-within': isDraggingWithin,
  25545. 'has-link': !!url,
  25546. 'has-child': hasChildren,
  25547. 'has-text-color': !!textColor || !!customTextColor,
  25548. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
  25549. 'has-background': !!backgroundColor || customBackgroundColor,
  25550. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor,
  25551. 'open-on-click': openSubmenusOnClick
  25552. }),
  25553. style: {
  25554. color: !textColor && customTextColor,
  25555. backgroundColor: !backgroundColor && customBackgroundColor
  25556. },
  25557. onKeyDown
  25558. }); // Always use overlay colors for submenus.
  25559. const innerBlocksColors = edit_getColors(context, true);
  25560. const allowedBlocks = isAtMaxNesting ? (0,external_lodash_namespaceObject.without)(navigation_submenu_edit_ALLOWED_BLOCKS, 'core/navigation-submenu') : navigation_submenu_edit_ALLOWED_BLOCKS;
  25561. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  25562. className: classnames_default()('wp-block-navigation__submenu-container', {
  25563. 'is-parent-of-selected-block': isParentOfSelectedBlock,
  25564. 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor),
  25565. [`has-${innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor,
  25566. 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor),
  25567. [`has-${innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor
  25568. }),
  25569. style: {
  25570. color: innerBlocksColors.customTextColor,
  25571. backgroundColor: innerBlocksColors.customBackgroundColor
  25572. }
  25573. }, {
  25574. allowedBlocks,
  25575. __experimentalDefaultBlock: edit_DEFAULT_BLOCK,
  25576. __experimentalDirectInsert: true,
  25577. // Ensure block toolbar is not too far removed from item
  25578. // being edited.
  25579. // see: https://github.com/WordPress/gutenberg/pull/34615.
  25580. __experimentalCaptureToolbars: true,
  25581. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
  25582. hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false
  25583. });
  25584. const ParentElement = openSubmenusOnClick ? 'button' : 'a';
  25585. function transformToLink() {
  25586. const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes);
  25587. replaceBlock(clientId, newLinkBlock);
  25588. }
  25589. const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink;
  25590. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, !openSubmenusOnClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  25591. name: "link",
  25592. icon: library_link,
  25593. title: (0,external_wp_i18n_namespaceObject.__)('Link'),
  25594. shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'),
  25595. onClick: () => setIsLinkOpen(true)
  25596. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  25597. name: "revert",
  25598. icon: remove_submenu,
  25599. title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'),
  25600. onClick: transformToLink,
  25601. className: "wp-block-navigation__submenu__revert",
  25602. isDisabled: !canConvertToLink
  25603. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  25604. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  25605. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
  25606. value: description || '',
  25607. onChange: descriptionValue => {
  25608. setAttributes({
  25609. description: descriptionValue
  25610. });
  25611. },
  25612. label: (0,external_wp_i18n_namespaceObject.__)('Description'),
  25613. help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
  25614. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  25615. value: title || '',
  25616. onChange: titleValue => {
  25617. setAttributes({
  25618. title: titleValue
  25619. });
  25620. },
  25621. label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
  25622. autoComplete: "off"
  25623. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  25624. value: rel || '',
  25625. onChange: relValue => {
  25626. setAttributes({
  25627. rel: relValue
  25628. });
  25629. },
  25630. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  25631. autoComplete: "off"
  25632. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(ParentElement, {
  25633. className: "wp-block-navigation-item__content"
  25634. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  25635. ref: ref,
  25636. identifier: "label",
  25637. className: "wp-block-navigation-item__label",
  25638. value: label,
  25639. onChange: labelValue => setAttributes({
  25640. label: labelValue
  25641. }),
  25642. onMerge: mergeBlocks,
  25643. onReplace: onReplace,
  25644. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
  25645. placeholder: itemLabelPlaceholder,
  25646. withoutInteractiveFormatting: true,
  25647. allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
  25648. onClick: () => {
  25649. if (!openSubmenusOnClick && !url) {
  25650. setIsLinkOpen(true);
  25651. }
  25652. }
  25653. }), !openSubmenusOnClick && isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  25654. position: "bottom center",
  25655. onClose: () => setIsLinkOpen(false),
  25656. anchorRef: listItemRef.current
  25657. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
  25658. className: "wp-block-navigation-link__inline-link-input",
  25659. value: link,
  25660. showInitialSuggestions: true,
  25661. withCreateSuggestion: userCanCreate,
  25662. createSuggestion: handleCreate,
  25663. createSuggestionButtonText: searchTerm => {
  25664. let format;
  25665. if (type === 'post') {
  25666. /* translators: %s: search term. */
  25667. format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
  25668. } else {
  25669. /* translators: %s: search term. */
  25670. format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
  25671. }
  25672. return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
  25673. mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
  25674. });
  25675. },
  25676. noDirectEntry: !!type,
  25677. noURLSuggestion: !!type,
  25678. suggestionsQuery: edit_getSuggestionsQuery(type, kind),
  25679. onChange: updatedValue => edit_updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
  25680. onRemove: () => {
  25681. setAttributes({
  25682. url: ''
  25683. });
  25684. (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
  25685. }
  25686. }))), (showSubmenuIcon || openSubmenusOnClick) && (0,external_wp_element_namespaceObject.createElement)("span", {
  25687. className: "wp-block-navigation__submenu-icon"
  25688. }, (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
  25689. }
  25690. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js
  25691. /**
  25692. * WordPress dependencies
  25693. */
  25694. function navigation_submenu_save_save() {
  25695. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  25696. }
  25697. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js
  25698. /**
  25699. * WordPress dependencies
  25700. */
  25701. const navigation_submenu_transforms_transforms = {
  25702. to: [{
  25703. type: 'block',
  25704. blocks: ['core/navigation-link'],
  25705. isMatch: (attributes, block) => {
  25706. var _block$innerBlocks;
  25707. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.length) === 0;
  25708. },
  25709. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes)
  25710. }, {
  25711. type: 'block',
  25712. blocks: ['core/spacer'],
  25713. isMatch: (attributes, block) => {
  25714. var _block$innerBlocks2;
  25715. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks2 = block.innerBlocks) === null || _block$innerBlocks2 === void 0 ? void 0 : _block$innerBlocks2.length) === 0;
  25716. },
  25717. transform: () => {
  25718. return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
  25719. }
  25720. }, {
  25721. type: 'block',
  25722. blocks: ['core/site-logo'],
  25723. isMatch: (attributes, block) => {
  25724. var _block$innerBlocks3;
  25725. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks3 = block.innerBlocks) === null || _block$innerBlocks3 === void 0 ? void 0 : _block$innerBlocks3.length) === 0;
  25726. },
  25727. transform: () => {
  25728. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
  25729. }
  25730. }, {
  25731. type: 'block',
  25732. blocks: ['core/home-link'],
  25733. isMatch: (attributes, block) => {
  25734. var _block$innerBlocks4;
  25735. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks4 = block.innerBlocks) === null || _block$innerBlocks4 === void 0 ? void 0 : _block$innerBlocks4.length) === 0;
  25736. },
  25737. transform: () => {
  25738. return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
  25739. }
  25740. }, {
  25741. type: 'block',
  25742. blocks: ['core/social-links'],
  25743. isMatch: (attributes, block) => {
  25744. var _block$innerBlocks5;
  25745. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks5 = block.innerBlocks) === null || _block$innerBlocks5 === void 0 ? void 0 : _block$innerBlocks5.length) === 0;
  25746. },
  25747. transform: () => {
  25748. return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
  25749. }
  25750. }, {
  25751. type: 'block',
  25752. blocks: ['core/search'],
  25753. isMatch: (attributes, block) => {
  25754. var _block$innerBlocks6;
  25755. return (block === null || block === void 0 ? void 0 : (_block$innerBlocks6 = block.innerBlocks) === null || _block$innerBlocks6 === void 0 ? void 0 : _block$innerBlocks6.length) === 0;
  25756. },
  25757. transform: () => {
  25758. return (0,external_wp_blocks_namespaceObject.createBlock)('core/search');
  25759. }
  25760. }]
  25761. };
  25762. /* harmony default export */ var navigation_submenu_transforms = (navigation_submenu_transforms_transforms);
  25763. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
  25764. /**
  25765. * WordPress dependencies
  25766. */
  25767. /**
  25768. * Internal dependencies
  25769. */
  25770. const navigation_submenu_metadata = {
  25771. $schema: "https://schemas.wp.org/trunk/block.json",
  25772. apiVersion: 2,
  25773. name: "core/navigation-submenu",
  25774. title: "Submenu",
  25775. category: "design",
  25776. parent: ["core/navigation"],
  25777. description: "Add a submenu to your navigation.",
  25778. textdomain: "default",
  25779. attributes: {
  25780. label: {
  25781. type: "string"
  25782. },
  25783. type: {
  25784. type: "string"
  25785. },
  25786. description: {
  25787. type: "string"
  25788. },
  25789. rel: {
  25790. type: "string"
  25791. },
  25792. id: {
  25793. type: "number"
  25794. },
  25795. opensInNewTab: {
  25796. type: "boolean",
  25797. "default": false
  25798. },
  25799. url: {
  25800. type: "string"
  25801. },
  25802. title: {
  25803. type: "string"
  25804. },
  25805. kind: {
  25806. type: "string"
  25807. },
  25808. isTopLevelItem: {
  25809. type: "boolean"
  25810. }
  25811. },
  25812. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"],
  25813. supports: {
  25814. reusable: false,
  25815. html: false
  25816. },
  25817. editorStyle: "wp-block-navigation-submenu-editor",
  25818. style: "wp-block-navigation-submenu"
  25819. };
  25820. const {
  25821. name: navigation_submenu_name
  25822. } = navigation_submenu_metadata;
  25823. const navigation_submenu_settings = {
  25824. icon: add_submenu,
  25825. __experimentalLabel: _ref => {
  25826. let {
  25827. label
  25828. } = _ref;
  25829. return label;
  25830. },
  25831. edit: NavigationSubmenuEdit,
  25832. save: navigation_submenu_save_save,
  25833. transforms: navigation_submenu_transforms
  25834. };
  25835. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js
  25836. /**
  25837. * WordPress dependencies
  25838. */
  25839. const pageBreak = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25840. xmlns: "http://www.w3.org/2000/svg",
  25841. viewBox: "0 0 24 24"
  25842. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25843. d: "M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"
  25844. }));
  25845. /* harmony default export */ var page_break = (pageBreak);
  25846. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js
  25847. /**
  25848. * WordPress dependencies
  25849. */
  25850. function NextPageEdit() {
  25851. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
  25852. className: "wp-block-nextpage"
  25853. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Page break'))));
  25854. }
  25855. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js
  25856. /**
  25857. * WordPress dependencies
  25858. */
  25859. function nextpage_save_save() {
  25860. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, '<!--nextpage-->');
  25861. }
  25862. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js
  25863. /**
  25864. * WordPress dependencies
  25865. */
  25866. const nextpage_transforms_transforms = {
  25867. from: [{
  25868. type: 'raw',
  25869. schema: {
  25870. 'wp-block': {
  25871. attributes: ['data-block']
  25872. }
  25873. },
  25874. isMatch: node => node.dataset && node.dataset.block === 'core/nextpage',
  25875. transform() {
  25876. return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {});
  25877. }
  25878. }]
  25879. };
  25880. /* harmony default export */ var nextpage_transforms = (nextpage_transforms_transforms);
  25881. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
  25882. /**
  25883. * WordPress dependencies
  25884. */
  25885. /**
  25886. * Internal dependencies
  25887. */
  25888. const nextpage_metadata = {
  25889. $schema: "https://schemas.wp.org/trunk/block.json",
  25890. apiVersion: 2,
  25891. name: "core/nextpage",
  25892. title: "Page Break",
  25893. category: "design",
  25894. description: "Separate your content into a multi-page experience.",
  25895. keywords: ["next page", "pagination"],
  25896. parent: ["core/post-content"],
  25897. textdomain: "default",
  25898. supports: {
  25899. customClassName: false,
  25900. className: false,
  25901. html: false
  25902. },
  25903. editorStyle: "wp-block-nextpage-editor"
  25904. };
  25905. const {
  25906. name: nextpage_name
  25907. } = nextpage_metadata;
  25908. const nextpage_settings = {
  25909. icon: page_break,
  25910. example: {},
  25911. transforms: nextpage_transforms,
  25912. edit: NextPageEdit,
  25913. save: nextpage_save_save
  25914. };
  25915. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
  25916. /**
  25917. * WordPress dependencies
  25918. */
  25919. const PatternEdit = _ref => {
  25920. let {
  25921. attributes,
  25922. clientId
  25923. } = _ref;
  25924. const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
  25925. const {
  25926. replaceBlocks,
  25927. __unstableMarkNextChangeAsNotPersistent
  25928. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Run this effect when the component loads.
  25929. // This adds the Pattern's contents to the post.
  25930. // This change won't be saved.
  25931. // It will continue to pull from the pattern file unless changes are made to its respective template part.
  25932. (0,external_wp_element_namespaceObject.useEffect)(() => {
  25933. if (selectedPattern !== null && selectedPattern !== void 0 && selectedPattern.blocks) {
  25934. __unstableMarkNextChangeAsNotPersistent();
  25935. replaceBlocks(clientId, selectedPattern.blocks);
  25936. }
  25937. }, [selectedPattern === null || selectedPattern === void 0 ? void 0 : selectedPattern.blocks]);
  25938. const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  25939. return (0,external_wp_element_namespaceObject.createElement)("div", props);
  25940. };
  25941. /* harmony default export */ var pattern_edit = (PatternEdit);
  25942. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
  25943. /**
  25944. * Internal dependencies
  25945. */
  25946. const pattern_metadata = {
  25947. $schema: "https://schemas.wp.org/trunk/block.json",
  25948. apiVersion: 2,
  25949. name: "core/pattern",
  25950. title: "Pattern",
  25951. category: "theme",
  25952. description: "Show a block pattern.",
  25953. supports: {
  25954. html: false,
  25955. inserter: false
  25956. },
  25957. textdomain: "default",
  25958. attributes: {
  25959. slug: {
  25960. type: "string"
  25961. }
  25962. }
  25963. };
  25964. const {
  25965. name: pattern_name
  25966. } = pattern_metadata;
  25967. const pattern_settings = {
  25968. edit: pattern_edit
  25969. };
  25970. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js
  25971. /**
  25972. * WordPress dependencies
  25973. */
  25974. const pages = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  25975. xmlns: "http://www.w3.org/2000/svg",
  25976. viewBox: "0 0 24 24"
  25977. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  25978. d: "M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"
  25979. }));
  25980. /* harmony default export */ var library_pages = (pages);
  25981. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
  25982. /**
  25983. * WordPress dependencies
  25984. */
  25985. const PAGE_FIELDS = ['id', 'title', 'link', 'type', 'parent'];
  25986. const MAX_PAGE_COUNT = 100;
  25987. const convertSelectedBlockToNavigationLinks = _ref => {
  25988. let {
  25989. pages,
  25990. clientId,
  25991. replaceBlock,
  25992. createBlock
  25993. } = _ref;
  25994. return () => {
  25995. if (!pages) {
  25996. return;
  25997. }
  25998. const linkMap = {};
  25999. const navigationLinks = [];
  26000. pages.forEach(_ref2 => {
  26001. var _linkMap$id$innerBloc, _linkMap$id;
  26002. let {
  26003. id,
  26004. title,
  26005. link: url,
  26006. type,
  26007. parent
  26008. } = _ref2;
  26009. // See if a placeholder exists. This is created if children appear before parents in list.
  26010. const innerBlocks = (_linkMap$id$innerBloc = (_linkMap$id = linkMap[id]) === null || _linkMap$id === void 0 ? void 0 : _linkMap$id.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : [];
  26011. linkMap[id] = createBlock('core/navigation-link', {
  26012. id,
  26013. label: title.rendered,
  26014. url,
  26015. type,
  26016. kind: 'post-type'
  26017. }, innerBlocks);
  26018. if (!parent) {
  26019. navigationLinks.push(linkMap[id]);
  26020. } else {
  26021. if (!linkMap[parent]) {
  26022. // Use a placeholder if the child appears before parent in list.
  26023. linkMap[parent] = {
  26024. innerBlocks: []
  26025. };
  26026. }
  26027. const parentLinkInnerBlocks = linkMap[parent].innerBlocks;
  26028. parentLinkInnerBlocks.push(linkMap[id]);
  26029. }
  26030. }); // Transform all links with innerBlocks into Submenus. This can't be done
  26031. // sooner because page objects have no information on their children.
  26032. const transformSubmenus = listOfLinks => {
  26033. listOfLinks.forEach((block, index, listOfLinksArray) => {
  26034. const {
  26035. attributes,
  26036. innerBlocks
  26037. } = block;
  26038. if (innerBlocks.length !== 0) {
  26039. transformSubmenus(innerBlocks);
  26040. const transformedBlock = createBlock('core/navigation-submenu', attributes, innerBlocks);
  26041. listOfLinksArray[index] = transformedBlock;
  26042. }
  26043. });
  26044. };
  26045. transformSubmenus(navigationLinks);
  26046. replaceBlock(clientId, navigationLinks);
  26047. };
  26048. };
  26049. function ConvertToLinksModal(_ref3) {
  26050. let {
  26051. onClose,
  26052. clientId
  26053. } = _ref3;
  26054. const {
  26055. records: pages,
  26056. hasResolved: pagesFinished
  26057. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
  26058. per_page: MAX_PAGE_COUNT,
  26059. _fields: PAGE_FIELDS,
  26060. // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
  26061. // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
  26062. // sort.
  26063. orderby: 'menu_order',
  26064. order: 'asc'
  26065. });
  26066. const {
  26067. replaceBlock
  26068. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  26069. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  26070. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
  26071. onRequestClose: onClose,
  26072. title: (0,external_wp_i18n_namespaceObject.__)('Convert to links'),
  26073. className: 'wp-block-page-list-modal',
  26074. aria: {
  26075. describedby: 'wp-block-page-list-modal__description'
  26076. }
  26077. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  26078. id: 'wp-block-page-list-modal__description'
  26079. }, (0,external_wp_i18n_namespaceObject.__)('To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")), (0,external_wp_element_namespaceObject.createElement)("div", {
  26080. className: "wp-block-page-list-modal-buttons"
  26081. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26082. variant: "tertiary",
  26083. onClick: onClose
  26084. }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  26085. variant: "primary",
  26086. disabled: !pagesFinished,
  26087. onClick: convertSelectedBlockToNavigationLinks({
  26088. pages,
  26089. replaceBlock,
  26090. clientId,
  26091. createBlock: external_wp_blocks_namespaceObject.createBlock
  26092. })
  26093. }, (0,external_wp_i18n_namespaceObject.__)('Convert'))));
  26094. }
  26095. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
  26096. /**
  26097. * WordPress dependencies
  26098. */
  26099. const icons_ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  26100. xmlns: "http://www.w3.org/2000/svg",
  26101. width: "12",
  26102. height: "12",
  26103. viewBox: "0 0 12 12",
  26104. fill: "none"
  26105. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  26106. d: "M1.50002 4L6.00002 8L10.5 4",
  26107. strokeWidth: "1.5"
  26108. }));
  26109. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
  26110. /**
  26111. * External dependencies
  26112. */
  26113. /**
  26114. * WordPress dependencies
  26115. */
  26116. /**
  26117. * Internal dependencies
  26118. */
  26119. // We only show the edit option when page count is <= MAX_PAGE_COUNT
  26120. // Performance of Navigation Links is not good past this value.
  26121. const edit_MAX_PAGE_COUNT = 100;
  26122. function PageListEdit(_ref) {
  26123. var _context$style;
  26124. let {
  26125. context,
  26126. clientId
  26127. } = _ref;
  26128. const {
  26129. pagesByParentId,
  26130. totalPages,
  26131. hasResolvedPages
  26132. } = usePageData();
  26133. const isNavigationChild = ('showSubmenuIcon' in context);
  26134. const allowConvertToLinks = isNavigationChild && totalPages <= edit_MAX_PAGE_COUNT;
  26135. const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  26136. const openModal = () => setOpen(true);
  26137. const closeModal = () => setOpen(false);
  26138. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  26139. className: classnames_default()('wp-block-page-list', {
  26140. 'has-text-color': !!context.textColor,
  26141. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
  26142. 'has-background': !!context.backgroundColor,
  26143. [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
  26144. }),
  26145. style: { ...((_context$style = context.style) === null || _context$style === void 0 ? void 0 : _context$style.color)
  26146. }
  26147. });
  26148. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, allowConvertToLinks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  26149. group: "other"
  26150. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  26151. title: (0,external_wp_i18n_namespaceObject.__)('Edit'),
  26152. onClick: openModal
  26153. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))), allowConvertToLinks && isOpen && (0,external_wp_element_namespaceObject.createElement)(ConvertToLinksModal, {
  26154. onClose: closeModal,
  26155. clientId: clientId
  26156. }), !hasResolvedPages && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), hasResolvedPages && totalPages === null && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  26157. status: 'warning',
  26158. isDismissible: false
  26159. }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')))), totalPages === 0 && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  26160. status: 'info',
  26161. isDismissible: false
  26162. }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))), totalPages > 0 && (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
  26163. context: context,
  26164. pagesByParentId: pagesByParentId
  26165. })));
  26166. }
  26167. function useFrontPageId() {
  26168. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  26169. const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site');
  26170. return (site === null || site === void 0 ? void 0 : site.show_on_front) === 'page' && (site === null || site === void 0 ? void 0 : site.page_on_front);
  26171. }, []);
  26172. }
  26173. function usePageData() {
  26174. const {
  26175. records: pages,
  26176. hasResolved: hasResolvedPages
  26177. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecords)('postType', 'page', {
  26178. orderby: 'menu_order',
  26179. order: 'asc',
  26180. _fields: ['id', 'link', 'parent', 'title', 'menu_order'],
  26181. per_page: -1
  26182. });
  26183. return (0,external_wp_element_namespaceObject.useMemo)(() => {
  26184. var _pages$length;
  26185. // TODO: Once the REST API supports passing multiple values to
  26186. // 'orderby', this can be removed.
  26187. // https://core.trac.wordpress.org/ticket/39037
  26188. const sortedPages = (0,external_lodash_namespaceObject.sortBy)(pages, ['menu_order', 'title.rendered']);
  26189. const pagesByParentId = sortedPages.reduce((accumulator, page) => {
  26190. const {
  26191. parent
  26192. } = page;
  26193. if (accumulator.has(parent)) {
  26194. accumulator.get(parent).push(page);
  26195. } else {
  26196. accumulator.set(parent, [page]);
  26197. }
  26198. return accumulator;
  26199. }, new Map());
  26200. return {
  26201. pagesByParentId,
  26202. hasResolvedPages,
  26203. totalPages: (_pages$length = pages === null || pages === void 0 ? void 0 : pages.length) !== null && _pages$length !== void 0 ? _pages$length : null
  26204. };
  26205. }, [pages, hasResolvedPages]);
  26206. }
  26207. const PageItems = (0,external_wp_element_namespaceObject.memo)(function PageItems(_ref2) {
  26208. let {
  26209. context,
  26210. pagesByParentId,
  26211. parentId = 0,
  26212. depth = 0
  26213. } = _ref2;
  26214. const pages = pagesByParentId.get(parentId);
  26215. const frontPageId = useFrontPageId();
  26216. if (!(pages !== null && pages !== void 0 && pages.length)) {
  26217. return [];
  26218. }
  26219. return pages.map(page => {
  26220. var _page$title, _page$title2;
  26221. const hasChildren = pagesByParentId.has(page.id);
  26222. const isNavigationChild = ('showSubmenuIcon' in context);
  26223. return (0,external_wp_element_namespaceObject.createElement)("li", {
  26224. key: page.id,
  26225. className: classnames_default()('wp-block-pages-list__item', {
  26226. 'has-child': hasChildren,
  26227. 'wp-block-navigation-item': isNavigationChild,
  26228. 'open-on-click': context.openSubmenusOnClick,
  26229. 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
  26230. 'menu-item-home': page.id === frontPageId
  26231. })
  26232. }, hasChildren && context.openSubmenusOnClick ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("button", {
  26233. className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle",
  26234. "aria-expanded": "false"
  26235. }, (_page$title = page.title) === null || _page$title === void 0 ? void 0 : _page$title.rendered), (0,external_wp_element_namespaceObject.createElement)("span", {
  26236. className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"
  26237. }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null))) : (0,external_wp_element_namespaceObject.createElement)("a", {
  26238. className: classnames_default()('wp-block-pages-list__item__link', {
  26239. 'wp-block-navigation-item__content': isNavigationChild
  26240. }),
  26241. href: page.link
  26242. }, (_page$title2 = page.title) === null || _page$title2 === void 0 ? void 0 : _page$title2.rendered), hasChildren && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
  26243. className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",
  26244. "aria-expanded": "false"
  26245. }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)), (0,external_wp_element_namespaceObject.createElement)("ul", {
  26246. className: classnames_default()('submenu-container', {
  26247. 'wp-block-navigation__submenu-container': isNavigationChild
  26248. })
  26249. }, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
  26250. context: context,
  26251. pagesByParentId: pagesByParentId,
  26252. parentId: page.id,
  26253. depth: depth + 1
  26254. }))));
  26255. });
  26256. });
  26257. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
  26258. /**
  26259. * WordPress dependencies
  26260. */
  26261. /**
  26262. * Internal dependencies
  26263. */
  26264. const page_list_metadata = {
  26265. $schema: "https://schemas.wp.org/trunk/block.json",
  26266. apiVersion: 2,
  26267. name: "core/page-list",
  26268. title: "Page List",
  26269. category: "widgets",
  26270. description: "Display a list of all pages.",
  26271. keywords: ["menu", "navigation"],
  26272. textdomain: "default",
  26273. attributes: {
  26274. __unstableMaxPages: {
  26275. type: "number"
  26276. }
  26277. },
  26278. usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
  26279. supports: {
  26280. reusable: false,
  26281. html: false
  26282. },
  26283. editorStyle: "wp-block-page-list-editor",
  26284. style: "wp-block-page-list"
  26285. };
  26286. const {
  26287. name: page_list_name
  26288. } = page_list_metadata;
  26289. const page_list_settings = {
  26290. icon: library_pages,
  26291. example: {},
  26292. edit: PageListEdit
  26293. };
  26294. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js
  26295. /**
  26296. * WordPress dependencies
  26297. */
  26298. const paragraph = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  26299. xmlns: "http://www.w3.org/2000/svg",
  26300. viewBox: "0 0 24 24"
  26301. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  26302. d: "M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"
  26303. }));
  26304. /* harmony default export */ var library_paragraph = (paragraph);
  26305. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
  26306. /**
  26307. * External dependencies
  26308. */
  26309. /**
  26310. * WordPress dependencies
  26311. */
  26312. const deprecated_supports = {
  26313. className: false
  26314. };
  26315. const paragraph_deprecated_blockAttributes = {
  26316. align: {
  26317. type: 'string'
  26318. },
  26319. content: {
  26320. type: 'string',
  26321. source: 'html',
  26322. selector: 'p',
  26323. default: ''
  26324. },
  26325. dropCap: {
  26326. type: 'boolean',
  26327. default: false
  26328. },
  26329. placeholder: {
  26330. type: 'string'
  26331. },
  26332. textColor: {
  26333. type: 'string'
  26334. },
  26335. backgroundColor: {
  26336. type: 'string'
  26337. },
  26338. fontSize: {
  26339. type: 'string'
  26340. },
  26341. direction: {
  26342. type: 'string',
  26343. enum: ['ltr', 'rtl']
  26344. },
  26345. style: {
  26346. type: 'object'
  26347. }
  26348. };
  26349. const migrateCustomColorsAndFontSizes = attributes => {
  26350. if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) {
  26351. return attributes;
  26352. }
  26353. const style = {};
  26354. if (attributes.customTextColor || attributes.customBackgroundColor) {
  26355. style.color = {};
  26356. }
  26357. if (attributes.customTextColor) {
  26358. style.color.text = attributes.customTextColor;
  26359. }
  26360. if (attributes.customBackgroundColor) {
  26361. style.color.background = attributes.customBackgroundColor;
  26362. }
  26363. if (attributes.customFontSize) {
  26364. style.typography = {
  26365. fontSize: attributes.customFontSize
  26366. };
  26367. }
  26368. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize']),
  26369. style
  26370. };
  26371. };
  26372. const paragraph_deprecated_deprecated = [{
  26373. supports: deprecated_supports,
  26374. attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
  26375. customTextColor: {
  26376. type: 'string'
  26377. },
  26378. customBackgroundColor: {
  26379. type: 'string'
  26380. },
  26381. customFontSize: {
  26382. type: 'number'
  26383. }
  26384. },
  26385. migrate: migrateCustomColorsAndFontSizes,
  26386. save(_ref) {
  26387. let {
  26388. attributes
  26389. } = _ref;
  26390. const {
  26391. align,
  26392. content,
  26393. dropCap,
  26394. backgroundColor,
  26395. textColor,
  26396. customBackgroundColor,
  26397. customTextColor,
  26398. fontSize,
  26399. customFontSize,
  26400. direction
  26401. } = attributes;
  26402. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  26403. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  26404. const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
  26405. const className = classnames_default()({
  26406. 'has-text-color': textColor || customTextColor,
  26407. 'has-background': backgroundColor || customBackgroundColor,
  26408. 'has-drop-cap': dropCap,
  26409. [`has-text-align-${align}`]: align,
  26410. [fontSizeClass]: fontSizeClass,
  26411. [textClass]: textClass,
  26412. [backgroundClass]: backgroundClass
  26413. });
  26414. const styles = {
  26415. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  26416. color: textClass ? undefined : customTextColor,
  26417. fontSize: fontSizeClass ? undefined : customFontSize
  26418. };
  26419. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26420. tagName: "p",
  26421. style: styles,
  26422. className: className ? className : undefined,
  26423. value: content,
  26424. dir: direction
  26425. });
  26426. }
  26427. }, {
  26428. supports: deprecated_supports,
  26429. attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
  26430. customTextColor: {
  26431. type: 'string'
  26432. },
  26433. customBackgroundColor: {
  26434. type: 'string'
  26435. },
  26436. customFontSize: {
  26437. type: 'number'
  26438. }
  26439. },
  26440. migrate: migrateCustomColorsAndFontSizes,
  26441. save(_ref2) {
  26442. let {
  26443. attributes
  26444. } = _ref2;
  26445. const {
  26446. align,
  26447. content,
  26448. dropCap,
  26449. backgroundColor,
  26450. textColor,
  26451. customBackgroundColor,
  26452. customTextColor,
  26453. fontSize,
  26454. customFontSize,
  26455. direction
  26456. } = attributes;
  26457. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  26458. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  26459. const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
  26460. const className = classnames_default()({
  26461. 'has-text-color': textColor || customTextColor,
  26462. 'has-background': backgroundColor || customBackgroundColor,
  26463. 'has-drop-cap': dropCap,
  26464. [fontSizeClass]: fontSizeClass,
  26465. [textClass]: textClass,
  26466. [backgroundClass]: backgroundClass
  26467. });
  26468. const styles = {
  26469. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  26470. color: textClass ? undefined : customTextColor,
  26471. fontSize: fontSizeClass ? undefined : customFontSize,
  26472. textAlign: align
  26473. };
  26474. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26475. tagName: "p",
  26476. style: styles,
  26477. className: className ? className : undefined,
  26478. value: content,
  26479. dir: direction
  26480. });
  26481. }
  26482. }, {
  26483. supports: deprecated_supports,
  26484. attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
  26485. customTextColor: {
  26486. type: 'string'
  26487. },
  26488. customBackgroundColor: {
  26489. type: 'string'
  26490. },
  26491. customFontSize: {
  26492. type: 'number'
  26493. },
  26494. width: {
  26495. type: 'string'
  26496. }
  26497. },
  26498. migrate: migrateCustomColorsAndFontSizes,
  26499. save(_ref3) {
  26500. let {
  26501. attributes
  26502. } = _ref3;
  26503. const {
  26504. width,
  26505. align,
  26506. content,
  26507. dropCap,
  26508. backgroundColor,
  26509. textColor,
  26510. customBackgroundColor,
  26511. customTextColor,
  26512. fontSize,
  26513. customFontSize
  26514. } = attributes;
  26515. const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  26516. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  26517. const fontSizeClass = fontSize && `is-${fontSize}-text`;
  26518. const className = classnames_default()({
  26519. [`align${width}`]: width,
  26520. 'has-background': backgroundColor || customBackgroundColor,
  26521. 'has-drop-cap': dropCap,
  26522. [fontSizeClass]: fontSizeClass,
  26523. [textClass]: textClass,
  26524. [backgroundClass]: backgroundClass
  26525. });
  26526. const styles = {
  26527. backgroundColor: backgroundClass ? undefined : customBackgroundColor,
  26528. color: textClass ? undefined : customTextColor,
  26529. fontSize: fontSizeClass ? undefined : customFontSize,
  26530. textAlign: align
  26531. };
  26532. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26533. tagName: "p",
  26534. style: styles,
  26535. className: className ? className : undefined,
  26536. value: content
  26537. });
  26538. }
  26539. }, {
  26540. supports: deprecated_supports,
  26541. attributes: (0,external_lodash_namespaceObject.omit)({ ...paragraph_deprecated_blockAttributes,
  26542. fontSize: {
  26543. type: 'number'
  26544. }
  26545. }, ['style']),
  26546. save(_ref4) {
  26547. let {
  26548. attributes
  26549. } = _ref4;
  26550. const {
  26551. width,
  26552. align,
  26553. content,
  26554. dropCap,
  26555. backgroundColor,
  26556. textColor,
  26557. fontSize
  26558. } = attributes;
  26559. const className = classnames_default()({
  26560. [`align${width}`]: width,
  26561. 'has-background': backgroundColor,
  26562. 'has-drop-cap': dropCap
  26563. });
  26564. const styles = {
  26565. backgroundColor,
  26566. color: textColor,
  26567. fontSize,
  26568. textAlign: align
  26569. };
  26570. return (0,external_wp_element_namespaceObject.createElement)("p", {
  26571. style: styles,
  26572. className: className ? className : undefined
  26573. }, content);
  26574. },
  26575. migrate(attributes) {
  26576. return migrateCustomColorsAndFontSizes((0,external_lodash_namespaceObject.omit)({ ...attributes,
  26577. customFontSize: (0,external_lodash_namespaceObject.isFinite)(attributes.fontSize) ? attributes.fontSize : undefined,
  26578. customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
  26579. customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined
  26580. }), ['fontSize', 'textColor', 'backgroundColor', 'style']);
  26581. }
  26582. }, {
  26583. supports: deprecated_supports,
  26584. attributes: { ...paragraph_deprecated_blockAttributes,
  26585. content: {
  26586. type: 'string',
  26587. source: 'html',
  26588. default: ''
  26589. }
  26590. },
  26591. save(_ref5) {
  26592. let {
  26593. attributes
  26594. } = _ref5;
  26595. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
  26596. },
  26597. migrate(attributes) {
  26598. return attributes;
  26599. }
  26600. }];
  26601. /* harmony default export */ var paragraph_deprecated = (paragraph_deprecated_deprecated);
  26602. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
  26603. /**
  26604. * WordPress dependencies
  26605. */
  26606. const formatLtr = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  26607. xmlns: "http://www.w3.org/2000/svg",
  26608. viewBox: "-2 -2 24 24"
  26609. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  26610. d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"
  26611. }));
  26612. /* harmony default export */ var format_ltr = (formatLtr);
  26613. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
  26614. /**
  26615. * External dependencies
  26616. */
  26617. /**
  26618. * WordPress dependencies
  26619. */
  26620. const paragraph_edit_name = 'core/paragraph';
  26621. function ParagraphRTLControl(_ref) {
  26622. let {
  26623. direction,
  26624. setDirection
  26625. } = _ref;
  26626. return (0,external_wp_i18n_namespaceObject.isRTL)() && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  26627. controls: [{
  26628. icon: format_ltr,
  26629. title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'),
  26630. isActive: direction === 'ltr',
  26631. onClick() {
  26632. setDirection(direction === 'ltr' ? undefined : 'ltr');
  26633. }
  26634. }]
  26635. });
  26636. }
  26637. function ParagraphBlock(_ref2) {
  26638. let {
  26639. attributes,
  26640. mergeBlocks,
  26641. onReplace,
  26642. onRemove,
  26643. setAttributes,
  26644. clientId
  26645. } = _ref2;
  26646. const {
  26647. align,
  26648. content,
  26649. direction,
  26650. dropCap,
  26651. placeholder
  26652. } = attributes;
  26653. const isDropCapFeatureEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.dropCap');
  26654. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  26655. className: classnames_default()({
  26656. 'has-drop-cap': dropCap,
  26657. [`has-text-align-${align}`]: align
  26658. }),
  26659. style: {
  26660. direction
  26661. }
  26662. });
  26663. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  26664. group: "block"
  26665. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  26666. value: align,
  26667. onChange: newAlign => setAttributes({
  26668. align: newAlign
  26669. })
  26670. }), (0,external_wp_element_namespaceObject.createElement)(ParagraphRTLControl, {
  26671. direction: direction,
  26672. setDirection: newDirection => setAttributes({
  26673. direction: newDirection
  26674. })
  26675. })), isDropCapFeatureEnabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  26676. __experimentalGroup: "typography"
  26677. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  26678. hasValue: () => !!dropCap,
  26679. label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
  26680. onDeselect: () => setAttributes({
  26681. dropCap: undefined
  26682. }),
  26683. resetAllFilter: () => ({
  26684. dropCap: undefined
  26685. }),
  26686. panelId: clientId
  26687. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  26688. label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
  26689. checked: !!dropCap,
  26690. onChange: () => setAttributes({
  26691. dropCap: !dropCap
  26692. }),
  26693. help: dropCap ? (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.') : (0,external_wp_i18n_namespaceObject.__)('Toggle to show a large initial letter.')
  26694. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  26695. identifier: "content",
  26696. tagName: "p"
  26697. }, blockProps, {
  26698. value: content,
  26699. onChange: newContent => setAttributes({
  26700. content: newContent
  26701. }),
  26702. onSplit: (value, isOriginal) => {
  26703. let newAttributes;
  26704. if (isOriginal || value) {
  26705. newAttributes = { ...attributes,
  26706. content: value
  26707. };
  26708. }
  26709. const block = (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_edit_name, newAttributes);
  26710. if (isOriginal) {
  26711. block.clientId = clientId;
  26712. }
  26713. return block;
  26714. },
  26715. onMerge: mergeBlocks,
  26716. onReplace: onReplace,
  26717. onRemove: onRemove,
  26718. "aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Paragraph block') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
  26719. "data-empty": content ? false : true,
  26720. placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
  26721. __unstableEmbedURLOnPaste: true,
  26722. __unstableAllowPrefixTransformations: true
  26723. })));
  26724. }
  26725. /* harmony default export */ var paragraph_edit = (ParagraphBlock);
  26726. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
  26727. /**
  26728. * External dependencies
  26729. */
  26730. /**
  26731. * WordPress dependencies
  26732. */
  26733. function paragraph_save_save(_ref) {
  26734. let {
  26735. attributes
  26736. } = _ref;
  26737. const {
  26738. align,
  26739. content,
  26740. dropCap,
  26741. direction
  26742. } = attributes;
  26743. const className = classnames_default()({
  26744. 'has-drop-cap': dropCap,
  26745. [`has-text-align-${align}`]: align
  26746. });
  26747. return (0,external_wp_element_namespaceObject.createElement)("p", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  26748. className,
  26749. dir: direction
  26750. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  26751. value: content
  26752. }));
  26753. }
  26754. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
  26755. /**
  26756. * WordPress dependencies
  26757. */
  26758. /**
  26759. * Internal dependencies
  26760. */
  26761. const {
  26762. name: paragraph_transforms_name
  26763. } = {
  26764. $schema: "https://schemas.wp.org/trunk/block.json",
  26765. apiVersion: 2,
  26766. name: "core/paragraph",
  26767. title: "Paragraph",
  26768. category: "text",
  26769. description: "Start with the basic building block of all narrative.",
  26770. keywords: ["text"],
  26771. textdomain: "default",
  26772. attributes: {
  26773. align: {
  26774. type: "string"
  26775. },
  26776. content: {
  26777. type: "string",
  26778. source: "html",
  26779. selector: "p",
  26780. "default": "",
  26781. __experimentalRole: "content"
  26782. },
  26783. dropCap: {
  26784. type: "boolean",
  26785. "default": false
  26786. },
  26787. placeholder: {
  26788. type: "string"
  26789. },
  26790. direction: {
  26791. type: "string",
  26792. "enum": ["ltr", "rtl"]
  26793. }
  26794. },
  26795. supports: {
  26796. anchor: true,
  26797. className: false,
  26798. color: {
  26799. link: true,
  26800. __experimentalDefaultControls: {
  26801. background: true,
  26802. text: true
  26803. }
  26804. },
  26805. typography: {
  26806. fontSize: true,
  26807. lineHeight: true,
  26808. __experimentalFontStyle: true,
  26809. __experimentalFontWeight: true,
  26810. __experimentalLetterSpacing: true,
  26811. __experimentalTextTransform: true,
  26812. __experimentalDefaultControls: {
  26813. fontSize: true
  26814. }
  26815. },
  26816. __experimentalSelector: "p",
  26817. __unstablePasteTextInline: true
  26818. },
  26819. editorStyle: "wp-block-paragraph-editor",
  26820. style: "wp-block-paragraph"
  26821. };
  26822. const paragraph_transforms_transforms = {
  26823. from: [{
  26824. type: 'raw',
  26825. // Paragraph is a fallback and should be matched last.
  26826. priority: 20,
  26827. selector: 'p',
  26828. schema: _ref => {
  26829. let {
  26830. phrasingContentSchema,
  26831. isPaste
  26832. } = _ref;
  26833. return {
  26834. p: {
  26835. children: phrasingContentSchema,
  26836. attributes: isPaste ? [] : ['style', 'id']
  26837. }
  26838. };
  26839. },
  26840. transform(node) {
  26841. const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(paragraph_transforms_name, node.outerHTML);
  26842. const {
  26843. textAlign
  26844. } = node.style || {};
  26845. if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
  26846. attributes.align = textAlign;
  26847. }
  26848. return (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_transforms_name, attributes);
  26849. }
  26850. }]
  26851. };
  26852. /* harmony default export */ var paragraph_transforms = (paragraph_transforms_transforms);
  26853. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
  26854. /**
  26855. * External dependencies
  26856. */
  26857. /**
  26858. * WordPress dependencies
  26859. */
  26860. /**
  26861. * Internal dependencies
  26862. */
  26863. const paragraph_metadata = {
  26864. $schema: "https://schemas.wp.org/trunk/block.json",
  26865. apiVersion: 2,
  26866. name: "core/paragraph",
  26867. title: "Paragraph",
  26868. category: "text",
  26869. description: "Start with the basic building block of all narrative.",
  26870. keywords: ["text"],
  26871. textdomain: "default",
  26872. attributes: {
  26873. align: {
  26874. type: "string"
  26875. },
  26876. content: {
  26877. type: "string",
  26878. source: "html",
  26879. selector: "p",
  26880. "default": "",
  26881. __experimentalRole: "content"
  26882. },
  26883. dropCap: {
  26884. type: "boolean",
  26885. "default": false
  26886. },
  26887. placeholder: {
  26888. type: "string"
  26889. },
  26890. direction: {
  26891. type: "string",
  26892. "enum": ["ltr", "rtl"]
  26893. }
  26894. },
  26895. supports: {
  26896. anchor: true,
  26897. className: false,
  26898. color: {
  26899. link: true,
  26900. __experimentalDefaultControls: {
  26901. background: true,
  26902. text: true
  26903. }
  26904. },
  26905. typography: {
  26906. fontSize: true,
  26907. lineHeight: true,
  26908. __experimentalFontStyle: true,
  26909. __experimentalFontWeight: true,
  26910. __experimentalLetterSpacing: true,
  26911. __experimentalTextTransform: true,
  26912. __experimentalDefaultControls: {
  26913. fontSize: true
  26914. }
  26915. },
  26916. __experimentalSelector: "p",
  26917. __unstablePasteTextInline: true
  26918. },
  26919. editorStyle: "wp-block-paragraph-editor",
  26920. style: "wp-block-paragraph"
  26921. };
  26922. const {
  26923. name: paragraph_name
  26924. } = paragraph_metadata;
  26925. const paragraph_settings = {
  26926. icon: library_paragraph,
  26927. example: {
  26928. attributes: {
  26929. content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'),
  26930. style: {
  26931. typography: {
  26932. fontSize: 28
  26933. }
  26934. },
  26935. dropCap: true
  26936. }
  26937. },
  26938. __experimentalLabel(attributes, _ref) {
  26939. let {
  26940. context
  26941. } = _ref;
  26942. if (context === 'accessibility') {
  26943. const {
  26944. content
  26945. } = attributes;
  26946. return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content;
  26947. }
  26948. },
  26949. transforms: paragraph_transforms,
  26950. deprecated: paragraph_deprecated,
  26951. merge(attributes, attributesToMerge) {
  26952. return {
  26953. content: (attributes.content || '') + (attributesToMerge.content || '')
  26954. };
  26955. },
  26956. edit: paragraph_edit,
  26957. save: paragraph_save_save
  26958. };
  26959. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
  26960. /**
  26961. * External dependencies
  26962. */
  26963. /**
  26964. * WordPress dependencies
  26965. */
  26966. function PostAuthorEdit(_ref) {
  26967. let {
  26968. isSelected,
  26969. context: {
  26970. postType,
  26971. postId,
  26972. queryId
  26973. },
  26974. attributes,
  26975. setAttributes
  26976. } = _ref;
  26977. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  26978. const {
  26979. authorId,
  26980. authorDetails,
  26981. authors
  26982. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  26983. var _getEditedEntityRecor;
  26984. const {
  26985. getEditedEntityRecord,
  26986. getUser,
  26987. getUsers
  26988. } = select(external_wp_coreData_namespaceObject.store);
  26989. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  26990. return {
  26991. authorId: _authorId,
  26992. authorDetails: _authorId ? getUser(_authorId) : null,
  26993. authors: getUsers({
  26994. who: 'authors'
  26995. })
  26996. };
  26997. }, [postType, postId]);
  26998. const {
  26999. editEntityRecord
  27000. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  27001. const {
  27002. textAlign,
  27003. showAvatar,
  27004. showBio,
  27005. byline
  27006. } = attributes;
  27007. const avatarSizes = [];
  27008. if (authorDetails) {
  27009. (0,external_lodash_namespaceObject.forEach)(authorDetails.avatar_urls, (url, size) => {
  27010. avatarSizes.push({
  27011. value: size,
  27012. label: `${size} x ${size}`
  27013. });
  27014. });
  27015. }
  27016. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27017. className: classnames_default()({
  27018. [`has-text-align-${textAlign}`]: textAlign
  27019. })
  27020. });
  27021. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27022. title: (0,external_wp_i18n_namespaceObject.__)('Author Settings')
  27023. }, !isDescendentOfQueryLoop && !!(authors !== null && authors !== void 0 && authors.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  27024. label: (0,external_wp_i18n_namespaceObject.__)('Author'),
  27025. value: authorId,
  27026. options: authors.map(_ref2 => {
  27027. let {
  27028. id,
  27029. name
  27030. } = _ref2;
  27031. return {
  27032. value: id,
  27033. label: name
  27034. };
  27035. }),
  27036. onChange: nextAuthorId => {
  27037. editEntityRecord('postType', postType, postId, {
  27038. author: nextAuthorId
  27039. });
  27040. }
  27041. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27042. label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'),
  27043. checked: showAvatar,
  27044. onChange: () => setAttributes({
  27045. showAvatar: !showAvatar
  27046. })
  27047. }), showAvatar && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  27048. label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'),
  27049. value: attributes.avatarSize,
  27050. options: avatarSizes,
  27051. onChange: size => {
  27052. setAttributes({
  27053. avatarSize: Number(size)
  27054. });
  27055. }
  27056. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27057. label: (0,external_wp_i18n_namespaceObject.__)('Show bio'),
  27058. checked: showBio,
  27059. onChange: () => setAttributes({
  27060. showBio: !showBio
  27061. })
  27062. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27063. group: "block"
  27064. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27065. value: textAlign,
  27066. onChange: nextAlign => {
  27067. setAttributes({
  27068. textAlign: nextAlign
  27069. });
  27070. }
  27071. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, showAvatar && authorDetails && (0,external_wp_element_namespaceObject.createElement)("div", {
  27072. className: "wp-block-post-author__avatar"
  27073. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  27074. width: attributes.avatarSize,
  27075. src: authorDetails.avatar_urls[attributes.avatarSize],
  27076. alt: authorDetails.name
  27077. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  27078. className: "wp-block-post-author__content"
  27079. }, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  27080. className: "wp-block-post-author__byline",
  27081. multiline: false,
  27082. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'),
  27083. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'),
  27084. value: byline,
  27085. onChange: value => setAttributes({
  27086. byline: value
  27087. })
  27088. }), (0,external_wp_element_namespaceObject.createElement)("p", {
  27089. className: "wp-block-post-author__name"
  27090. }, (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) || (0,external_wp_i18n_namespaceObject.__)('Post Author')), showBio && (0,external_wp_element_namespaceObject.createElement)("p", {
  27091. className: "wp-block-post-author__bio"
  27092. }, authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description))));
  27093. }
  27094. /* harmony default export */ var post_author_edit = (PostAuthorEdit);
  27095. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
  27096. /**
  27097. * WordPress dependencies
  27098. */
  27099. const postAuthor = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  27100. viewBox: "0 0 24 24",
  27101. xmlns: "http://www.w3.org/2000/svg"
  27102. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  27103. d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",
  27104. fillRule: "evenodd",
  27105. clipRule: "evenodd"
  27106. }));
  27107. /* harmony default export */ var post_author = (postAuthor);
  27108. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
  27109. /**
  27110. * Internal dependencies
  27111. */
  27112. const post_author_metadata = {
  27113. $schema: "https://schemas.wp.org/trunk/block.json",
  27114. apiVersion: 2,
  27115. name: "core/post-author",
  27116. title: "Post Author",
  27117. category: "theme",
  27118. description: "Display post author details such as name, avatar, and bio.",
  27119. textdomain: "default",
  27120. attributes: {
  27121. textAlign: {
  27122. type: "string"
  27123. },
  27124. avatarSize: {
  27125. type: "number",
  27126. "default": 48
  27127. },
  27128. showAvatar: {
  27129. type: "boolean",
  27130. "default": true
  27131. },
  27132. showBio: {
  27133. type: "boolean"
  27134. },
  27135. byline: {
  27136. type: "string"
  27137. }
  27138. },
  27139. usesContext: ["postType", "postId", "queryId"],
  27140. supports: {
  27141. html: false,
  27142. spacing: {
  27143. margin: true,
  27144. padding: true
  27145. },
  27146. typography: {
  27147. fontSize: true,
  27148. lineHeight: true,
  27149. __experimentalFontStyle: true,
  27150. __experimentalFontWeight: true,
  27151. __experimentalLetterSpacing: true,
  27152. __experimentalTextTransform: true,
  27153. __experimentalDefaultControls: {
  27154. fontSize: true
  27155. }
  27156. },
  27157. color: {
  27158. gradients: true,
  27159. link: true,
  27160. __experimentalDuotone: ".wp-block-post-author__avatar img",
  27161. __experimentalDefaultControls: {
  27162. background: true,
  27163. text: true
  27164. }
  27165. }
  27166. },
  27167. editorStyle: "wp-block-post-author-editor",
  27168. style: "wp-block-post-author"
  27169. };
  27170. /**
  27171. * WordPress dependencies
  27172. */
  27173. const {
  27174. name: post_author_name
  27175. } = post_author_metadata;
  27176. const post_author_settings = {
  27177. icon: post_author,
  27178. edit: post_author_edit
  27179. };
  27180. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js
  27181. /**
  27182. * External dependencies
  27183. */
  27184. /**
  27185. * WordPress dependencies
  27186. */
  27187. function PostAuthorBiographyEdit(_ref) {
  27188. let {
  27189. context: {
  27190. postType,
  27191. postId
  27192. },
  27193. attributes: {
  27194. textAlign
  27195. },
  27196. setAttributes
  27197. } = _ref;
  27198. const {
  27199. authorDetails
  27200. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27201. var _getEditedEntityRecor;
  27202. const {
  27203. getEditedEntityRecord,
  27204. getUser
  27205. } = select(external_wp_coreData_namespaceObject.store);
  27206. const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
  27207. return {
  27208. authorDetails: _authorId ? getUser(_authorId) : null
  27209. };
  27210. }, [postType, postId]);
  27211. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27212. className: classnames_default()({
  27213. [`has-text-align-${textAlign}`]: textAlign
  27214. })
  27215. });
  27216. const displayAuthorBiography = (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description) || (0,external_wp_i18n_namespaceObject.__)('Author Biography');
  27217. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27218. group: "block"
  27219. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27220. value: textAlign,
  27221. onChange: nextAlign => {
  27222. setAttributes({
  27223. textAlign: nextAlign
  27224. });
  27225. }
  27226. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, " ", displayAuthorBiography, " "));
  27227. }
  27228. /* harmony default export */ var post_author_biography_edit = (PostAuthorBiographyEdit);
  27229. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
  27230. /**
  27231. * Internal dependencies
  27232. */
  27233. const post_author_biography_metadata = {
  27234. $schema: "https://schemas.wp.org/trunk/block.json",
  27235. apiVersion: 2,
  27236. name: "core/post-author-biography",
  27237. title: "Post Author Biography",
  27238. category: "theme",
  27239. description: "The author biography.",
  27240. textdomain: "default",
  27241. attributes: {
  27242. textAlign: {
  27243. type: "string"
  27244. }
  27245. },
  27246. usesContext: ["postType", "postId"],
  27247. supports: {
  27248. spacing: {
  27249. margin: true,
  27250. padding: true
  27251. },
  27252. color: {
  27253. gradients: true,
  27254. link: true,
  27255. __experimentalDefaultControls: {
  27256. background: true,
  27257. text: true
  27258. }
  27259. },
  27260. typography: {
  27261. fontSize: true,
  27262. lineHeight: true,
  27263. __experimentalFontFamily: true,
  27264. __experimentalFontWeight: true,
  27265. __experimentalFontStyle: true,
  27266. __experimentalTextTransform: true,
  27267. __experimentalLetterSpacing: true,
  27268. __experimentalDefaultControls: {
  27269. fontSize: true
  27270. }
  27271. }
  27272. }
  27273. };
  27274. /**
  27275. * WordPress dependencies
  27276. */
  27277. const {
  27278. name: post_author_biography_name
  27279. } = post_author_biography_metadata;
  27280. const post_author_biography_settings = {
  27281. icon: post_author,
  27282. edit: post_author_biography_edit
  27283. };
  27284. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/edit.js
  27285. /**
  27286. * External dependencies
  27287. */
  27288. /**
  27289. * WordPress dependencies
  27290. */
  27291. function PostCommentsEdit(_ref) {
  27292. let {
  27293. attributes: {
  27294. textAlign
  27295. },
  27296. setAttributes,
  27297. context: {
  27298. postType,
  27299. postId
  27300. }
  27301. } = _ref;
  27302. let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  27303. postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title');
  27304. const [commentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
  27305. const {
  27306. avatarURL,
  27307. defaultCommentStatus
  27308. } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  27309. const isSiteEditor = postType === undefined || postId === undefined;
  27310. const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27311. var _select$getPostType;
  27312. return postType ? !!((_select$getPostType = select(external_wp_coreData_namespaceObject.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
  27313. });
  27314. let warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments Query Loop" block.');
  27315. let showPlacholder = true;
  27316. if (!isSiteEditor && 'open' !== commentStatus) {
  27317. if ('closed' === commentStatus) {
  27318. warning = (0,external_wp_i18n_namespaceObject.sprintf)(
  27319. /* translators: 1: Post type (i.e. "post", "page") */
  27320. (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments to this %s are not allowed.'), postType);
  27321. showPlacholder = false;
  27322. } else if (!postTypeSupportsComments) {
  27323. warning = (0,external_wp_i18n_namespaceObject.sprintf)(
  27324. /* translators: 1: Post type (i.e. "post", "page") */
  27325. (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
  27326. showPlacholder = false;
  27327. } else if ('open' !== defaultCommentStatus) {
  27328. warning = (0,external_wp_i18n_namespaceObject.__)('Post Comments block: Comments are not enabled.');
  27329. showPlacholder = false;
  27330. }
  27331. }
  27332. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27333. className: classnames_default()({
  27334. [`has-text-align-${textAlign}`]: textAlign
  27335. })
  27336. });
  27337. const disabledRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)();
  27338. const textareaId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostCommentsEdit);
  27339. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27340. group: "block"
  27341. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27342. value: textAlign,
  27343. onChange: nextAlign => {
  27344. setAttributes({
  27345. textAlign: nextAlign
  27346. });
  27347. }
  27348. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, warning), showPlacholder && (0,external_wp_element_namespaceObject.createElement)("div", {
  27349. className: "wp-block-post-comments__placeholder",
  27350. ref: disabledRef
  27351. }, (0,external_wp_element_namespaceObject.createElement)("h3", null,
  27352. /* translators: %s: Post title. */
  27353. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_wp_element_namespaceObject.createElement)("div", {
  27354. className: "navigation"
  27355. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  27356. className: "alignleft"
  27357. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27358. href: "#top"
  27359. }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27360. className: "alignright"
  27361. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27362. href: "#top"
  27363. }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)("ol", {
  27364. className: "commentlist"
  27365. }, (0,external_wp_element_namespaceObject.createElement)("li", {
  27366. className: "comment even thread-even depth-1"
  27367. }, (0,external_wp_element_namespaceObject.createElement)("article", {
  27368. className: "comment-body"
  27369. }, (0,external_wp_element_namespaceObject.createElement)("footer", {
  27370. className: "comment-meta"
  27371. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  27372. className: "comment-author vcard"
  27373. }, (0,external_wp_element_namespaceObject.createElement)("img", {
  27374. alt: "Commenter Avatar",
  27375. src: avatarURL,
  27376. className: "avatar avatar-32 photo",
  27377. height: "32",
  27378. width: "32",
  27379. loading: "lazy"
  27380. }), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(
  27381. /* translators: %s: Comment author link. */
  27382. (0,external_wp_i18n_namespaceObject.__)('%s <span>says:</span>'), (0,external_wp_i18n_namespaceObject.sprintf)('<cite><a>%s</a></cite>', (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), {
  27383. span: (0,external_wp_element_namespaceObject.createElement)("span", {
  27384. className: "says"
  27385. }),
  27386. a:
  27387. /* eslint-disable jsx-a11y/anchor-has-content */
  27388. (0,external_wp_element_namespaceObject.createElement)("a", {
  27389. href: "#top",
  27390. className: "url"
  27391. })
  27392. /* eslint-enable jsx-a11y/anchor-has-content */
  27393. ,
  27394. cite: (0,external_wp_element_namespaceObject.createElement)("cite", {
  27395. className: "fn"
  27396. })
  27397. })), (0,external_wp_element_namespaceObject.createElement)("div", {
  27398. className: "comment-metadata"
  27399. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27400. href: "#top"
  27401. }, (0,external_wp_element_namespaceObject.createElement)("time", {
  27402. dateTime: "2000-01-01T12:00:00+00:00"
  27403. }, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 12:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
  27404. className: "edit-link"
  27405. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27406. className: "comment-edit-link",
  27407. href: "#top"
  27408. }, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27409. className: "comment-content"
  27410. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>'), {
  27411. a:
  27412. /* eslint-disable-next-line jsx-a11y/anchor-has-content */
  27413. (0,external_wp_element_namespaceObject.createElement)("a", {
  27414. href: "https://gravatar.com/"
  27415. })
  27416. }))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27417. className: "reply"
  27418. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27419. className: "comment-reply-link",
  27420. href: "#top",
  27421. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
  27422. /* translators: Comment reply button text. %s: Comment author name. */
  27423. (0,external_wp_i18n_namespaceObject.__)('Reply to %s'), (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))
  27424. }, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27425. className: "navigation"
  27426. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  27427. className: "alignleft"
  27428. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27429. href: "#top"
  27430. }, "\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments'))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27431. className: "alignright"
  27432. }, (0,external_wp_element_namespaceObject.createElement)("a", {
  27433. href: "#top"
  27434. }, (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"))), (0,external_wp_element_namespaceObject.createElement)("div", {
  27435. className: "comment-respond"
  27436. }, (0,external_wp_element_namespaceObject.createElement)("h3", {
  27437. className: "comment-reply-title"
  27438. }, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_wp_element_namespaceObject.createElement)("form", {
  27439. className: "comment-form",
  27440. noValidate: true
  27441. }, (0,external_wp_element_namespaceObject.createElement)("p", {
  27442. className: "comment-form-comment"
  27443. }, (0,external_wp_element_namespaceObject.createElement)("label", {
  27444. htmlFor: `comment-${textareaId}`
  27445. }, (0,external_wp_i18n_namespaceObject.__)('Comment'), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
  27446. className: "required"
  27447. }, "*")), (0,external_wp_element_namespaceObject.createElement)("textarea", {
  27448. id: `comment-${textareaId}`,
  27449. name: "comment",
  27450. cols: "45",
  27451. rows: "8",
  27452. required: true
  27453. })), (0,external_wp_element_namespaceObject.createElement)("p", {
  27454. className: "form-submit wp-block-button"
  27455. }, (0,external_wp_element_namespaceObject.createElement)("input", {
  27456. name: "submit",
  27457. type: "submit",
  27458. className: "submit wp-block-button__link",
  27459. value: (0,external_wp_i18n_namespaceObject.__)('Post Comment')
  27460. })))))));
  27461. }
  27462. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
  27463. /**
  27464. * WordPress dependencies
  27465. */
  27466. /**
  27467. * Internal dependencies
  27468. */
  27469. const post_comments_metadata = {
  27470. $schema: "https://schemas.wp.org/trunk/block.json",
  27471. apiVersion: 2,
  27472. name: "core/post-comments",
  27473. title: "Post Comments (deprecated)",
  27474. category: "theme",
  27475. description: "This block is deprecated. Please use the Comments Query Loop block instead.",
  27476. textdomain: "default",
  27477. attributes: {
  27478. textAlign: {
  27479. type: "string"
  27480. }
  27481. },
  27482. usesContext: ["postId", "postType"],
  27483. supports: {
  27484. html: false,
  27485. align: ["wide", "full"],
  27486. typography: {
  27487. fontSize: true,
  27488. lineHeight: true,
  27489. __experimentalFontStyle: true,
  27490. __experimentalFontWeight: true,
  27491. __experimentalLetterSpacing: true,
  27492. __experimentalTextTransform: true,
  27493. __experimentalDefaultControls: {
  27494. fontSize: true
  27495. }
  27496. },
  27497. color: {
  27498. gradients: true,
  27499. link: true,
  27500. __experimentalDefaultControls: {
  27501. background: true,
  27502. text: true
  27503. }
  27504. },
  27505. inserter: false
  27506. },
  27507. style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"],
  27508. editorStyle: "wp-block-post-comments-editor"
  27509. };
  27510. const {
  27511. name: post_comments_name
  27512. } = post_comments_metadata;
  27513. const post_comments_settings = {
  27514. icon: post_comments,
  27515. edit: PostCommentsEdit
  27516. };
  27517. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js
  27518. /**
  27519. * WordPress dependencies
  27520. */
  27521. const postCommentsForm = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  27522. xmlns: "http://www.w3.org/2000/svg",
  27523. viewBox: "0 0 24 24"
  27524. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  27525. d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"
  27526. }));
  27527. /* harmony default export */ var post_comments_form = (postCommentsForm);
  27528. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js
  27529. /**
  27530. * External dependencies
  27531. */
  27532. /**
  27533. * WordPress dependencies
  27534. */
  27535. function PostCommentsFormEdit(_ref) {
  27536. let {
  27537. attributes,
  27538. context,
  27539. setAttributes
  27540. } = _ref;
  27541. const {
  27542. textAlign
  27543. } = attributes;
  27544. const {
  27545. postId,
  27546. postType
  27547. } = context;
  27548. const [commentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
  27549. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27550. className: classnames_default()({
  27551. [`has-text-align-${textAlign}`]: textAlign
  27552. })
  27553. });
  27554. const isInSiteEditor = postType === undefined || postId === undefined;
  27555. const disabledFormRef = (0,external_wp_compose_namespaceObject.__experimentalUseDisabled)();
  27556. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostCommentsFormEdit);
  27557. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27558. group: "block"
  27559. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27560. value: textAlign,
  27561. onChange: nextAlign => {
  27562. setAttributes({
  27563. textAlign: nextAlign
  27564. });
  27565. }
  27566. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, !commentStatus && !isInSiteEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: comments are not enabled for this post type.')), 'open' !== commentStatus && !isInSiteEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
  27567. /* translators: 1: Post type (i.e. "post", "page") */
  27568. (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: comments to this %s are not allowed.'), postType)), ('open' === commentStatus || isInSiteEditor) && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Leave a Reply')), (0,external_wp_element_namespaceObject.createElement)("form", {
  27569. noValidate: true,
  27570. className: "comment-form",
  27571. ref: disabledFormRef
  27572. }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("label", {
  27573. htmlFor: `comment-${instanceId}`
  27574. }, (0,external_wp_i18n_namespaceObject.__)('Comment')), (0,external_wp_element_namespaceObject.createElement)("textarea", {
  27575. id: `comment-${instanceId}`,
  27576. name: "comment",
  27577. cols: "45",
  27578. rows: "8"
  27579. })), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)("input", {
  27580. name: "submit",
  27581. className: "submit wp-block-button__link",
  27582. label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'),
  27583. value: (0,external_wp_i18n_namespaceObject.__)('Post Comment'),
  27584. readOnly: true
  27585. }))))));
  27586. }
  27587. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
  27588. /**
  27589. * WordPress dependencies
  27590. */
  27591. /**
  27592. * Internal dependencies
  27593. */
  27594. const post_comments_form_metadata = {
  27595. $schema: "https://schemas.wp.org/trunk/block.json",
  27596. apiVersion: 2,
  27597. name: "core/post-comments-form",
  27598. title: "Post Comments Form",
  27599. category: "theme",
  27600. description: "Display a post's comments form.",
  27601. textdomain: "default",
  27602. attributes: {
  27603. textAlign: {
  27604. type: "string"
  27605. }
  27606. },
  27607. usesContext: ["postId", "postType"],
  27608. supports: {
  27609. html: false,
  27610. color: {
  27611. gradients: true,
  27612. link: true,
  27613. __experimentalDefaultControls: {
  27614. background: true,
  27615. text: true
  27616. }
  27617. },
  27618. typography: {
  27619. fontSize: true,
  27620. lineHeight: true,
  27621. __experimentalFontStyle: true,
  27622. __experimentalFontWeight: true,
  27623. __experimentalLetterSpacing: true,
  27624. __experimentalTextTransform: true,
  27625. __experimentalDefaultControls: {
  27626. fontSize: true
  27627. }
  27628. }
  27629. },
  27630. editorStyle: "wp-block-post-comments-form-editor",
  27631. style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
  27632. };
  27633. const {
  27634. name: post_comments_form_name
  27635. } = post_comments_form_metadata;
  27636. const post_comments_form_settings = {
  27637. icon: post_comments_form,
  27638. edit: PostCommentsFormEdit
  27639. };
  27640. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js
  27641. /**
  27642. * WordPress dependencies
  27643. */
  27644. const postContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  27645. xmlns: "https://www.w3.org/2000/svg",
  27646. viewBox: "0 0 24 24"
  27647. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  27648. d: "M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
  27649. }));
  27650. /* harmony default export */ var post_content = (postContent);
  27651. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
  27652. /**
  27653. * WordPress dependencies
  27654. */
  27655. /**
  27656. * Returns whether the current user can edit the given entity.
  27657. *
  27658. * @param {string} kind Entity kind.
  27659. * @param {string} name Entity name.
  27660. * @param {string} recordId Record's id.
  27661. */
  27662. function useCanEditEntity(kind, name, recordId) {
  27663. return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
  27664. }
  27665. /* harmony default export */ var hooks = ({
  27666. useCanEditEntity
  27667. });
  27668. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
  27669. /**
  27670. * WordPress dependencies
  27671. */
  27672. /**
  27673. * Internal dependencies
  27674. */
  27675. function ReadOnlyContent(_ref) {
  27676. let {
  27677. userCanEdit,
  27678. postType,
  27679. postId
  27680. } = _ref;
  27681. const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
  27682. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  27683. return content !== null && content !== void 0 && content.protected && !userCanEdit ? (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('This content is password protected.'))) : (0,external_wp_element_namespaceObject.createElement)("div", _extends({}, blockProps, {
  27684. dangerouslySetInnerHTML: {
  27685. __html: content === null || content === void 0 ? void 0 : content.rendered
  27686. }
  27687. }));
  27688. }
  27689. function EditableContent(_ref2) {
  27690. let {
  27691. layout,
  27692. context = {}
  27693. } = _ref2;
  27694. const {
  27695. postType,
  27696. postId
  27697. } = context;
  27698. const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
  27699. var _getSettings;
  27700. const {
  27701. getSettings
  27702. } = select(external_wp_blockEditor_namespaceObject.store);
  27703. return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
  27704. }, []);
  27705. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  27706. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  27707. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
  27708. id: postId
  27709. });
  27710. const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27711. className: 'entry-content'
  27712. }), {
  27713. value: blocks,
  27714. onInput,
  27715. onChange,
  27716. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  27717. });
  27718. return (0,external_wp_element_namespaceObject.createElement)("div", props);
  27719. }
  27720. function Content(props) {
  27721. const {
  27722. context: {
  27723. queryId,
  27724. postType,
  27725. postId
  27726. } = {}
  27727. } = props;
  27728. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  27729. const userCanEdit = useCanEditEntity('postType', postType, postId);
  27730. const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  27731. return isEditable ? (0,external_wp_element_namespaceObject.createElement)(EditableContent, props) : (0,external_wp_element_namespaceObject.createElement)(ReadOnlyContent, {
  27732. userCanEdit: userCanEdit,
  27733. postType: postType,
  27734. postId: postId
  27735. });
  27736. }
  27737. function edit_Placeholder() {
  27738. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  27739. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Content block, it will display all the blocks in any single post or page.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Post Content block can display the contents of those entries as well.')));
  27740. }
  27741. function RecursionError() {
  27742. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  27743. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  27744. }
  27745. function PostContentEdit(_ref3) {
  27746. let {
  27747. context,
  27748. attributes
  27749. } = _ref3;
  27750. const {
  27751. postId: contextPostId,
  27752. postType: contextPostType
  27753. } = context;
  27754. const {
  27755. layout = {}
  27756. } = attributes;
  27757. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(contextPostId);
  27758. if (contextPostId && contextPostType && hasAlreadyRendered) {
  27759. return (0,external_wp_element_namespaceObject.createElement)(RecursionError, null);
  27760. }
  27761. return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, contextPostId && contextPostType ? (0,external_wp_element_namespaceObject.createElement)(Content, {
  27762. context: context,
  27763. layout: layout
  27764. }) : (0,external_wp_element_namespaceObject.createElement)(edit_Placeholder, null));
  27765. }
  27766. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
  27767. /**
  27768. * WordPress dependencies
  27769. */
  27770. /**
  27771. * Internal dependencies
  27772. */
  27773. const post_content_metadata = {
  27774. $schema: "https://schemas.wp.org/trunk/block.json",
  27775. apiVersion: 2,
  27776. name: "core/post-content",
  27777. title: "Post Content",
  27778. category: "theme",
  27779. description: "Displays the contents of a post or page.",
  27780. textdomain: "default",
  27781. usesContext: ["postId", "postType", "queryId"],
  27782. supports: {
  27783. align: ["wide", "full"],
  27784. html: false,
  27785. __experimentalLayout: true
  27786. },
  27787. editorStyle: "wp-block-post-content-editor"
  27788. };
  27789. const {
  27790. name: post_content_name
  27791. } = post_content_metadata;
  27792. const post_content_settings = {
  27793. icon: post_content,
  27794. edit: PostContentEdit
  27795. };
  27796. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
  27797. /**
  27798. * External dependencies
  27799. */
  27800. /**
  27801. * WordPress dependencies
  27802. */
  27803. function PostDateEdit(_ref) {
  27804. let {
  27805. attributes: {
  27806. textAlign,
  27807. format,
  27808. isLink
  27809. },
  27810. context: {
  27811. postId,
  27812. postType: postTypeSlug,
  27813. queryId
  27814. },
  27815. setAttributes
  27816. } = _ref;
  27817. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  27818. className: classnames_default()({
  27819. [`has-text-align-${textAlign}`]: textAlign
  27820. })
  27821. });
  27822. const timeRef = (0,external_wp_element_namespaceObject.useRef)();
  27823. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  27824. const dateSettings = (0,external_wp_date_namespaceObject.__experimentalGetSettings)();
  27825. const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  27826. const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
  27827. const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'date', postId);
  27828. const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
  27829. let postDate = date ? (0,external_wp_element_namespaceObject.createElement)("time", {
  27830. dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date),
  27831. ref: timeRef
  27832. }, (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_wp_i18n_namespaceObject.__)('Post Date');
  27833. if (isLink && date) {
  27834. postDate = (0,external_wp_element_namespaceObject.createElement)("a", {
  27835. href: "#post-date-pseudo-link",
  27836. onClick: event => event.preventDefault()
  27837. }, postDate);
  27838. }
  27839. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  27840. group: "block"
  27841. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  27842. value: textAlign,
  27843. onChange: nextAlign => {
  27844. setAttributes({
  27845. textAlign: nextAlign
  27846. });
  27847. }
  27848. }), date && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  27849. popoverProps: {
  27850. anchorRef: timeRef.current
  27851. },
  27852. renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DateTimePicker, {
  27853. currentDate: date,
  27854. onChange: setDate,
  27855. is12Hour: is12HourFormat(siteTimeFormat)
  27856. }),
  27857. renderToggle: _ref2 => {
  27858. let {
  27859. isOpen,
  27860. onToggle
  27861. } = _ref2;
  27862. const openOnArrowDown = event => {
  27863. if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
  27864. event.preventDefault();
  27865. onToggle();
  27866. }
  27867. };
  27868. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  27869. "aria-expanded": isOpen,
  27870. icon: library_edit,
  27871. title: (0,external_wp_i18n_namespaceObject.__)('Change Date'),
  27872. onClick: onToggle,
  27873. onKeyDown: openOnArrowDown
  27874. });
  27875. }
  27876. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  27877. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  27878. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
  27879. format: format,
  27880. defaultFormat: siteFormat,
  27881. onChange: nextFormat => setAttributes({
  27882. format: nextFormat
  27883. })
  27884. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  27885. label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
  27886. (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
  27887. onChange: () => setAttributes({
  27888. isLink: !isLink
  27889. }),
  27890. checked: isLink
  27891. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, postDate));
  27892. }
  27893. function is12HourFormat(format) {
  27894. // To know if the time format is a 12 hour time, look for any of the 12 hour
  27895. // format characters: 'a', 'A', 'g', and 'h'. The character must be
  27896. // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I
  27897. // feel when working with regular expressions.
  27898. // https://www.php.net/manual/en/datetime.format.php
  27899. return /(?:^|[^\\])[aAgh]/.test(format);
  27900. }
  27901. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
  27902. /**
  27903. * Internal dependencies
  27904. */
  27905. const post_date_deprecated_v1 = {
  27906. attributes: {
  27907. textAlign: {
  27908. type: 'string'
  27909. },
  27910. format: {
  27911. type: 'string'
  27912. },
  27913. isLink: {
  27914. type: 'boolean',
  27915. default: false
  27916. }
  27917. },
  27918. supports: {
  27919. html: false,
  27920. color: {
  27921. gradients: true,
  27922. link: true
  27923. },
  27924. typography: {
  27925. fontSize: true,
  27926. lineHeight: true,
  27927. __experimentalFontFamily: true,
  27928. __experimentalFontWeight: true,
  27929. __experimentalFontStyle: true,
  27930. __experimentalTextTransform: true,
  27931. __experimentalLetterSpacing: true
  27932. }
  27933. },
  27934. save() {
  27935. return null;
  27936. },
  27937. migrate: migrate_font_family,
  27938. isEligible(_ref) {
  27939. var _style$typography;
  27940. let {
  27941. style
  27942. } = _ref;
  27943. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  27944. }
  27945. };
  27946. /**
  27947. * New deprecations need to be placed first
  27948. * for them to have higher priority.
  27949. *
  27950. * Old deprecations may need to be updated as well.
  27951. *
  27952. * See block-deprecation.md
  27953. */
  27954. /* harmony default export */ var post_date_deprecated = ([post_date_deprecated_v1]);
  27955. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
  27956. /**
  27957. * WordPress dependencies
  27958. */
  27959. /**
  27960. * Internal dependencies
  27961. */
  27962. const post_date_metadata = {
  27963. $schema: "https://schemas.wp.org/trunk/block.json",
  27964. apiVersion: 2,
  27965. name: "core/post-date",
  27966. title: "Post Date",
  27967. category: "theme",
  27968. description: "Add the date of this post.",
  27969. textdomain: "default",
  27970. attributes: {
  27971. textAlign: {
  27972. type: "string"
  27973. },
  27974. format: {
  27975. type: "string"
  27976. },
  27977. isLink: {
  27978. type: "boolean",
  27979. "default": false
  27980. }
  27981. },
  27982. usesContext: ["postId", "postType", "queryId"],
  27983. supports: {
  27984. html: false,
  27985. color: {
  27986. gradients: true,
  27987. link: true,
  27988. __experimentalDefaultControls: {
  27989. background: true,
  27990. text: true,
  27991. link: true
  27992. }
  27993. },
  27994. typography: {
  27995. fontSize: true,
  27996. lineHeight: true,
  27997. __experimentalFontFamily: true,
  27998. __experimentalFontWeight: true,
  27999. __experimentalFontStyle: true,
  28000. __experimentalTextTransform: true,
  28001. __experimentalLetterSpacing: true,
  28002. __experimentalDefaultControls: {
  28003. fontSize: true
  28004. }
  28005. }
  28006. }
  28007. };
  28008. const {
  28009. name: post_date_name
  28010. } = post_date_metadata;
  28011. const post_date_settings = {
  28012. icon: post_date,
  28013. edit: PostDateEdit,
  28014. deprecated: post_date_deprecated
  28015. };
  28016. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
  28017. /**
  28018. * WordPress dependencies
  28019. */
  28020. const postExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28021. xmlns: "http://www.w3.org/2000/svg",
  28022. viewBox: "0 0 24 24"
  28023. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28024. d: "M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"
  28025. }));
  28026. /* harmony default export */ var post_excerpt = (postExcerpt);
  28027. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
  28028. /**
  28029. * External dependencies
  28030. */
  28031. /**
  28032. * WordPress dependencies
  28033. */
  28034. /**
  28035. * Internal dependencies
  28036. */
  28037. function PostExcerptEditor(_ref) {
  28038. let {
  28039. attributes: {
  28040. textAlign,
  28041. moreText,
  28042. showMoreOnNewLine
  28043. },
  28044. setAttributes,
  28045. isSelected,
  28046. context: {
  28047. postId,
  28048. postType,
  28049. queryId
  28050. }
  28051. } = _ref;
  28052. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  28053. const userCanEdit = useCanEditEntity('postType', postType, postId);
  28054. const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  28055. const [rawExcerpt, setExcerpt, {
  28056. rendered: renderedExcerpt,
  28057. protected: isProtected
  28058. } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
  28059. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28060. className: classnames_default()({
  28061. [`has-text-align-${textAlign}`]: textAlign
  28062. })
  28063. });
  28064. /**
  28065. * When excerpt is editable, strip the html tags from
  28066. * rendered excerpt. This will be used if the entity's
  28067. * excerpt has been produced from the content.
  28068. */
  28069. const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => {
  28070. if (!renderedExcerpt) return '';
  28071. const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html');
  28072. return document.body.textContent || document.body.innerText || '';
  28073. }, [renderedExcerpt]);
  28074. if (!postType || !postId) {
  28075. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('This is the Post Excerpt block, it will display the excerpt from single posts.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types with support for excerpts, the Post Excerpt block can display the excerpts of those entries as well.')));
  28076. }
  28077. if (isProtected && !userCanEdit) {
  28078. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('There is no excerpt because this is a protected post.')));
  28079. }
  28080. const readMoreLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28081. className: "wp-block-post-excerpt__more-link",
  28082. tagName: "a",
  28083. "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
  28084. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'),
  28085. value: moreText,
  28086. onChange: newMoreText => setAttributes({
  28087. moreText: newMoreText
  28088. }),
  28089. withoutInteractiveFormatting: true
  28090. });
  28091. const excerptClassName = classnames_default()('wp-block-post-excerpt__excerpt', {
  28092. 'is-inline': !showMoreOnNewLine
  28093. });
  28094. const excerptContent = isEditable ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28095. className: excerptClassName,
  28096. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post excerpt text'),
  28097. value: rawExcerpt || strippedRenderedExcerpt || (isSelected ? '' : (0,external_wp_i18n_namespaceObject.__)('No post excerpt found')),
  28098. onChange: setExcerpt,
  28099. tagName: "p"
  28100. }) : (0,external_wp_element_namespaceObject.createElement)("p", {
  28101. className: excerptClassName
  28102. }, strippedRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No post excerpt found'));
  28103. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  28104. value: textAlign,
  28105. onChange: newAlign => setAttributes({
  28106. textAlign: newAlign
  28107. })
  28108. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  28109. title: (0,external_wp_i18n_namespaceObject.__)('Post Excerpt Settings')
  28110. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28111. label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
  28112. checked: showMoreOnNewLine,
  28113. onChange: newShowMoreOnNewLine => setAttributes({
  28114. showMoreOnNewLine: newShowMoreOnNewLine
  28115. })
  28116. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_wp_element_namespaceObject.createElement)("p", {
  28117. className: "wp-block-post-excerpt__more-text"
  28118. }, readMoreLink) : readMoreLink));
  28119. }
  28120. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js
  28121. /**
  28122. * WordPress dependencies
  28123. */
  28124. const post_excerpt_transforms_transforms = {
  28125. from: [{
  28126. type: 'block',
  28127. blocks: ['core/post-content'],
  28128. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt')
  28129. }],
  28130. to: [{
  28131. type: 'block',
  28132. blocks: ['core/post-content'],
  28133. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content')
  28134. }]
  28135. };
  28136. /* harmony default export */ var post_excerpt_transforms = (post_excerpt_transforms_transforms);
  28137. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
  28138. /**
  28139. * WordPress dependencies
  28140. */
  28141. /**
  28142. * Internal dependencies
  28143. */
  28144. const post_excerpt_metadata = {
  28145. $schema: "https://schemas.wp.org/trunk/block.json",
  28146. apiVersion: 2,
  28147. name: "core/post-excerpt",
  28148. title: "Post Excerpt",
  28149. category: "theme",
  28150. description: "Display a post's excerpt.",
  28151. textdomain: "default",
  28152. attributes: {
  28153. textAlign: {
  28154. type: "string"
  28155. },
  28156. moreText: {
  28157. type: "string"
  28158. },
  28159. showMoreOnNewLine: {
  28160. type: "boolean",
  28161. "default": true
  28162. }
  28163. },
  28164. usesContext: ["postId", "postType", "queryId"],
  28165. supports: {
  28166. html: false,
  28167. color: {
  28168. gradients: true,
  28169. link: true,
  28170. __experimentalDefaultControls: {
  28171. background: true,
  28172. text: true,
  28173. link: true
  28174. }
  28175. },
  28176. spacing: {
  28177. margin: true,
  28178. padding: true
  28179. },
  28180. typography: {
  28181. fontSize: true,
  28182. lineHeight: true,
  28183. __experimentalFontStyle: true,
  28184. __experimentalFontWeight: true,
  28185. __experimentalLetterSpacing: true,
  28186. __experimentalTextTransform: true,
  28187. __experimentalDefaultControls: {
  28188. fontSize: true
  28189. }
  28190. }
  28191. },
  28192. editorStyle: "wp-block-post-excerpt-editor",
  28193. style: "wp-block-post-excerpt"
  28194. };
  28195. const {
  28196. name: post_excerpt_name
  28197. } = post_excerpt_metadata;
  28198. const post_excerpt_settings = {
  28199. icon: post_excerpt,
  28200. transforms: post_excerpt_transforms,
  28201. edit: PostExcerptEditor
  28202. };
  28203. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
  28204. /**
  28205. * WordPress dependencies
  28206. */
  28207. const SCALE_OPTIONS = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  28208. value: "cover",
  28209. label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
  28210. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  28211. value: "contain",
  28212. label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
  28213. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  28214. value: "fill",
  28215. label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
  28216. }));
  28217. const DEFAULT_SCALE = 'cover';
  28218. const DEFAULT_SIZE = 'full';
  28219. const scaleHelp = {
  28220. cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'),
  28221. contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'),
  28222. fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.')
  28223. };
  28224. const DimensionControls = _ref => {
  28225. let {
  28226. clientId,
  28227. attributes: {
  28228. width,
  28229. height,
  28230. scale,
  28231. sizeSlug
  28232. },
  28233. setAttributes,
  28234. imageSizeOptions = []
  28235. } = _ref;
  28236. const defaultUnits = ['px', '%', 'vw', 'em', 'rem'];
  28237. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  28238. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || defaultUnits
  28239. });
  28240. const onDimensionChange = (dimension, nextValue) => {
  28241. const parsedValue = parseFloat(nextValue);
  28242. /**
  28243. * If we have no value set and we change the unit,
  28244. * we don't want to set the attribute, as it would
  28245. * end up having the unit as value without any number.
  28246. */
  28247. if (isNaN(parsedValue) && nextValue) return;
  28248. setAttributes({
  28249. [dimension]: parsedValue < 0 ? '0' : nextValue
  28250. });
  28251. };
  28252. const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options');
  28253. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  28254. __experimentalGroup: "dimensions"
  28255. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28256. className: "single-column",
  28257. hasValue: () => !!height,
  28258. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  28259. onDeselect: () => setAttributes({
  28260. height: undefined
  28261. }),
  28262. resetAllFilter: () => ({
  28263. height: undefined
  28264. }),
  28265. isShownByDefault: true,
  28266. panelId: clientId
  28267. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  28268. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  28269. labelPosition: "top",
  28270. value: height || '',
  28271. min: 0,
  28272. onChange: nextHeight => onDimensionChange('height', nextHeight),
  28273. units: units
  28274. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28275. className: "single-column",
  28276. hasValue: () => !!width,
  28277. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  28278. onDeselect: () => setAttributes({
  28279. width: undefined
  28280. }),
  28281. resetAllFilter: () => ({
  28282. width: undefined
  28283. }),
  28284. isShownByDefault: true,
  28285. panelId: clientId
  28286. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  28287. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  28288. labelPosition: "top",
  28289. value: width || '',
  28290. min: 0,
  28291. onChange: nextWidth => onDimensionChange('width', nextWidth),
  28292. units: units
  28293. })), !!height && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28294. hasValue: () => !!scale && scale !== DEFAULT_SCALE,
  28295. label: scaleLabel,
  28296. onDeselect: () => setAttributes({
  28297. scale: DEFAULT_SCALE
  28298. }),
  28299. resetAllFilter: () => ({
  28300. scale: DEFAULT_SCALE
  28301. }),
  28302. isShownByDefault: true,
  28303. panelId: clientId
  28304. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  28305. label: scaleLabel,
  28306. value: scale,
  28307. help: scaleHelp[scale],
  28308. onChange: value => setAttributes({
  28309. scale: value
  28310. }),
  28311. isBlock: true
  28312. }, SCALE_OPTIONS)), !!imageSizeOptions.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
  28313. hasValue: () => !!sizeSlug,
  28314. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  28315. onDeselect: () => setAttributes({
  28316. sizeSlug: undefined
  28317. }),
  28318. resetAllFilter: () => ({
  28319. sizeSlug: undefined
  28320. }),
  28321. isShownByDefault: false,
  28322. panelId: clientId
  28323. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  28324. label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
  28325. value: sizeSlug || DEFAULT_SIZE,
  28326. options: imageSizeOptions,
  28327. onChange: nextSizeSlug => setAttributes({
  28328. sizeSlug: nextSizeSlug
  28329. }),
  28330. help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.')
  28331. })));
  28332. };
  28333. /* harmony default export */ var dimension_controls = (DimensionControls);
  28334. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
  28335. /**
  28336. * WordPress dependencies
  28337. */
  28338. /**
  28339. * Internal dependencies
  28340. */
  28341. const placeholderIllustration = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28342. className: "components-placeholder__illustration",
  28343. fill: "none",
  28344. xmlns: "http://www.w3.org/2000/svg",
  28345. viewBox: "0 0 60 60",
  28346. preserveAspectRatio: "none"
  28347. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28348. vectorEffect: "non-scaling-stroke",
  28349. d: "M60 60 0 0"
  28350. }));
  28351. const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];
  28352. const placeholderChip = (0,external_wp_element_namespaceObject.createElement)("div", {
  28353. className: "wp-block-post-featured-image__placeholder"
  28354. }, placeholderIllustration);
  28355. function getMediaSourceUrlBySizeSlug(media, slug) {
  28356. var _media$media_details, _media$media_details$, _media$media_details$2;
  28357. return (media === null || media === void 0 ? void 0 : (_media$media_details = media.media_details) === null || _media$media_details === void 0 ? void 0 : (_media$media_details$ = _media$media_details.sizes) === null || _media$media_details$ === void 0 ? void 0 : (_media$media_details$2 = _media$media_details$[slug]) === null || _media$media_details$2 === void 0 ? void 0 : _media$media_details$2.source_url) || (media === null || media === void 0 ? void 0 : media.source_url);
  28358. }
  28359. function PostFeaturedImageDisplay(_ref) {
  28360. let {
  28361. clientId,
  28362. attributes,
  28363. setAttributes,
  28364. context: {
  28365. postId,
  28366. postType: postTypeSlug,
  28367. queryId
  28368. }
  28369. } = _ref;
  28370. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  28371. const {
  28372. isLink,
  28373. height,
  28374. width,
  28375. scale,
  28376. sizeSlug
  28377. } = attributes;
  28378. const [featuredImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
  28379. const {
  28380. media,
  28381. postType
  28382. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28383. const {
  28384. getMedia,
  28385. getPostType
  28386. } = select(external_wp_coreData_namespaceObject.store);
  28387. return {
  28388. media: featuredImage && getMedia(featuredImage, {
  28389. context: 'view'
  28390. }),
  28391. postType: postTypeSlug && getPostType(postTypeSlug)
  28392. };
  28393. }, [featuredImage, postTypeSlug]);
  28394. const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
  28395. const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().imageSizes, []);
  28396. const imageSizeOptions = imageSizes.filter(_ref2 => {
  28397. var _media$media_details2, _media$media_details3, _media$media_details4;
  28398. let {
  28399. slug
  28400. } = _ref2;
  28401. return media === null || media === void 0 ? void 0 : (_media$media_details2 = media.media_details) === null || _media$media_details2 === void 0 ? void 0 : (_media$media_details3 = _media$media_details2.sizes) === null || _media$media_details3 === void 0 ? void 0 : (_media$media_details4 = _media$media_details3[slug]) === null || _media$media_details4 === void 0 ? void 0 : _media$media_details4.source_url;
  28402. }).map(_ref3 => {
  28403. let {
  28404. name,
  28405. slug
  28406. } = _ref3;
  28407. return {
  28408. value: slug,
  28409. label: name
  28410. };
  28411. });
  28412. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28413. style: {
  28414. width,
  28415. height
  28416. }
  28417. });
  28418. const placeholder = content => {
  28419. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  28420. className: "block-editor-media-placeholder"
  28421. }, placeholderIllustration, content);
  28422. };
  28423. const onSelectImage = value => {
  28424. if (value !== null && value !== void 0 && value.id) {
  28425. setFeaturedImage(value.id);
  28426. }
  28427. };
  28428. const {
  28429. createErrorNotice
  28430. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  28431. const onUploadError = message => {
  28432. createErrorNotice(message[2], {
  28433. type: 'snackbar'
  28434. });
  28435. };
  28436. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(dimension_controls, {
  28437. clientId: clientId,
  28438. attributes: attributes,
  28439. setAttributes: setAttributes,
  28440. imageSizeOptions: imageSizeOptions
  28441. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  28442. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  28443. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28444. label: postType !== null && postType !== void 0 && postType.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
  28445. (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'),
  28446. onChange: () => setAttributes({
  28447. isLink: !isLink
  28448. }),
  28449. checked: isLink
  28450. }))));
  28451. let image;
  28452. if (!featuredImage && isDescendentOfQueryLoop) {
  28453. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip));
  28454. }
  28455. const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
  28456. if (!featuredImage) {
  28457. image = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  28458. onSelect: onSelectImage,
  28459. accept: "image/*",
  28460. allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
  28461. onError: onUploadError,
  28462. placeholder: placeholder,
  28463. mediaLibraryButton: _ref4 => {
  28464. let {
  28465. open
  28466. } = _ref4;
  28467. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  28468. icon: library_upload,
  28469. variant: "primary",
  28470. label: label,
  28471. showTooltip: true,
  28472. tooltipPosition: "top center",
  28473. onClick: () => {
  28474. open();
  28475. }
  28476. });
  28477. }
  28478. });
  28479. } else {
  28480. // We have a Featured image so show a Placeholder if is loading.
  28481. image = !media ? placeholderChip : (0,external_wp_element_namespaceObject.createElement)("img", {
  28482. src: mediaUrl,
  28483. alt: media.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The image's alt text.
  28484. (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
  28485. style: {
  28486. height,
  28487. objectFit: height && scale
  28488. }
  28489. });
  28490. }
  28491. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controls, !!media && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  28492. group: "other"
  28493. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  28494. mediaId: featuredImage,
  28495. mediaURL: mediaUrl,
  28496. allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
  28497. accept: "image/*",
  28498. onSelect: onSelectImage,
  28499. onError: onUploadError
  28500. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  28501. onClick: () => setFeaturedImage(0)
  28502. }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, image));
  28503. }
  28504. function PostFeaturedImageEdit(props) {
  28505. var _props$context;
  28506. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  28507. if (!((_props$context = props.context) !== null && _props$context !== void 0 && _props$context.postId)) {
  28508. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip);
  28509. }
  28510. return (0,external_wp_element_namespaceObject.createElement)(PostFeaturedImageDisplay, props);
  28511. }
  28512. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
  28513. /**
  28514. * WordPress dependencies
  28515. */
  28516. /**
  28517. * Internal dependencies
  28518. */
  28519. const post_featured_image_metadata = {
  28520. $schema: "https://schemas.wp.org/trunk/block.json",
  28521. apiVersion: 2,
  28522. name: "core/post-featured-image",
  28523. title: "Post Featured Image",
  28524. category: "theme",
  28525. description: "Display a post's featured image.",
  28526. textdomain: "default",
  28527. attributes: {
  28528. isLink: {
  28529. type: "boolean",
  28530. "default": false
  28531. },
  28532. width: {
  28533. type: "string"
  28534. },
  28535. height: {
  28536. type: "string"
  28537. },
  28538. scale: {
  28539. type: "string",
  28540. "default": "cover"
  28541. },
  28542. sizeSlug: {
  28543. type: "string"
  28544. }
  28545. },
  28546. usesContext: ["postId", "postType", "queryId"],
  28547. supports: {
  28548. align: ["left", "right", "center", "wide", "full"],
  28549. color: {
  28550. __experimentalDuotone: "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
  28551. text: false,
  28552. background: false
  28553. },
  28554. html: false,
  28555. spacing: {
  28556. margin: true,
  28557. padding: true
  28558. }
  28559. },
  28560. editorStyle: "wp-block-post-featured-image-editor",
  28561. style: "wp-block-post-featured-image"
  28562. };
  28563. const {
  28564. name: post_featured_image_name
  28565. } = post_featured_image_metadata;
  28566. const post_featured_image_settings = {
  28567. icon: post_featured_image,
  28568. edit: PostFeaturedImageEdit
  28569. };
  28570. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
  28571. /**
  28572. * External dependencies
  28573. */
  28574. /**
  28575. * WordPress dependencies
  28576. */
  28577. function PostNavigationLinkEdit(_ref) {
  28578. let {
  28579. attributes: {
  28580. type,
  28581. label,
  28582. showTitle,
  28583. textAlign,
  28584. linkLabel
  28585. },
  28586. setAttributes
  28587. } = _ref;
  28588. const isNext = type === 'next';
  28589. let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous');
  28590. if (showTitle) {
  28591. /* translators: Label before for next and previous post. There is a space after the colon. */
  28592. placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next: ') : (0,external_wp_i18n_namespaceObject.__)('Previous: ');
  28593. }
  28594. const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post');
  28595. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28596. className: classnames_default()({
  28597. [`has-text-align-${textAlign}`]: textAlign
  28598. })
  28599. });
  28600. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28601. label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'),
  28602. help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'),
  28603. checked: !!showTitle,
  28604. onChange: () => setAttributes({
  28605. showTitle: !showTitle
  28606. })
  28607. }), showTitle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  28608. label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'),
  28609. checked: !!linkLabel,
  28610. onChange: () => setAttributes({
  28611. linkLabel: !linkLabel
  28612. })
  28613. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  28614. value: textAlign,
  28615. onChange: nextAlign => {
  28616. setAttributes({
  28617. textAlign: nextAlign
  28618. });
  28619. }
  28620. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  28621. tagName: "a",
  28622. "aria-label": ariaLabel,
  28623. placeholder: placeholder,
  28624. value: label,
  28625. allowedFormats: ['core/bold', 'core/italic'],
  28626. onChange: newLabel => setAttributes({
  28627. label: newLabel
  28628. })
  28629. }), showTitle && (0,external_wp_element_namespaceObject.createElement)("a", {
  28630. href: "#post-navigation-pseudo-link",
  28631. onClick: event => event.preventDefault()
  28632. }, (0,external_wp_i18n_namespaceObject.__)('An example title'))));
  28633. }
  28634. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js
  28635. /**
  28636. * WordPress dependencies
  28637. */
  28638. const next = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28639. xmlns: "http://www.w3.org/2000/svg",
  28640. viewBox: "0 0 24 24"
  28641. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28642. d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
  28643. }));
  28644. /* harmony default export */ var library_next = (next);
  28645. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js
  28646. /**
  28647. * WordPress dependencies
  28648. */
  28649. const previous = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  28650. xmlns: "http://www.w3.org/2000/svg",
  28651. viewBox: "0 0 24 24"
  28652. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  28653. d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
  28654. }));
  28655. /* harmony default export */ var library_previous = (previous);
  28656. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
  28657. /**
  28658. * WordPress dependencies
  28659. */
  28660. const post_navigation_link_variations_variations = [{
  28661. isDefault: true,
  28662. name: 'post-next',
  28663. title: (0,external_wp_i18n_namespaceObject.__)('Next post'),
  28664. description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'),
  28665. icon: library_next,
  28666. attributes: {
  28667. type: 'next'
  28668. },
  28669. scope: ['inserter', 'transform']
  28670. }, {
  28671. name: 'post-previous',
  28672. title: (0,external_wp_i18n_namespaceObject.__)('Previous post'),
  28673. description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'),
  28674. icon: library_previous,
  28675. attributes: {
  28676. type: 'previous'
  28677. },
  28678. scope: ['inserter', 'transform']
  28679. }];
  28680. /**
  28681. * Add `isActive` function to all `post-navigation-link` variations, if not defined.
  28682. * `isActive` function is used to find a variation match from a created
  28683. * Block by providing its attributes.
  28684. */
  28685. post_navigation_link_variations_variations.forEach(variation => {
  28686. if (variation.isActive) return;
  28687. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  28688. });
  28689. /* harmony default export */ var post_navigation_link_variations = (post_navigation_link_variations_variations);
  28690. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
  28691. /**
  28692. * Internal dependencies
  28693. */
  28694. const post_navigation_link_metadata = {
  28695. $schema: "https://schemas.wp.org/trunk/block.json",
  28696. apiVersion: 2,
  28697. name: "core/post-navigation-link",
  28698. title: "Post Navigation Link",
  28699. category: "theme",
  28700. description: "Displays the next or previous post link that is adjacent to the current post.",
  28701. textdomain: "default",
  28702. attributes: {
  28703. textAlign: {
  28704. type: "string"
  28705. },
  28706. type: {
  28707. type: "string",
  28708. "default": "next"
  28709. },
  28710. label: {
  28711. type: "string"
  28712. },
  28713. showTitle: {
  28714. type: "boolean",
  28715. "default": false
  28716. },
  28717. linkLabel: {
  28718. type: "boolean",
  28719. "default": false
  28720. }
  28721. },
  28722. supports: {
  28723. reusable: false,
  28724. html: false,
  28725. typography: {
  28726. fontSize: true,
  28727. lineHeight: true,
  28728. __experimentalFontStyle: true,
  28729. __experimentalFontWeight: true,
  28730. __experimentalLetterSpacing: true,
  28731. __experimentalTextTransform: true,
  28732. __experimentalDefaultControls: {
  28733. fontSize: true
  28734. }
  28735. }
  28736. }
  28737. };
  28738. const {
  28739. name: post_navigation_link_name
  28740. } = post_navigation_link_metadata;
  28741. const post_navigation_link_settings = {
  28742. edit: PostNavigationLinkEdit,
  28743. variations: post_navigation_link_variations
  28744. };
  28745. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.js
  28746. /**
  28747. * External dependencies
  28748. */
  28749. /**
  28750. * WordPress dependencies
  28751. */
  28752. const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];
  28753. function PostTemplateInnerBlocks() {
  28754. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
  28755. className: 'wp-block-post'
  28756. }, {
  28757. template: post_template_edit_TEMPLATE
  28758. });
  28759. return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps);
  28760. }
  28761. function PostTemplateBlockPreview(_ref) {
  28762. let {
  28763. blocks,
  28764. blockContextId,
  28765. isHidden,
  28766. setActiveBlockContextId
  28767. } = _ref;
  28768. const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
  28769. blocks,
  28770. props: {
  28771. className: 'wp-block-post'
  28772. }
  28773. });
  28774. const handleOnClick = () => {
  28775. setActiveBlockContextId(blockContextId);
  28776. };
  28777. const style = {
  28778. display: isHidden ? 'none' : undefined
  28779. };
  28780. return (0,external_wp_element_namespaceObject.createElement)("li", _extends({}, blockPreviewProps, {
  28781. tabIndex: 0 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
  28782. ,
  28783. role: "button",
  28784. onClick: handleOnClick,
  28785. onKeyPress: handleOnClick,
  28786. style: style
  28787. }));
  28788. }
  28789. const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview);
  28790. function PostTemplateEdit(_ref2) {
  28791. let {
  28792. clientId,
  28793. context: {
  28794. query: {
  28795. perPage,
  28796. offset,
  28797. postType,
  28798. order,
  28799. orderBy,
  28800. author,
  28801. search,
  28802. exclude,
  28803. sticky,
  28804. inherit,
  28805. taxQuery
  28806. } = {},
  28807. queryContext = [{
  28808. page: 1
  28809. }],
  28810. templateSlug,
  28811. displayLayout: {
  28812. type: layoutType = 'flex',
  28813. columns = 1
  28814. } = {}
  28815. }
  28816. } = _ref2;
  28817. const [{
  28818. page
  28819. }] = queryContext;
  28820. const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)();
  28821. const {
  28822. posts,
  28823. blocks
  28824. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  28825. const {
  28826. getEntityRecords,
  28827. getTaxonomies
  28828. } = select(external_wp_coreData_namespaceObject.store);
  28829. const {
  28830. getBlocks
  28831. } = select(external_wp_blockEditor_namespaceObject.store);
  28832. const taxonomies = getTaxonomies({
  28833. type: postType,
  28834. per_page: -1,
  28835. context: 'view'
  28836. });
  28837. const query = {
  28838. offset: perPage ? perPage * (page - 1) + offset : 0,
  28839. order,
  28840. orderby: orderBy
  28841. };
  28842. if (taxQuery) {
  28843. // We have to build the tax query for the REST API and use as
  28844. // keys the taxonomies `rest_base` with the `term ids` as values.
  28845. const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, _ref3) => {
  28846. let [taxonomySlug, terms] = _ref3;
  28847. const taxonomy = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.find(_ref4 => {
  28848. let {
  28849. slug
  28850. } = _ref4;
  28851. return slug === taxonomySlug;
  28852. });
  28853. if (taxonomy !== null && taxonomy !== void 0 && taxonomy.rest_base) {
  28854. accumulator[taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.rest_base] = terms;
  28855. }
  28856. return accumulator;
  28857. }, {});
  28858. if (!!Object.keys(builtTaxQuery).length) {
  28859. Object.assign(query, builtTaxQuery);
  28860. }
  28861. }
  28862. if (perPage) {
  28863. query.per_page = perPage;
  28864. }
  28865. if (author) {
  28866. query.author = author;
  28867. }
  28868. if (search) {
  28869. query.search = search;
  28870. }
  28871. if (exclude !== null && exclude !== void 0 && exclude.length) {
  28872. query.exclude = exclude;
  28873. } // If sticky is not set, it will return all posts in the results.
  28874. // If sticky is set to `only`, it will limit the results to sticky posts only.
  28875. // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`.
  28876. if (sticky) {
  28877. query.sticky = sticky === 'only';
  28878. } // If `inherit` is truthy, adjust conditionally the query to create a better preview.
  28879. if (inherit) {
  28880. // Change the post-type if needed.
  28881. if (templateSlug !== null && templateSlug !== void 0 && templateSlug.startsWith('archive-')) {
  28882. query.postType = templateSlug.replace('archive-', '');
  28883. postType = query.postType;
  28884. }
  28885. }
  28886. return {
  28887. posts: getEntityRecords('postType', postType, query),
  28888. blocks: getBlocks(clientId)
  28889. };
  28890. }, [perPage, page, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery]);
  28891. const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts === null || posts === void 0 ? void 0 : posts.map(post => ({
  28892. postType: post.type,
  28893. postId: post.id
  28894. })), [posts]);
  28895. const hasLayoutFlex = layoutType === 'flex' && columns > 1;
  28896. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  28897. className: classnames_default()({
  28898. 'is-flex-container': hasLayoutFlex,
  28899. [`columns-${columns}`]: hasLayoutFlex
  28900. })
  28901. });
  28902. if (!posts) {
  28903. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
  28904. }
  28905. if (!posts.length) {
  28906. return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, " ", (0,external_wp_i18n_namespaceObject.__)('No results found.'));
  28907. } // To avoid flicker when switching active block contexts, a preview is rendered
  28908. // for each block context, but the preview for the active block context is hidden.
  28909. // This ensures that when it is displayed again, the cached rendering of the
  28910. // block preview is used, instead of having to re-render the preview from scratch.
  28911. return (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, blockContexts && blockContexts.map(blockContext => {
  28912. var _blockContexts$, _blockContexts$2;
  28913. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
  28914. key: blockContext.postId,
  28915. value: blockContext
  28916. }, blockContext.postId === (activeBlockContextId || ((_blockContexts$ = blockContexts[0]) === null || _blockContexts$ === void 0 ? void 0 : _blockContexts$.postId)) ? (0,external_wp_element_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, {
  28917. blocks: blocks,
  28918. blockContextId: blockContext.postId,
  28919. setActiveBlockContextId: setActiveBlockContextId,
  28920. isHidden: blockContext.postId === (activeBlockContextId || ((_blockContexts$2 = blockContexts[0]) === null || _blockContexts$2 === void 0 ? void 0 : _blockContexts$2.postId))
  28921. }));
  28922. }));
  28923. }
  28924. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js
  28925. /**
  28926. * WordPress dependencies
  28927. */
  28928. function PostTemplateSave() {
  28929. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  28930. }
  28931. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
  28932. /**
  28933. * WordPress dependencies
  28934. */
  28935. /**
  28936. * Internal dependencies
  28937. */
  28938. const post_template_metadata = {
  28939. $schema: "https://schemas.wp.org/trunk/block.json",
  28940. apiVersion: 2,
  28941. name: "core/post-template",
  28942. title: "Post Template",
  28943. category: "theme",
  28944. parent: ["core/query"],
  28945. description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
  28946. textdomain: "default",
  28947. usesContext: ["queryId", "query", "queryContext", "displayLayout", "templateSlug"],
  28948. supports: {
  28949. reusable: false,
  28950. html: false,
  28951. align: true,
  28952. __experimentalLayout: {
  28953. allowEditing: false
  28954. }
  28955. },
  28956. style: "wp-block-post-template",
  28957. editorStyle: "wp-block-post-template-editor"
  28958. };
  28959. const {
  28960. name: post_template_name
  28961. } = post_template_metadata;
  28962. const post_template_settings = {
  28963. icon: library_layout,
  28964. edit: PostTemplateEdit,
  28965. save: PostTemplateSave
  28966. };
  28967. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
  28968. /**
  28969. * WordPress dependencies
  28970. */
  28971. function usePostTerms(_ref) {
  28972. var _term$visibility2;
  28973. let {
  28974. postId,
  28975. postType,
  28976. term
  28977. } = _ref;
  28978. const {
  28979. rest_base: restBase,
  28980. slug
  28981. } = term;
  28982. const [termIds] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, restBase, postId);
  28983. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  28984. var _term$visibility;
  28985. const visible = term === null || term === void 0 ? void 0 : (_term$visibility = term.visibility) === null || _term$visibility === void 0 ? void 0 : _term$visibility.publicly_queryable;
  28986. if (!visible) {
  28987. return {
  28988. postTerms: [],
  28989. _isLoading: false,
  28990. hasPostTerms: false
  28991. };
  28992. }
  28993. if (!termIds) {
  28994. var _term$postTerms;
  28995. // Waiting for post terms to be fetched.
  28996. return {
  28997. isLoading: term === null || term === void 0 ? void 0 : (_term$postTerms = term.postTerms) === null || _term$postTerms === void 0 ? void 0 : _term$postTerms.includes(postType)
  28998. };
  28999. }
  29000. if (!termIds.length) {
  29001. return {
  29002. isLoading: false
  29003. };
  29004. }
  29005. const {
  29006. getEntityRecords,
  29007. isResolving
  29008. } = select(external_wp_coreData_namespaceObject.store);
  29009. const taxonomyArgs = ['taxonomy', slug, {
  29010. include: termIds,
  29011. context: 'view'
  29012. }];
  29013. const terms = getEntityRecords(...taxonomyArgs);
  29014. const _isLoading = isResolving('getEntityRecords', taxonomyArgs);
  29015. return {
  29016. postTerms: terms,
  29017. isLoading: _isLoading,
  29018. hasPostTerms: !!(terms !== null && terms !== void 0 && terms.length)
  29019. };
  29020. }, [termIds, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable]);
  29021. }
  29022. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
  29023. /**
  29024. * External dependencies
  29025. */
  29026. /**
  29027. * WordPress dependencies
  29028. */
  29029. /**
  29030. * Internal dependencies
  29031. */
  29032. function PostTermsEdit(_ref) {
  29033. var _selectedTerm$labels;
  29034. let {
  29035. attributes,
  29036. clientId,
  29037. context,
  29038. setAttributes
  29039. } = _ref;
  29040. const {
  29041. term,
  29042. textAlign,
  29043. separator
  29044. } = attributes;
  29045. const {
  29046. postId,
  29047. postType
  29048. } = context;
  29049. const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => {
  29050. var _taxonomy$visibility;
  29051. if (!term) return {};
  29052. const {
  29053. getTaxonomy
  29054. } = select(external_wp_coreData_namespaceObject.store);
  29055. const taxonomy = getTaxonomy(term);
  29056. return taxonomy !== null && taxonomy !== void 0 && (_taxonomy$visibility = taxonomy.visibility) !== null && _taxonomy$visibility !== void 0 && _taxonomy$visibility.publicly_queryable ? taxonomy : {};
  29057. }, [term]);
  29058. const {
  29059. postTerms,
  29060. hasPostTerms,
  29061. isLoading
  29062. } = usePostTerms({
  29063. postId,
  29064. postType,
  29065. term: selectedTerm
  29066. });
  29067. const hasPost = postId && postType;
  29068. const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId);
  29069. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29070. className: classnames_default()({
  29071. [`has-text-align-${textAlign}`]: textAlign,
  29072. [`taxonomy-${term}`]: term
  29073. })
  29074. });
  29075. if (!hasPost || !term) {
  29076. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, blockInformation.title);
  29077. }
  29078. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  29079. value: textAlign,
  29080. onChange: nextAlign => {
  29081. setAttributes({
  29082. textAlign: nextAlign
  29083. });
  29084. }
  29085. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  29086. __experimentalGroup: "advanced"
  29087. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  29088. autoComplete: "off",
  29089. label: (0,external_wp_i18n_namespaceObject.__)('Separator'),
  29090. value: separator || '',
  29091. onChange: nextValue => {
  29092. setAttributes({
  29093. separator: nextValue
  29094. });
  29095. },
  29096. help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.')
  29097. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_wp_element_namespaceObject.createElement)("a", {
  29098. key: postTerm.id,
  29099. href: postTerm.link,
  29100. onClick: event => event.preventDefault()
  29101. }, (0,external_lodash_namespaceObject.unescape)(postTerm.name))).reduce((prev, curr) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, prev, (0,external_wp_element_namespaceObject.createElement)("span", {
  29102. className: "wp-block-post-terms__separator"
  29103. }, separator || ' '), curr)), !isLoading && !hasPostTerms && ((selectedTerm === null || selectedTerm === void 0 ? void 0 : (_selectedTerm$labels = selectedTerm.labels) === null || _selectedTerm$labels === void 0 ? void 0 : _selectedTerm$labels.no_terms) || (0,external_wp_i18n_namespaceObject.__)('Term items not found.'))));
  29104. }
  29105. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js
  29106. /**
  29107. * WordPress dependencies
  29108. */
  29109. const postCategories = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29110. viewBox: "0 0 24 24",
  29111. xmlns: "http://www.w3.org/2000/svg"
  29112. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29113. d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",
  29114. fillRule: "evenodd",
  29115. clipRule: "evenodd"
  29116. }));
  29117. /* harmony default export */ var post_categories = (postCategories);
  29118. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-terms.js
  29119. /**
  29120. * WordPress dependencies
  29121. */
  29122. const postTerms = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29123. viewBox: "0 0 24 24",
  29124. xmlns: "http://www.w3.org/2000/svg"
  29125. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29126. d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
  29127. }));
  29128. /* harmony default export */ var post_terms = (postTerms);
  29129. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/variations.js
  29130. /**
  29131. * WordPress dependencies
  29132. */
  29133. const post_terms_variations_variations = [{
  29134. name: 'category',
  29135. title: (0,external_wp_i18n_namespaceObject.__)('Post Categories'),
  29136. description: (0,external_wp_i18n_namespaceObject.__)("Display a post's categories."),
  29137. icon: post_categories,
  29138. isDefault: true,
  29139. attributes: {
  29140. term: 'category'
  29141. },
  29142. isActive: blockAttributes => blockAttributes.term === 'category'
  29143. }, {
  29144. name: 'post_tag',
  29145. title: (0,external_wp_i18n_namespaceObject.__)('Post Tags'),
  29146. description: (0,external_wp_i18n_namespaceObject.__)("Display a post's tags."),
  29147. icon: post_terms,
  29148. attributes: {
  29149. term: 'post_tag'
  29150. },
  29151. isActive: blockAttributes => blockAttributes.term === 'post_tag'
  29152. }];
  29153. /* harmony default export */ var post_terms_variations = (post_terms_variations_variations);
  29154. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
  29155. /**
  29156. * Internal dependencies
  29157. */
  29158. const post_terms_metadata = {
  29159. $schema: "https://schemas.wp.org/trunk/block.json",
  29160. apiVersion: 2,
  29161. name: "core/post-terms",
  29162. title: "Post Terms",
  29163. category: "theme",
  29164. description: "Post terms.",
  29165. textdomain: "default",
  29166. attributes: {
  29167. term: {
  29168. type: "string"
  29169. },
  29170. textAlign: {
  29171. type: "string"
  29172. },
  29173. separator: {
  29174. type: "string",
  29175. "default": ", "
  29176. }
  29177. },
  29178. usesContext: ["postId", "postType"],
  29179. supports: {
  29180. html: false,
  29181. color: {
  29182. gradients: true,
  29183. link: true,
  29184. __experimentalDefaultControls: {
  29185. background: true,
  29186. text: true,
  29187. link: true
  29188. }
  29189. },
  29190. typography: {
  29191. lineHeight: true,
  29192. fontSize: true,
  29193. __experimentalFontStyle: true,
  29194. __experimentalFontWeight: true,
  29195. __experimentalLetterSpacing: true,
  29196. __experimentalTextTransform: true,
  29197. __experimentalDefaultControls: {
  29198. fontSize: true
  29199. }
  29200. }
  29201. },
  29202. style: "wp-block-post-terms"
  29203. };
  29204. /**
  29205. * WordPress dependencies
  29206. */
  29207. const {
  29208. name: post_terms_name
  29209. } = post_terms_metadata;
  29210. const post_terms_settings = {
  29211. icon: post_terms,
  29212. variations: post_terms_variations,
  29213. edit: PostTermsEdit
  29214. };
  29215. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
  29216. /**
  29217. * External dependencies
  29218. */
  29219. /**
  29220. * WordPress dependencies
  29221. */
  29222. /**
  29223. * Internal dependencies
  29224. */
  29225. function PostTitleEdit(_ref) {
  29226. let {
  29227. attributes: {
  29228. level,
  29229. textAlign,
  29230. isLink,
  29231. rel,
  29232. linkTarget
  29233. },
  29234. setAttributes,
  29235. context: {
  29236. postType,
  29237. postId,
  29238. queryId
  29239. }
  29240. } = _ref;
  29241. const TagName = 0 === level ? 'p' : 'h' + level;
  29242. const isDescendentOfQueryLoop = Number.isFinite(queryId);
  29243. const userCanEdit = useCanEditEntity('postType', postType, postId);
  29244. const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  29245. const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);
  29246. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29247. className: classnames_default()({
  29248. [`has-text-align-${textAlign}`]: textAlign
  29249. })
  29250. });
  29251. let titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Title'));
  29252. if (postType && postId) {
  29253. titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, _extends({
  29254. tagName: TagName,
  29255. placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'),
  29256. value: rawTitle,
  29257. onChange: setTitle,
  29258. __experimentalVersion: 2
  29259. }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)(TagName, _extends({}, blockProps, {
  29260. dangerouslySetInnerHTML: {
  29261. __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
  29262. }
  29263. }));
  29264. }
  29265. if (isLink && postType && postId) {
  29266. titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  29267. tagName: "a",
  29268. href: link,
  29269. target: linkTarget,
  29270. rel: rel,
  29271. placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No Title') : null,
  29272. value: rawTitle,
  29273. onChange: setTitle,
  29274. __experimentalVersion: 2
  29275. })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
  29276. href: link,
  29277. target: linkTarget,
  29278. rel: rel,
  29279. onClick: event => event.preventDefault(),
  29280. dangerouslySetInnerHTML: {
  29281. __html: fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered
  29282. }
  29283. }));
  29284. }
  29285. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  29286. group: "block"
  29287. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  29288. selectedLevel: level,
  29289. onChange: newLevel => setAttributes({
  29290. level: newLevel
  29291. })
  29292. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  29293. value: textAlign,
  29294. onChange: nextAlign => {
  29295. setAttributes({
  29296. textAlign: nextAlign
  29297. });
  29298. }
  29299. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  29300. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  29301. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  29302. label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'),
  29303. onChange: () => setAttributes({
  29304. isLink: !isLink
  29305. }),
  29306. checked: isLink
  29307. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  29308. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  29309. onChange: value => setAttributes({
  29310. linkTarget: value ? '_blank' : '_self'
  29311. }),
  29312. checked: linkTarget === '_blank'
  29313. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  29314. label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
  29315. value: rel,
  29316. onChange: newRel => setAttributes({
  29317. rel: newRel
  29318. })
  29319. })))), titleElement);
  29320. }
  29321. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
  29322. /**
  29323. * Internal dependencies
  29324. */
  29325. const post_title_deprecated_v1 = {
  29326. attributes: {
  29327. textAlign: {
  29328. type: 'string'
  29329. },
  29330. level: {
  29331. type: 'number',
  29332. default: 2
  29333. },
  29334. isLink: {
  29335. type: 'boolean',
  29336. default: false
  29337. },
  29338. rel: {
  29339. type: 'string',
  29340. attribute: 'rel',
  29341. default: ''
  29342. },
  29343. linkTarget: {
  29344. type: 'string',
  29345. default: '_self'
  29346. }
  29347. },
  29348. supports: {
  29349. align: ['wide', 'full'],
  29350. html: false,
  29351. color: {
  29352. gradients: true,
  29353. link: true
  29354. },
  29355. spacing: {
  29356. margin: true
  29357. },
  29358. typography: {
  29359. fontSize: true,
  29360. lineHeight: true,
  29361. __experimentalFontFamily: true,
  29362. __experimentalFontWeight: true,
  29363. __experimentalFontStyle: true,
  29364. __experimentalTextTransform: true
  29365. }
  29366. },
  29367. save() {
  29368. return null;
  29369. },
  29370. migrate: migrate_font_family,
  29371. isEligible(_ref) {
  29372. var _style$typography;
  29373. let {
  29374. style
  29375. } = _ref;
  29376. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  29377. }
  29378. };
  29379. /**
  29380. * New deprecations need to be placed first
  29381. * for them to have higher priority.
  29382. *
  29383. * Old deprecations may need to be updated as well.
  29384. *
  29385. * See block-deprecation.md
  29386. */
  29387. /* harmony default export */ var post_title_deprecated = ([post_title_deprecated_v1]);
  29388. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
  29389. /**
  29390. * WordPress dependencies
  29391. */
  29392. /**
  29393. * Internal dependencies
  29394. */
  29395. const post_title_metadata = {
  29396. $schema: "https://schemas.wp.org/trunk/block.json",
  29397. apiVersion: 2,
  29398. name: "core/post-title",
  29399. title: "Post Title",
  29400. category: "theme",
  29401. description: "Displays the title of a post, page, or any other content-type.",
  29402. textdomain: "default",
  29403. usesContext: ["postId", "postType", "queryId"],
  29404. attributes: {
  29405. textAlign: {
  29406. type: "string"
  29407. },
  29408. level: {
  29409. type: "number",
  29410. "default": 2
  29411. },
  29412. isLink: {
  29413. type: "boolean",
  29414. "default": false
  29415. },
  29416. rel: {
  29417. type: "string",
  29418. attribute: "rel",
  29419. "default": ""
  29420. },
  29421. linkTarget: {
  29422. type: "string",
  29423. "default": "_self"
  29424. }
  29425. },
  29426. supports: {
  29427. align: ["wide", "full"],
  29428. html: false,
  29429. color: {
  29430. gradients: true,
  29431. link: true,
  29432. __experimentalDefaultControls: {
  29433. background: true,
  29434. text: true,
  29435. link: true
  29436. }
  29437. },
  29438. spacing: {
  29439. margin: true
  29440. },
  29441. typography: {
  29442. fontSize: true,
  29443. lineHeight: true,
  29444. __experimentalFontFamily: true,
  29445. __experimentalFontWeight: true,
  29446. __experimentalFontStyle: true,
  29447. __experimentalTextTransform: true,
  29448. __experimentalLetterSpacing: true,
  29449. __experimentalDefaultControls: {
  29450. fontSize: true,
  29451. fontAppearance: true,
  29452. textTransform: true
  29453. }
  29454. }
  29455. },
  29456. style: "wp-block-post-title"
  29457. };
  29458. const {
  29459. name: post_title_name
  29460. } = post_title_metadata;
  29461. const post_title_settings = {
  29462. icon: post_title,
  29463. edit: PostTitleEdit,
  29464. deprecated: post_title_deprecated
  29465. };
  29466. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js
  29467. /**
  29468. * WordPress dependencies
  29469. */
  29470. const preformatted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29471. viewBox: "0 0 24 24",
  29472. xmlns: "http://www.w3.org/2000/svg"
  29473. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29474. d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"
  29475. }));
  29476. /* harmony default export */ var library_preformatted = (preformatted);
  29477. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
  29478. /**
  29479. * WordPress dependencies
  29480. */
  29481. function PreformattedEdit(_ref) {
  29482. let {
  29483. attributes,
  29484. mergeBlocks,
  29485. setAttributes,
  29486. onRemove,
  29487. style
  29488. } = _ref;
  29489. const {
  29490. content
  29491. } = attributes;
  29492. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  29493. style
  29494. });
  29495. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  29496. tagName: "pre",
  29497. identifier: "content",
  29498. preserveWhiteSpace: true,
  29499. value: content,
  29500. onChange: nextContent => {
  29501. setAttributes({
  29502. content: nextContent
  29503. });
  29504. },
  29505. onRemove: onRemove,
  29506. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'),
  29507. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'),
  29508. onMerge: mergeBlocks
  29509. }, blockProps, {
  29510. __unstablePastePlainText: true
  29511. }));
  29512. }
  29513. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
  29514. /**
  29515. * WordPress dependencies
  29516. */
  29517. function preformatted_save_save(_ref) {
  29518. let {
  29519. attributes
  29520. } = _ref;
  29521. const {
  29522. content
  29523. } = attributes;
  29524. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29525. value: content
  29526. }));
  29527. }
  29528. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
  29529. /**
  29530. * WordPress dependencies
  29531. */
  29532. const preformatted_transforms_transforms = {
  29533. from: [{
  29534. type: 'block',
  29535. blocks: ['core/code', 'core/paragraph'],
  29536. transform: _ref => {
  29537. let {
  29538. content,
  29539. anchor
  29540. } = _ref;
  29541. return (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', {
  29542. content,
  29543. anchor
  29544. });
  29545. }
  29546. }, {
  29547. type: 'raw',
  29548. isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'),
  29549. schema: _ref2 => {
  29550. let {
  29551. phrasingContentSchema
  29552. } = _ref2;
  29553. return {
  29554. pre: {
  29555. children: phrasingContentSchema
  29556. }
  29557. };
  29558. }
  29559. }],
  29560. to: [{
  29561. type: 'block',
  29562. blocks: ['core/paragraph'],
  29563. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  29564. }, {
  29565. type: 'block',
  29566. blocks: ['core/code'],
  29567. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes)
  29568. }]
  29569. };
  29570. /* harmony default export */ var preformatted_transforms = (preformatted_transforms_transforms);
  29571. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
  29572. /**
  29573. * WordPress dependencies
  29574. */
  29575. /**
  29576. * Internal dependencies
  29577. */
  29578. const preformatted_metadata = {
  29579. $schema: "https://schemas.wp.org/trunk/block.json",
  29580. apiVersion: 2,
  29581. name: "core/preformatted",
  29582. title: "Preformatted",
  29583. category: "text",
  29584. description: "Add text that respects your spacing and tabs, and also allows styling.",
  29585. textdomain: "default",
  29586. attributes: {
  29587. content: {
  29588. type: "string",
  29589. source: "html",
  29590. selector: "pre",
  29591. "default": "",
  29592. __unstablePreserveWhiteSpace: true,
  29593. __experimentalRole: "content"
  29594. }
  29595. },
  29596. supports: {
  29597. anchor: true,
  29598. color: {
  29599. gradients: true,
  29600. __experimentalDefaultControls: {
  29601. background: true,
  29602. text: true
  29603. }
  29604. },
  29605. typography: {
  29606. fontSize: true,
  29607. lineHeight: true,
  29608. __experimentalFontStyle: true,
  29609. __experimentalFontWeight: true,
  29610. __experimentalLetterSpacing: true,
  29611. __experimentalTextTransform: true,
  29612. __experimentalDefaultControls: {
  29613. fontSize: true
  29614. }
  29615. }
  29616. },
  29617. style: "wp-block-preformatted"
  29618. };
  29619. const {
  29620. name: preformatted_name
  29621. } = preformatted_metadata;
  29622. const preformatted_settings = {
  29623. icon: library_preformatted,
  29624. example: {
  29625. attributes: {
  29626. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  29627. // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
  29628. content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
  29629. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  29630. }
  29631. },
  29632. transforms: preformatted_transforms,
  29633. edit: PreformattedEdit,
  29634. save: preformatted_save_save,
  29635. merge(attributes, attributesToMerge) {
  29636. return {
  29637. content: attributes.content + attributesToMerge.content
  29638. };
  29639. }
  29640. };
  29641. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js
  29642. /**
  29643. * WordPress dependencies
  29644. */
  29645. const pullquote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  29646. viewBox: "0 0 24 24",
  29647. xmlns: "http://www.w3.org/2000/svg"
  29648. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  29649. d: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"
  29650. }));
  29651. /* harmony default export */ var library_pullquote = (pullquote);
  29652. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
  29653. const SOLID_COLOR_CLASS = `is-style-solid-color`;
  29654. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
  29655. /**
  29656. * External dependencies
  29657. */
  29658. /**
  29659. * WordPress dependencies
  29660. */
  29661. /**
  29662. * Internal dependencies
  29663. */
  29664. const pullquote_deprecated_blockAttributes = {
  29665. value: {
  29666. type: 'string',
  29667. source: 'html',
  29668. selector: 'blockquote',
  29669. multiline: 'p'
  29670. },
  29671. citation: {
  29672. type: 'string',
  29673. source: 'html',
  29674. selector: 'cite',
  29675. default: ''
  29676. },
  29677. mainColor: {
  29678. type: 'string'
  29679. },
  29680. customMainColor: {
  29681. type: 'string'
  29682. },
  29683. textColor: {
  29684. type: 'string'
  29685. },
  29686. customTextColor: {
  29687. type: 'string'
  29688. }
  29689. };
  29690. function parseBorderColor(styleString) {
  29691. if (!styleString) {
  29692. return;
  29693. }
  29694. const matches = styleString.match(/border-color:([^;]+)[;]?/);
  29695. if (matches && matches[1]) {
  29696. return matches[1];
  29697. }
  29698. } // TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example
  29699. const pullquote_deprecated_deprecated = [{
  29700. attributes: { ...pullquote_deprecated_blockAttributes
  29701. },
  29702. save(_ref) {
  29703. let {
  29704. attributes
  29705. } = _ref;
  29706. const {
  29707. mainColor,
  29708. customMainColor,
  29709. customTextColor,
  29710. textColor,
  29711. value,
  29712. citation,
  29713. className
  29714. } = attributes;
  29715. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29716. let figureClasses, figureStyles; // Is solid color style
  29717. if (isSolidColorStyle) {
  29718. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  29719. figureClasses = classnames_default()({
  29720. 'has-background': backgroundClass || customMainColor,
  29721. [backgroundClass]: backgroundClass
  29722. });
  29723. figureStyles = {
  29724. backgroundColor: backgroundClass ? undefined : customMainColor
  29725. }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
  29726. } else if (customMainColor) {
  29727. figureStyles = {
  29728. borderColor: customMainColor
  29729. };
  29730. }
  29731. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  29732. const blockquoteClasses = classnames_default()({
  29733. 'has-text-color': textColor || customTextColor,
  29734. [blockquoteTextColorClass]: blockquoteTextColorClass
  29735. });
  29736. const blockquoteStyles = blockquoteTextColorClass ? undefined : {
  29737. color: customTextColor
  29738. };
  29739. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  29740. className: figureClasses,
  29741. style: figureStyles
  29742. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  29743. className: blockquoteClasses,
  29744. style: blockquoteStyles
  29745. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29746. value: value,
  29747. multiline: true
  29748. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29749. tagName: "cite",
  29750. value: citation
  29751. })));
  29752. },
  29753. migrate(_ref2) {
  29754. let {
  29755. className,
  29756. mainColor,
  29757. customMainColor,
  29758. customTextColor,
  29759. ...attributes
  29760. } = _ref2;
  29761. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29762. let style;
  29763. if (customMainColor) {
  29764. if (!isSolidColorStyle) {
  29765. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  29766. style = {
  29767. border: {
  29768. color: customMainColor
  29769. }
  29770. };
  29771. } else {
  29772. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  29773. style = {
  29774. color: {
  29775. background: customMainColor
  29776. }
  29777. };
  29778. }
  29779. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  29780. if (customTextColor && style) {
  29781. style.color = { ...style.color,
  29782. text: customTextColor
  29783. };
  29784. }
  29785. return {
  29786. className,
  29787. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  29788. borderColor: isSolidColorStyle ? undefined : mainColor,
  29789. textAlign: isSolidColorStyle ? 'left' : undefined,
  29790. style,
  29791. ...attributes
  29792. };
  29793. }
  29794. }, {
  29795. attributes: { ...pullquote_deprecated_blockAttributes,
  29796. // figureStyle is an attribute that never existed.
  29797. // We are using it as a way to access the styles previously applied to the figure.
  29798. figureStyle: {
  29799. source: 'attribute',
  29800. selector: 'figure',
  29801. attribute: 'style'
  29802. }
  29803. },
  29804. save(_ref3) {
  29805. let {
  29806. attributes
  29807. } = _ref3;
  29808. const {
  29809. mainColor,
  29810. customMainColor,
  29811. textColor,
  29812. customTextColor,
  29813. value,
  29814. citation,
  29815. className,
  29816. figureStyle
  29817. } = attributes;
  29818. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29819. let figureClasses, figureStyles; // Is solid color style
  29820. if (isSolidColorStyle) {
  29821. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  29822. figureClasses = classnames_default()({
  29823. 'has-background': backgroundClass || customMainColor,
  29824. [backgroundClass]: backgroundClass
  29825. });
  29826. figureStyles = {
  29827. backgroundColor: backgroundClass ? undefined : customMainColor
  29828. }; // Is normal style and a custom color is being used ( we can set a style directly with its value)
  29829. } else if (customMainColor) {
  29830. figureStyles = {
  29831. borderColor: customMainColor
  29832. }; // If normal style and a named color are being used, we need to retrieve the color value to set the style,
  29833. // as there is no expectation that themes create classes that set border colors.
  29834. } else if (mainColor) {
  29835. // Previously here we queried the color settings to know the color value
  29836. // of a named color. This made the save function impure and the block was refactored,
  29837. // because meanwhile a change in the editor made it impossible to query color settings in the save function.
  29838. // Here instead of querying the color settings to know the color value, we retrieve the value
  29839. // directly from the style previously serialized.
  29840. const borderColor = parseBorderColor(figureStyle);
  29841. figureStyles = {
  29842. borderColor
  29843. };
  29844. }
  29845. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  29846. const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', {
  29847. [blockquoteTextColorClass]: blockquoteTextColorClass
  29848. });
  29849. const blockquoteStyles = blockquoteTextColorClass ? undefined : {
  29850. color: customTextColor
  29851. };
  29852. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  29853. className: figureClasses,
  29854. style: figureStyles
  29855. }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  29856. className: blockquoteClasses,
  29857. style: blockquoteStyles
  29858. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29859. value: value,
  29860. multiline: true
  29861. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29862. tagName: "cite",
  29863. value: citation
  29864. })));
  29865. },
  29866. migrate(_ref4) {
  29867. let {
  29868. className,
  29869. figureStyle,
  29870. mainColor,
  29871. customMainColor,
  29872. customTextColor,
  29873. ...attributes
  29874. } = _ref4;
  29875. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29876. let style;
  29877. if (customMainColor) {
  29878. if (!isSolidColorStyle) {
  29879. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  29880. style = {
  29881. border: {
  29882. color: customMainColor
  29883. }
  29884. };
  29885. } else {
  29886. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  29887. style = {
  29888. color: {
  29889. background: customMainColor
  29890. }
  29891. };
  29892. }
  29893. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  29894. if (customTextColor && style) {
  29895. style.color = { ...style.color,
  29896. text: customTextColor
  29897. };
  29898. } // If is the default style, and a main color is set,
  29899. // migrate the main color value into a custom border color.
  29900. // The custom border color value is retrieved by parsing the figure styles.
  29901. if (!isSolidColorStyle && mainColor && figureStyle) {
  29902. const borderColor = parseBorderColor(figureStyle);
  29903. if (borderColor) {
  29904. return { ...attributes,
  29905. className,
  29906. // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style.
  29907. style: {
  29908. border: {
  29909. color: borderColor
  29910. }
  29911. }
  29912. };
  29913. }
  29914. }
  29915. return {
  29916. className,
  29917. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  29918. borderColor: isSolidColorStyle ? undefined : mainColor,
  29919. textAlign: isSolidColorStyle ? 'left' : undefined,
  29920. style,
  29921. ...attributes
  29922. };
  29923. }
  29924. }, {
  29925. attributes: pullquote_deprecated_blockAttributes,
  29926. save(_ref5) {
  29927. let {
  29928. attributes
  29929. } = _ref5;
  29930. const {
  29931. mainColor,
  29932. customMainColor,
  29933. textColor,
  29934. customTextColor,
  29935. value,
  29936. citation,
  29937. className
  29938. } = attributes;
  29939. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29940. let figureClass, figureStyles; // Is solid color style
  29941. if (isSolidColorStyle) {
  29942. figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
  29943. if (!figureClass) {
  29944. figureStyles = {
  29945. backgroundColor: customMainColor
  29946. };
  29947. } // Is normal style and a custom color is being used ( we can set a style directly with its value)
  29948. } else if (customMainColor) {
  29949. figureStyles = {
  29950. borderColor: customMainColor
  29951. }; // Is normal style and a named color is being used, we need to retrieve the color value to set the style,
  29952. // as there is no expectation that themes create classes that set border colors.
  29953. } else if (mainColor) {
  29954. const colors = (0,external_lodash_namespaceObject.get)((0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings(), ['colors'], []);
  29955. const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
  29956. figureStyles = {
  29957. borderColor: colorObject.color
  29958. };
  29959. }
  29960. const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
  29961. const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', {
  29962. [blockquoteTextColorClass]: blockquoteTextColorClass
  29963. }) : undefined;
  29964. const blockquoteStyle = blockquoteTextColorClass ? undefined : {
  29965. color: customTextColor
  29966. };
  29967. return (0,external_wp_element_namespaceObject.createElement)("figure", {
  29968. className: figureClass,
  29969. style: figureStyles
  29970. }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  29971. className: blockquoteClasses,
  29972. style: blockquoteStyle
  29973. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29974. value: value,
  29975. multiline: true
  29976. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  29977. tagName: "cite",
  29978. value: citation
  29979. })));
  29980. },
  29981. migrate(_ref6) {
  29982. let {
  29983. className,
  29984. mainColor,
  29985. customMainColor,
  29986. customTextColor,
  29987. ...attributes
  29988. } = _ref6;
  29989. const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
  29990. let style = {};
  29991. if (customMainColor) {
  29992. if (!isSolidColorStyle) {
  29993. // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute.
  29994. style = {
  29995. border: {
  29996. color: customMainColor
  29997. }
  29998. };
  29999. } else {
  30000. // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute.
  30001. style = {
  30002. color: {
  30003. background: customMainColor
  30004. }
  30005. };
  30006. }
  30007. } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute.
  30008. if (customTextColor && style) {
  30009. style.color = { ...style.color,
  30010. text: customTextColor
  30011. };
  30012. }
  30013. return {
  30014. className,
  30015. backgroundColor: isSolidColorStyle ? mainColor : undefined,
  30016. borderColor: isSolidColorStyle ? undefined : mainColor,
  30017. textAlign: isSolidColorStyle ? 'left' : undefined,
  30018. style,
  30019. ...attributes
  30020. };
  30021. }
  30022. }, {
  30023. attributes: { ...pullquote_deprecated_blockAttributes
  30024. },
  30025. save(_ref7) {
  30026. let {
  30027. attributes
  30028. } = _ref7;
  30029. const {
  30030. value,
  30031. citation
  30032. } = attributes;
  30033. return (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30034. value: value,
  30035. multiline: true
  30036. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30037. tagName: "cite",
  30038. value: citation
  30039. }));
  30040. }
  30041. }, {
  30042. attributes: { ...pullquote_deprecated_blockAttributes,
  30043. citation: {
  30044. type: 'string',
  30045. source: 'html',
  30046. selector: 'footer'
  30047. },
  30048. align: {
  30049. type: 'string',
  30050. default: 'none'
  30051. }
  30052. },
  30053. save(_ref8) {
  30054. let {
  30055. attributes
  30056. } = _ref8;
  30057. const {
  30058. value,
  30059. citation,
  30060. align
  30061. } = attributes;
  30062. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  30063. className: `align${align}`
  30064. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30065. value: value,
  30066. multiline: true
  30067. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30068. tagName: "footer",
  30069. value: citation
  30070. }));
  30071. }
  30072. }];
  30073. /* harmony default export */ var pullquote_deprecated = (pullquote_deprecated_deprecated);
  30074. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
  30075. const Figure = 'figure';
  30076. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
  30077. const BlockQuote = 'blockquote';
  30078. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
  30079. /**
  30080. * External dependencies
  30081. */
  30082. /**
  30083. * WordPress dependencies
  30084. */
  30085. /**
  30086. * Internal dependencies
  30087. */
  30088. const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
  30089. function PullQuoteEdit(_ref) {
  30090. let {
  30091. attributes,
  30092. setAttributes,
  30093. isSelected,
  30094. insertBlocksAfter
  30095. } = _ref;
  30096. const {
  30097. textAlign,
  30098. citation,
  30099. value
  30100. } = attributes;
  30101. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  30102. className: classnames_default()({
  30103. [`has-text-align-${textAlign}`]: textAlign
  30104. })
  30105. });
  30106. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
  30107. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  30108. group: "block"
  30109. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  30110. value: textAlign,
  30111. onChange: nextAlign => {
  30112. setAttributes({
  30113. textAlign: nextAlign
  30114. });
  30115. }
  30116. })), (0,external_wp_element_namespaceObject.createElement)(Figure, blockProps, (0,external_wp_element_namespaceObject.createElement)(BlockQuote, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  30117. identifier: "value",
  30118. multiline: true,
  30119. value: value,
  30120. onChange: nextValue => setAttributes({
  30121. value: nextValue
  30122. }),
  30123. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'),
  30124. placeholder: // translators: placeholder text used for the quote
  30125. (0,external_wp_i18n_namespaceObject.__)('Add quote'),
  30126. textAlign: "center"
  30127. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  30128. identifier: "citation",
  30129. tagName: isWebPlatform ? 'cite' : undefined,
  30130. style: {
  30131. display: 'block'
  30132. },
  30133. value: citation,
  30134. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'),
  30135. placeholder: // translators: placeholder text used for the citation
  30136. (0,external_wp_i18n_namespaceObject.__)('Add citation'),
  30137. onChange: nextCitation => setAttributes({
  30138. citation: nextCitation
  30139. }),
  30140. className: "wp-block-pullquote__citation",
  30141. __unstableMobileNoFocusOnMount: true,
  30142. textAlign: "center",
  30143. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  30144. }))));
  30145. }
  30146. /* harmony default export */ var pullquote_edit = (PullQuoteEdit);
  30147. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
  30148. /**
  30149. * External dependencies
  30150. */
  30151. /**
  30152. * WordPress dependencies
  30153. */
  30154. function pullquote_save_save(_ref) {
  30155. let {
  30156. attributes
  30157. } = _ref;
  30158. const {
  30159. textAlign,
  30160. citation,
  30161. value
  30162. } = attributes;
  30163. const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
  30164. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  30165. className: classnames_default()({
  30166. [`has-text-align-${textAlign}`]: textAlign
  30167. })
  30168. }), (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30169. value: value,
  30170. multiline: true
  30171. }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  30172. tagName: "cite",
  30173. value: citation
  30174. })));
  30175. }
  30176. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
  30177. /**
  30178. * WordPress dependencies
  30179. */
  30180. const pullquote_transforms_transforms = {
  30181. from: [{
  30182. type: 'block',
  30183. isMultiBlock: true,
  30184. blocks: ['core/paragraph'],
  30185. transform: attributes => {
  30186. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  30187. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30188. value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
  30189. let {
  30190. content
  30191. } = _ref;
  30192. return (0,external_wp_richText_namespaceObject.create)({
  30193. html: content
  30194. });
  30195. }), '\u2028'),
  30196. multilineTag: 'p'
  30197. }),
  30198. anchor: attributes.anchor
  30199. });
  30200. }
  30201. }, {
  30202. type: 'block',
  30203. blocks: ['core/heading'],
  30204. transform: _ref2 => {
  30205. let {
  30206. content,
  30207. anchor
  30208. } = _ref2;
  30209. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  30210. value: `<p>${content}</p>`,
  30211. anchor
  30212. });
  30213. }
  30214. }],
  30215. to: [{
  30216. type: 'block',
  30217. blocks: ['core/paragraph'],
  30218. transform: _ref3 => {
  30219. let {
  30220. value,
  30221. citation
  30222. } = _ref3;
  30223. const paragraphs = [];
  30224. if (value && value !== '<p></p>') {
  30225. paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  30226. html: value,
  30227. multilineTag: 'p'
  30228. }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  30229. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30230. value: piece
  30231. })
  30232. })));
  30233. }
  30234. if (citation && citation !== '<p></p>') {
  30235. paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  30236. content: citation
  30237. }));
  30238. }
  30239. if (paragraphs.length === 0) {
  30240. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  30241. content: ''
  30242. });
  30243. }
  30244. return paragraphs;
  30245. }
  30246. }, {
  30247. type: 'block',
  30248. blocks: ['core/heading'],
  30249. transform: _ref4 => {
  30250. let {
  30251. value,
  30252. citation,
  30253. ...attrs
  30254. } = _ref4;
  30255. // If there is no pullquote content, use the citation as the
  30256. // content of the resulting heading. A nonexistent citation
  30257. // will result in an empty heading.
  30258. if (value === '<p></p>') {
  30259. return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  30260. content: citation
  30261. });
  30262. }
  30263. const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  30264. html: value,
  30265. multilineTag: 'p'
  30266. }), '\u2028');
  30267. const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  30268. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30269. value: pieces[0]
  30270. })
  30271. });
  30272. if (!citation && pieces.length === 1) {
  30273. return headingBlock;
  30274. }
  30275. const quotePieces = pieces.slice(1);
  30276. const pullquoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { ...attrs,
  30277. citation,
  30278. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  30279. value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
  30280. multilineTag: 'p'
  30281. })
  30282. });
  30283. return [headingBlock, pullquoteBlock];
  30284. }
  30285. }]
  30286. };
  30287. /* harmony default export */ var pullquote_transforms = (pullquote_transforms_transforms);
  30288. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
  30289. /**
  30290. * WordPress dependencies
  30291. */
  30292. /**
  30293. * Internal dependencies
  30294. */
  30295. const pullquote_metadata = {
  30296. $schema: "https://schemas.wp.org/trunk/block.json",
  30297. apiVersion: 2,
  30298. name: "core/pullquote",
  30299. title: "Pullquote",
  30300. category: "text",
  30301. description: "Give special visual emphasis to a quote from your text.",
  30302. textdomain: "default",
  30303. attributes: {
  30304. value: {
  30305. type: "string",
  30306. source: "html",
  30307. selector: "blockquote",
  30308. multiline: "p",
  30309. __experimentalRole: "content"
  30310. },
  30311. citation: {
  30312. type: "string",
  30313. source: "html",
  30314. selector: "cite",
  30315. "default": "",
  30316. __experimentalRole: "content"
  30317. },
  30318. textAlign: {
  30319. type: "string"
  30320. }
  30321. },
  30322. supports: {
  30323. anchor: true,
  30324. align: ["left", "right", "wide", "full"],
  30325. color: {
  30326. gradients: true,
  30327. background: true,
  30328. link: true,
  30329. __experimentalDefaultControls: {
  30330. background: true,
  30331. text: true
  30332. }
  30333. },
  30334. typography: {
  30335. fontSize: true,
  30336. lineHeight: true,
  30337. __experimentalFontStyle: true,
  30338. __experimentalFontWeight: true,
  30339. __experimentalLetterSpacing: true,
  30340. __experimentalTextTransform: true,
  30341. __experimentalDefaultControls: {
  30342. fontSize: true,
  30343. fontAppearance: true
  30344. }
  30345. },
  30346. __experimentalBorder: {
  30347. color: true,
  30348. radius: true,
  30349. style: true,
  30350. width: true,
  30351. __experimentalDefaultControls: {
  30352. color: true,
  30353. radius: true,
  30354. style: true,
  30355. width: true
  30356. }
  30357. }
  30358. },
  30359. editorStyle: "wp-block-pullquote-editor",
  30360. style: "wp-block-pullquote"
  30361. };
  30362. const {
  30363. name: pullquote_name
  30364. } = pullquote_metadata;
  30365. const pullquote_settings = {
  30366. icon: library_pullquote,
  30367. example: {
  30368. attributes: {
  30369. value: '<p>' + // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.
  30370. (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.') + '</p>',
  30371. citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg')
  30372. }
  30373. },
  30374. transforms: pullquote_transforms,
  30375. edit: pullquote_edit,
  30376. save: pullquote_save_save,
  30377. deprecated: pullquote_deprecated
  30378. };
  30379. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js
  30380. /**
  30381. * WordPress dependencies
  30382. */
  30383. const loop = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30384. viewBox: "0 0 24 24",
  30385. xmlns: "http://www.w3.org/2000/svg"
  30386. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30387. d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"
  30388. }));
  30389. /* harmony default export */ var library_loop = (loop);
  30390. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
  30391. /**
  30392. * WordPress dependencies
  30393. */
  30394. const settings_settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  30395. xmlns: "http://www.w3.org/2000/svg",
  30396. viewBox: "0 0 24 24"
  30397. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  30398. d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
  30399. }));
  30400. /* harmony default export */ var library_settings = (settings_settings);
  30401. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
  30402. /**
  30403. * WordPress dependencies
  30404. */
  30405. function QueryToolbar(_ref) {
  30406. let {
  30407. attributes: {
  30408. query,
  30409. displayLayout
  30410. },
  30411. setQuery,
  30412. setDisplayLayout,
  30413. openPatternSelectionModal
  30414. } = _ref;
  30415. const maxPageInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
  30416. const displayLayoutControls = [{
  30417. icon: library_list,
  30418. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  30419. onClick: () => setDisplayLayout({
  30420. type: 'list'
  30421. }),
  30422. isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'list'
  30423. }, {
  30424. icon: library_grid,
  30425. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  30426. onClick: () => setDisplayLayout({
  30427. type: 'flex',
  30428. columns: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.columns) || 3
  30429. }),
  30430. isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex'
  30431. }];
  30432. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !query.inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  30433. contentClassName: "block-library-query-toolbar__popover",
  30434. renderToggle: _ref2 => {
  30435. let {
  30436. onToggle
  30437. } = _ref2;
  30438. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  30439. icon: library_settings,
  30440. label: (0,external_wp_i18n_namespaceObject.__)('Display settings'),
  30441. onClick: onToggle
  30442. });
  30443. },
  30444. renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  30445. __unstableInputWidth: "60px",
  30446. label: (0,external_wp_i18n_namespaceObject.__)('Items per Page'),
  30447. labelPosition: "edge",
  30448. min: 1,
  30449. max: 100,
  30450. onChange: value => {
  30451. if (isNaN(value) || value < 1 || value > 100) {
  30452. return;
  30453. }
  30454. setQuery({
  30455. perPage: value
  30456. });
  30457. },
  30458. step: "1",
  30459. value: query.perPage,
  30460. isDragEnabled: false
  30461. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  30462. __unstableInputWidth: "60px",
  30463. label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
  30464. labelPosition: "edge",
  30465. min: 0,
  30466. max: 100,
  30467. onChange: value => {
  30468. if (isNaN(value) || value < 0 || value > 100) {
  30469. return;
  30470. }
  30471. setQuery({
  30472. offset: value
  30473. });
  30474. },
  30475. step: "1",
  30476. value: query.offset,
  30477. isDragEnabled: false
  30478. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  30479. id: maxPageInputId,
  30480. help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
  30481. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
  30482. id: maxPageInputId,
  30483. __unstableInputWidth: "60px",
  30484. label: (0,external_wp_i18n_namespaceObject.__)('Max page to show'),
  30485. labelPosition: "edge",
  30486. min: 0,
  30487. onChange: value => {
  30488. if (isNaN(value) || value < 0) {
  30489. return;
  30490. }
  30491. setQuery({
  30492. pages: value
  30493. });
  30494. },
  30495. step: "1",
  30496. value: query.pages,
  30497. isDragEnabled: false
  30498. })))
  30499. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  30500. className: "wp-block-template-part__block-control-group"
  30501. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  30502. onClick: openPatternSelectionModal
  30503. }, (0,external_wp_i18n_namespaceObject.__)('Replace'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  30504. controls: displayLayoutControls
  30505. }));
  30506. }
  30507. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js
  30508. /**
  30509. * WordPress dependencies
  30510. */
  30511. const orderOptions = [{
  30512. label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'),
  30513. value: 'date/desc'
  30514. }, {
  30515. label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'),
  30516. value: 'date/asc'
  30517. }, {
  30518. /* translators: label for ordering posts by title in ascending order */
  30519. label: (0,external_wp_i18n_namespaceObject.__)('A → Z'),
  30520. value: 'title/asc'
  30521. }, {
  30522. /* translators: label for ordering posts by title in descending order */
  30523. label: (0,external_wp_i18n_namespaceObject.__)('Z → A'),
  30524. value: 'title/desc'
  30525. }];
  30526. function OrderControl(_ref) {
  30527. let {
  30528. order,
  30529. orderBy,
  30530. onChange
  30531. } = _ref;
  30532. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  30533. label: (0,external_wp_i18n_namespaceObject.__)('Order by'),
  30534. value: `${orderBy}/${order}`,
  30535. options: orderOptions,
  30536. onChange: value => {
  30537. const [newOrderBy, newOrder] = value.split('/');
  30538. onChange({
  30539. order: newOrder,
  30540. orderBy: newOrderBy
  30541. });
  30542. }
  30543. });
  30544. }
  30545. /* harmony default export */ var order_control = (OrderControl);
  30546. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js
  30547. /**
  30548. * WordPress dependencies
  30549. */
  30550. /**
  30551. * @typedef IHasNameAndId
  30552. * @property {string|number} id The entity's id.
  30553. * @property {string} name The entity's name.
  30554. */
  30555. /**
  30556. * The object used in Query block that contains info and helper mappings
  30557. * from an array of IHasNameAndId objects.
  30558. *
  30559. * @typedef {Object} QueryEntitiesInfo
  30560. * @property {IHasNameAndId[]} entities The array of entities.
  30561. * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.
  30562. * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.
  30563. * @property {string[]} names Array with the entities' names.
  30564. */
  30565. /**
  30566. * Returns a helper object with mapping from Objects that implement
  30567. * the `IHasNameAndId` interface. The returned object is used for
  30568. * integration with `FormTokenField` component.
  30569. *
  30570. * @param {IHasNameAndId[]} entities The entities to extract of helper object.
  30571. * @return {QueryEntitiesInfo} The object with the entities information.
  30572. */
  30573. const getEntitiesInfo = entities => {
  30574. const mapping = entities === null || entities === void 0 ? void 0 : entities.reduce((accumulator, entity) => {
  30575. const {
  30576. mapById,
  30577. mapByName,
  30578. names
  30579. } = accumulator;
  30580. mapById[entity.id] = entity;
  30581. mapByName[entity.name] = entity;
  30582. names.push(entity.name);
  30583. return accumulator;
  30584. }, {
  30585. mapById: {},
  30586. mapByName: {},
  30587. names: []
  30588. });
  30589. return {
  30590. entities,
  30591. ...mapping
  30592. };
  30593. };
  30594. /**
  30595. * Returns a helper object that contains:
  30596. * 1. An `options` object from the available post types, to be passed to a `SelectControl`.
  30597. * 2. A helper map with available taxonomies per post type.
  30598. *
  30599. * @return {Object} The helper object related to post types.
  30600. */
  30601. const usePostTypes = () => {
  30602. const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30603. var _getPostTypes;
  30604. const {
  30605. getPostTypes
  30606. } = select(external_wp_coreData_namespaceObject.store);
  30607. const excludedPostTypes = ['attachment'];
  30608. const filteredPostTypes = (_getPostTypes = getPostTypes({
  30609. per_page: -1
  30610. })) === null || _getPostTypes === void 0 ? void 0 : _getPostTypes.filter(_ref => {
  30611. let {
  30612. viewable,
  30613. slug
  30614. } = _ref;
  30615. return viewable && !excludedPostTypes.includes(slug);
  30616. });
  30617. return filteredPostTypes;
  30618. }, []);
  30619. const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
  30620. if (!(postTypes !== null && postTypes !== void 0 && postTypes.length)) return;
  30621. return postTypes.reduce((accumulator, type) => {
  30622. accumulator[type.slug] = type.taxonomies;
  30623. return accumulator;
  30624. }, {});
  30625. }, [postTypes]);
  30626. const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(_ref2 => {
  30627. let {
  30628. labels,
  30629. slug
  30630. } = _ref2;
  30631. return {
  30632. label: labels.singular_name,
  30633. value: slug
  30634. };
  30635. }), [postTypes]);
  30636. return {
  30637. postTypesTaxonomiesMap,
  30638. postTypesSelectOptions
  30639. };
  30640. };
  30641. /**
  30642. * Hook that returns the taxonomies associated with a specific post type.
  30643. *
  30644. * @param {string} postType The post type from which to retrieve the associated taxonomies.
  30645. * @return {Object[]} An array of the associated taxonomies.
  30646. */
  30647. const useTaxonomies = postType => {
  30648. const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30649. const {
  30650. getTaxonomies
  30651. } = select(external_wp_coreData_namespaceObject.store);
  30652. const filteredTaxonomies = getTaxonomies({
  30653. type: postType,
  30654. per_page: -1,
  30655. context: 'view'
  30656. });
  30657. return filteredTaxonomies;
  30658. }, [postType]);
  30659. return taxonomies;
  30660. };
  30661. /**
  30662. * Recurses over a list of blocks and returns the first found
  30663. * Query Loop block's clientId.
  30664. *
  30665. * @param {WPBlock[]} blocks The list of blocks to look through.
  30666. * @return {string=} The first found Query Loop's clientId.
  30667. */
  30668. const getFirstQueryClientIdFromBlocks = blocks => {
  30669. const blocksQueue = [...blocks];
  30670. while (blocksQueue.length > 0) {
  30671. var _block$innerBlocks;
  30672. const block = blocksQueue.shift();
  30673. if (block.name === 'core/query') {
  30674. return block.clientId;
  30675. }
  30676. (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => {
  30677. blocksQueue.push(innerBlock);
  30678. });
  30679. }
  30680. };
  30681. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js
  30682. /**
  30683. * WordPress dependencies
  30684. */
  30685. /**
  30686. * Internal dependencies
  30687. */
  30688. const author_control_AUTHORS_QUERY = {
  30689. who: 'authors',
  30690. per_page: -1,
  30691. _fields: 'id,name',
  30692. context: 'view'
  30693. };
  30694. function AuthorControl(_ref) {
  30695. let {
  30696. value,
  30697. onChange
  30698. } = _ref;
  30699. const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30700. const {
  30701. getUsers
  30702. } = select(external_wp_coreData_namespaceObject.store);
  30703. return getUsers(author_control_AUTHORS_QUERY);
  30704. }, []);
  30705. if (!authorsList) {
  30706. return null;
  30707. }
  30708. const authorsInfo = getEntitiesInfo(authorsList);
  30709. /**
  30710. * We need to normalize the value because the block operates on a
  30711. * comma(`,`) separated string value and `FormTokenFiels` needs an
  30712. * array.
  30713. */
  30714. const normalizedValue = !value ? [] : value.toString().split(','); // Returns only the existing authors ids. This prevents the component
  30715. // from crashing in the editor, when non existing ids are provided.
  30716. const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => {
  30717. const author = authorsInfo.mapById[authorId];
  30718. if (author) {
  30719. accumulator.push({
  30720. id: authorId,
  30721. value: author.name
  30722. });
  30723. }
  30724. return accumulator;
  30725. }, []);
  30726. const getIdByValue = (entitiesMappedByName, authorValue) => {
  30727. var _entitiesMappedByName;
  30728. const id = (authorValue === null || authorValue === void 0 ? void 0 : authorValue.id) || ((_entitiesMappedByName = entitiesMappedByName[authorValue]) === null || _entitiesMappedByName === void 0 ? void 0 : _entitiesMappedByName.id);
  30729. if (id) return id;
  30730. };
  30731. const onAuthorChange = newValue => {
  30732. const ids = Array.from(newValue.reduce((accumulator, author) => {
  30733. // Verify that new values point to existing entities.
  30734. const id = getIdByValue(authorsInfo.mapByName, author);
  30735. if (id) accumulator.add(id);
  30736. return accumulator;
  30737. }, new Set()));
  30738. onChange({
  30739. author: ids.join(',')
  30740. });
  30741. };
  30742. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  30743. label: (0,external_wp_i18n_namespaceObject.__)('Authors'),
  30744. value: sanitizedValue,
  30745. suggestions: authorsInfo.names,
  30746. onChange: onAuthorChange
  30747. });
  30748. }
  30749. /* harmony default export */ var author_control = (AuthorControl);
  30750. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/constants.js
  30751. const MAX_FETCHED_TERMS = 100;
  30752. const DEFAULTS_POSTS_PER_PAGE = 3;
  30753. /* harmony default export */ var constants = ({
  30754. MAX_FETCHED_TERMS,
  30755. DEFAULTS_POSTS_PER_PAGE
  30756. });
  30757. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js
  30758. /**
  30759. * WordPress dependencies
  30760. */
  30761. /**
  30762. * Internal dependencies
  30763. */
  30764. // Helper function to get the term id based on user input in terms `FormTokenField`.
  30765. const getTermIdByTermValue = (termsMappedByName, termValue) => {
  30766. var _termsMappedByName$te;
  30767. // First we check for exact match by `term.id` or case sensitive `term.name` match.
  30768. const termId = (termValue === null || termValue === void 0 ? void 0 : termValue.id) || ((_termsMappedByName$te = termsMappedByName[termValue]) === null || _termsMappedByName$te === void 0 ? void 0 : _termsMappedByName$te.id);
  30769. if (termId) return termId;
  30770. /**
  30771. * Here we make an extra check for entered terms in a non case sensitive way,
  30772. * to match user expectations, due to `FormTokenField` behaviour that shows
  30773. * suggestions which are case insensitive.
  30774. *
  30775. * Although WP tries to discourage users to add terms with the same name (case insensitive),
  30776. * it's still possible if you manually change the name, as long as the terms have different slugs.
  30777. * In this edge case we always apply the first match from the terms list.
  30778. */
  30779. const termValueLower = termValue.toLocaleLowerCase();
  30780. for (const term in termsMappedByName) {
  30781. if (term.toLocaleLowerCase() === termValueLower) {
  30782. return termsMappedByName[term].id;
  30783. }
  30784. }
  30785. };
  30786. function TaxonomyControls(_ref) {
  30787. let {
  30788. onChange,
  30789. query
  30790. } = _ref;
  30791. const taxonomies = useTaxonomies(query.postType);
  30792. const taxonomiesInfo = (0,external_wp_data_namespaceObject.useSelect)(select => {
  30793. const {
  30794. getEntityRecords
  30795. } = select(external_wp_coreData_namespaceObject.store);
  30796. const termsQuery = {
  30797. per_page: MAX_FETCHED_TERMS
  30798. };
  30799. const _taxonomiesInfo = taxonomies === null || taxonomies === void 0 ? void 0 : taxonomies.map(_ref2 => {
  30800. let {
  30801. slug,
  30802. name
  30803. } = _ref2;
  30804. const _terms = getEntityRecords('taxonomy', slug, termsQuery);
  30805. return {
  30806. slug,
  30807. name,
  30808. terms: getEntitiesInfo(_terms)
  30809. };
  30810. });
  30811. return _taxonomiesInfo;
  30812. }, [taxonomies]);
  30813. const onTermsChange = taxonomySlug => newTermValues => {
  30814. const taxonomyInfo = taxonomiesInfo.find(_ref3 => {
  30815. let {
  30816. slug
  30817. } = _ref3;
  30818. return slug === taxonomySlug;
  30819. });
  30820. if (!taxonomyInfo) return;
  30821. const termIds = Array.from(newTermValues.reduce((accumulator, termValue) => {
  30822. const termId = getTermIdByTermValue(taxonomyInfo.terms.mapByName, termValue);
  30823. if (termId) accumulator.add(termId);
  30824. return accumulator;
  30825. }, new Set()));
  30826. const newTaxQuery = { ...query.taxQuery,
  30827. [taxonomySlug]: termIds
  30828. };
  30829. onChange({
  30830. taxQuery: newTaxQuery
  30831. });
  30832. }; // Returns only the existing term ids in proper format to be
  30833. // used in `FormTokenField`. This prevents the component from
  30834. // crashing in the editor, when non existing term ids were provided.
  30835. const getExistingTaxQueryValue = taxonomySlug => {
  30836. var _query$taxQuery;
  30837. const taxonomyInfo = taxonomiesInfo.find(_ref4 => {
  30838. let {
  30839. slug
  30840. } = _ref4;
  30841. return slug === taxonomySlug;
  30842. });
  30843. if (!taxonomyInfo) return [];
  30844. return (((_query$taxQuery = query.taxQuery) === null || _query$taxQuery === void 0 ? void 0 : _query$taxQuery[taxonomySlug]) || []).reduce((accumulator, termId) => {
  30845. const term = taxonomyInfo.terms.mapById[termId];
  30846. if (term) {
  30847. accumulator.push({
  30848. id: termId,
  30849. value: term.name
  30850. });
  30851. }
  30852. return accumulator;
  30853. }, []);
  30854. };
  30855. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !!(taxonomiesInfo !== null && taxonomiesInfo !== void 0 && taxonomiesInfo.length) && taxonomiesInfo.map(_ref5 => {
  30856. var _terms$names;
  30857. let {
  30858. slug,
  30859. name,
  30860. terms
  30861. } = _ref5;
  30862. if (!(terms !== null && terms !== void 0 && (_terms$names = terms.names) !== null && _terms$names !== void 0 && _terms$names.length)) {
  30863. return null;
  30864. }
  30865. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
  30866. key: slug,
  30867. label: name,
  30868. value: getExistingTaxQueryValue(slug),
  30869. suggestions: terms.names,
  30870. onChange: onTermsChange(slug)
  30871. });
  30872. }));
  30873. }
  30874. /* harmony default export */ var taxonomy_controls = (TaxonomyControls);
  30875. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js
  30876. /**
  30877. * External dependencies
  30878. */
  30879. /**
  30880. * WordPress dependencies
  30881. */
  30882. /**
  30883. * Internal dependencies
  30884. */
  30885. const stickyOptions = [{
  30886. label: (0,external_wp_i18n_namespaceObject.__)('Include'),
  30887. value: ''
  30888. }, {
  30889. label: (0,external_wp_i18n_namespaceObject.__)('Exclude'),
  30890. value: 'exclude'
  30891. }, {
  30892. label: (0,external_wp_i18n_namespaceObject.__)('Only'),
  30893. value: 'only'
  30894. }];
  30895. function QueryInspectorControls(_ref) {
  30896. let {
  30897. attributes: {
  30898. query,
  30899. displayLayout
  30900. },
  30901. setQuery,
  30902. setDisplayLayout
  30903. } = _ref;
  30904. const {
  30905. order,
  30906. orderBy,
  30907. author: authorIds,
  30908. postType,
  30909. sticky,
  30910. inherit,
  30911. taxQuery
  30912. } = query;
  30913. const [showSticky, setShowSticky] = (0,external_wp_element_namespaceObject.useState)(postType === 'post');
  30914. const {
  30915. postTypesTaxonomiesMap,
  30916. postTypesSelectOptions
  30917. } = usePostTypes();
  30918. (0,external_wp_element_namespaceObject.useEffect)(() => {
  30919. setShowSticky(postType === 'post');
  30920. }, [postType]);
  30921. const onPostTypeChange = newValue => {
  30922. const updateQuery = {
  30923. postType: newValue
  30924. }; // We need to dynamically update the `taxQuery` property,
  30925. // by removing any not supported taxonomy from the query.
  30926. const supportedTaxonomies = postTypesTaxonomiesMap[newValue];
  30927. const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, _ref2) => {
  30928. let [taxonomySlug, terms] = _ref2;
  30929. if (supportedTaxonomies.includes(taxonomySlug)) {
  30930. accumulator[taxonomySlug] = terms;
  30931. }
  30932. return accumulator;
  30933. }, {});
  30934. updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined;
  30935. if (newValue !== 'post') {
  30936. updateQuery.sticky = '';
  30937. }
  30938. setQuery(updateQuery);
  30939. };
  30940. const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search);
  30941. const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_lodash_namespaceObject.debounce)(() => {
  30942. if (query.search !== querySearch) {
  30943. setQuery({
  30944. search: querySearch
  30945. });
  30946. }
  30947. }, 250), [querySearch, query.search]);
  30948. (0,external_wp_element_namespaceObject.useEffect)(() => {
  30949. onChangeDebounced();
  30950. return onChangeDebounced.cancel;
  30951. }, [querySearch, onChangeDebounced]);
  30952. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  30953. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  30954. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  30955. label: (0,external_wp_i18n_namespaceObject.__)('Inherit query from template'),
  30956. help: (0,external_wp_i18n_namespaceObject.__)('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'),
  30957. checked: !!inherit,
  30958. onChange: value => setQuery({
  30959. inherit: !!value
  30960. })
  30961. }), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  30962. options: postTypesSelectOptions,
  30963. value: postType,
  30964. label: (0,external_wp_i18n_namespaceObject.__)('Post type'),
  30965. onChange: onPostTypeChange,
  30966. help: (0,external_wp_i18n_namespaceObject.__)('WordPress contains different types of content and they are divided into collections called "Post types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')
  30967. }), (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex' && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  30968. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  30969. value: displayLayout.columns,
  30970. onChange: value => setDisplayLayout({
  30971. columns: value
  30972. }),
  30973. min: 2,
  30974. max: Math.max(6, displayLayout.columns)
  30975. }), displayLayout.columns > 6 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
  30976. status: "warning",
  30977. isDismissible: false
  30978. }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), !inherit && (0,external_wp_element_namespaceObject.createElement)(order_control, {
  30979. order,
  30980. orderBy,
  30981. onChange: setQuery
  30982. }), showSticky && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  30983. label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
  30984. options: stickyOptions,
  30985. value: sticky,
  30986. onChange: value => setQuery({
  30987. sticky: value
  30988. }),
  30989. help: (0,external_wp_i18n_namespaceObject.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
  30990. })), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  30991. title: (0,external_wp_i18n_namespaceObject.__)('Filters')
  30992. }, (0,external_wp_element_namespaceObject.createElement)(taxonomy_controls, {
  30993. onChange: setQuery,
  30994. query: query
  30995. }), (0,external_wp_element_namespaceObject.createElement)(author_control, {
  30996. value: authorIds,
  30997. onChange: setQuery
  30998. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  30999. label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
  31000. value: querySearch,
  31001. onChange: setQuerySearch
  31002. })));
  31003. }
  31004. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
  31005. /**
  31006. * WordPress dependencies
  31007. */
  31008. function QueryPlaceholder(_ref) {
  31009. let {
  31010. clientId,
  31011. name,
  31012. setAttributes,
  31013. icon,
  31014. label
  31015. } = _ref;
  31016. const {
  31017. defaultVariation,
  31018. scopeVariations
  31019. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31020. const {
  31021. getBlockVariations,
  31022. getBlockType,
  31023. getDefaultBlockVariation
  31024. } = select(external_wp_blocks_namespaceObject.store);
  31025. return {
  31026. blockType: getBlockType(name),
  31027. defaultVariation: getDefaultBlockVariation(name, 'block'),
  31028. scopeVariations: getBlockVariations(name, 'block')
  31029. };
  31030. }, [name]);
  31031. const {
  31032. replaceInnerBlocks
  31033. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  31034. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31035. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
  31036. icon: icon,
  31037. label: label,
  31038. variations: scopeVariations,
  31039. onSelect: function () {
  31040. let nextVariation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultVariation;
  31041. if (nextVariation.attributes) {
  31042. setAttributes(nextVariation.attributes);
  31043. }
  31044. if (nextVariation.innerBlocks) {
  31045. replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), false);
  31046. }
  31047. }
  31048. }));
  31049. }
  31050. /* harmony default export */ var query_placeholder = (QueryPlaceholder);
  31051. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
  31052. /**
  31053. * WordPress dependencies
  31054. */
  31055. /**
  31056. * Internal dependencies
  31057. */
  31058. const query_edit_TEMPLATE = [['core/post-template']];
  31059. function QueryContent(_ref) {
  31060. let {
  31061. attributes,
  31062. setAttributes,
  31063. openPatternSelectionModal
  31064. } = _ref;
  31065. const {
  31066. queryId,
  31067. query,
  31068. displayLayout,
  31069. tagName: TagName = 'div',
  31070. layout = {}
  31071. } = attributes;
  31072. const {
  31073. __unstableMarkNextChangeAsNotPersistent
  31074. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  31075. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent);
  31076. const {
  31077. themeSupportsLayout
  31078. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31079. var _getSettings;
  31080. const {
  31081. getSettings
  31082. } = select(external_wp_blockEditor_namespaceObject.store);
  31083. return {
  31084. themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
  31085. };
  31086. }, []);
  31087. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  31088. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  31089. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31090. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31091. template: query_edit_TEMPLATE,
  31092. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  31093. });
  31094. const {
  31095. postsPerPage
  31096. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31097. const {
  31098. getSettings
  31099. } = select(external_wp_blockEditor_namespaceObject.store);
  31100. return {
  31101. postsPerPage: +getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE
  31102. };
  31103. }, []); // There are some effects running where some initialization logic is
  31104. // happening and setting some values to some attributes (ex. queryId).
  31105. // These updates can cause an `undo trap` where undoing will result in
  31106. // resetting again, so we need to mark these changes as not persistent
  31107. // with `__unstableMarkNextChangeAsNotPersistent`.
  31108. // Changes in query property (which is an object) need to be in the same callback,
  31109. // because updates are batched after the render and changes in different query properties
  31110. // would cause to override previous wanted changes.
  31111. (0,external_wp_element_namespaceObject.useEffect)(() => {
  31112. const newQuery = {};
  31113. if (!query.perPage && postsPerPage) {
  31114. newQuery.perPage = postsPerPage;
  31115. }
  31116. if (!!Object.keys(newQuery).length) {
  31117. __unstableMarkNextChangeAsNotPersistent();
  31118. updateQuery(newQuery);
  31119. }
  31120. }, [query.perPage]); // We need this for multi-query block pagination.
  31121. // Query parameters for each block are scoped to their ID.
  31122. (0,external_wp_element_namespaceObject.useEffect)(() => {
  31123. if (!Number.isFinite(queryId)) {
  31124. __unstableMarkNextChangeAsNotPersistent();
  31125. setAttributes({
  31126. queryId: instanceId
  31127. });
  31128. }
  31129. }, [queryId, instanceId]);
  31130. const updateQuery = newQuery => setAttributes({
  31131. query: { ...query,
  31132. ...newQuery
  31133. }
  31134. });
  31135. const updateDisplayLayout = newDisplayLayout => setAttributes({
  31136. displayLayout: { ...displayLayout,
  31137. ...newDisplayLayout
  31138. }
  31139. });
  31140. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(QueryInspectorControls, {
  31141. attributes: attributes,
  31142. setQuery: updateQuery,
  31143. setDisplayLayout: updateDisplayLayout
  31144. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(QueryToolbar, {
  31145. attributes: attributes,
  31146. setQuery: updateQuery,
  31147. setDisplayLayout: updateDisplayLayout,
  31148. openPatternSelectionModal: openPatternSelectionModal
  31149. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  31150. __experimentalGroup: "advanced"
  31151. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  31152. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  31153. options: [{
  31154. label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
  31155. value: 'div'
  31156. }, {
  31157. label: '<main>',
  31158. value: 'main'
  31159. }, {
  31160. label: '<section>',
  31161. value: 'section'
  31162. }, {
  31163. label: '<aside>',
  31164. value: 'aside'
  31165. }],
  31166. value: TagName,
  31167. onChange: value => setAttributes({
  31168. tagName: value
  31169. })
  31170. })), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
  31171. }
  31172. function QueryPatternSetup(_ref2) {
  31173. var _blockType$icon;
  31174. let {
  31175. attributes,
  31176. clientId,
  31177. name,
  31178. openPatternSelectionModal,
  31179. setAttributes
  31180. } = _ref2;
  31181. const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false);
  31182. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31183. const {
  31184. blockType,
  31185. allVariations,
  31186. hasPatterns
  31187. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31188. const {
  31189. getBlockVariations,
  31190. getBlockType
  31191. } = select(external_wp_blocks_namespaceObject.store);
  31192. const {
  31193. getBlockRootClientId,
  31194. __experimentalGetPatternsByBlockTypes
  31195. } = select(external_wp_blockEditor_namespaceObject.store);
  31196. const rootClientId = getBlockRootClientId(clientId);
  31197. return {
  31198. blockType: getBlockType(name),
  31199. allVariations: getBlockVariations(name),
  31200. hasPatterns: !!__experimentalGetPatternsByBlockTypes(name, rootClientId).length
  31201. };
  31202. }, [name, clientId]);
  31203. const matchingVariation = (0,external_wp_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
  31204. const icon = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.icon) || (blockType === null || blockType === void 0 ? void 0 : (_blockType$icon = blockType.icon) === null || _blockType$icon === void 0 ? void 0 : _blockType$icon.src);
  31205. const label = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title);
  31206. if (isStartingBlank) {
  31207. return (0,external_wp_element_namespaceObject.createElement)(query_placeholder, {
  31208. clientId: clientId,
  31209. name: name,
  31210. setAttributes: setAttributes,
  31211. icon: icon,
  31212. label: label
  31213. });
  31214. }
  31215. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  31216. icon: icon,
  31217. label: label,
  31218. instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.')
  31219. }, !!hasPatterns && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  31220. variant: "primary",
  31221. onClick: openPatternSelectionModal
  31222. }, (0,external_wp_i18n_namespaceObject.__)('Choose')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  31223. variant: "secondary",
  31224. onClick: () => {
  31225. setIsStartingBlank(true);
  31226. }
  31227. }, (0,external_wp_i18n_namespaceObject.__)('Start blank'))));
  31228. }
  31229. const QueryEdit = props => {
  31230. const {
  31231. clientId,
  31232. name
  31233. } = props;
  31234. const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
  31235. const {
  31236. replaceBlock,
  31237. selectBlock
  31238. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  31239. const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
  31240. const Component = hasInnerBlocks ? QueryContent : QueryPatternSetup;
  31241. const onBlockPatternSelect = blocks => {
  31242. const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
  31243. const firstQueryClientId = getFirstQueryClientIdFromBlocks(clonedBlocks);
  31244. replaceBlock(clientId, clonedBlocks);
  31245. if (firstQueryClientId) {
  31246. selectBlock(firstQueryClientId);
  31247. }
  31248. };
  31249. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Component, _extends({}, props, {
  31250. openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true)
  31251. })), isPatternSelectionModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  31252. className: "block-editor-query-pattern__selection-modal",
  31253. title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
  31254. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  31255. onRequestClose: () => setIsPatternSelectionModalOpen(false)
  31256. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternSetup, {
  31257. blockName: name,
  31258. clientId: clientId,
  31259. onBlockPatternSelect: onBlockPatternSelect
  31260. })));
  31261. };
  31262. /* harmony default export */ var query_edit = (QueryEdit);
  31263. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js
  31264. /**
  31265. * WordPress dependencies
  31266. */
  31267. function QuerySave(_ref) {
  31268. let {
  31269. attributes: {
  31270. tagName: Tag = 'div'
  31271. }
  31272. } = _ref;
  31273. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  31274. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  31275. return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  31276. }
  31277. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js
  31278. /**
  31279. * WordPress dependencies
  31280. */
  31281. const titleDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31282. xmlns: "http://www.w3.org/2000/svg",
  31283. viewBox: "0 0 48 48"
  31284. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31285. d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
  31286. }));
  31287. const titleExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31288. xmlns: "http://www.w3.org/2000/svg",
  31289. viewBox: "0 0 48 48"
  31290. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31291. d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
  31292. }));
  31293. const titleDateExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31294. xmlns: "http://www.w3.org/2000/svg",
  31295. viewBox: "0 0 48 48"
  31296. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31297. d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
  31298. }));
  31299. const imageDateTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  31300. xmlns: "http://www.w3.org/2000/svg",
  31301. viewBox: "0 0 48 48"
  31302. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  31303. d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
  31304. }));
  31305. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js
  31306. /**
  31307. * WordPress dependencies
  31308. */
  31309. /**
  31310. * Internal dependencies
  31311. */
  31312. const QUERY_DEFAULT_ATTRIBUTES = {
  31313. query: {
  31314. perPage: 3,
  31315. pages: 0,
  31316. offset: 0,
  31317. postType: 'post',
  31318. order: 'desc',
  31319. orderBy: 'date',
  31320. author: '',
  31321. search: '',
  31322. exclude: [],
  31323. sticky: '',
  31324. inherit: false
  31325. }
  31326. };
  31327. const query_variations_variations = [{
  31328. name: 'posts-list',
  31329. title: (0,external_wp_i18n_namespaceObject.__)('Posts List'),
  31330. description: (0,external_wp_i18n_namespaceObject.__)('Display a list of your most recent posts, excluding sticky posts.'),
  31331. icon: post_list,
  31332. attributes: {
  31333. query: {
  31334. perPage: 4,
  31335. pages: 1,
  31336. offset: 0,
  31337. postType: 'post',
  31338. order: 'desc',
  31339. orderBy: 'date',
  31340. author: '',
  31341. search: '',
  31342. sticky: 'exclude',
  31343. inherit: false
  31344. }
  31345. },
  31346. scope: ['inserter']
  31347. }, {
  31348. name: 'title-date',
  31349. title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'),
  31350. icon: titleDate,
  31351. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31352. },
  31353. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']],
  31354. scope: ['block']
  31355. }, {
  31356. name: 'title-excerpt',
  31357. title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'),
  31358. icon: titleExcerpt,
  31359. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31360. },
  31361. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
  31362. scope: ['block']
  31363. }, {
  31364. name: 'title-date-excerpt',
  31365. title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'),
  31366. icon: titleDateExcerpt,
  31367. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31368. },
  31369. innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']],
  31370. scope: ['block']
  31371. }, {
  31372. name: 'image-date-title',
  31373. title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'),
  31374. icon: imageDateTitle,
  31375. attributes: { ...QUERY_DEFAULT_ATTRIBUTES
  31376. },
  31377. innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']],
  31378. scope: ['block']
  31379. }];
  31380. /* harmony default export */ var query_variations = (query_variations_variations);
  31381. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
  31382. /**
  31383. * External dependencies
  31384. */
  31385. /**
  31386. * WordPress dependencies
  31387. */
  31388. const migrateToTaxQuery = attributes => {
  31389. var _query$categoryIds, _query$tagIds;
  31390. const {
  31391. query
  31392. } = attributes;
  31393. const newQuery = { ...(0,external_lodash_namespaceObject.omit)(query, ['categoryIds', 'tagIds'])
  31394. };
  31395. if ((_query$categoryIds = query.categoryIds) !== null && _query$categoryIds !== void 0 && _query$categoryIds.length || (_query$tagIds = query.tagIds) !== null && _query$tagIds !== void 0 && _query$tagIds.length) {
  31396. var _query$categoryIds2, _query$tagIds2;
  31397. newQuery.taxQuery = {
  31398. category: !!((_query$categoryIds2 = query.categoryIds) !== null && _query$categoryIds2 !== void 0 && _query$categoryIds2.length) ? query.categoryIds : undefined,
  31399. post_tag: !!((_query$tagIds2 = query.tagIds) !== null && _query$tagIds2 !== void 0 && _query$tagIds2.length) ? query.tagIds : undefined
  31400. };
  31401. }
  31402. return { ...attributes,
  31403. query: newQuery
  31404. };
  31405. };
  31406. const query_deprecated_deprecated = [// Version with `categoryIds and tagIds`.
  31407. {
  31408. attributes: {
  31409. queryId: {
  31410. type: 'number'
  31411. },
  31412. query: {
  31413. type: 'object',
  31414. default: {
  31415. perPage: null,
  31416. pages: 0,
  31417. offset: 0,
  31418. postType: 'post',
  31419. categoryIds: [],
  31420. tagIds: [],
  31421. order: 'desc',
  31422. orderBy: 'date',
  31423. author: '',
  31424. search: '',
  31425. exclude: [],
  31426. sticky: '',
  31427. inherit: true
  31428. }
  31429. },
  31430. tagName: {
  31431. type: 'string',
  31432. default: 'div'
  31433. },
  31434. displayLayout: {
  31435. type: 'object',
  31436. default: {
  31437. type: 'list'
  31438. }
  31439. }
  31440. },
  31441. supports: {
  31442. align: ['wide', 'full'],
  31443. html: false,
  31444. color: {
  31445. gradients: true,
  31446. link: true
  31447. },
  31448. __experimentalLayout: true
  31449. },
  31450. isEligible: _ref => {
  31451. let {
  31452. query: {
  31453. categoryIds,
  31454. tagIds
  31455. } = {}
  31456. } = _ref;
  31457. return categoryIds || tagIds;
  31458. },
  31459. migrate: migrateToTaxQuery,
  31460. save(_ref2) {
  31461. let {
  31462. attributes: {
  31463. tagName: Tag = 'div'
  31464. }
  31465. } = _ref2;
  31466. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
  31467. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  31468. return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
  31469. }
  31470. }, // Version with NO wrapper `div` element.
  31471. {
  31472. attributes: {
  31473. queryId: {
  31474. type: 'number'
  31475. },
  31476. query: {
  31477. type: 'object',
  31478. default: {
  31479. perPage: null,
  31480. pages: 0,
  31481. offset: 0,
  31482. postType: 'post',
  31483. categoryIds: [],
  31484. tagIds: [],
  31485. order: 'desc',
  31486. orderBy: 'date',
  31487. author: '',
  31488. search: '',
  31489. exclude: [],
  31490. sticky: '',
  31491. inherit: true
  31492. }
  31493. },
  31494. layout: {
  31495. type: 'object',
  31496. default: {
  31497. type: 'list'
  31498. }
  31499. }
  31500. },
  31501. supports: {
  31502. html: false
  31503. },
  31504. migrate(attributes) {
  31505. const withTaxQuery = migrateToTaxQuery(attributes);
  31506. return { ...(0,external_lodash_namespaceObject.omit)(withTaxQuery, ['layout']),
  31507. displayLayout: withTaxQuery.layout
  31508. };
  31509. },
  31510. save() {
  31511. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  31512. }
  31513. }];
  31514. /* harmony default export */ var query_deprecated = (query_deprecated_deprecated);
  31515. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/hooks.js
  31516. /**
  31517. * WordPress dependencies
  31518. */
  31519. const CreateNewPostLink = _ref => {
  31520. let {
  31521. attributes: {
  31522. query: {
  31523. postType
  31524. } = {}
  31525. } = {}
  31526. } = _ref;
  31527. if (!postType) return null;
  31528. const newPostUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
  31529. post_type: postType
  31530. });
  31531. return (0,external_wp_element_namespaceObject.createElement)("div", {
  31532. className: "wp-block-query__create-new-link"
  31533. }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<a>Create a new post</a> for this feed.'), // eslint-disable-next-line jsx-a11y/anchor-has-content
  31534. {
  31535. a: (0,external_wp_element_namespaceObject.createElement)("a", {
  31536. href: newPostUrl
  31537. })
  31538. }));
  31539. };
  31540. /**
  31541. * Override the default edit UI to include layout controls
  31542. *
  31543. * @param {Function} BlockEdit Original component
  31544. * @return {Function} Wrapped component
  31545. */
  31546. const queryTopInspectorControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
  31547. const {
  31548. name,
  31549. isSelected
  31550. } = props;
  31551. if (name !== 'core/query' || !isSelected) {
  31552. return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
  31553. key: "edit"
  31554. }, props));
  31555. }
  31556. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(CreateNewPostLink, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
  31557. key: "edit"
  31558. }, props)));
  31559. }, 'withInspectorControls');
  31560. /* harmony default export */ var query_hooks = (queryTopInspectorControls);
  31561. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js
  31562. /**
  31563. * WordPress dependencies
  31564. */
  31565. /**
  31566. * Internal dependencies
  31567. */
  31568. const query_metadata = {
  31569. $schema: "https://schemas.wp.org/trunk/block.json",
  31570. apiVersion: 2,
  31571. name: "core/query",
  31572. title: "Query Loop",
  31573. category: "theme",
  31574. description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
  31575. textdomain: "default",
  31576. attributes: {
  31577. queryId: {
  31578. type: "number"
  31579. },
  31580. query: {
  31581. type: "object",
  31582. "default": {
  31583. perPage: null,
  31584. pages: 0,
  31585. offset: 0,
  31586. postType: "post",
  31587. order: "desc",
  31588. orderBy: "date",
  31589. author: "",
  31590. search: "",
  31591. exclude: [],
  31592. sticky: "",
  31593. inherit: true,
  31594. taxQuery: null
  31595. }
  31596. },
  31597. tagName: {
  31598. type: "string",
  31599. "default": "div"
  31600. },
  31601. displayLayout: {
  31602. type: "object",
  31603. "default": {
  31604. type: "list"
  31605. }
  31606. }
  31607. },
  31608. providesContext: {
  31609. queryId: "queryId",
  31610. query: "query",
  31611. displayLayout: "displayLayout"
  31612. },
  31613. supports: {
  31614. align: ["wide", "full"],
  31615. html: false,
  31616. color: {
  31617. gradients: true,
  31618. link: true,
  31619. __experimentalDefaultControls: {
  31620. background: true,
  31621. text: true
  31622. }
  31623. },
  31624. __experimentalLayout: true
  31625. },
  31626. editorStyle: "wp-block-query-editor"
  31627. };
  31628. const {
  31629. name: query_name
  31630. } = query_metadata;
  31631. const query_settings = {
  31632. icon: library_loop,
  31633. edit: query_edit,
  31634. save: QuerySave,
  31635. variations: query_variations,
  31636. deprecated: query_deprecated
  31637. }; // Importing this file includes side effects and is whitelisted
  31638. // in block-library/package.json under `sideEffects`.
  31639. (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/query', query_hooks);
  31640. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js
  31641. /**
  31642. * WordPress dependencies
  31643. */
  31644. const query_no_results_edit_TEMPLATE = [['core/paragraph', {
  31645. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when the query returns no results.')
  31646. }]];
  31647. function QueryNoResultsEdit() {
  31648. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31649. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31650. template: query_no_results_edit_TEMPLATE
  31651. });
  31652. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
  31653. }
  31654. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js
  31655. /**
  31656. * WordPress dependencies
  31657. */
  31658. function QueryNoResultsSave() {
  31659. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  31660. }
  31661. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
  31662. /**
  31663. * WordPress dependencies
  31664. */
  31665. /**
  31666. * Internal dependencies
  31667. */
  31668. const query_no_results_metadata = {
  31669. $schema: "https://schemas.wp.org/trunk/block.json",
  31670. apiVersion: 2,
  31671. name: "core/query-no-results",
  31672. title: "No results",
  31673. category: "theme",
  31674. description: "Contains the block elements used to render content when no query results are found.",
  31675. parent: ["core/query"],
  31676. textdomain: "default",
  31677. usesContext: ["queryId", "query"],
  31678. supports: {
  31679. align: true,
  31680. reusable: false,
  31681. html: false,
  31682. color: {
  31683. gradients: true,
  31684. link: true
  31685. }
  31686. }
  31687. };
  31688. const {
  31689. name: query_no_results_name
  31690. } = query_no_results_metadata;
  31691. const query_no_results_settings = {
  31692. icon: library_loop,
  31693. edit: QueryNoResultsEdit,
  31694. save: QueryNoResultsSave
  31695. };
  31696. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
  31697. /**
  31698. * WordPress dependencies
  31699. */
  31700. function QueryPaginationArrowControls(_ref) {
  31701. let {
  31702. value,
  31703. onChange
  31704. } = _ref;
  31705. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
  31706. label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
  31707. value: value,
  31708. onChange: onChange,
  31709. help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'),
  31710. isBlock: true
  31711. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  31712. value: "none",
  31713. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks')
  31714. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  31715. value: "arrow",
  31716. label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
  31717. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
  31718. value: "chevron",
  31719. label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
  31720. }));
  31721. }
  31722. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
  31723. /**
  31724. * WordPress dependencies
  31725. */
  31726. /**
  31727. * Internal dependencies
  31728. */
  31729. const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
  31730. const edit_getDefaultBlockLayout = blockTypeOrName => {
  31731. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  31732. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  31733. };
  31734. function edit_QueryPaginationEdit(_ref) {
  31735. let {
  31736. attributes: {
  31737. paginationArrow,
  31738. layout
  31739. },
  31740. setAttributes,
  31741. clientId,
  31742. name
  31743. } = _ref;
  31744. const usedLayout = layout || edit_getDefaultBlockLayout(name);
  31745. const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
  31746. const {
  31747. getBlocks
  31748. } = select(external_wp_blockEditor_namespaceObject.store);
  31749. const innerBlocks = getBlocks(clientId);
  31750. /**
  31751. * Show the `paginationArrow` control only if a
  31752. * `QueryPaginationNext/Previous` block exists.
  31753. */
  31754. return innerBlocks === null || innerBlocks === void 0 ? void 0 : innerBlocks.find(innerBlock => {
  31755. return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name);
  31756. });
  31757. }, []);
  31758. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  31759. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  31760. template: query_pagination_edit_TEMPLATE,
  31761. allowedBlocks: ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'],
  31762. __experimentalLayout: usedLayout
  31763. });
  31764. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  31765. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  31766. }, (0,external_wp_element_namespaceObject.createElement)(QueryPaginationArrowControls, {
  31767. value: paginationArrow,
  31768. onChange: value => {
  31769. setAttributes({
  31770. paginationArrow: value
  31771. });
  31772. }
  31773. }))), (0,external_wp_element_namespaceObject.createElement)("nav", innerBlocksProps));
  31774. }
  31775. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
  31776. /**
  31777. * WordPress dependencies
  31778. */
  31779. function query_pagination_save_save() {
  31780. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
  31781. }
  31782. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
  31783. /**
  31784. * WordPress dependencies
  31785. */
  31786. const query_pagination_deprecated_deprecated = [// Version with wrapper `div` element.
  31787. {
  31788. save() {
  31789. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  31790. }
  31791. }];
  31792. /* harmony default export */ var query_pagination_deprecated = (query_pagination_deprecated_deprecated);
  31793. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
  31794. /**
  31795. * WordPress dependencies
  31796. */
  31797. /**
  31798. * Internal dependencies
  31799. */
  31800. const query_pagination_metadata = {
  31801. $schema: "https://schemas.wp.org/trunk/block.json",
  31802. apiVersion: 2,
  31803. name: "core/query-pagination",
  31804. title: "Pagination",
  31805. category: "theme",
  31806. parent: ["core/query"],
  31807. description: "Displays a paginated navigation to next/previous set of posts, when applicable.",
  31808. textdomain: "default",
  31809. attributes: {
  31810. paginationArrow: {
  31811. type: "string",
  31812. "default": "none"
  31813. }
  31814. },
  31815. usesContext: ["queryId", "query"],
  31816. providesContext: {
  31817. paginationArrow: "paginationArrow"
  31818. },
  31819. supports: {
  31820. align: true,
  31821. reusable: false,
  31822. html: false,
  31823. color: {
  31824. gradients: true,
  31825. link: true,
  31826. __experimentalDefaultControls: {
  31827. background: true,
  31828. text: true,
  31829. link: true
  31830. }
  31831. },
  31832. __experimentalLayout: {
  31833. allowSwitching: false,
  31834. allowInheriting: false,
  31835. "default": {
  31836. type: "flex"
  31837. }
  31838. }
  31839. },
  31840. editorStyle: "wp-block-query-pagination-editor",
  31841. style: "wp-block-query-pagination"
  31842. };
  31843. const {
  31844. name: query_pagination_name
  31845. } = query_pagination_metadata;
  31846. const query_pagination_settings = {
  31847. icon: query_pagination,
  31848. edit: edit_QueryPaginationEdit,
  31849. save: query_pagination_save_save,
  31850. deprecated: query_pagination_deprecated
  31851. };
  31852. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
  31853. /**
  31854. * WordPress dependencies
  31855. */
  31856. const query_pagination_next_edit_arrowMap = {
  31857. none: '',
  31858. arrow: '→',
  31859. chevron: '»'
  31860. };
  31861. function QueryPaginationNextEdit(_ref) {
  31862. let {
  31863. attributes: {
  31864. label
  31865. },
  31866. setAttributes,
  31867. context: {
  31868. paginationArrow
  31869. }
  31870. } = _ref;
  31871. const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow];
  31872. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  31873. href: "#pagination-next-pseudo-link",
  31874. onClick: event => event.preventDefault()
  31875. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  31876. __experimentalVersion: 2,
  31877. tagName: "span",
  31878. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'),
  31879. placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'),
  31880. value: label,
  31881. onChange: newLabel => setAttributes({
  31882. label: newLabel
  31883. })
  31884. }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  31885. className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`
  31886. }, displayArrow));
  31887. }
  31888. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
  31889. /**
  31890. * WordPress dependencies
  31891. */
  31892. /**
  31893. * Internal dependencies
  31894. */
  31895. const query_pagination_next_metadata = {
  31896. $schema: "https://schemas.wp.org/trunk/block.json",
  31897. apiVersion: 2,
  31898. name: "core/query-pagination-next",
  31899. title: "Next Page",
  31900. category: "theme",
  31901. parent: ["core/query-pagination"],
  31902. description: "Displays the next posts page link.",
  31903. textdomain: "default",
  31904. attributes: {
  31905. label: {
  31906. type: "string"
  31907. }
  31908. },
  31909. usesContext: ["queryId", "query", "paginationArrow"],
  31910. supports: {
  31911. reusable: false,
  31912. html: false,
  31913. color: {
  31914. gradients: true,
  31915. text: false,
  31916. __experimentalDefaultControls: {
  31917. background: true
  31918. }
  31919. },
  31920. typography: {
  31921. fontSize: true,
  31922. lineHeight: true,
  31923. __experimentalFontStyle: true,
  31924. __experimentalFontWeight: true,
  31925. __experimentalLetterSpacing: true,
  31926. __experimentalTextTransform: true,
  31927. __experimentalDefaultControls: {
  31928. fontSize: true
  31929. }
  31930. }
  31931. }
  31932. };
  31933. const {
  31934. name: query_pagination_next_name
  31935. } = query_pagination_next_metadata;
  31936. const query_pagination_next_settings = {
  31937. icon: query_pagination_next,
  31938. edit: QueryPaginationNextEdit
  31939. };
  31940. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
  31941. /**
  31942. * WordPress dependencies
  31943. */
  31944. const createPaginationItem = function (content) {
  31945. let Tag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'a';
  31946. let extraClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  31947. return (0,external_wp_element_namespaceObject.createElement)(Tag, {
  31948. className: `page-numbers ${extraClass}`
  31949. }, content);
  31950. };
  31951. const previewPaginationNumbers = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
  31952. function QueryPaginationNumbersEdit() {
  31953. const paginationNumbers = previewPaginationNumbers();
  31954. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), paginationNumbers);
  31955. }
  31956. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
  31957. /**
  31958. * WordPress dependencies
  31959. */
  31960. /**
  31961. * Internal dependencies
  31962. */
  31963. const query_pagination_numbers_metadata = {
  31964. $schema: "https://schemas.wp.org/trunk/block.json",
  31965. apiVersion: 2,
  31966. name: "core/query-pagination-numbers",
  31967. title: "Page Numbers",
  31968. category: "theme",
  31969. parent: ["core/query-pagination"],
  31970. description: "Displays a list of page numbers for pagination",
  31971. textdomain: "default",
  31972. usesContext: ["queryId", "query"],
  31973. supports: {
  31974. reusable: false,
  31975. html: false,
  31976. color: {
  31977. gradients: true,
  31978. text: false,
  31979. __experimentalDefaultControls: {
  31980. background: true
  31981. }
  31982. },
  31983. typography: {
  31984. fontSize: true,
  31985. lineHeight: true,
  31986. __experimentalFontStyle: true,
  31987. __experimentalFontWeight: true,
  31988. __experimentalLetterSpacing: true,
  31989. __experimentalTextTransform: true,
  31990. __experimentalDefaultControls: {
  31991. fontSize: true
  31992. }
  31993. }
  31994. },
  31995. editorStyle: "query-pagination-numbers-editor"
  31996. };
  31997. const {
  31998. name: query_pagination_numbers_name
  31999. } = query_pagination_numbers_metadata;
  32000. const query_pagination_numbers_settings = {
  32001. icon: query_pagination_numbers,
  32002. edit: QueryPaginationNumbersEdit
  32003. };
  32004. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
  32005. /**
  32006. * WordPress dependencies
  32007. */
  32008. const query_pagination_previous_edit_arrowMap = {
  32009. none: '',
  32010. arrow: '←',
  32011. chevron: '«'
  32012. };
  32013. function QueryPaginationPreviousEdit(_ref) {
  32014. let {
  32015. attributes: {
  32016. label
  32017. },
  32018. setAttributes,
  32019. context: {
  32020. paginationArrow
  32021. }
  32022. } = _ref;
  32023. const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow];
  32024. return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
  32025. href: "#pagination-previous-pseudo-link",
  32026. onClick: event => event.preventDefault()
  32027. }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
  32028. className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`
  32029. }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  32030. __experimentalVersion: 2,
  32031. tagName: "span",
  32032. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'),
  32033. placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'),
  32034. value: label,
  32035. onChange: newLabel => setAttributes({
  32036. label: newLabel
  32037. })
  32038. }));
  32039. }
  32040. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
  32041. /**
  32042. * WordPress dependencies
  32043. */
  32044. /**
  32045. * Internal dependencies
  32046. */
  32047. const query_pagination_previous_metadata = {
  32048. $schema: "https://schemas.wp.org/trunk/block.json",
  32049. apiVersion: 2,
  32050. name: "core/query-pagination-previous",
  32051. title: "Previous Page",
  32052. category: "theme",
  32053. parent: ["core/query-pagination"],
  32054. description: "Displays the previous posts page link.",
  32055. textdomain: "default",
  32056. attributes: {
  32057. label: {
  32058. type: "string"
  32059. }
  32060. },
  32061. usesContext: ["queryId", "query", "paginationArrow"],
  32062. supports: {
  32063. reusable: false,
  32064. html: false,
  32065. color: {
  32066. gradients: true,
  32067. text: false,
  32068. __experimentalDefaultControls: {
  32069. background: true
  32070. }
  32071. },
  32072. typography: {
  32073. fontSize: true,
  32074. lineHeight: true,
  32075. __experimentalFontStyle: true,
  32076. __experimentalFontWeight: true,
  32077. __experimentalLetterSpacing: true,
  32078. __experimentalTextTransform: true,
  32079. __experimentalDefaultControls: {
  32080. fontSize: true
  32081. }
  32082. }
  32083. }
  32084. };
  32085. const {
  32086. name: query_pagination_previous_name
  32087. } = query_pagination_previous_metadata;
  32088. const query_pagination_previous_settings = {
  32089. icon: query_pagination_previous,
  32090. edit: QueryPaginationPreviousEdit
  32091. };
  32092. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
  32093. /**
  32094. * External dependencies
  32095. */
  32096. /**
  32097. * WordPress dependencies
  32098. */
  32099. /**
  32100. * Internal dependencies
  32101. */
  32102. const SUPPORTED_TYPES = ['archive'];
  32103. function QueryTitleEdit(_ref) {
  32104. let {
  32105. attributes: {
  32106. type,
  32107. level,
  32108. textAlign
  32109. },
  32110. setAttributes
  32111. } = _ref;
  32112. const TagName = `h${level}`;
  32113. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32114. className: classnames_default()({
  32115. [`has-text-align-${textAlign}`]: textAlign,
  32116. 'wp-block-query-title__placeholder': type === 'archive'
  32117. })
  32118. }); // The plan is to augment this block with more
  32119. // block variations like `Search Title`.
  32120. if (!SUPPORTED_TYPES.includes(type)) {
  32121. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.')));
  32122. }
  32123. let titleElement;
  32124. if (type === 'archive') {
  32125. titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Archive title'));
  32126. }
  32127. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32128. group: "block"
  32129. }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
  32130. selectedLevel: level,
  32131. onChange: newLevel => setAttributes({
  32132. level: newLevel
  32133. })
  32134. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32135. value: textAlign,
  32136. onChange: nextAlign => {
  32137. setAttributes({
  32138. textAlign: nextAlign
  32139. });
  32140. }
  32141. })), titleElement);
  32142. }
  32143. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive-title.js
  32144. /**
  32145. * WordPress dependencies
  32146. */
  32147. const archiveTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32148. viewBox: "0 0 24 24",
  32149. xmlns: "http://www.w3.org/2000/svg"
  32150. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32151. d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM20 16H4v-1.5h16V16Zm-7 4H4v-1.5h9V20Z"
  32152. }));
  32153. /* harmony default export */ var archive_title = (archiveTitle);
  32154. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
  32155. /**
  32156. * WordPress dependencies
  32157. */
  32158. const query_title_variations_variations = [{
  32159. isDefault: true,
  32160. name: 'archive-title',
  32161. title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'),
  32162. description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'),
  32163. icon: archive_title,
  32164. attributes: {
  32165. type: 'archive'
  32166. },
  32167. scope: ['inserter']
  32168. }];
  32169. /**
  32170. * Add `isActive` function to all `query-title` variations, if not defined.
  32171. * `isActive` function is used to find a variation match from a created
  32172. * Block by providing its attributes.
  32173. */
  32174. query_title_variations_variations.forEach(variation => {
  32175. if (variation.isActive) return;
  32176. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
  32177. });
  32178. /* harmony default export */ var query_title_variations = (query_title_variations_variations);
  32179. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
  32180. /**
  32181. * Internal dependencies
  32182. */
  32183. const query_title_deprecated_v1 = {
  32184. attributes: {
  32185. type: {
  32186. type: 'string'
  32187. },
  32188. textAlign: {
  32189. type: 'string'
  32190. },
  32191. level: {
  32192. type: 'number',
  32193. default: 1
  32194. }
  32195. },
  32196. supports: {
  32197. align: ['wide', 'full'],
  32198. html: false,
  32199. color: {
  32200. gradients: true
  32201. },
  32202. spacing: {
  32203. margin: true
  32204. },
  32205. typography: {
  32206. fontSize: true,
  32207. lineHeight: true,
  32208. __experimentalFontFamily: true
  32209. }
  32210. },
  32211. save() {
  32212. return null;
  32213. },
  32214. migrate: migrate_font_family,
  32215. isEligible(_ref) {
  32216. var _style$typography;
  32217. let {
  32218. style
  32219. } = _ref;
  32220. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  32221. }
  32222. };
  32223. /**
  32224. * New deprecations need to be placed first
  32225. * for them to have higher priority.
  32226. *
  32227. * Old deprecations may need to be updated as well.
  32228. *
  32229. * See block-deprecation.md
  32230. */
  32231. /* harmony default export */ var query_title_deprecated = ([query_title_deprecated_v1]);
  32232. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-title.js
  32233. /**
  32234. * WordPress dependencies
  32235. */
  32236. const queryTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32237. viewBox: "0 0 24 24",
  32238. xmlns: "http://www.w3.org/2000/svg"
  32239. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32240. d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm1.3-2.9c.6.3 1.3.5 2 .5.8 0 1.4-.2 2-.5.1 0 .1-.1.2-.2l.8.7.9-1-.8-.7.3-.3a5.09 5.09 0 0 0 0-4.4c-.2-.6-.7-1-1.3-1.4-.6-.3-1.3-.5-2-.5-.8 0-1.4.2-2 .5-.7.4-1.1.8-1.5 1.5-.3.6-.5 1.3-.5 2.2 0 .8.2 1.6.5 2.2.4.6.8 1.1 1.4 1.4zm-.1-5c.2-.4.5-.7.8-1s.8-.4 1.3-.4 1 .1 1.3.4.6.6.8 1c.3.4.4.8.4 1.4 0 .5-.1 1-.3 1.4v.1l-1-.9-.9 1 .9.9c-.3.2-.7.3-1.2.3s-1-.1-1.3-.4c-.4-.2-.6-.6-.8-1C5 9 4.9 8.5 4.9 8c0-.6.1-1 .3-1.4z"
  32241. }));
  32242. /* harmony default export */ var query_title = (queryTitle);
  32243. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
  32244. /**
  32245. * Internal dependencies
  32246. */
  32247. const query_title_metadata = {
  32248. $schema: "https://schemas.wp.org/trunk/block.json",
  32249. apiVersion: 2,
  32250. name: "core/query-title",
  32251. title: "Query Title",
  32252. category: "theme",
  32253. description: "Display the query title.",
  32254. textdomain: "default",
  32255. attributes: {
  32256. type: {
  32257. type: "string"
  32258. },
  32259. textAlign: {
  32260. type: "string"
  32261. },
  32262. level: {
  32263. type: "number",
  32264. "default": 1
  32265. }
  32266. },
  32267. supports: {
  32268. align: ["wide", "full"],
  32269. html: false,
  32270. color: {
  32271. gradients: true,
  32272. __experimentalDefaultControls: {
  32273. background: true,
  32274. text: true
  32275. }
  32276. },
  32277. spacing: {
  32278. margin: true
  32279. },
  32280. typography: {
  32281. fontSize: true,
  32282. lineHeight: true,
  32283. __experimentalFontFamily: true,
  32284. __experimentalFontStyle: true,
  32285. __experimentalFontWeight: true,
  32286. __experimentalLetterSpacing: true,
  32287. __experimentalTextTransform: true,
  32288. __experimentalDefaultControls: {
  32289. fontSize: true,
  32290. fontAppearance: true,
  32291. textTransform: true
  32292. }
  32293. }
  32294. },
  32295. editorStyle: "wp-block-query-title-editor"
  32296. };
  32297. /**
  32298. * WordPress dependencies
  32299. */
  32300. const {
  32301. name: query_title_name
  32302. } = query_title_metadata;
  32303. const query_title_settings = {
  32304. icon: query_title,
  32305. edit: QueryTitleEdit,
  32306. variations: query_title_variations,
  32307. deprecated: query_title_deprecated
  32308. };
  32309. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js
  32310. /**
  32311. * WordPress dependencies
  32312. */
  32313. const quote = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32314. viewBox: "0 0 24 24",
  32315. xmlns: "http://www.w3.org/2000/svg"
  32316. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32317. d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"
  32318. }));
  32319. /* harmony default export */ var library_quote = (quote);
  32320. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
  32321. /**
  32322. * External dependencies
  32323. */
  32324. /**
  32325. * WordPress dependencies
  32326. */
  32327. const quote_deprecated_blockAttributes = {
  32328. value: {
  32329. type: 'string',
  32330. source: 'html',
  32331. selector: 'blockquote',
  32332. multiline: 'p',
  32333. default: ''
  32334. },
  32335. citation: {
  32336. type: 'string',
  32337. source: 'html',
  32338. selector: 'cite',
  32339. default: ''
  32340. },
  32341. align: {
  32342. type: 'string'
  32343. }
  32344. };
  32345. const quote_deprecated_deprecated = [{
  32346. attributes: quote_deprecated_blockAttributes,
  32347. save(_ref) {
  32348. let {
  32349. attributes
  32350. } = _ref;
  32351. const {
  32352. align,
  32353. value,
  32354. citation
  32355. } = attributes;
  32356. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  32357. style: {
  32358. textAlign: align ? align : null
  32359. }
  32360. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32361. multiline: true,
  32362. value: value
  32363. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32364. tagName: "cite",
  32365. value: citation
  32366. }));
  32367. }
  32368. }, {
  32369. attributes: { ...quote_deprecated_blockAttributes,
  32370. style: {
  32371. type: 'number',
  32372. default: 1
  32373. }
  32374. },
  32375. migrate(attributes) {
  32376. if (attributes.style === 2) {
  32377. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style']),
  32378. className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
  32379. };
  32380. }
  32381. return attributes;
  32382. },
  32383. save(_ref2) {
  32384. let {
  32385. attributes
  32386. } = _ref2;
  32387. const {
  32388. align,
  32389. value,
  32390. citation,
  32391. style
  32392. } = attributes;
  32393. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  32394. className: style === 2 ? 'is-large' : '',
  32395. style: {
  32396. textAlign: align ? align : null
  32397. }
  32398. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32399. multiline: true,
  32400. value: value
  32401. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32402. tagName: "cite",
  32403. value: citation
  32404. }));
  32405. }
  32406. }, {
  32407. attributes: { ...quote_deprecated_blockAttributes,
  32408. citation: {
  32409. type: 'string',
  32410. source: 'html',
  32411. selector: 'footer',
  32412. default: ''
  32413. },
  32414. style: {
  32415. type: 'number',
  32416. default: 1
  32417. }
  32418. },
  32419. migrate(attributes) {
  32420. if (!isNaN(parseInt(attributes.style))) {
  32421. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style'])
  32422. };
  32423. }
  32424. return attributes;
  32425. },
  32426. save(_ref3) {
  32427. let {
  32428. attributes
  32429. } = _ref3;
  32430. const {
  32431. align,
  32432. value,
  32433. citation,
  32434. style
  32435. } = attributes;
  32436. return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
  32437. className: `blocks-quote-style-${style}`,
  32438. style: {
  32439. textAlign: align ? align : null
  32440. }
  32441. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32442. multiline: true,
  32443. value: value
  32444. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32445. tagName: "footer",
  32446. value: citation
  32447. }));
  32448. }
  32449. }];
  32450. /* harmony default export */ var quote_deprecated = (quote_deprecated_deprecated);
  32451. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js
  32452. /**
  32453. * External dependencies
  32454. */
  32455. /**
  32456. * WordPress dependencies
  32457. */
  32458. const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
  32459. function QuoteEdit(_ref) {
  32460. let {
  32461. attributes,
  32462. setAttributes,
  32463. isSelected,
  32464. mergeBlocks,
  32465. onReplace,
  32466. className,
  32467. insertBlocksAfter,
  32468. style
  32469. } = _ref;
  32470. const {
  32471. align,
  32472. value,
  32473. citation
  32474. } = attributes;
  32475. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  32476. className: classnames_default()(className, {
  32477. [`has-text-align-${align}`]: align
  32478. }),
  32479. style
  32480. });
  32481. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  32482. group: "block"
  32483. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  32484. value: align,
  32485. onChange: nextAlign => {
  32486. setAttributes({
  32487. align: nextAlign
  32488. });
  32489. }
  32490. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BlockQuotation, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  32491. identifier: "value",
  32492. multiline: true,
  32493. value: value,
  32494. onChange: nextValue => setAttributes({
  32495. value: nextValue
  32496. }),
  32497. onMerge: mergeBlocks,
  32498. onRemove: forward => {
  32499. const hasEmptyCitation = !citation || citation.length === 0;
  32500. if (!forward && hasEmptyCitation) {
  32501. onReplace([]);
  32502. }
  32503. },
  32504. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote text'),
  32505. placeholder: // translators: placeholder text used for the quote
  32506. (0,external_wp_i18n_namespaceObject.__)('Add quote'),
  32507. onReplace: onReplace,
  32508. onSplit: piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attributes,
  32509. value: piece
  32510. }),
  32511. __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
  32512. textAlign: align
  32513. }), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  32514. identifier: "citation",
  32515. tagName: edit_isWebPlatform ? 'cite' : undefined,
  32516. style: {
  32517. display: 'block'
  32518. },
  32519. value: citation,
  32520. onChange: nextCitation => setAttributes({
  32521. citation: nextCitation
  32522. }),
  32523. __unstableMobileNoFocusOnMount: true,
  32524. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote citation text'),
  32525. placeholder: // translators: placeholder text used for the citation
  32526. (0,external_wp_i18n_namespaceObject.__)('Add citation'),
  32527. className: "wp-block-quote__citation",
  32528. textAlign: align,
  32529. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  32530. })));
  32531. }
  32532. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js
  32533. /**
  32534. * External dependencies
  32535. */
  32536. /**
  32537. * WordPress dependencies
  32538. */
  32539. function quote_save_save(_ref) {
  32540. let {
  32541. attributes
  32542. } = _ref;
  32543. const {
  32544. align,
  32545. value,
  32546. citation
  32547. } = attributes;
  32548. const className = classnames_default()({
  32549. [`has-text-align-${align}`]: align
  32550. });
  32551. return (0,external_wp_element_namespaceObject.createElement)("blockquote", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  32552. className
  32553. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32554. multiline: true,
  32555. value: value
  32556. }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  32557. tagName: "cite",
  32558. value: citation
  32559. }));
  32560. }
  32561. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
  32562. /**
  32563. * WordPress dependencies
  32564. */
  32565. const quote_transforms_transforms = {
  32566. from: [{
  32567. type: 'block',
  32568. isMultiBlock: true,
  32569. blocks: ['core/paragraph'],
  32570. transform: attributes => {
  32571. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32572. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32573. value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
  32574. let {
  32575. content
  32576. } = _ref;
  32577. return (0,external_wp_richText_namespaceObject.create)({
  32578. html: content
  32579. });
  32580. }), '\u2028'),
  32581. multilineTag: 'p'
  32582. }),
  32583. anchor: attributes.anchor
  32584. });
  32585. }
  32586. }, {
  32587. type: 'block',
  32588. blocks: ['core/heading'],
  32589. transform: _ref2 => {
  32590. let {
  32591. content,
  32592. anchor
  32593. } = _ref2;
  32594. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32595. value: `<p>${content}</p>`,
  32596. anchor
  32597. });
  32598. }
  32599. }, {
  32600. type: 'block',
  32601. blocks: ['core/pullquote'],
  32602. transform: _ref3 => {
  32603. let {
  32604. value,
  32605. citation,
  32606. anchor
  32607. } = _ref3;
  32608. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32609. value,
  32610. citation,
  32611. anchor
  32612. });
  32613. }
  32614. }, {
  32615. type: 'prefix',
  32616. prefix: '>',
  32617. transform: content => {
  32618. return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
  32619. value: `<p>${content}</p>`
  32620. });
  32621. }
  32622. }, {
  32623. type: 'raw',
  32624. isMatch: node => {
  32625. const isParagraphOrSingleCite = (() => {
  32626. let hasCitation = false;
  32627. return child => {
  32628. // Child is a paragraph.
  32629. if (child.nodeName === 'P') {
  32630. return true;
  32631. } // Child is a cite and no other cite child exists before it.
  32632. if (!hasCitation && child.nodeName === 'CITE') {
  32633. hasCitation = true;
  32634. return true;
  32635. }
  32636. };
  32637. })();
  32638. return node.nodeName === 'BLOCKQUOTE' && // The quote block can only handle multiline paragraph
  32639. // content with an optional cite child.
  32640. Array.from(node.childNodes).every(isParagraphOrSingleCite);
  32641. },
  32642. schema: _ref4 => {
  32643. let {
  32644. phrasingContentSchema
  32645. } = _ref4;
  32646. return {
  32647. blockquote: {
  32648. children: {
  32649. p: {
  32650. children: phrasingContentSchema
  32651. },
  32652. cite: {
  32653. children: phrasingContentSchema
  32654. }
  32655. }
  32656. }
  32657. };
  32658. }
  32659. }],
  32660. to: [{
  32661. type: 'block',
  32662. blocks: ['core/paragraph'],
  32663. transform: _ref5 => {
  32664. let {
  32665. value,
  32666. citation
  32667. } = _ref5;
  32668. const paragraphs = [];
  32669. if (value && value !== '<p></p>') {
  32670. paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  32671. html: value,
  32672. multilineTag: 'p'
  32673. }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  32674. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32675. value: piece
  32676. })
  32677. })));
  32678. }
  32679. if (citation && citation !== '<p></p>') {
  32680. paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  32681. content: citation
  32682. }));
  32683. }
  32684. if (paragraphs.length === 0) {
  32685. return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  32686. content: ''
  32687. });
  32688. }
  32689. return paragraphs;
  32690. }
  32691. }, {
  32692. type: 'block',
  32693. blocks: ['core/heading'],
  32694. transform: _ref6 => {
  32695. let {
  32696. value,
  32697. citation,
  32698. ...attrs
  32699. } = _ref6;
  32700. // If there is no quote content, use the citation as the
  32701. // content of the resulting heading. A nonexistent citation
  32702. // will result in an empty heading.
  32703. if (value === '<p></p>') {
  32704. return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  32705. content: citation
  32706. });
  32707. }
  32708. const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
  32709. html: value,
  32710. multilineTag: 'p'
  32711. }), '\u2028');
  32712. const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
  32713. content: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32714. value: pieces[0]
  32715. })
  32716. });
  32717. if (!citation && pieces.length === 1) {
  32718. return headingBlock;
  32719. }
  32720. const quotePieces = pieces.slice(1);
  32721. const quoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attrs,
  32722. citation,
  32723. value: (0,external_wp_richText_namespaceObject.toHTMLString)({
  32724. value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
  32725. multilineTag: 'p'
  32726. })
  32727. });
  32728. return [headingBlock, quoteBlock];
  32729. }
  32730. }, {
  32731. type: 'block',
  32732. blocks: ['core/pullquote'],
  32733. transform: _ref7 => {
  32734. let {
  32735. value,
  32736. citation,
  32737. anchor
  32738. } = _ref7;
  32739. return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
  32740. value,
  32741. citation,
  32742. anchor
  32743. });
  32744. }
  32745. }]
  32746. };
  32747. /* harmony default export */ var quote_transforms = (quote_transforms_transforms);
  32748. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js
  32749. /**
  32750. * WordPress dependencies
  32751. */
  32752. /**
  32753. * Internal dependencies
  32754. */
  32755. const quote_metadata = {
  32756. $schema: "https://schemas.wp.org/trunk/block.json",
  32757. apiVersion: 2,
  32758. name: "core/quote",
  32759. title: "Quote",
  32760. category: "text",
  32761. description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar",
  32762. keywords: ["blockquote", "cite"],
  32763. textdomain: "default",
  32764. attributes: {
  32765. value: {
  32766. type: "string",
  32767. source: "html",
  32768. selector: "blockquote",
  32769. multiline: "p",
  32770. "default": "",
  32771. __experimentalRole: "content"
  32772. },
  32773. citation: {
  32774. type: "string",
  32775. source: "html",
  32776. selector: "cite",
  32777. "default": "",
  32778. __experimentalRole: "content"
  32779. },
  32780. align: {
  32781. type: "string"
  32782. }
  32783. },
  32784. supports: {
  32785. anchor: true,
  32786. __experimentalSlashInserter: true,
  32787. typography: {
  32788. fontSize: true,
  32789. lineHeight: true,
  32790. __experimentalFontStyle: true,
  32791. __experimentalFontWeight: true,
  32792. __experimentalLetterSpacing: true,
  32793. __experimentalTextTransform: true,
  32794. __experimentalDefaultControls: {
  32795. fontSize: true,
  32796. fontAppearance: true
  32797. }
  32798. },
  32799. color: {
  32800. gradients: true,
  32801. link: true,
  32802. __experimentalDefaultControls: {
  32803. background: true,
  32804. text: true
  32805. }
  32806. }
  32807. },
  32808. styles: [{
  32809. name: "default",
  32810. label: "Default",
  32811. isDefault: true
  32812. }, {
  32813. name: "plain",
  32814. label: "Plain"
  32815. }],
  32816. editorStyle: "wp-block-quote-editor",
  32817. style: "wp-block-quote"
  32818. };
  32819. const {
  32820. name: quote_name
  32821. } = quote_metadata;
  32822. const quote_settingsV1 = {
  32823. icon: library_quote,
  32824. example: {
  32825. attributes: {
  32826. value: '<p>' + (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') + '</p>',
  32827. citation: 'Julio Cortázar'
  32828. }
  32829. },
  32830. transforms: quote_transforms,
  32831. edit: QuoteEdit,
  32832. save: quote_save_save,
  32833. merge(attributes, _ref) {
  32834. let {
  32835. value,
  32836. citation
  32837. } = _ref;
  32838. // Quote citations cannot be merged. Pick the second one unless it's
  32839. // empty.
  32840. if (!citation) {
  32841. citation = attributes.citation;
  32842. }
  32843. if (!value || value === '<p></p>') {
  32844. return { ...attributes,
  32845. citation
  32846. };
  32847. }
  32848. return { ...attributes,
  32849. value: attributes.value + value,
  32850. citation
  32851. };
  32852. },
  32853. deprecated: quote_deprecated
  32854. };
  32855. let quote_settings = quote_settingsV1;
  32856. if (false) { var quote_window; }
  32857. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
  32858. /**
  32859. * WordPress dependencies
  32860. */
  32861. const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32862. xmlns: "http://www.w3.org/2000/svg",
  32863. viewBox: "0 0 24 24"
  32864. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32865. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  32866. }));
  32867. /* harmony default export */ var library_symbol = (symbol);
  32868. ;// CONCATENATED MODULE: external ["wp","reusableBlocks"]
  32869. var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
  32870. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/ungroup.js
  32871. /**
  32872. * WordPress dependencies
  32873. */
  32874. const ungroup = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  32875. xmlns: "http://www.w3.org/2000/svg",
  32876. viewBox: "0 0 24 24"
  32877. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  32878. d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"
  32879. }));
  32880. /* harmony default export */ var library_ungroup = (ungroup);
  32881. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js
  32882. /**
  32883. * WordPress dependencies
  32884. */
  32885. function ReusableBlockEdit(_ref) {
  32886. let {
  32887. attributes: {
  32888. ref
  32889. },
  32890. clientId
  32891. } = _ref;
  32892. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(ref);
  32893. const {
  32894. record,
  32895. hasResolved
  32896. } = (0,external_wp_coreData_namespaceObject.__experimentalUseEntityRecord)('postType', 'wp_block', ref);
  32897. const isMissing = hasResolved && !record;
  32898. const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
  32899. const {
  32900. __experimentalConvertBlockToStatic: convertBlockToStatic
  32901. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_reusableBlocks_namespaceObject.store);
  32902. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', {
  32903. id: ref
  32904. });
  32905. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_block', 'title', ref);
  32906. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  32907. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
  32908. value: blocks,
  32909. onInput,
  32910. onChange,
  32911. renderAppender: blocks !== null && blocks !== void 0 && blocks.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  32912. });
  32913. if (hasAlreadyRendered) {
  32914. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  32915. }
  32916. if (isMissing) {
  32917. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')));
  32918. }
  32919. if (!hasResolved) {
  32920. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
  32921. }
  32922. return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  32923. onClick: () => convertBlockToStatic(clientId),
  32924. label: (0,external_wp_i18n_namespaceObject.__)('Convert to regular blocks'),
  32925. icon: library_ungroup,
  32926. showTooltip: true
  32927. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  32928. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  32929. value: title,
  32930. onChange: setTitle
  32931. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
  32932. clientId: clientId,
  32933. wrapperProps: innerBlocksProps,
  32934. className: "block-library-block__reusable-block-container"
  32935. })));
  32936. }
  32937. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js
  32938. /**
  32939. * WordPress dependencies
  32940. */
  32941. /**
  32942. * Internal dependencies
  32943. */
  32944. const block_metadata = {
  32945. $schema: "https://schemas.wp.org/trunk/block.json",
  32946. apiVersion: 2,
  32947. name: "core/block",
  32948. title: "Reusable block",
  32949. category: "reusable",
  32950. description: "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it\u2019s used.",
  32951. textdomain: "default",
  32952. attributes: {
  32953. ref: {
  32954. type: "number"
  32955. }
  32956. },
  32957. supports: {
  32958. customClassName: false,
  32959. html: false,
  32960. inserter: false
  32961. },
  32962. editorStyle: "wp-block-editor"
  32963. };
  32964. const {
  32965. name: block_name
  32966. } = block_metadata;
  32967. const block_settings = {
  32968. edit: ReusableBlockEdit,
  32969. icon: library_symbol
  32970. };
  32971. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/edit.js
  32972. /**
  32973. * WordPress dependencies
  32974. */
  32975. function ReadMore(_ref) {
  32976. let {
  32977. attributes: {
  32978. content,
  32979. linkTarget
  32980. },
  32981. setAttributes,
  32982. insertBlocksAfter
  32983. } = _ref;
  32984. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  32985. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  32986. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  32987. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  32988. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  32989. onChange: value => setAttributes({
  32990. linkTarget: value ? '_blank' : '_self'
  32991. }),
  32992. checked: linkTarget === '_blank'
  32993. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  32994. tagName: "a",
  32995. "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
  32996. placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'),
  32997. value: content,
  32998. onChange: newValue => setAttributes({
  32999. content: newValue
  33000. }),
  33001. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())),
  33002. withoutInteractiveFormatting: true
  33003. }, blockProps)));
  33004. }
  33005. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
  33006. /**
  33007. * WordPress dependencies
  33008. */
  33009. /**
  33010. * Internal dependencies
  33011. */
  33012. const read_more_metadata = {
  33013. $schema: "https://schemas.wp.org/trunk/block.json",
  33014. apiVersion: 2,
  33015. name: "core/read-more",
  33016. title: "Read More",
  33017. category: "theme",
  33018. description: "Displays the link of a post, page, or any other content-type.",
  33019. textdomain: "default",
  33020. attributes: {
  33021. content: {
  33022. type: "string"
  33023. },
  33024. linkTarget: {
  33025. type: "string",
  33026. "default": "_self"
  33027. }
  33028. },
  33029. usesContext: ["postId"],
  33030. supports: {
  33031. html: false,
  33032. color: {
  33033. gradients: true,
  33034. text: true
  33035. },
  33036. typography: {
  33037. fontSize: true,
  33038. lineHeight: true,
  33039. __experimentalFontFamily: true,
  33040. __experimentalFontWeight: true,
  33041. __experimentalFontStyle: true,
  33042. __experimentalTextTransform: true,
  33043. __experimentalLetterSpacing: true,
  33044. __experimentalTextDecoration: true,
  33045. __experimentalDefaultControls: {
  33046. fontSize: true,
  33047. textDecoration: true
  33048. }
  33049. },
  33050. spacing: {
  33051. margin: ["top", "bottom"],
  33052. padding: true,
  33053. __experimentalDefaultControls: {
  33054. padding: true
  33055. }
  33056. },
  33057. __experimentalBorder: {
  33058. color: true,
  33059. radius: true,
  33060. width: true,
  33061. __experimentalDefaultControls: {
  33062. width: true
  33063. }
  33064. }
  33065. },
  33066. style: "wp-block-read-more"
  33067. };
  33068. const {
  33069. name: read_more_name
  33070. } = read_more_metadata;
  33071. const read_more_settings = {
  33072. icon: library_link,
  33073. edit: ReadMore
  33074. };
  33075. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js
  33076. /**
  33077. * WordPress dependencies
  33078. */
  33079. const rss = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33080. xmlns: "http://www.w3.org/2000/svg",
  33081. viewBox: "0 0 24 24"
  33082. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33083. d: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"
  33084. }));
  33085. /* harmony default export */ var library_rss = (rss);
  33086. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js
  33087. /**
  33088. * WordPress dependencies
  33089. */
  33090. const DEFAULT_MIN_ITEMS = 1;
  33091. const DEFAULT_MAX_ITEMS = 20;
  33092. function RSSEdit(_ref) {
  33093. let {
  33094. attributes,
  33095. setAttributes
  33096. } = _ref;
  33097. const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL);
  33098. const {
  33099. blockLayout,
  33100. columns,
  33101. displayAuthor,
  33102. displayDate,
  33103. displayExcerpt,
  33104. excerptLength,
  33105. feedURL,
  33106. itemsToShow
  33107. } = attributes;
  33108. function toggleAttribute(propName) {
  33109. return () => {
  33110. const value = attributes[propName];
  33111. setAttributes({
  33112. [propName]: !value
  33113. });
  33114. };
  33115. }
  33116. function onSubmitURL(event) {
  33117. event.preventDefault();
  33118. if (feedURL) {
  33119. setAttributes({
  33120. feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL)
  33121. });
  33122. setIsEditing(false);
  33123. }
  33124. }
  33125. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  33126. if (isEditing) {
  33127. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  33128. icon: library_rss,
  33129. label: "RSS"
  33130. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  33131. onSubmit: onSubmitURL,
  33132. className: "wp-block-rss__placeholder-form"
  33133. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  33134. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'),
  33135. value: feedURL,
  33136. onChange: value => setAttributes({
  33137. feedURL: value
  33138. }),
  33139. className: "wp-block-rss__placeholder-input"
  33140. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  33141. variant: "primary",
  33142. type: "submit"
  33143. }, (0,external_wp_i18n_namespaceObject.__)('Use URL')))));
  33144. }
  33145. const toolbarControls = [{
  33146. icon: library_edit,
  33147. title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'),
  33148. onClick: () => setIsEditing(true)
  33149. }, {
  33150. icon: library_list,
  33151. title: (0,external_wp_i18n_namespaceObject.__)('List view'),
  33152. onClick: () => setAttributes({
  33153. blockLayout: 'list'
  33154. }),
  33155. isActive: blockLayout === 'list'
  33156. }, {
  33157. icon: library_grid,
  33158. title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
  33159. onClick: () => setAttributes({
  33160. blockLayout: 'grid'
  33161. }),
  33162. isActive: blockLayout === 'grid'
  33163. }];
  33164. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  33165. controls: toolbarControls
  33166. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  33167. title: (0,external_wp_i18n_namespaceObject.__)('RSS settings')
  33168. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33169. label: (0,external_wp_i18n_namespaceObject.__)('Number of items'),
  33170. value: itemsToShow,
  33171. onChange: value => setAttributes({
  33172. itemsToShow: value
  33173. }),
  33174. min: DEFAULT_MIN_ITEMS,
  33175. max: DEFAULT_MAX_ITEMS,
  33176. required: true
  33177. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33178. label: (0,external_wp_i18n_namespaceObject.__)('Display author'),
  33179. checked: displayAuthor,
  33180. onChange: toggleAttribute('displayAuthor')
  33181. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33182. label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
  33183. checked: displayDate,
  33184. onChange: toggleAttribute('displayDate')
  33185. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  33186. label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
  33187. checked: displayExcerpt,
  33188. onChange: toggleAttribute('displayExcerpt')
  33189. }), displayExcerpt && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33190. label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
  33191. value: excerptLength,
  33192. onChange: value => setAttributes({
  33193. excerptLength: value
  33194. }),
  33195. min: 10,
  33196. max: 100,
  33197. required: true
  33198. }), blockLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  33199. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  33200. value: columns,
  33201. onChange: value => setAttributes({
  33202. columns: value
  33203. }),
  33204. min: 2,
  33205. max: 6,
  33206. required: true
  33207. }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  33208. block: "core/rss",
  33209. attributes: attributes
  33210. }))));
  33211. }
  33212. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js
  33213. /**
  33214. * WordPress dependencies
  33215. */
  33216. /**
  33217. * Internal dependencies
  33218. */
  33219. const rss_metadata = {
  33220. $schema: "https://schemas.wp.org/trunk/block.json",
  33221. apiVersion: 2,
  33222. name: "core/rss",
  33223. title: "RSS",
  33224. category: "widgets",
  33225. description: "Display entries from any RSS or Atom feed.",
  33226. keywords: ["atom", "feed"],
  33227. textdomain: "default",
  33228. attributes: {
  33229. columns: {
  33230. type: "number",
  33231. "default": 2
  33232. },
  33233. blockLayout: {
  33234. type: "string",
  33235. "default": "list"
  33236. },
  33237. feedURL: {
  33238. type: "string",
  33239. "default": ""
  33240. },
  33241. itemsToShow: {
  33242. type: "number",
  33243. "default": 5
  33244. },
  33245. displayExcerpt: {
  33246. type: "boolean",
  33247. "default": false
  33248. },
  33249. displayAuthor: {
  33250. type: "boolean",
  33251. "default": false
  33252. },
  33253. displayDate: {
  33254. type: "boolean",
  33255. "default": false
  33256. },
  33257. excerptLength: {
  33258. type: "number",
  33259. "default": 55
  33260. }
  33261. },
  33262. supports: {
  33263. align: true,
  33264. html: false
  33265. },
  33266. editorStyle: "wp-block-rss-editor",
  33267. style: "wp-block-rss"
  33268. };
  33269. const {
  33270. name: rss_name
  33271. } = rss_metadata;
  33272. const rss_settings = {
  33273. icon: library_rss,
  33274. example: {
  33275. attributes: {
  33276. feedURL: 'https://wordpress.org'
  33277. }
  33278. },
  33279. edit: RSSEdit
  33280. };
  33281. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
  33282. /**
  33283. * WordPress dependencies
  33284. */
  33285. const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33286. xmlns: "http://www.w3.org/2000/svg",
  33287. viewBox: "0 0 24 24"
  33288. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33289. d: "M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"
  33290. }));
  33291. /* harmony default export */ var library_search = (search);
  33292. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js
  33293. /**
  33294. * WordPress dependencies
  33295. */
  33296. const buttonOnly = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33297. xmlns: "http://www.w3.org/2000/svg",
  33298. viewBox: "0 0 24 24"
  33299. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33300. x: "7",
  33301. y: "10",
  33302. width: "10",
  33303. height: "4",
  33304. rx: "1",
  33305. fill: "currentColor"
  33306. }));
  33307. const buttonOutside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33308. xmlns: "http://www.w3.org/2000/svg",
  33309. viewBox: "0 0 24 24"
  33310. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33311. x: "4.75",
  33312. y: "15.25",
  33313. width: "6.5",
  33314. height: "9.5",
  33315. transform: "rotate(-90 4.75 15.25)",
  33316. stroke: "currentColor",
  33317. strokeWidth: "1.5",
  33318. fill: "none"
  33319. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33320. x: "16",
  33321. y: "10",
  33322. width: "4",
  33323. height: "4",
  33324. rx: "1",
  33325. fill: "currentColor"
  33326. }));
  33327. const buttonInside = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33328. xmlns: "http://www.w3.org/2000/svg",
  33329. viewBox: "0 0 24 24"
  33330. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33331. x: "4.75",
  33332. y: "15.25",
  33333. width: "6.5",
  33334. height: "14.5",
  33335. transform: "rotate(-90 4.75 15.25)",
  33336. stroke: "currentColor",
  33337. strokeWidth: "1.5",
  33338. fill: "none"
  33339. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33340. x: "14",
  33341. y: "10",
  33342. width: "4",
  33343. height: "4",
  33344. rx: "1",
  33345. fill: "currentColor"
  33346. }));
  33347. const noButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33348. xmlns: "http://www.w3.org/2000/svg",
  33349. viewBox: "0 0 24 24"
  33350. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33351. x: "4.75",
  33352. y: "15.25",
  33353. width: "6.5",
  33354. height: "14.5",
  33355. transform: "rotate(-90 4.75 15.25)",
  33356. stroke: "currentColor",
  33357. fill: "none",
  33358. strokeWidth: "1.5"
  33359. }));
  33360. const buttonWithIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33361. xmlns: "http://www.w3.org/2000/svg",
  33362. viewBox: "0 0 24 24"
  33363. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33364. x: "4.75",
  33365. y: "7.75",
  33366. width: "14.5",
  33367. height: "8.5",
  33368. rx: "1.25",
  33369. stroke: "currentColor",
  33370. fill: "none",
  33371. strokeWidth: "1.5"
  33372. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33373. x: "8",
  33374. y: "11",
  33375. width: "8",
  33376. height: "2",
  33377. fill: "currentColor"
  33378. }));
  33379. const toggleLabel = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  33380. xmlns: "http://www.w3.org/2000/svg",
  33381. viewBox: "0 0 24 24"
  33382. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33383. x: "4.75",
  33384. y: "17.25",
  33385. width: "5.5",
  33386. height: "14.5",
  33387. transform: "rotate(-90 4.75 17.25)",
  33388. stroke: "currentColor",
  33389. fill: "none",
  33390. strokeWidth: "1.5"
  33391. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  33392. x: "4",
  33393. y: "7",
  33394. width: "10",
  33395. height: "2",
  33396. fill: "currentColor"
  33397. }));
  33398. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js
  33399. /**
  33400. * Constants
  33401. */
  33402. const PC_WIDTH_DEFAULT = 50;
  33403. const PX_WIDTH_DEFAULT = 350;
  33404. const MIN_WIDTH = 220;
  33405. const MIN_WIDTH_UNIT = 'px';
  33406. /**
  33407. * Returns a boolean whether passed unit is percentage
  33408. *
  33409. * @param {string} unit Block width unit.
  33410. *
  33411. * @return {boolean} Whether unit is '%'.
  33412. */
  33413. function utils_isPercentageUnit(unit) {
  33414. return unit === '%';
  33415. }
  33416. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js
  33417. /**
  33418. * External dependencies
  33419. */
  33420. /**
  33421. * WordPress dependencies
  33422. */
  33423. /**
  33424. * Internal dependencies
  33425. */
  33426. // Used to calculate border radius adjustment to avoid "fat" corners when
  33427. // button is placed inside wrapper.
  33428. const DEFAULT_INNER_PADDING = '4px';
  33429. function SearchEdit(_ref) {
  33430. var _style$border, _style$border2, _style$border3;
  33431. let {
  33432. className,
  33433. attributes,
  33434. setAttributes,
  33435. toggleSelection,
  33436. isSelected,
  33437. clientId
  33438. } = _ref;
  33439. const {
  33440. label,
  33441. showLabel,
  33442. placeholder,
  33443. width,
  33444. widthUnit,
  33445. align,
  33446. buttonText,
  33447. buttonPosition,
  33448. buttonUseIcon,
  33449. style
  33450. } = attributes;
  33451. const insertedInNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
  33452. var _getBlockParentsByBlo;
  33453. const {
  33454. getBlockParentsByBlockName,
  33455. wasBlockJustInserted
  33456. } = select(external_wp_blockEditor_namespaceObject.store);
  33457. return !!((_getBlockParentsByBlo = getBlockParentsByBlockName(clientId, 'core/navigation')) !== null && _getBlockParentsByBlo !== void 0 && _getBlockParentsByBlo.length) && wasBlockJustInserted(clientId);
  33458. }, [clientId]);
  33459. const {
  33460. __unstableMarkNextChangeAsNotPersistent
  33461. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  33462. (0,external_wp_element_namespaceObject.useEffect)(() => {
  33463. if (!insertedInNavigationBlock) return; // This side-effect should not create an undo level.
  33464. __unstableMarkNextChangeAsNotPersistent();
  33465. setAttributes({
  33466. showLabel: false,
  33467. buttonUseIcon: true,
  33468. buttonPosition: 'button-inside'
  33469. });
  33470. }, [insertedInNavigationBlock]);
  33471. const borderRadius = style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius;
  33472. const borderColor = style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color;
  33473. const borderWidth = style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.width;
  33474. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); // Check for old deprecated numerical border radius. Done as a separate
  33475. // check so that a borderRadius style won't overwrite the longhand
  33476. // per-corner styles.
  33477. if (typeof borderRadius === 'number') {
  33478. borderProps.style.borderRadius = `${borderRadius}px`;
  33479. }
  33480. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  33481. const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
  33482. const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
  33483. const isButtonPositionInside = 'button-inside' === buttonPosition;
  33484. const isButtonPositionOutside = 'button-outside' === buttonPosition;
  33485. const hasNoButton = 'no-button' === buttonPosition;
  33486. const hasOnlyButton = 'button-only' === buttonPosition;
  33487. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  33488. availableUnits: ['%', 'px'],
  33489. defaultValues: {
  33490. '%': PC_WIDTH_DEFAULT,
  33491. px: PX_WIDTH_DEFAULT
  33492. }
  33493. });
  33494. const getBlockClassNames = () => {
  33495. return classnames_default()(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined);
  33496. };
  33497. const buttonPositionControls = [{
  33498. role: 'menuitemradio',
  33499. title: (0,external_wp_i18n_namespaceObject.__)('Button outside'),
  33500. isActive: buttonPosition === 'button-outside',
  33501. icon: buttonOutside,
  33502. onClick: () => {
  33503. setAttributes({
  33504. buttonPosition: 'button-outside'
  33505. });
  33506. }
  33507. }, {
  33508. role: 'menuitemradio',
  33509. title: (0,external_wp_i18n_namespaceObject.__)('Button inside'),
  33510. isActive: buttonPosition === 'button-inside',
  33511. icon: buttonInside,
  33512. onClick: () => {
  33513. setAttributes({
  33514. buttonPosition: 'button-inside'
  33515. });
  33516. }
  33517. }, {
  33518. role: 'menuitemradio',
  33519. title: (0,external_wp_i18n_namespaceObject.__)('No button'),
  33520. isActive: buttonPosition === 'no-button',
  33521. icon: noButton,
  33522. onClick: () => {
  33523. setAttributes({
  33524. buttonPosition: 'no-button'
  33525. });
  33526. }
  33527. }];
  33528. const getButtonPositionIcon = () => {
  33529. switch (buttonPosition) {
  33530. case 'button-inside':
  33531. return buttonInside;
  33532. case 'button-outside':
  33533. return buttonOutside;
  33534. case 'no-button':
  33535. return noButton;
  33536. case 'button-only':
  33537. return buttonOnly;
  33538. }
  33539. };
  33540. const getResizableSides = () => {
  33541. if (hasOnlyButton) {
  33542. return {};
  33543. }
  33544. return {
  33545. right: align !== 'right',
  33546. left: align === 'right'
  33547. };
  33548. };
  33549. const renderTextField = () => {
  33550. // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.
  33551. const textFieldClasses = classnames_default()('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className);
  33552. const textFieldStyles = isButtonPositionInside ? {
  33553. borderRadius
  33554. } : borderProps.style;
  33555. return (0,external_wp_element_namespaceObject.createElement)("input", {
  33556. className: textFieldClasses,
  33557. style: textFieldStyles,
  33558. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
  33559. // stops screen readers from reading the placeholder field's placeholder
  33560. // which is confusing.
  33561. ,
  33562. placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'),
  33563. value: placeholder,
  33564. onChange: event => setAttributes({
  33565. placeholder: event.target.value
  33566. })
  33567. });
  33568. };
  33569. const renderButton = () => {
  33570. // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.
  33571. const buttonClasses = classnames_default()('wp-block-search__button', colorProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined);
  33572. const buttonStyles = { ...colorProps.style,
  33573. ...(isButtonPositionInside ? {
  33574. borderRadius
  33575. } : borderProps.style)
  33576. };
  33577. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
  33578. type: "button",
  33579. className: buttonClasses,
  33580. style: buttonStyles,
  33581. "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search')
  33582. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  33583. icon: library_search
  33584. })), !buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  33585. className: buttonClasses,
  33586. style: buttonStyles,
  33587. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
  33588. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'),
  33589. withoutInteractiveFormatting: true,
  33590. value: buttonText,
  33591. onChange: html => setAttributes({
  33592. buttonText: html
  33593. })
  33594. }));
  33595. };
  33596. const controls = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  33597. title: (0,external_wp_i18n_namespaceObject.__)('Toggle search label'),
  33598. icon: toggleLabel,
  33599. onClick: () => {
  33600. setAttributes({
  33601. showLabel: !showLabel
  33602. });
  33603. },
  33604. className: showLabel ? 'is-pressed' : undefined
  33605. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  33606. icon: getButtonPositionIcon(),
  33607. label: (0,external_wp_i18n_namespaceObject.__)('Change button position'),
  33608. controls: buttonPositionControls
  33609. }), !hasNoButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  33610. title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'),
  33611. icon: buttonWithIcon,
  33612. onClick: () => {
  33613. setAttributes({
  33614. buttonUseIcon: !buttonUseIcon
  33615. });
  33616. },
  33617. className: buttonUseIcon ? 'is-pressed' : undefined
  33618. }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  33619. title: (0,external_wp_i18n_namespaceObject.__)('Display Settings')
  33620. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  33621. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  33622. id: unitControlInputId
  33623. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  33624. id: unitControlInputId,
  33625. min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
  33626. onChange: newWidth => {
  33627. const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth;
  33628. setAttributes({
  33629. width: parseInt(filteredWidth, 10)
  33630. });
  33631. },
  33632. onUnitChange: newUnit => {
  33633. setAttributes({
  33634. width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT,
  33635. widthUnit: newUnit
  33636. });
  33637. },
  33638. style: {
  33639. maxWidth: 80
  33640. },
  33641. value: `${width}${widthUnit}`,
  33642. units: units
  33643. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
  33644. className: "wp-block-search__components-button-group",
  33645. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Percentage Width')
  33646. }, [25, 50, 75, 100].map(widthValue => {
  33647. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  33648. key: widthValue,
  33649. isSmall: true,
  33650. variant: `${widthValue}%` === `${width}${widthUnit}` ? 0 : undefined,
  33651. onClick: () => setAttributes({
  33652. width: widthValue,
  33653. widthUnit: '%'
  33654. })
  33655. }, widthValue, "%");
  33656. }))))));
  33657. const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
  33658. const getWrapperStyles = () => {
  33659. const styles = {
  33660. borderColor,
  33661. borderWidth: isButtonPositionInside ? borderWidth : undefined
  33662. };
  33663. const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0;
  33664. if (isButtonPositionInside && isNonZeroBorderRadius) {
  33665. // We have button inside wrapper and a border radius value to apply.
  33666. // Add default padding so we don't get "fat" corners.
  33667. //
  33668. // CSS calc() is used here to support non-pixel units. The inline
  33669. // style using calc() will only apply if both values have units.
  33670. if (typeof borderRadius === 'object') {
  33671. // Individual corner border radii present.
  33672. const {
  33673. topLeft,
  33674. topRight,
  33675. bottomLeft,
  33676. bottomRight
  33677. } = borderRadius;
  33678. return {
  33679. borderTopLeftRadius: padBorderRadius(topLeft),
  33680. borderTopRightRadius: padBorderRadius(topRight),
  33681. borderBottomLeftRadius: padBorderRadius(bottomLeft),
  33682. borderBottomRightRadius: padBorderRadius(bottomRight),
  33683. ...styles
  33684. };
  33685. } // The inline style using calc() will only apply if both values
  33686. // supplied to calc() have units. Deprecated block's may have
  33687. // unitless integer.
  33688. const radius = Number.isInteger(borderRadius) ? `${borderRadius}px` : borderRadius;
  33689. styles.borderRadius = `calc(${radius} + ${DEFAULT_INNER_PADDING})`;
  33690. }
  33691. return styles;
  33692. };
  33693. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33694. className: getBlockClassNames()
  33695. });
  33696. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, showLabel && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  33697. className: "wp-block-search__label",
  33698. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'),
  33699. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'),
  33700. withoutInteractiveFormatting: true,
  33701. value: label,
  33702. onChange: html => setAttributes({
  33703. label: html
  33704. })
  33705. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  33706. size: {
  33707. width: `${width}${widthUnit}`
  33708. },
  33709. className: classnames_default()('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined),
  33710. style: getWrapperStyles(),
  33711. minWidth: MIN_WIDTH,
  33712. enable: getResizableSides(),
  33713. onResizeStart: (event, direction, elt) => {
  33714. setAttributes({
  33715. width: parseInt(elt.offsetWidth, 10),
  33716. widthUnit: 'px'
  33717. });
  33718. toggleSelection(false);
  33719. },
  33720. onResizeStop: (event, direction, elt, delta) => {
  33721. setAttributes({
  33722. width: parseInt(width + delta.width, 10)
  33723. });
  33724. toggleSelection(true);
  33725. },
  33726. showHandle: isSelected
  33727. }, (isButtonPositionInside || isButtonPositionOutside) && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasOnlyButton && renderButton(), hasNoButton && renderTextField()));
  33728. }
  33729. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js
  33730. /**
  33731. * WordPress dependencies
  33732. */
  33733. const search_variations_variations = [{
  33734. name: 'default',
  33735. isDefault: true,
  33736. attributes: {
  33737. buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
  33738. label: (0,external_wp_i18n_namespaceObject.__)('Search')
  33739. }
  33740. }];
  33741. /* harmony default export */ var search_variations = (search_variations_variations);
  33742. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js
  33743. /**
  33744. * WordPress dependencies
  33745. */
  33746. /**
  33747. * Internal dependencies
  33748. */
  33749. const search_metadata = {
  33750. $schema: "https://schemas.wp.org/trunk/block.json",
  33751. apiVersion: 2,
  33752. name: "core/search",
  33753. title: "Search",
  33754. category: "widgets",
  33755. description: "Help visitors find your content.",
  33756. keywords: ["find"],
  33757. textdomain: "default",
  33758. attributes: {
  33759. label: {
  33760. type: "string",
  33761. __experimentalRole: "content"
  33762. },
  33763. showLabel: {
  33764. type: "boolean",
  33765. "default": true
  33766. },
  33767. placeholder: {
  33768. type: "string",
  33769. "default": "",
  33770. __experimentalRole: "content"
  33771. },
  33772. width: {
  33773. type: "number"
  33774. },
  33775. widthUnit: {
  33776. type: "string"
  33777. },
  33778. buttonText: {
  33779. type: "string",
  33780. __experimentalRole: "content"
  33781. },
  33782. buttonPosition: {
  33783. type: "string",
  33784. "default": "button-outside"
  33785. },
  33786. buttonUseIcon: {
  33787. type: "boolean",
  33788. "default": false
  33789. }
  33790. },
  33791. supports: {
  33792. align: ["left", "center", "right"],
  33793. color: {
  33794. gradients: true,
  33795. __experimentalSkipSerialization: true,
  33796. __experimentalDefaultControls: {
  33797. background: true,
  33798. text: true
  33799. }
  33800. },
  33801. __experimentalBorder: {
  33802. color: true,
  33803. radius: true,
  33804. width: true,
  33805. __experimentalSkipSerialization: true,
  33806. __experimentalDefaultControls: {
  33807. color: true,
  33808. radius: true,
  33809. width: true
  33810. }
  33811. },
  33812. html: false
  33813. },
  33814. editorStyle: "wp-block-search-editor",
  33815. style: "wp-block-search"
  33816. };
  33817. const {
  33818. name: search_name
  33819. } = search_metadata;
  33820. const search_settings = {
  33821. icon: library_search,
  33822. example: {},
  33823. variations: search_variations,
  33824. edit: SearchEdit
  33825. };
  33826. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js
  33827. /**
  33828. * WordPress dependencies
  33829. */
  33830. const separator = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  33831. viewBox: "0 0 24 24",
  33832. xmlns: "http://www.w3.org/2000/svg"
  33833. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  33834. d: "M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"
  33835. }));
  33836. /* harmony default export */ var library_separator = (separator);
  33837. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js
  33838. /**
  33839. * WordPress dependencies
  33840. */
  33841. function useDeprecatedOpacity(opacity, currentColor, setAttributes) {
  33842. const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false);
  33843. const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); // A separator with no color set will always have previousColor set to undefined,
  33844. // and we need to differentiate these from those with color set that will return
  33845. // previousColor as undefined on the first render.
  33846. (0,external_wp_element_namespaceObject.useEffect)(() => {
  33847. if (opacity === 'css' && !currentColor && !previousColor) {
  33848. setDeprecatedOpacityWithNoColor(true);
  33849. }
  33850. }, [currentColor, previousColor, opacity]); // For deprecated blocks, that have a default 0.4 css opacity set, we
  33851. // need to remove this if the current color is changed, or a color is added.
  33852. // In these instances the opacity attribute is set back to the default of
  33853. // alpha-channel which allows a new custom opacity to be set via the color picker.
  33854. (0,external_wp_element_namespaceObject.useEffect)(() => {
  33855. if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) {
  33856. setAttributes({
  33857. opacity: 'alpha-channel'
  33858. });
  33859. setDeprecatedOpacityWithNoColor(false);
  33860. }
  33861. }, [deprecatedOpacityWithNoColor, currentColor, previousColor]);
  33862. }
  33863. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js
  33864. /**
  33865. * External dependencies
  33866. */
  33867. /**
  33868. * WordPress dependencies
  33869. */
  33870. /**
  33871. * Internal dependencies
  33872. */
  33873. function SeparatorEdit(_ref) {
  33874. var _colorProps$style, _style$color;
  33875. let {
  33876. attributes,
  33877. setAttributes
  33878. } = _ref;
  33879. const {
  33880. backgroundColor,
  33881. opacity,
  33882. style
  33883. } = attributes;
  33884. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  33885. const currentColor = colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor;
  33886. const hasCustomColor = !!(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.background);
  33887. useDeprecatedOpacity(opacity, currentColor, setAttributes); // The dots styles uses text for the dots, to change those dots color is
  33888. // using color, not backgroundColor.
  33889. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  33890. const className = classnames_default()({
  33891. 'has-text-color': backgroundColor || currentColor,
  33892. [colorClass]: colorClass,
  33893. 'has-css-opacity': opacity === 'css',
  33894. 'has-alpha-channel-opacity': opacity === 'alpha-channel'
  33895. }, colorProps.classname);
  33896. const styles = {
  33897. color: currentColor,
  33898. backgroundColor: currentColor
  33899. };
  33900. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.HorizontalRule, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  33901. className,
  33902. style: hasCustomColor ? styles : undefined
  33903. })));
  33904. }
  33905. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js
  33906. /**
  33907. * External dependencies
  33908. */
  33909. /**
  33910. * WordPress dependencies
  33911. */
  33912. function separatorSave(_ref) {
  33913. var _style$color, _colorProps$style;
  33914. let {
  33915. attributes
  33916. } = _ref;
  33917. const {
  33918. backgroundColor,
  33919. style,
  33920. opacity
  33921. } = attributes;
  33922. const customColor = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.background;
  33923. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); // The hr support changing color using border-color, since border-color
  33924. // is not yet supported in the color palette, we use background-color.
  33925. // The dots styles uses text for the dots, to change those dots color is
  33926. // using color, not backgroundColor.
  33927. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  33928. const className = classnames_default()({
  33929. 'has-text-color': backgroundColor || customColor,
  33930. [colorClass]: colorClass,
  33931. 'has-css-opacity': opacity === 'css',
  33932. 'has-alpha-channel-opacity': opacity === 'alpha-channel'
  33933. }, colorProps.className);
  33934. const styles = {
  33935. backgroundColor: colorProps === null || colorProps === void 0 ? void 0 : (_colorProps$style = colorProps.style) === null || _colorProps$style === void 0 ? void 0 : _colorProps$style.backgroundColor,
  33936. color: colorClass ? undefined : customColor
  33937. };
  33938. return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  33939. className,
  33940. style: styles
  33941. }));
  33942. }
  33943. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
  33944. /**
  33945. * WordPress dependencies
  33946. */
  33947. const separator_transforms_transforms = {
  33948. from: [{
  33949. type: 'enter',
  33950. regExp: /^-{3,}$/,
  33951. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator')
  33952. }, {
  33953. type: 'raw',
  33954. selector: 'hr',
  33955. schema: {
  33956. hr: {}
  33957. }
  33958. }]
  33959. };
  33960. /* harmony default export */ var separator_transforms = (separator_transforms_transforms);
  33961. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js
  33962. /**
  33963. * External dependencies
  33964. */
  33965. /**
  33966. * WordPress dependencies
  33967. */
  33968. const separator_deprecated_v1 = {
  33969. attributes: {
  33970. color: {
  33971. type: 'string'
  33972. },
  33973. customColor: {
  33974. type: 'string'
  33975. }
  33976. },
  33977. save(_ref) {
  33978. let {
  33979. attributes
  33980. } = _ref;
  33981. const {
  33982. color,
  33983. customColor
  33984. } = attributes; // the hr support changing color using border-color, since border-color
  33985. // is not yet supported in the color palette, we use background-color
  33986. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); // the dots styles uses text for the dots, to change those dots color is
  33987. // using color, not backgroundColor
  33988. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color);
  33989. const className = classnames_default()({
  33990. 'has-text-color has-background': color || customColor,
  33991. [backgroundClass]: backgroundClass,
  33992. [colorClass]: colorClass
  33993. });
  33994. const style = {
  33995. backgroundColor: backgroundClass ? undefined : customColor,
  33996. color: colorClass ? undefined : customColor
  33997. };
  33998. return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  33999. className,
  34000. style
  34001. }));
  34002. },
  34003. migrate(attributes) {
  34004. const {
  34005. color,
  34006. customColor
  34007. } = attributes;
  34008. return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['color', 'customColor']),
  34009. backgroundColor: color ? color : undefined,
  34010. opacity: 'css',
  34011. style: customColor ? {
  34012. color: {
  34013. background: customColor
  34014. }
  34015. } : undefined
  34016. };
  34017. }
  34018. };
  34019. /* harmony default export */ var separator_deprecated = ([separator_deprecated_v1]);
  34020. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js
  34021. /**
  34022. * WordPress dependencies
  34023. */
  34024. /**
  34025. * Internal dependencies
  34026. */
  34027. const separator_metadata = {
  34028. $schema: "https://schemas.wp.org/trunk/block.json",
  34029. apiVersion: 2,
  34030. name: "core/separator",
  34031. title: "Separator",
  34032. category: "design",
  34033. description: "Create a break between ideas or sections with a horizontal separator.",
  34034. keywords: ["horizontal-line", "hr", "divider"],
  34035. textdomain: "default",
  34036. attributes: {
  34037. opacity: {
  34038. type: "string",
  34039. "default": "alpha-channel"
  34040. }
  34041. },
  34042. supports: {
  34043. anchor: true,
  34044. align: ["center", "wide", "full"],
  34045. color: {
  34046. __experimentalSkipSerialization: true,
  34047. gradients: true,
  34048. background: true,
  34049. text: false,
  34050. __experimentalDefaultControls: {
  34051. background: true
  34052. }
  34053. }
  34054. },
  34055. styles: [{
  34056. name: "default",
  34057. label: "Default",
  34058. isDefault: true
  34059. }, {
  34060. name: "wide",
  34061. label: "Wide Line"
  34062. }, {
  34063. name: "dots",
  34064. label: "Dots"
  34065. }],
  34066. editorStyle: "wp-block-separator-editor",
  34067. style: "wp-block-separator"
  34068. };
  34069. const {
  34070. name: separator_name
  34071. } = separator_metadata;
  34072. const separator_settings = {
  34073. icon: library_separator,
  34074. example: {
  34075. attributes: {
  34076. customColor: '#065174',
  34077. className: 'is-style-wide'
  34078. }
  34079. },
  34080. transforms: separator_transforms,
  34081. edit: SeparatorEdit,
  34082. save: separatorSave,
  34083. deprecated: separator_deprecated
  34084. };
  34085. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js
  34086. /**
  34087. * WordPress dependencies
  34088. */
  34089. const shortcode = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34090. viewBox: "0 0 24 24",
  34091. xmlns: "http://www.w3.org/2000/svg"
  34092. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34093. d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"
  34094. }));
  34095. /* harmony default export */ var library_shortcode = (shortcode);
  34096. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
  34097. /**
  34098. * WordPress dependencies
  34099. */
  34100. function ShortcodeEdit(_ref) {
  34101. let {
  34102. attributes,
  34103. setAttributes
  34104. } = _ref;
  34105. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
  34106. const inputId = `blocks-shortcode-input-${instanceId}`;
  34107. return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34108. className: 'components-placeholder'
  34109. }), (0,external_wp_element_namespaceObject.createElement)("label", {
  34110. htmlFor: inputId,
  34111. className: "components-placeholder__label"
  34112. }, (0,external_wp_element_namespaceObject.createElement)(icon, {
  34113. icon: library_shortcode
  34114. }), (0,external_wp_i18n_namespaceObject.__)('Shortcode')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
  34115. className: "blocks-shortcode__textarea",
  34116. id: inputId,
  34117. value: attributes.text,
  34118. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'),
  34119. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'),
  34120. onChange: text => setAttributes({
  34121. text
  34122. })
  34123. }));
  34124. }
  34125. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
  34126. /**
  34127. * WordPress dependencies
  34128. */
  34129. function shortcode_save_save(_ref) {
  34130. let {
  34131. attributes
  34132. } = _ref;
  34133. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.text);
  34134. }
  34135. ;// CONCATENATED MODULE: external ["wp","autop"]
  34136. var external_wp_autop_namespaceObject = window["wp"]["autop"];
  34137. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
  34138. /**
  34139. * WordPress dependencies
  34140. */
  34141. const shortcode_transforms_transforms = {
  34142. from: [{
  34143. type: 'shortcode',
  34144. // Per "Shortcode names should be all lowercase and use all
  34145. // letters, but numbers and underscores should work fine too.
  34146. // Be wary of using hyphens (dashes), you'll be better off not
  34147. // using them." in https://codex.wordpress.org/Shortcode_API
  34148. // Require that the first character be a letter. This notably
  34149. // prevents footnote markings ([1]) from being caught as
  34150. // shortcodes.
  34151. tag: '[a-z][a-z0-9_-]*',
  34152. attributes: {
  34153. text: {
  34154. type: 'string',
  34155. shortcode: (attrs, _ref) => {
  34156. let {
  34157. content
  34158. } = _ref;
  34159. return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content));
  34160. }
  34161. }
  34162. },
  34163. priority: 20
  34164. }]
  34165. };
  34166. /* harmony default export */ var shortcode_transforms = (shortcode_transforms_transforms);
  34167. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
  34168. /**
  34169. * WordPress dependencies
  34170. */
  34171. /**
  34172. * Internal dependencies
  34173. */
  34174. const shortcode_metadata = {
  34175. $schema: "https://schemas.wp.org/trunk/block.json",
  34176. apiVersion: 2,
  34177. name: "core/shortcode",
  34178. title: "Shortcode",
  34179. category: "widgets",
  34180. description: "Insert additional custom elements with a WordPress shortcode.",
  34181. textdomain: "default",
  34182. attributes: {
  34183. text: {
  34184. type: "string",
  34185. source: "html"
  34186. }
  34187. },
  34188. supports: {
  34189. className: false,
  34190. customClassName: false,
  34191. html: false
  34192. },
  34193. editorStyle: "wp-block-shortcode-editor"
  34194. };
  34195. const {
  34196. name: shortcode_name
  34197. } = shortcode_metadata;
  34198. const shortcode_settings = {
  34199. icon: library_shortcode,
  34200. transforms: shortcode_transforms,
  34201. edit: ShortcodeEdit,
  34202. save: shortcode_save_save
  34203. };
  34204. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js
  34205. /**
  34206. * WordPress dependencies
  34207. */
  34208. const siteLogo = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34209. xmlns: "http://www.w3.org/2000/svg",
  34210. viewBox: "0 0 24 24"
  34211. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34212. d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"
  34213. }));
  34214. /* harmony default export */ var site_logo = (siteLogo);
  34215. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
  34216. /**
  34217. * External dependencies
  34218. */
  34219. /**
  34220. * WordPress dependencies
  34221. */
  34222. /**
  34223. * Internal dependencies
  34224. */
  34225. /**
  34226. * Module constants
  34227. */
  34228. const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image'];
  34229. const ACCEPT_MEDIA_STRING = 'image/*';
  34230. const SiteLogo = _ref => {
  34231. let {
  34232. alt,
  34233. attributes: {
  34234. align,
  34235. width,
  34236. height,
  34237. isLink,
  34238. linkTarget,
  34239. shouldSyncIcon
  34240. },
  34241. containerRef,
  34242. isSelected,
  34243. setAttributes,
  34244. setLogo,
  34245. logoUrl,
  34246. siteUrl,
  34247. logoId,
  34248. iconId,
  34249. setIcon,
  34250. canUserEdit
  34251. } = _ref;
  34252. const clientWidth = useClientWidth(containerRef, [align]);
  34253. const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
  34254. const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
  34255. const isResizable = !isWideAligned && isLargeViewport;
  34256. const [{
  34257. naturalWidth,
  34258. naturalHeight
  34259. }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
  34260. const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
  34261. const {
  34262. toggleSelection
  34263. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  34264. const classes = classnames_default()('custom-logo-link', {
  34265. 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl)
  34266. });
  34267. const {
  34268. imageEditing,
  34269. maxWidth,
  34270. title
  34271. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34272. const {
  34273. getSettings
  34274. } = select(external_wp_blockEditor_namespaceObject.store);
  34275. const siteEntities = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'site');
  34276. return {
  34277. title: siteEntities.title,
  34278. ...(0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'maxWidth'])
  34279. };
  34280. }, []);
  34281. (0,external_wp_element_namespaceObject.useEffect)(() => {
  34282. // Turn the `Use as site icon` toggle off if it is on but the logo and icon have
  34283. // fallen out of sync. This can happen if the toggle is saved in the `on` position,
  34284. // but changes are later made to the site icon in the Customizer.
  34285. if (shouldSyncIcon && logoId !== iconId) {
  34286. setAttributes({
  34287. shouldSyncIcon: false
  34288. });
  34289. }
  34290. }, []);
  34291. (0,external_wp_element_namespaceObject.useEffect)(() => {
  34292. if (!isSelected) {
  34293. setIsEditingImage(false);
  34294. }
  34295. }, [isSelected]);
  34296. function onResizeStart() {
  34297. toggleSelection(false);
  34298. }
  34299. function onResizeStop() {
  34300. toggleSelection(true);
  34301. }
  34302. const img = (0,external_wp_element_namespaceObject.createElement)("img", {
  34303. className: "custom-logo",
  34304. src: logoUrl,
  34305. alt: alt,
  34306. onLoad: event => {
  34307. setNaturalSize((0,external_lodash_namespaceObject.pick)(event.target, ['naturalWidth', 'naturalHeight']));
  34308. }
  34309. });
  34310. let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but
  34311. // should direct focus to block.
  34312. if (isLink) {
  34313. imgWrapper =
  34314. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  34315. (0,external_wp_element_namespaceObject.createElement)("a", {
  34316. href: siteUrl,
  34317. className: classes,
  34318. rel: "home",
  34319. title: title,
  34320. onClick: event => event.preventDefault()
  34321. }, img)
  34322. /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  34323. ;
  34324. }
  34325. let imageWidthWithinContainer;
  34326. if (clientWidth && naturalWidth && naturalHeight) {
  34327. const exceedMaxWidth = naturalWidth > clientWidth;
  34328. imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  34329. }
  34330. if (!isResizable || !imageWidthWithinContainer) {
  34331. return (0,external_wp_element_namespaceObject.createElement)("div", {
  34332. style: {
  34333. width,
  34334. height
  34335. }
  34336. }, imgWrapper);
  34337. } // Set the default width to a responsible size.
  34338. // Note that this width is also set in the attached frontend CSS file.
  34339. const defaultWidth = 120;
  34340. const currentWidth = width || defaultWidth;
  34341. const ratio = naturalWidth / naturalHeight;
  34342. const currentHeight = currentWidth / ratio;
  34343. const minWidth = naturalWidth < naturalHeight ? MIN_SIZE : Math.ceil(MIN_SIZE * ratio);
  34344. const minHeight = naturalHeight < naturalWidth ? MIN_SIZE : Math.ceil(MIN_SIZE / ratio); // With the current implementation of ResizableBox, an image needs an
  34345. // explicit pixel value for the max-width. In absence of being able to
  34346. // set the content-width, this max-width is currently dictated by the
  34347. // vanilla editor style. The following variable adds a buffer to this
  34348. // vanilla style, so 3rd party themes have some wiggleroom. This does,
  34349. // in most cases, allow you to scale the image beyond the width of the
  34350. // main column, though not infinitely.
  34351. // @todo It would be good to revisit this once a content-width variable
  34352. // becomes available.
  34353. const maxWidthBuffer = maxWidth * 2.5;
  34354. let showRightHandle = false;
  34355. let showLeftHandle = false;
  34356. /* eslint-disable no-lonely-if */
  34357. // See https://github.com/WordPress/gutenberg/issues/7584.
  34358. if (align === 'center') {
  34359. // When the image is centered, show both handles.
  34360. showRightHandle = true;
  34361. showLeftHandle = true;
  34362. } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
  34363. // In RTL mode the image is on the right by default.
  34364. // Show the right handle and hide the left handle only when it is
  34365. // aligned left. Otherwise always show the left handle.
  34366. if (align === 'left') {
  34367. showRightHandle = true;
  34368. } else {
  34369. showLeftHandle = true;
  34370. }
  34371. } else {
  34372. // Show the left handle and hide the right handle only when the
  34373. // image is aligned right. Otherwise always show the right handle.
  34374. if (align === 'right') {
  34375. showLeftHandle = true;
  34376. } else {
  34377. showRightHandle = true;
  34378. }
  34379. }
  34380. /* eslint-enable no-lonely-if */
  34381. const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing;
  34382. const imgEdit = canEditImage && isEditingImage ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
  34383. id: logoId,
  34384. url: logoUrl,
  34385. naturalWidth: naturalWidth,
  34386. naturalHeight: naturalHeight,
  34387. clientWidth: clientWidth,
  34388. onSaveImage: imageAttributes => {
  34389. setLogo(imageAttributes.id);
  34390. },
  34391. isEditing: isEditingImage,
  34392. onFinishEditing: () => setIsEditingImage(false)
  34393. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
  34394. url: logoUrl,
  34395. width: currentWidth,
  34396. height: currentHeight,
  34397. clientWidth: clientWidth,
  34398. naturalHeight: naturalHeight,
  34399. naturalWidth: naturalWidth
  34400. })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
  34401. size: {
  34402. width: currentWidth,
  34403. height: currentHeight
  34404. },
  34405. showHandle: isSelected,
  34406. minWidth: minWidth,
  34407. maxWidth: maxWidthBuffer,
  34408. minHeight: minHeight,
  34409. maxHeight: maxWidthBuffer / ratio,
  34410. lockAspectRatio: true,
  34411. enable: {
  34412. top: false,
  34413. right: showRightHandle,
  34414. bottom: true,
  34415. left: showLeftHandle
  34416. },
  34417. onResizeStart: onResizeStart,
  34418. onResizeStop: (event, direction, elt, delta) => {
  34419. onResizeStop();
  34420. setAttributes({
  34421. width: parseInt(currentWidth + delta.width, 10),
  34422. height: parseInt(currentHeight + delta.height, 10)
  34423. });
  34424. }
  34425. }, imgWrapper);
  34426. const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
  34427. a: // eslint-disable-next-line jsx-a11y/anchor-has-content
  34428. (0,external_wp_element_namespaceObject.createElement)("a", {
  34429. href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
  34430. target: "_blank",
  34431. rel: "noopener noreferrer"
  34432. })
  34433. });
  34434. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  34435. title: (0,external_wp_i18n_namespaceObject.__)('Settings')
  34436. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  34437. label: (0,external_wp_i18n_namespaceObject.__)('Image width'),
  34438. onChange: newWidth => setAttributes({
  34439. width: newWidth
  34440. }),
  34441. min: minWidth,
  34442. max: maxWidthBuffer,
  34443. initialPosition: Math.min(defaultWidth, maxWidthBuffer),
  34444. value: width || '',
  34445. disabled: !isResizable
  34446. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34447. label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'),
  34448. onChange: () => setAttributes({
  34449. isLink: !isLink
  34450. }),
  34451. checked: isLink
  34452. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34453. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  34454. onChange: value => setAttributes({
  34455. linkTarget: value ? '_blank' : '_self'
  34456. }),
  34457. checked: linkTarget === '_blank'
  34458. })), canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  34459. label: (0,external_wp_i18n_namespaceObject.__)('Use as site icon'),
  34460. onChange: value => {
  34461. setAttributes({
  34462. shouldSyncIcon: value
  34463. });
  34464. setIcon(value ? logoId : undefined);
  34465. },
  34466. checked: !!shouldSyncIcon,
  34467. help: syncSiteIconHelpText
  34468. })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34469. group: "block"
  34470. }, canEditImage && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  34471. onClick: () => setIsEditingImage(true),
  34472. icon: library_crop,
  34473. label: (0,external_wp_i18n_namespaceObject.__)('Crop')
  34474. })), imgEdit);
  34475. };
  34476. function LogoEdit(_ref2) {
  34477. let {
  34478. attributes,
  34479. className,
  34480. setAttributes,
  34481. isSelected
  34482. } = _ref2;
  34483. const {
  34484. width,
  34485. shouldSyncIcon
  34486. } = attributes;
  34487. const [logoUrl, setLogoUrl] = (0,external_wp_element_namespaceObject.useState)();
  34488. const ref = (0,external_wp_element_namespaceObject.useRef)();
  34489. const {
  34490. siteLogoId,
  34491. canUserEdit,
  34492. url,
  34493. siteIconId,
  34494. mediaItemData,
  34495. isRequestingMediaItem
  34496. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34497. const {
  34498. canUser,
  34499. getEntityRecord,
  34500. getEditedEntityRecord
  34501. } = select(external_wp_coreData_namespaceObject.store);
  34502. const siteSettings = getEditedEntityRecord('root', 'site');
  34503. const siteData = getEntityRecord('root', '__unstableBase');
  34504. const _siteLogo = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_logo;
  34505. const _readOnlyLogo = siteData === null || siteData === void 0 ? void 0 : siteData.site_logo;
  34506. const _canUserEdit = canUser('update', 'settings');
  34507. const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
  34508. const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
  34509. const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, {
  34510. context: 'view'
  34511. });
  34512. const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
  34513. context: 'view'
  34514. }]);
  34515. return {
  34516. siteLogoId: _siteLogoId,
  34517. canUserEdit: _canUserEdit,
  34518. url: siteData === null || siteData === void 0 ? void 0 : siteData.url,
  34519. mediaItemData: mediaItem,
  34520. isRequestingMediaItem: _isRequestingMediaItem,
  34521. siteIconId: _siteIconId
  34522. };
  34523. }, []);
  34524. const {
  34525. editEntityRecord
  34526. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  34527. const setLogo = function (newValue) {
  34528. let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  34529. // `shouldForceSync` is used to force syncing when the attribute
  34530. // may not have updated yet.
  34531. if (shouldSyncIcon || shouldForceSync) {
  34532. setIcon(newValue);
  34533. }
  34534. editEntityRecord('root', 'site', undefined, {
  34535. site_logo: newValue
  34536. });
  34537. };
  34538. const setIcon = newValue => // The new value needs to be `null` to reset the Site Icon.
  34539. editEntityRecord('root', 'site', undefined, {
  34540. site_icon: newValue !== null && newValue !== void 0 ? newValue : null
  34541. });
  34542. let alt = null;
  34543. if (mediaItemData) {
  34544. alt = mediaItemData.alt_text;
  34545. if (logoUrl !== mediaItemData.source_url) {
  34546. setLogoUrl(mediaItemData.source_url);
  34547. }
  34548. }
  34549. const onInitialSelectLogo = media => {
  34550. // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
  34551. // site icon, automatically sync the logo to the icon.
  34552. if (shouldSyncIcon === undefined) {
  34553. const shouldForceSync = !siteIconId;
  34554. setAttributes({
  34555. shouldSyncIcon: shouldForceSync
  34556. }); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
  34557. // the time `setLogo` is called, pass an argument to force the syncing.
  34558. onSelectLogo(media, shouldForceSync);
  34559. return;
  34560. }
  34561. onSelectLogo(media);
  34562. };
  34563. const onSelectLogo = function (media) {
  34564. let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  34565. if (!media) {
  34566. return;
  34567. }
  34568. if (!media.id && media.url) {
  34569. // This is a temporary blob image.
  34570. setLogo(undefined);
  34571. setLogoUrl(media.url);
  34572. return;
  34573. }
  34574. setLogo(media.id, shouldForceSync);
  34575. };
  34576. const onRemoveLogo = () => {
  34577. setLogo(null);
  34578. setLogoUrl(undefined);
  34579. setAttributes({
  34580. width: undefined
  34581. });
  34582. };
  34583. const {
  34584. createErrorNotice
  34585. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  34586. const onUploadError = message => {
  34587. createErrorNotice(message[2], {
  34588. type: 'snackbar'
  34589. });
  34590. };
  34591. const controls = canUserEdit && logoUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34592. group: "other"
  34593. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  34594. mediaURL: logoUrl,
  34595. allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
  34596. accept: ACCEPT_MEDIA_STRING,
  34597. onSelect: onSelectLogo,
  34598. onError: onUploadError
  34599. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  34600. onClick: onRemoveLogo
  34601. }, (0,external_wp_i18n_namespaceObject.__)('Reset'))));
  34602. let logoImage;
  34603. const isLoading = siteLogoId === undefined || isRequestingMediaItem;
  34604. if (isLoading) {
  34605. logoImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null);
  34606. }
  34607. if (!!logoUrl) {
  34608. logoImage = (0,external_wp_element_namespaceObject.createElement)(SiteLogo, {
  34609. alt: alt,
  34610. attributes: attributes,
  34611. className: className,
  34612. containerRef: ref,
  34613. isSelected: isSelected,
  34614. setAttributes: setAttributes,
  34615. logoUrl: logoUrl,
  34616. setLogo: setLogo,
  34617. logoId: (mediaItemData === null || mediaItemData === void 0 ? void 0 : mediaItemData.id) || siteLogoId,
  34618. siteUrl: url,
  34619. setIcon: setIcon,
  34620. iconId: siteIconId,
  34621. canUserEdit: canUserEdit
  34622. });
  34623. }
  34624. const placeholder = content => {
  34625. const placeholderClassName = classnames_default()('block-editor-media-placeholder', className);
  34626. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  34627. className: placeholderClassName,
  34628. preview: logoImage
  34629. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34630. className: "components-placeholder__illustration",
  34631. fill: "none",
  34632. xmlns: "http://www.w3.org/2000/svg",
  34633. viewBox: "0 0 60 60"
  34634. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34635. vectorEffect: "non-scaling-stroke",
  34636. d: "m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"
  34637. })), content);
  34638. };
  34639. const classes = classnames_default()(className, {
  34640. 'is-default-size': !width
  34641. });
  34642. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34643. ref,
  34644. className: classes
  34645. });
  34646. const label = (0,external_wp_i18n_namespaceObject.__)('Add a site logo');
  34647. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  34648. className: "site-logo_placeholder"
  34649. }, isLoading && (0,external_wp_element_namespaceObject.createElement)("span", {
  34650. className: "components-placeholder__preview"
  34651. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  34652. onSelect: onInitialSelectLogo,
  34653. accept: ACCEPT_MEDIA_STRING,
  34654. allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
  34655. onError: onUploadError,
  34656. placeholder: placeholder,
  34657. mediaLibraryButton: _ref3 => {
  34658. let {
  34659. open
  34660. } = _ref3;
  34661. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  34662. icon: library_upload,
  34663. variant: "primary",
  34664. label: label,
  34665. showTooltip: true,
  34666. tooltipPosition: "top center",
  34667. onClick: () => {
  34668. open();
  34669. }
  34670. });
  34671. }
  34672. }));
  34673. }
  34674. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js
  34675. /**
  34676. * WordPress dependencies
  34677. */
  34678. const site_logo_transforms_transforms = {
  34679. to: [{
  34680. type: 'block',
  34681. blocks: ['core/site-title'],
  34682. transform: _ref => {
  34683. let {
  34684. isLink,
  34685. linkTarget
  34686. } = _ref;
  34687. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', {
  34688. isLink,
  34689. linkTarget
  34690. });
  34691. }
  34692. }]
  34693. };
  34694. /* harmony default export */ var site_logo_transforms = (site_logo_transforms_transforms);
  34695. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
  34696. /**
  34697. * WordPress dependencies
  34698. */
  34699. /**
  34700. * Internal dependencies
  34701. */
  34702. const site_logo_metadata = {
  34703. $schema: "https://schemas.wp.org/trunk/block.json",
  34704. apiVersion: 2,
  34705. name: "core/site-logo",
  34706. title: "Site Logo",
  34707. category: "theme",
  34708. description: "Display a graphic to represent this site. Update the block, and the changes apply everywhere it\u2019s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
  34709. textdomain: "default",
  34710. attributes: {
  34711. width: {
  34712. type: "number"
  34713. },
  34714. isLink: {
  34715. type: "boolean",
  34716. "default": true
  34717. },
  34718. linkTarget: {
  34719. type: "string",
  34720. "default": "_self"
  34721. },
  34722. shouldSyncIcon: {
  34723. type: "boolean"
  34724. }
  34725. },
  34726. example: {
  34727. viewportWidth: 500,
  34728. attributes: {
  34729. width: 350,
  34730. className: "block-editor-block-types-list__site-logo-example"
  34731. }
  34732. },
  34733. supports: {
  34734. html: false,
  34735. align: true,
  34736. alignWide: false,
  34737. color: {
  34738. __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before",
  34739. text: false,
  34740. background: false
  34741. }
  34742. },
  34743. styles: [{
  34744. name: "default",
  34745. label: "Default",
  34746. isDefault: true
  34747. }, {
  34748. name: "rounded",
  34749. label: "Rounded"
  34750. }],
  34751. editorStyle: "wp-block-site-logo-editor",
  34752. style: "wp-block-site-logo"
  34753. };
  34754. const {
  34755. name: site_logo_name
  34756. } = site_logo_metadata;
  34757. const site_logo_settings = {
  34758. icon: site_logo,
  34759. edit: LogoEdit,
  34760. transforms: site_logo_transforms
  34761. };
  34762. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
  34763. /**
  34764. * External dependencies
  34765. */
  34766. /**
  34767. * WordPress dependencies
  34768. */
  34769. function SiteTaglineEdit(_ref) {
  34770. let {
  34771. attributes,
  34772. setAttributes,
  34773. insertBlocksAfter
  34774. } = _ref;
  34775. const {
  34776. textAlign
  34777. } = attributes;
  34778. const [siteTagline, setSiteTagline] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'description');
  34779. const {
  34780. canUserEdit,
  34781. readOnlySiteTagLine
  34782. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  34783. const {
  34784. canUser,
  34785. getEntityRecord
  34786. } = select(external_wp_coreData_namespaceObject.store);
  34787. const siteData = getEntityRecord('root', '__unstableBase');
  34788. return {
  34789. canUserEdit: canUser('update', 'settings'),
  34790. readOnlySiteTagLine: siteData === null || siteData === void 0 ? void 0 : siteData.description
  34791. };
  34792. }, []);
  34793. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  34794. className: classnames_default()({
  34795. [`has-text-align-${textAlign}`]: textAlign,
  34796. 'wp-block-site-tagline__placeholder': !canUserEdit && !readOnlySiteTagLine
  34797. })
  34798. });
  34799. const siteTaglineContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  34800. allowedFormats: [],
  34801. onChange: setSiteTagline,
  34802. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'),
  34803. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'),
  34804. tagName: "p",
  34805. value: siteTagline,
  34806. disableLineBreaks: true,
  34807. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  34808. }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)("p", blockProps, readOnlySiteTagLine || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder'));
  34809. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  34810. group: "block"
  34811. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  34812. onChange: newAlign => setAttributes({
  34813. textAlign: newAlign
  34814. }),
  34815. value: textAlign
  34816. })), siteTaglineContent);
  34817. }
  34818. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
  34819. /**
  34820. * WordPress dependencies
  34821. */
  34822. /* harmony default export */ var site_tagline_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  34823. xmlns: "http://www.w3.org/2000/svg",
  34824. width: "24",
  34825. height: "24"
  34826. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  34827. fill: "none",
  34828. d: "M0 0h24v24H0z"
  34829. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  34830. d: "M4 9h16v2H4V9zm0 4h10v2H4v-2z"
  34831. })));
  34832. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
  34833. /**
  34834. * Internal dependencies
  34835. */
  34836. const site_tagline_deprecated_v1 = {
  34837. attributes: {
  34838. textAlign: {
  34839. type: 'string'
  34840. }
  34841. },
  34842. supports: {
  34843. align: ['wide', 'full'],
  34844. html: false,
  34845. color: {
  34846. gradients: true
  34847. },
  34848. spacing: {
  34849. margin: true,
  34850. padding: true
  34851. },
  34852. typography: {
  34853. fontSize: true,
  34854. lineHeight: true,
  34855. __experimentalFontFamily: true,
  34856. __experimentalTextTransform: true,
  34857. __experimentalFontStyle: true,
  34858. __experimentalFontWeight: true,
  34859. __experimentalLetterSpacing: true
  34860. }
  34861. },
  34862. save() {
  34863. return null;
  34864. },
  34865. migrate: migrate_font_family,
  34866. isEligible(_ref) {
  34867. var _style$typography;
  34868. let {
  34869. style
  34870. } = _ref;
  34871. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  34872. }
  34873. };
  34874. /**
  34875. * New deprecations need to be placed first
  34876. * for them to have higher priority.
  34877. *
  34878. * Old deprecations may need to be updated as well.
  34879. *
  34880. * See block-deprecation.md
  34881. */
  34882. /* harmony default export */ var site_tagline_deprecated = ([site_tagline_deprecated_v1]);
  34883. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
  34884. /**
  34885. * Internal dependencies
  34886. */
  34887. const site_tagline_metadata = {
  34888. $schema: "https://schemas.wp.org/trunk/block.json",
  34889. apiVersion: 2,
  34890. name: "core/site-tagline",
  34891. title: "Site Tagline",
  34892. category: "theme",
  34893. description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
  34894. keywords: ["description"],
  34895. textdomain: "default",
  34896. attributes: {
  34897. textAlign: {
  34898. type: "string"
  34899. }
  34900. },
  34901. supports: {
  34902. align: ["wide", "full"],
  34903. html: false,
  34904. color: {
  34905. gradients: true,
  34906. __experimentalDefaultControls: {
  34907. background: true,
  34908. text: true
  34909. }
  34910. },
  34911. spacing: {
  34912. margin: true,
  34913. padding: true
  34914. },
  34915. typography: {
  34916. fontSize: true,
  34917. lineHeight: true,
  34918. __experimentalFontFamily: true,
  34919. __experimentalTextTransform: true,
  34920. __experimentalFontStyle: true,
  34921. __experimentalFontWeight: true,
  34922. __experimentalLetterSpacing: true,
  34923. __experimentalDefaultControls: {
  34924. fontSize: true
  34925. }
  34926. }
  34927. },
  34928. editorStyle: "wp-block-site-tagline-editor"
  34929. };
  34930. const {
  34931. name: site_tagline_name
  34932. } = site_tagline_metadata;
  34933. const site_tagline_settings = {
  34934. icon: site_tagline_icon,
  34935. edit: SiteTaglineEdit,
  34936. deprecated: site_tagline_deprecated
  34937. };
  34938. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js
  34939. /**
  34940. * WordPress dependencies
  34941. */
  34942. const mapMarker = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  34943. xmlns: "https://www.w3.org/2000/svg",
  34944. viewBox: "0 0 24 24"
  34945. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  34946. d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"
  34947. }));
  34948. /* harmony default export */ var map_marker = (mapMarker);
  34949. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-icon.js
  34950. /**
  34951. * WordPress dependencies
  34952. */
  34953. function LevelIcon(_ref) {
  34954. let {
  34955. level,
  34956. isPressed = false
  34957. } = _ref;
  34958. if (level === 0) return library_paragraph;
  34959. const levelToPath = {
  34960. 1: 'M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z',
  34961. 2: 'M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z',
  34962. 3: 'M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z',
  34963. 4: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z',
  34964. 5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
  34965. 6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
  34966. };
  34967. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  34968. width: "20",
  34969. height: "20",
  34970. viewBox: "0 0 20 20",
  34971. xmlns: "http://www.w3.org/2000/svg",
  34972. isPressed: isPressed
  34973. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  34974. d: levelToPath[level]
  34975. }));
  34976. }
  34977. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-toolbar.js
  34978. /**
  34979. * WordPress dependencies
  34980. */
  34981. /**
  34982. * Internal dependencies
  34983. */
  34984. function LevelControl(_ref) {
  34985. let {
  34986. level,
  34987. onChange
  34988. } = _ref;
  34989. const allControls = [1, 2, 3, 4, 5, 6, 0].map(currentLevel => {
  34990. const isActive = currentLevel === level;
  34991. return {
  34992. icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
  34993. level: currentLevel,
  34994. isPressed: isActive
  34995. }),
  34996. title: currentLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)('Paragraph') : // translators: %s: heading level e.g: "1", "2", "3"
  34997. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Heading %d'), currentLevel),
  34998. isActive,
  34999. onClick: () => onChange(currentLevel)
  35000. };
  35001. });
  35002. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  35003. label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
  35004. icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
  35005. level: level
  35006. }),
  35007. controls: allControls
  35008. });
  35009. }
  35010. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js
  35011. /**
  35012. * External dependencies
  35013. */
  35014. /**
  35015. * WordPress dependencies
  35016. */
  35017. /**
  35018. * Internal dependencies
  35019. */
  35020. function SiteTitleEdit(_ref) {
  35021. let {
  35022. attributes,
  35023. setAttributes,
  35024. insertBlocksAfter
  35025. } = _ref;
  35026. const {
  35027. level,
  35028. textAlign,
  35029. isLink,
  35030. linkTarget
  35031. } = attributes;
  35032. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'title');
  35033. const {
  35034. canUserEdit,
  35035. readOnlyTitle
  35036. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  35037. const {
  35038. canUser,
  35039. getEntityRecord
  35040. } = select(external_wp_coreData_namespaceObject.store);
  35041. const siteData = getEntityRecord('root', '__unstableBase');
  35042. return {
  35043. canUserEdit: canUser('update', 'settings'),
  35044. readOnlyTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteData === null || siteData === void 0 ? void 0 : siteData.name)
  35045. };
  35046. }, []);
  35047. const TagName = level === 0 ? 'p' : `h${level}`;
  35048. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  35049. className: classnames_default()({
  35050. [`has-text-align-${textAlign}`]: textAlign,
  35051. 'wp-block-site-title__placeholder': !canUserEdit && !readOnlyTitle
  35052. })
  35053. });
  35054. const siteTitleContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  35055. tagName: isLink ? 'a' : 'span',
  35056. href: isLink ? '#site-title-pseudo-link' : undefined,
  35057. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'),
  35058. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'),
  35059. value: title,
  35060. onChange: setTitle,
  35061. allowedFormats: [],
  35062. disableLineBreaks: true,
  35063. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
  35064. })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
  35065. href: "#site-title-pseudo-link",
  35066. onClick: event => event.preventDefault()
  35067. }, readOnlyTitle || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')) : (0,external_wp_element_namespaceObject.createElement)("span", null, title || readOnlyTitle));
  35068. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  35069. group: "block"
  35070. }, (0,external_wp_element_namespaceObject.createElement)(LevelControl, {
  35071. level: level,
  35072. onChange: newLevel => setAttributes({
  35073. level: newLevel
  35074. })
  35075. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  35076. value: textAlign,
  35077. onChange: nextAlign => {
  35078. setAttributes({
  35079. textAlign: nextAlign
  35080. });
  35081. }
  35082. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  35083. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  35084. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  35085. label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
  35086. onChange: () => setAttributes({
  35087. isLink: !isLink
  35088. }),
  35089. checked: isLink
  35090. }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  35091. label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
  35092. onChange: value => setAttributes({
  35093. linkTarget: value ? '_blank' : '_self'
  35094. }),
  35095. checked: linkTarget === '_blank'
  35096. }))), siteTitleContent);
  35097. }
  35098. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
  35099. /**
  35100. * Internal dependencies
  35101. */
  35102. const site_title_deprecated_v1 = {
  35103. attributes: {
  35104. level: {
  35105. type: 'number',
  35106. default: 1
  35107. },
  35108. textAlign: {
  35109. type: 'string'
  35110. },
  35111. isLink: {
  35112. type: 'boolean',
  35113. default: true
  35114. },
  35115. linkTarget: {
  35116. type: 'string',
  35117. default: '_self'
  35118. }
  35119. },
  35120. supports: {
  35121. align: ['wide', 'full'],
  35122. html: false,
  35123. color: {
  35124. gradients: true,
  35125. link: true
  35126. },
  35127. spacing: {
  35128. padding: true,
  35129. margin: true
  35130. },
  35131. typography: {
  35132. fontSize: true,
  35133. lineHeight: true,
  35134. __experimentalFontFamily: true,
  35135. __experimentalTextTransform: true,
  35136. __experimentalFontStyle: true,
  35137. __experimentalFontWeight: true,
  35138. __experimentalLetterSpacing: true
  35139. }
  35140. },
  35141. save() {
  35142. return null;
  35143. },
  35144. migrate: migrate_font_family,
  35145. isEligible(_ref) {
  35146. var _style$typography;
  35147. let {
  35148. style
  35149. } = _ref;
  35150. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  35151. }
  35152. };
  35153. /**
  35154. * New deprecations need to be placed first
  35155. * for them to have higher priority.
  35156. *
  35157. * Old deprecations may need to be updated as well.
  35158. *
  35159. * See block-deprecation.md
  35160. */
  35161. /* harmony default export */ var site_title_deprecated = ([site_title_deprecated_v1]);
  35162. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js
  35163. /**
  35164. * WordPress dependencies
  35165. */
  35166. const site_title_transforms_transforms = {
  35167. to: [{
  35168. type: 'block',
  35169. blocks: ['core/site-logo'],
  35170. transform: _ref => {
  35171. let {
  35172. isLink,
  35173. linkTarget
  35174. } = _ref;
  35175. return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', {
  35176. isLink,
  35177. linkTarget
  35178. });
  35179. }
  35180. }]
  35181. };
  35182. /* harmony default export */ var site_title_transforms = (site_title_transforms_transforms);
  35183. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
  35184. /**
  35185. * WordPress dependencies
  35186. */
  35187. /**
  35188. * Internal dependencies
  35189. */
  35190. const site_title_metadata = {
  35191. $schema: "https://schemas.wp.org/trunk/block.json",
  35192. apiVersion: 2,
  35193. name: "core/site-title",
  35194. title: "Site Title",
  35195. category: "theme",
  35196. description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.",
  35197. textdomain: "default",
  35198. attributes: {
  35199. level: {
  35200. type: "number",
  35201. "default": 1
  35202. },
  35203. textAlign: {
  35204. type: "string"
  35205. },
  35206. isLink: {
  35207. type: "boolean",
  35208. "default": true
  35209. },
  35210. linkTarget: {
  35211. type: "string",
  35212. "default": "_self"
  35213. }
  35214. },
  35215. example: {
  35216. viewportWidth: 500
  35217. },
  35218. supports: {
  35219. align: ["wide", "full"],
  35220. html: false,
  35221. color: {
  35222. gradients: true,
  35223. link: true,
  35224. __experimentalDefaultControls: {
  35225. background: true,
  35226. text: true,
  35227. link: true
  35228. }
  35229. },
  35230. spacing: {
  35231. padding: true,
  35232. margin: true
  35233. },
  35234. typography: {
  35235. fontSize: true,
  35236. lineHeight: true,
  35237. __experimentalFontFamily: true,
  35238. __experimentalTextTransform: true,
  35239. __experimentalFontStyle: true,
  35240. __experimentalFontWeight: true,
  35241. __experimentalLetterSpacing: true,
  35242. __experimentalDefaultControls: {
  35243. fontSize: true,
  35244. lineHeight: true,
  35245. fontAppearance: true,
  35246. letterSpacing: true,
  35247. textTransform: true
  35248. }
  35249. }
  35250. },
  35251. editorStyle: "wp-block-site-title-editor"
  35252. };
  35253. const {
  35254. name: site_title_name
  35255. } = site_title_metadata;
  35256. const site_title_settings = {
  35257. icon: map_marker,
  35258. edit: SiteTitleEdit,
  35259. transforms: site_title_transforms,
  35260. deprecated: site_title_deprecated
  35261. };
  35262. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js
  35263. /**
  35264. * WordPress dependencies
  35265. */
  35266. const share = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35267. viewBox: "0 0 24 24",
  35268. xmlns: "http://www.w3.org/2000/svg"
  35269. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35270. d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"
  35271. }));
  35272. /* harmony default export */ var library_share = (share);
  35273. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
  35274. /**
  35275. * WordPress dependencies
  35276. */
  35277. const keyboardReturn = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35278. xmlns: "http://www.w3.org/2000/svg",
  35279. viewBox: "-2 -2 24 24"
  35280. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35281. d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"
  35282. }));
  35283. /* harmony default export */ var keyboard_return = (keyboardReturn);
  35284. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js
  35285. /**
  35286. * WordPress dependencies
  35287. */
  35288. const WordPressIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35289. width: "24",
  35290. height: "24",
  35291. viewBox: "0 0 24 24",
  35292. version: "1.1",
  35293. xmlns: "http://www.w3.org/2000/svg"
  35294. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35295. d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"
  35296. }));
  35297. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
  35298. /**
  35299. * WordPress dependencies
  35300. */
  35301. const FivehundredpxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35302. width: "24",
  35303. height: "24",
  35304. viewBox: "0 0 24 24",
  35305. version: "1.1"
  35306. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35307. d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"
  35308. }));
  35309. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
  35310. /**
  35311. * WordPress dependencies
  35312. */
  35313. const AmazonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35314. width: "24",
  35315. height: "24",
  35316. viewBox: "0 0 24 24",
  35317. version: "1.1"
  35318. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35319. d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"
  35320. }));
  35321. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
  35322. /**
  35323. * WordPress dependencies
  35324. */
  35325. const BandcampIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35326. width: "24",
  35327. height: "24",
  35328. viewBox: "0 0 24 24",
  35329. version: "1.1"
  35330. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35331. d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"
  35332. }));
  35333. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
  35334. /**
  35335. * WordPress dependencies
  35336. */
  35337. const BehanceIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35338. width: "24",
  35339. height: "24",
  35340. viewBox: "0 0 24 24",
  35341. version: "1.1"
  35342. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35343. d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"
  35344. }));
  35345. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
  35346. /**
  35347. * WordPress dependencies
  35348. */
  35349. const ChainIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35350. width: "24",
  35351. height: "24",
  35352. viewBox: "0 0 24 24",
  35353. version: "1.1"
  35354. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35355. d: "M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"
  35356. }));
  35357. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
  35358. /**
  35359. * WordPress dependencies
  35360. */
  35361. const CodepenIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35362. width: "24",
  35363. height: "24",
  35364. viewBox: "0 0 24 24",
  35365. version: "1.1"
  35366. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35367. d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"
  35368. }));
  35369. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
  35370. /**
  35371. * WordPress dependencies
  35372. */
  35373. const DeviantArtIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35374. width: "24",
  35375. height: "24",
  35376. viewBox: "0 0 24 24",
  35377. version: "1.1"
  35378. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35379. d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"
  35380. }));
  35381. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
  35382. /**
  35383. * WordPress dependencies
  35384. */
  35385. const DribbbleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35386. width: "24",
  35387. height: "24",
  35388. viewBox: "0 0 24 24",
  35389. version: "1.1"
  35390. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35391. d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"
  35392. }));
  35393. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
  35394. /**
  35395. * WordPress dependencies
  35396. */
  35397. const DropboxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35398. width: "24",
  35399. height: "24",
  35400. viewBox: "0 0 24 24",
  35401. version: "1.1"
  35402. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35403. d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"
  35404. }));
  35405. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
  35406. /**
  35407. * WordPress dependencies
  35408. */
  35409. const EtsyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35410. width: "24",
  35411. height: "24",
  35412. viewBox: "0 0 24 24",
  35413. version: "1.1"
  35414. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35415. d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"
  35416. }));
  35417. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
  35418. /**
  35419. * WordPress dependencies
  35420. */
  35421. const FacebookIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35422. width: "24",
  35423. height: "24",
  35424. viewBox: "0 0 24 24",
  35425. version: "1.1"
  35426. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35427. d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"
  35428. }));
  35429. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
  35430. /**
  35431. * WordPress dependencies
  35432. */
  35433. const FeedIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35434. width: "24",
  35435. height: "24",
  35436. viewBox: "0 0 24 24",
  35437. version: "1.1"
  35438. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35439. d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"
  35440. }));
  35441. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
  35442. /**
  35443. * WordPress dependencies
  35444. */
  35445. const FlickrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35446. width: "24",
  35447. height: "24",
  35448. viewBox: "0 0 24 24",
  35449. version: "1.1"
  35450. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35451. d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"
  35452. }));
  35453. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
  35454. /**
  35455. * WordPress dependencies
  35456. */
  35457. const FoursquareIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35458. width: "24",
  35459. height: "24",
  35460. viewBox: "0 0 24 24",
  35461. version: "1.1"
  35462. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35463. d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"
  35464. }));
  35465. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
  35466. /**
  35467. * WordPress dependencies
  35468. */
  35469. const GoodreadsIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35470. width: "24",
  35471. height: "24",
  35472. viewBox: "0 0 24 24",
  35473. version: "1.1"
  35474. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35475. d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"
  35476. }));
  35477. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
  35478. /**
  35479. * WordPress dependencies
  35480. */
  35481. const GoogleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35482. width: "24",
  35483. height: "24",
  35484. viewBox: "0 0 24 24",
  35485. version: "1.1"
  35486. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35487. d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"
  35488. }));
  35489. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
  35490. /**
  35491. * WordPress dependencies
  35492. */
  35493. const GitHubIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35494. width: "24",
  35495. height: "24",
  35496. viewBox: "0 0 24 24",
  35497. version: "1.1"
  35498. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35499. d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"
  35500. }));
  35501. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
  35502. /**
  35503. * WordPress dependencies
  35504. */
  35505. const InstagramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35506. width: "24",
  35507. height: "24",
  35508. viewBox: "0 0 24 24",
  35509. version: "1.1"
  35510. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35511. d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"
  35512. }));
  35513. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
  35514. /**
  35515. * WordPress dependencies
  35516. */
  35517. const LastfmIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35518. width: "24",
  35519. height: "24",
  35520. viewBox: "0 0 24 24",
  35521. version: "1.1"
  35522. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35523. d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"
  35524. }));
  35525. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
  35526. /**
  35527. * WordPress dependencies
  35528. */
  35529. const LinkedInIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35530. width: "24",
  35531. height: "24",
  35532. viewBox: "0 0 24 24",
  35533. version: "1.1"
  35534. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35535. d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"
  35536. }));
  35537. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
  35538. /**
  35539. * WordPress dependencies
  35540. */
  35541. const MailIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35542. width: "24",
  35543. height: "24",
  35544. viewBox: "0 0 24 24",
  35545. version: "1.1"
  35546. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35547. d: "M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"
  35548. }));
  35549. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
  35550. /**
  35551. * WordPress dependencies
  35552. */
  35553. const MastodonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35554. width: "24",
  35555. height: "24",
  35556. viewBox: "0 0 24 24",
  35557. version: "1.1"
  35558. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35559. d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"
  35560. }));
  35561. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
  35562. /**
  35563. * WordPress dependencies
  35564. */
  35565. const MeetupIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35566. width: "24",
  35567. height: "24",
  35568. viewBox: "0 0 24 24",
  35569. version: "1.1"
  35570. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35571. d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"
  35572. }));
  35573. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
  35574. /**
  35575. * WordPress dependencies
  35576. */
  35577. const MediumIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35578. width: "24",
  35579. height: "24",
  35580. viewBox: "0 0 24 24",
  35581. version: "1.1"
  35582. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35583. d: "M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"
  35584. }));
  35585. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
  35586. /**
  35587. * WordPress dependencies
  35588. */
  35589. const PatreonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35590. width: "24",
  35591. height: "24",
  35592. viewBox: "0 0 569 546",
  35593. version: "1.1"
  35594. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
  35595. cx: "363",
  35596. cy: "205",
  35597. r: "205"
  35598. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
  35599. width: "100",
  35600. height: "546",
  35601. x: "0",
  35602. y: "0"
  35603. }));
  35604. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
  35605. /**
  35606. * WordPress dependencies
  35607. */
  35608. const PinterestIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35609. width: "24",
  35610. height: "24",
  35611. viewBox: "0 0 24 24",
  35612. version: "1.1"
  35613. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35614. d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"
  35615. }));
  35616. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
  35617. /**
  35618. * WordPress dependencies
  35619. */
  35620. const PocketIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35621. width: "24",
  35622. height: "24",
  35623. viewBox: "0 0 24 24",
  35624. version: "1.1"
  35625. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35626. d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"
  35627. }));
  35628. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
  35629. /**
  35630. * WordPress dependencies
  35631. */
  35632. const RedditIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35633. width: "24",
  35634. height: "24",
  35635. viewBox: "0 0 24 24",
  35636. version: "1.1"
  35637. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35638. d: "M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"
  35639. }));
  35640. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
  35641. /**
  35642. * WordPress dependencies
  35643. */
  35644. const SkypeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35645. width: "24",
  35646. height: "24",
  35647. viewBox: "0 0 24 24",
  35648. version: "1.1"
  35649. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35650. d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"
  35651. }));
  35652. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
  35653. /**
  35654. * WordPress dependencies
  35655. */
  35656. const SnapchatIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35657. width: "24",
  35658. height: "24",
  35659. viewBox: "0 0 24 24",
  35660. version: "1.1"
  35661. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35662. d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"
  35663. }));
  35664. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
  35665. /**
  35666. * WordPress dependencies
  35667. */
  35668. const SoundCloudIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35669. width: "24",
  35670. height: "24",
  35671. viewBox: "0 0 24 24",
  35672. version: "1.1"
  35673. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35674. d: "M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"
  35675. }));
  35676. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
  35677. /**
  35678. * WordPress dependencies
  35679. */
  35680. const SpotifyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35681. width: "24",
  35682. height: "24",
  35683. viewBox: "0 0 24 24",
  35684. version: "1.1"
  35685. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35686. d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"
  35687. }));
  35688. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
  35689. /**
  35690. * WordPress dependencies
  35691. */
  35692. const TelegramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35693. width: "24",
  35694. height: "24",
  35695. viewBox: "0 0 128 128",
  35696. version: "1.1"
  35697. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35698. d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"
  35699. }));
  35700. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
  35701. /**
  35702. * WordPress dependencies
  35703. */
  35704. const TiktokIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35705. width: "24",
  35706. height: "24",
  35707. viewBox: "0 0 32 32",
  35708. version: "1.1"
  35709. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35710. d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"
  35711. }));
  35712. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
  35713. /**
  35714. * WordPress dependencies
  35715. */
  35716. const TumblrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35717. width: "24",
  35718. height: "24",
  35719. viewBox: "0 0 24 24",
  35720. version: "1.1"
  35721. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35722. d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"
  35723. }));
  35724. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
  35725. /**
  35726. * WordPress dependencies
  35727. */
  35728. const TwitchIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35729. width: "24",
  35730. height: "24",
  35731. viewBox: "0 0 24 24",
  35732. version: "1.1"
  35733. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35734. d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"
  35735. }));
  35736. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
  35737. /**
  35738. * WordPress dependencies
  35739. */
  35740. const TwitterIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35741. width: "24",
  35742. height: "24",
  35743. viewBox: "0 0 24 24",
  35744. version: "1.1"
  35745. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35746. d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"
  35747. }));
  35748. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
  35749. /**
  35750. * WordPress dependencies
  35751. */
  35752. const VimeoIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35753. width: "24",
  35754. height: "24",
  35755. viewBox: "0 0 24 24",
  35756. version: "1.1"
  35757. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35758. d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"
  35759. }));
  35760. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
  35761. /**
  35762. * WordPress dependencies
  35763. */
  35764. const VkIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35765. width: "24",
  35766. height: "24",
  35767. viewBox: "0 0 24 24",
  35768. version: "1.1"
  35769. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35770. d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"
  35771. }));
  35772. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
  35773. /**
  35774. * WordPress dependencies
  35775. */
  35776. const YelpIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35777. width: "24",
  35778. height: "24",
  35779. viewBox: "0 0 24 24",
  35780. version: "1.1"
  35781. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35782. d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"
  35783. }));
  35784. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
  35785. /**
  35786. * WordPress dependencies
  35787. */
  35788. const YouTubeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  35789. width: "24",
  35790. height: "24",
  35791. viewBox: "0 0 24 24",
  35792. version: "1.1"
  35793. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  35794. d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"
  35795. }));
  35796. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
  35797. /**
  35798. * Internal dependencies
  35799. */
  35800. const social_link_variations_variations = [{
  35801. isDefault: true,
  35802. name: 'wordpress',
  35803. attributes: {
  35804. service: 'wordpress'
  35805. },
  35806. title: 'WordPress',
  35807. icon: WordPressIcon
  35808. }, {
  35809. name: 'fivehundredpx',
  35810. attributes: {
  35811. service: 'fivehundredpx'
  35812. },
  35813. title: '500px',
  35814. icon: FivehundredpxIcon
  35815. }, {
  35816. name: 'amazon',
  35817. attributes: {
  35818. service: 'amazon'
  35819. },
  35820. title: 'Amazon',
  35821. icon: AmazonIcon
  35822. }, {
  35823. name: 'bandcamp',
  35824. attributes: {
  35825. service: 'bandcamp'
  35826. },
  35827. title: 'Bandcamp',
  35828. icon: BandcampIcon
  35829. }, {
  35830. name: 'behance',
  35831. attributes: {
  35832. service: 'behance'
  35833. },
  35834. title: 'Behance',
  35835. icon: BehanceIcon
  35836. }, {
  35837. name: 'chain',
  35838. attributes: {
  35839. service: 'chain'
  35840. },
  35841. title: 'Link',
  35842. icon: ChainIcon
  35843. }, {
  35844. name: 'codepen',
  35845. attributes: {
  35846. service: 'codepen'
  35847. },
  35848. title: 'CodePen',
  35849. icon: CodepenIcon
  35850. }, {
  35851. name: 'deviantart',
  35852. attributes: {
  35853. service: 'deviantart'
  35854. },
  35855. title: 'DeviantArt',
  35856. icon: DeviantArtIcon
  35857. }, {
  35858. name: 'dribbble',
  35859. attributes: {
  35860. service: 'dribbble'
  35861. },
  35862. title: 'Dribbble',
  35863. icon: DribbbleIcon
  35864. }, {
  35865. name: 'dropbox',
  35866. attributes: {
  35867. service: 'dropbox'
  35868. },
  35869. title: 'Dropbox',
  35870. icon: DropboxIcon
  35871. }, {
  35872. name: 'etsy',
  35873. attributes: {
  35874. service: 'etsy'
  35875. },
  35876. title: 'Etsy',
  35877. icon: EtsyIcon
  35878. }, {
  35879. name: 'facebook',
  35880. attributes: {
  35881. service: 'facebook'
  35882. },
  35883. title: 'Facebook',
  35884. icon: FacebookIcon
  35885. }, {
  35886. name: 'feed',
  35887. attributes: {
  35888. service: 'feed'
  35889. },
  35890. title: 'RSS Feed',
  35891. icon: FeedIcon
  35892. }, {
  35893. name: 'flickr',
  35894. attributes: {
  35895. service: 'flickr'
  35896. },
  35897. title: 'Flickr',
  35898. icon: FlickrIcon
  35899. }, {
  35900. name: 'foursquare',
  35901. attributes: {
  35902. service: 'foursquare'
  35903. },
  35904. title: 'Foursquare',
  35905. icon: FoursquareIcon
  35906. }, {
  35907. name: 'goodreads',
  35908. attributes: {
  35909. service: 'goodreads'
  35910. },
  35911. title: 'Goodreads',
  35912. icon: GoodreadsIcon
  35913. }, {
  35914. name: 'google',
  35915. attributes: {
  35916. service: 'google'
  35917. },
  35918. title: 'Google',
  35919. icon: GoogleIcon
  35920. }, {
  35921. name: 'github',
  35922. attributes: {
  35923. service: 'github'
  35924. },
  35925. title: 'GitHub',
  35926. icon: GitHubIcon
  35927. }, {
  35928. name: 'instagram',
  35929. attributes: {
  35930. service: 'instagram'
  35931. },
  35932. title: 'Instagram',
  35933. icon: InstagramIcon
  35934. }, {
  35935. name: 'lastfm',
  35936. attributes: {
  35937. service: 'lastfm'
  35938. },
  35939. title: 'Last.fm',
  35940. icon: LastfmIcon
  35941. }, {
  35942. name: 'linkedin',
  35943. attributes: {
  35944. service: 'linkedin'
  35945. },
  35946. title: 'LinkedIn',
  35947. icon: LinkedInIcon
  35948. }, {
  35949. name: 'mail',
  35950. attributes: {
  35951. service: 'mail'
  35952. },
  35953. title: 'Mail',
  35954. keywords: ['email', 'e-mail'],
  35955. icon: MailIcon
  35956. }, {
  35957. name: 'mastodon',
  35958. attributes: {
  35959. service: 'mastodon'
  35960. },
  35961. title: 'Mastodon',
  35962. icon: MastodonIcon
  35963. }, {
  35964. name: 'meetup',
  35965. attributes: {
  35966. service: 'meetup'
  35967. },
  35968. title: 'Meetup',
  35969. icon: MeetupIcon
  35970. }, {
  35971. name: 'medium',
  35972. attributes: {
  35973. service: 'medium'
  35974. },
  35975. title: 'Medium',
  35976. icon: MediumIcon
  35977. }, {
  35978. name: 'patreon',
  35979. attributes: {
  35980. service: 'patreon'
  35981. },
  35982. title: 'Patreon',
  35983. icon: PatreonIcon
  35984. }, {
  35985. name: 'pinterest',
  35986. attributes: {
  35987. service: 'pinterest'
  35988. },
  35989. title: 'Pinterest',
  35990. icon: PinterestIcon
  35991. }, {
  35992. name: 'pocket',
  35993. attributes: {
  35994. service: 'pocket'
  35995. },
  35996. title: 'Pocket',
  35997. icon: PocketIcon
  35998. }, {
  35999. name: 'reddit',
  36000. attributes: {
  36001. service: 'reddit'
  36002. },
  36003. title: 'Reddit',
  36004. icon: RedditIcon
  36005. }, {
  36006. name: 'skype',
  36007. attributes: {
  36008. service: 'skype'
  36009. },
  36010. title: 'Skype',
  36011. icon: SkypeIcon
  36012. }, {
  36013. name: 'snapchat',
  36014. attributes: {
  36015. service: 'snapchat'
  36016. },
  36017. title: 'Snapchat',
  36018. icon: SnapchatIcon
  36019. }, {
  36020. name: 'soundcloud',
  36021. attributes: {
  36022. service: 'soundcloud'
  36023. },
  36024. title: 'SoundCloud',
  36025. icon: SoundCloudIcon
  36026. }, {
  36027. name: 'spotify',
  36028. attributes: {
  36029. service: 'spotify'
  36030. },
  36031. title: 'Spotify',
  36032. icon: SpotifyIcon
  36033. }, {
  36034. name: 'telegram',
  36035. attributes: {
  36036. service: 'telegram'
  36037. },
  36038. title: 'Telegram',
  36039. icon: TelegramIcon
  36040. }, {
  36041. name: 'tiktok',
  36042. attributes: {
  36043. service: 'tiktok'
  36044. },
  36045. title: 'TikTok',
  36046. icon: TiktokIcon
  36047. }, {
  36048. name: 'tumblr',
  36049. attributes: {
  36050. service: 'tumblr'
  36051. },
  36052. title: 'Tumblr',
  36053. icon: TumblrIcon
  36054. }, {
  36055. name: 'twitch',
  36056. attributes: {
  36057. service: 'twitch'
  36058. },
  36059. title: 'Twitch',
  36060. icon: TwitchIcon
  36061. }, {
  36062. name: 'twitter',
  36063. attributes: {
  36064. service: 'twitter'
  36065. },
  36066. title: 'Twitter',
  36067. icon: TwitterIcon
  36068. }, {
  36069. name: 'vimeo',
  36070. attributes: {
  36071. service: 'vimeo'
  36072. },
  36073. title: 'Vimeo',
  36074. icon: VimeoIcon
  36075. }, {
  36076. name: 'vk',
  36077. attributes: {
  36078. service: 'vk'
  36079. },
  36080. title: 'VK',
  36081. icon: VkIcon
  36082. }, {
  36083. name: 'yelp',
  36084. attributes: {
  36085. service: 'yelp'
  36086. },
  36087. title: 'Yelp',
  36088. icon: YelpIcon
  36089. }, {
  36090. name: 'youtube',
  36091. attributes: {
  36092. service: 'youtube'
  36093. },
  36094. title: 'YouTube',
  36095. icon: YouTubeIcon
  36096. }];
  36097. /**
  36098. * Add `isActive` function to all `social link` variations, if not defined.
  36099. * `isActive` function is used to find a variation match from a created
  36100. * Block by providing its attributes.
  36101. */
  36102. social_link_variations_variations.forEach(variation => {
  36103. if (variation.isActive) return;
  36104. variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service;
  36105. });
  36106. /* harmony default export */ var social_link_variations = (social_link_variations_variations);
  36107. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
  36108. /**
  36109. * External dependencies
  36110. */
  36111. /**
  36112. * WordPress dependencies
  36113. */
  36114. /**
  36115. * Internal dependencies
  36116. */
  36117. /**
  36118. * Retrieves the social service's icon component.
  36119. *
  36120. * @param {string} name key for a social service (lowercase slug)
  36121. *
  36122. * @return {WPComponent} Icon component for social service.
  36123. */
  36124. const getIconBySite = name => {
  36125. const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
  36126. name
  36127. });
  36128. return variation ? variation.icon : ChainIcon;
  36129. };
  36130. /**
  36131. * Retrieves the display name for the social service.
  36132. *
  36133. * @param {string} name key for a social service (lowercase slug)
  36134. *
  36135. * @return {string} Display name for social service
  36136. */
  36137. const getNameBySite = name => {
  36138. const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
  36139. name
  36140. });
  36141. return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon');
  36142. };
  36143. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
  36144. /**
  36145. * External dependencies
  36146. */
  36147. /**
  36148. * WordPress dependencies
  36149. */
  36150. /**
  36151. * Internal dependencies
  36152. */
  36153. const SocialLinkURLPopover = _ref => {
  36154. let {
  36155. url,
  36156. setAttributes,
  36157. setPopover,
  36158. anchorRef
  36159. } = _ref;
  36160. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLPopover, {
  36161. anchorRef: anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current,
  36162. onClose: () => setPopover(false)
  36163. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  36164. className: "block-editor-url-popover__link-editor",
  36165. onSubmit: event => {
  36166. event.preventDefault();
  36167. setPopover(false);
  36168. }
  36169. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  36170. className: "block-editor-url-input"
  36171. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLInput, {
  36172. value: url,
  36173. onChange: nextURL => setAttributes({
  36174. url: nextURL
  36175. }),
  36176. placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter address'),
  36177. disableSuggestions: true
  36178. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  36179. icon: keyboard_return,
  36180. label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
  36181. type: "submit"
  36182. })));
  36183. };
  36184. const SocialLinkEdit = _ref2 => {
  36185. let {
  36186. attributes,
  36187. context,
  36188. isSelected,
  36189. setAttributes
  36190. } = _ref2;
  36191. const {
  36192. url,
  36193. service,
  36194. label
  36195. } = attributes;
  36196. const {
  36197. showLabels,
  36198. iconColorValue,
  36199. iconBackgroundColorValue
  36200. } = context;
  36201. const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false);
  36202. const classes = classnames_default()('wp-social-link', 'wp-social-link-' + service, {
  36203. 'wp-social-link__is-incomplete': !url
  36204. });
  36205. const ref = (0,external_wp_element_namespaceObject.useRef)();
  36206. const IconComponent = getIconBySite(service);
  36207. const socialLinkName = getNameBySite(service);
  36208. const socialLinkLabel = label !== null && label !== void 0 ? label : socialLinkName;
  36209. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  36210. className: classes,
  36211. style: {
  36212. color: iconColorValue,
  36213. backgroundColor: iconBackgroundColorValue
  36214. }
  36215. });
  36216. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36217. title: (0,external_wp_i18n_namespaceObject.sprintf)(
  36218. /* translators: %s: name of the social service. */
  36219. (0,external_wp_i18n_namespaceObject.__)('%s label'), socialLinkName),
  36220. initialOpen: false
  36221. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  36222. label: (0,external_wp_i18n_namespaceObject.__)('Link label'),
  36223. help: (0,external_wp_i18n_namespaceObject.__)('Briefly describe the link to help screen reader users.'),
  36224. value: label,
  36225. onChange: value => setAttributes({
  36226. label: value
  36227. })
  36228. })))), (0,external_wp_element_namespaceObject.createElement)("li", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  36229. className: "wp-block-social-link-anchor",
  36230. ref: ref,
  36231. onClick: () => setPopover(true)
  36232. }, (0,external_wp_element_namespaceObject.createElement)(IconComponent, null), (0,external_wp_element_namespaceObject.createElement)("span", {
  36233. className: classnames_default()('wp-block-social-link-label', {
  36234. 'screen-reader-text': !showLabels
  36235. })
  36236. }, socialLinkLabel), isSelected && showURLPopover && (0,external_wp_element_namespaceObject.createElement)(SocialLinkURLPopover, {
  36237. url: url,
  36238. setAttributes: setAttributes,
  36239. setPopover: setPopover,
  36240. anchorRef: ref
  36241. }))));
  36242. };
  36243. /* harmony default export */ var social_link_edit = (SocialLinkEdit);
  36244. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
  36245. /**
  36246. * WordPress dependencies
  36247. */
  36248. /**
  36249. * Internal dependencies
  36250. */
  36251. const social_link_metadata = {
  36252. $schema: "https://schemas.wp.org/trunk/block.json",
  36253. apiVersion: 2,
  36254. name: "core/social-link",
  36255. title: "Social Icon",
  36256. category: "widgets",
  36257. parent: ["core/social-links"],
  36258. description: "Display an icon linking to a social media profile or site.",
  36259. textdomain: "default",
  36260. attributes: {
  36261. url: {
  36262. type: "string"
  36263. },
  36264. service: {
  36265. type: "string"
  36266. },
  36267. label: {
  36268. type: "string"
  36269. }
  36270. },
  36271. usesContext: ["openInNewTab", "showLabels", "iconColorValue", "iconBackgroundColorValue"],
  36272. supports: {
  36273. reusable: false,
  36274. html: false
  36275. },
  36276. editorStyle: "wp-block-social-link-editor"
  36277. };
  36278. const {
  36279. name: social_link_name
  36280. } = social_link_metadata;
  36281. const social_link_settings = {
  36282. icon: library_share,
  36283. edit: social_link_edit,
  36284. variations: social_link_variations
  36285. };
  36286. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
  36287. /**
  36288. * External dependencies
  36289. */
  36290. /**
  36291. * WordPress dependencies
  36292. */
  36293. /**
  36294. * The specific handling by `className` below is needed because `itemsJustification`
  36295. * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't
  36296. * declared in block.json.
  36297. *
  36298. * @param {Object} attributes Block's attributes.
  36299. */
  36300. const social_links_deprecated_migrateWithLayout = attributes => {
  36301. var _className$match, _className$match$;
  36302. if (!!attributes.layout) {
  36303. return attributes;
  36304. }
  36305. const {
  36306. className
  36307. } = attributes; // Matches classes with `items-justified-` prefix.
  36308. const prefix = `items-justified-`;
  36309. const justifiedItemsRegex = new RegExp(`\\b${prefix}[^ ]*[ ]?\\b`, 'g');
  36310. const newAttributes = { ...attributes,
  36311. className: className === null || className === void 0 ? void 0 : className.replace(justifiedItemsRegex, '').trim()
  36312. };
  36313. /**
  36314. * Add `layout` prop only if `justifyContent` is defined, for backwards
  36315. * compatibility. In other cases the block's default layout will be used.
  36316. * Also noting that due to the missing attribute, it's possible for a block
  36317. * to have more than one of `justified` classes.
  36318. */
  36319. const justifyContent = className === null || className === void 0 ? void 0 : (_className$match = className.match(justifiedItemsRegex)) === null || _className$match === void 0 ? void 0 : (_className$match$ = _className$match[0]) === null || _className$match$ === void 0 ? void 0 : _className$match$.trim();
  36320. if (justifyContent) {
  36321. Object.assign(newAttributes, {
  36322. layout: {
  36323. type: 'flex',
  36324. justifyContent: justifyContent.slice(prefix.length)
  36325. }
  36326. });
  36327. }
  36328. return newAttributes;
  36329. }; // Social Links block deprecations.
  36330. const social_links_deprecated_deprecated = [// V1. Remove CSS variable use for colors.
  36331. {
  36332. attributes: {
  36333. iconColor: {
  36334. type: 'string'
  36335. },
  36336. customIconColor: {
  36337. type: 'string'
  36338. },
  36339. iconColorValue: {
  36340. type: 'string'
  36341. },
  36342. iconBackgroundColor: {
  36343. type: 'string'
  36344. },
  36345. customIconBackgroundColor: {
  36346. type: 'string'
  36347. },
  36348. iconBackgroundColorValue: {
  36349. type: 'string'
  36350. },
  36351. openInNewTab: {
  36352. type: 'boolean',
  36353. default: false
  36354. },
  36355. size: {
  36356. type: 'string'
  36357. }
  36358. },
  36359. providesContext: {
  36360. openInNewTab: 'openInNewTab'
  36361. },
  36362. supports: {
  36363. align: ['left', 'center', 'right'],
  36364. anchor: true
  36365. },
  36366. migrate: social_links_deprecated_migrateWithLayout,
  36367. save: props => {
  36368. const {
  36369. attributes: {
  36370. iconBackgroundColorValue,
  36371. iconColorValue,
  36372. itemsJustification,
  36373. size
  36374. }
  36375. } = props;
  36376. const className = classnames_default()(size, {
  36377. 'has-icon-color': iconColorValue,
  36378. 'has-icon-background-color': iconBackgroundColorValue,
  36379. [`items-justified-${itemsJustification}`]: itemsJustification
  36380. });
  36381. const style = {
  36382. '--wp--social-links--icon-color': iconColorValue,
  36383. '--wp--social-links--icon-background-color': iconBackgroundColorValue
  36384. };
  36385. return (0,external_wp_element_namespaceObject.createElement)("ul", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  36386. className,
  36387. style
  36388. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
  36389. }
  36390. }];
  36391. /* harmony default export */ var social_links_deprecated = (social_links_deprecated_deprecated);
  36392. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
  36393. /**
  36394. * WordPress dependencies
  36395. */
  36396. const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  36397. xmlns: "http://www.w3.org/2000/svg",
  36398. viewBox: "0 0 24 24"
  36399. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  36400. d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
  36401. }));
  36402. /* harmony default export */ var library_check = (check);
  36403. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/edit.js
  36404. /**
  36405. * External dependencies
  36406. */
  36407. /**
  36408. * WordPress dependencies
  36409. */
  36410. const social_links_edit_ALLOWED_BLOCKS = ['core/social-link'];
  36411. const sizeOptions = [{
  36412. name: (0,external_wp_i18n_namespaceObject.__)('Small'),
  36413. value: 'has-small-icon-size'
  36414. }, {
  36415. name: (0,external_wp_i18n_namespaceObject.__)('Normal'),
  36416. value: 'has-normal-icon-size'
  36417. }, {
  36418. name: (0,external_wp_i18n_namespaceObject.__)('Large'),
  36419. value: 'has-large-icon-size'
  36420. }, {
  36421. name: (0,external_wp_i18n_namespaceObject.__)('Huge'),
  36422. value: 'has-huge-icon-size'
  36423. }];
  36424. const social_links_edit_getDefaultBlockLayout = blockTypeOrName => {
  36425. const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
  36426. return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
  36427. };
  36428. function SocialLinksEdit(props) {
  36429. var _attributes$className;
  36430. const {
  36431. name,
  36432. attributes,
  36433. iconBackgroundColor,
  36434. iconColor,
  36435. isSelected,
  36436. setAttributes,
  36437. setIconBackgroundColor,
  36438. setIconColor
  36439. } = props;
  36440. const {
  36441. iconBackgroundColorValue,
  36442. customIconBackgroundColor,
  36443. iconColorValue,
  36444. openInNewTab,
  36445. showLabels,
  36446. size,
  36447. layout
  36448. } = attributes;
  36449. const usedLayout = layout || social_links_edit_getDefaultBlockLayout(name);
  36450. const logosOnly = (_attributes$className = attributes.className) === null || _attributes$className === void 0 ? void 0 : _attributes$className.includes('is-style-logos-only'); // Remove icon background color when logos only style is selected or
  36451. // restore it when any other style is selected.
  36452. const backgroundBackup = (0,external_wp_element_namespaceObject.useRef)({});
  36453. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36454. if (logosOnly) {
  36455. backgroundBackup.current = {
  36456. iconBackgroundColor,
  36457. iconBackgroundColorValue,
  36458. customIconBackgroundColor
  36459. };
  36460. setAttributes({
  36461. iconBackgroundColor: undefined,
  36462. customIconBackgroundColor: undefined,
  36463. iconBackgroundColorValue: undefined
  36464. });
  36465. } else {
  36466. setAttributes({ ...backgroundBackup.current
  36467. });
  36468. }
  36469. }, [logosOnly]);
  36470. const SocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
  36471. className: "wp-block-social-links__social-placeholder"
  36472. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  36473. className: "wp-block-social-links__social-placeholder-icons"
  36474. }, (0,external_wp_element_namespaceObject.createElement)("div", {
  36475. className: "wp-social-link wp-social-link-twitter"
  36476. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  36477. className: "wp-social-link wp-social-link-facebook"
  36478. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  36479. className: "wp-social-link wp-social-link-instagram"
  36480. })));
  36481. const SelectedSocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
  36482. className: "wp-block-social-links__social-prompt"
  36483. }, (0,external_wp_i18n_namespaceObject.__)('Click plus to add')); // Fallback color values are used maintain selections in case switching
  36484. // themes and named colors in palette do not match.
  36485. const className = classnames_default()(size, {
  36486. 'has-icon-color': iconColor.color || iconColorValue,
  36487. 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
  36488. });
  36489. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  36490. className
  36491. });
  36492. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  36493. allowedBlocks: social_links_edit_ALLOWED_BLOCKS,
  36494. placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
  36495. templateLock: false,
  36496. __experimentalAppenderTagName: 'li',
  36497. __experimentalLayout: usedLayout
  36498. });
  36499. const POPOVER_PROPS = {
  36500. position: 'bottom right'
  36501. };
  36502. const colorSettings = [{
  36503. // Use custom attribute as fallback to prevent loss of named color selection when
  36504. // switching themes to a new theme that does not have a matching named color.
  36505. value: iconColor.color || iconColorValue,
  36506. onChange: colorValue => {
  36507. setIconColor(colorValue);
  36508. setAttributes({
  36509. iconColorValue: colorValue
  36510. });
  36511. },
  36512. label: (0,external_wp_i18n_namespaceObject.__)('Icon color')
  36513. }];
  36514. if (!logosOnly) {
  36515. colorSettings.push({
  36516. // Use custom attribute as fallback to prevent loss of named color selection when
  36517. // switching themes to a new theme that does not have a matching named color.
  36518. value: iconBackgroundColor.color || iconBackgroundColorValue,
  36519. onChange: colorValue => {
  36520. setIconBackgroundColor(colorValue);
  36521. setAttributes({
  36522. iconBackgroundColorValue: colorValue
  36523. });
  36524. },
  36525. label: (0,external_wp_i18n_namespaceObject.__)('Icon background')
  36526. });
  36527. }
  36528. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  36529. group: "other"
  36530. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  36531. label: (0,external_wp_i18n_namespaceObject.__)('Size'),
  36532. text: (0,external_wp_i18n_namespaceObject.__)('Size'),
  36533. icon: null,
  36534. popoverProps: POPOVER_PROPS
  36535. }, _ref => {
  36536. let {
  36537. onClose
  36538. } = _ref;
  36539. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => {
  36540. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  36541. icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
  36542. isSelected: size === entry.value,
  36543. key: entry.value,
  36544. onClick: () => {
  36545. setAttributes({
  36546. size: entry.value
  36547. });
  36548. },
  36549. onClose: onClose,
  36550. role: "menuitemradio"
  36551. }, entry.name);
  36552. }));
  36553. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36554. title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
  36555. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  36556. label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
  36557. checked: openInNewTab,
  36558. onChange: () => setAttributes({
  36559. openInNewTab: !openInNewTab
  36560. })
  36561. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  36562. label: (0,external_wp_i18n_namespaceObject.__)('Show labels'),
  36563. checked: showLabels,
  36564. onChange: () => setAttributes({
  36565. showLabels: !showLabels
  36566. })
  36567. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
  36568. __experimentalHasMultipleOrigins: true,
  36569. __experimentalIsRenderedInSidebar: true,
  36570. title: (0,external_wp_i18n_namespaceObject.__)('Color'),
  36571. colorSettings: colorSettings
  36572. }), !logosOnly && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
  36573. textColor: iconColorValue,
  36574. backgroundColor: iconBackgroundColorValue,
  36575. isLargeText: false
  36576. })), (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps));
  36577. }
  36578. const iconColorAttributes = {
  36579. iconColor: 'icon-color',
  36580. iconBackgroundColor: 'icon-background-color'
  36581. };
  36582. /* harmony default export */ var social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));
  36583. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js
  36584. /**
  36585. * External dependencies
  36586. */
  36587. /**
  36588. * WordPress dependencies
  36589. */
  36590. function social_links_save_save(props) {
  36591. const {
  36592. attributes: {
  36593. iconBackgroundColorValue,
  36594. iconColorValue,
  36595. showLabels,
  36596. size
  36597. }
  36598. } = props;
  36599. const className = classnames_default()(size, {
  36600. 'has-visible-labels': showLabels,
  36601. 'has-icon-color': iconColorValue,
  36602. 'has-icon-background-color': iconBackgroundColorValue
  36603. });
  36604. const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
  36605. className
  36606. });
  36607. const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  36608. return (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps);
  36609. }
  36610. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
  36611. /**
  36612. * WordPress dependencies
  36613. */
  36614. /**
  36615. * Internal dependencies
  36616. */
  36617. const social_links_metadata = {
  36618. $schema: "https://schemas.wp.org/trunk/block.json",
  36619. apiVersion: 2,
  36620. name: "core/social-links",
  36621. title: "Social Icons",
  36622. category: "widgets",
  36623. description: "Display icons linking to your social media profiles or sites.",
  36624. keywords: ["links"],
  36625. textdomain: "default",
  36626. attributes: {
  36627. iconColor: {
  36628. type: "string"
  36629. },
  36630. customIconColor: {
  36631. type: "string"
  36632. },
  36633. iconColorValue: {
  36634. type: "string"
  36635. },
  36636. iconBackgroundColor: {
  36637. type: "string"
  36638. },
  36639. customIconBackgroundColor: {
  36640. type: "string"
  36641. },
  36642. iconBackgroundColorValue: {
  36643. type: "string"
  36644. },
  36645. openInNewTab: {
  36646. type: "boolean",
  36647. "default": false
  36648. },
  36649. showLabels: {
  36650. type: "boolean",
  36651. "default": false
  36652. },
  36653. size: {
  36654. type: "string"
  36655. }
  36656. },
  36657. providesContext: {
  36658. openInNewTab: "openInNewTab",
  36659. showLabels: "showLabels",
  36660. iconColorValue: "iconColorValue",
  36661. iconBackgroundColorValue: "iconBackgroundColorValue"
  36662. },
  36663. supports: {
  36664. align: ["left", "center", "right"],
  36665. anchor: true,
  36666. __experimentalExposeControlsToChildren: true,
  36667. __experimentalLayout: {
  36668. allowSwitching: false,
  36669. allowInheriting: false,
  36670. allowVerticalAlignment: false,
  36671. "default": {
  36672. type: "flex"
  36673. }
  36674. },
  36675. spacing: {
  36676. blockGap: ["horizontal", "vertical"],
  36677. margin: ["top", "bottom"],
  36678. units: ["px", "em", "rem", "vh", "vw"],
  36679. __experimentalDefaultControls: {
  36680. blockGap: true
  36681. }
  36682. }
  36683. },
  36684. styles: [{
  36685. name: "default",
  36686. label: "Default",
  36687. isDefault: true
  36688. }, {
  36689. name: "logos-only",
  36690. label: "Logos Only"
  36691. }, {
  36692. name: "pill-shape",
  36693. label: "Pill Shape"
  36694. }],
  36695. editorStyle: "wp-block-social-links-editor",
  36696. style: "wp-block-social-links"
  36697. };
  36698. const {
  36699. name: social_links_name
  36700. } = social_links_metadata;
  36701. const social_links_settings = {
  36702. example: {
  36703. innerBlocks: [{
  36704. name: 'core/social-link',
  36705. attributes: {
  36706. service: 'wordpress',
  36707. url: 'https://wordpress.org'
  36708. }
  36709. }, {
  36710. name: 'core/social-link',
  36711. attributes: {
  36712. service: 'facebook',
  36713. url: 'https://www.facebook.com/WordPress/'
  36714. }
  36715. }, {
  36716. name: 'core/social-link',
  36717. attributes: {
  36718. service: 'twitter',
  36719. url: 'https://twitter.com/WordPress'
  36720. }
  36721. }]
  36722. },
  36723. icon: library_share,
  36724. edit: social_links_edit,
  36725. save: social_links_save_save,
  36726. deprecated: social_links_deprecated
  36727. };
  36728. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
  36729. /**
  36730. * WordPress dependencies
  36731. */
  36732. const resizeCornerNE = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  36733. viewBox: "0 0 24 24",
  36734. xmlns: "http://www.w3.org/2000/svg"
  36735. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  36736. d: "M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"
  36737. }));
  36738. /* harmony default export */ var resize_corner_n_e = (resizeCornerNE);
  36739. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
  36740. /**
  36741. * WordPress dependencies
  36742. */
  36743. const spacer_deprecated_deprecated = [{
  36744. attributes: {
  36745. height: {
  36746. type: 'number',
  36747. default: 100
  36748. },
  36749. width: {
  36750. type: 'number'
  36751. }
  36752. },
  36753. migrate(attributes) {
  36754. const {
  36755. height,
  36756. width
  36757. } = attributes;
  36758. return { ...attributes,
  36759. width: width !== undefined ? `${width}px` : undefined,
  36760. height: height !== undefined ? `${height}px` : undefined
  36761. };
  36762. },
  36763. save(_ref) {
  36764. let {
  36765. attributes
  36766. } = _ref;
  36767. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  36768. style: {
  36769. height: attributes.height,
  36770. width: attributes.width
  36771. },
  36772. 'aria-hidden': true
  36773. }));
  36774. }
  36775. }];
  36776. /* harmony default export */ var spacer_deprecated = (spacer_deprecated_deprecated);
  36777. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
  36778. /**
  36779. * WordPress dependencies
  36780. */
  36781. /**
  36782. * Internal dependencies
  36783. */
  36784. function DimensionInput(_ref) {
  36785. var _ref2;
  36786. let {
  36787. label,
  36788. onChange,
  36789. isResizing,
  36790. value = ''
  36791. } = _ref;
  36792. const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); // In most contexts the spacer size cannot meaningfully be set to a
  36793. // percentage, since this is relative to the parent container. This
  36794. // unit is disabled from the UI.
  36795. const availableUnitSettings = (_ref2 = (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || undefined) === null || _ref2 === void 0 ? void 0 : _ref2.filter(availableUnit => availableUnit !== '%');
  36796. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  36797. availableUnits: availableUnitSettings || ['px', 'em', 'rem', 'vw', 'vh'],
  36798. defaultValues: {
  36799. px: 100,
  36800. em: 10,
  36801. rem: 10,
  36802. vw: 10,
  36803. vh: 25
  36804. }
  36805. });
  36806. const handleOnChange = unprocessedValue => {
  36807. onChange(unprocessedValue);
  36808. }; // Force the unit to update to `px` when the Spacer is being resized.
  36809. const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  36810. const computedValue = [parsedQuantity, isResizing ? 'px' : parsedUnit].join('');
  36811. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  36812. label: label,
  36813. id: inputId
  36814. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  36815. id: inputId,
  36816. isResetValueOnUnitChange: true,
  36817. min: MIN_SPACER_SIZE,
  36818. onChange: handleOnChange,
  36819. style: {
  36820. maxWidth: 80
  36821. },
  36822. value: computedValue,
  36823. units: units
  36824. }));
  36825. }
  36826. function SpacerControls(_ref3) {
  36827. let {
  36828. setAttributes,
  36829. orientation,
  36830. height,
  36831. width,
  36832. isResizing
  36833. } = _ref3;
  36834. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  36835. title: (0,external_wp_i18n_namespaceObject.__)('Spacer settings')
  36836. }, orientation === 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
  36837. label: (0,external_wp_i18n_namespaceObject.__)('Width'),
  36838. value: width,
  36839. onChange: nextWidth => setAttributes({
  36840. width: nextWidth
  36841. }),
  36842. isResizing: isResizing
  36843. }), orientation !== 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
  36844. label: (0,external_wp_i18n_namespaceObject.__)('Height'),
  36845. value: height,
  36846. onChange: nextHeight => setAttributes({
  36847. height: nextHeight
  36848. }),
  36849. isResizing: isResizing
  36850. })));
  36851. }
  36852. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
  36853. /**
  36854. * External dependencies
  36855. */
  36856. /**
  36857. * WordPress dependencies
  36858. */
  36859. /**
  36860. * Internal dependencies
  36861. */
  36862. const MIN_SPACER_SIZE = 0;
  36863. const ResizableSpacer = _ref => {
  36864. let {
  36865. orientation,
  36866. onResizeStart,
  36867. onResize,
  36868. onResizeStop,
  36869. isSelected,
  36870. isResizing,
  36871. setIsResizing,
  36872. ...props
  36873. } = _ref;
  36874. const getCurrentSize = elt => {
  36875. return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight;
  36876. };
  36877. const getNextVal = elt => {
  36878. return `${getCurrentSize(elt)}px`;
  36879. };
  36880. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
  36881. className: classnames_default()('block-library-spacer__resize-container', {
  36882. 'resize-horizontal': orientation === 'horizontal',
  36883. 'is-resizing': isResizing,
  36884. 'is-selected': isSelected
  36885. }),
  36886. onResizeStart: (_event, _direction, elt) => {
  36887. const nextVal = getNextVal(elt);
  36888. onResizeStart(nextVal);
  36889. onResize(nextVal);
  36890. },
  36891. onResize: (_event, _direction, elt) => {
  36892. onResize(getNextVal(elt));
  36893. if (!isResizing) {
  36894. setIsResizing(true);
  36895. }
  36896. },
  36897. onResizeStop: (_event, _direction, elt) => {
  36898. const nextVal = getCurrentSize(elt);
  36899. onResizeStop(`${nextVal}px`);
  36900. setIsResizing(false);
  36901. },
  36902. __experimentalShowTooltip: true,
  36903. __experimentalTooltipProps: {
  36904. axis: orientation === 'horizontal' ? 'x' : 'y',
  36905. position: 'corner',
  36906. isVisible: isResizing
  36907. },
  36908. showHandle: isSelected
  36909. }, props));
  36910. };
  36911. const SpacerEdit = _ref2 => {
  36912. let {
  36913. attributes,
  36914. isSelected,
  36915. setAttributes,
  36916. toggleSelection,
  36917. context
  36918. } = _ref2;
  36919. const {
  36920. orientation
  36921. } = context;
  36922. const {
  36923. height,
  36924. width
  36925. } = attributes;
  36926. const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
  36927. const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null);
  36928. const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null);
  36929. const onResizeStart = () => toggleSelection(false);
  36930. const onResizeStop = () => toggleSelection(true);
  36931. const handleOnVerticalResizeStop = newHeight => {
  36932. onResizeStop();
  36933. setAttributes({
  36934. height: newHeight
  36935. });
  36936. setTemporaryHeight(null);
  36937. };
  36938. const handleOnHorizontalResizeStop = newWidth => {
  36939. onResizeStop();
  36940. setAttributes({
  36941. width: newWidth
  36942. });
  36943. setTemporaryWidth(null);
  36944. };
  36945. const style = {
  36946. height: orientation === 'horizontal' ? 24 : temporaryHeight || height || undefined,
  36947. width: orientation === 'horizontal' ? temporaryWidth || width || undefined : undefined
  36948. };
  36949. const resizableBoxWithOrientation = blockOrientation => {
  36950. if (blockOrientation === 'horizontal') {
  36951. return (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
  36952. minWidth: MIN_SPACER_SIZE,
  36953. enable: {
  36954. top: false,
  36955. right: true,
  36956. bottom: false,
  36957. left: false,
  36958. topRight: false,
  36959. bottomRight: false,
  36960. bottomLeft: false,
  36961. topLeft: false
  36962. },
  36963. orientation: blockOrientation,
  36964. onResizeStart: onResizeStart,
  36965. onResize: setTemporaryWidth,
  36966. onResizeStop: handleOnHorizontalResizeStop,
  36967. isSelected: isSelected,
  36968. isResizing: isResizing,
  36969. setIsResizing: setIsResizing
  36970. });
  36971. }
  36972. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
  36973. minHeight: MIN_SPACER_SIZE,
  36974. enable: {
  36975. top: false,
  36976. right: false,
  36977. bottom: true,
  36978. left: false,
  36979. topRight: false,
  36980. bottomRight: false,
  36981. bottomLeft: false,
  36982. topLeft: false
  36983. },
  36984. orientation: blockOrientation,
  36985. onResizeStart: onResizeStart,
  36986. onResize: setTemporaryHeight,
  36987. onResizeStop: handleOnVerticalResizeStop,
  36988. isSelected: isSelected,
  36989. isResizing: isResizing,
  36990. setIsResizing: setIsResizing
  36991. }));
  36992. };
  36993. (0,external_wp_element_namespaceObject.useEffect)(() => {
  36994. if (orientation === 'horizontal' && !width) {
  36995. setAttributes({
  36996. height: '0px',
  36997. width: '72px'
  36998. });
  36999. }
  37000. }, []);
  37001. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  37002. style
  37003. }), resizableBoxWithOrientation(orientation)), (0,external_wp_element_namespaceObject.createElement)(SpacerControls, {
  37004. setAttributes: setAttributes,
  37005. height: temporaryHeight || height,
  37006. width: temporaryWidth || width,
  37007. orientation: orientation,
  37008. isResizing: isResizing
  37009. }));
  37010. };
  37011. /* harmony default export */ var spacer_edit = (SpacerEdit);
  37012. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js
  37013. /**
  37014. * WordPress dependencies
  37015. */
  37016. function spacer_save_save(_ref) {
  37017. let {
  37018. attributes: {
  37019. height,
  37020. width
  37021. }
  37022. } = _ref;
  37023. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  37024. style: {
  37025. height,
  37026. width
  37027. },
  37028. 'aria-hidden': true
  37029. }));
  37030. }
  37031. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
  37032. /**
  37033. * WordPress dependencies
  37034. */
  37035. /**
  37036. * Internal dependencies
  37037. */
  37038. const spacer_metadata = {
  37039. $schema: "https://schemas.wp.org/trunk/block.json",
  37040. apiVersion: 2,
  37041. name: "core/spacer",
  37042. title: "Spacer",
  37043. category: "design",
  37044. description: "Add white space between blocks and customize its height.",
  37045. textdomain: "default",
  37046. attributes: {
  37047. height: {
  37048. type: "string",
  37049. "default": "100px"
  37050. },
  37051. width: {
  37052. type: "string"
  37053. }
  37054. },
  37055. usesContext: ["orientation"],
  37056. supports: {
  37057. anchor: true
  37058. },
  37059. editorStyle: "wp-block-spacer-editor",
  37060. style: "wp-block-spacer"
  37061. };
  37062. const {
  37063. name: spacer_name
  37064. } = spacer_metadata;
  37065. const spacer_settings = {
  37066. icon: resize_corner_n_e,
  37067. edit: spacer_edit,
  37068. save: spacer_save_save,
  37069. deprecated: spacer_deprecated
  37070. };
  37071. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js
  37072. /**
  37073. * WordPress dependencies
  37074. */
  37075. const blockTable = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37076. viewBox: "0 0 24 24",
  37077. xmlns: "http://www.w3.org/2000/svg"
  37078. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37079. d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"
  37080. }));
  37081. /* harmony default export */ var block_table = (blockTable);
  37082. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
  37083. /**
  37084. * External dependencies
  37085. */
  37086. /**
  37087. * WordPress dependencies
  37088. */
  37089. const table_deprecated_supports = {
  37090. align: true
  37091. }; // As the previous arbitrary colors won't match theme color palettes, the hex
  37092. // value will be mapped to the style.color.background attribute as if it was
  37093. // a custom color selection.
  37094. const oldColors = {
  37095. 'subtle-light-gray': '#f3f4f5',
  37096. 'subtle-pale-green': '#e9fbe5',
  37097. 'subtle-pale-blue': '#e7f5fe',
  37098. 'subtle-pale-pink': '#fcf0ef'
  37099. };
  37100. const table_deprecated_deprecated = [// Deprecation migrating table block to use colors block support feature.
  37101. {
  37102. attributes: {
  37103. hasFixedLayout: {
  37104. type: 'boolean',
  37105. default: false
  37106. },
  37107. backgroundColor: {
  37108. type: 'string'
  37109. },
  37110. caption: {
  37111. type: 'string',
  37112. source: 'html',
  37113. selector: 'figcaption',
  37114. default: ''
  37115. },
  37116. head: {
  37117. type: 'array',
  37118. default: [],
  37119. source: 'query',
  37120. selector: 'thead tr',
  37121. query: {
  37122. cells: {
  37123. type: 'array',
  37124. default: [],
  37125. source: 'query',
  37126. selector: 'td,th',
  37127. query: {
  37128. content: {
  37129. type: 'string',
  37130. source: 'html'
  37131. },
  37132. tag: {
  37133. type: 'string',
  37134. default: 'td',
  37135. source: 'tag'
  37136. },
  37137. scope: {
  37138. type: 'string',
  37139. source: 'attribute',
  37140. attribute: 'scope'
  37141. },
  37142. align: {
  37143. type: 'string',
  37144. source: 'attribute',
  37145. attribute: 'data-align'
  37146. }
  37147. }
  37148. }
  37149. }
  37150. },
  37151. body: {
  37152. type: 'array',
  37153. default: [],
  37154. source: 'query',
  37155. selector: 'tbody tr',
  37156. query: {
  37157. cells: {
  37158. type: 'array',
  37159. default: [],
  37160. source: 'query',
  37161. selector: 'td,th',
  37162. query: {
  37163. content: {
  37164. type: 'string',
  37165. source: 'html'
  37166. },
  37167. tag: {
  37168. type: 'string',
  37169. default: 'td',
  37170. source: 'tag'
  37171. },
  37172. scope: {
  37173. type: 'string',
  37174. source: 'attribute',
  37175. attribute: 'scope'
  37176. },
  37177. align: {
  37178. type: 'string',
  37179. source: 'attribute',
  37180. attribute: 'data-align'
  37181. }
  37182. }
  37183. }
  37184. }
  37185. },
  37186. foot: {
  37187. type: 'array',
  37188. default: [],
  37189. source: 'query',
  37190. selector: 'tfoot tr',
  37191. query: {
  37192. cells: {
  37193. type: 'array',
  37194. default: [],
  37195. source: 'query',
  37196. selector: 'td,th',
  37197. query: {
  37198. content: {
  37199. type: 'string',
  37200. source: 'html'
  37201. },
  37202. tag: {
  37203. type: 'string',
  37204. default: 'td',
  37205. source: 'tag'
  37206. },
  37207. scope: {
  37208. type: 'string',
  37209. source: 'attribute',
  37210. attribute: 'scope'
  37211. },
  37212. align: {
  37213. type: 'string',
  37214. source: 'attribute',
  37215. attribute: 'data-align'
  37216. }
  37217. }
  37218. }
  37219. }
  37220. }
  37221. },
  37222. supports: {
  37223. anchor: true,
  37224. align: true,
  37225. __experimentalSelector: '.wp-block-table > table'
  37226. },
  37227. save: _ref => {
  37228. let {
  37229. attributes
  37230. } = _ref;
  37231. const {
  37232. hasFixedLayout,
  37233. head,
  37234. body,
  37235. foot,
  37236. backgroundColor,
  37237. caption
  37238. } = attributes;
  37239. const isEmpty = !head.length && !body.length && !foot.length;
  37240. if (isEmpty) {
  37241. return null;
  37242. }
  37243. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  37244. const classes = classnames_default()(backgroundClass, {
  37245. 'has-fixed-layout': hasFixedLayout,
  37246. 'has-background': !!backgroundClass
  37247. });
  37248. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  37249. const Section = _ref2 => {
  37250. let {
  37251. type,
  37252. rows
  37253. } = _ref2;
  37254. if (!rows.length) {
  37255. return null;
  37256. }
  37257. const Tag = `t${type}`;
  37258. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
  37259. let {
  37260. cells
  37261. } = _ref3;
  37262. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  37263. key: rowIndex
  37264. }, cells.map((_ref4, cellIndex) => {
  37265. let {
  37266. content,
  37267. tag,
  37268. scope,
  37269. align
  37270. } = _ref4;
  37271. const cellClasses = classnames_default()({
  37272. [`has-text-align-${align}`]: align
  37273. });
  37274. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37275. className: cellClasses ? cellClasses : undefined,
  37276. "data-align": align,
  37277. tagName: tag,
  37278. value: content,
  37279. key: cellIndex,
  37280. scope: tag === 'th' ? scope : undefined
  37281. });
  37282. }));
  37283. }));
  37284. };
  37285. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  37286. className: classes === '' ? undefined : classes
  37287. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  37288. type: "head",
  37289. rows: head
  37290. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37291. type: "body",
  37292. rows: body
  37293. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37294. type: "foot",
  37295. rows: foot
  37296. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37297. tagName: "figcaption",
  37298. value: caption
  37299. }));
  37300. },
  37301. isEligible: attributes => {
  37302. return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style;
  37303. },
  37304. // This version is the first to introduce the style attribute to the
  37305. // table block. As a result, we'll explicitly override that.
  37306. migrate: attributes => {
  37307. return { ...attributes,
  37308. backgroundColor: undefined,
  37309. style: {
  37310. color: {
  37311. background: oldColors[attributes.backgroundColor]
  37312. }
  37313. }
  37314. };
  37315. }
  37316. }, {
  37317. attributes: {
  37318. hasFixedLayout: {
  37319. type: 'boolean',
  37320. default: false
  37321. },
  37322. backgroundColor: {
  37323. type: 'string'
  37324. },
  37325. head: {
  37326. type: 'array',
  37327. default: [],
  37328. source: 'query',
  37329. selector: 'thead tr',
  37330. query: {
  37331. cells: {
  37332. type: 'array',
  37333. default: [],
  37334. source: 'query',
  37335. selector: 'td,th',
  37336. query: {
  37337. content: {
  37338. type: 'string',
  37339. source: 'html'
  37340. },
  37341. tag: {
  37342. type: 'string',
  37343. default: 'td',
  37344. source: 'tag'
  37345. },
  37346. scope: {
  37347. type: 'string',
  37348. source: 'attribute',
  37349. attribute: 'scope'
  37350. }
  37351. }
  37352. }
  37353. }
  37354. },
  37355. body: {
  37356. type: 'array',
  37357. default: [],
  37358. source: 'query',
  37359. selector: 'tbody tr',
  37360. query: {
  37361. cells: {
  37362. type: 'array',
  37363. default: [],
  37364. source: 'query',
  37365. selector: 'td,th',
  37366. query: {
  37367. content: {
  37368. type: 'string',
  37369. source: 'html'
  37370. },
  37371. tag: {
  37372. type: 'string',
  37373. default: 'td',
  37374. source: 'tag'
  37375. },
  37376. scope: {
  37377. type: 'string',
  37378. source: 'attribute',
  37379. attribute: 'scope'
  37380. }
  37381. }
  37382. }
  37383. }
  37384. },
  37385. foot: {
  37386. type: 'array',
  37387. default: [],
  37388. source: 'query',
  37389. selector: 'tfoot tr',
  37390. query: {
  37391. cells: {
  37392. type: 'array',
  37393. default: [],
  37394. source: 'query',
  37395. selector: 'td,th',
  37396. query: {
  37397. content: {
  37398. type: 'string',
  37399. source: 'html'
  37400. },
  37401. tag: {
  37402. type: 'string',
  37403. default: 'td',
  37404. source: 'tag'
  37405. },
  37406. scope: {
  37407. type: 'string',
  37408. source: 'attribute',
  37409. attribute: 'scope'
  37410. }
  37411. }
  37412. }
  37413. }
  37414. }
  37415. },
  37416. supports: table_deprecated_supports,
  37417. save(_ref5) {
  37418. let {
  37419. attributes
  37420. } = _ref5;
  37421. const {
  37422. hasFixedLayout,
  37423. head,
  37424. body,
  37425. foot,
  37426. backgroundColor
  37427. } = attributes;
  37428. const isEmpty = !head.length && !body.length && !foot.length;
  37429. if (isEmpty) {
  37430. return null;
  37431. }
  37432. const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
  37433. const classes = classnames_default()(backgroundClass, {
  37434. 'has-fixed-layout': hasFixedLayout,
  37435. 'has-background': !!backgroundClass
  37436. });
  37437. const Section = _ref6 => {
  37438. let {
  37439. type,
  37440. rows
  37441. } = _ref6;
  37442. if (!rows.length) {
  37443. return null;
  37444. }
  37445. const Tag = `t${type}`;
  37446. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref7, rowIndex) => {
  37447. let {
  37448. cells
  37449. } = _ref7;
  37450. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  37451. key: rowIndex
  37452. }, cells.map((_ref8, cellIndex) => {
  37453. let {
  37454. content,
  37455. tag,
  37456. scope
  37457. } = _ref8;
  37458. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  37459. tagName: tag,
  37460. value: content,
  37461. key: cellIndex,
  37462. scope: tag === 'th' ? scope : undefined
  37463. });
  37464. }));
  37465. }));
  37466. };
  37467. return (0,external_wp_element_namespaceObject.createElement)("table", {
  37468. className: classes
  37469. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  37470. type: "head",
  37471. rows: head
  37472. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37473. type: "body",
  37474. rows: body
  37475. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  37476. type: "foot",
  37477. rows: foot
  37478. }));
  37479. }
  37480. }];
  37481. /* harmony default export */ var table_deprecated = (table_deprecated_deprecated);
  37482. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js
  37483. /**
  37484. * WordPress dependencies
  37485. */
  37486. const alignLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37487. xmlns: "http://www.w3.org/2000/svg",
  37488. viewBox: "0 0 24 24"
  37489. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37490. d: "M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"
  37491. }));
  37492. /* harmony default export */ var align_left = (alignLeft);
  37493. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js
  37494. /**
  37495. * WordPress dependencies
  37496. */
  37497. const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37498. xmlns: "http://www.w3.org/2000/svg",
  37499. viewBox: "0 0 24 24"
  37500. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37501. d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"
  37502. }));
  37503. /* harmony default export */ var align_center = (alignCenter);
  37504. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js
  37505. /**
  37506. * WordPress dependencies
  37507. */
  37508. const alignRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37509. xmlns: "http://www.w3.org/2000/svg",
  37510. viewBox: "0 0 24 24"
  37511. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37512. d: "M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"
  37513. }));
  37514. /* harmony default export */ var align_right = (alignRight);
  37515. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-before.js
  37516. /**
  37517. * WordPress dependencies
  37518. */
  37519. const tableRowBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37520. xmlns: "http://www.w3.org/2000/svg",
  37521. viewBox: "-2 -2 24 24"
  37522. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37523. d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"
  37524. }));
  37525. /* harmony default export */ var table_row_before = (tableRowBefore);
  37526. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
  37527. /**
  37528. * WordPress dependencies
  37529. */
  37530. const tableRowAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37531. xmlns: "http://www.w3.org/2000/svg",
  37532. viewBox: "-2 -2 24 24"
  37533. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37534. d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"
  37535. }));
  37536. /* harmony default export */ var table_row_after = (tableRowAfter);
  37537. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
  37538. /**
  37539. * WordPress dependencies
  37540. */
  37541. const tableRowDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37542. xmlns: "http://www.w3.org/2000/svg",
  37543. viewBox: "-2 -2 24 24"
  37544. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37545. d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"
  37546. }));
  37547. /* harmony default export */ var table_row_delete = (tableRowDelete);
  37548. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
  37549. /**
  37550. * WordPress dependencies
  37551. */
  37552. const tableColumnBefore = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37553. xmlns: "http://www.w3.org/2000/svg",
  37554. viewBox: "-2 -2 24 24"
  37555. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37556. d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"
  37557. }));
  37558. /* harmony default export */ var table_column_before = (tableColumnBefore);
  37559. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
  37560. /**
  37561. * WordPress dependencies
  37562. */
  37563. const tableColumnAfter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37564. xmlns: "http://www.w3.org/2000/svg",
  37565. viewBox: "-2 -2 24 24"
  37566. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37567. d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"
  37568. }));
  37569. /* harmony default export */ var table_column_after = (tableColumnAfter);
  37570. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
  37571. /**
  37572. * WordPress dependencies
  37573. */
  37574. const tableColumnDelete = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37575. xmlns: "http://www.w3.org/2000/svg",
  37576. viewBox: "-2 -2 24 24"
  37577. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37578. d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"
  37579. }));
  37580. /* harmony default export */ var table_column_delete = (tableColumnDelete);
  37581. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js
  37582. /**
  37583. * WordPress dependencies
  37584. */
  37585. const table = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  37586. xmlns: "http://www.w3.org/2000/svg",
  37587. viewBox: "0 0 24 24"
  37588. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  37589. d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"
  37590. }));
  37591. /* harmony default export */ var library_table = (table);
  37592. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js
  37593. /**
  37594. * External dependencies
  37595. */
  37596. const INHERITED_COLUMN_ATTRIBUTES = ['align'];
  37597. /**
  37598. * Creates a table state.
  37599. *
  37600. * @param {Object} options
  37601. * @param {number} options.rowCount Row count for the table to create.
  37602. * @param {number} options.columnCount Column count for the table to create.
  37603. *
  37604. * @return {Object} New table state.
  37605. */
  37606. function createTable(_ref) {
  37607. let {
  37608. rowCount,
  37609. columnCount
  37610. } = _ref;
  37611. return {
  37612. body: (0,external_lodash_namespaceObject.times)(rowCount, () => ({
  37613. cells: (0,external_lodash_namespaceObject.times)(columnCount, () => ({
  37614. content: '',
  37615. tag: 'td'
  37616. }))
  37617. }))
  37618. };
  37619. }
  37620. /**
  37621. * Returns the first row in the table.
  37622. *
  37623. * @param {Object} state Current table state.
  37624. *
  37625. * @return {Object} The first table row.
  37626. */
  37627. function getFirstRow(state) {
  37628. if (!isEmptyTableSection(state.head)) {
  37629. return state.head[0];
  37630. }
  37631. if (!isEmptyTableSection(state.body)) {
  37632. return state.body[0];
  37633. }
  37634. if (!isEmptyTableSection(state.foot)) {
  37635. return state.foot[0];
  37636. }
  37637. }
  37638. /**
  37639. * Gets an attribute for a cell.
  37640. *
  37641. * @param {Object} state Current table state.
  37642. * @param {Object} cellLocation The location of the cell
  37643. * @param {string} attributeName The name of the attribute to get the value of.
  37644. *
  37645. * @return {*} The attribute value.
  37646. */
  37647. function getCellAttribute(state, cellLocation, attributeName) {
  37648. const {
  37649. sectionName,
  37650. rowIndex,
  37651. columnIndex
  37652. } = cellLocation;
  37653. return (0,external_lodash_namespaceObject.get)(state, [sectionName, rowIndex, 'cells', columnIndex, attributeName]);
  37654. }
  37655. /**
  37656. * Returns updated cell attributes after applying the `updateCell` function to the selection.
  37657. *
  37658. * @param {Object} state The block attributes.
  37659. * @param {Object} selection The selection of cells to update.
  37660. * @param {Function} updateCell A function to update the selected cell attributes.
  37661. *
  37662. * @return {Object} New table state including the updated cells.
  37663. */
  37664. function updateSelectedCell(state, selection, updateCell) {
  37665. if (!selection) {
  37666. return state;
  37667. }
  37668. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  37669. const {
  37670. sectionName: selectionSectionName,
  37671. rowIndex: selectionRowIndex
  37672. } = selection;
  37673. return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
  37674. if (selectionSectionName && selectionSectionName !== sectionName) {
  37675. return section;
  37676. }
  37677. return section.map((row, rowIndex) => {
  37678. if (selectionRowIndex && selectionRowIndex !== rowIndex) {
  37679. return row;
  37680. }
  37681. return {
  37682. cells: row.cells.map((cellAttributes, columnIndex) => {
  37683. const cellLocation = {
  37684. sectionName,
  37685. columnIndex,
  37686. rowIndex
  37687. };
  37688. if (!isCellSelected(cellLocation, selection)) {
  37689. return cellAttributes;
  37690. }
  37691. return updateCell(cellAttributes);
  37692. })
  37693. };
  37694. });
  37695. });
  37696. }
  37697. /**
  37698. * Returns whether the cell at `cellLocation` is included in the selection `selection`.
  37699. *
  37700. * @param {Object} cellLocation An object containing cell location properties.
  37701. * @param {Object} selection An object containing selection properties.
  37702. *
  37703. * @return {boolean} True if the cell is selected, false otherwise.
  37704. */
  37705. function isCellSelected(cellLocation, selection) {
  37706. if (!cellLocation || !selection) {
  37707. return false;
  37708. }
  37709. switch (selection.type) {
  37710. case 'column':
  37711. return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex;
  37712. case 'cell':
  37713. return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex;
  37714. }
  37715. }
  37716. /**
  37717. * Inserts a row in the table state.
  37718. *
  37719. * @param {Object} state Current table state.
  37720. * @param {Object} options
  37721. * @param {string} options.sectionName Section in which to insert the row.
  37722. * @param {number} options.rowIndex Row index at which to insert the row.
  37723. * @param {number} options.columnCount Column count for the table to create.
  37724. *
  37725. * @return {Object} New table state.
  37726. */
  37727. function insertRow(state, _ref2) {
  37728. let {
  37729. sectionName,
  37730. rowIndex,
  37731. columnCount
  37732. } = _ref2;
  37733. const firstRow = getFirstRow(state);
  37734. const cellCount = columnCount === undefined ? (0,external_lodash_namespaceObject.get)(firstRow, ['cells', 'length']) : columnCount; // Bail early if the function cannot determine how many cells to add.
  37735. if (!cellCount) {
  37736. return state;
  37737. }
  37738. return {
  37739. [sectionName]: [...state[sectionName].slice(0, rowIndex), {
  37740. cells: (0,external_lodash_namespaceObject.times)(cellCount, index => {
  37741. const firstCellInColumn = (0,external_lodash_namespaceObject.get)(firstRow, ['cells', index], {});
  37742. const inheritedAttributes = (0,external_lodash_namespaceObject.pick)(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
  37743. return { ...inheritedAttributes,
  37744. content: '',
  37745. tag: sectionName === 'head' ? 'th' : 'td'
  37746. };
  37747. })
  37748. }, ...state[sectionName].slice(rowIndex)]
  37749. };
  37750. }
  37751. /**
  37752. * Deletes a row from the table state.
  37753. *
  37754. * @param {Object} state Current table state.
  37755. * @param {Object} options
  37756. * @param {string} options.sectionName Section in which to delete the row.
  37757. * @param {number} options.rowIndex Row index to delete.
  37758. *
  37759. * @return {Object} New table state.
  37760. */
  37761. function deleteRow(state, _ref3) {
  37762. let {
  37763. sectionName,
  37764. rowIndex
  37765. } = _ref3;
  37766. return {
  37767. [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex)
  37768. };
  37769. }
  37770. /**
  37771. * Inserts a column in the table state.
  37772. *
  37773. * @param {Object} state Current table state.
  37774. * @param {Object} options
  37775. * @param {number} options.columnIndex Column index at which to insert the column.
  37776. *
  37777. * @return {Object} New table state.
  37778. */
  37779. function insertColumn(state, _ref4) {
  37780. let {
  37781. columnIndex
  37782. } = _ref4;
  37783. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  37784. return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
  37785. // Bail early if the table section is empty.
  37786. if (isEmptyTableSection(section)) {
  37787. return section;
  37788. }
  37789. return section.map(row => {
  37790. // Bail early if the row is empty or it's an attempt to insert past
  37791. // the last possible index of the array.
  37792. if (isEmptyRow(row) || row.cells.length < columnIndex) {
  37793. return row;
  37794. }
  37795. return {
  37796. cells: [...row.cells.slice(0, columnIndex), {
  37797. content: '',
  37798. tag: sectionName === 'head' ? 'th' : 'td'
  37799. }, ...row.cells.slice(columnIndex)]
  37800. };
  37801. });
  37802. });
  37803. }
  37804. /**
  37805. * Deletes a column from the table state.
  37806. *
  37807. * @param {Object} state Current table state.
  37808. * @param {Object} options
  37809. * @param {number} options.columnIndex Column index to delete.
  37810. *
  37811. * @return {Object} New table state.
  37812. */
  37813. function deleteColumn(state, _ref5) {
  37814. let {
  37815. columnIndex
  37816. } = _ref5;
  37817. const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
  37818. return (0,external_lodash_namespaceObject.mapValues)(tableSections, section => {
  37819. // Bail early if the table section is empty.
  37820. if (isEmptyTableSection(section)) {
  37821. return section;
  37822. }
  37823. return section.map(row => ({
  37824. cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells
  37825. })).filter(row => row.cells.length);
  37826. });
  37827. }
  37828. /**
  37829. * Toggles the existance of a section.
  37830. *
  37831. * @param {Object} state Current table state.
  37832. * @param {string} sectionName Name of the section to toggle.
  37833. *
  37834. * @return {Object} New table state.
  37835. */
  37836. function toggleSection(state, sectionName) {
  37837. // Section exists, replace it with an empty row to remove it.
  37838. if (!isEmptyTableSection(state[sectionName])) {
  37839. return {
  37840. [sectionName]: []
  37841. };
  37842. } // Get the length of the first row of the body to use when creating the header.
  37843. const columnCount = (0,external_lodash_namespaceObject.get)(state, ['body', 0, 'cells', 'length'], 1); // Section doesn't exist, insert an empty row to create the section.
  37844. return insertRow(state, {
  37845. sectionName,
  37846. rowIndex: 0,
  37847. columnCount
  37848. });
  37849. }
  37850. /**
  37851. * Determines whether a table section is empty.
  37852. *
  37853. * @param {Object} section Table section state.
  37854. *
  37855. * @return {boolean} True if the table section is empty, false otherwise.
  37856. */
  37857. function isEmptyTableSection(section) {
  37858. return !section || !section.length || (0,external_lodash_namespaceObject.every)(section, isEmptyRow);
  37859. }
  37860. /**
  37861. * Determines whether a table row is empty.
  37862. *
  37863. * @param {Object} row Table row state.
  37864. *
  37865. * @return {boolean} True if the table section is empty, false otherwise.
  37866. */
  37867. function isEmptyRow(row) {
  37868. return !(row.cells && row.cells.length);
  37869. }
  37870. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js
  37871. /**
  37872. * External dependencies
  37873. */
  37874. /**
  37875. * WordPress dependencies
  37876. */
  37877. /**
  37878. * Internal dependencies
  37879. */
  37880. const ALIGNMENT_CONTROLS = [{
  37881. icon: align_left,
  37882. title: (0,external_wp_i18n_namespaceObject.__)('Align column left'),
  37883. align: 'left'
  37884. }, {
  37885. icon: align_center,
  37886. title: (0,external_wp_i18n_namespaceObject.__)('Align column center'),
  37887. align: 'center'
  37888. }, {
  37889. icon: align_right,
  37890. title: (0,external_wp_i18n_namespaceObject.__)('Align column right'),
  37891. align: 'right'
  37892. }];
  37893. const cellAriaLabel = {
  37894. head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'),
  37895. body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'),
  37896. foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text')
  37897. };
  37898. const placeholder = {
  37899. head: (0,external_wp_i18n_namespaceObject.__)('Header label'),
  37900. foot: (0,external_wp_i18n_namespaceObject.__)('Footer label')
  37901. };
  37902. function TSection(_ref) {
  37903. let {
  37904. name,
  37905. ...props
  37906. } = _ref;
  37907. const TagName = `t${name}`;
  37908. return (0,external_wp_element_namespaceObject.createElement)(TagName, props);
  37909. }
  37910. function TableEdit(_ref2) {
  37911. let {
  37912. attributes,
  37913. setAttributes,
  37914. insertBlocksAfter,
  37915. isSelected
  37916. } = _ref2;
  37917. const {
  37918. hasFixedLayout,
  37919. caption,
  37920. head,
  37921. foot
  37922. } = attributes;
  37923. const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2);
  37924. const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2);
  37925. const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)();
  37926. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  37927. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  37928. /**
  37929. * Updates the initial column count used for table creation.
  37930. *
  37931. * @param {number} count New initial column count.
  37932. */
  37933. function onChangeInitialColumnCount(count) {
  37934. setInitialColumnCount(count);
  37935. }
  37936. /**
  37937. * Updates the initial row count used for table creation.
  37938. *
  37939. * @param {number} count New initial row count.
  37940. */
  37941. function onChangeInitialRowCount(count) {
  37942. setInitialRowCount(count);
  37943. }
  37944. /**
  37945. * Creates a table based on dimensions in local state.
  37946. *
  37947. * @param {Object} event Form submit event.
  37948. */
  37949. function onCreateTable(event) {
  37950. event.preventDefault();
  37951. setAttributes(createTable({
  37952. rowCount: parseInt(initialRowCount, 10) || 2,
  37953. columnCount: parseInt(initialColumnCount, 10) || 2
  37954. }));
  37955. }
  37956. /**
  37957. * Toggles whether the table has a fixed layout or not.
  37958. */
  37959. function onChangeFixedLayout() {
  37960. setAttributes({
  37961. hasFixedLayout: !hasFixedLayout
  37962. });
  37963. }
  37964. /**
  37965. * Changes the content of the currently selected cell.
  37966. *
  37967. * @param {Array} content A RichText content value.
  37968. */
  37969. function onChange(content) {
  37970. if (!selectedCell) {
  37971. return;
  37972. }
  37973. setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ ...cellAttributes,
  37974. content
  37975. })));
  37976. }
  37977. /**
  37978. * Align text within the a column.
  37979. *
  37980. * @param {string} align The new alignment to apply to the column.
  37981. */
  37982. function onChangeColumnAlignment(align) {
  37983. if (!selectedCell) {
  37984. return;
  37985. } // Convert the cell selection to a column selection so that alignment
  37986. // is applied to the entire column.
  37987. const columnSelection = {
  37988. type: 'column',
  37989. columnIndex: selectedCell.columnIndex
  37990. };
  37991. const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ ...cellAttributes,
  37992. align
  37993. }));
  37994. setAttributes(newAttributes);
  37995. }
  37996. /**
  37997. * Get the alignment of the currently selected cell.
  37998. *
  37999. * @return {string} The new alignment to apply to the column.
  38000. */
  38001. function getCellAlignment() {
  38002. if (!selectedCell) {
  38003. return;
  38004. }
  38005. return getCellAttribute(attributes, selectedCell, 'align');
  38006. }
  38007. /**
  38008. * Add or remove a `head` table section.
  38009. */
  38010. function onToggleHeaderSection() {
  38011. setAttributes(toggleSection(attributes, 'head'));
  38012. }
  38013. /**
  38014. * Add or remove a `foot` table section.
  38015. */
  38016. function onToggleFooterSection() {
  38017. setAttributes(toggleSection(attributes, 'foot'));
  38018. }
  38019. /**
  38020. * Inserts a row at the currently selected row index, plus `delta`.
  38021. *
  38022. * @param {number} delta Offset for selected row index at which to insert.
  38023. */
  38024. function onInsertRow(delta) {
  38025. if (!selectedCell) {
  38026. return;
  38027. }
  38028. const {
  38029. sectionName,
  38030. rowIndex
  38031. } = selectedCell;
  38032. const newRowIndex = rowIndex + delta;
  38033. setAttributes(insertRow(attributes, {
  38034. sectionName,
  38035. rowIndex: newRowIndex
  38036. })); // Select the first cell of the new row.
  38037. setSelectedCell({
  38038. sectionName,
  38039. rowIndex: newRowIndex,
  38040. columnIndex: 0,
  38041. type: 'cell'
  38042. });
  38043. }
  38044. /**
  38045. * Inserts a row before the currently selected row.
  38046. */
  38047. function onInsertRowBefore() {
  38048. onInsertRow(0);
  38049. }
  38050. /**
  38051. * Inserts a row after the currently selected row.
  38052. */
  38053. function onInsertRowAfter() {
  38054. onInsertRow(1);
  38055. }
  38056. /**
  38057. * Deletes the currently selected row.
  38058. */
  38059. function onDeleteRow() {
  38060. if (!selectedCell) {
  38061. return;
  38062. }
  38063. const {
  38064. sectionName,
  38065. rowIndex
  38066. } = selectedCell;
  38067. setSelectedCell();
  38068. setAttributes(deleteRow(attributes, {
  38069. sectionName,
  38070. rowIndex
  38071. }));
  38072. }
  38073. /**
  38074. * Inserts a column at the currently selected column index, plus `delta`.
  38075. *
  38076. * @param {number} delta Offset for selected column index at which to insert.
  38077. */
  38078. function onInsertColumn() {
  38079. let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  38080. if (!selectedCell) {
  38081. return;
  38082. }
  38083. const {
  38084. columnIndex
  38085. } = selectedCell;
  38086. const newColumnIndex = columnIndex + delta;
  38087. setAttributes(insertColumn(attributes, {
  38088. columnIndex: newColumnIndex
  38089. })); // Select the first cell of the new column.
  38090. setSelectedCell({
  38091. rowIndex: 0,
  38092. columnIndex: newColumnIndex,
  38093. type: 'cell'
  38094. });
  38095. }
  38096. /**
  38097. * Inserts a column before the currently selected column.
  38098. */
  38099. function onInsertColumnBefore() {
  38100. onInsertColumn(0);
  38101. }
  38102. /**
  38103. * Inserts a column after the currently selected column.
  38104. */
  38105. function onInsertColumnAfter() {
  38106. onInsertColumn(1);
  38107. }
  38108. /**
  38109. * Deletes the currently selected column.
  38110. */
  38111. function onDeleteColumn() {
  38112. if (!selectedCell) {
  38113. return;
  38114. }
  38115. const {
  38116. sectionName,
  38117. columnIndex
  38118. } = selectedCell;
  38119. setSelectedCell();
  38120. setAttributes(deleteColumn(attributes, {
  38121. sectionName,
  38122. columnIndex
  38123. }));
  38124. }
  38125. (0,external_wp_element_namespaceObject.useEffect)(() => {
  38126. if (!isSelected) {
  38127. setSelectedCell();
  38128. }
  38129. }, [isSelected]);
  38130. const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name]));
  38131. const tableControls = [{
  38132. icon: table_row_before,
  38133. title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'),
  38134. isDisabled: !selectedCell,
  38135. onClick: onInsertRowBefore
  38136. }, {
  38137. icon: table_row_after,
  38138. title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'),
  38139. isDisabled: !selectedCell,
  38140. onClick: onInsertRowAfter
  38141. }, {
  38142. icon: table_row_delete,
  38143. title: (0,external_wp_i18n_namespaceObject.__)('Delete row'),
  38144. isDisabled: !selectedCell,
  38145. onClick: onDeleteRow
  38146. }, {
  38147. icon: table_column_before,
  38148. title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'),
  38149. isDisabled: !selectedCell,
  38150. onClick: onInsertColumnBefore
  38151. }, {
  38152. icon: table_column_after,
  38153. title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'),
  38154. isDisabled: !selectedCell,
  38155. onClick: onInsertColumnAfter
  38156. }, {
  38157. icon: table_column_delete,
  38158. title: (0,external_wp_i18n_namespaceObject.__)('Delete column'),
  38159. isDisabled: !selectedCell,
  38160. onClick: onDeleteColumn
  38161. }];
  38162. const renderedSections = ['head', 'body', 'foot'].map(name => (0,external_wp_element_namespaceObject.createElement)(TSection, {
  38163. name: name,
  38164. key: name
  38165. }, attributes[name].map((_ref3, rowIndex) => {
  38166. let {
  38167. cells
  38168. } = _ref3;
  38169. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  38170. key: rowIndex
  38171. }, cells.map((_ref4, columnIndex) => {
  38172. let {
  38173. content,
  38174. tag: CellTag,
  38175. scope,
  38176. align
  38177. } = _ref4;
  38178. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  38179. tagName: CellTag,
  38180. key: columnIndex,
  38181. className: classnames_default()({
  38182. [`has-text-align-${align}`]: align
  38183. }, 'wp-block-table__cell-content'),
  38184. scope: CellTag === 'th' ? scope : undefined,
  38185. value: content,
  38186. onChange: onChange,
  38187. unstableOnFocus: () => {
  38188. setSelectedCell({
  38189. sectionName: name,
  38190. rowIndex,
  38191. columnIndex,
  38192. type: 'cell'
  38193. });
  38194. },
  38195. "aria-label": cellAriaLabel[name],
  38196. placeholder: placeholder[name]
  38197. });
  38198. }));
  38199. })));
  38200. const isEmpty = !sections.length;
  38201. return (0,external_wp_element_namespaceObject.createElement)("figure", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  38202. group: "block"
  38203. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  38204. label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'),
  38205. alignmentControls: ALIGNMENT_CONTROLS,
  38206. value: getCellAlignment(),
  38207. onChange: nextAlign => onChangeColumnAlignment(nextAlign)
  38208. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  38209. group: "other"
  38210. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
  38211. hasArrowIndicator: true,
  38212. icon: library_table,
  38213. label: (0,external_wp_i18n_namespaceObject.__)('Edit table'),
  38214. controls: tableControls
  38215. }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  38216. title: (0,external_wp_i18n_namespaceObject.__)('Table settings'),
  38217. className: "blocks-table-settings"
  38218. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38219. label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
  38220. checked: !!hasFixedLayout,
  38221. onChange: onChangeFixedLayout
  38222. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38223. label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
  38224. checked: !!(head && head.length),
  38225. onChange: onToggleHeaderSection
  38226. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38227. label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
  38228. checked: !!(foot && foot.length),
  38229. onChange: onToggleFooterSection
  38230. }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)("table", {
  38231. className: classnames_default()(colorProps.className, borderProps.className, {
  38232. 'has-fixed-layout': hasFixedLayout
  38233. }),
  38234. style: { ...colorProps.style,
  38235. ...borderProps.style
  38236. }
  38237. }, renderedSections), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  38238. tagName: "figcaption",
  38239. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Table caption text'),
  38240. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  38241. value: caption,
  38242. onChange: value => setAttributes({
  38243. caption: value
  38244. }) // Deselect the selected table cell when the caption is focused.
  38245. ,
  38246. unstableOnFocus: () => setSelectedCell(),
  38247. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  38248. }), isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  38249. label: (0,external_wp_i18n_namespaceObject.__)('Table'),
  38250. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  38251. icon: block_table,
  38252. showColors: true
  38253. }),
  38254. instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.')
  38255. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  38256. className: "blocks-table__placeholder-form",
  38257. onSubmit: onCreateTable
  38258. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  38259. type: "number",
  38260. label: (0,external_wp_i18n_namespaceObject.__)('Column count'),
  38261. value: initialColumnCount,
  38262. onChange: onChangeInitialColumnCount,
  38263. min: "1",
  38264. className: "blocks-table__placeholder-input"
  38265. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  38266. type: "number",
  38267. label: (0,external_wp_i18n_namespaceObject.__)('Row count'),
  38268. value: initialRowCount,
  38269. onChange: onChangeInitialRowCount,
  38270. min: "1",
  38271. className: "blocks-table__placeholder-input"
  38272. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  38273. className: "blocks-table__placeholder-button",
  38274. variant: "primary",
  38275. type: "submit"
  38276. }, (0,external_wp_i18n_namespaceObject.__)('Create Table')))));
  38277. }
  38278. /* harmony default export */ var table_edit = (TableEdit);
  38279. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js
  38280. /**
  38281. * External dependencies
  38282. */
  38283. /**
  38284. * WordPress dependencies
  38285. */
  38286. function table_save_save(_ref) {
  38287. let {
  38288. attributes
  38289. } = _ref;
  38290. const {
  38291. hasFixedLayout,
  38292. head,
  38293. body,
  38294. foot,
  38295. caption
  38296. } = attributes;
  38297. const isEmpty = !head.length && !body.length && !foot.length;
  38298. if (isEmpty) {
  38299. return null;
  38300. }
  38301. const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  38302. const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  38303. const classes = classnames_default()(colorProps.className, borderProps.className, {
  38304. 'has-fixed-layout': hasFixedLayout
  38305. });
  38306. const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
  38307. const Section = _ref2 => {
  38308. let {
  38309. type,
  38310. rows
  38311. } = _ref2;
  38312. if (!rows.length) {
  38313. return null;
  38314. }
  38315. const Tag = `t${type}`;
  38316. return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
  38317. let {
  38318. cells
  38319. } = _ref3;
  38320. return (0,external_wp_element_namespaceObject.createElement)("tr", {
  38321. key: rowIndex
  38322. }, cells.map((_ref4, cellIndex) => {
  38323. let {
  38324. content,
  38325. tag,
  38326. scope,
  38327. align
  38328. } = _ref4;
  38329. const cellClasses = classnames_default()({
  38330. [`has-text-align-${align}`]: align
  38331. });
  38332. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38333. className: cellClasses ? cellClasses : undefined,
  38334. "data-align": align,
  38335. tagName: tag,
  38336. value: content,
  38337. key: cellIndex,
  38338. scope: tag === 'th' ? scope : undefined
  38339. });
  38340. }));
  38341. }));
  38342. };
  38343. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
  38344. className: classes === '' ? undefined : classes,
  38345. style: { ...colorProps.style,
  38346. ...borderProps.style
  38347. }
  38348. }, (0,external_wp_element_namespaceObject.createElement)(Section, {
  38349. type: "head",
  38350. rows: head
  38351. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  38352. type: "body",
  38353. rows: body
  38354. }), (0,external_wp_element_namespaceObject.createElement)(Section, {
  38355. type: "foot",
  38356. rows: foot
  38357. })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  38358. tagName: "figcaption",
  38359. value: caption
  38360. }));
  38361. }
  38362. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/transforms.js
  38363. const tableContentPasteSchema = _ref => {
  38364. let {
  38365. phrasingContentSchema
  38366. } = _ref;
  38367. return {
  38368. tr: {
  38369. allowEmpty: true,
  38370. children: {
  38371. th: {
  38372. allowEmpty: true,
  38373. children: phrasingContentSchema,
  38374. attributes: ['scope']
  38375. },
  38376. td: {
  38377. allowEmpty: true,
  38378. children: phrasingContentSchema
  38379. }
  38380. }
  38381. }
  38382. };
  38383. };
  38384. const tablePasteSchema = args => ({
  38385. table: {
  38386. children: {
  38387. thead: {
  38388. allowEmpty: true,
  38389. children: tableContentPasteSchema(args)
  38390. },
  38391. tfoot: {
  38392. allowEmpty: true,
  38393. children: tableContentPasteSchema(args)
  38394. },
  38395. tbody: {
  38396. allowEmpty: true,
  38397. children: tableContentPasteSchema(args)
  38398. }
  38399. }
  38400. }
  38401. });
  38402. const table_transforms_transforms = {
  38403. from: [{
  38404. type: 'raw',
  38405. selector: 'table',
  38406. schema: tablePasteSchema
  38407. }]
  38408. };
  38409. /* harmony default export */ var table_transforms = (table_transforms_transforms);
  38410. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js
  38411. /**
  38412. * WordPress dependencies
  38413. */
  38414. /**
  38415. * Internal dependencies
  38416. */
  38417. const table_metadata = {
  38418. $schema: "https://schemas.wp.org/trunk/block.json",
  38419. apiVersion: 2,
  38420. name: "core/table",
  38421. title: "Table",
  38422. category: "text",
  38423. description: "Create structured content in rows and columns to display information.",
  38424. textdomain: "default",
  38425. attributes: {
  38426. hasFixedLayout: {
  38427. type: "boolean",
  38428. "default": false
  38429. },
  38430. caption: {
  38431. type: "string",
  38432. source: "html",
  38433. selector: "figcaption",
  38434. "default": ""
  38435. },
  38436. head: {
  38437. type: "array",
  38438. "default": [],
  38439. source: "query",
  38440. selector: "thead tr",
  38441. query: {
  38442. cells: {
  38443. type: "array",
  38444. "default": [],
  38445. source: "query",
  38446. selector: "td,th",
  38447. query: {
  38448. content: {
  38449. type: "string",
  38450. source: "html"
  38451. },
  38452. tag: {
  38453. type: "string",
  38454. "default": "td",
  38455. source: "tag"
  38456. },
  38457. scope: {
  38458. type: "string",
  38459. source: "attribute",
  38460. attribute: "scope"
  38461. },
  38462. align: {
  38463. type: "string",
  38464. source: "attribute",
  38465. attribute: "data-align"
  38466. }
  38467. }
  38468. }
  38469. }
  38470. },
  38471. body: {
  38472. type: "array",
  38473. "default": [],
  38474. source: "query",
  38475. selector: "tbody tr",
  38476. query: {
  38477. cells: {
  38478. type: "array",
  38479. "default": [],
  38480. source: "query",
  38481. selector: "td,th",
  38482. query: {
  38483. content: {
  38484. type: "string",
  38485. source: "html"
  38486. },
  38487. tag: {
  38488. type: "string",
  38489. "default": "td",
  38490. source: "tag"
  38491. },
  38492. scope: {
  38493. type: "string",
  38494. source: "attribute",
  38495. attribute: "scope"
  38496. },
  38497. align: {
  38498. type: "string",
  38499. source: "attribute",
  38500. attribute: "data-align"
  38501. }
  38502. }
  38503. }
  38504. }
  38505. },
  38506. foot: {
  38507. type: "array",
  38508. "default": [],
  38509. source: "query",
  38510. selector: "tfoot tr",
  38511. query: {
  38512. cells: {
  38513. type: "array",
  38514. "default": [],
  38515. source: "query",
  38516. selector: "td,th",
  38517. query: {
  38518. content: {
  38519. type: "string",
  38520. source: "html"
  38521. },
  38522. tag: {
  38523. type: "string",
  38524. "default": "td",
  38525. source: "tag"
  38526. },
  38527. scope: {
  38528. type: "string",
  38529. source: "attribute",
  38530. attribute: "scope"
  38531. },
  38532. align: {
  38533. type: "string",
  38534. source: "attribute",
  38535. attribute: "data-align"
  38536. }
  38537. }
  38538. }
  38539. }
  38540. }
  38541. },
  38542. supports: {
  38543. anchor: true,
  38544. align: true,
  38545. color: {
  38546. __experimentalSkipSerialization: true,
  38547. gradients: true,
  38548. __experimentalDefaultControls: {
  38549. background: true,
  38550. text: true
  38551. }
  38552. },
  38553. typography: {
  38554. fontSize: true,
  38555. lineHeight: true,
  38556. __experimentalFontStyle: true,
  38557. __experimentalFontWeight: true,
  38558. __experimentalLetterSpacing: true,
  38559. __experimentalTextTransform: true,
  38560. __experimentalDefaultControls: {
  38561. fontSize: true
  38562. }
  38563. },
  38564. __experimentalBorder: {
  38565. __experimentalSkipSerialization: true,
  38566. color: true,
  38567. style: true,
  38568. width: true,
  38569. __experimentalDefaultControls: {
  38570. color: true,
  38571. style: true,
  38572. width: true
  38573. }
  38574. },
  38575. __experimentalSelector: ".wp-block-table > table"
  38576. },
  38577. styles: [{
  38578. name: "regular",
  38579. label: "Default",
  38580. isDefault: true
  38581. }, {
  38582. name: "stripes",
  38583. label: "Stripes"
  38584. }],
  38585. editorStyle: "wp-block-table-editor",
  38586. style: "wp-block-table"
  38587. };
  38588. const {
  38589. name: table_name
  38590. } = table_metadata;
  38591. const table_settings = {
  38592. icon: block_table,
  38593. example: {
  38594. attributes: {
  38595. head: [{
  38596. cells: [{
  38597. content: (0,external_wp_i18n_namespaceObject.__)('Version'),
  38598. tag: 'th'
  38599. }, {
  38600. content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'),
  38601. tag: 'th'
  38602. }, {
  38603. content: (0,external_wp_i18n_namespaceObject.__)('Release Date'),
  38604. tag: 'th'
  38605. }]
  38606. }],
  38607. body: [{
  38608. cells: [{
  38609. content: '5.2',
  38610. tag: 'td'
  38611. }, {
  38612. content: 'Jaco Pastorius',
  38613. tag: 'td'
  38614. }, {
  38615. content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'),
  38616. tag: 'td'
  38617. }]
  38618. }, {
  38619. cells: [{
  38620. content: '5.1',
  38621. tag: 'td'
  38622. }, {
  38623. content: 'Betty Carter',
  38624. tag: 'td'
  38625. }, {
  38626. content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'),
  38627. tag: 'td'
  38628. }]
  38629. }, {
  38630. cells: [{
  38631. content: '5.0',
  38632. tag: 'td'
  38633. }, {
  38634. content: 'Bebo Valdés',
  38635. tag: 'td'
  38636. }, {
  38637. content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'),
  38638. tag: 'td'
  38639. }]
  38640. }]
  38641. }
  38642. },
  38643. transforms: table_transforms,
  38644. edit: table_edit,
  38645. save: table_save_save,
  38646. deprecated: table_deprecated
  38647. };
  38648. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js
  38649. /**
  38650. * WordPress dependencies
  38651. */
  38652. const tag_cloud_transforms_transforms = {
  38653. from: [{
  38654. type: 'block',
  38655. blocks: ['core/categories'],
  38656. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud')
  38657. }],
  38658. to: [{
  38659. type: 'block',
  38660. blocks: ['core/categories'],
  38661. transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories')
  38662. }]
  38663. };
  38664. /* harmony default export */ var tag_cloud_transforms = (tag_cloud_transforms_transforms);
  38665. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
  38666. /**
  38667. * External dependencies
  38668. */
  38669. /**
  38670. * WordPress dependencies
  38671. */
  38672. /**
  38673. * Minimum number of tags a user can show using this block.
  38674. *
  38675. * @type {number}
  38676. */
  38677. const MIN_TAGS = 1;
  38678. /**
  38679. * Maximum number of tags a user can show using this block.
  38680. *
  38681. * @type {number}
  38682. */
  38683. const MAX_TAGS = 100;
  38684. const MIN_FONT_SIZE = 0.1;
  38685. const MAX_FONT_SIZE = 100;
  38686. function TagCloudEdit(_ref) {
  38687. let {
  38688. attributes,
  38689. setAttributes,
  38690. taxonomies
  38691. } = _ref;
  38692. const {
  38693. taxonomy,
  38694. showTagCounts,
  38695. numberOfTags,
  38696. smallestFontSize,
  38697. largestFontSize
  38698. } = attributes;
  38699. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
  38700. availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem']
  38701. });
  38702. const getTaxonomyOptions = () => {
  38703. const selectOption = {
  38704. label: (0,external_wp_i18n_namespaceObject.__)('- Select -'),
  38705. value: '',
  38706. disabled: true
  38707. };
  38708. const taxonomyOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(taxonomies, 'show_cloud'), item => {
  38709. return {
  38710. value: item.slug,
  38711. label: item.name
  38712. };
  38713. });
  38714. return [selectOption, ...taxonomyOptions];
  38715. };
  38716. const onFontSizeChange = (fontSizeLabel, newValue) => {
  38717. // eslint-disable-next-line @wordpress/no-unused-vars-before-return
  38718. const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue);
  38719. if (!Number.isFinite(quantity)) {
  38720. return;
  38721. }
  38722. const updateObj = {
  38723. [fontSizeLabel]: newValue
  38724. }; // We need to keep in sync the `unit` changes to both `smallestFontSize`
  38725. // and `largestFontSize` attributes.
  38726. Object.entries({
  38727. smallestFontSize,
  38728. largestFontSize
  38729. }).forEach(_ref2 => {
  38730. let [attribute, currentValue] = _ref2;
  38731. const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); // Only add an update if the other font size attribute has a different unit.
  38732. if (attribute !== fontSizeLabel && currentUnit !== newUnit) {
  38733. updateObj[attribute] = `${currentQuantity}${newUnit}`;
  38734. }
  38735. });
  38736. setAttributes(updateObj);
  38737. };
  38738. const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  38739. title: (0,external_wp_i18n_namespaceObject.__)('Tag Cloud settings')
  38740. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  38741. label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
  38742. options: getTaxonomyOptions(),
  38743. value: taxonomy,
  38744. onChange: selectedTaxonomy => setAttributes({
  38745. taxonomy: selectedTaxonomy
  38746. })
  38747. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  38748. label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'),
  38749. checked: showTagCounts,
  38750. onChange: () => setAttributes({
  38751. showTagCounts: !showTagCounts
  38752. })
  38753. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  38754. label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
  38755. value: numberOfTags,
  38756. onChange: value => setAttributes({
  38757. numberOfTags: value
  38758. }),
  38759. min: MIN_TAGS,
  38760. max: MAX_TAGS,
  38761. required: true
  38762. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  38763. isBlock: true
  38764. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  38765. label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'),
  38766. value: smallestFontSize,
  38767. onChange: value => {
  38768. onFontSizeChange('smallestFontSize', value);
  38769. },
  38770. units: units,
  38771. min: MIN_FONT_SIZE,
  38772. max: MAX_FONT_SIZE
  38773. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
  38774. isBlock: true
  38775. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
  38776. label: (0,external_wp_i18n_namespaceObject.__)('Largest size'),
  38777. value: largestFontSize,
  38778. onChange: value => {
  38779. onFontSizeChange('largestFontSize', value);
  38780. },
  38781. units: units,
  38782. min: MIN_FONT_SIZE,
  38783. max: MAX_FONT_SIZE
  38784. })))));
  38785. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
  38786. key: "tag-cloud",
  38787. block: "core/tag-cloud",
  38788. attributes: attributes
  38789. })));
  38790. }
  38791. /* harmony default export */ var tag_cloud_edit = ((0,external_wp_data_namespaceObject.withSelect)(select => {
  38792. return {
  38793. taxonomies: select(external_wp_coreData_namespaceObject.store).getTaxonomies({
  38794. per_page: -1
  38795. })
  38796. };
  38797. })(TagCloudEdit));
  38798. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
  38799. /**
  38800. * WordPress dependencies
  38801. */
  38802. /**
  38803. * Internal dependencies
  38804. */
  38805. const tag_cloud_metadata = {
  38806. $schema: "https://schemas.wp.org/trunk/block.json",
  38807. apiVersion: 2,
  38808. name: "core/tag-cloud",
  38809. title: "Tag Cloud",
  38810. category: "widgets",
  38811. description: "A cloud of your most used tags.",
  38812. textdomain: "default",
  38813. attributes: {
  38814. numberOfTags: {
  38815. type: "number",
  38816. "default": 45,
  38817. minimum: 1,
  38818. maximum: 100
  38819. },
  38820. taxonomy: {
  38821. type: "string",
  38822. "default": "post_tag"
  38823. },
  38824. showTagCounts: {
  38825. type: "boolean",
  38826. "default": false
  38827. },
  38828. smallestFontSize: {
  38829. type: "string",
  38830. "default": "8pt"
  38831. },
  38832. largestFontSize: {
  38833. type: "string",
  38834. "default": "22pt"
  38835. }
  38836. },
  38837. styles: [{
  38838. name: "default",
  38839. label: "Default",
  38840. isDefault: true
  38841. }, {
  38842. name: "outline",
  38843. label: "Outline"
  38844. }],
  38845. supports: {
  38846. html: false,
  38847. align: true
  38848. },
  38849. editorStyle: "wp-block-tag-cloud-editor"
  38850. };
  38851. const {
  38852. name: tag_cloud_name
  38853. } = tag_cloud_metadata;
  38854. const tag_cloud_settings = {
  38855. icon: library_tag,
  38856. example: {},
  38857. edit: tag_cloud_edit,
  38858. transforms: tag_cloud_transforms
  38859. };
  38860. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
  38861. /**
  38862. * WordPress dependencies
  38863. */
  38864. const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  38865. xmlns: "http://www.w3.org/2000/svg",
  38866. viewBox: "0 0 24 24"
  38867. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  38868. d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
  38869. }));
  38870. /* harmony default export */ var symbol_filled = (symbolFilled);
  38871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js
  38872. /**
  38873. * External dependencies
  38874. */
  38875. /**
  38876. * WordPress dependencies
  38877. */
  38878. /**
  38879. * Internal dependencies
  38880. */
  38881. /**
  38882. * Retrieves the available template parts for the given area.
  38883. *
  38884. * @param {string} area Template part area.
  38885. * @param {string} excludedId Template part ID to exclude.
  38886. *
  38887. * @return {{ templateParts: Array, isResolving: boolean }} array of template parts.
  38888. */
  38889. function useAlternativeTemplateParts(area, excludedId) {
  38890. const {
  38891. templateParts,
  38892. isResolving
  38893. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  38894. const {
  38895. getEntityRecords,
  38896. isResolving: _isResolving
  38897. } = select(external_wp_coreData_namespaceObject.store);
  38898. const query = {
  38899. per_page: -1
  38900. };
  38901. return {
  38902. templateParts: getEntityRecords('postType', 'wp_template_part', query),
  38903. isLoading: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query])
  38904. };
  38905. }, []);
  38906. const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => {
  38907. if (!templateParts) {
  38908. return [];
  38909. }
  38910. return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || [];
  38911. }, [templateParts, area]);
  38912. return {
  38913. templateParts: filteredTemplateParts,
  38914. isResolving
  38915. };
  38916. }
  38917. /**
  38918. * Retrieves the available block patterns for the given area.
  38919. *
  38920. * @param {string} area Template part area.
  38921. * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks).
  38922. *
  38923. * @return {Array} array of block patterns.
  38924. */
  38925. function useAlternativeBlockPatterns(area, clientId) {
  38926. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  38927. const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part';
  38928. const {
  38929. getBlockRootClientId,
  38930. __experimentalGetPatternsByBlockTypes
  38931. } = select(external_wp_blockEditor_namespaceObject.store);
  38932. const rootClientId = getBlockRootClientId(clientId);
  38933. return __experimentalGetPatternsByBlockTypes(blockNameWithArea, rootClientId);
  38934. }, [area, clientId]);
  38935. }
  38936. function useCreateTemplatePartFromBlocks(area, setAttributes) {
  38937. const {
  38938. saveEntityRecord
  38939. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
  38940. return async function () {
  38941. let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  38942. let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part');
  38943. // Currently template parts only allow latin chars.
  38944. // Fallback slug will receive suffix by default.
  38945. const cleanSlug = (0,external_lodash_namespaceObject.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; // If we have `area` set from block attributes, means an exposed
  38946. // block variation was inserted. So add this prop to the template
  38947. // part entity on creation. Afterwards remove `area` value from
  38948. // block attributes.
  38949. const record = {
  38950. title,
  38951. slug: cleanSlug,
  38952. content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
  38953. // `area` is filterable on the server and defaults to `UNCATEGORIZED`
  38954. // if provided value is not allowed.
  38955. area
  38956. };
  38957. const templatePart = await saveEntityRecord('postType', 'wp_template_part', record);
  38958. setAttributes({
  38959. slug: templatePart.slug,
  38960. theme: templatePart.theme,
  38961. area: undefined
  38962. });
  38963. };
  38964. }
  38965. /**
  38966. * Retrieves the template part area object.
  38967. *
  38968. * @param {string} area Template part area identifier.
  38969. *
  38970. * @return {{icon: Object, label: string, tagName: string}} Template Part area.
  38971. */
  38972. function useTemplatePartArea(area) {
  38973. return (0,external_wp_data_namespaceObject.useSelect)(select => {
  38974. var _selectedArea$area_ta;
  38975. // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  38976. // Blocks can be loaded into a *non-post* block editor.
  38977. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  38978. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  38979. const selectedArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
  38980. area
  38981. });
  38982. const defaultArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
  38983. area: 'uncategorized'
  38984. });
  38985. return {
  38986. icon: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.icon) || (defaultArea === null || defaultArea === void 0 ? void 0 : defaultArea.icon),
  38987. label: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.label) || (0,external_wp_i18n_namespaceObject.__)('Template Part'),
  38988. tagName: (_selectedArea$area_ta = selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div'
  38989. };
  38990. }, [area]);
  38991. }
  38992. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js
  38993. /**
  38994. * WordPress dependencies
  38995. */
  38996. function TitleModal(_ref) {
  38997. let {
  38998. areaLabel,
  38999. onClose,
  39000. onSubmit
  39001. } = _ref;
  39002. // Restructure onCreate to set the blocks on local state.
  39003. // Add modal to confirm title and trigger onCreate.
  39004. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part'));
  39005. const submitForCreation = event => {
  39006. event.preventDefault();
  39007. onSubmit(title);
  39008. };
  39009. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  39010. title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  39011. (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()),
  39012. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  39013. overlayClassName: "wp-block-template-part__placeholder-create-new__title-form",
  39014. onRequestClose: onClose
  39015. }, (0,external_wp_element_namespaceObject.createElement)("form", {
  39016. onSubmit: submitForCreation
  39017. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  39018. label: (0,external_wp_i18n_namespaceObject.__)('Name'),
  39019. value: title,
  39020. onChange: setTitle
  39021. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
  39022. className: "wp-block-template-part__placeholder-create-new__title-form-actions",
  39023. justify: "flex-end"
  39024. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39025. variant: "primary",
  39026. type: "submit",
  39027. disabled: !title.length,
  39028. "aria-disabled": !title.length
  39029. }, (0,external_wp_i18n_namespaceObject.__)('Create'))))));
  39030. }
  39031. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js
  39032. /**
  39033. * WordPress dependencies
  39034. */
  39035. /**
  39036. * Internal dependencies
  39037. */
  39038. function TemplatePartPlaceholder(_ref) {
  39039. let {
  39040. area,
  39041. clientId,
  39042. templatePartId,
  39043. onOpenSelectionModal,
  39044. setAttributes
  39045. } = _ref;
  39046. const {
  39047. templateParts,
  39048. isResolving
  39049. } = useAlternativeTemplateParts(area, templatePartId);
  39050. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  39051. const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false);
  39052. const areaObject = useTemplatePartArea(area);
  39053. const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  39054. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
  39055. icon: areaObject.icon,
  39056. label: areaObject.label,
  39057. instructions: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  39058. (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase())
  39059. }, isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isResolving && !!(templateParts.length || blockPatterns.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39060. variant: "primary",
  39061. onClick: onOpenSelectionModal
  39062. }, (0,external_wp_i18n_namespaceObject.__)('Choose')), !isResolving && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  39063. variant: "secondary",
  39064. onClick: () => {
  39065. setShowTitleModal(true);
  39066. }
  39067. }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), showTitleModal && (0,external_wp_element_namespaceObject.createElement)(TitleModal, {
  39068. areaLabel: areaObject.label,
  39069. onClose: () => setShowTitleModal(false),
  39070. onSubmit: title => {
  39071. createFromBlocks([], title);
  39072. }
  39073. }));
  39074. }
  39075. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js
  39076. /**
  39077. * WordPress dependencies
  39078. */
  39079. /**
  39080. * Internal dependencies
  39081. */
  39082. function TemplatePartSelectionModal(_ref) {
  39083. let {
  39084. setAttributes,
  39085. onClose,
  39086. templatePartId = null,
  39087. area,
  39088. clientId
  39089. } = _ref;
  39090. // When the templatePartId is undefined,
  39091. // it means the user is creating a new one from the placeholder.
  39092. const isReplacingTemplatePartContent = !!templatePartId;
  39093. const {
  39094. templateParts
  39095. } = useAlternativeTemplateParts(area, templatePartId); // We can map template parts to block patters to reuse the BlockPatternsList UI
  39096. const templartPartsAsBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => {
  39097. return templateParts.map(templatePart => ({
  39098. name: createTemplatePartId(templatePart.theme, templatePart.slug),
  39099. title: templatePart.title.rendered,
  39100. blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw),
  39101. templatePart
  39102. }));
  39103. }, [templateParts]);
  39104. const shownTemplateParts = (0,external_wp_compose_namespaceObject.useAsyncList)(templartPartsAsBlockPatterns);
  39105. const {
  39106. createSuccessNotice
  39107. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
  39108. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  39109. const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns);
  39110. const {
  39111. replaceInnerBlocks
  39112. } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
  39113. const onTemplatePartSelect = (0,external_wp_element_namespaceObject.useCallback)(templatePart => {
  39114. var _templatePart$title;
  39115. setAttributes({
  39116. slug: templatePart.slug,
  39117. theme: templatePart.theme,
  39118. area: undefined
  39119. });
  39120. createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
  39121. /* translators: %s: template part title. */
  39122. (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), ((_templatePart$title = templatePart.title) === null || _templatePart$title === void 0 ? void 0 : _templatePart$title.rendered) || templatePart.slug), {
  39123. type: 'snackbar'
  39124. });
  39125. onClose();
  39126. }, []);
  39127. const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  39128. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  39129. className: "block-library-template-part__selection-content"
  39130. }, !!templartPartsAsBlockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Existing template parts')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
  39131. blockPatterns: templartPartsAsBlockPatterns,
  39132. shownPatterns: shownTemplateParts,
  39133. onClickPattern: pattern => {
  39134. onTemplatePartSelect(pattern.templatePart);
  39135. }
  39136. })), !!blockPatterns.length && (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("h2", null, (0,external_wp_i18n_namespaceObject.__)('Patterns')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
  39137. blockPatterns: blockPatterns,
  39138. shownPatterns: shownBlockPatterns,
  39139. onClickPattern: (pattern, blocks) => {
  39140. if (isReplacingTemplatePartContent) {
  39141. replaceInnerBlocks(clientId, blocks);
  39142. } else {
  39143. createFromBlocks(blocks, pattern.title);
  39144. }
  39145. onClose();
  39146. }
  39147. }))));
  39148. }
  39149. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
  39150. /**
  39151. * WordPress dependencies
  39152. */
  39153. function TemplatePartAdvancedControls(_ref) {
  39154. let {
  39155. tagName,
  39156. setAttributes,
  39157. isEntityAvailable,
  39158. templatePartId,
  39159. defaultWrapper
  39160. } = _ref;
  39161. const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId);
  39162. const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId);
  39163. const {
  39164. areaOptions
  39165. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39166. // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
  39167. // Blocks can be loaded into a *non-post* block editor.
  39168. // eslint-disable-next-line @wordpress/data-no-store-string-literals
  39169. const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
  39170. return {
  39171. areaOptions: definedAreas.map(_ref2 => {
  39172. let {
  39173. label,
  39174. area: _area
  39175. } = _ref2;
  39176. return {
  39177. label,
  39178. value: _area
  39179. };
  39180. })
  39181. };
  39182. }, []);
  39183. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
  39184. __experimentalGroup: "advanced"
  39185. }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  39186. label: (0,external_wp_i18n_namespaceObject.__)('Title'),
  39187. value: title,
  39188. onChange: value => {
  39189. setTitle(value);
  39190. },
  39191. onFocus: event => event.target.select()
  39192. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  39193. label: (0,external_wp_i18n_namespaceObject.__)('Area'),
  39194. labelPosition: "top",
  39195. options: areaOptions,
  39196. value: area,
  39197. onChange: setArea
  39198. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  39199. label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
  39200. options: [{
  39201. label: (0,external_wp_i18n_namespaceObject.sprintf)(
  39202. /* translators: %s: HTML tag based on area. */
  39203. (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`),
  39204. value: ''
  39205. }, {
  39206. label: '<header>',
  39207. value: 'header'
  39208. }, {
  39209. label: '<main>',
  39210. value: 'main'
  39211. }, {
  39212. label: '<section>',
  39213. value: 'section'
  39214. }, {
  39215. label: '<article>',
  39216. value: 'article'
  39217. }, {
  39218. label: '<aside>',
  39219. value: 'aside'
  39220. }, {
  39221. label: '<footer>',
  39222. value: 'footer'
  39223. }, {
  39224. label: '<div>',
  39225. value: 'div'
  39226. }],
  39227. value: tagName || '',
  39228. onChange: value => setAttributes({
  39229. tagName: value
  39230. })
  39231. }));
  39232. }
  39233. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js
  39234. /**
  39235. * WordPress dependencies
  39236. */
  39237. function TemplatePartInnerBlocks(_ref) {
  39238. let {
  39239. postId: id,
  39240. hasInnerBlocks,
  39241. layout,
  39242. tagName,
  39243. blockProps,
  39244. clientId
  39245. } = _ref;
  39246. const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39247. var _getSettings;
  39248. const {
  39249. getSettings
  39250. } = select(external_wp_blockEditor_namespaceObject.store);
  39251. return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
  39252. }, []);
  39253. const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
  39254. const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  39255. const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', {
  39256. id
  39257. });
  39258. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
  39259. value: blocks,
  39260. onInput,
  39261. onChange,
  39262. renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
  39263. __experimentalLayout: themeSupportsLayout ? usedLayout : undefined
  39264. });
  39265. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
  39266. clientId: clientId,
  39267. tagName: tagName,
  39268. wrapperProps: innerBlocksProps
  39269. });
  39270. }
  39271. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js
  39272. /**
  39273. * External dependencies
  39274. */
  39275. /**
  39276. * WordPress dependencies
  39277. */
  39278. /**
  39279. * Internal dependencies
  39280. */
  39281. function TemplatePartEdit(_ref) {
  39282. let {
  39283. attributes,
  39284. setAttributes,
  39285. clientId
  39286. } = _ref;
  39287. const {
  39288. slug,
  39289. theme,
  39290. tagName,
  39291. layout = {}
  39292. } = attributes;
  39293. const templatePartId = createTemplatePartId(theme, slug);
  39294. const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(templatePartId);
  39295. const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Set the postId block attribute if it did not exist,
  39296. // but wait until the inner blocks have loaded to allow
  39297. // new edits to trigger this.
  39298. const {
  39299. isResolved,
  39300. innerBlocks,
  39301. isMissing,
  39302. area
  39303. } = (0,external_wp_data_namespaceObject.useSelect)(select => {
  39304. const {
  39305. getEditedEntityRecord,
  39306. hasFinishedResolution
  39307. } = select(external_wp_coreData_namespaceObject.store);
  39308. const {
  39309. getBlocks
  39310. } = select(external_wp_blockEditor_namespaceObject.store);
  39311. const getEntityArgs = ['postType', 'wp_template_part', templatePartId];
  39312. const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null;
  39313. const _area = (entityRecord === null || entityRecord === void 0 ? void 0 : entityRecord.area) || attributes.area;
  39314. const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false;
  39315. return {
  39316. innerBlocks: getBlocks(clientId),
  39317. isResolved: hasResolvedEntity,
  39318. isMissing: hasResolvedEntity && (0,external_lodash_namespaceObject.isEmpty)(entityRecord),
  39319. area: _area
  39320. };
  39321. }, [templatePartId, clientId]);
  39322. const {
  39323. templateParts
  39324. } = useAlternativeTemplateParts(area, templatePartId);
  39325. const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  39326. const hasReplacements = !!templateParts.length || !!blockPatterns.length;
  39327. const areaObject = useTemplatePartArea(area);
  39328. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
  39329. const isPlaceholder = !slug;
  39330. const isEntityAvailable = !isPlaceholder && !isMissing && isResolved;
  39331. const TagName = tagName || areaObject.tagName; // We don't want to render a missing state if we have any inner blocks.
  39332. // A new template part is automatically created if we have any inner blocks but no entity.
  39333. if (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
  39334. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
  39335. /* translators: %s: Template part slug */
  39336. (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug)));
  39337. }
  39338. if (isEntityAvailable && hasAlreadyRendered) {
  39339. return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
  39340. }
  39341. return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(TemplatePartAdvancedControls, {
  39342. tagName: tagName,
  39343. setAttributes: setAttributes,
  39344. isEntityAvailable: isEntityAvailable,
  39345. templatePartId: templatePartId,
  39346. defaultWrapper: areaObject.tagName
  39347. }), isPlaceholder && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(TemplatePartPlaceholder, {
  39348. area: attributes.area,
  39349. templatePartId: templatePartId,
  39350. clientId: clientId,
  39351. setAttributes: setAttributes,
  39352. onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true)
  39353. })), isEntityAvailable && hasReplacements && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
  39354. className: "wp-block-template-part__block-control-group"
  39355. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  39356. onClick: () => setIsTemplatePartSelectionOpen(true)
  39357. }, (0,external_wp_i18n_namespaceObject.__)('Replace')))), isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(TemplatePartInnerBlocks, {
  39358. clientId: clientId,
  39359. tagName: TagName,
  39360. blockProps: blockProps,
  39361. postId: templatePartId,
  39362. hasInnerBlocks: innerBlocks.length > 0,
  39363. layout: layout
  39364. }), !isPlaceholder && !isResolved && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), isTemplatePartSelectionOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
  39365. className: "block-editor-template-part__selection-modal",
  39366. title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
  39367. (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()),
  39368. closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
  39369. onRequestClose: () => setIsTemplatePartSelectionOpen(false)
  39370. }, (0,external_wp_element_namespaceObject.createElement)(TemplatePartSelectionModal, {
  39371. templatePartId: templatePartId,
  39372. clientId: clientId,
  39373. area: area,
  39374. setAttributes: setAttributes,
  39375. onClose: () => setIsTemplatePartSelectionOpen(false)
  39376. })));
  39377. }
  39378. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js
  39379. /**
  39380. * WordPress dependencies
  39381. */
  39382. const header = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39383. xmlns: "http://www.w3.org/2000/svg",
  39384. viewBox: "0 0 24 24"
  39385. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39386. d: "M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  39387. }));
  39388. /* harmony default export */ var library_header = (header);
  39389. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js
  39390. /**
  39391. * WordPress dependencies
  39392. */
  39393. const footer = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39394. xmlns: "http://www.w3.org/2000/svg",
  39395. viewBox: "0 0 24 24"
  39396. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39397. fillRule: "evenodd",
  39398. d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  39399. }));
  39400. /* harmony default export */ var library_footer = (footer);
  39401. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
  39402. /**
  39403. * WordPress dependencies
  39404. */
  39405. const sidebar = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39406. xmlns: "http://www.w3.org/2000/svg",
  39407. viewBox: "0 0 24 24"
  39408. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39409. d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
  39410. }));
  39411. /* harmony default export */ var library_sidebar = (sidebar);
  39412. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/fallback-variations.js
  39413. /**
  39414. * WordPress dependencies
  39415. */
  39416. const fallback_variations_fallbackVariations = [{
  39417. name: 'header',
  39418. icon: library_header,
  39419. title: (0,external_wp_i18n_namespaceObject.__)('Header'),
  39420. description: (0,external_wp_i18n_namespaceObject.__)('The Header template defines a page area that typically contains a title, logo, and main navigation.'),
  39421. attributes: {
  39422. area: 'header'
  39423. },
  39424. scope: ['inserter']
  39425. }, {
  39426. name: 'footer',
  39427. icon: library_footer,
  39428. title: (0,external_wp_i18n_namespaceObject.__)('Footer'),
  39429. description: (0,external_wp_i18n_namespaceObject.__)('The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'),
  39430. attributes: {
  39431. area: 'footer'
  39432. },
  39433. scope: ['inserter']
  39434. }];
  39435. fallback_variations_fallbackVariations.forEach(variation => {
  39436. if (variation.isActive) return;
  39437. variation.isActive = (blockAttributes, variationAttributes) => {
  39438. const {
  39439. area,
  39440. theme,
  39441. slug
  39442. } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
  39443. // This property is removed on the creation of a template part.
  39444. if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
  39445. // by checking the entity's `area` property.
  39446. if (!slug) return false;
  39447. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
  39448. return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
  39449. };
  39450. });
  39451. /* harmony default export */ var template_part_fallback_variations = (fallback_variations_fallbackVariations);
  39452. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
  39453. /**
  39454. * WordPress dependencies
  39455. */
  39456. /**
  39457. * Internal dependencies
  39458. */
  39459. function getTemplatePartIcon(iconName) {
  39460. if ('header' === iconName) {
  39461. return library_header;
  39462. } else if ('footer' === iconName) {
  39463. return library_footer;
  39464. } else if ('sidebar' === iconName) {
  39465. return library_sidebar;
  39466. }
  39467. return symbol_filled;
  39468. }
  39469. function enhanceTemplatePartVariations(settings, name) {
  39470. if (name !== 'core/template-part') {
  39471. return settings;
  39472. } // WordPress versions pre-5.8 do not support server side variation registration.
  39473. // So we must register the fallback variations until those versions are no longer supported.
  39474. if (!(settings.variations && settings.variations.length)) {
  39475. return { ...settings,
  39476. variations: template_part_fallback_variations
  39477. };
  39478. }
  39479. if (settings.variations) {
  39480. const isActive = (blockAttributes, variationAttributes) => {
  39481. const {
  39482. area,
  39483. theme,
  39484. slug
  39485. } = blockAttributes; // We first check the `area` block attribute which is set during insertion.
  39486. // This property is removed on the creation of a template part.
  39487. if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
  39488. // by checking the entity's `area` property.
  39489. if (!slug) return false;
  39490. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
  39491. return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
  39492. };
  39493. const variations = settings.variations.map(variation => {
  39494. return { ...variation,
  39495. ...(!variation.isActive && {
  39496. isActive
  39497. }),
  39498. ...(typeof variation.icon === 'string' && {
  39499. icon: getTemplatePartIcon(variation.icon)
  39500. })
  39501. };
  39502. });
  39503. return { ...settings,
  39504. variations
  39505. };
  39506. }
  39507. return settings;
  39508. }
  39509. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
  39510. /**
  39511. * External dependencies
  39512. */
  39513. /**
  39514. * WordPress dependencies
  39515. */
  39516. /**
  39517. * Internal dependencies
  39518. */
  39519. const template_part_metadata = {
  39520. $schema: "https://schemas.wp.org/trunk/block.json",
  39521. apiVersion: 2,
  39522. name: "core/template-part",
  39523. title: "Template Part",
  39524. category: "theme",
  39525. description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",
  39526. textdomain: "default",
  39527. attributes: {
  39528. slug: {
  39529. type: "string"
  39530. },
  39531. theme: {
  39532. type: "string"
  39533. },
  39534. tagName: {
  39535. type: "string"
  39536. },
  39537. area: {
  39538. type: "string"
  39539. }
  39540. },
  39541. supports: {
  39542. align: true,
  39543. html: false,
  39544. reusable: false
  39545. },
  39546. editorStyle: "wp-block-template-part-editor"
  39547. };
  39548. const {
  39549. name: template_part_name
  39550. } = template_part_metadata;
  39551. const template_part_settings = {
  39552. icon: symbol_filled,
  39553. __experimentalLabel: _ref => {
  39554. var _entity$title;
  39555. let {
  39556. slug,
  39557. theme
  39558. } = _ref;
  39559. // Attempt to find entity title if block is a template part.
  39560. // Require slug to request, otherwise entity is uncreated and will throw 404.
  39561. if (!slug) {
  39562. return;
  39563. }
  39564. const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', theme + '//' + slug);
  39565. if (!entity) {
  39566. return;
  39567. }
  39568. return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)((_entity$title = entity.title) === null || _entity$title === void 0 ? void 0 : _entity$title.rendered) || (0,external_lodash_namespaceObject.startCase)(entity.slug);
  39569. },
  39570. edit: TemplatePartEdit
  39571. }; // Importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
  39572. (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
  39573. const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
  39574. (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (can, blockType, rootClientId, _ref2) => {
  39575. let {
  39576. getBlock,
  39577. getBlockParentsByBlockName
  39578. } = _ref2;
  39579. if (blockType.name !== 'core/template-part') {
  39580. return can;
  39581. }
  39582. for (const disallowedParentType of DISALLOWED_PARENTS) {
  39583. var _getBlock;
  39584. const hasDisallowedParent = ((_getBlock = getBlock(rootClientId)) === null || _getBlock === void 0 ? void 0 : _getBlock.name) === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length;
  39585. if (hasDisallowedParent) {
  39586. return false;
  39587. }
  39588. }
  39589. return true;
  39590. });
  39591. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
  39592. /**
  39593. * WordPress dependencies
  39594. */
  39595. const term_description_tag = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39596. xmlns: "http://www.w3.org/2000/svg",
  39597. viewBox: "0 0 24 24"
  39598. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39599. d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"
  39600. }));
  39601. /* harmony default export */ var term_description = (term_description_tag);
  39602. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js
  39603. /**
  39604. * External dependencies
  39605. */
  39606. /**
  39607. * WordPress dependencies
  39608. */
  39609. function TermDescriptionEdit(_ref) {
  39610. let {
  39611. attributes,
  39612. setAttributes,
  39613. mergedStyle
  39614. } = _ref;
  39615. const {
  39616. textAlign
  39617. } = attributes;
  39618. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39619. className: classnames_default()({
  39620. [`has-text-align-${textAlign}`]: textAlign
  39621. }),
  39622. style: mergedStyle
  39623. });
  39624. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  39625. group: "block"
  39626. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
  39627. value: textAlign,
  39628. onChange: nextAlign => {
  39629. setAttributes({
  39630. textAlign: nextAlign
  39631. });
  39632. }
  39633. })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
  39634. className: "wp-block-term-description__placeholder"
  39635. }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Term Description')))));
  39636. }
  39637. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
  39638. /**
  39639. * WordPress dependencies
  39640. */
  39641. /**
  39642. * Internal dependencies
  39643. */
  39644. const term_description_metadata = {
  39645. $schema: "https://schemas.wp.org/trunk/block.json",
  39646. apiVersion: 2,
  39647. name: "core/term-description",
  39648. title: "Term Description",
  39649. category: "theme",
  39650. description: "Display the description of categories, tags and custom taxonomies when viewing an archive.",
  39651. textdomain: "default",
  39652. attributes: {
  39653. textAlign: {
  39654. type: "string"
  39655. }
  39656. },
  39657. supports: {
  39658. align: ["wide", "full"],
  39659. html: false,
  39660. color: {
  39661. link: true,
  39662. __experimentalDefaultControls: {
  39663. background: true,
  39664. text: true
  39665. }
  39666. },
  39667. typography: {
  39668. fontSize: true,
  39669. lineHeight: true,
  39670. __experimentalDefaultControls: {
  39671. fontSize: true
  39672. }
  39673. }
  39674. },
  39675. editorStyle: "wp-block-term-description-editor"
  39676. };
  39677. const {
  39678. name: term_description_name
  39679. } = term_description_metadata;
  39680. const term_description_settings = {
  39681. icon: term_description,
  39682. edit: TermDescriptionEdit
  39683. };
  39684. ;// CONCATENATED MODULE: external ["wp","deprecated"]
  39685. var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  39686. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  39687. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js
  39688. /**
  39689. * External dependencies
  39690. */
  39691. /**
  39692. * WordPress dependencies
  39693. */
  39694. function TextColumnsEdit(_ref) {
  39695. let {
  39696. attributes,
  39697. setAttributes
  39698. } = _ref;
  39699. const {
  39700. width,
  39701. content,
  39702. columns
  39703. } = attributes;
  39704. external_wp_deprecated_default()('The Text Columns block', {
  39705. since: '5.3',
  39706. alternative: 'the Columns block'
  39707. });
  39708. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
  39709. value: width,
  39710. onChange: nextWidth => setAttributes({
  39711. width: nextWidth
  39712. }),
  39713. controls: ['center', 'wide', 'full']
  39714. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
  39715. label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
  39716. value: columns,
  39717. onChange: value => setAttributes({
  39718. columns: value
  39719. }),
  39720. min: 2,
  39721. max: 4,
  39722. required: true
  39723. }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39724. className: `align${width} columns-${columns}`
  39725. }), (0,external_lodash_namespaceObject.times)(columns, index => {
  39726. return (0,external_wp_element_namespaceObject.createElement)("div", {
  39727. className: "wp-block-column",
  39728. key: `column-${index}`
  39729. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  39730. tagName: "p",
  39731. value: (0,external_lodash_namespaceObject.get)(content, [index, 'children']),
  39732. onChange: nextContent => {
  39733. setAttributes({
  39734. content: [...content.slice(0, index), {
  39735. children: nextContent
  39736. }, ...content.slice(index + 1)]
  39737. });
  39738. },
  39739. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1)
  39740. (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1),
  39741. placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column')
  39742. }));
  39743. })));
  39744. }
  39745. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js
  39746. /**
  39747. * External dependencies
  39748. */
  39749. /**
  39750. * WordPress dependencies
  39751. */
  39752. function text_columns_save_save(_ref) {
  39753. let {
  39754. attributes
  39755. } = _ref;
  39756. const {
  39757. width,
  39758. content,
  39759. columns
  39760. } = attributes;
  39761. return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  39762. className: `align${width} columns-${columns}`
  39763. }), (0,external_lodash_namespaceObject.times)(columns, index => (0,external_wp_element_namespaceObject.createElement)("div", {
  39764. className: "wp-block-column",
  39765. key: `column-${index}`
  39766. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  39767. tagName: "p",
  39768. value: (0,external_lodash_namespaceObject.get)(content, [index, 'children'])
  39769. }))));
  39770. }
  39771. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js
  39772. /**
  39773. * WordPress dependencies
  39774. */
  39775. const text_columns_transforms_transforms = {
  39776. to: [{
  39777. type: 'block',
  39778. blocks: ['core/columns'],
  39779. transform: _ref => {
  39780. let {
  39781. className,
  39782. columns,
  39783. content,
  39784. width
  39785. } = _ref;
  39786. return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
  39787. align: 'wide' === width || 'full' === width ? width : undefined,
  39788. className,
  39789. columns
  39790. }, content.map(_ref2 => {
  39791. let {
  39792. children
  39793. } = _ref2;
  39794. return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
  39795. content: children
  39796. })]);
  39797. }));
  39798. }
  39799. }]
  39800. };
  39801. /* harmony default export */ var text_columns_transforms = (text_columns_transforms_transforms);
  39802. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
  39803. /**
  39804. * Internal dependencies
  39805. */
  39806. const text_columns_metadata = {
  39807. $schema: "https://schemas.wp.org/trunk/block.json",
  39808. apiVersion: 2,
  39809. name: "core/text-columns",
  39810. title: "Text Columns (deprecated)",
  39811. icon: "columns",
  39812. category: "design",
  39813. description: "This block is deprecated. Please use the Columns block instead.",
  39814. textdomain: "default",
  39815. attributes: {
  39816. content: {
  39817. type: "array",
  39818. source: "query",
  39819. selector: "p",
  39820. query: {
  39821. children: {
  39822. type: "string",
  39823. source: "html"
  39824. }
  39825. },
  39826. "default": [{}, {}]
  39827. },
  39828. columns: {
  39829. type: "number",
  39830. "default": 2
  39831. },
  39832. width: {
  39833. type: "string"
  39834. }
  39835. },
  39836. supports: {
  39837. inserter: false
  39838. },
  39839. editorStyle: "wp-block-text-columns-editor",
  39840. style: "wp-block-text-columns"
  39841. };
  39842. const {
  39843. name: text_columns_name
  39844. } = text_columns_metadata;
  39845. const text_columns_settings = {
  39846. transforms: text_columns_transforms,
  39847. getEditWrapperProps(attributes) {
  39848. const {
  39849. width
  39850. } = attributes;
  39851. if ('wide' === width || 'full' === width) {
  39852. return {
  39853. 'data-align': width
  39854. };
  39855. }
  39856. },
  39857. edit: TextColumnsEdit,
  39858. save: text_columns_save_save
  39859. };
  39860. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
  39861. /**
  39862. * WordPress dependencies
  39863. */
  39864. const verse = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  39865. viewBox: "0 0 24 24",
  39866. xmlns: "http://www.w3.org/2000/svg"
  39867. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  39868. d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
  39869. }));
  39870. /* harmony default export */ var library_verse = (verse);
  39871. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js
  39872. /**
  39873. * External dependencies
  39874. */
  39875. /**
  39876. * WordPress dependencies
  39877. */
  39878. /**
  39879. * Internal dependencies
  39880. */
  39881. const verse_deprecated_v1 = {
  39882. attributes: {
  39883. content: {
  39884. type: 'string',
  39885. source: 'html',
  39886. selector: 'pre',
  39887. default: ''
  39888. },
  39889. textAlign: {
  39890. type: 'string'
  39891. }
  39892. },
  39893. save(_ref) {
  39894. let {
  39895. attributes
  39896. } = _ref;
  39897. const {
  39898. textAlign,
  39899. content
  39900. } = attributes;
  39901. return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  39902. tagName: "pre",
  39903. style: {
  39904. textAlign
  39905. },
  39906. value: content
  39907. });
  39908. }
  39909. };
  39910. const verse_deprecated_v2 = {
  39911. attributes: {
  39912. content: {
  39913. type: 'string',
  39914. source: 'html',
  39915. selector: 'pre',
  39916. default: '',
  39917. __unstablePreserveWhiteSpace: true,
  39918. __experimentalRole: 'content'
  39919. },
  39920. textAlign: {
  39921. type: 'string'
  39922. }
  39923. },
  39924. supports: {
  39925. anchor: true,
  39926. color: {
  39927. gradients: true,
  39928. link: true
  39929. },
  39930. typography: {
  39931. fontSize: true,
  39932. __experimentalFontFamily: true
  39933. },
  39934. spacing: {
  39935. padding: true
  39936. }
  39937. },
  39938. save(_ref2) {
  39939. let {
  39940. attributes
  39941. } = _ref2;
  39942. const {
  39943. textAlign,
  39944. content
  39945. } = attributes;
  39946. const className = classnames_default()({
  39947. [`has-text-align-${textAlign}`]: textAlign
  39948. });
  39949. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  39950. className
  39951. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  39952. value: content
  39953. }));
  39954. },
  39955. migrate: migrate_font_family,
  39956. isEligible(_ref3) {
  39957. var _style$typography;
  39958. let {
  39959. style
  39960. } = _ref3;
  39961. return style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontFamily;
  39962. }
  39963. };
  39964. /**
  39965. * New deprecations need to be placed first
  39966. * for them to have higher priority.
  39967. *
  39968. * Old deprecations may need to be updated as well.
  39969. *
  39970. * See block-deprecation.md
  39971. */
  39972. /* harmony default export */ var verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]);
  39973. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js
  39974. /**
  39975. * External dependencies
  39976. */
  39977. /**
  39978. * WordPress dependencies
  39979. */
  39980. function VerseEdit(_ref) {
  39981. let {
  39982. attributes,
  39983. setAttributes,
  39984. mergeBlocks,
  39985. onRemove,
  39986. style
  39987. } = _ref;
  39988. const {
  39989. textAlign,
  39990. content
  39991. } = attributes;
  39992. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  39993. className: classnames_default()({
  39994. [`has-text-align-${textAlign}`]: textAlign
  39995. }),
  39996. style
  39997. });
  39998. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
  39999. value: textAlign,
  40000. onChange: nextAlign => {
  40001. setAttributes({
  40002. textAlign: nextAlign
  40003. });
  40004. }
  40005. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
  40006. tagName: "pre",
  40007. identifier: "content",
  40008. preserveWhiteSpace: true,
  40009. value: content,
  40010. onChange: nextContent => {
  40011. setAttributes({
  40012. content: nextContent
  40013. });
  40014. },
  40015. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'),
  40016. placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'),
  40017. onRemove: onRemove,
  40018. onMerge: mergeBlocks,
  40019. textAlign: textAlign
  40020. }, blockProps, {
  40021. __unstablePastePlainText: true
  40022. })));
  40023. }
  40024. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js
  40025. /**
  40026. * External dependencies
  40027. */
  40028. /**
  40029. * WordPress dependencies
  40030. */
  40031. function verse_save_save(_ref) {
  40032. let {
  40033. attributes
  40034. } = _ref;
  40035. const {
  40036. textAlign,
  40037. content
  40038. } = attributes;
  40039. const className = classnames_default()({
  40040. [`has-text-align-${textAlign}`]: textAlign
  40041. });
  40042. return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
  40043. className
  40044. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  40045. value: content
  40046. }));
  40047. }
  40048. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js
  40049. /**
  40050. * WordPress dependencies
  40051. */
  40052. const verse_transforms_transforms = {
  40053. from: [{
  40054. type: 'block',
  40055. blocks: ['core/paragraph'],
  40056. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes)
  40057. }],
  40058. to: [{
  40059. type: 'block',
  40060. blocks: ['core/paragraph'],
  40061. transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  40062. }]
  40063. };
  40064. /* harmony default export */ var verse_transforms = (verse_transforms_transforms);
  40065. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js
  40066. /**
  40067. * WordPress dependencies
  40068. */
  40069. /**
  40070. * Internal dependencies
  40071. */
  40072. const verse_metadata = {
  40073. $schema: "https://schemas.wp.org/trunk/block.json",
  40074. apiVersion: 2,
  40075. name: "core/verse",
  40076. title: "Verse",
  40077. category: "text",
  40078. description: "Insert poetry. Use special spacing formats. Or quote song lyrics.",
  40079. keywords: ["poetry", "poem"],
  40080. textdomain: "default",
  40081. attributes: {
  40082. content: {
  40083. type: "string",
  40084. source: "html",
  40085. selector: "pre",
  40086. "default": "",
  40087. __unstablePreserveWhiteSpace: true,
  40088. __experimentalRole: "content"
  40089. },
  40090. textAlign: {
  40091. type: "string"
  40092. }
  40093. },
  40094. supports: {
  40095. anchor: true,
  40096. color: {
  40097. gradients: true,
  40098. link: true,
  40099. __experimentalDefaultControls: {
  40100. background: true,
  40101. text: true
  40102. }
  40103. },
  40104. typography: {
  40105. fontSize: true,
  40106. __experimentalFontFamily: true,
  40107. lineHeight: true,
  40108. __experimentalFontStyle: true,
  40109. __experimentalFontWeight: true,
  40110. __experimentalLetterSpacing: true,
  40111. __experimentalTextTransform: true,
  40112. __experimentalDefaultControls: {
  40113. fontSize: true,
  40114. fontAppearance: true
  40115. }
  40116. },
  40117. spacing: {
  40118. padding: true
  40119. }
  40120. },
  40121. style: "wp-block-verse",
  40122. editorStyle: "wp-block-verse-editor"
  40123. };
  40124. const {
  40125. name: verse_name
  40126. } = verse_metadata;
  40127. const verse_settings = {
  40128. icon: library_verse,
  40129. example: {
  40130. attributes: {
  40131. /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
  40132. // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.
  40133. content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.')
  40134. /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
  40135. }
  40136. },
  40137. transforms: verse_transforms,
  40138. deprecated: verse_deprecated,
  40139. merge(attributes, attributesToMerge) {
  40140. return {
  40141. content: attributes.content + attributesToMerge.content
  40142. };
  40143. },
  40144. edit: VerseEdit,
  40145. save: verse_save_save
  40146. };
  40147. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js
  40148. /**
  40149. * WordPress dependencies
  40150. */
  40151. const video = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  40152. viewBox: "0 0 24 24",
  40153. xmlns: "http://www.w3.org/2000/svg"
  40154. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  40155. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  40156. }));
  40157. /* harmony default export */ var library_video = (video);
  40158. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js
  40159. /**
  40160. * WordPress dependencies
  40161. */
  40162. const options = [{
  40163. value: 'auto',
  40164. label: (0,external_wp_i18n_namespaceObject.__)('Auto')
  40165. }, {
  40166. value: 'metadata',
  40167. label: (0,external_wp_i18n_namespaceObject.__)('Metadata')
  40168. }, {
  40169. value: 'none',
  40170. label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value')
  40171. }];
  40172. const VideoSettings = _ref => {
  40173. let {
  40174. setAttributes,
  40175. attributes
  40176. } = _ref;
  40177. const {
  40178. autoplay,
  40179. controls,
  40180. loop,
  40181. muted,
  40182. playsInline,
  40183. preload
  40184. } = attributes;
  40185. const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.');
  40186. const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({
  40187. web: (0,external_wp_element_namespaceObject.useCallback)(checked => {
  40188. return checked ? autoPlayHelpText : null;
  40189. }, []),
  40190. native: autoPlayHelpText
  40191. });
  40192. const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => {
  40193. const toggleAttribute = attribute => {
  40194. return newValue => {
  40195. setAttributes({
  40196. [attribute]: newValue
  40197. });
  40198. };
  40199. };
  40200. return {
  40201. autoplay: toggleAttribute('autoplay'),
  40202. loop: toggleAttribute('loop'),
  40203. muted: toggleAttribute('muted'),
  40204. controls: toggleAttribute('controls'),
  40205. playsInline: toggleAttribute('playsInline')
  40206. };
  40207. }, []);
  40208. const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => {
  40209. setAttributes({
  40210. preload: value
  40211. });
  40212. }, []);
  40213. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40214. label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'),
  40215. onChange: toggleFactory.autoplay,
  40216. checked: autoplay,
  40217. help: getAutoplayHelp
  40218. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40219. label: (0,external_wp_i18n_namespaceObject.__)('Loop'),
  40220. onChange: toggleFactory.loop,
  40221. checked: loop
  40222. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40223. label: (0,external_wp_i18n_namespaceObject.__)('Muted'),
  40224. onChange: toggleFactory.muted,
  40225. checked: muted
  40226. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40227. label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'),
  40228. onChange: toggleFactory.controls,
  40229. checked: controls
  40230. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
  40231. label: (0,external_wp_i18n_namespaceObject.__)('Play inline'),
  40232. onChange: toggleFactory.playsInline,
  40233. checked: playsInline
  40234. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  40235. label: (0,external_wp_i18n_namespaceObject.__)('Preload'),
  40236. value: preload,
  40237. onChange: onChangePreload,
  40238. options: options,
  40239. hideCancelButton: true
  40240. }));
  40241. };
  40242. /* harmony default export */ var edit_common_settings = (VideoSettings);
  40243. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
  40244. /**
  40245. * WordPress dependencies
  40246. */
  40247. const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  40248. xmlns: "http://www.w3.org/2000/svg",
  40249. viewBox: "0 0 24 24"
  40250. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  40251. d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
  40252. }));
  40253. /* harmony default export */ var library_media = (media);
  40254. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js
  40255. /**
  40256. * WordPress dependencies
  40257. */
  40258. const ALLOWED_TYPES = ['text/vtt'];
  40259. const DEFAULT_KIND = 'subtitles';
  40260. const KIND_OPTIONS = [{
  40261. label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'),
  40262. value: 'subtitles'
  40263. }, {
  40264. label: (0,external_wp_i18n_namespaceObject.__)('Captions'),
  40265. value: 'captions'
  40266. }, {
  40267. label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'),
  40268. value: 'descriptions'
  40269. }, {
  40270. label: (0,external_wp_i18n_namespaceObject.__)('Chapters'),
  40271. value: 'chapters'
  40272. }, {
  40273. label: (0,external_wp_i18n_namespaceObject.__)('Metadata'),
  40274. value: 'metadata'
  40275. }];
  40276. const captionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
  40277. width: "18",
  40278. height: "14",
  40279. viewBox: "0 0 18 14",
  40280. role: "img",
  40281. fill: "none"
  40282. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
  40283. x: "0.75",
  40284. y: "0.75",
  40285. width: "16.5",
  40286. height: "12.5",
  40287. rx: "1.25",
  40288. stroke: "black",
  40289. strokeWidth: "1.5",
  40290. fill: "none"
  40291. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40292. d: "M3 7H15",
  40293. stroke: "black",
  40294. strokeWidth: "1.5"
  40295. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
  40296. d: "M3 10L15 10",
  40297. stroke: "black",
  40298. strokeWidth: "1.5"
  40299. }));
  40300. function TrackList(_ref) {
  40301. let {
  40302. tracks,
  40303. onEditPress
  40304. } = _ref;
  40305. let content;
  40306. if (tracks.length === 0) {
  40307. content = (0,external_wp_element_namespaceObject.createElement)("p", {
  40308. className: "block-library-video-tracks-editor__tracks-informative-message"
  40309. }, (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'));
  40310. } else {
  40311. content = tracks.map((track, index) => {
  40312. return (0,external_wp_element_namespaceObject.createElement)("div", {
  40313. key: index,
  40314. className: "block-library-video-tracks-editor__track-list-track"
  40315. }, (0,external_wp_element_namespaceObject.createElement)("span", null, track.label, " "), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40316. variant: "tertiary",
  40317. onClick: () => onEditPress(index),
  40318. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
  40319. /* translators: %s: Label of the video text track e.g: "French subtitles" */
  40320. (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label)
  40321. }, (0,external_wp_i18n_namespaceObject.__)('Edit')));
  40322. });
  40323. }
  40324. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  40325. label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
  40326. className: "block-library-video-tracks-editor__track-list"
  40327. }, content);
  40328. }
  40329. function SingleTrackEditor(_ref2) {
  40330. let {
  40331. track,
  40332. onChange,
  40333. onClose,
  40334. onRemove
  40335. } = _ref2;
  40336. const {
  40337. src = '',
  40338. label = '',
  40339. srcLang = '',
  40340. kind = DEFAULT_KIND
  40341. } = track;
  40342. const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || '';
  40343. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)("div", {
  40344. className: "block-library-video-tracks-editor__single-track-editor"
  40345. }, (0,external_wp_element_namespaceObject.createElement)("span", {
  40346. className: "block-library-video-tracks-editor__single-track-editor-edit-track-label"
  40347. }, (0,external_wp_i18n_namespaceObject.__)('Edit track')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('File'), ": ", (0,external_wp_element_namespaceObject.createElement)("b", null, fileName)), (0,external_wp_element_namespaceObject.createElement)("div", {
  40348. className: "block-library-video-tracks-editor__single-track-editor-label-language"
  40349. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl
  40350. /* eslint-disable jsx-a11y/no-autofocus */
  40351. , {
  40352. autoFocus: true
  40353. /* eslint-enable jsx-a11y/no-autofocus */
  40354. ,
  40355. onChange: newLabel => onChange({ ...track,
  40356. label: newLabel
  40357. }),
  40358. label: (0,external_wp_i18n_namespaceObject.__)('Label'),
  40359. value: label,
  40360. help: (0,external_wp_i18n_namespaceObject.__)('Title of track')
  40361. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
  40362. onChange: newSrcLang => onChange({ ...track,
  40363. srcLang: newSrcLang
  40364. }),
  40365. label: (0,external_wp_i18n_namespaceObject.__)('Source language'),
  40366. value: srcLang,
  40367. help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)')
  40368. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
  40369. className: "block-library-video-tracks-editor__single-track-editor-kind-select",
  40370. options: KIND_OPTIONS,
  40371. value: kind,
  40372. label: (0,external_wp_i18n_namespaceObject.__)('Kind'),
  40373. onChange: newKind => {
  40374. onChange({ ...track,
  40375. kind: newKind
  40376. });
  40377. }
  40378. }), (0,external_wp_element_namespaceObject.createElement)("div", {
  40379. className: "block-library-video-tracks-editor__single-track-editor-buttons-container"
  40380. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40381. variant: "secondary",
  40382. onClick: () => {
  40383. const changes = {};
  40384. let hasChanges = false;
  40385. if (label === '') {
  40386. changes.label = (0,external_wp_i18n_namespaceObject.__)('English');
  40387. hasChanges = true;
  40388. }
  40389. if (srcLang === '') {
  40390. changes.srcLang = 'en';
  40391. hasChanges = true;
  40392. }
  40393. if (track.kind === undefined) {
  40394. changes.kind = DEFAULT_KIND;
  40395. hasChanges = true;
  40396. }
  40397. if (hasChanges) {
  40398. onChange({ ...track,
  40399. ...changes
  40400. });
  40401. }
  40402. onClose();
  40403. }
  40404. }, (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40405. isDestructive: true,
  40406. variant: "link",
  40407. onClick: onRemove
  40408. }, (0,external_wp_i18n_namespaceObject.__)('Remove track')))));
  40409. }
  40410. function TracksEditor(_ref3) {
  40411. let {
  40412. tracks = [],
  40413. onChange
  40414. } = _ref3;
  40415. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
  40416. return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload;
  40417. }, []);
  40418. const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null);
  40419. if (!mediaUpload) {
  40420. return null;
  40421. }
  40422. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
  40423. contentClassName: "block-library-video-tracks-editor",
  40424. renderToggle: _ref4 => {
  40425. let {
  40426. isOpen,
  40427. onToggle
  40428. } = _ref4;
  40429. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
  40430. label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
  40431. showTooltip: true,
  40432. "aria-expanded": isOpen,
  40433. "aria-haspopup": "true",
  40434. onClick: onToggle,
  40435. icon: captionIcon
  40436. });
  40437. },
  40438. renderContent: _ref5 => {
  40439. let {} = _ref5;
  40440. if (trackBeingEdited !== null) {
  40441. return (0,external_wp_element_namespaceObject.createElement)(SingleTrackEditor, {
  40442. track: tracks[trackBeingEdited],
  40443. onChange: newTrack => {
  40444. const newTracks = [...tracks];
  40445. newTracks[trackBeingEdited] = newTrack;
  40446. onChange(newTracks);
  40447. },
  40448. onClose: () => setTrackBeingEdited(null),
  40449. onRemove: () => {
  40450. onChange(tracks.filter((_track, index) => index !== trackBeingEdited));
  40451. setTrackBeingEdited(null);
  40452. }
  40453. });
  40454. }
  40455. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)(TrackList, {
  40456. tracks: tracks,
  40457. onEditPress: setTrackBeingEdited
  40458. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
  40459. className: "block-library-video-tracks-editor__add-tracks-container",
  40460. label: (0,external_wp_i18n_namespaceObject.__)('Add tracks')
  40461. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
  40462. onSelect: _ref6 => {
  40463. let {
  40464. url
  40465. } = _ref6;
  40466. const trackIndex = tracks.length;
  40467. onChange([...tracks, {
  40468. src: url
  40469. }]);
  40470. setTrackBeingEdited(trackIndex);
  40471. },
  40472. allowedTypes: ALLOWED_TYPES,
  40473. render: _ref7 => {
  40474. let {
  40475. open
  40476. } = _ref7;
  40477. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  40478. icon: library_media,
  40479. onClick: open
  40480. }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
  40481. }
  40482. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
  40483. onChange: event => {
  40484. const files = event.target.files;
  40485. const trackIndex = tracks.length;
  40486. mediaUpload({
  40487. allowedTypes: ALLOWED_TYPES,
  40488. filesList: files,
  40489. onFileChange: _ref8 => {
  40490. let [{
  40491. url
  40492. }] = _ref8;
  40493. const newTracks = [...tracks];
  40494. if (!newTracks[trackIndex]) {
  40495. newTracks[trackIndex] = {};
  40496. }
  40497. newTracks[trackIndex] = { ...tracks[trackIndex],
  40498. src: url
  40499. };
  40500. onChange(newTracks);
  40501. setTrackBeingEdited(trackIndex);
  40502. }
  40503. });
  40504. },
  40505. accept: ".vtt,text/vtt",
  40506. render: _ref9 => {
  40507. let {
  40508. openFileDialog
  40509. } = _ref9;
  40510. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
  40511. icon: library_upload,
  40512. onClick: () => {
  40513. openFileDialog();
  40514. }
  40515. }, (0,external_wp_i18n_namespaceObject.__)('Upload'));
  40516. }
  40517. })))));
  40518. }
  40519. });
  40520. }
  40521. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js
  40522. function Tracks(_ref) {
  40523. let {
  40524. tracks = []
  40525. } = _ref;
  40526. return tracks.map(track => {
  40527. return (0,external_wp_element_namespaceObject.createElement)("track", _extends({
  40528. key: track.src
  40529. }, track));
  40530. });
  40531. }
  40532. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js
  40533. /**
  40534. * External dependencies
  40535. */
  40536. /**
  40537. * WordPress dependencies
  40538. */
  40539. /**
  40540. * Internal dependencies
  40541. */
  40542. const video_edit_ALLOWED_MEDIA_TYPES = ['video'];
  40543. const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];
  40544. function VideoEdit(_ref) {
  40545. let {
  40546. isSelected,
  40547. noticeUI,
  40548. attributes,
  40549. className,
  40550. setAttributes,
  40551. insertBlocksAfter,
  40552. onReplace,
  40553. noticeOperations
  40554. } = _ref;
  40555. const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit);
  40556. const videoPlayer = (0,external_wp_element_namespaceObject.useRef)();
  40557. const posterImageButton = (0,external_wp_element_namespaceObject.useRef)();
  40558. const {
  40559. id,
  40560. caption,
  40561. controls,
  40562. poster,
  40563. src,
  40564. tracks
  40565. } = attributes;
  40566. const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
  40567. const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload);
  40568. (0,external_wp_element_namespaceObject.useEffect)(() => {
  40569. if (!id && (0,external_wp_blob_namespaceObject.isBlobURL)(src)) {
  40570. const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(src);
  40571. if (file) {
  40572. mediaUpload({
  40573. filesList: [file],
  40574. onFileChange: _ref2 => {
  40575. let [{
  40576. url
  40577. }] = _ref2;
  40578. setAttributes({
  40579. src: url
  40580. });
  40581. },
  40582. onError: message => {
  40583. noticeOperations.createErrorNotice(message);
  40584. },
  40585. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES
  40586. });
  40587. }
  40588. }
  40589. }, []);
  40590. (0,external_wp_element_namespaceObject.useEffect)(() => {
  40591. // Placeholder may be rendered.
  40592. if (videoPlayer.current) {
  40593. videoPlayer.current.load();
  40594. }
  40595. }, [poster]);
  40596. function onSelectVideo(media) {
  40597. var _media$image, _media$image2;
  40598. if (!media || !media.url) {
  40599. // In this case there was an error
  40600. // previous attributes should be removed
  40601. // because they may be temporary blob urls.
  40602. setAttributes({
  40603. src: undefined,
  40604. id: undefined,
  40605. poster: undefined
  40606. });
  40607. return;
  40608. } // Sets the block's attribute and updates the edit component from the
  40609. // selected media.
  40610. setAttributes({
  40611. src: media.url,
  40612. id: media.id,
  40613. poster: ((_media$image = media.image) === null || _media$image === void 0 ? void 0 : _media$image.src) !== media.icon ? (_media$image2 = media.image) === null || _media$image2 === void 0 ? void 0 : _media$image2.src : undefined
  40614. });
  40615. }
  40616. function onSelectURL(newSrc) {
  40617. if (newSrc !== src) {
  40618. // Check if there's an embed block that handles this URL.
  40619. const embedBlock = createUpgradedEmbedBlock({
  40620. attributes: {
  40621. url: newSrc
  40622. }
  40623. });
  40624. if (undefined !== embedBlock) {
  40625. onReplace(embedBlock);
  40626. return;
  40627. }
  40628. setAttributes({
  40629. src: newSrc,
  40630. id: undefined,
  40631. poster: undefined
  40632. });
  40633. }
  40634. }
  40635. function onUploadError(message) {
  40636. noticeOperations.removeAllNotices();
  40637. noticeOperations.createErrorNotice(message);
  40638. }
  40639. const classes = classnames_default()(className, {
  40640. 'is-transient': isTemporaryVideo
  40641. });
  40642. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
  40643. className: classes
  40644. });
  40645. if (!src) {
  40646. return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
  40647. icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
  40648. icon: library_video
  40649. }),
  40650. onSelect: onSelectVideo,
  40651. onSelectURL: onSelectURL,
  40652. accept: "video/*",
  40653. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
  40654. value: attributes,
  40655. notices: noticeUI,
  40656. onError: onUploadError
  40657. }));
  40658. }
  40659. function onSelectPoster(image) {
  40660. setAttributes({
  40661. poster: image.url
  40662. });
  40663. }
  40664. function onRemovePoster() {
  40665. setAttributes({
  40666. poster: undefined
  40667. }); // Move focus back to the Media Upload button.
  40668. posterImageButton.current.focus();
  40669. }
  40670. const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
  40671. return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40672. group: "block"
  40673. }, (0,external_wp_element_namespaceObject.createElement)(TracksEditor, {
  40674. tracks: tracks,
  40675. onChange: newTracks => {
  40676. setAttributes({
  40677. tracks: newTracks
  40678. });
  40679. }
  40680. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
  40681. group: "other"
  40682. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, {
  40683. mediaId: id,
  40684. mediaURL: src,
  40685. allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
  40686. accept: "video/*",
  40687. onSelect: onSelectVideo,
  40688. onSelectURL: onSelectURL,
  40689. onError: onUploadError
  40690. })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
  40691. title: (0,external_wp_i18n_namespaceObject.__)('Video settings')
  40692. }, (0,external_wp_element_namespaceObject.createElement)(edit_common_settings, {
  40693. setAttributes: setAttributes,
  40694. attributes: attributes
  40695. }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
  40696. className: "editor-video-poster-control"
  40697. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Poster image')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
  40698. title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'),
  40699. onSelect: onSelectPoster,
  40700. allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES,
  40701. render: _ref3 => {
  40702. let {
  40703. open
  40704. } = _ref3;
  40705. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40706. variant: "primary",
  40707. onClick: open,
  40708. ref: posterImageButton,
  40709. "aria-describedby": videoPosterDescription
  40710. }, !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace'));
  40711. }
  40712. }), (0,external_wp_element_namespaceObject.createElement)("p", {
  40713. id: videoPosterDescription,
  40714. hidden: true
  40715. }, poster ? (0,external_wp_i18n_namespaceObject.sprintf)(
  40716. /* translators: %s: poster image URL. */
  40717. (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected')), !!poster && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  40718. onClick: onRemovePoster,
  40719. variant: "tertiary"
  40720. }, (0,external_wp_i18n_namespaceObject.__)('Remove')))))), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
  40721. isDisabled: !isSelected
  40722. }, (0,external_wp_element_namespaceObject.createElement)("video", {
  40723. controls: controls,
  40724. poster: poster,
  40725. src: src,
  40726. ref: videoPlayer
  40727. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  40728. tracks: tracks
  40729. }))), isTemporaryVideo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
  40730. tagName: "figcaption",
  40731. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Video caption text'),
  40732. placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
  40733. value: caption,
  40734. onChange: value => setAttributes({
  40735. caption: value
  40736. }),
  40737. inlineToolbar: true,
  40738. __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
  40739. })));
  40740. }
  40741. /* harmony default export */ var video_edit = ((0,external_wp_components_namespaceObject.withNotices)(VideoEdit));
  40742. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js
  40743. /**
  40744. * WordPress dependencies
  40745. */
  40746. /**
  40747. * Internal dependencies
  40748. */
  40749. function video_save_save(_ref) {
  40750. let {
  40751. attributes
  40752. } = _ref;
  40753. const {
  40754. autoplay,
  40755. caption,
  40756. controls,
  40757. loop,
  40758. muted,
  40759. poster,
  40760. preload,
  40761. src,
  40762. playsInline,
  40763. tracks
  40764. } = attributes;
  40765. return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), src && (0,external_wp_element_namespaceObject.createElement)("video", {
  40766. autoPlay: autoplay,
  40767. controls: controls,
  40768. loop: loop,
  40769. muted: muted,
  40770. poster: poster,
  40771. preload: preload !== 'metadata' ? preload : undefined,
  40772. src: src,
  40773. playsInline: playsInline
  40774. }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
  40775. tracks: tracks
  40776. })), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
  40777. tagName: "figcaption",
  40778. value: caption
  40779. }));
  40780. }
  40781. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js
  40782. /**
  40783. * WordPress dependencies
  40784. */
  40785. const video_transforms_transforms = {
  40786. from: [{
  40787. type: 'files',
  40788. isMatch(files) {
  40789. return files.length === 1 && files[0].type.indexOf('video/') === 0;
  40790. },
  40791. transform(files) {
  40792. const file = files[0]; // We don't need to upload the media directly here
  40793. // It's already done as part of the `componentDidMount`
  40794. // in the video block
  40795. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
  40796. src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
  40797. });
  40798. return block;
  40799. }
  40800. }, {
  40801. type: 'shortcode',
  40802. tag: 'video',
  40803. attributes: {
  40804. src: {
  40805. type: 'string',
  40806. shortcode: _ref => {
  40807. let {
  40808. named: {
  40809. src,
  40810. mp4,
  40811. m4v,
  40812. webm,
  40813. ogv,
  40814. flv
  40815. }
  40816. } = _ref;
  40817. return src || mp4 || m4v || webm || ogv || flv;
  40818. }
  40819. },
  40820. poster: {
  40821. type: 'string',
  40822. shortcode: _ref2 => {
  40823. let {
  40824. named: {
  40825. poster
  40826. }
  40827. } = _ref2;
  40828. return poster;
  40829. }
  40830. },
  40831. loop: {
  40832. type: 'string',
  40833. shortcode: _ref3 => {
  40834. let {
  40835. named: {
  40836. loop
  40837. }
  40838. } = _ref3;
  40839. return loop;
  40840. }
  40841. },
  40842. autoplay: {
  40843. type: 'string',
  40844. shortcode: _ref4 => {
  40845. let {
  40846. named: {
  40847. autoplay
  40848. }
  40849. } = _ref4;
  40850. return autoplay;
  40851. }
  40852. },
  40853. preload: {
  40854. type: 'string',
  40855. shortcode: _ref5 => {
  40856. let {
  40857. named: {
  40858. preload
  40859. }
  40860. } = _ref5;
  40861. return preload;
  40862. }
  40863. }
  40864. }
  40865. }]
  40866. };
  40867. /* harmony default export */ var video_transforms = (video_transforms_transforms);
  40868. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js
  40869. /**
  40870. * WordPress dependencies
  40871. */
  40872. /**
  40873. * Internal dependencies
  40874. */
  40875. const video_metadata = {
  40876. $schema: "https://schemas.wp.org/trunk/block.json",
  40877. apiVersion: 2,
  40878. name: "core/video",
  40879. title: "Video",
  40880. category: "media",
  40881. description: "Embed a video from your media library or upload a new one.",
  40882. keywords: ["movie"],
  40883. textdomain: "default",
  40884. attributes: {
  40885. autoplay: {
  40886. type: "boolean",
  40887. source: "attribute",
  40888. selector: "video",
  40889. attribute: "autoplay"
  40890. },
  40891. caption: {
  40892. type: "string",
  40893. source: "html",
  40894. selector: "figcaption"
  40895. },
  40896. controls: {
  40897. type: "boolean",
  40898. source: "attribute",
  40899. selector: "video",
  40900. attribute: "controls",
  40901. "default": true
  40902. },
  40903. id: {
  40904. type: "number"
  40905. },
  40906. loop: {
  40907. type: "boolean",
  40908. source: "attribute",
  40909. selector: "video",
  40910. attribute: "loop"
  40911. },
  40912. muted: {
  40913. type: "boolean",
  40914. source: "attribute",
  40915. selector: "video",
  40916. attribute: "muted"
  40917. },
  40918. poster: {
  40919. type: "string",
  40920. source: "attribute",
  40921. selector: "video",
  40922. attribute: "poster"
  40923. },
  40924. preload: {
  40925. type: "string",
  40926. source: "attribute",
  40927. selector: "video",
  40928. attribute: "preload",
  40929. "default": "metadata"
  40930. },
  40931. src: {
  40932. type: "string",
  40933. source: "attribute",
  40934. selector: "video",
  40935. attribute: "src"
  40936. },
  40937. playsInline: {
  40938. type: "boolean",
  40939. source: "attribute",
  40940. selector: "video",
  40941. attribute: "playsinline"
  40942. },
  40943. tracks: {
  40944. type: "array",
  40945. items: {
  40946. type: "object"
  40947. },
  40948. "default": []
  40949. }
  40950. },
  40951. supports: {
  40952. anchor: true,
  40953. align: true
  40954. },
  40955. editorStyle: "wp-block-video-editor",
  40956. style: "wp-block-video"
  40957. };
  40958. const {
  40959. name: video_name
  40960. } = video_metadata;
  40961. const video_settings = {
  40962. icon: library_video,
  40963. example: {
  40964. attributes: {
  40965. src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',
  40966. // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.
  40967. caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.')
  40968. }
  40969. },
  40970. transforms: video_transforms,
  40971. edit: video_edit,
  40972. save: video_save_save
  40973. };
  40974. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js
  40975. /**
  40976. * WordPress dependencies
  40977. */
  40978. /**
  40979. * Internal dependencies
  40980. */
  40981. /**
  40982. * Function to register an individual block.
  40983. *
  40984. * @param {Object} block The block to be registered.
  40985. *
  40986. */
  40987. const registerBlock = block => {
  40988. if (!block) {
  40989. return;
  40990. }
  40991. const {
  40992. metadata,
  40993. settings,
  40994. name
  40995. } = block;
  40996. (0,external_wp_blocks_namespaceObject.registerBlockType)({
  40997. name,
  40998. ...metadata
  40999. }, settings);
  41000. };
  41001. /**
  41002. * Function to get all the core blocks in an array.
  41003. *
  41004. * @example
  41005. * ```js
  41006. * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';
  41007. *
  41008. * const coreBlocks = __experimentalGetCoreBlocks();
  41009. * ```
  41010. */
  41011. const __experimentalGetCoreBlocks = () => [// Common blocks are grouped at the top to prioritize their display
  41012. // in various contexts — like the inserter and auto-complete components.
  41013. build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks.
  41014. archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, window.wp && window.wp.oldEditor ? freeform_namespaceObject : null, // Only add the classic block in WP Context.
  41015. build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_cover_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, // tableOfContents,
  41016. tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, // theme blocks
  41017. build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, build_module_post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_query_loop_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_namespaceObject, build_module_post_comments_form_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, build_module_query_title_namespaceObject, post_author_biography_namespaceObject];
  41018. /**
  41019. * Function to register core blocks provided by the block editor.
  41020. *
  41021. * @param {Array} blocks An optional array of the core blocks being registered.
  41022. *
  41023. * @example
  41024. * ```js
  41025. * import { registerCoreBlocks } from '@wordpress/block-library';
  41026. *
  41027. * registerCoreBlocks();
  41028. * ```
  41029. */
  41030. const registerCoreBlocks = function () {
  41031. let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __experimentalGetCoreBlocks();
  41032. blocks.forEach(registerBlock);
  41033. (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name);
  41034. if (window.wp && window.wp.oldEditor) {
  41035. (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name);
  41036. }
  41037. (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name);
  41038. (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name);
  41039. };
  41040. /**
  41041. * Function to register experimental core blocks depending on editor settings.
  41042. *
  41043. * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.
  41044. * @example
  41045. * ```js
  41046. * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
  41047. *
  41048. * __experimentalRegisterExperimentalCoreBlocks( settings );
  41049. * ```
  41050. */
  41051. const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined;
  41052. }();
  41053. (window.wp = window.wp || {}).blockLibrary = __webpack_exports__;
  41054. /******/ })()
  41055. ;