| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135 |
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-CbvoP-qD.js","assets/typescript-BaxiLt3b.js"])))=>i.map(i=>d[i]);
- function bNe(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in n)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(n,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();/**
- * @vue/shared v3.5.13
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **//*! #__NO_SIDE_EFFECTS__ */function mZ(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const nr={},Z1=[],ps=()=>{},TNe=()=>!1,y5=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),_Z=n=>n.startsWith("onUpdate:"),ba=Object.assign,vZ=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},CNe=Object.prototype.hasOwnProperty,Wi=(n,e)=>CNe.call(n,e),yt=Array.isArray,eO=n=>xP(n)==="[object Map]",E5=n=>xP(n)==="[object Set]",WC=n=>xP(n)==="[object Date]",ln=n=>typeof n=="function",sn=n=>typeof n=="string",Yg=n=>typeof n=="symbol",si=n=>n!==null&&typeof n=="object",S$=n=>(si(n)||ln(n))&&ln(n.then)&&ln(n.catch),f_e=Object.prototype.toString,xP=n=>f_e.call(n),yNe=n=>xP(n).slice(8,-1),w$=n=>xP(n)==="[object Object]",bZ=n=>sn(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,yD=mZ(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),S5=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ENe=/-(\w)/g,$u=S5(n=>n.replace(ENe,(e,t)=>t?t.toUpperCase():"")),SNe=/\B([A-Z])/g,bb=S5(n=>n.replace(SNe,"-$1").toLowerCase()),PP=S5(n=>n.charAt(0).toUpperCase()+n.slice(1)),ED=S5(n=>n?`on${PP(n)}`:""),IC=(n,e)=>!Object.is(n,e),VV=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},g_e=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},DK=n=>{const e=parseFloat(n);return isNaN(e)?n:e},wNe=n=>{const e=sn(n)?Number(n):NaN;return isNaN(e)?n:e};let Doe;const w5=()=>Doe||(Doe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function on(n){if(yt(n)){const e={};for(let t=0;t<n.length;t++){const i=n[t],s=sn(i)?RNe(i):on(i);if(s)for(const o in s)e[o]=s[o]}return e}else if(sn(n)||si(n))return n}const INe=/;(?![^(]*\))/g,LNe=/:([^]+)/,ONe=/\/\*[^]*?\*\//g;function RNe(n){const e={};return n.replace(ONe,"").split(INe).forEach(t=>{if(t){const i=t.split(LNe);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Y(n){let e="";if(sn(n))e=n;else if(yt(n))for(let t=0;t<n.length;t++){const i=Y(n[t]);i&&(e+=i+" ")}else if(si(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function wf(n){if(!n)return null;let{class:e,style:t}=n;return e&&!sn(e)&&(n.class=Y(e)),t&&(n.style=on(t)),n}const MNe="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",kNe=mZ(MNe);function p_e(n){return!!n||n===""}function ANe(n,e){if(n.length!==e.length)return!1;let t=!0;for(let i=0;t&&i<n.length;i++)t=NO(n[i],e[i]);return t}function NO(n,e){if(n===e)return!0;let t=WC(n),i=WC(e);if(t||i)return t&&i?n.getTime()===e.getTime():!1;if(t=Yg(n),i=Yg(e),t||i)return n===e;if(t=yt(n),i=yt(e),t||i)return t&&i?ANe(n,e):!1;if(t=si(n),i=si(e),t||i){if(!t||!i)return!1;const s=Object.keys(n).length,o=Object.keys(e).length;if(s!==o)return!1;for(const r in n){const a=n.hasOwnProperty(r),c=e.hasOwnProperty(r);if(a&&!c||!a&&c||!NO(n[r],e[r]))return!1}}return String(n)===String(e)}function m_e(n,e){return n.findIndex(t=>NO(t,e))}const __e=n=>!!(n&&n.__v_isRef===!0),st=n=>sn(n)?n:n==null?"":yt(n)||si(n)&&(n.toString===f_e||!ln(n.toString))?__e(n)?st(n.value):JSON.stringify(n,v_e,2):String(n),v_e=(n,e)=>__e(e)?v_e(n,e.value):eO(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],o)=>(t[tz(i,o)+" =>"]=s,t),{})}:E5(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>tz(t))}:Yg(e)?tz(e):si(e)&&!yt(e)&&!w$(e)?String(e):e,tz=(n,e="")=>{var t;return Yg(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/**
- * @vue/reactivity v3.5.13
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/let Tu;class b_e{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Tu,!e&&Tu&&(this.index=(Tu.scopes||(Tu.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Tu;try{return Tu=this,e()}finally{Tu=t}}}on(){Tu=this}off(){Tu=this.parent}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function I5(n){return new b_e(n)}function TZ(){return Tu}function CZ(n,e=!1){Tu&&Tu.cleanups.push(n)}let dr;const nz=new WeakSet;class T_e{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Tu&&Tu.active&&Tu.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,nz.has(this)&&(nz.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||y_e(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,$oe(this),E_e(this);const e=dr,t=Hg;dr=this,Hg=!0;try{return this.fn()}finally{S_e(this),dr=e,Hg=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)SZ(e);this.deps=this.depsTail=void 0,$oe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?nz.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){$K(this)&&this.run()}get dirty(){return $K(this)}}let C_e=0,SD,wD;function y_e(n,e=!1){if(n.flags|=8,e){n.next=wD,wD=n;return}n.next=SD,SD=n}function yZ(){C_e++}function EZ(){if(--C_e>0)return;if(wD){let e=wD;for(wD=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;SD;){let e=SD;for(SD=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function E_e(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function S_e(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),SZ(i),NNe(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function $K(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(w_e(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function w_e(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===I$))return;n.globalVersion=I$;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!$K(n)){n.flags&=-3;return}const t=dr,i=Hg;dr=n,Hg=!0;try{E_e(n);const s=n.fn(n._value);(e.version===0||IC(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{dr=t,Hg=i,S_e(n),n.flags&=-3}}function SZ(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)SZ(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function NNe(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Hg=!0;const I_e=[];function wy(){I_e.push(Hg),Hg=!1}function Iy(){const n=I_e.pop();Hg=n===void 0?!0:n}function $oe(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=dr;dr=void 0;try{e()}finally{dr=t}}}let I$=0,DNe=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class L5{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!dr||!Hg||dr===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==dr)t=this.activeLink=new DNe(dr,this),dr.deps?(t.prevDep=dr.depsTail,dr.depsTail.nextDep=t,dr.depsTail=t):dr.deps=dr.depsTail=t,L_e(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=dr.depsTail,t.nextDep=void 0,dr.depsTail.nextDep=t,dr.depsTail=t,dr.deps===t&&(dr.deps=i)}return t}trigger(e){this.version++,I$++,this.notify(e)}notify(e){yZ();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{EZ()}}}function L_e(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)L_e(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const M4=new WeakMap,n0=Symbol(""),xK=Symbol(""),L$=Symbol("");function Fc(n,e,t){if(Hg&&dr){let i=M4.get(n);i||M4.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new L5),s.map=i,s.key=t),s.track()}}function Av(n,e,t,i,s,o){const r=M4.get(n);if(!r){I$++;return}const a=c=>{c&&c.trigger()};if(yZ(),e==="clear")r.forEach(a);else{const c=yt(n),u=c&&bZ(t);if(c&&t==="length"){const d=Number(i);r.forEach((f,g)=>{(g==="length"||g===L$||!Yg(g)&&g>=d)&&a(f)})}else switch((t!==void 0||r.has(void 0))&&a(r.get(t)),u&&a(r.get(L$)),e){case"add":c?u&&a(r.get("length")):(a(r.get(n0)),eO(n)&&a(r.get(xK)));break;case"delete":c||(a(r.get(n0)),eO(n)&&a(r.get(xK)));break;case"set":eO(n)&&a(r.get(n0));break}}EZ()}function $Ne(n,e){const t=M4.get(n);return t&&t.get(e)}function WL(n){const e=Cs(n);return e===n?e:(Fc(e,"iterate",L$),Nf(n)?e:e.map(Bc))}function O5(n){return Fc(n=Cs(n),"iterate",L$),n}const xNe={__proto__:null,[Symbol.iterator](){return iz(this,Symbol.iterator,Bc)},concat(...n){return WL(this).concat(...n.map(e=>yt(e)?WL(e):e))},entries(){return iz(this,"entries",n=>(n[1]=Bc(n[1]),n))},every(n,e){return ov(this,"every",n,e,void 0,arguments)},filter(n,e){return ov(this,"filter",n,e,t=>t.map(Bc),arguments)},find(n,e){return ov(this,"find",n,e,Bc,arguments)},findIndex(n,e){return ov(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return ov(this,"findLast",n,e,Bc,arguments)},findLastIndex(n,e){return ov(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return ov(this,"forEach",n,e,void 0,arguments)},includes(...n){return sz(this,"includes",n)},indexOf(...n){return sz(this,"indexOf",n)},join(n){return WL(this).join(n)},lastIndexOf(...n){return sz(this,"lastIndexOf",n)},map(n,e){return ov(this,"map",n,e,void 0,arguments)},pop(){return gN(this,"pop")},push(...n){return gN(this,"push",n)},reduce(n,...e){return xoe(this,"reduce",n,e)},reduceRight(n,...e){return xoe(this,"reduceRight",n,e)},shift(){return gN(this,"shift")},some(n,e){return ov(this,"some",n,e,void 0,arguments)},splice(...n){return gN(this,"splice",n)},toReversed(){return WL(this).toReversed()},toSorted(n){return WL(this).toSorted(n)},toSpliced(...n){return WL(this).toSpliced(...n)},unshift(...n){return gN(this,"unshift",n)},values(){return iz(this,"values",Bc)}};function iz(n,e,t){const i=O5(n),s=i[e]();return i!==n&&!Nf(n)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.value&&(o.value=t(o.value)),o}),s}const PNe=Array.prototype;function ov(n,e,t,i,s,o){const r=O5(n),a=r!==n&&!Nf(n),c=r[e];if(c!==PNe[e]){const f=c.apply(n,o);return a?Bc(f):f}let u=t;r!==n&&(a?u=function(f,g){return t.call(this,Bc(f),g,n)}:t.length>2&&(u=function(f,g){return t.call(this,f,g,n)}));const d=c.call(r,u,i);return a&&s?s(d):d}function xoe(n,e,t,i){const s=O5(n);let o=t;return s!==n&&(Nf(n)?t.length>3&&(o=function(r,a,c){return t.call(this,r,a,c,n)}):o=function(r,a,c){return t.call(this,r,Bc(a),c,n)}),s[e](o,...i)}function sz(n,e,t){const i=Cs(n);Fc(i,"iterate",L$);const s=i[e](...t);return(s===-1||s===!1)&&OZ(t[0])?(t[0]=Cs(t[0]),i[e](...t)):s}function gN(n,e,t=[]){wy(),yZ();const i=Cs(n)[e].apply(n,t);return EZ(),Iy(),i}const FNe=mZ("__proto__,__v_isRef,__isVue"),O_e=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Yg));function BNe(n){Yg(n)||(n=String(n));const e=Cs(this);return Fc(e,"has",n),e.hasOwnProperty(n)}class R_e{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return o;if(t==="__v_raw")return i===(s?o?YNe:N_e:o?A_e:k_e).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const r=yt(e);if(!s){let c;if(r&&(c=xNe[t]))return c;if(t==="hasOwnProperty")return BNe}const a=Reflect.get(e,t,Ss(e)?e:i);return(Yg(t)?O_e.has(t):FNe(t))||(s||Fc(e,"get",t),o)?a:Ss(a)?r&&bZ(t)?a:a.value:si(a)?s?XR(a):Ki(a):a}}class M_e extends R_e{constructor(e=!1){super(!1,e)}set(e,t,i,s){let o=e[t];if(!this._isShallow){const c=R0(o);if(!Nf(i)&&!R0(i)&&(o=Cs(o),i=Cs(i)),!yt(e)&&Ss(o)&&!Ss(i))return c?!1:(o.value=i,!0)}const r=yt(e)&&bZ(t)?Number(t)<e.length:Wi(e,t),a=Reflect.set(e,t,i,Ss(e)?e:s);return e===Cs(s)&&(r?IC(i,o)&&Av(e,"set",t,i):Av(e,"add",t,i)),a}deleteProperty(e,t){const i=Wi(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&i&&Av(e,"delete",t,void 0),s}has(e,t){const i=Reflect.has(e,t);return(!Yg(t)||!O_e.has(t))&&Fc(e,"has",t),i}ownKeys(e){return Fc(e,"iterate",yt(e)?"length":n0),Reflect.ownKeys(e)}}class HNe extends R_e{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const VNe=new M_e,UNe=new HNe,WNe=new M_e(!0);const PK=n=>n,WB=n=>Reflect.getPrototypeOf(n);function GNe(n,e,t){return function(...i){const s=this.__v_raw,o=Cs(s),r=eO(o),a=n==="entries"||n===Symbol.iterator&&r,c=n==="keys"&&r,u=s[n](...i),d=t?PK:e?FK:Bc;return!e&&Fc(o,"iterate",c?xK:n0),{next(){const{value:f,done:g}=u.next();return g?{value:f,done:g}:{value:a?[d(f[0]),d(f[1])]:d(f),done:g}},[Symbol.iterator](){return this}}}}function GB(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function zNe(n,e){const t={get(s){const o=this.__v_raw,r=Cs(o),a=Cs(s);n||(IC(s,a)&&Fc(r,"get",s),Fc(r,"get",a));const{has:c}=WB(r),u=e?PK:n?FK:Bc;if(c.call(r,s))return u(o.get(s));if(c.call(r,a))return u(o.get(a));o!==r&&o.get(s)},get size(){const s=this.__v_raw;return!n&&Fc(Cs(s),"iterate",n0),Reflect.get(s,"size",s)},has(s){const o=this.__v_raw,r=Cs(o),a=Cs(s);return n||(IC(s,a)&&Fc(r,"has",s),Fc(r,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const r=this,a=r.__v_raw,c=Cs(a),u=e?PK:n?FK:Bc;return!n&&Fc(c,"iterate",n0),a.forEach((d,f)=>s.call(o,u(d),u(f),r))}};return ba(t,n?{add:GB("add"),set:GB("set"),delete:GB("delete"),clear:GB("clear")}:{add(s){!e&&!Nf(s)&&!R0(s)&&(s=Cs(s));const o=Cs(this);return WB(o).has.call(o,s)||(o.add(s),Av(o,"add",s,s)),this},set(s,o){!e&&!Nf(o)&&!R0(o)&&(o=Cs(o));const r=Cs(this),{has:a,get:c}=WB(r);let u=a.call(r,s);u||(s=Cs(s),u=a.call(r,s));const d=c.call(r,s);return r.set(s,o),u?IC(o,d)&&Av(r,"set",s,o):Av(r,"add",s,o),this},delete(s){const o=Cs(this),{has:r,get:a}=WB(o);let c=r.call(o,s);c||(s=Cs(s),c=r.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return c&&Av(o,"delete",s,void 0),u},clear(){const s=Cs(this),o=s.size!==0,r=s.clear();return o&&Av(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=GNe(s,n,e)}),t}function wZ(n,e){const t=zNe(n,e);return(i,s,o)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(Wi(t,s)&&s in i?t:i,s,o)}const KNe={get:wZ(!1,!1)},jNe={get:wZ(!1,!0)},XNe={get:wZ(!0,!1)};const k_e=new WeakMap,A_e=new WeakMap,N_e=new WeakMap,YNe=new WeakMap;function qNe(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function JNe(n){return n.__v_skip||!Object.isExtensible(n)?0:qNe(yNe(n))}function Ki(n){return R0(n)?n:LZ(n,!1,VNe,KNe,k_e)}function IZ(n){return LZ(n,!1,WNe,jNe,A_e)}function XR(n){return LZ(n,!0,UNe,XNe,N_e)}function LZ(n,e,t,i,s){if(!si(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=s.get(n);if(o)return o;const r=JNe(n);if(r===0)return n;const a=new Proxy(n,r===2?i:t);return s.set(n,a),a}function LC(n){return R0(n)?LC(n.__v_raw):!!(n&&n.__v_isReactive)}function R0(n){return!!(n&&n.__v_isReadonly)}function Nf(n){return!!(n&&n.__v_isShallow)}function OZ(n){return n?!!n.__v_raw:!1}function Cs(n){const e=n&&n.__v_raw;return e?Cs(e):n}function Nm(n){return!Wi(n,"__v_skip")&&Object.isExtensible(n)&&g_e(n,"__v_skip",!0),n}const Bc=n=>si(n)?Ki(n):n,FK=n=>si(n)?XR(n):n;function Ss(n){return n?n.__v_isRef===!0:!1}function te(n){return D_e(n,!1)}function us(n){return D_e(n,!0)}function D_e(n,e){return Ss(n)?n:new QNe(n,e)}class QNe{constructor(e,t){this.dep=new L5,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Cs(e),this._value=t?e:Bc(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Nf(e)||R0(e);e=i?e:Cs(e),IC(e,t)&&(this._rawValue=e,this._value=i?e:Bc(e),this.dep.trigger())}}function T(n){return Ss(n)?n.value:n}const ZNe={get:(n,e,t)=>e==="__v_raw"?n:T(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Ss(s)&&!Ss(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function $_e(n){return LC(n)?n:new Proxy(n,ZNe)}class eDe{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new L5,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tDe(n){return new eDe(n)}function Gl(n){const e=yt(n)?new Array(n.length):{};for(const t in n)e[t]=x_e(n,t);return e}class nDe{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return $Ne(Cs(this._object),this._key)}}class iDe{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function ds(n,e,t){return Ss(n)?n:ln(n)?new iDe(n):si(n)&&arguments.length>1?x_e(n,e,t):te(n)}function x_e(n,e,t){const i=n[e];return Ss(i)?i:new nDe(n,e,t)}class sDe{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new L5(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=I$-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&dr!==this)return y_e(this,!0),!0}get value(){const e=this.dep.track();return w_e(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function oDe(n,e,t=!1){let i,s;return ln(n)?i=n:(i=n.get,s=n.set),new sDe(i,s,t)}const zB={},k4=new WeakMap;let _S;function rDe(n,e=!1,t=_S){if(t){let i=k4.get(t);i||k4.set(t,i=[]),i.push(n)}}function lDe(n,e,t=nr){const{immediate:i,deep:s,once:o,scheduler:r,augmentJob:a,call:c}=t,u=L=>s?L:Nf(L)||s===!1||s===0?Nv(L,1):Nv(L);let d,f,g,p,_=!1,v=!1;if(Ss(n)?(f=()=>n.value,_=Nf(n)):LC(n)?(f=()=>u(n),_=!0):yt(n)?(v=!0,_=n.some(L=>LC(L)||Nf(L)),f=()=>n.map(L=>{if(Ss(L))return L.value;if(LC(L))return u(L);if(ln(L))return c?c(L,2):L()})):ln(n)?e?f=c?()=>c(n,2):n:f=()=>{if(g){wy();try{g()}finally{Iy()}}const L=_S;_S=d;try{return c?c(n,3,[p]):n(p)}finally{_S=L}}:f=ps,e&&s){const L=f,O=s===!0?1/0:s;f=()=>Nv(L(),O)}const C=TZ(),y=()=>{d.stop(),C&&C.active&&vZ(C.effects,d)};if(o&&e){const L=e;e=(...O)=>{L(...O),y()}}let w=v?new Array(n.length).fill(zB):zB;const I=L=>{if(!(!(d.flags&1)||!d.dirty&&!L))if(e){const O=d.run();if(s||_||(v?O.some((A,N)=>IC(A,w[N])):IC(O,w))){g&&g();const A=_S;_S=d;try{const N=[O,w===zB?void 0:v&&w[0]===zB?[]:w,p];c?c(e,3,N):e(...N),w=O}finally{_S=A}}}else d.run()};return a&&a(I),d=new T_e(f),d.scheduler=r?()=>r(I,!1):I,p=L=>rDe(L,!1,d),g=d.onStop=()=>{const L=k4.get(d);if(L){if(c)c(L,4);else for(const O of L)O();k4.delete(d)}},e?i?I(!0):w=d.run():r?r(I.bind(null,!0),!0):d.run(),y.pause=d.pause.bind(d),y.resume=d.resume.bind(d),y.stop=y,y}function Nv(n,e=1/0,t){if(e<=0||!si(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Ss(n))Nv(n.value,e,t);else if(yt(n))for(let i=0;i<n.length;i++)Nv(n[i],e,t);else if(E5(n)||eO(n))n.forEach(i=>{Nv(i,e,t)});else if(w$(n)){for(const i in n)Nv(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Nv(n[i],e,t)}return n}/**
- * @vue/runtime-core v3.5.13
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/function FP(n,e,t,i){try{return i?n(...i):n()}catch(s){R5(s,e,t)}}function qg(n,e,t,i){if(ln(n)){const s=FP(n,e,t,i);return s&&S$(s)&&s.catch(o=>{R5(o,e,t)}),s}if(yt(n)){const s=[];for(let o=0;o<n.length;o++)s.push(qg(n[o],e,t,i));return s}}function R5(n,e,t,i=!0){const s=e?e.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:r}=e&&e.appContext.config||nr;if(e){let a=e.parent;const c=e.proxy,u=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const d=a.ec;if(d){for(let f=0;f<d.length;f++)if(d[f](n,c,u)===!1)return}a=a.parent}if(o){wy(),FP(o,null,10,[n,c,u]),Iy();return}}aDe(n,t,s,i,r)}function aDe(n,e,t,i=!0,s=!1){if(s)throw n;console.error(n)}const yu=[];let lm=-1;const tO=[];let JT=null,v1=0;const P_e=Promise.resolve();let A4=null;function cn(n){const e=A4||P_e;return n?e.then(this?n.bind(this):n):e}function cDe(n){let e=lm+1,t=yu.length;for(;e<t;){const i=e+t>>>1,s=yu[i],o=O$(s);o<n||o===n&&s.flags&2?e=i+1:t=i}return e}function RZ(n){if(!(n.flags&1)){const e=O$(n),t=yu[yu.length-1];!t||!(n.flags&2)&&e>=O$(t)?yu.push(n):yu.splice(cDe(e),0,n),n.flags|=1,F_e()}}function F_e(){A4||(A4=P_e.then(H_e))}function uDe(n){yt(n)?tO.push(...n):JT&&n.id===-1?JT.splice(v1+1,0,n):n.flags&1||(tO.push(n),n.flags|=1),F_e()}function Poe(n,e,t=lm+1){for(;t<yu.length;t++){const i=yu[t];if(i&&i.flags&2){if(n&&i.id!==n.uid)continue;yu.splice(t,1),t--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function B_e(n){if(tO.length){const e=[...new Set(tO)].sort((t,i)=>O$(t)-O$(i));if(tO.length=0,JT){JT.push(...e);return}for(JT=e,v1=0;v1<JT.length;v1++){const t=JT[v1];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}JT=null,v1=0}}const O$=n=>n.id==null?n.flags&2?-1:1/0:n.id;function H_e(n){try{for(lm=0;lm<yu.length;lm++){const e=yu[lm];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),FP(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;lm<yu.length;lm++){const e=yu[lm];e&&(e.flags&=-2)}lm=-1,yu.length=0,B_e(),A4=null,(yu.length||tO.length)&&H_e()}}let ga=null,V_e=null;function N4(n){const e=ga;return ga=n,V_e=n&&n.type.__scopeId||null,e}function _e(n,e=ga,t){if(!e||n._n)return n;const i=(...s)=>{i._d&&Joe(-1);const o=N4(e);let r;try{r=n(...s)}finally{N4(o),i._d&&Joe(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function Un(n,e){if(ga===null)return n;const t=$5(ga),i=n.dirs||(n.dirs=[]);for(let s=0;s<e.length;s++){let[o,r,a,c=nr]=e[s];o&&(ln(o)&&(o={mounted:o,updated:o}),o.deep&&Nv(r),i.push({dir:o,instance:t,value:r,oldValue:void 0,arg:a,modifiers:c}))}return n}function iS(n,e,t,i){const s=n.dirs,o=e&&e.dirs;for(let r=0;r<s.length;r++){const a=s[r];o&&(a.oldValue=o[r].value);let c=a.dir[i];c&&(wy(),qg(c,t,8,[n.el,a,n,e]),Iy())}}const U_e=Symbol("_vte"),W_e=n=>n.__isTeleport,ID=n=>n&&(n.disabled||n.disabled===""),Foe=n=>n&&(n.defer||n.defer===""),Boe=n=>typeof SVGElement<"u"&&n instanceof SVGElement,Hoe=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,BK=(n,e)=>{const t=n&&n.to;return sn(t)?e?e(t):null:t},G_e={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,o,r,a,c,u){const{mc:d,pc:f,pbc:g,o:{insert:p,querySelector:_,createText:v,createComment:C}}=u,y=ID(e.props);let{shapeFlag:w,children:I,dynamicChildren:L}=e;if(n==null){const O=e.el=v(""),A=e.anchor=v("");p(O,t,i),p(A,t,i);const N=(P,F)=>{w&16&&(s&&s.isCE&&(s.ce._teleportTarget=P),d(I,P,F,s,o,r,a,c))},D=()=>{const P=e.target=BK(e.props,_),F=z_e(P,e,v,p);P&&(r!=="svg"&&Boe(P)?r="svg":r!=="mathml"&&Hoe(P)&&(r="mathml"),y||(N(P,F),UV(e,!1)))};y&&(N(t,A),UV(e,!0)),Foe(e.props)?vu(()=>{D(),e.el.__isMounted=!0},o):D()}else{if(Foe(e.props)&&!n.el.__isMounted){vu(()=>{G_e.process(n,e,t,i,s,o,r,a,c,u),delete n.el.__isMounted},o);return}e.el=n.el,e.targetStart=n.targetStart;const O=e.anchor=n.anchor,A=e.target=n.target,N=e.targetAnchor=n.targetAnchor,D=ID(n.props),P=D?t:A,F=D?O:N;if(r==="svg"||Boe(A)?r="svg":(r==="mathml"||Hoe(A))&&(r="mathml"),L?(g(n.dynamicChildren,L,P,s,o,r,a),$Z(n,e,!0)):c||f(n,e,P,F,s,o,r,a,!1),y)D?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):KB(e,t,O,u,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const V=e.target=BK(e.props,_);V&&KB(e,V,null,u,0)}else D&&KB(e,A,N,u,1);UV(e,y)}},remove(n,e,t,{um:i,o:{remove:s}},o){const{shapeFlag:r,children:a,anchor:c,targetStart:u,targetAnchor:d,target:f,props:g}=n;if(f&&(s(u),s(d)),o&&s(c),r&16){const p=o||!ID(g);for(let _=0;_<a.length;_++){const v=a[_];i(v,e,t,p,!!v.dynamicChildren)}}},move:KB,hydrate:dDe};function KB(n,e,t,{o:{insert:i},m:s},o=2){o===0&&i(n.targetAnchor,e,t);const{el:r,anchor:a,shapeFlag:c,children:u,props:d}=n,f=o===2;if(f&&i(r,e,t),(!f||ID(d))&&c&16)for(let g=0;g<u.length;g++)s(u[g],e,t,2);f&&i(a,e,t)}function dDe(n,e,t,i,s,o,{o:{nextSibling:r,parentNode:a,querySelector:c,insert:u,createText:d}},f){const g=e.target=BK(e.props,c);if(g){const p=ID(e.props),_=g._lpa||g.firstChild;if(e.shapeFlag&16)if(p)e.anchor=f(r(n),e,a(n),t,i,s,o),e.targetStart=_,e.targetAnchor=_&&r(_);else{e.anchor=r(n);let v=_;for(;v;){if(v&&v.nodeType===8){if(v.data==="teleport start anchor")e.targetStart=v;else if(v.data==="teleport anchor"){e.targetAnchor=v,g._lpa=e.targetAnchor&&r(e.targetAnchor);break}}v=r(v)}e.targetAnchor||z_e(g,e,d,u),f(_&&r(_),e,g,t,i,s,o)}UV(e,p)}return e.anchor&&r(e.anchor)}const hDe=G_e;function UV(n,e){const t=n.ctx;if(t&&t.ut){let i,s;for(e?(i=n.el,s=n.anchor):(i=n.targetStart,s=n.targetAnchor);i&&i!==s;)i.nodeType===1&&i.setAttribute("data-v-owner",t.uid),i=i.nextSibling;t.ut()}}function z_e(n,e,t,i){const s=e.targetStart=t(""),o=e.targetAnchor=t("");return s[U_e]=o,n&&(i(s,n),i(o,n)),o}const QT=Symbol("_leaveCb"),jB=Symbol("_enterCb");function K_e(){const n={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return $n(()=>{n.isMounted=!0}),As(()=>{n.isUnmounting=!0}),n}const rf=[Function,Array],j_e={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:rf,onEnter:rf,onAfterEnter:rf,onEnterCancelled:rf,onBeforeLeave:rf,onLeave:rf,onAfterLeave:rf,onLeaveCancelled:rf,onBeforeAppear:rf,onAppear:rf,onAfterAppear:rf,onAppearCancelled:rf},X_e=n=>{const e=n.subTree;return e.component?X_e(e.component):e},fDe={name:"BaseTransition",props:j_e,setup(n,{slots:e}){const t=Qn(),i=K_e();return()=>{const s=e.default&&MZ(e.default(),!0);if(!s||!s.length)return;const o=Y_e(s),r=Cs(n),{mode:a}=r;if(i.isLeaving)return oz(o);const c=Voe(o);if(!c)return oz(o);let u=R$(c,r,i,t,f=>u=f);c.type!==fa&&M0(c,u);let d=t.subTree&&Voe(t.subTree);if(d&&d.type!==fa&&!CS(c,d)&&X_e(t).type!==fa){let f=R$(d,r,i,t);if(M0(d,f),a==="out-in"&&c.type!==fa)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,d=void 0},oz(o);a==="in-out"&&c.type!==fa?f.delayLeave=(g,p,_)=>{const v=q_e(i,d);v[String(d.key)]=d,g[QT]=()=>{p(),g[QT]=void 0,delete u.delayedLeave,d=void 0},u.delayedLeave=()=>{_(),delete u.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return o}}};function Y_e(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==fa){e=t;break}}return e}const gDe=fDe;function q_e(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function R$(n,e,t,i,s){const{appear:o,mode:r,persisted:a=!1,onBeforeEnter:c,onEnter:u,onAfterEnter:d,onEnterCancelled:f,onBeforeLeave:g,onLeave:p,onAfterLeave:_,onLeaveCancelled:v,onBeforeAppear:C,onAppear:y,onAfterAppear:w,onAppearCancelled:I}=e,L=String(n.key),O=q_e(t,n),A=(P,F)=>{P&&qg(P,i,9,F)},N=(P,F)=>{const V=F[1];A(P,F),yt(P)?P.every(U=>U.length<=1)&&V():P.length<=1&&V()},D={mode:r,persisted:a,beforeEnter(P){let F=c;if(!t.isMounted)if(o)F=C||c;else return;P[QT]&&P[QT](!0);const V=O[L];V&&CS(n,V)&&V.el[QT]&&V.el[QT](),A(F,[P])},enter(P){let F=u,V=d,U=f;if(!t.isMounted)if(o)F=y||u,V=w||d,U=I||f;else return;let Q=!1;const de=P[jB]=q=>{Q||(Q=!0,q?A(U,[P]):A(V,[P]),D.delayedLeave&&D.delayedLeave(),P[jB]=void 0)};F?N(F,[P,de]):de()},leave(P,F){const V=String(n.key);if(P[jB]&&P[jB](!0),t.isUnmounting)return F();A(g,[P]);let U=!1;const Q=P[QT]=de=>{U||(U=!0,F(),de?A(v,[P]):A(_,[P]),P[QT]=void 0,O[V]===n&&delete O[V])};O[V]=n,p?N(p,[P,Q]):Q()},clone(P){const F=R$(P,e,t,i,s);return s&&s(F),F}};return D}function oz(n){if(M5(n))return n=ib(n),n.children=null,n}function Voe(n){if(!M5(n))return W_e(n.type)&&n.children?Y_e(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&ln(t.default))return t.default()}}function M0(n,e){n.shapeFlag&6&&n.component?(n.transition=e,M0(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function MZ(n,e=!1,t){let i=[],s=0;for(let o=0;o<n.length;o++){let r=n[o];const a=t==null?r.key:String(t)+String(r.key!=null?r.key:o);r.type===Qt?(r.patchFlag&128&&s++,i=i.concat(MZ(r.children,e,a))):(e||r.type!==fa)&&i.push(a!=null?ib(r,{key:a}):r)}if(s>1)for(let o=0;o<i.length;o++)i[o].patchFlag=-2;return i}/*! #__NO_SIDE_EFFECTS__ */function $e(n,e){return ln(n)?ba({name:n.name},e,{setup:n}):n}function J_e(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function D4(n,e,t,i,s=!1){if(yt(n)){n.forEach((_,v)=>D4(_,e&&(yt(e)?e[v]:e),t,i,s));return}if(nO(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&D4(n,e,t,i.component.subTree);return}const o=i.shapeFlag&4?$5(i.component):i.el,r=s?null:o,{i:a,r:c}=n,u=e&&e.r,d=a.refs===nr?a.refs={}:a.refs,f=a.setupState,g=Cs(f),p=f===nr?()=>!1:_=>Wi(g,_);if(u!=null&&u!==c&&(sn(u)?(d[u]=null,p(u)&&(f[u]=null)):Ss(u)&&(u.value=null)),ln(c))FP(c,a,12,[r,d]);else{const _=sn(c),v=Ss(c);if(_||v){const C=()=>{if(n.f){const y=_?p(c)?f[c]:d[c]:c.value;s?yt(y)&&vZ(y,o):yt(y)?y.includes(o)||y.push(o):_?(d[c]=[o],p(c)&&(f[c]=d[c])):(c.value=[o],n.k&&(d[n.k]=c.value))}else _?(d[c]=r,p(c)&&(f[c]=r)):v&&(c.value=r,n.k&&(d[n.k]=r))};r?(C.id=-1,vu(C,t)):C()}}}w5().requestIdleCallback;w5().cancelIdleCallback;const nO=n=>!!n.type.__asyncLoader,M5=n=>n.type.__isKeepAlive;function kZ(n,e){Z_e(n,"a",e)}function Q_e(n,e){Z_e(n,"da",e)}function Z_e(n,e,t=xa){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(k5(e,i,t),t){let s=t.parent;for(;s&&s.parent;)M5(s.parent.vnode)&&pDe(i,e,t,s),s=s.parent}}function pDe(n,e,t,i){const s=k5(e,n,i,!0);Cb(()=>{vZ(i[e],s)},t)}function k5(n,e,t=xa,i=!1){if(t){const s=t[n]||(t[n]=[]),o=e.__weh||(e.__weh=(...r)=>{wy();const a=BP(t),c=qg(e,t,n,r);return a(),Iy(),c});return i?s.unshift(o):s.push(o),o}}const Tb=n=>(e,t=xa)=>{(!k$||n==="sp")&&k5(n,(...i)=>e(...i),t)},A5=Tb("bm"),$n=Tb("m"),eve=Tb("bu"),s_=Tb("u"),As=Tb("bum"),Cb=Tb("um"),mDe=Tb("sp"),_De=Tb("rtg"),vDe=Tb("rtc");function bDe(n,e=xa){k5("ec",n,e)}const AZ="components",TDe="directives";function Bt(n,e){return NZ(AZ,n,!0,e)||n}const tve=Symbol.for("v-ndc");function ui(n){return sn(n)?NZ(AZ,n,!1)||n:n||tve}function N5(n){return NZ(TDe,n)}function NZ(n,e,t=!0,i=!1){const s=ga||xa;if(s){const o=s.type;if(n===AZ){const a=o$e(o,!1);if(a&&(a===e||a===$u(e)||a===PP($u(e))))return o}const r=Uoe(s[n]||o[n],e)||Uoe(s.appContext[n],e);return!r&&i?o:r}}function Uoe(n,e){return n&&(n[e]||n[$u(e)]||n[PP($u(e))])}function fi(n,e,t,i){let s;const o=t,r=yt(n);if(r||sn(n)){const a=r&&LC(n);let c=!1;a&&(c=!Nf(n),n=O5(n)),s=new Array(n.length);for(let u=0,d=n.length;u<d;u++)s[u]=e(c?Bc(n[u]):n[u],u,void 0,o)}else if(typeof n=="number"){s=new Array(n);for(let a=0;a<n;a++)s[a]=e(a+1,a,void 0,o)}else if(si(n))if(n[Symbol.iterator])s=Array.from(n,(a,c)=>e(a,c,void 0,o));else{const a=Object.keys(n);s=new Array(a.length);for(let c=0,u=a.length;c<u;c++){const d=a[c];s[c]=e(n[d],d,c,o)}}else s=[];return s}function Hf(n,e){for(let t=0;t<e.length;t++){const i=e[t];if(yt(i))for(let s=0;s<i.length;s++)n[i[s].name]=i[s].fn;else i&&(n[i.name]=i.key?(...s)=>{const o=i.fn(...s);return o&&(o.key=i.key),o}:i.fn)}return n}function Ye(n,e,t={},i,s){if(ga.ce||ga.parent&&nO(ga.parent)&&ga.parent.ce)return e!=="default"&&(t.name=e),G(),nt(Qt,null,[ce("slot",t,i&&i())],64);let o=n[e];o&&o._c&&(o._d=!1),G();const r=o&&nve(o(t)),a=t.key||r&&r.key,c=nt(Qt,{key:(a&&!Yg(a)?a:`_${e}`)+(!r&&i?"_fb":"")},r||(i?i():[]),r&&n._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),o&&o._c&&(o._d=!0),c}function nve(n){return n.some(e=>Oo(e)?!(e.type===fa||e.type===Qt&&!nve(e.children)):!0)?n:null}function CDe(n,e){const t={};for(const i in n)t[ED(i)]=n[i];return t}const HK=n=>n?yve(n)?$5(n):HK(n.parent):null,LD=ba(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>HK(n.parent),$root:n=>HK(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>ove(n),$forceUpdate:n=>n.f||(n.f=()=>{RZ(n.update)}),$nextTick:n=>n.n||(n.n=cn.bind(n.proxy)),$watch:n=>WDe.bind(n)}),rz=(n,e)=>n!==nr&&!n.__isScriptSetup&&Wi(n,e),yDe={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:o,accessCache:r,type:a,appContext:c}=n;let u;if(e[0]!=="$"){const p=r[e];if(p!==void 0)switch(p){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return o[e]}else{if(rz(i,e))return r[e]=1,i[e];if(s!==nr&&Wi(s,e))return r[e]=2,s[e];if((u=n.propsOptions[0])&&Wi(u,e))return r[e]=3,o[e];if(t!==nr&&Wi(t,e))return r[e]=4,t[e];VK&&(r[e]=0)}}const d=LD[e];let f,g;if(d)return e==="$attrs"&&Fc(n.attrs,"get",""),d(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==nr&&Wi(t,e))return r[e]=4,t[e];if(g=c.config.globalProperties,Wi(g,e))return g[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:o}=n;return rz(s,e)?(s[e]=t,!0):i!==nr&&Wi(i,e)?(i[e]=t,!0):Wi(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:o}},r){let a;return!!t[r]||n!==nr&&Wi(n,r)||rz(e,r)||(a=o[0])&&Wi(a,r)||Wi(i,r)||Wi(LD,r)||Wi(s.config.globalProperties,r)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Wi(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function dl(){return ive().slots}function Ly(){return ive().attrs}function ive(){const n=Qn();return n.setupContext||(n.setupContext=Sve(n))}function Woe(n){return yt(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let VK=!0;function EDe(n){const e=ove(n),t=n.proxy,i=n.ctx;VK=!1,e.beforeCreate&&Goe(e.beforeCreate,n,"bc");const{data:s,computed:o,methods:r,watch:a,provide:c,inject:u,created:d,beforeMount:f,mounted:g,beforeUpdate:p,updated:_,activated:v,deactivated:C,beforeDestroy:y,beforeUnmount:w,destroyed:I,unmounted:L,render:O,renderTracked:A,renderTriggered:N,errorCaptured:D,serverPrefetch:P,expose:F,inheritAttrs:V,components:U,directives:Q,filters:de}=e;if(u&&SDe(u,i,null),r)for(const re in r){const Z=r[re];ln(Z)&&(i[re]=Z.bind(t))}if(s){const re=s.call(t,t);si(re)&&(n.data=Ki(re))}if(VK=!0,o)for(const re in o){const Z=o[re],J=ln(Z)?Z.bind(t,t):ln(Z.get)?Z.get.bind(t,t):ps,ge=!ln(Z)&&ln(Z.set)?Z.set.bind(t):ps,ve=W({get:J,set:ge});Object.defineProperty(i,re,{enumerable:!0,configurable:!0,get:()=>ve.value,set:Le=>ve.value=Le})}if(a)for(const re in a)sve(a[re],i,t,re);if(c){const re=ln(c)?c.call(t):c;Reflect.ownKeys(re).forEach(Z=>{pi(Z,re[Z])})}d&&Goe(d,n,"c");function K(re,Z){yt(Z)?Z.forEach(J=>re(J.bind(t))):Z&&re(Z.bind(t))}if(K(A5,f),K($n,g),K(eve,p),K(s_,_),K(kZ,v),K(Q_e,C),K(bDe,D),K(vDe,A),K(_De,N),K(As,w),K(Cb,L),K(mDe,P),yt(F))if(F.length){const re=n.exposed||(n.exposed={});F.forEach(Z=>{Object.defineProperty(re,Z,{get:()=>t[Z],set:J=>t[Z]=J})})}else n.exposed||(n.exposed={});O&&n.render===ps&&(n.render=O),V!=null&&(n.inheritAttrs=V),U&&(n.components=U),Q&&(n.directives=Q),P&&J_e(n)}function SDe(n,e,t=ps){yt(n)&&(n=UK(n));for(const i in n){const s=n[i];let o;si(s)?"default"in s?o=Kt(s.from||i,s.default,!0):o=Kt(s.from||i):o=Kt(s),Ss(o)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:r=>o.value=r}):e[i]=o}}function Goe(n,e,t){qg(yt(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function sve(n,e,t,i){let s=i.includes(".")?_ve(t,i):()=>t[i];if(sn(n)){const o=e[n];ln(o)&&ht(s,o)}else if(ln(n))ht(s,n.bind(t));else if(si(n))if(yt(n))n.forEach(o=>sve(o,e,t,i));else{const o=ln(n.handler)?n.handler.bind(t):e[n.handler];ln(o)&&ht(s,o,n)}}function ove(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:o,config:{optionMergeStrategies:r}}=n.appContext,a=o.get(e);let c;return a?c=a:!s.length&&!t&&!i?c=e:(c={},s.length&&s.forEach(u=>$4(c,u,r,!0)),$4(c,e,r)),si(e)&&o.set(e,c),c}function $4(n,e,t,i=!1){const{mixins:s,extends:o}=e;o&&$4(n,o,t,!0),s&&s.forEach(r=>$4(n,r,t,!0));for(const r in e)if(!(i&&r==="expose")){const a=wDe[r]||t&&t[r];n[r]=a?a(n[r],e[r]):e[r]}return n}const wDe={data:zoe,props:Koe,emits:Koe,methods:JN,computed:JN,beforeCreate:pu,created:pu,beforeMount:pu,mounted:pu,beforeUpdate:pu,updated:pu,beforeDestroy:pu,beforeUnmount:pu,destroyed:pu,unmounted:pu,activated:pu,deactivated:pu,errorCaptured:pu,serverPrefetch:pu,components:JN,directives:JN,watch:LDe,provide:zoe,inject:IDe};function zoe(n,e){return e?n?function(){return ba(ln(n)?n.call(this,this):n,ln(e)?e.call(this,this):e)}:e:n}function IDe(n,e){return JN(UK(n),UK(e))}function UK(n){if(yt(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function pu(n,e){return n?[...new Set([].concat(n,e))]:e}function JN(n,e){return n?ba(Object.create(null),n,e):e}function Koe(n,e){return n?yt(n)&&yt(e)?[...new Set([...n,...e])]:ba(Object.create(null),Woe(n),Woe(e??{})):e}function LDe(n,e){if(!n)return e;if(!e)return n;const t=ba(Object.create(null),n);for(const i in e)t[i]=pu(n[i],e[i]);return t}function rve(){return{app:null,config:{isNativeTag:TNe,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ODe=0;function RDe(n,e){return function(i,s=null){ln(i)||(i=ba({},i)),s!=null&&!si(s)&&(s=null);const o=rve(),r=new WeakSet,a=[];let c=!1;const u=o.app={_uid:ODe++,_component:i,_props:s,_container:null,_context:o,_instance:null,version:l$e,get config(){return o.config},set config(d){},use(d,...f){return r.has(d)||(d&&ln(d.install)?(r.add(d),d.install(u,...f)):ln(d)&&(r.add(d),d(u,...f))),u},mixin(d){return o.mixins.includes(d)||o.mixins.push(d),u},component(d,f){return f?(o.components[d]=f,u):o.components[d]},directive(d,f){return f?(o.directives[d]=f,u):o.directives[d]},mount(d,f,g){if(!c){const p=u._ceVNode||ce(i,s);return p.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),n(p,d,g),c=!0,u._container=d,d.__vue_app__=u,$5(p.component)}},onUnmount(d){a.push(d)},unmount(){c&&(qg(a,u._instance,16),n(null,u._container),delete u._container.__vue_app__)},provide(d,f){return o.provides[d]=f,u},runWithContext(d){const f=i0;i0=u;try{return d()}finally{i0=f}}};return u}}let i0=null;function pi(n,e){if(xa){let t=xa.provides;const i=xa.parent&&xa.parent.provides;i===t&&(t=xa.provides=Object.create(i)),t[n]=e}}function Kt(n,e,t=!1){const i=xa||ga;if(i||i0){const s=i0?i0._context.provides:i?i.parent==null?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(s&&n in s)return s[n];if(arguments.length>1)return t&&ln(e)?e.call(i&&i.proxy):e}}function MDe(){return!!(xa||ga||i0)}const lve={},ave=()=>Object.create(lve),cve=n=>Object.getPrototypeOf(n)===lve;function kDe(n,e,t,i=!1){const s={},o=ave();n.propsDefaults=Object.create(null),uve(n,e,s,o);for(const r in n.propsOptions[0])r in s||(s[r]=void 0);t?n.props=i?s:IZ(s):n.type.props?n.props=s:n.props=o,n.attrs=o}function ADe(n,e,t,i){const{props:s,attrs:o,vnode:{patchFlag:r}}=n,a=Cs(s),[c]=n.propsOptions;let u=!1;if((i||r>0)&&!(r&16)){if(r&8){const d=n.vnode.dynamicProps;for(let f=0;f<d.length;f++){let g=d[f];if(D5(n.emitsOptions,g))continue;const p=e[g];if(c)if(Wi(o,g))p!==o[g]&&(o[g]=p,u=!0);else{const _=$u(g);s[_]=WK(c,a,_,p,n,!1)}else p!==o[g]&&(o[g]=p,u=!0)}}}else{uve(n,e,s,o)&&(u=!0);let d;for(const f in a)(!e||!Wi(e,f)&&((d=bb(f))===f||!Wi(e,d)))&&(c?t&&(t[f]!==void 0||t[d]!==void 0)&&(s[f]=WK(c,a,f,void 0,n,!0)):delete s[f]);if(o!==a)for(const f in o)(!e||!Wi(e,f))&&(delete o[f],u=!0)}u&&Av(n.attrs,"set","")}function uve(n,e,t,i){const[s,o]=n.propsOptions;let r=!1,a;if(e)for(let c in e){if(yD(c))continue;const u=e[c];let d;s&&Wi(s,d=$u(c))?!o||!o.includes(d)?t[d]=u:(a||(a={}))[d]=u:D5(n.emitsOptions,c)||(!(c in i)||u!==i[c])&&(i[c]=u,r=!0)}if(o){const c=Cs(t),u=a||nr;for(let d=0;d<o.length;d++){const f=o[d];t[f]=WK(s,c,f,u[f],n,!Wi(u,f))}}return r}function WK(n,e,t,i,s,o){const r=n[t];if(r!=null){const a=Wi(r,"default");if(a&&i===void 0){const c=r.default;if(r.type!==Function&&!r.skipFactory&&ln(c)){const{propsDefaults:u}=s;if(t in u)i=u[t];else{const d=BP(s);i=u[t]=c.call(null,e),d()}}else i=c;s.ce&&s.ce._setProp(t,i)}r[0]&&(o&&!a?i=!1:r[1]&&(i===""||i===bb(t))&&(i=!0))}return i}const NDe=new WeakMap;function dve(n,e,t=!1){const i=t?NDe:e.propsCache,s=i.get(n);if(s)return s;const o=n.props,r={},a=[];let c=!1;if(!ln(n)){const d=f=>{c=!0;const[g,p]=dve(f,e,!0);ba(r,g),p&&a.push(...p)};!t&&e.mixins.length&&e.mixins.forEach(d),n.extends&&d(n.extends),n.mixins&&n.mixins.forEach(d)}if(!o&&!c)return si(n)&&i.set(n,Z1),Z1;if(yt(o))for(let d=0;d<o.length;d++){const f=$u(o[d]);joe(f)&&(r[f]=nr)}else if(o)for(const d in o){const f=$u(d);if(joe(f)){const g=o[d],p=r[f]=yt(g)||ln(g)?{type:g}:ba({},g),_=p.type;let v=!1,C=!0;if(yt(_))for(let y=0;y<_.length;++y){const w=_[y],I=ln(w)&&w.name;if(I==="Boolean"){v=!0;break}else I==="String"&&(C=!1)}else v=ln(_)&&_.name==="Boolean";p[0]=v,p[1]=C,(v||Wi(p,"default"))&&a.push(f)}}const u=[r,a];return si(n)&&i.set(n,u),u}function joe(n){return n[0]!=="$"&&!yD(n)}const hve=n=>n[0]==="_"||n==="$stable",DZ=n=>yt(n)?n.map(dm):[dm(n)],DDe=(n,e,t)=>{if(e._n)return e;const i=_e((...s)=>DZ(e(...s)),t);return i._c=!1,i},fve=(n,e,t)=>{const i=n._ctx;for(const s in n){if(hve(s))continue;const o=n[s];if(ln(o))e[s]=DDe(s,o,i);else if(o!=null){const r=DZ(o);e[s]=()=>r}}},gve=(n,e)=>{const t=DZ(e);n.slots.default=()=>t},pve=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},$De=(n,e,t)=>{const i=n.slots=ave();if(n.vnode.shapeFlag&32){const s=e._;s?(pve(i,e,t),t&&g_e(i,"_",s,!0)):fve(e,i)}else e&&gve(n,e)},xDe=(n,e,t)=>{const{vnode:i,slots:s}=n;let o=!0,r=nr;if(i.shapeFlag&32){const a=e._;a?t&&a===1?o=!1:pve(s,e,t):(o=!e.$stable,fve(e,s)),r=e}else e&&(gve(n,e),r={default:1});if(o)for(const a in s)!hve(a)&&r[a]==null&&delete s[a]},vu=qDe;function PDe(n){return FDe(n)}function FDe(n,e){const t=w5();t.__VUE__=!0;const{insert:i,remove:s,patchProp:o,createElement:r,createText:a,createComment:c,setText:u,setElementText:d,parentNode:f,nextSibling:g,setScopeId:p=ps,insertStaticContent:_}=n,v=(ee,ye,Me,et=null,at=null,Ue=null,Se=void 0,Ie=null,Xe=!!ye.dynamicChildren)=>{if(ee===ye)return;ee&&!CS(ee,ye)&&(et=we(ee),Le(ee,at,Ue,!0),ee=null),ye.patchFlag===-2&&(Xe=!1,ye.dynamicChildren=null);const{type:it,ref:Tt,shapeFlag:He}=ye;switch(it){case ww:C(ee,ye,Me,et);break;case fa:y(ee,ye,Me,et);break;case az:ee==null&&w(ye,Me,et,Se);break;case Qt:U(ee,ye,Me,et,at,Ue,Se,Ie,Xe);break;default:He&1?O(ee,ye,Me,et,at,Ue,Se,Ie,Xe):He&6?Q(ee,ye,Me,et,at,Ue,Se,Ie,Xe):(He&64||He&128)&&it.process(ee,ye,Me,et,at,Ue,Se,Ie,Xe,dt)}Tt!=null&&at&&D4(Tt,ee&&ee.ref,Ue,ye||ee,!ye)},C=(ee,ye,Me,et)=>{if(ee==null)i(ye.el=a(ye.children),Me,et);else{const at=ye.el=ee.el;ye.children!==ee.children&&u(at,ye.children)}},y=(ee,ye,Me,et)=>{ee==null?i(ye.el=c(ye.children||""),Me,et):ye.el=ee.el},w=(ee,ye,Me,et)=>{[ee.el,ee.anchor]=_(ee.children,ye,Me,et,ee.el,ee.anchor)},I=({el:ee,anchor:ye},Me,et)=>{let at;for(;ee&&ee!==ye;)at=g(ee),i(ee,Me,et),ee=at;i(ye,Me,et)},L=({el:ee,anchor:ye})=>{let Me;for(;ee&&ee!==ye;)Me=g(ee),s(ee),ee=Me;s(ye)},O=(ee,ye,Me,et,at,Ue,Se,Ie,Xe)=>{ye.type==="svg"?Se="svg":ye.type==="math"&&(Se="mathml"),ee==null?A(ye,Me,et,at,Ue,Se,Ie,Xe):P(ee,ye,at,Ue,Se,Ie,Xe)},A=(ee,ye,Me,et,at,Ue,Se,Ie)=>{let Xe,it;const{props:Tt,shapeFlag:He,transition:ke,dirs:ot}=ee;if(Xe=ee.el=r(ee.type,Ue,Tt&&Tt.is,Tt),He&8?d(Xe,ee.children):He&16&&D(ee.children,Xe,null,et,at,lz(ee,Ue),Se,Ie),ot&&iS(ee,null,et,"created"),N(Xe,ee,ee.scopeId,Se,et),Tt){for(const Gt in Tt)Gt!=="value"&&!yD(Gt)&&o(Xe,Gt,null,Tt[Gt],Ue,et);"value"in Tt&&o(Xe,"value",null,Tt.value,Ue),(it=Tt.onVnodeBeforeMount)&&zp(it,et,ee)}ot&&iS(ee,null,et,"beforeMount");const Ct=BDe(at,ke);Ct&&ke.beforeEnter(Xe),i(Xe,ye,Me),((it=Tt&&Tt.onVnodeMounted)||Ct||ot)&&vu(()=>{it&&zp(it,et,ee),Ct&&ke.enter(Xe),ot&&iS(ee,null,et,"mounted")},at)},N=(ee,ye,Me,et,at)=>{if(Me&&p(ee,Me),et)for(let Ue=0;Ue<et.length;Ue++)p(ee,et[Ue]);if(at){let Ue=at.subTree;if(ye===Ue||bve(Ue.type)&&(Ue.ssContent===ye||Ue.ssFallback===ye)){const Se=at.vnode;N(ee,Se,Se.scopeId,Se.slotScopeIds,at.parent)}}},D=(ee,ye,Me,et,at,Ue,Se,Ie,Xe=0)=>{for(let it=Xe;it<ee.length;it++){const Tt=ee[it]=Ie?ZT(ee[it]):dm(ee[it]);v(null,Tt,ye,Me,et,at,Ue,Se,Ie)}},P=(ee,ye,Me,et,at,Ue,Se)=>{const Ie=ye.el=ee.el;let{patchFlag:Xe,dynamicChildren:it,dirs:Tt}=ye;Xe|=ee.patchFlag&16;const He=ee.props||nr,ke=ye.props||nr;let ot;if(Me&&sS(Me,!1),(ot=ke.onVnodeBeforeUpdate)&&zp(ot,Me,ye,ee),Tt&&iS(ye,ee,Me,"beforeUpdate"),Me&&sS(Me,!0),(He.innerHTML&&ke.innerHTML==null||He.textContent&&ke.textContent==null)&&d(Ie,""),it?F(ee.dynamicChildren,it,Ie,Me,et,lz(ye,at),Ue):Se||Z(ee,ye,Ie,null,Me,et,lz(ye,at),Ue,!1),Xe>0){if(Xe&16)V(Ie,He,ke,Me,at);else if(Xe&2&&He.class!==ke.class&&o(Ie,"class",null,ke.class,at),Xe&4&&o(Ie,"style",He.style,ke.style,at),Xe&8){const Ct=ye.dynamicProps;for(let Gt=0;Gt<Ct.length;Gt++){const Ot=Ct[Gt],En=He[Ot],fe=ke[Ot];(fe!==En||Ot==="value")&&o(Ie,Ot,En,fe,at,Me)}}Xe&1&&ee.children!==ye.children&&d(Ie,ye.children)}else!Se&&it==null&&V(Ie,He,ke,Me,at);((ot=ke.onVnodeUpdated)||Tt)&&vu(()=>{ot&&zp(ot,Me,ye,ee),Tt&&iS(ye,ee,Me,"updated")},et)},F=(ee,ye,Me,et,at,Ue,Se)=>{for(let Ie=0;Ie<ye.length;Ie++){const Xe=ee[Ie],it=ye[Ie],Tt=Xe.el&&(Xe.type===Qt||!CS(Xe,it)||Xe.shapeFlag&70)?f(Xe.el):Me;v(Xe,it,Tt,null,et,at,Ue,Se,!0)}},V=(ee,ye,Me,et,at)=>{if(ye!==Me){if(ye!==nr)for(const Ue in ye)!yD(Ue)&&!(Ue in Me)&&o(ee,Ue,ye[Ue],null,at,et);for(const Ue in Me){if(yD(Ue))continue;const Se=Me[Ue],Ie=ye[Ue];Se!==Ie&&Ue!=="value"&&o(ee,Ue,Ie,Se,at,et)}"value"in Me&&o(ee,"value",ye.value,Me.value,at)}},U=(ee,ye,Me,et,at,Ue,Se,Ie,Xe)=>{const it=ye.el=ee?ee.el:a(""),Tt=ye.anchor=ee?ee.anchor:a("");let{patchFlag:He,dynamicChildren:ke,slotScopeIds:ot}=ye;ot&&(Ie=Ie?Ie.concat(ot):ot),ee==null?(i(it,Me,et),i(Tt,Me,et),D(ye.children||[],Me,Tt,at,Ue,Se,Ie,Xe)):He>0&&He&64&&ke&&ee.dynamicChildren?(F(ee.dynamicChildren,ke,Me,at,Ue,Se,Ie),(ye.key!=null||at&&ye===at.subTree)&&$Z(ee,ye,!0)):Z(ee,ye,Me,Tt,at,Ue,Se,Ie,Xe)},Q=(ee,ye,Me,et,at,Ue,Se,Ie,Xe)=>{ye.slotScopeIds=Ie,ee==null?ye.shapeFlag&512?at.ctx.activate(ye,Me,et,Se,Xe):de(ye,Me,et,at,Ue,Se,Xe):q(ee,ye,Xe)},de=(ee,ye,Me,et,at,Ue,Se)=>{const Ie=ee.component=t$e(ee,et,at);if(M5(ee)&&(Ie.ctx.renderer=dt),n$e(Ie,!1,Se),Ie.asyncDep){if(at&&at.registerDep(Ie,K,Se),!ee.el){const Xe=Ie.subTree=ce(fa);y(null,Xe,ye,Me)}}else K(Ie,ee,ye,Me,at,Ue,Se)},q=(ee,ye,Me)=>{const et=ye.component=ee.component;if(XDe(ee,ye,Me))if(et.asyncDep&&!et.asyncResolved){re(et,ye,Me);return}else et.next=ye,et.update();else ye.el=ee.el,et.vnode=ye},K=(ee,ye,Me,et,at,Ue,Se)=>{const Ie=()=>{if(ee.isMounted){let{next:He,bu:ke,u:ot,parent:Ct,vnode:Gt}=ee;{const le=mve(ee);if(le){He&&(He.el=Gt.el,re(ee,He,Se)),le.asyncDep.then(()=>{ee.isUnmounted||Ie()});return}}let Ot=He,En;sS(ee,!1),He?(He.el=Gt.el,re(ee,He,Se)):He=Gt,ke&&VV(ke),(En=He.props&&He.props.onVnodeBeforeUpdate)&&zp(En,Ct,He,Gt),sS(ee,!0);const fe=Yoe(ee),se=ee.subTree;ee.subTree=fe,v(se,fe,f(se.el),we(se),ee,at,Ue),He.el=fe.el,Ot===null&&YDe(ee,fe.el),ot&&vu(ot,at),(En=He.props&&He.props.onVnodeUpdated)&&vu(()=>zp(En,Ct,He,Gt),at)}else{let He;const{el:ke,props:ot}=ye,{bm:Ct,m:Gt,parent:Ot,root:En,type:fe}=ee,se=nO(ye);sS(ee,!1),Ct&&VV(Ct),!se&&(He=ot&&ot.onVnodeBeforeMount)&&zp(He,Ot,ye),sS(ee,!0);{En.ce&&En.ce._injectChildStyle(fe);const le=ee.subTree=Yoe(ee);v(null,le,Me,et,ee,at,Ue),ye.el=le.el}if(Gt&&vu(Gt,at),!se&&(He=ot&&ot.onVnodeMounted)){const le=ye;vu(()=>zp(He,Ot,le),at)}(ye.shapeFlag&256||Ot&&nO(Ot.vnode)&&Ot.vnode.shapeFlag&256)&&ee.a&&vu(ee.a,at),ee.isMounted=!0,ye=Me=et=null}};ee.scope.on();const Xe=ee.effect=new T_e(Ie);ee.scope.off();const it=ee.update=Xe.run.bind(Xe),Tt=ee.job=Xe.runIfDirty.bind(Xe);Tt.i=ee,Tt.id=ee.uid,Xe.scheduler=()=>RZ(Tt),sS(ee,!0),it()},re=(ee,ye,Me)=>{ye.component=ee;const et=ee.vnode.props;ee.vnode=ye,ee.next=null,ADe(ee,ye.props,et,Me),xDe(ee,ye.children,Me),wy(),Poe(ee),Iy()},Z=(ee,ye,Me,et,at,Ue,Se,Ie,Xe=!1)=>{const it=ee&&ee.children,Tt=ee?ee.shapeFlag:0,He=ye.children,{patchFlag:ke,shapeFlag:ot}=ye;if(ke>0){if(ke&128){ge(it,He,Me,et,at,Ue,Se,Ie,Xe);return}else if(ke&256){J(it,He,Me,et,at,Ue,Se,Ie,Xe);return}}ot&8?(Tt&16&&Re(it,at,Ue),He!==it&&d(Me,He)):Tt&16?ot&16?ge(it,He,Me,et,at,Ue,Se,Ie,Xe):Re(it,at,Ue,!0):(Tt&8&&d(Me,""),ot&16&&D(He,Me,et,at,Ue,Se,Ie,Xe))},J=(ee,ye,Me,et,at,Ue,Se,Ie,Xe)=>{ee=ee||Z1,ye=ye||Z1;const it=ee.length,Tt=ye.length,He=Math.min(it,Tt);let ke;for(ke=0;ke<He;ke++){const ot=ye[ke]=Xe?ZT(ye[ke]):dm(ye[ke]);v(ee[ke],ot,Me,null,at,Ue,Se,Ie,Xe)}it>Tt?Re(ee,at,Ue,!0,!1,He):D(ye,Me,et,at,Ue,Se,Ie,Xe,He)},ge=(ee,ye,Me,et,at,Ue,Se,Ie,Xe)=>{let it=0;const Tt=ye.length;let He=ee.length-1,ke=Tt-1;for(;it<=He&&it<=ke;){const ot=ee[it],Ct=ye[it]=Xe?ZT(ye[it]):dm(ye[it]);if(CS(ot,Ct))v(ot,Ct,Me,null,at,Ue,Se,Ie,Xe);else break;it++}for(;it<=He&&it<=ke;){const ot=ee[He],Ct=ye[ke]=Xe?ZT(ye[ke]):dm(ye[ke]);if(CS(ot,Ct))v(ot,Ct,Me,null,at,Ue,Se,Ie,Xe);else break;He--,ke--}if(it>He){if(it<=ke){const ot=ke+1,Ct=ot<Tt?ye[ot].el:et;for(;it<=ke;)v(null,ye[it]=Xe?ZT(ye[it]):dm(ye[it]),Me,Ct,at,Ue,Se,Ie,Xe),it++}}else if(it>ke)for(;it<=He;)Le(ee[it],at,Ue,!0),it++;else{const ot=it,Ct=it,Gt=new Map;for(it=Ct;it<=ke;it++){const je=ye[it]=Xe?ZT(ye[it]):dm(ye[it]);je.key!=null&&Gt.set(je.key,it)}let Ot,En=0;const fe=ke-Ct+1;let se=!1,le=0;const Fe=new Array(fe);for(it=0;it<fe;it++)Fe[it]=0;for(it=ot;it<=He;it++){const je=ee[it];if(En>=fe){Le(je,at,Ue,!0);continue}let Ae;if(je.key!=null)Ae=Gt.get(je.key);else for(Ot=Ct;Ot<=ke;Ot++)if(Fe[Ot-Ct]===0&&CS(je,ye[Ot])){Ae=Ot;break}Ae===void 0?Le(je,at,Ue,!0):(Fe[Ae-Ct]=it+1,Ae>=le?le=Ae:se=!0,v(je,ye[Ae],Me,null,at,Ue,Se,Ie,Xe),En++)}const pe=se?HDe(Fe):Z1;for(Ot=pe.length-1,it=fe-1;it>=0;it--){const je=Ct+it,Ae=ye[je],Et=je+1<Tt?ye[je+1].el:et;Fe[it]===0?v(null,Ae,Me,Et,at,Ue,Se,Ie,Xe):se&&(Ot<0||it!==pe[Ot]?ve(Ae,Me,Et,2):Ot--)}}},ve=(ee,ye,Me,et,at=null)=>{const{el:Ue,type:Se,transition:Ie,children:Xe,shapeFlag:it}=ee;if(it&6){ve(ee.component.subTree,ye,Me,et);return}if(it&128){ee.suspense.move(ye,Me,et);return}if(it&64){Se.move(ee,ye,Me,dt);return}if(Se===Qt){i(Ue,ye,Me);for(let He=0;He<Xe.length;He++)ve(Xe[He],ye,Me,et);i(ee.anchor,ye,Me);return}if(Se===az){I(ee,ye,Me);return}if(et!==2&&it&1&&Ie)if(et===0)Ie.beforeEnter(Ue),i(Ue,ye,Me),vu(()=>Ie.enter(Ue),at);else{const{leave:He,delayLeave:ke,afterLeave:ot}=Ie,Ct=()=>i(Ue,ye,Me),Gt=()=>{He(Ue,()=>{Ct(),ot&&ot()})};ke?ke(Ue,Ct,Gt):Gt()}else i(Ue,ye,Me)},Le=(ee,ye,Me,et=!1,at=!1)=>{const{type:Ue,props:Se,ref:Ie,children:Xe,dynamicChildren:it,shapeFlag:Tt,patchFlag:He,dirs:ke,cacheIndex:ot}=ee;if(He===-2&&(at=!1),Ie!=null&&D4(Ie,null,Me,ee,!0),ot!=null&&(ye.renderCache[ot]=void 0),Tt&256){ye.ctx.deactivate(ee);return}const Ct=Tt&1&&ke,Gt=!nO(ee);let Ot;if(Gt&&(Ot=Se&&Se.onVnodeBeforeUnmount)&&zp(Ot,ye,ee),Tt&6)qe(ee.component,Me,et);else{if(Tt&128){ee.suspense.unmount(Me,et);return}Ct&&iS(ee,null,ye,"beforeUnmount"),Tt&64?ee.type.remove(ee,ye,Me,dt,et):it&&!it.hasOnce&&(Ue!==Qt||He>0&&He&64)?Re(it,ye,Me,!1,!0):(Ue===Qt&&He&384||!at&&Tt&16)&&Re(Xe,ye,Me),et&&Ee(ee)}(Gt&&(Ot=Se&&Se.onVnodeUnmounted)||Ct)&&vu(()=>{Ot&&zp(Ot,ye,ee),Ct&&iS(ee,null,ye,"unmounted")},Me)},Ee=ee=>{const{type:ye,el:Me,anchor:et,transition:at}=ee;if(ye===Qt){Ne(Me,et);return}if(ye===az){L(ee);return}const Ue=()=>{s(Me),at&&!at.persisted&&at.afterLeave&&at.afterLeave()};if(ee.shapeFlag&1&&at&&!at.persisted){const{leave:Se,delayLeave:Ie}=at,Xe=()=>Se(Me,Ue);Ie?Ie(ee.el,Ue,Xe):Xe()}else Ue()},Ne=(ee,ye)=>{let Me;for(;ee!==ye;)Me=g(ee),s(ee),ee=Me;s(ye)},qe=(ee,ye,Me)=>{const{bum:et,scope:at,job:Ue,subTree:Se,um:Ie,m:Xe,a:it}=ee;Xoe(Xe),Xoe(it),et&&VV(et),at.stop(),Ue&&(Ue.flags|=8,Le(Se,ee,ye,Me)),Ie&&vu(Ie,ye),vu(()=>{ee.isUnmounted=!0},ye),ye&&ye.pendingBranch&&!ye.isUnmounted&&ee.asyncDep&&!ee.asyncResolved&&ee.suspenseId===ye.pendingId&&(ye.deps--,ye.deps===0&&ye.resolve())},Re=(ee,ye,Me,et=!1,at=!1,Ue=0)=>{for(let Se=Ue;Se<ee.length;Se++)Le(ee[Se],ye,Me,et,at)},we=ee=>{if(ee.shapeFlag&6)return we(ee.component.subTree);if(ee.shapeFlag&128)return ee.suspense.next();const ye=g(ee.anchor||ee.el),Me=ye&&ye[U_e];return Me?g(Me):ye};let Ve=!1;const Ge=(ee,ye,Me)=>{ee==null?ye._vnode&&Le(ye._vnode,null,null,!0):v(ye._vnode||null,ee,ye,null,null,null,Me),ye._vnode=ee,Ve||(Ve=!0,Poe(),B_e(),Ve=!1)},dt={p:v,um:Le,m:ve,r:Ee,mt:de,mc:D,pc:Z,pbc:F,n:we,o:n};return{render:Ge,hydrate:void 0,createApp:RDe(Ge)}}function lz({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function sS({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function BDe(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function $Z(n,e,t=!1){const i=n.children,s=e.children;if(yt(i)&&yt(s))for(let o=0;o<i.length;o++){const r=i[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=ZT(s[o]),a.el=r.el),!t&&a.patchFlag!==-2&&$Z(r,a)),a.type===ww&&(a.el=r.el)}}function HDe(n){const e=n.slice(),t=[0];let i,s,o,r,a;const c=n.length;for(i=0;i<c;i++){const u=n[i];if(u!==0){if(s=t[t.length-1],n[s]<u){e[i]=s,t.push(i);continue}for(o=0,r=t.length-1;o<r;)a=o+r>>1,n[t[a]]<u?o=a+1:r=a;u<n[t[o]]&&(o>0&&(e[i]=t[o-1]),t[o]=i)}}for(o=t.length,r=t[o-1];o-- >0;)t[o]=r,r=e[r];return t}function mve(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:mve(e)}function Xoe(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}const VDe=Symbol.for("v-scx"),UDe=()=>Kt(VDe);function Sl(n,e){return xZ(n,null,e)}function ht(n,e,t){return xZ(n,e,t)}function xZ(n,e,t=nr){const{immediate:i,deep:s,flush:o,once:r}=t,a=ba({},t),c=e&&i||!e&&o!=="post";let u;if(k$){if(o==="sync"){const p=UDe();u=p.__watcherHandles||(p.__watcherHandles=[])}else if(!c){const p=()=>{};return p.stop=ps,p.resume=ps,p.pause=ps,p}}const d=xa;a.call=(p,_,v)=>qg(p,d,_,v);let f=!1;o==="post"?a.scheduler=p=>{vu(p,d&&d.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(p,_)=>{_?p():RZ(p)}),a.augmentJob=p=>{e&&(p.flags|=4),f&&(p.flags|=2,d&&(p.id=d.uid,p.i=d))};const g=lDe(n,e,a);return k$&&(u?u.push(g):c&&g()),g}function WDe(n,e,t){const i=this.proxy,s=sn(n)?n.includes(".")?_ve(i,n):()=>i[n]:n.bind(i,i);let o;ln(e)?o=e:(o=e.handler,t=e);const r=BP(this),a=xZ(s,o.bind(i),t);return r(),a}function _ve(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s<t.length&&i;s++)i=i[t[s]];return i}}const GDe=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${$u(e)}Modifiers`]||n[`${bb(e)}Modifiers`];function zDe(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||nr;let s=t;const o=e.startsWith("update:"),r=o&&GDe(i,e.slice(7));r&&(r.trim&&(s=t.map(d=>sn(d)?d.trim():d)),r.number&&(s=t.map(DK)));let a,c=i[a=ED(e)]||i[a=ED($u(e))];!c&&o&&(c=i[a=ED(bb(e))]),c&&qg(c,n,6,s);const u=i[a+"Once"];if(u){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,qg(u,n,6,s)}}function vve(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const o=n.emits;let r={},a=!1;if(!ln(n)){const c=u=>{const d=vve(u,e,!0);d&&(a=!0,ba(r,d))};!t&&e.mixins.length&&e.mixins.forEach(c),n.extends&&c(n.extends),n.mixins&&n.mixins.forEach(c)}return!o&&!a?(si(n)&&i.set(n,null),null):(yt(o)?o.forEach(c=>r[c]=null):ba(r,o),si(n)&&i.set(n,r),r)}function D5(n,e){return!n||!y5(e)?!1:(e=e.slice(2).replace(/Once$/,""),Wi(n,e[0].toLowerCase()+e.slice(1))||Wi(n,bb(e))||Wi(n,e))}function Yoe(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[o],slots:r,attrs:a,emit:c,render:u,renderCache:d,props:f,data:g,setupState:p,ctx:_,inheritAttrs:v}=n,C=N4(n);let y,w;try{if(t.shapeFlag&4){const L=s||i,O=L;y=dm(u.call(O,L,d,f,p,g,_)),w=a}else{const L=e;y=dm(L.length>1?L(f,{attrs:a,slots:r,emit:c}):L(f,null)),w=e.props?a:KDe(a)}}catch(L){OD.length=0,R5(L,n,1),y=ce(fa)}let I=y;if(w&&v!==!1){const L=Object.keys(w),{shapeFlag:O}=I;L.length&&O&7&&(o&&L.some(_Z)&&(w=jDe(w,o)),I=ib(I,w,!1,!0))}return t.dirs&&(I=ib(I,null,!1,!0),I.dirs=I.dirs?I.dirs.concat(t.dirs):t.dirs),t.transition&&M0(I,t.transition),y=I,N4(C),y}const KDe=n=>{let e;for(const t in n)(t==="class"||t==="style"||y5(t))&&((e||(e={}))[t]=n[t]);return e},jDe=(n,e)=>{const t={};for(const i in n)(!_Z(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function XDe(n,e,t){const{props:i,children:s,component:o}=n,{props:r,children:a,patchFlag:c}=e,u=o.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return i?qoe(i,r,u):!!r;if(c&8){const d=e.dynamicProps;for(let f=0;f<d.length;f++){const g=d[f];if(r[g]!==i[g]&&!D5(u,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:i===r?!1:i?r?qoe(i,r,u):!0:!!r;return!1}function qoe(n,e,t){const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!0;for(let s=0;s<i.length;s++){const o=i[s];if(e[o]!==n[o]&&!D5(t,o))return!0}return!1}function YDe({vnode:n,parent:e},t){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===n&&(i.el=n.el),i===n)(n=e.vnode).el=t,e=e.parent;else break}}const bve=n=>n.__isSuspense;function qDe(n,e){e&&e.pendingBranch?yt(n)?e.effects.push(...n):e.effects.push(n):uDe(n)}const Qt=Symbol.for("v-fgt"),ww=Symbol.for("v-txt"),fa=Symbol.for("v-cmt"),az=Symbol.for("v-stc"),OD=[];let ch=null;function G(n=!1){OD.push(ch=n?null:[])}function JDe(){OD.pop(),ch=OD[OD.length-1]||null}let M$=1;function Joe(n,e=!1){M$+=n,n<0&&ch&&e&&(ch.hasOnce=!0)}function Tve(n){return n.dynamicChildren=M$>0?ch||Z1:null,JDe(),M$>0&&ch&&ch.push(n),n}function he(n,e,t,i,s,o){return Tve(oe(n,e,t,i,s,o,!0))}function nt(n,e,t,i,s){return Tve(ce(n,e,t,i,s,!0))}function Oo(n){return n?n.__v_isVNode===!0:!1}function CS(n,e){return n.type===e.type&&n.key===e.key}const Cve=({key:n})=>n??null,WV=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?sn(n)||Ss(n)||ln(n)?{i:ga,r:n,k:e,f:!!t}:n:null);function oe(n,e=null,t=null,i=0,s=null,o=n===Qt?0:1,r=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Cve(e),ref:e&&WV(e),scopeId:V_e,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:ga};return a?(PZ(c,t),o&128&&n.normalize(c)):t&&(c.shapeFlag|=sn(t)?8:16),M$>0&&!r&&ch&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&ch.push(c),c}const ce=QDe;function QDe(n,e=null,t=null,i=0,s=null,o=!1){if((!n||n===tve)&&(n=fa),Oo(n)){const a=ib(n,e,!0);return t&&PZ(a,t),M$>0&&!o&&ch&&(a.shapeFlag&6?ch[ch.indexOf(n)]=a:ch.push(a)),a.patchFlag=-2,a}if(r$e(n)&&(n=n.__vccOpts),e){e=nb(e);let{class:a,style:c}=e;a&&!sn(a)&&(e.class=Y(a)),si(c)&&(OZ(c)&&!yt(c)&&(c=ba({},c)),e.style=on(c))}const r=sn(n)?1:bve(n)?128:W_e(n)?64:si(n)?4:ln(n)?2:0;return oe(n,e,t,i,s,r,o,!0)}function nb(n){return n?OZ(n)||cve(n)?ba({},n):n:null}function ib(n,e,t=!1,i=!1){const{props:s,ref:o,patchFlag:r,children:a,transition:c}=n,u=e?hi(s||{},e):s,d={__v_isVNode:!0,__v_skip:!0,type:n.type,props:u,key:u&&Cve(u),ref:e&&e.ref?t&&o?yt(o)?o.concat(WV(e)):[o,WV(e)]:WV(e):o,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Qt?r===-1?16:r|16:r,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ib(n.ssContent),ssFallback:n.ssFallback&&ib(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&i&&M0(d,c.clone(d)),d}function mn(n=" ",e=0){return ce(ww,null,n,e)}function Qe(n="",e=!1){return e?(G(),nt(fa,null,n)):ce(fa,null,n)}function dm(n){return n==null||typeof n=="boolean"?ce(fa):yt(n)?ce(Qt,null,n.slice()):Oo(n)?ZT(n):ce(ww,null,String(n))}function ZT(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:ib(n)}function PZ(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(yt(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),PZ(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!cve(e)?e._ctx=ga:s===3&&ga&&(ga.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else ln(e)?(e={default:e,_ctx:ga},t=32):(e=String(e),i&64?(t=16,e=[mn(e)]):t=8);n.children=e,n.shapeFlag|=t}function hi(...n){const e={};for(let t=0;t<n.length;t++){const i=n[t];for(const s in i)if(s==="class")e.class!==i.class&&(e.class=Y([e.class,i.class]));else if(s==="style")e.style=on([e.style,i.style]);else if(y5(s)){const o=e[s],r=i[s];r&&o!==r&&!(yt(o)&&o.includes(r))&&(e[s]=o?[].concat(o,r):r)}else s!==""&&(e[s]=i[s])}return e}function zp(n,e,t,i=null){qg(n,e,7,[t,i])}const ZDe=rve();let e$e=0;function t$e(n,e,t){const i=n.type,s=(e?e.appContext:n.appContext)||ZDe,o={uid:e$e++,vnode:n,type:i,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new b_e(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(s.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:dve(i,s),emitsOptions:vve(i,s),emit:null,emitted:null,propsDefaults:nr,inheritAttrs:i.inheritAttrs,ctx:nr,data:nr,props:nr,attrs:nr,slots:nr,refs:nr,setupState:nr,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=e?e.root:o,o.emit=zDe.bind(null,o),n.ce&&n.ce(o),o}let xa=null;const Qn=()=>xa||ga;let x4,GK;{const n=w5(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),o=>{s.length>1?s.forEach(r=>r(o)):s[0](o)}};x4=e("__VUE_INSTANCE_SETTERS__",t=>xa=t),GK=e("__VUE_SSR_SETTERS__",t=>k$=t)}const BP=n=>{const e=xa;return x4(n),n.scope.on(),()=>{n.scope.off(),x4(e)}},Qoe=()=>{xa&&xa.scope.off(),x4(null)};function yve(n){return n.vnode.shapeFlag&4}let k$=!1;function n$e(n,e=!1,t=!1){e&&GK(e);const{props:i,children:s}=n.vnode,o=yve(n);kDe(n,i,o,e),$De(n,s,t);const r=o?i$e(n,e):void 0;return e&&GK(!1),r}function i$e(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,yDe);const{setup:i}=t;if(i){wy();const s=n.setupContext=i.length>1?Sve(n):null,o=BP(n),r=FP(i,n,0,[n.props,s]),a=S$(r);if(Iy(),o(),(a||n.sp)&&!nO(n)&&J_e(n),a){if(r.then(Qoe,Qoe),e)return r.then(c=>{Zoe(n,c)}).catch(c=>{R5(c,n,0)});n.asyncDep=r}else Zoe(n,r)}else Eve(n)}function Zoe(n,e,t){ln(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:si(e)&&(n.setupState=$_e(e)),Eve(n)}function Eve(n,e,t){const i=n.type;n.render||(n.render=i.render||ps);{const s=BP(n);wy();try{EDe(n)}finally{Iy(),s()}}}const s$e={get(n,e){return Fc(n,"get",""),n[e]}};function Sve(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,s$e),slots:n.slots,emit:n.emit,expose:e}}function $5(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy($_e(Nm(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in LD)return LD[t](n)},has(e,t){return t in e||t in LD}})):n.proxy}function o$e(n,e=!0){return ln(n)?n.displayName||n.name:n.name||e&&n.__name}function r$e(n){return ln(n)&&"__vccOpts"in n}const W=(n,e)=>oDe(n,e,k$);function hn(n,e,t){const i=arguments.length;return i===2?si(e)&&!yt(e)?Oo(e)?ce(n,null,[e]):ce(n,e):ce(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Oo(t)&&(t=[t]),ce(n,e,t))}const l$e="3.5.13",a$e=ps;/**
- * @vue/runtime-dom v3.5.13
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/let zK;const ere=typeof window<"u"&&window.trustedTypes;if(ere)try{zK=ere.createPolicy("vue",{createHTML:n=>n})}catch{}const wve=zK?n=>zK.createHTML(n):n=>n,c$e="http://www.w3.org/2000/svg",u$e="http://www.w3.org/1998/Math/MathML",_v=typeof document<"u"?document:null,tre=_v&&_v.createElement("template"),d$e={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?_v.createElementNS(c$e,n):e==="mathml"?_v.createElementNS(u$e,n):t?_v.createElement(n,{is:t}):_v.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>_v.createTextNode(n),createComment:n=>_v.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>_v.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,o){const r=t?t.previousSibling:e.lastChild;if(s&&(s===o||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===o||!(s=s.nextSibling)););else{tre.innerHTML=wve(i==="svg"?`<svg>${n}</svg>`:i==="mathml"?`<math>${n}</math>`:n);const a=tre.content;if(i==="svg"||i==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[r?r.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},kT="transition",pN="animation",DO=Symbol("_vtc"),Ive={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Lve=ba({},j_e,Ive),h$e=n=>(n.displayName="Transition",n.props=Lve,n),Ta=h$e((n,{slots:e})=>hn(gDe,Ove(n),e)),oS=(n,e=[])=>{yt(n)?n.forEach(t=>t(...e)):n&&n(...e)},nre=n=>n?yt(n)?n.some(e=>e.length>1):n.length>1:!1;function Ove(n){const e={};for(const U in n)U in Ive||(e[U]=n[U]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:o=`${t}-enter-from`,enterActiveClass:r=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=o,appearActiveClass:u=r,appearToClass:d=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:g=`${t}-leave-active`,leaveToClass:p=`${t}-leave-to`}=n,_=f$e(s),v=_&&_[0],C=_&&_[1],{onBeforeEnter:y,onEnter:w,onEnterCancelled:I,onLeave:L,onLeaveCancelled:O,onBeforeAppear:A=y,onAppear:N=w,onAppearCancelled:D=I}=e,P=(U,Q,de,q)=>{U._enterCancelled=q,VT(U,Q?d:a),VT(U,Q?u:r),de&&de()},F=(U,Q)=>{U._isLeaving=!1,VT(U,f),VT(U,p),VT(U,g),Q&&Q()},V=U=>(Q,de)=>{const q=U?N:w,K=()=>P(Q,U,de);oS(q,[Q,K]),ire(()=>{VT(Q,U?c:o),nm(Q,U?d:a),nre(q)||sre(Q,i,v,K)})};return ba(e,{onBeforeEnter(U){oS(y,[U]),nm(U,o),nm(U,r)},onBeforeAppear(U){oS(A,[U]),nm(U,c),nm(U,u)},onEnter:V(!1),onAppear:V(!0),onLeave(U,Q){U._isLeaving=!0;const de=()=>F(U,Q);nm(U,f),U._enterCancelled?(nm(U,g),KK()):(KK(),nm(U,g)),ire(()=>{U._isLeaving&&(VT(U,f),nm(U,p),nre(L)||sre(U,i,C,de))}),oS(L,[U,de])},onEnterCancelled(U){P(U,!1,void 0,!0),oS(I,[U])},onAppearCancelled(U){P(U,!0,void 0,!0),oS(D,[U])},onLeaveCancelled(U){F(U),oS(O,[U])}})}function f$e(n){if(n==null)return null;if(si(n))return[cz(n.enter),cz(n.leave)];{const e=cz(n);return[e,e]}}function cz(n){return wNe(n)}function nm(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[DO]||(n[DO]=new Set)).add(e)}function VT(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[DO];t&&(t.delete(e),t.size||(n[DO]=void 0))}function ire(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let g$e=0;function sre(n,e,t,i){const s=n._endId=++g$e,o=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(o,t);const{type:r,timeout:a,propCount:c}=Rve(n,e);if(!r)return i();const u=r+"end";let d=0;const f=()=>{n.removeEventListener(u,g),o()},g=p=>{p.target===n&&++d>=c&&f()};setTimeout(()=>{d<c&&f()},a+1),n.addEventListener(u,g)}function Rve(n,e){const t=window.getComputedStyle(n),i=_=>(t[_]||"").split(", "),s=i(`${kT}Delay`),o=i(`${kT}Duration`),r=ore(s,o),a=i(`${pN}Delay`),c=i(`${pN}Duration`),u=ore(a,c);let d=null,f=0,g=0;e===kT?r>0&&(d=kT,f=r,g=o.length):e===pN?u>0&&(d=pN,f=u,g=c.length):(f=Math.max(r,u),d=f>0?r>u?kT:pN:null,g=d?d===kT?o.length:c.length:0);const p=d===kT&&/\b(transform|all)(,|$)/.test(i(`${kT}Property`).toString());return{type:d,timeout:f,propCount:g,hasTransform:p}}function ore(n,e){for(;n.length<e.length;)n=n.concat(n);return Math.max(...e.map((t,i)=>rre(t)+rre(n[i])))}function rre(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function KK(){return document.body.offsetHeight}function p$e(n,e,t){const i=n[DO];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const P4=Symbol("_vod"),Mve=Symbol("_vsh"),Gi={beforeMount(n,{value:e},{transition:t}){n[P4]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):mN(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(n),mN(n,!0),i.enter(n)):i.leave(n,()=>{mN(n,!1)}):mN(n,e))},beforeUnmount(n,{value:e}){mN(n,e)}};function mN(n,e){n.style.display=e?n[P4]:"none",n[Mve]=!e}const m$e=Symbol(""),_$e=/(^|;)\s*display\s*:/;function v$e(n,e,t){const i=n.style,s=sn(t);let o=!1;if(t&&!s){if(e)if(sn(e))for(const r of e.split(";")){const a=r.slice(0,r.indexOf(":")).trim();t[a]==null&&GV(i,a,"")}else for(const r in e)t[r]==null&&GV(i,r,"");for(const r in t)r==="display"&&(o=!0),GV(i,r,t[r])}else if(s){if(e!==t){const r=i[m$e];r&&(t+=";"+r),i.cssText=t,o=_$e.test(t)}}else e&&n.removeAttribute("style");P4 in n&&(n[P4]=o?i.display:"",n[Mve]&&(i.display="none"))}const lre=/\s*!important$/;function GV(n,e,t){if(yt(t))t.forEach(i=>GV(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=b$e(n,e);lre.test(t)?n.setProperty(bb(i),t.replace(lre,""),"important"):n[i]=t}}const are=["Webkit","Moz","ms"],uz={};function b$e(n,e){const t=uz[e];if(t)return t;let i=$u(e);if(i!=="filter"&&i in n)return uz[e]=i;i=PP(i);for(let s=0;s<are.length;s++){const o=are[s]+i;if(o in n)return uz[e]=o}return e}const cre="http://www.w3.org/1999/xlink";function ure(n,e,t,i,s,o=kNe(e)){i&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(cre,e.slice(6,e.length)):n.setAttributeNS(cre,e,t):t==null||o&&!p_e(t)?n.removeAttribute(e):n.setAttribute(e,o?"":Yg(t)?String(t):t)}function dre(n,e,t,i,s){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?wve(t):t);return}const o=n.tagName;if(e==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?n.getAttribute("value")||"":n.value,c=t==null?n.type==="checkbox"?"on":"":String(t);(a!==c||!("_value"in n))&&(n.value=c),t==null&&n.removeAttribute(e),n._value=t;return}let r=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=p_e(t):t==null&&a==="string"?(t="",r=!0):a==="number"&&(t=0,r=!0)}try{n[e]=t}catch{}r&&n.removeAttribute(s||e)}function oC(n,e,t,i){n.addEventListener(e,t,i)}function T$e(n,e,t,i){n.removeEventListener(e,t,i)}const hre=Symbol("_vei");function C$e(n,e,t,i,s=null){const o=n[hre]||(n[hre]={}),r=o[e];if(i&&r)r.value=i;else{const[a,c]=y$e(e);if(i){const u=o[e]=w$e(i,s);oC(n,a,u,c)}else r&&(T$e(n,a,r,c),o[e]=void 0)}}const fre=/(?:Once|Passive|Capture)$/;function y$e(n){let e;if(fre.test(n)){e={};let i;for(;i=n.match(fre);)n=n.slice(0,n.length-i[0].length),e[i[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):bb(n.slice(2)),e]}let dz=0;const E$e=Promise.resolve(),S$e=()=>dz||(E$e.then(()=>dz=0),dz=Date.now());function w$e(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;qg(I$e(i,t.value),e,5,[i])};return t.value=n,t.attached=S$e(),t}function I$e(n,e){if(yt(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const gre=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,L$e=(n,e,t,i,s,o)=>{const r=s==="svg";e==="class"?p$e(n,i,r):e==="style"?v$e(n,t,i):y5(e)?_Z(e)||C$e(n,e,t,i,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):O$e(n,e,i,r))?(dre(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&ure(n,e,i,r,o,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!sn(i))?dre(n,$u(e),i,o,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),ure(n,e,i,r))};function O$e(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&gre(e)&&ln(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return gre(e)&&sn(t)?!1:e in n}const kve=new WeakMap,Ave=new WeakMap,F4=Symbol("_moveCb"),pre=Symbol("_enterCb"),R$e=n=>(delete n.props.mode,n),M$e=R$e({name:"TransitionGroup",props:ba({},Lve,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=Qn(),i=K_e();let s,o;return s_(()=>{if(!s.length)return;const r=n.moveClass||`${n.name||"v"}-move`;if(!D$e(s[0].el,t.vnode.el,r))return;s.forEach(k$e),s.forEach(A$e);const a=s.filter(N$e);KK(),a.forEach(c=>{const u=c.el,d=u.style;nm(u,r),d.transform=d.webkitTransform=d.transitionDuration="";const f=u[F4]=g=>{g&&g.target!==u||(!g||/transform$/.test(g.propertyName))&&(u.removeEventListener("transitionend",f),u[F4]=null,VT(u,r))};u.addEventListener("transitionend",f)})}),()=>{const r=Cs(n),a=Ove(r);let c=r.tag||Qt;if(s=[],o)for(let u=0;u<o.length;u++){const d=o[u];d.el&&d.el instanceof Element&&(s.push(d),M0(d,R$(d,a,i,t)),kve.set(d,d.el.getBoundingClientRect()))}o=e.default?MZ(e.default()):[];for(let u=0;u<o.length;u++){const d=o[u];d.key!=null&&M0(d,R$(d,a,i,t))}return ce(c,null,o)}}}),Nve=M$e;function k$e(n){const e=n.el;e[F4]&&e[F4](),e[pre]&&e[pre]()}function A$e(n){Ave.set(n,n.el.getBoundingClientRect())}function N$e(n){const e=kve.get(n),t=Ave.get(n),i=e.left-t.left,s=e.top-t.top;if(i||s){const o=n.el.style;return o.transform=o.webkitTransform=`translate(${i}px,${s}px)`,o.transitionDuration="0s",n}}function D$e(n,e,t){const i=n.cloneNode(),s=n[DO];s&&s.forEach(a=>{a.split(/\s+/).forEach(c=>c&&i.classList.remove(c))}),t.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const o=e.nodeType===1?e:e.parentNode;o.appendChild(i);const{hasTransform:r}=Rve(i);return o.removeChild(i),r}const $O=n=>{const e=n.props["onUpdate:modelValue"]||!1;return yt(e)?t=>VV(e,t):e};function $$e(n){n.target.composing=!0}function mre(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const jv=Symbol("_assign"),x5={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[jv]=$O(s);const o=i||s.props&&s.props.type==="number";oC(n,e?"change":"input",r=>{if(r.target.composing)return;let a=n.value;t&&(a=a.trim()),o&&(a=DK(a)),n[jv](a)}),t&&oC(n,"change",()=>{n.value=n.value.trim()}),e||(oC(n,"compositionstart",$$e),oC(n,"compositionend",mre),oC(n,"change",mre))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:o}},r){if(n[jv]=$O(r),n.composing)return;const a=(o||n.type==="number")&&!/^0\d/.test(n.value)?DK(n.value):n.value,c=e??"";a!==c&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===c)||(n.value=c))}},B4={deep:!0,created(n,e,t){n[jv]=$O(t),oC(n,"change",()=>{const i=n._modelValue,s=$ve(n),o=n.checked,r=n[jv];if(yt(i)){const a=m_e(i,s),c=a!==-1;if(o&&!c)r(i.concat(s));else if(!o&&c){const u=[...i];u.splice(a,1),r(u)}}else if(E5(i)){const a=new Set(i);o?a.add(s):a.delete(s),r(a)}else r(xve(n,o))})},mounted:_re,beforeUpdate(n,e,t){n[jv]=$O(t),_re(n,e,t)}};function _re(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(yt(e))s=m_e(e,i.props.value)>-1;else if(E5(e))s=e.has(i.props.value);else{if(e===t)return;s=NO(e,xve(n,!0))}n.checked!==s&&(n.checked=s)}const Dve={created(n,{value:e},t){n.checked=NO(e,t.props.value),n[jv]=$O(t),oC(n,"change",()=>{n[jv]($ve(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[jv]=$O(i),e!==t&&(n.checked=NO(e,i.props.value))}};function $ve(n){return"_value"in n?n._value:n.value}function xve(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const x$e=["ctrl","shift","alt","meta"],P$e={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>x$e.some(t=>n[`${t}Key`]&&!e.includes(t))},bn=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...o)=>{for(let r=0;r<e.length;r++){const a=P$e[e[r]];if(a&&a(s,e))return}return n(s,...o)})},F$e={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},xs=(n,e)=>{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const o=bb(s.key);if(e.some(r=>r===o||F$e[r]===o))return n(s)})},B$e=ba({patchProp:L$e},d$e);let vre;function Pve(){return vre||(vre=PDe(B$e))}const GC=(...n)=>{Pve().render(...n)},Fve=(...n)=>{const e=Pve().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=V$e(i);if(!s)return;const o=e._component;!ln(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=t(s,!1,H$e(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},e};function H$e(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function V$e(n){return sn(n)?document.querySelector(n):n}var dC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zV={exports:{}},KV={exports:{}},jV={exports:{}},XV={exports:{}},YV={exports:{}},U$e=YV.exports,bre;function P5(){return bre||(bre=1,function(n,e){(function(t,i){n.exports=i()})(U$e,function(){var t={},i,s,o,r,a,c,u,d,f,g,p,_,v,C,y,w,I,L,O,A,N,D,P,F,V,U,Q,de,q,K,re,Z,J,ge,ve,Le,Ee,Ne,qe,Re,we,Ve,Ge,dt,ze,ee,ye,Me,et,at,Ue,Se,Ie,Xe,it,Tt,He,ke,ot,Ct,Gt,Ot,En,fe,se,le,Fe,pe,je,Ae,Et,Tn,Hn,Xn,vs,Zn,Hi,ti,Ps,ae,xe,H,j,ue,ie,Te,De,me,tt,It,kt,un,gt,Ft,pn,Fn,Cn,Fs,vi,go,gl,vo,At,In,Yn,bi,Ur,Yl,RM,tI,b_,YF,nI,MM,kM,AM,Ky,T_,kb,qF,iI,Ab,NM,JF,Tp,DM,Nb,sI,$M,jy,tg,wa,xM,oI,rI,lI,PM,aI,FM,BM,Xy,QF,HM,Cp,VM,Ah,ZF,cI,e2,yp,UM,t2,n2,Fo,Mo,i2,WM,s2,o2,uI,r2,GM,zM,Yr,Db,Ep,Hd,dI,iu,KM,jM,XM,YM,qM,hI,qr,$b,Tc,l2,JM,ng,Yy,fI,qo,ig,gI,QM,pI,a2,c2,u2,ZM,qy,Vd,ek,tk,nk,su,bo,Sp,d2,Jy,xb,Wu,mI,Ia,Qy,C_,ik,sk,h2,ok,f2,rk,Zy,y_,g2,p2,_I,Pb,Nh,Fb,lk,m2,Bb,wp,La,vI,ak,ck,Hb,bI,TI,E_,bt,Yt,xt,ei,Pi,zs,Wr,To,S_,uk,ql,w_,Ud,Ip,Vb,Ub,no,CI,yI,Wb,Gb,_2,eE,zb,Dh,tE,nE,Kb,dk,hk,iE,fk,jb,Gu,Xb,gk,Yb,EI,sE,oE,rE,pk,$h,mk,_k,Jr,Jl,v2,b2,xh,Lp,qb,I_,Jb,Op,zu,sg,L_,og,O_,vk,SI,bk,Tr,lE,Ph,rg,Be,Rl,aE,ou,bs,T2,Tk,C2,lg,wI,y2,E2,S2,Ck,Ku,yk,II,w2,I2,L2,Fh,ci,Cc,pl,Bo,Bh,ju,Vn,Mr,ru,O2,LI,Ek,R2,Sk,cE,OI,wk,M2,uE,Qb,R_,k2,Ik,dE,Hh,RI,Rp,Ql,A2,MI,kI,M_,Vh,hE,Lk,Mp,Ok,AI,ml,fE,NI,Xu,gE,Zb,ag,DI,Zl,pE,N2,D2,eT,mE,$2,kp,$I,Rk,Mk,k_,kk,Ak,_E,xI,PI,vE,Nk,Dk,bE,$k,TE,FI,BI,HI,tT,x2,VI,xk,P2,Pk,F2,UI,Fk,WI,B2,GI,os,H2,gi;i=function(l,h,m,E){if(!(l instanceof Jt)&&typeof l!="string"||`${l}`.trim()==="")throw Error('Invalid type "'+l+'". The type must be a non-empty string or a Blockly.registry.Type.');if(l=`${l}`.toLowerCase(),typeof h!="string"||h.trim()==="")throw Error('Invalid name "'+h+'". The name must be a non-empty string.');const k=h.toLowerCase();if(!m)throw Error("Can not register a null value");let z=Yu[l],Oe=zI[l];if(z||(z=Yu[l]=Object.create(null),Oe=zI[l]=Object.create(null)),s(l,m),!E&&z[k])throw Error('Name "'+k+'" with type "'+l+'" already registered.');z[k]=m,Oe[k]=h},s=function(l,h){switch(l){case String(Jt.FIELD):if(typeof h.fromJson!="function")throw Error('Type "'+l+'" must have a fromJson function')}},o=function(l,h){l=`${l}`.toLowerCase(),h=h.toLowerCase();const m=Yu[l];m&&m[h]?(delete Yu[l][h],delete zI[l][h]):console.warn("Unable to unregister ["+h+"]["+l+"] from the registry.")},r=function(l,h,m){l=`${l}`.toLowerCase(),h=h.toLowerCase();const E=Yu[l];if(!E||!E[h]){if(h="Unable to find ["+h+"]["+l+"] in the registry.",m)throw Error(h+" You must require or register a "+l+" plugin.");return console.warn(h),null}return E[h]},a=function(l,h){return l=`${l}`.toLowerCase(),h=h.toLowerCase(),(l=Yu[l])?!!l[h]:!1},c=function(l,h,m){return r(l,h,m)},u=function(l,h,m){return r(l,h,m)},d=function(l,h,m){l=`${l}`.toLowerCase();var E=Yu[l];if(!E){if(E=`Unable to find [${l}] in the registry.`,m)throw Error(`${E} You must require or register a ${l} plugin.`);return console.warn(E),null}if(!h)return E;l=zI[l],m=Object.create(null);for(const k of Object.keys(E))m[l[k]]=E[k];return m},f=function(l,h,m){return h=h.plugins[String(l)]||Uh,typeof h=="function"?h:c(l,h,m)},g=function(l){return A_[l]||null},p=function(){const l=[];for(const h in A_)l.push(A_[h]);return l},_=function(l){A_[l.id]=l},v=function(l){delete A_[l.id]},C=function(){return Bk},y=function(l){Bk=l},w=function(){return Hk},I=function(l){Hk=l},L=function(){return yc},O=function(l){yc=l},A=function(l){for(;l.options.parentWorkspace;)l=l.options.parentWorkspace;const h=l.getParentSvg(),m=l.getCachedParentSvgSize();var E=h.parentElement;if(E instanceof HTMLElement){var k=E.offsetWidth;E=E.offsetHeight,m.width!==k&&(h.setAttribute("width",k+"px"),l.setCachedParentSvgSize(k,null)),m.height!==E&&(h.setAttribute("height",E+"px"),l.setCachedParentSvgSize(null,E)),l.resize()}},N=function(l,h){const m=Object.create(null),E=l.getDescendants(!0);h&&(l=l.getNextBlock())&&(l=E.indexOf(l),E.splice(l,E.length-l));for(let k=0,z;z=E[k];k++)m[z.type]?m[z.type]++:m[z.type]=1;return m},D=function(l){return function(){this.jsonInit(l)}},P=function(l){KI.defineBlocksWithJsonArrayInternal(l)},F=function(l){t.defineBlocks$$module$build$src$core$common(t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(l))},t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(l){const h={};for(let m=0;m<l.length;m++){const E=l[m];if(!E){console.warn(`Block definition #${m} in JSON array is ${E}. Skipping`);continue}const k=E.type;k?h[k]={init:D(E)}:console.warn(`Block definition #${m} in JSON array is missing a type attribute. Skipping.`)}return h},t.defineBlocks$$module$build$src$core$common=function(l){for(const h of Object.keys(l)){const m=l[h];h in ea&&console.warn(`Block definiton "${h}" overwrites previous definition.`),ea[h]=m}},V=function(){return"blockly-"+(Uk++).toString(36)},U=function(){return Vk.genUid()},Q=function(l){Ap=l},de=function(){return Ap},q=function(l){XI.fireInternal(l)},K=function(l){if(ge()){if(!$p.length)try{requestAnimationFrame(()=>{setTimeout(re,0)})}catch{setTimeout(re,0)}$p.push(l)}},re=function(){var l=Z($p,!0);$p.length=0;for(let m=0,E;E=l[m];m++)if(E.workspaceId){var h=g(E.workspaceId);h&&h.fireChangeListener(E)}l=new Set(l.map(m=>m.workspaceId));for(const m of l){if(!m||(l=g(m),!l))continue;l=l.getUndoStack();let E;for(h=l.length;0<h;h--){const k=l[h-1];if(k.group==="")break;if(E===void 0)E=k.group;else if(k.group!==E)break}E&&h!=l.length-1&&(h=l.splice(h,l.length-h),h=Z(h,!0),l.push(...h))}},Z=function(l,h){l=l.slice(),h||l.reverse();const m=[],E=Object.create(null);for(let Oe=0,Je;Je=l[Oe];Oe++)if(!Je.isNull()){var k=[Je.isUiEvent?nT:Je.type,Je.blockId,Je.workspaceId].join(" "),z=E[k];const Ht=z?z.event:null;z?Je.type===t.MOVE$$module$build$src$core$events$utils&&z.index===Oe-1?(k=Je,Ht.newParentId=k.newParentId,Ht.newInputName=k.newInputName,Ht.newCoordinate=k.newCoordinate,k.reason&&(Ht.reason?(k=new Set(k.reason.concat(Ht.reason)),Ht.reason=Array.from(k)):Ht.reason=k.reason),z.index=Oe):Je.type===t.CHANGE$$module$build$src$core$events$utils&&Je.element===Ht.element&&Je.name===Ht.name?Ht.newValue=Je.newValue:Je.type===Gr?(z=Je,Ht.viewTop=z.viewTop,Ht.viewLeft=z.viewLeft,Ht.scale=z.scale,Ht.oldScale=z.oldScale):(Je.type!==dg||Ht.type!==Gd)&&(E[k]={event:Je,index:Oe},m.push(Je)):(E[k]={event:Je,index:Oe},m.push(Je))}l=m.filter(function(Oe){return!Oe.isNull()}),h||l.reverse();for(let Oe=1,Je;Je=l[Oe];Oe++)Je.type===t.CHANGE$$module$build$src$core$events$utils&&Je.element==="mutation"&&l.unshift(l.splice(Oe,1)[0]);return l},J=function(){for(let l=0,h;h=$p[l];l++)h.recordUndo=!1},t.disable$$module$build$src$core$events$utils=function(){Wd++},t.enable$$module$build$src$core$events$utils=function(){Wd--},ge=function(){return Wd===0},t.getGroup$$module$build$src$core$events$utils=function(){return yE},t.setGroup$$module$build$src$core$events$utils=function(l){XI.setGroupInternal(l)},ve=function(l){yE=typeof l=="boolean"?l?U():"":l},Le=function(l){const h=[];l=l.getDescendants(!1);for(let m=0,E;E=l[m];m++)h[m]=E.id;return h},Ee=function(l,h){const m=Ne(l.type);if(!m)throw Error("Unknown event type.");return m.fromJson(l,h)},Ne=function(l){const h=c(Jt.EVENT,l);if(!h)throw Error(`Event type ${l} not found in registry.`);return h},qe=function(l){if((l.type===t.MOVE$$module$build$src$core$events$utils||l.type===t.CREATE$$module$build$src$core$events$utils)&&l.workspaceId){var h=g(l.workspaceId);if(!l.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(l=h.getBlockById(l.blockId)){const m=Ap;try{Ap=!1;const E=l.getParent();if(E&&E.isEnabled()){const k=l.getDescendants(!1);for(let z=0,Oe;Oe=k[z];z++)Oe.setEnabled(!0)}else if((l.outputConnection||l.previousConnection)&&!h.isDragging())do l.setEnabled(!1),l=l.getNextBlock();while(l)}finally{Ap=m}}}},Re=function(l,h){we(),oT=setTimeout(function(){h&&h.handleRightClick(l)},U2)},we=function(){oT&&(clearTimeout(oT),oT=0)},Ve=function(){wE=null},Ge=function(l){return!l.type.startsWith("pointer")||l instanceof PointerEvent&&ze(l)},dt=function(l){return`${l.pointerId}`},ze=function(l){const h=dt(l);return wE?wE===h:l.type==="pointerdown"?(wE=h,!0):!1},ee=function(l,h,m,E,k){function z(Je){(k||Ge(Je))&&(m?E.call(m,Je):E(Je))}const Oe=[];if(h in Wh)for(let Je=0;Je<Wh[h].length;Je++){const Ht=Wh[h][Je];l.addEventListener(Ht,z,!1),Oe.push([l,Ht,z])}else l.addEventListener(h,z,!1),Oe.push([l,h,z]);return Oe},ye=function(l,h,m,E){function k(Oe){m?E.call(m,Oe):E(Oe)}const z=[];if(h in Wh)for(let Oe=0;Oe<Wh[h].length;Oe++){const Je=Wh[h][Oe];l.addEventListener(Je,k,!1),z.push([l,Je,k])}else l.addEventListener(h,k,!1),z.push([l,h,k]);return z},Me=function(l){const h=l[l.length-1][2];for(;l.length;){const[m,E,k]=l.pop();m.removeEventListener(E,k,!1)}return h},et=function(l){if(l.target instanceof HTMLElement){if(l.target.isContentEditable||l.target.getAttribute("data-is-text-input")==="true")return!0;if(l.target instanceof HTMLInputElement)return l=l.target,l.type==="text"||l.type==="number"||l.type==="email"||l.type==="password"||l.type==="search"||l.type==="tel"||l.type==="url";if(l.target instanceof HTMLTextAreaElement)return!0}return!1},at=function(l){return l.ctrlKey&&LE?!0:l.button===2},Ue=function(l,h,m){const E=h.createSVGPoint();return E.x=l.clientX,E.y=l.clientY,m||(m=h.getScreenCTM().inverse()),E.matrixTransform(m)},Se=function(l){switch(l.deltaMode){default:return{x:l.deltaX,y:l.deltaY};case 1:return{x:l.deltaX*B_,y:l.deltaY*B_};case 2:return{x:l.deltaX*Ti,y:l.deltaY*Ti}}},Ie=function(l,h){return h=l.indexOf(h),h===-1?!1:(l.splice(h,1),!0)},Xe=function(l){if(RE)throw Error("CSS already injected");nL+=`
- `+l},it=function(l,h){RE||(RE=!0,l&&(l=h.replace(/[\\/]$/,""),h=nL.replace(/<<<PATH>>>/g,l),nL="",l=document.createElement("style"),l.id="blockly-common-style",h=document.createTextNode(h),l.appendChild(h),document.head.insertBefore(l,document.head.firstChild)))},Tt=function(l,h,m,E){l=l+" was deprecated in "+h+" and will be deleted in "+m+".",E&&(l+=`
- Use `+E+" instead."),W2.has(l)||(W2.add(l),console.warn(l))},He=function(l,h,m){l=document.createElementNS(ME,`${l}`);for(const E in h)l.setAttribute(E,`${h[E]}`);return m&&m.appendChild(l),l},ke=function(l,h){return h=h.split(" "),h.every(m=>l.classList.contains(m))?!1:(l.classList.add(...h),!0)},ot=function(l,h){l.classList.remove(...h.split(" "))},Ct=function(l,h){return h=h.split(" "),h.every(m=>!l.classList.contains(m))?!1:(l.classList.remove(...h),!0)},Gt=function(l,h){return l.classList.contains(h)},Ot=function(l){return l&&l.parentNode?l.parentNode.removeChild(l):null},En=function(l,h){const m=h.nextSibling;if(h=h.parentNode,!h)throw Error("Reference node has no parent.");m?h.insertBefore(l,m):h.appendChild(l)},fe=function(l,h){return Tt("Blockly.utils.dom.containsNode","version 10","version 11",'Use native "contains" DOM method'),l.contains(h)},se=function(l,h){l.style.transform=h,l.style["-webkit-transform"]=h},le=function(){Xd++,jd||(jd=Object.create(null))},Fe=function(){Xd--,Xd||(jd=null)},pe=function(l){const h=l.textContent+`
- `+l.className.baseVal;let m;if(jd&&(m=jd[h]))return m;try{m=l.getComputedTextLength()}catch{return 8*l.textContent.length}return jd&&(jd[h]=m),m},je=function(l,h,m,E){return Ae(l,h+"pt",m,E)},Ae=function(l,h,m,E){const k=l.textContent;l=k+`
- `+l.className.baseVal;var z;return jd&&(z=jd[l])||(Al||(z=document.createElement("canvas"),z.className="blocklyComputeCanvas",document.body.appendChild(z),Al=z.getContext("2d")),Al.font=m+" "+h+" "+E,z=k?Al.measureText(k).width:0,jd&&(jd[l]=z)),z},Et=function(l,h,m,E){const k=document.createElement("span");k.style.font=m+" "+h+" "+E,k.textContent=l,l=document.createElement("div"),l.style.width="1px",l.style.height="0",h=document.createElement("div"),h.style.display="flex",h.style.position="fixed",h.style.top="0",h.style.left="0",h.appendChild(k),h.appendChild(l),document.body.appendChild(h),m={height:0,baseline:0};try{h.style.alignItems="baseline",m.baseline=l.offsetTop-k.offsetTop,h.style.alignItems="flex-end",m.height=l.offsetTop-k.offsetTop}finally{document.body.removeChild(h)}return m},Tn=function(l){return G2.getSizeInternal(l)},Hn=function(l){if(vs(l,"display")!=="none")return Xn(l);const h=l.style,m=h.display,E=h.visibility,k=h.position;h.visibility="hidden",h.position="absolute",h.display="inline";const z=l.offsetWidth;return l=l.offsetHeight,h.display=m,h.position=k,h.visibility=E,new ko(z,l)},Xn=function(l){return new ko(l.offsetWidth,l.offsetHeight)},vs=function(l,h){return l=window.getComputedStyle(l),l[h]||l.getPropertyValue(h)},Zn=function(l){const h=new _n(0,0);l=l.getBoundingClientRect();var m=document.documentElement;return m=new _n(window.pageXOffset||m.scrollLeft,window.pageYOffset||m.scrollTop),h.x=l.left+m.x,h.y=l.top+m.y,h},Hi=function(){const l=document.body,h=document.documentElement;return new _n(l.scrollLeft||h.scrollLeft,l.scrollTop||h.scrollTop)},ti=function(l){const h=parseFloat(vs(l,"borderLeftWidth")),m=parseFloat(vs(l,"borderRightWidth")),E=parseFloat(vs(l,"borderTopWidth"));return l=parseFloat(vs(l,"borderBottomWidth")),new lo(E,l,h,m)},Ps=function(l,h,m){l=ae(l,h,m),h.scrollLeft=l.x,h.scrollTop=l.y},ae=function(l,h,m){var E=Zn(l),k=Zn(h),z=ti(h);const Oe=E.x-k.x-z.left;return E=E.y-k.y-z.top,k=Xn(l),l=h.clientWidth-k.width,k=h.clientHeight-k.height,z=h.scrollLeft,h=h.scrollTop,m?(z+=Oe-l/2,h+=E-k/2):(z+=Math.min(Oe,Math.max(Oe-l,0)),h+=Math.min(E,Math.max(E-k,0))),new _n(z,h)},xe=function(l){const h=new _n(0,0);var m=l.x&&l.getAttribute("x");const E=l.y&&l.getAttribute("y");return m&&(h.x=parseInt(m)),E&&(h.y=parseInt(E)),(m=(m=l.getAttribute("transform"))&&m.match(Qk))&&(h.x+=Number(m[1]),m[3]&&(h.y+=Number(m[3]))),(l=l.getAttribute("style"))&&-1<l.indexOf("translate")&&(l=l.match(Zk))&&(h.x+=Number(l[1]),l[3]&&(h.y+=Number(l[3]))),h},H=function(l){let h=0,m=0;for(;l;){const E=xe(l);if(h+=E.x,m+=E.y,(" "+(l.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")!==-1)break;l=l.parentNode}return new _n(h,m)},j=function(){const l=Hi();return new lo(l.y,document.documentElement.clientHeight+l.y,l.x,document.documentElement.clientWidth+l.x)},ue=function(){const l=document.documentElement,h=window;return new _n(h.pageXOffset||l.scrollLeft,h.pageYOffset||l.scrollTop)},ie=function(l,h){var m=h.x;h=h.y;const E=l.getInjectionDiv().getBoundingClientRect();return m=new _n(m-E.left,h-E.top),h=l.getOriginOffsetInPixels(),_n.difference(m,h).scale(1/l.scale)},Te=function(l,h){var m=h.scale(l.scale);h=m.x,m=m.y;const E=l.getInjectionDiv().getBoundingClientRect();return l=l.getOriginOffsetInPixels(),new _n(h+E.left+l.x,m+E.top+l.y)},De=function(l){({document:kE=kE,DOMParser:AE=AE,XMLSerializer:V_=V_}=l),iL=new AE,sL=new V_},t.createElement$$module$build$src$core$utils$xml=function(l){return kE.createElementNS(eA,l)},t.createTextNode$$module$build$src$core$utils$xml=function(l){return kE.createTextNode(l)},t.textToDom$$module$build$src$core$utils$xml=function(l){let h=iL.parseFromString(l,"text/xml");if(h&&h.documentElement&&!h.getElementsByTagName("parsererror").length)return h.documentElement;if((h=iL.parseFromString(l,"text/html"))&&h.body.firstChild&&h.body.firstChild.nodeName.toLowerCase()==="xml")return h.body.firstChild;throw Error(`DOMParser was unable to parse: ${l}`)},me=function(l){return tt(sL.serializeToString(l))},tt=function(l){return l.replace(NE,h=>`&#${h.charCodeAt(0)};`)},It=function(l){return l?((l instanceof Element||typeof l=="string")&&(l=vi(l),l=Fn(l)),kt(l),l):null},kt=function(l){const h=l.kind;if(l=l.contents,h&&h!==tA&&h!==oL)throw Error("Invalid toolbox kind "+h+". Please supply either "+tA+" or "+oL);if(!l)throw Error("Toolbox must have a contents attribute.")},un=function(l){return l?l.contents?l.contents:Array.isArray(l)&&0<l.length&&!l[0].nodeType?l:Cn(l):[]},gt=function(l){return nA.hasCategoriesInternal(l)},Ft=function(l){if(!l)return!1;const h=l.kind;return h?h===oL:!!l.contents.filter(function(m){return m.kind.toUpperCase()==="CATEGORY"}).length},pn=function(l){return l&&l.contents?!!l.contents.filter(function(h){return h.kind.toUpperCase()==="CATEGORY"}).length:!1},Fn=function(l){const h={contents:Cn(l)};return l instanceof Node&&Fs(l,h),h},Cn=function(l){const h=[];let m=l.childNodes;m||(m=l);for(let E=0,k;k=m[E];E++){if(!k.tagName)continue;l={};const z=k.tagName.toUpperCase();l.kind=z,z==="BLOCK"?l.blockxml=k:k.childNodes&&0<k.childNodes.length&&(l.contents=Cn(k)),Fs(k,l),h.push(l)}return h},Fs=function(l,h){for(let m=0;m<l.attributes.length;m++){const E=l.attributes[m];-1<E.nodeName.indexOf("css-")?(h.cssconfig=h.cssconfig||{},h.cssconfig[E.nodeName.replace("css-","")]=E.value):h[E.nodeName]=E.value}},vi=function(l){let h=null;if(l)if(typeof l=="string"){if(h=t.textToDom$$module$build$src$core$utils$xml(l),h.nodeName.toLowerCase()!=="xml")throw TypeError("Toolbox should be an <xml> document.")}else l instanceof Element&&(h=l);return h},go=function(l,h,m,E,k,z){const Oe=z.scrollbar&&z.scrollbar.canScrollVertically();return l.horizontal===lT.LEFT?(m=k.absoluteMetrics.left+m,Oe&&z.RTL&&(m+=kr.scrollbarThickness)):(m=k.absoluteMetrics.left+k.viewMetrics.width-h.width-m,Oe&&!z.RTL&&(m-=kr.scrollbarThickness)),l.vertical===ja.TOP?l=k.absoluteMetrics.top+E:(l=k.absoluteMetrics.top+k.viewMetrics.height-h.height-E,z.scrollbar&&z.scrollbar.canScrollHorizontally()&&(l-=kr.scrollbarThickness)),new lo(l,l+h.height,m,m+h.width)},gl=function(l,h){return{horizontal:h.toolboxMetrics.position===Fi.LEFT||l.horizontalLayout&&!l.RTL?lT.RIGHT:lT.LEFT,vertical:h.toolboxMetrics.position===Fi.BOTTOM?ja.TOP:ja.BOTTOM}},vo=function(l,h,m,E){const k=l.left,z=l.right-l.left,Oe=l.bottom-l.top;for(let Je=0;Je<E.length;Je++){const Ht=E[Je];l.intersects(Ht)&&(l=m===fg.UP?Ht.top-Oe-h:Ht.bottom+h,l=new lo(l,l+Oe,k,k+z),Je=-1)}return l},At=function(l,h){K2(l,h)},In=function(l){K2=l},Yn=function(l,h){Y2.confirmInternal(l,h)},bi=function(l,h){j2(l,h)},Ur=function(l){j2=l},Yl=function(l,h,m){X2(l,h,m)},RM=function(l){X2=l},tI=function(l){return l.getVariableModel!==void 0},b_=function(l){return l.getProcedureDef!==void 0},YF=function(l){return l.getProcedureCall!==void 0&&l.renameProcedure!==void 0},t.allUsedVarModels$$module$build$src$core$variables=function(l){l=l.getAllBlocks(!1);const h=new Set;for(let m=0;m<l.length;m++){const E=l[m].getVarModels();if(E)for(let k=0;k<E.length;k++){const z=E[k];z.getId()&&h.add(z)}}return Array.from(h.values())},t.allDeveloperVariables$$module$build$src$core$variables=function(l){l=l.getAllBlocks(!1);const h=new Set;for(let E=0,k;k=l[E];E++){var m=k.getDeveloperVariables;if(m){m=m();for(let z=0;z<m.length;z++)h.add(m[z])}}return Array.from(h.values())},nI=function(l){let h=[];const m=document.createElement("button");return m.setAttribute("text","%{BKY_NEW_VARIABLE}"),m.setAttribute("callbackKey","CREATE_VARIABLE"),l.registerButtonCallback("CREATE_VARIABLE",function(E){T_(E.getTargetWorkspace())}),h.push(m),l=MM(l),h=h.concat(l)},MM=function(l){l=l.getVariablesOfType("");const h=[];if(0<l.length){var m=l[l.length-1];if(ea.variables_set){var E=t.createElement$$module$build$src$core$utils$xml("block");E.setAttribute("type","variables_set"),E.setAttribute("gap",ea.math_change?"8":"24"),E.appendChild(Tp(m)),h.push(E)}if(ea.math_change&&(E=t.createElement$$module$build$src$core$utils$xml("block"),E.setAttribute("type","math_change"),E.setAttribute("gap",ea.variables_get?"20":"8"),E.appendChild(Tp(m)),m=t.textToDom$$module$build$src$core$utils$xml('<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>'),E.appendChild(m),h.push(E)),ea.variables_get){l.sort(cT.compareByName);for(let k=0,z;z=l[k];k++)m=t.createElement$$module$build$src$core$utils$xml("block"),m.setAttribute("type","variables_get"),m.setAttribute("gap","8"),m.appendChild(Tp(z)),h.push(m)}}return h},kM=function(l){return J2.generateUniqueNameInternal(l)},AM=function(l){return Ky(oA.charAt(0),l.getAllVariableNames())},Ky=function(l,h){if(!h.length)return l;const m=oA;let E="",k=m.indexOf(l);for(;;){let z=!1;for(let Oe=0;Oe<h.length;Oe++)if(h[Oe].toLowerCase()===l){z=!0;break}if(!z)break;k++,k===m.length&&(k=0,E=`${Number(E)+1}`),l=m.charAt(k)+E}return l},T_=function(l,h,m){function E(z){kb(t.Msg$$module$build$src$core$msg.NEW_VARIABLE_TITLE,z,function(Oe){if(Oe){var Je=iI(Oe,l);if(Je){if(Je.type===k)var Ht=t.Msg$$module$build$src$core$msg.VARIABLE_ALREADY_EXISTS.replace("%1",Je.name);else Ht=t.Msg$$module$build$src$core$msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE,Ht=Ht.replace("%1",Je.name).replace("%2",Je.type);At(Ht,function(){E(Oe)})}else l.createVariable(Oe,k),h&&h(Oe)}else h&&h(null)})}const k=m||"";E("")},t.renameVariable$$module$build$src$core$variables=function(l,h,m){function E(k){const z=t.Msg$$module$build$src$core$msg.RENAME_VARIABLE_TITLE.replace("%1",h.name);kb(z,k,function(Oe){if(Oe){var Je=qF(Oe,h.type,l),Ht=Ab(h.name,Oe,l);if(Je||Ht){var kn="";Je?kn=t.Msg$$module$build$src$core$msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",Je.name).replace("%2",Je.type):Ht&&(kn=t.Msg$$module$build$src$core$msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER.replace("%1",Oe).replace("%2",Ht)),At(kn,function(){E(Oe)})}else l.renameVariableById(h.getId(),Oe),m&&m(Oe)}else m&&m(null)})}E("")},kb=function(l,h,m){Yl(l,h,function(E){E&&(E=E.replace(/[\s\xa0]+/g," ").trim(),E===t.Msg$$module$build$src$core$msg.RENAME_VARIABLE||E===t.Msg$$module$build$src$core$msg.NEW_VARIABLE)&&(E=null),m(E)})},qF=function(l,h,m){m=m.getVariableMap().getAllVariables(),l=l.toLowerCase();for(let E=0,k;k=m[E];E++)if(k.name.toLowerCase()===l&&k.type!==h)return k;return null},iI=function(l,h){h=h.getVariableMap().getAllVariables(),l=l.toLowerCase();for(let m=0,E;E=h[m];m++)if(E.name.toLowerCase()===l)return E;return null},Ab=function(l,h,m){return m.getProcedureMap().getProcedures().length?NM(l,h,m):JF(l,h,m)},NM=function(l,h,m){l=l.toLowerCase(),h=h.toLowerCase(),m=m.getProcedureMap().getProcedures();for(const k of m){var E=k.getParameters().filter(tI).map(z=>z.getVariableModel().name);if(E&&(m=E.some(z=>z.toLowerCase()===l),E=E.some(z=>z.toLowerCase()===h),m&&E))return k.getName()}return null},JF=function(l,h,m){l=l.toLowerCase(),h=h.toLowerCase(),m=m.getAllBlocks(!1);for(const k of m){if(!b_(k))continue;m=k.getProcedureDef();var E=m[1];const z=E.some(Oe=>Oe.toLowerCase()===l);if(E=E.some(Oe=>Oe.toLowerCase()===h),z&&E)return m[0]}return null},Tp=function(l){const h=t.createElement$$module$build$src$core$utils$xml("field");return h.setAttribute("name","VAR"),h.setAttribute("id",l.getId()),h.setAttribute("variabletype",l.type),l=t.createTextNode$$module$build$src$core$utils$xml(l.name),h.appendChild(l),h},t.getOrCreateVariablePackage$$module$build$src$core$variables=function(l,h,m,E){let k=t.getVariable$$module$build$src$core$variables(l,h,m,E);return k||(k=DM(l,h,m,E)),k},t.getVariable$$module$build$src$core$variables=function(l,h,m,E){const k=l.getPotentialVariableMap();let z=null;if(h&&(z=l.getVariableById(h),!z&&k&&(z=k.getVariableById(h)),z))return z;if(m){if(E===void 0)throw Error("Tried to look up a variable by name without a type");z=l.getVariable(m,E),!z&&k&&(z=k.getVariable(m,E))}return z},DM=function(l,h,m,E){const k=l.getPotentialVariableMap();return m||(m=kM(l.isFlyout?l.targetWorkspace:l)),k?k.createVariable(m,E,h):l.createVariable(m,E,h)},Nb=function(l,h){l=l.getAllVariables();const m=[];if(h.length!==l.length)for(let E=0;E<l.length;E++){const k=l[E];h.indexOf(k)===-1&&m.push(k)}return m},sI=function(l,h){i(Jt.PASTER,l,h)},$M=function(l){o(Jt.PASTER,l)},jy=function(l){return oI(l),xM()?(rI(),Promise.resolve()):(G_||(G_=new Promise(h=>{cA=h,Q2=window.requestAnimationFrame(()=>{rI(),h()})})),G_)},tg=function(){return G_||Promise.resolve()},wa=function(l){l||window.cancelAnimationFrame(Q2),rI(l),!l&&cA&&cA()},xM=function(){return Yk},oI=function(l){aA.add(l);const h=l.getParent();h?oI(h):cL.add(l)},rI=function(l){const h=l?new Set([l]):new Set([...cL].map(k=>k.workspace)),m=[...cL].filter(PM).filter(k=>h.has(k.workspace));for(var E of m)aI(E);for(const k of h)k.resizeContents();for(const k of m)E=k.getRelativeToSurfaceXY(),k.updateComponentLocations(E);for(const k of m)lI(k);l||(G_=null)},lI=function(l){cL.delete(l),aA.delete(l);for(const h of l.getChildren(!1))lI(h)},PM=function(l){return!l.isDisposed()&&!l.getParent()},aI=function(l){if(aA.has(l)){for(const h of l.getChildren(!1))aI(h);l.renderEfficiently()}},FM=function(l,h){const m=t.createElement$$module$build$src$core$utils$xml("xml");var E=BM(t.allUsedVarModels$$module$build$src$core$variables(l));E.hasChildNodes()&&m.appendChild(E),E=l.getTopComments(!0);for(let k=0;k<E.length;k++)m.appendChild(E[k].toXmlWithXY(h));for(l=l.getTopBlocks(!0),E=0;E<l.length;E++)m.appendChild(Xy(l[E],h));return m},BM=function(l){const h=t.createElement$$module$build$src$core$utils$xml("variables");for(let m=0;m<l.length;m++){const E=l[m],k=t.createElement$$module$build$src$core$utils$xml("variable");k.appendChild(t.createTextNode$$module$build$src$core$utils$xml(E.name)),E.type&&k.setAttribute("type",E.type),k.id=E.getId(),h.appendChild(k)}return h},Xy=function(l,h){if(l.isInsertionMarker()&&(l=l.getChildren(!1)[0],!l))return new DocumentFragment;let m=0;if(l.workspace.RTL&&(m=l.workspace.getWidth()),h=Cp(l,h),zM(h)){const E=l.getRelativeToSurfaceXY();h.setAttribute("x",String(Math.round(l.workspace.RTL?m-E.x:E.x))),h.setAttribute("y",String(Math.round(E.y)))}return h},QF=function(l){if(l.isSerializable()){const h=t.createElement$$module$build$src$core$utils$xml("field");return h.setAttribute("name",l.name||""),l.toXml(h)}return null},HM=function(l,h){for(let m=0;m<l.inputList.length;m++){const E=l.inputList[m];for(let k=0;k<E.fieldRow.length;k++){const z=QF(E.fieldRow[k]);z&&h.appendChild(z)}}},Cp=function(l,h){if(l.isInsertionMarker())return(h=l.getChildren(!1)[0])?Cp(h):new DocumentFragment;const m=t.createElement$$module$build$src$core$utils$xml(l.isShadow()?"shadow":"block");if(m.setAttribute("type",l.type),h||(m.id=l.id),l.mutationToDom){var E=l.mutationToDom();E&&(E.hasChildNodes()||E.hasAttributes())&&m.appendChild(E)}if(HM(l,m),E=l.getCommentText()){var k=l.getIcon(wc.COMMENT),z=k.getBubbleSize();k=k.bubbleIsVisible();var Oe=t.createElement$$module$build$src$core$utils$xml("comment");Oe.appendChild(t.createTextNode$$module$build$src$core$utils$xml(E)),Oe.setAttribute("pinned",`${k}`),Oe.setAttribute("h",String(z.height)),Oe.setAttribute("w",String(z.width)),m.appendChild(Oe)}for(l.data&&(E=t.createElement$$module$build$src$core$utils$xml("data"),E.appendChild(t.createTextNode$$module$build$src$core$utils$xml(l.data)),m.appendChild(E)),E=0;E<l.inputList.length;E++){z=l.inputList[E];var Je=void 0;if(k=!0,z.type!==t.inputTypes$$module$build$src$core$inputs$input_types.DUMMY&&z.type!==t.inputTypes$$module$build$src$core$inputs$input_types.END_ROW){Oe=z.connection.targetBlock(),z.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE?Je=t.createElement$$module$build$src$core$utils$xml("value"):z.type===t.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT&&(Je=t.createElement$$module$build$src$core$utils$xml("statement"));const kn=z.connection.getShadowDom();!kn||Oe&&Oe.isShadow()||Je.appendChild(VM(kn,h)),Oe&&(Oe=Cp(Oe,h),Oe.nodeType===hg.ELEMENT_NODE&&(Je.appendChild(Oe),k=!1)),Je.setAttribute("name",z.name),k||m.appendChild(Je)}}l.inputsInline!==void 0&&l.inputsInline!==l.inputsInlineDefault&&m.setAttribute("inline",String(l.inputsInline)),l.isCollapsed()&&m.setAttribute("collapsed","true"),l.isEnabled()||m.setAttribute("disabled","true"),l.isDeletable()||l.isShadow()||m.setAttribute("deletable","false"),l.isMovable()||l.isShadow()||m.setAttribute("movable","false"),l.isEditable()||m.setAttribute("editable","false"),Je=l.getNextBlock();let Ht;return Je&&(E=Cp(Je,h),E.nodeType===hg.ELEMENT_NODE&&(Ht=t.createElement$$module$build$src$core$utils$xml("next"),Ht.appendChild(E),m.appendChild(Ht))),l=l.nextConnection&&l.nextConnection.getShadowDom(),!l||Je&&Je.isShadow()||Ht.appendChild(VM(l,h)),m},VM=function(l,h){let m=l=l.cloneNode(!0),E;for(;m;)if(h&&m.nodeName==="shadow"&&m.removeAttribute("id"),m.firstChild)m=m.firstChild;else{for(;m&&!m.nextSibling;){E=m,m=m.parentNode;let k;E.nodeType===hg.TEXT_NODE&&E.data.trim()===""&&((k=m)==null?void 0:k.firstChild)!==E&&Ot(E)}m&&(E=m,m=m.nextSibling,E.nodeType===hg.TEXT_NODE&&E.data.trim()===""&&Ot(E))}return l},Ah=function(l){return me(l).replace(/<(\w+)([^<]*)\/>/g,"<$1$2></$1>")},ZF=function(l){l=Ah(l).split("<");let h="";for(let m=1;m<l.length;m++){const E=l[m];E[0]==="/"&&(h=h.substring(2)),l[m]=h+"<"+E,E[0]!=="/"&&E.slice(-2)!=="/>"&&(h+=" ")}return l=l.join(`
- `),l=l.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1</$2>"),l.replace(/^\n/,"")},cI=function(l,h){return h.setResizesEnabled(!1),h.clear(),l=t.domToWorkspace$$module$build$src$core$xml(l,h),h.setResizesEnabled(!0),l},t.domToWorkspace$$module$build$src$core$xml=function(l,h){let m=0;h.RTL&&(m=h.getWidth());const E=[];le();const k=t.getGroup$$module$build$src$core$events$utils();k||t.setGroup$$module$build$src$core$events$utils(!0),h.setResizesEnabled&&h.setResizesEnabled(!1);let z=!0;try{for(let Oe=0,Je;Je=l.childNodes[Oe];Oe++){const Ht=Je.nodeName.toLowerCase(),kn=Je;if(Ht==="block"||Ht==="shadow"&&!de()){const Qo=yp(kn,h);E.push(Qo.id);let Vo;const sd=parseInt((Vo=kn.getAttribute("x"))!=null?Vo:"10",10);let VL;const UL=parseInt((VL=kn.getAttribute("y"))!=null?VL:"10",10);isNaN(sd)||isNaN(UL)||Qo.moveBy(h.RTL?m-sd:sd,UL,["create"]),z=!1}else{if(Ht==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(Ht==="comment")h.rendered?sa.fromXmlRendered(kn,h,m):Kh.fromXml(kn,h);else if(Ht==="variables"){if(z)UM(kn,h);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");z=!1}}}}finally{t.setGroup$$module$build$src$core$events$utils(k),h.setResizesEnabled&&h.setResizesEnabled(!0),h.rendered&&wa(),Fe()}return q(new(Ne(qu))(h)),E},e2=function(l,h){if(!h.getBlocksBoundingBox)return t.domToWorkspace$$module$build$src$core$xml(l,h);var m=h.getBlocksBoundingBox();if(l=t.domToWorkspace$$module$build$src$core$xml(l,h),m&&m.top!==m.bottom){var E=m.bottom;m=h.RTL?m.right:m.left;var k=1/0;let z=-1/0,Oe=1/0;for(let Je=0;Je<l.length;Je++){const Ht=h.getBlockById(l[Je]).getRelativeToSurfaceXY();Ht.y<Oe&&(Oe=Ht.y),Ht.x<k&&(k=Ht.x),Ht.x>z&&(z=Ht.x)}for(E=E-Oe+10,m=h.RTL?m-z:m-k,k=0;k<l.length;k++)h.getBlockById(l[k]).moveBy(m,E,["create"])}return l},t.domToBlock$$module$build$src$core$xml=function(l,h){return l=yp(l,h),h.rendered&&wa(),l},yp=function(l,h){t.disable$$module$build$src$core$events$utils();var m=h.getAllVariables();let E;try{if(E=uI(l,h),h.rendered){const k=E,z=E.getDescendants(!1);k.setConnectionTracking(!1);for(let Oe=z.length-1;0<=Oe;Oe--)z[Oe].initSvg();for(let Oe=z.length-1;0<=Oe;Oe--)z[Oe].queueRender();setTimeout(function(){k.disposed||k.setConnectionTracking(!0)},1),h.resizeContents()}else{const k=E.getDescendants(!1);for(let z=k.length-1;0<=z;z--)k[z].initModel()}}finally{t.enable$$module$build$src$core$events$utils()}if(ge()){for(l=Nb(h,m),h=0;h<l.length;h++)m=l[h],q(new(Ne(za))(m));q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(E))}return E},UM=function(l,h){for(let E=0;E<l.children.length;E++){var m=l.children[E];const k=m.getAttribute("type"),z=m.getAttribute("id");if(m=m.textContent,!m)break;h.createVariable(m,k,z)}},t2=function(l){const h={mutation:[],comment:[],data:[],field:[],input:[],next:[]};for(let m=0;m<l.children.length;m++){const E=l.children[m];if(E.nodeType!==hg.TEXT_NODE)switch(E.nodeName.toLowerCase()){case"mutation":h.mutation.push(E);break;case"comment":h.comment.push(E);break;case"data":h.data.push(E);break;case"title":case"field":h.field.push(E);break;case"value":case"statement":h.input.push(E);break;case"next":h.next.push(E);break;default:console.warn("Ignoring unknown tag: "+E.nodeName)}}return h},n2=function(l,h){let m=!1;for(let E=0;E<l.length;E++){const k=l[E];h.domToMutation&&(h.domToMutation(k),h.initSvg&&(m=!0))}return m},Fo=function(l,h){for(let E=0;E<l.length;E++){var m=l[E];const k=m.textContent,z=m.getAttribute("pinned")==="true";let Oe;const Je=parseInt((Oe=m.getAttribute("w"))!=null?Oe:"50",10);let Ht;m=parseInt((Ht=m.getAttribute("h"))!=null?Ht:"50",10),h.setCommentText(k);const kn=h.getIcon(wc.COMMENT);isNaN(Je)||isNaN(m)||kn.setBubbleSize(new ko(Je,m)),kn.setBubbleVisible(z),setTimeout(()=>kn.setBubbleVisible(z),1)}},Mo=function(l,h){for(let m=0;m<l.length;m++)h.data=l[m].textContent},i2=function(l,h){for(let m=0;m<l.length;m++){const E=l[m],k=E.getAttribute("name");k?r2(h,k,E):console.warn(`Ignoring unnamed field in block ${h.type}`)}},WM=function(l){let h=null,m=null;for(let E=0;E<l.childNodes.length;E++){const k=l.childNodes[E];zM(k)&&(k.nodeName.toLowerCase()==="block"?h=k:k.nodeName.toLowerCase()==="shadow"&&(m=k))}return{childBlockElement:h,childShadowElement:m}},s2=function(l,h,m,E){for(let z=0;z<l.length;z++){var k=l[z];const Oe=k.getAttribute("name"),Je=Oe?m.getInput(Oe):null;if(!Je){console.warn("Ignoring non-existent input "+Oe+" in block "+E);break}if(k=WM(k),k.childBlockElement){if(!Je.connection)throw TypeError("Input connection does not exist.");uI(k.childBlockElement,h,Je.connection,!1)}if(k.childShadowElement){let Ht;(Ht=Je.connection)==null||Ht.setShadowDom(k.childShadowElement)}}},o2=function(l,h,m){for(let E=0;E<l.length;E++){const k=WM(l[E]);if(k.childBlockElement){if(!m.nextConnection)throw TypeError("Next statement does not exist.");if(m.nextConnection.isConnected())throw TypeError("Next statement is already connected.");uI(k.childBlockElement,h,m.nextConnection,!0)}k.childShadowElement&&m.nextConnection&&m.nextConnection.setShadowDom(k.childShadowElement)}},uI=function(l,h,m,E){var k;const z=l.getAttribute("type");if(!z)throw TypeError("Block type unspecified: "+l.outerHTML);var Oe=(k=l.getAttribute("id"))!=null?k:void 0;k=h.newBlock(z,Oe),Oe=t2(l);const Je=n2(Oe.mutation,k);if(Fo(Oe.comment,k),Mo(Oe.data,k),m)if(E)if(k.previousConnection)m.connect(k.previousConnection);else throw TypeError("Next block does not have previous statement.");else if(k.outputConnection)m.connect(k.outputConnection);else if(k.previousConnection)m.connect(k.previousConnection);else throw TypeError("Child block does not have output or previous statement.");if(i2(Oe.field,k),s2(Oe.input,h,k,z),o2(Oe.next,h,k),Je&&k.initSvg(),(h=l.getAttribute("inline"))&&k.setInputsInline(h==="true"),(h=l.getAttribute("disabled"))&&k.setEnabled(h!=="true"&&h!=="disabled"),(h=l.getAttribute("deletable"))&&k.setDeletable(h==="true"),(h=l.getAttribute("movable"))&&k.setMovable(h==="true"),(h=l.getAttribute("editable"))&&k.setEditable(h==="true"),(h=l.getAttribute("collapsed"))&&k.setCollapsed(h==="true"),l.nodeName.toLowerCase()==="shadow"){for(l=k.getChildren(!1),h=0;h<l.length;h++)if(!l[h].isShadow())throw TypeError("Shadow block not allowed non-shadow child.");k.setShadow(!0)}return k},r2=function(l,h,m){const E=l.getField(h);E?E.fromXml(m):console.warn("Ignoring non-existent field "+h+" in block "+l.type)},GM=function(l){for(let h=0;h<l.childNodes.length;h++){const m=l.childNodes[h];if(m.nodeName.toLowerCase()==="next"){l.removeChild(m);break}}},zM=function(l){return l.nodeType===hg.ELEMENT_NODE},Yr=function(l){return l.saveState!==void 0&&l.loadState!==void 0},Db=function(l,h){i(Jt.SERIALIZER,l,h)},Ep=function(l){o(Jt.SERIALIZER,l)},Hd=function(l,{addCoordinates:h=!1,addInputBlocks:m=!0,addNextBlocks:E=!0,doFullSerialization:k=!0,saveIds:z=!0}={}){if(l.isInsertionMarker())return null;const Oe={type:l.type,id:z?l.id:void 0};return h&&iu(l,Oe),dI(l,Oe),KM(l,Oe,k),jM(l,Oe,k),XM(l,Oe,k),m&&YM(l,Oe,k,z),E&&qM(l,Oe,k,z),Oe},dI=function(l,h){l.isCollapsed()&&(h.collapsed=!0),l.isEnabled()||(h.enabled=!1),l.isOwnDeletable()||(h.deletable=!1),l.isOwnMovable()||(h.movable=!1),l.isOwnEditable()||(h.editable=!1),l.inputsInline!==void 0&&l.inputsInline!==l.inputsInlineDefault&&(h.inline=l.inputsInline),l.data&&(h.data=l.data)},iu=function(l,h){const m=l.workspace;l=l.getRelativeToSurfaceXY(),h.x=Math.round(m.RTL?m.getWidth()-l.x:l.x),h.y=Math.round(l.y)},KM=function(l,h,m){l.saveExtraState?(l=l.saveExtraState(m),l!==null&&(h.extraState=l)):l.mutationToDom&&(l=l.mutationToDom(),l!==null&&(h.extraState=Ah(l).replace(' xmlns="https://developers.google.com/blockly/xml"',"")))},jM=function(l,h,m){const E=Object.create(null);for(const k of l.getIcons())Yr(k)&&(l=k.saveState(m))&&(E[k.getType().toString()]=l);Object.keys(E).length&&(h.icons=E)},XM=function(l,h,m){const E=Object.create(null);for(let k=0;k<l.inputList.length;k++){const z=l.inputList[k];for(let Oe=0;Oe<z.fieldRow.length;Oe++){const Je=z.fieldRow[Oe];Je.isSerializable()&&(E[Je.name]=Je.saveState(m))}}Object.keys(E).length&&(h.fields=E)},YM=function(l,h,m,E){const k=Object.create(null);for(let z=0;z<l.inputList.length;z++){const Oe=l.inputList[z];if(!Oe.connection)continue;const Je=hI(Oe.connection,m,E);Je&&(k[Oe.name]=Je)}Object.keys(k).length&&(h.inputs=k)},qM=function(l,h,m,E){l.nextConnection&&(l=hI(l.nextConnection,m,E))&&(h.next=l)},hI=function(l,h,m){const E=l.getShadowState(!0);if(l=l.targetBlock(),!E&&!l)return null;const k=Object.create(null);return E&&(k.shadow=E),l&&!l.isShadow()&&(k.block=Hd(l,{doFullSerialization:h,saveIds:m})),k},qr=function(l,h,{recordUndo:m=!1}={}){return l=$b(l,h,{recordUndo:m}),h.rendered&&wa(),l},$b=function(l,h,{parentConnection:m,isShadow:E=!1,recordUndo:k=!1}={}){const z=de();Q(k),(k=t.getGroup$$module$build$src$core$events$utils())||t.setGroup$$module$build$src$core$events$utils(!0),t.disable$$module$build$src$core$events$utils();let Oe;try{Oe=Tc(l,h,{parentConnection:m,isShadow:E})}finally{t.enable$$module$build$src$core$events$utils()}if(ge()&&q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(Oe)),t.setGroup$$module$build$src$core$events$utils(k),Q(z),h.rendered){const Je=Oe;setTimeout(()=>{Je.disposed||Je.setConnectionTracking(!0)},1)}return Oe},Tc=function(l,h,{parentConnection:m,isShadow:E=!1}={}){if(!l.type)throw new Z2(l);const k=h.newBlock(l.type,l.id);return k.setShadow(E),l2(k,l),JM(k,l),ng(k,l),Yy(m,k,l),fI(k,l),qo(k,l),ig(k,l),gI(k,l),pI(k,h.rendered),k},l2=function(l,h){let m=h.x===void 0?0:h.x;h=h.y===void 0?0:h.y;const E=l.workspace;m=E.RTL?E.getWidth()-m:m,l.moveBy(m,h)},JM=function(l,h){h.collapsed&&l.setCollapsed(!0),h.deletable===!1&&l.setDeletable(!1),h.movable===!1&&l.setMovable(!1),h.editable===!1&&l.setEditable(!1),h.enabled===!1&&l.setEnabled(!1),h.inline!==void 0&&l.setInputsInline(h.inline),h.data!==void 0&&(l.data=h.data)},ng=function(l,h){h.extraState&&(l.loadExtraState?l.loadExtraState(h.extraState):l.domToMutation&&l.domToMutation(t.textToDom$$module$build$src$core$utils$xml(h.extraState)))},Yy=function(l,h,m){if(l){if(l.getSourceBlock().isShadow()&&!h.isShadow())throw new tB(m);if(l.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE){var E=h.outputConnection;if(!E)throw new DE("output",h,m)}else if(E=h.previousConnection,!E)throw new DE("previous",h,m);if(!l.connect(E)){const k=h.workspace.connectionChecker;throw new eB(k.getErrorMessage(k.canConnectWithReason(E,l,!1),E,l),l.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE?"output connection":"previous connection",h,m)}}},fI=function(l,h){if(h.icons){var m=Object.keys(h.icons);for(const k of m){m=h.icons[k];var E=l.getIcon(k);if(!E){if(E=c(Jt.ICON,k,!1),!E)throw new nB(k,l,h);E=new E(l),l.addIcon(E)}Yr(E)&&E.loadState(m)}}},qo=function(l,h){if(h.fields){var m=Object.keys(h.fields);for(let E=0;E<m.length;E++){const k=m[E],z=h.fields[k],Oe=l.getField(k);Oe?Oe.loadState(z):console.warn(`Ignoring non-existant field ${k} in block ${l.type}`)}}},ig=function(l,h){if(h.inputs){var m=Object.keys(h.inputs);for(let E=0;E<m.length;E++){const k=m[E],z=l.getInput(k);if(!z||!z.connection)throw new DE(k,l,h);QM(z.connection,h.inputs[k])}}},gI=function(l,h){if(h.next){if(!l.nextConnection)throw new DE("next",l,h);QM(l.nextConnection,h.next)}},QM=function(l,h){h.shadow&&l.setShadowState(h.shadow),h.block&&Tc(h.block,l.getSourceBlock().workspace,{parentConnection:l})},pI=function(l,h){if(h){l.setConnectionTracking(!1),l.initSvg(),l.queueRender();for(const m of l.getIcons())m.onLocationChange(l.getRelativeToSurfaceXY())}else l.initModel()},a2=function(l){const h=l.workspace,m=t.config$$module$build$src$core$config.snapRadius,E=l.getRelativeToSurfaceXY(),k=new _n(0,0),z=h.getAllBlocks(!1).filter(Oe=>Oe.id!=l.id).map(Oe=>Oe.getRelativeToSurfaceXY());for(;c2(_n.sum(E,k),z)||u2(l,k,m);)h.RTL?k.translate(-m,2*m):k.translate(m,2*m);l.moveTo(_n.sum(E,k))},c2=function(l,h){return h.some(m=>1>=Math.abs(m.x-l.x)&&1>=Math.abs(m.y-l.y))},u2=function(l,h,m){return l.getConnections_(!1).some(E=>!!E.closest(m,h).connection)},ZM=function(l){return Tt("Blockly.clipboard.copy","v11","v12","myCopyable.toCopyData()"),_A.copyInternal(l)},qy=function(l){const h=l.toCopyData();pA=h;let m;return mA=(m=l.workspace)!=null?m:null,h},Vd=function(l,h,m){return l&&h?ek(l,h,m):pA&&mA?ek(pA,mA):null},ek=function(l,h,m){let E;h=(E=h.getRootWorkspace())!=null?E:h;let k,z;return(z=(k=u(Jt.PASTER,l.paster,!1))==null?void 0:k.paste(l,h,m))!=null?z:null},tk=function(l){return Tt("Blockly.clipboard.duplicate","v11","v12","Blockly.clipboard.paste(myCopyable.toCopyData(), myWorkspace)"),_A.duplicateInternal(l)},nk=function(l){const h=l.toCopyData();return h?Vd(h,l.workspace):null},su=function(l,h){l.setAttribute(PG,h)},bo=function(l,h,m){Array.isArray(m)&&(m=m.join(" ")),l.setAttribute(xG+h,`${m}`)},Sp=function(){return jh},d2=function(l){if(jh=l,l===null){let h;(h=document.querySelector("."+bA))==null||h.remove()}},Jy=function(){document.querySelector("."+bA)||(jh=document.createElement("div"),jh.className=bA,(L()||document.body).appendChild(jh))},xb=function(l,h,m){Wu(),fT=l,dL=m,(l=jh)&&(l.style.direction=h?"rtl":"ltr",l.style.display="block",h=C(),gT=h.getRenderer().getClassName(),pT=h.getTheme().getClassName(),gT&&ke(l,gT),pT&&ke(l,pT))},Wu=function(){if(mI()){fT=null;var l=jh;l&&(l.style.display="none",l.style.left="",l.style.top="",dL&&dL(),dL=null,l.textContent="",gT&&(Ct(l,gT),gT=""),pT&&(Ct(l,pT),pT=""),C().markFocused())}},mI=function(){return!!fT},Ia=function(l){fT===l&&Wu()},Qy=function(l,h,m){jh.style.left=l+"px",jh.style.top=h+"px",jh.style.height=m+"px"},C_=function(l,h,m,E){const k=sk(l,h,m);l=ik(l,h,m,E),0>k?Qy(l,0,m.height+k):Qy(l,k,m.height)},ik=function(l,h,m,E){return E?Math.min(Math.max(h.right-m.width,l.left),l.right-m.width):Math.max(Math.min(h.left,l.right-m.width),l.left)},sk=function(l,h,m){return h.bottom+m.height>=l.bottom?h.top-m.height:h.bottom},h2=function(l){return!(l==null||!l.repositionForWindowResize)},ok=function(){h2(fT)&&fT.repositionForWindowResize()||Wu()},f2=function(){return hL},rk=function(l){hL=l},Zy=function(l,h,m){if(xb(lB,m,Nh),h.length){var E=y_(h,m);fL=E,g2(E,l,m),setTimeout(function(){E.focus()},1),hL=null}else Pb()},y_=function(l,h){const m=new vA;m.setRole(Lc.MENU);for(let E=0;E<l.length;E++){const k=l[E],z=new hT(k.text);z.setRightToLeft(h),z.setRole(Lc.MENUITEM),m.addChild(z),z.setEnabled(k.enabled),k.enabled&&z.onAction(function(){Pb(),requestAnimationFrame(()=>{setTimeout(()=>{k.callback(k.scope)},0)})},{})}return m},g2=function(l,h,m){const E=j();h=new lo(h.clientY+E.top,h.clientY+E.top,h.clientX+E.left,h.clientX+E.left),p2(l);const k=l.getSize();m&&(h.left+=k.width,h.right+=k.width,E.left+=k.width,E.right+=k.width),C_(E,h,k,m),l.focus()},p2=function(l){var h=Sp();if(!h)throw Error("Attempting to create a context menu when widget div is null");h=l.render(h),ke(h,"blocklyContextMenu"),ee(h,"contextmenu",null,_I),l.focus()},_I=function(l){l.preventDefault(),l.stopPropagation()},Pb=function(){Ia(lB),hL=null},Nh=function(){fL&&(fL.dispose(),fL=null)},t.callbackFactory$$module$build$src$core$contextmenu=function(l,h){return()=>{t.disable$$module$build$src$core$events$utils();let m;try{m=h instanceof Element?yp(h,l.workspace):$b(h,l.workspace);const E=l.getRelativeToSurfaceXY();E.x=l.RTL?E.x-t.config$$module$build$src$core$config.snapRadius:E.x+t.config$$module$build$src$core$config.snapRadius,E.y+=2*t.config$$module$build$src$core$config.snapRadius,m.moveBy(E.x,E.y)}finally{t.enable$$module$build$src$core$events$utils()}return ge()&&!m.isShadow()&&q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(m)),m.select(),m}},Fb=function(l){return{text:t.Msg$$module$build$src$core$msg.REMOVE_COMMENT,enabled:!0,callback:function(){t.setGroup$$module$build$src$core$events$utils(!0),l.dispose(),t.setGroup$$module$build$src$core$events$utils(!1)}}},lk=function(l){return{text:t.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){const h=l.toCopyData();h&&Vd(h,l.workspace)}}},m2=function(l,h){const m={enabled:!0};return m.text=t.Msg$$module$build$src$core$msg.ADD_COMMENT,m.callback=function(){const E=new sa(l,t.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT,sa.DEFAULT_SIZE,sa.DEFAULT_SIZE);var k=l.getInjectionDiv().getBoundingClientRect();k=new _n(h.clientX-k.left,h.clientY-k.top);const z=l.getOriginOffsetInPixels();k=_n.difference(k,z),k.scale(1/l.scale),E.moveBy(k.x,k.y),l.rendered&&(E.initSvg(),E.render(),E.select())},m},Bb=function(l){return l*Math.PI/180},wp=function(l){return 180*l/Math.PI},La=function(l,h,m){if(m<l){const E=m;m=l,l=E}return Math.max(l,Math.min(h,m))},vI=function(){document.querySelector(".blocklyDropDownDiv")||(Is=document.createElement("div"),Is.className="blocklyDropDownDiv",(L()||document.body).appendChild(Is),vT=document.createElement("div"),vT.className="blocklyDropDownContent",Is.appendChild(vT),Y_=document.createElement("div"),Y_.className="blocklyDropDownArrow",Is.appendChild(Y_),Is.style.opacity="0",Is.style.transition="transform "+PE+"s, opacity "+PE+"s",Is.addEventListener("focusin",function(){ke(Is,"blocklyFocused")}),Is.addEventListener("focusout",function(){Ct(Is,"blocklyFocused")}))},ak=function(l){yA=l},ck=function(){return Bp},Hb=function(){return vT},bI=function(){vT.textContent="",vT.style.width=""},TI=function(l,h){Is.style.backgroundColor=l,Is.style.borderColor=h},E_=function(l,h,m,E){return ei(Yt(h),l,m,E)},bt=function(l,h,m){return cB=!0,ei(xt(l),l,h,m)},Yt=function(l){var h=l.getSvgRoot();const m=l.workspace.scale,E=l.height*m;return l=l.width*m,h=Zn(h),new lo(h.y,h.y+E,h.x,h.x+l)},xt=function(l){return l=l.getScaledBBox(),new lo(l.top,l.bottom,l.left,l.right)},ei=function(l,h,m,E){const k=l.left+(l.right-l.left)/2,z=l.bottom;l=l.top,E&&(l+=E),E=h.getSourceBlock();let Oe=E.workspace;for(;Oe.options.parentWorkspace;)Oe=Oe.options.parentWorkspace;return ak(Oe.getParentSvg().parentNode),Pi(h,E.RTL,k,z,k,l,m)},Pi=function(l,h,m,E,k,z,Oe){return Bp=l,X_=Oe||null,Is.style.direction=h?"rtl":"ltr",l=C(),mT=l.getRenderer().getClassName(),_T=l.getTheme().getClassName(),mT&&ke(Is,mT),_T&&ke(Is,_T),Ip(m,E,k,z)},zs=function(l,h,m,E){return l=S_(l,m.left,m.right,E.width),{initialX:l.divX,initialY:h,finalX:l.divX,finalY:h+pL,arrowX:l.arrowX,arrowY:-(xE/2+TA),arrowAtTop:!0,arrowVisible:!0}},Wr=function(l,h,m,E){return l=S_(l,m.left,m.right,E.width),{initialX:l.divX,initialY:h-E.height,finalX:l.divX,finalY:h-E.height-pL,arrowX:l.arrowX,arrowY:E.height-2*TA-xE/2,arrowAtTop:!1,arrowVisible:!0}},To=function(l,h,m){return l=S_(l,h.left,h.right,m.width),{initialX:l.divX,initialY:0,finalX:l.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}},S_=function(l,h,m,E){return h=La(h,l-E/2,m-E),l=l-xE/2-h,m=aB,l=La(m,l,E-m-xE),{arrowX:l,divX:h}},uk=function(){return!!Bp},ql=function(l,h){return Bp===l?(h?Ud():w_(),!0):!1},w_=function(){Is.style.transform="translate(0, 0)",Is.style.opacity="0",CA=setTimeout(function(){Ud()},1e3*PE),X_&&(X_(),X_=null)},Ud=function(){uk()&&(CA&&clearTimeout(CA),Is.style.transform="",Is.style.left="",Is.style.top="",Is.style.opacity="0",Is.style.display="none",Is.style.backgroundColor="",Is.style.borderColor="",X_&&(X_(),X_=null),bI(),Bp=null,mT&&(Ct(Is,mT),mT=""),_T&&(Ct(Is,_T),_T=""),C().markFocused())},Ip=function(l,h,m,E){l=EA.getPositionMetrics(l,h,m,E),l.arrowVisible?(Y_.style.display="",Y_.style.transform="translate("+l.arrowX+"px,"+l.arrowY+"px) rotate(45deg)",Y_.setAttribute("class",l.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):Y_.style.display="none",h=Math.floor(l.initialX),m=Math.floor(l.initialY),E=Math.floor(l.finalX);const k=Math.floor(l.finalY);return Is.style.left=h+"px",Is.style.top=m+"px",Is.style.display="block",Is.style.opacity="1",Is.style.transform="translate("+(E-h)+"px,"+(k-m)+"px)",!!l.arrowAtTop},Vb=function(){if(Bp){var l=Bp.getSourceBlock();l=cB?xt(Bp):Yt(l);const h=l.left+(l.right-l.left)/2;Ip(h,l.bottom,h,l.top)}else w_()},Ub=function(l){if(!(100<l.getDescendants(!1).length)){var h=l.workspace,m=l.getSvgRoot();h.getAudioManager().play("delete");var E=h.getSvgXY(m);m=m.cloneNode(!0),m.setAttribute("transform","translate("+E.x+","+E.y+")"),h.getParentSvg().appendChild(m),no(m,{x:E.x,y:E.y,width:l.width,height:l.height},h.RTL,new Date,h.scale)}},no=function(l,h,m,E,k){const z=(new Date().getTime()-E.getTime())/150;1<z?Ot(l):(l.setAttribute("transform","translate("+(h.x+(m?-1:1)*h.width*k/2*z)+","+(h.y+h.height*k*z)+") scale("+(1-z)*k+")"),setTimeout(no,10,l,h,m,E,k))},CI=function(l){var h=l.workspace;const m=h.scale;if(h.getAudioManager().play("click"),!(1>m)){var E=h.getSvgXY(l.getSvgRoot());l.outputConnection?(E.x+=(l.RTL?3:-3)*m,E.y+=13*m):l.previousConnection&&(E.x+=(l.RTL?-23:23)*m,E.y+=3*m);var k=He(pt.CIRCLE,{cx:E.x,cy:E.y,r:0,fill:"none",stroke:"#888","stroke-width":10},h.getParentSvg());l=He(pt.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*m},k),h=He(pt.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},k),l.beginElement(),h.beginElement(),setTimeout(()=>void Ot(k),150)}},yI=function(l){if(Gb(),l.workspace.getAudioManager().play("disconnect"),!(1>l.workspace.scale)){var h=l.getHeightWidth().height;h=Math.atan(10/h)/Math.PI*180,l.RTL||(h*=-1),FE=l,Wb(l,h,new Date)}},Wb=function(l,h,m){const E=(new Date().getTime()-m.getTime())/200;let k="";1>=E&&(k=`skewX(${Math.round(Math.sin(E*Math.PI*3)*(1-E)*h)})`,mL=setTimeout(Wb,10,l,h,m)),l.getSvgRoot().setAttribute("transform",`${l.getTranslation()} ${k}`)},Gb=function(){FE&&(mL&&(clearTimeout(mL),mL=null),FE.getSvgRoot().setAttribute("transform",FE.getTranslation()),FE=null)},_2=function(l,h){return Tt("Blockly.utils.string.startsWith()","April 2022","April 2023","Use built-in string.startsWith"),l.startsWith(h)},eE=function(l){return l.length?l.reduce(function(h,m){return h.length<m.length?h:m}).length:0},zb=function(l,h){if(!l.length)return 0;if(l.length===1)return l[0].length;let m=0;h=h||eE(l);let E;for(E=0;E<h;E++){for(var k=l[0][E],z=1;z<l.length;z++)if(k!==l[z][E])return m;k===" "&&(m=E+1)}for(k=1;k<l.length;k++)if((z=l[k][E])&&z!==" ")return m;return h},Dh=function(l,h){if(!l.length)return 0;if(l.length===1)return l[0].length;let m=0;h=h||eE(l);let E;for(E=0;E<h;E++){for(var k=l[0].substr(-E-1,1),z=1;z<l.length;z++)if(k!==l[z].substr(-E-1,1))return m;k===" "&&(m=E+1)}for(k=1;k<l.length;k++)if((z=l[k].charAt(l[k].length-E-1))&&z!==" ")return m;return h},t.wrap$$module$build$src$core$utils$string=function(l,h){l=l.split(`
- `);for(let m=0;m<l.length;m++)l[m]=tE(l[m],h);return l.join(`
- `)},tE=function(l,h){if(l.length<=h)return l;const m=l.trim().split(/\s+/);for(var E=0;E<m.length;E++)m[E].length>h&&(h=m[E].length);var k=-1/0;let z,Oe=1;do{E=k,z=l,l=[],k=m.length/Oe;let Je=1;for(let Ht=0;Ht<m.length-1;Ht++)Je<(Ht+1.5)/k?(Je++,l[Ht]=!0):l[Ht]=!1;l=Kb(m,l,h),k=nE(m,l,h),l=dk(m,l),Oe++}while(k>E);return z},nE=function(l,h,m){const E=[0],k=[];for(var z=0;z<l.length;z++)E[E.length-1]+=l[z].length,h[z]===!0?(E.push(0),k.push(l[z].charAt(l[z].length-1))):h[z]===!1&&E[E.length-1]++;for(l=Math.max(...E),h=0,z=0;z<E.length;z++)h-=2*Math.pow(Math.abs(m-E[z]),1.5),h-=Math.pow(l-E[z],1.5),".?!".indexOf(k[z])!==-1?h+=m/3:",;)]}".indexOf(k[z])!==-1&&(h+=m/4);return 1<E.length&&E[E.length-1]<=E[E.length-2]&&(h+=.5),h},Kb=function(l,h,m){let E=nE(l,h,m),k;for(let z=0;z<h.length-1;z++){if(h[z]===h[z+1])continue;const Oe=[].concat(h);Oe[z]=!Oe[z],Oe[z+1]=!Oe[z+1];const Je=nE(l,Oe,m);Je>E&&(E=Je,k=Oe)}return k?Kb(l,k,m):h},dk=function(l,h){const m=[];for(let E=0;E<l.length;E++)m.push(l[E]),h[E]!==void 0&&m.push(h[E]?`
- `:" ");return m.join("")},t.isNumber$$module$build$src$core$utils$string=function(l){return/^\s*-?\d+(\.\d+)?\s*$/.test(l)},hk=function(l){HE=l},iE=function(){return HE},fk=function(){return VE},jb=function(){return el},Gu=function(l){if(l=Xb(l)){for(l=l.tooltip;typeof l=="function";)l=l();if(typeof l!="string")throw Error("Tooltip function must return a string.");return l}return""},Xb=function(l){for(;l&&l.tooltip;){if(typeof l.tooltip=="string"||typeof l.tooltip=="function")return l;l=l.tooltip}return null},gk=function(){document.querySelector(".blocklyTooltipDiv")||(el=document.createElement("div"),el.className="blocklyTooltipDiv",(L()||document.body).appendChild(el))},Yb=function(l){l.mouseOverWrapper_=ye(l,"pointerover",null,sE),l.mouseOutWrapper_=ye(l,"pointerout",null,oE),l.addEventListener("pointermove",rE,!1)},EI=function(l){l&&(Me(l.mouseOverWrapper_),Me(l.mouseOutWrapper_),l.removeEventListener("pointermove",rE))},sE=function(l){TT||(l=Xb(l.currentTarget),Oc!==l&&($h(),CT=null,Oc=l),clearTimeout(UE))},oE=function(l){TT||(UE=setTimeout(function(){CT=Oc=null,$h()},1),clearTimeout(qh),qh=0)},rE=function(l){if(Oc&&Oc.tooltip&&!TT)if(VE){const h=LA-l.pageX;l=OA-l.pageY,Math.sqrt(h*h+l*l)>hB&&$h()}else CT!==Oc&&(clearTimeout(qh),LA=l.pageX,OA=l.pageY,qh=setTimeout(b2,fB))},pk=function(){CT=Oc=null,$h()},$h=function(){VE&&(VE=!1,el&&(el.style.display="none")),qh&&(clearTimeout(qh),qh=0)},mk=function(){$h(),TT=!0},_k=function(){TT=!1},Jr=function(){el&&Oc&&(typeof HE=="function"?HE(el,Oc):Jl())},Jl=function(){var l=Gu(Oc);l=t.wrap$$module$build$src$core$utils$string(l,dB),l=l.split(`
- `);for(let h=0;h<l.length;h++){const m=document.createElement("div");m.appendChild(document.createTextNode(l[h])),el.appendChild(m)}},v2=function(l){const h=document.documentElement.clientWidth,m=document.documentElement.clientHeight;let E=LA;E=l?E-(RA+el.offsetWidth):E+RA;let k=OA+MA;return k+el.offsetHeight>m+window.scrollY&&(k-=el.offsetHeight+2*MA),l?E=Math.max(bL-window.scrollX,E):E+el.offsetWidth>h+window.scrollX-2*bL&&(E=h-el.offsetWidth-2*bL),{x:E,y:k}},b2=function(){if(!TT&&(CT=Oc,el)){el.textContent="",Jr();var l=Oc.RTL;el.style.direction=l?"rtl":"ltr",el.style.display="block",VE=!0;var{x:h,y:m}=v2(l);el.style.left=h+"px",el.style.top=m+"px"}},xh=function(l,h){for(const m in h)l[m]=h[m]!==null&&typeof h[m]=="object"?xh(l[m]||Object.create(null),h[m]):h[m];return l},Lp=function(l){return l.bubbleIsVisible!==void 0&&l.setBubbleVisible!==void 0},qb=function(){return AA},I_=function(l){AA=l},Jb=function(){return Jh},Op=function(l){Jh=l},zu=function(l){l=`${l}`.toLowerCase().trim();var h=mB[l];if(h||(h=l.substring(0,2)==="0x"?"#"+l.substring(2):l,h=h[0]==="#"?h:"#"+h,/^#[0-9a-f]{6}$/.test(h)))return h;if(/^#[0-9a-f]{3}$/.test(h))return["#",h[1],h[1],h[2],h[2],h[3],h[3]].join("");var m=l.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return m&&(l=Number(m[1]),h=Number(m[2]),m=Number(m[3]),0<=l&&256>l&&0<=h&&256>h&&0<=m&&256>m)?sg(l,h,m):null},sg=function(l,h,m){return h=l<<16|h<<8|m,16>l?"#"+(16777216|h).toString(16).substr(1):"#"+h.toString(16)},L_=function(l){return l=zu(l),l?(l=parseInt(l.substr(1),16),[l>>16,l>>8&255,l&255]):[0,0,0]},og=function(l,h,m){let E=0,k=0,z=0;if(h===0)z=k=E=m;else{const Oe=Math.floor(l/60),Je=l/60-Oe;l=m*(1-h);const Ht=m*(1-h*Je);switch(h=m*(1-h*(1-Je)),Oe){case 1:E=Ht,k=m,z=l;break;case 2:E=l,k=m,z=h;break;case 3:E=l,k=Ht,z=m;break;case 4:E=h,k=l,z=m;break;case 5:E=m,k=l,z=Ht;break;case 6:case 0:E=m,k=h,z=l}}return sg(Math.floor(E),Math.floor(k),Math.floor(z))},O_=function(l,h,m){return l=zu(l),!l||(h=zu(h),!h)?null:(l=L_(l),h=L_(h),sg(Math.round(h[0]+m*(l[0]-h[0])),Math.round(h[1]+m*(l[1]-h[1])),Math.round(h[2]+m*(l[2]-h[2]))))},vk=function(l){return og(l,AA,255*Jh)},SI=function(l,h,m){const E=[];var k=l.split("");k.push("");var z=0;l=[];let Oe=null;for(let kn=0;kn<k.length;kn++){var Je=k[kn];if(z===0)if(Je==="%")(z=l.join(""))&&E.push(z),l.length=0,z=1;else if(m&&Je===`
- `){const Qo=l.join("");Qo&&E.push(Qo),l.length=0,E.push(Je)}else l.push(Je);else if(z===1)Je==="%"?(l.push(Je),z=0):h&&"0"<=Je&&"9">=Je?(z=2,Oe=Je,(Je=l.join(""))&&E.push(Je),l.length=0):Je==="{"?z=3:(l.push("%",Je),z=0);else if(z===2)if("0"<=Je&&"9">=Je)Oe+=Je;else{var Ht=void 0;E.push(parseInt((Ht=Oe)!=null?Ht:"",10)),kn--,z=0}else z===3&&(Je===""?(l.splice(0,0,"%{"),kn--,z=0):Je!=="}"?l.push(Je):(z=l.join(""),/[A-Z]\w*/i.test(z)?(Je=z.toUpperCase(),(Je=Je.startsWith("BKY_")?Je.substring(4):null)&&Je in t.Msg$$module$build$src$core$msg?(z=t.Msg$$module$build$src$core$msg[Je],typeof z=="string"?Array.prototype.push.apply(E,SI(z,h,m)):h?E.push(`${z}`):E.push(z)):E.push("%{"+z+"}")):E.push("%{"+z+"}"),z=l.length=0))}for((h=l.join(""))&&E.push(h),Ht=[],l.length=0,k=0;k<E.length;k++)typeof E[k]!="string"||m&&E[k]===`
- `?((h=l.join(""))&&Ht.push(h),l.length=0,Ht.push(E[k])):l.push(E[k]);return(h=l.join(""))&&Ht.push(h),l.length=0,Ht},bk=function(l){return SI(l,!0,!0)},Tr=function(l){return typeof l!="string"?l:(l=SI(l,!1,!1),l.length?String(l[0]):"")},lE=function(l){let h=!0;const m=t.Msg$$module$build$src$core$msg,E=l.match(/%{BKY_[A-Z]\w*}/gi);if(E)for(let k=0;k<E.length;k++){const z=E[k].toUpperCase();m[z.slice(6,-1)]===void 0&&(console.warn("No message string for "+E[k]+" in "+l),h=!1)}return h},Ph=function(l){const h=typeof l=="string"?Tr(l):l;var m=Number(h);if(!isNaN(m)&&0<=m&&360>=m)return{hue:m,hex:og(m,qb(),255*Jb())};if(m=zu(h))return{hue:null,hex:m};throw m='Invalid colour: "'+h+'"',l!==h&&(m+=' (from "'+l+'")'),Error(m)},rg=function(l){return l.getProcedureModel!==void 0&&l.doProcedureUpdate!==void 0&&l.isProcedureDef!==void 0},Be=function(l){return l.startPublishing!==void 0&&l.stopPublishing!==void 0},Rl=function(l,h){i(Jt.FIELD,l,h)},aE=function(l){o(Jt.FIELD,l)},t.fromJson$$module$build$src$core$field_registry=function(l){return Qh.fromJsonInternal(l)},ou=function(l){const h=u(Jt.FIELD,l.type);if(h){if(typeof h.fromJson!="function")throw new TypeError("returned Field was not a IRegistrableField");return h.fromJson(l)}return console.warn("Blockly could not create a field of type "+l.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null},bs=function(l){let h=!1;const m=l.map(([Oe,Je])=>typeof Oe=="string"?[Tr(Oe),Je]:(h=!0,[Oe.alt!==null?Object.assign({},Oe,{alt:Tr(Oe.alt)}):Object.assign({},Oe),Je]));if(h||2>l.length)return{options:m};var E=m.map(([Oe])=>Oe),k=eE(E);l=zb(E,k);const z=Dh(E,k);return!l&&!z||k<=l+z?{options:m}:(k=l?E[0].substring(0,l-1):void 0,E=z?E[0].substr(1-z):void 0,{options:T2(m,l,z),prefix:k,suffix:E})},T2=function(l,h,m){return l.map(([E,k])=>[E.substring(h,E.length-m),k])},Tk=function(l){if(!Array.isArray(l))throw TypeError("FieldDropdown options must be an array.");if(!l.length)throw TypeError("FieldDropdown options must not be an empty array.");let h=!1;for(let m=0;m<l.length;m++){const E=l[m];Array.isArray(E)?typeof E[1]!="string"?(h=!0,console.error("Invalid option["+m+"]: Each FieldDropdown option id must be a string. Found "+E[1]+" in: ",E)):E[0]&&typeof E[0]!="string"&&typeof E[0].src!="string"&&(h=!0,console.error("Invalid option["+m+"]: Each FieldDropdown option must have a string label or image description. Found"+E[0]+" in: ",E)):(h=!0,console.error("Invalid option["+m+"]: Each FieldDropdown option must be an array. Found: ",E))}if(h)throw TypeError("Found invalid FieldDropdown options.")},t.register$$module$build$src$core$extensions=function(l,h){if(typeof l!="string"||l.trim()==="")throw Error('Error: Invalid extension name "'+l+'"');if(yT[l])throw Error('Error: Extension "'+l+'" is already registered.');if(typeof h!="function")throw Error('Error: Extension "'+l+'" must be a function');yT[l]=h},t.registerMixin$$module$build$src$core$extensions=function(l,h){if(!h||typeof h!="object")throw Error('Error: Mixin "'+l+'" must be a object');t.register$$module$build$src$core$extensions(l,function(){this.mixin(h)})},t.registerMutator$$module$build$src$core$extensions=function(l,h,m,E){const k='Error when registering mutator "'+l+'": ';yk(k,h);const z=Ck(h,k);if(m&&typeof m!="function")throw Error(k+'Extension "'+l+'" is not a function');t.register$$module$build$src$core$extensions(l,function(){z&&this.setMutator(new t.MutatorIcon$$module$build$src$core$icons$mutator_icon(E||[],this)),this.mixin(h),m&&m.apply(this)})},C2=function(l){lg(l)?delete yT[l]:console.warn('No extension mapping for name "'+l+'" found to unregister')},lg=function(l){return!!yT[l]},wI=function(l,h,m){const E=yT[l];if(typeof E!="function")throw Error('Error: Extension "'+l+'" not found.');let k;if(m?y2(l,h):k=II(h),E.apply(h),m)yk('Error after applying mutator "'+l+'": ',h);else if(!w2(k,h))throw Error('Error when applying extension "'+l+'": mutation properties changed when applying a non-mutator extension.')},y2=function(l,h){if(II(h).length)throw Error('Error: tried to apply mutation "'+l+'" to a block that already has mutator functions. Block id: '+h.id)},E2=function(l,h){return Ku(l.mutationToDom,l.domToMutation,h+" mutationToDom/domToMutation")},S2=function(l,h){return Ku(l.saveExtraState,l.loadExtraState,h+" saveExtraState/loadExtraState")},Ck=function(l,h){return Ku(l.compose,l.decompose,h+" compose/decompose")},Ku=function(l,h,m){if(l&&h){if(typeof l!="function"||typeof h!="function")throw Error(m+" must be a function");return!0}if(!l&&!h)return!1;throw Error(m+"Must have both or neither functions")},yk=function(l,h){const m=E2(h,l),E=S2(h,l);if(!m&&!E)throw Error(l+"Mutations must contain either XML hooks, or JSON hooks, or both");Ck(h,l)},II=function(l){const h=[];return l.domToMutation!==void 0&&h.push(l.domToMutation),l.mutationToDom!==void 0&&h.push(l.mutationToDom),l.saveExtraState!==void 0&&h.push(l.saveExtraState),l.loadExtraState!==void 0&&h.push(l.loadExtraState),l.compose!==void 0&&h.push(l.compose),l.decompose!==void 0&&h.push(l.decompose),h},w2=function(l,h){if(h=II(h),h.length!==l.length)return!1;for(let m=0;m<h.length;m++)if(l[m]!==h[m])return!1;return!0},I2=function(l){if(typeof document!="object")throw Error("runAfterPageLoad() requires browser document.");if(document.readyState==="complete")l();else{const h=setInterval(function(){document.readyState==="complete"&&(clearInterval(h),l())},10)}},t.buildTooltipForDropdown$$module$build$src$core$extensions=function(l,h){const m=[];return function(){m.indexOf(this.type)===-1&&(L2(this,l,h),m.push(this.type)),this.setTooltip((function(){const E=String(this.getFieldValue(l));return Tr(h[E])}).bind(this))}},L2=function(l,h,m){var E=l.getField(h);if(E instanceof du&&!E.isOptionListDynamic()){E=E.getOptions();for(const[,k]of E)m[k]===void 0&&console.warn(`No tooltip mapping for value ${k} of field ${h} of block type ${l.type}.`)}},t.buildTooltipWithFieldText$$module$build$src$core$extensions=function(l,h){return function(){this.setTooltip((function(){const m=this.getField(h);return Tr(l).replace("%1",m?m.getText():"")}).bind(this))}},Fh=function(){const l=this.tooltip;this.setTooltip((function(){const h=this.getParent();return h&&h.getInputsInline()&&h.tooltip||l}).bind(this))},ci=function(l,h){return" "+l+","+h+" "},Cc=function(l,h){return" "+l+h.join("")},pl=function(l,h){return" M "+l+","+h+" "},Bo=function(l,h){return" m "+l+","+h+" "},Bh=function(l,h){return" l "+l+","+h+" "},ju=function(l){return" l"+l.join("")},Vn=function(l,h){return" "+l+" "+h+" "},Mr=function(l,h,m,E){return l+" "+m+" "+m+" "+h+E},ru=function(l,h){i(Jt.ICON,l.toString(),h)},O2=function(l){o(Jt.ICON,l)},LI=function(l){const h=l.getProcedureMap().getProcedures().filter(E=>!E.getReturnTypes()).map(E=>[E.getName(),E.getParameters().map(k=>k.getName()),!1]);l.getBlocksByType("procedures_defnoreturn",!1).forEach(E=>{!rg(E)&&b_(E)&&h.push(E.getProcedureDef())});const m=l.getProcedureMap().getProcedures().filter(E=>!!E.getReturnTypes()).map(E=>[E.getName(),E.getParameters().map(k=>k.getName()),!0]);return l.getBlocksByType("procedures_defreturn",!1).forEach(E=>{!rg(E)&&b_(E)&&m.push(E.getProcedureDef())}),h.sort(Ek),m.sort(Ek),[h,m]},Ek=function(l,h){return l[0].localeCompare(h[0],void 0,{sensitivity:"base"})},t.findLegalName$$module$build$src$core$procedures=function(l,h){if(h.isInFlyout)return l;for(l=l||t.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!R2(l,h.workspace,h);){const m=l.match(/^(.*?)(\d+)$/);l=m?m[1]+(parseInt(m[2])+1):l+"2"}return l},R2=function(l,h,m){return!Sk(l,h,m)},Sk=function(l,h,m){for(const E of h.getAllBlocks(!1))if(E!==m&&b_(E)&&t.Names$$module$build$src$core$names.equals(E.getProcedureDef()[0],l))return!0;m=m&&rg(m)?m==null?void 0:m.getProcedureModel():void 0;for(const E of h.getProcedureMap().getProcedures())if(E!==m&&t.Names$$module$build$src$core$names.equals(E.getName(),l))return!0;return!1},t.rename$$module$build$src$core$procedures=function(l){var h=this.getSourceBlock();if(!h)throw new Co;l=l.trim();const m=t.findLegalName$$module$build$src$core$procedures(l,h);rg(h)&&!h.isInsertionMarker()&&h.getProcedureModel().setName(m);const E=this.getValue();if(E!==l&&E!==m)for(l=h.workspace.getAllBlocks(!1),h=0;h<l.length;h++){const k=l[h];k.renameProcedure&&k.renameProcedure(E,m)}return m},cE=function(l){function h(z,Oe){for(let Ht=0;Ht<z.length;Ht++){var Je=z[Ht][0];const kn=z[Ht][1],Qo=t.createElement$$module$build$src$core$utils$xml("block");Qo.setAttribute("type",Oe),Qo.setAttribute("gap","16");const Vo=t.createElement$$module$build$src$core$utils$xml("mutation");for(Vo.setAttribute("name",Je),Qo.appendChild(Vo),Je=0;Je<kn.length;Je++){const sd=t.createElement$$module$build$src$core$utils$xml("arg");sd.setAttribute("name",kn[Je]),Vo.appendChild(sd)}m.push(Qo)}}const m=[];if(ea.procedures_defnoreturn){var E=t.createElement$$module$build$src$core$utils$xml("block");E.setAttribute("type","procedures_defnoreturn"),E.setAttribute("gap","16");var k=t.createElement$$module$build$src$core$utils$xml("field");k.setAttribute("name","NAME"),k.appendChild(t.createTextNode$$module$build$src$core$utils$xml(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE)),E.appendChild(k),m.push(E)}return ea.procedures_defreturn&&(E=t.createElement$$module$build$src$core$utils$xml("block"),E.setAttribute("type","procedures_defreturn"),E.setAttribute("gap","16"),k=t.createElement$$module$build$src$core$utils$xml("field"),k.setAttribute("name","NAME"),k.appendChild(t.createTextNode$$module$build$src$core$utils$xml(t.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE)),E.appendChild(k),m.push(E)),ea.procedures_ifreturn&&(E=t.createElement$$module$build$src$core$utils$xml("block"),E.setAttribute("type","procedures_ifreturn"),E.setAttribute("gap","16"),m.push(E)),m.length&&m[m.length-1].setAttribute("gap","24"),l=LI(l),h(l[0],"procedures_callnoreturn"),h(l[1],"procedures_callreturn"),m},OI=function(l){var h=[],m=l.getBlocksByType("procedures_mutatorarg",!1);for(let z=0,Oe;Oe=m[z];z++)h.push(Oe.getFieldValue("NAME"));m=t.createElement$$module$build$src$core$utils$xml("xml");const E=t.createElement$$module$build$src$core$utils$xml("block");E.setAttribute("type","procedures_mutatorarg");const k=t.createElement$$module$build$src$core$utils$xml("field");k.setAttribute("name","NAME"),h=Ky(t.DEFAULT_ARG$$module$build$src$core$procedures,h),h=t.createTextNode$$module$build$src$core$utils$xml(h),k.appendChild(h),E.appendChild(k),m.appendChild(E),l.updateToolbox(m)},wk=function(l){if(l.type===Gd&&l.bubbleType==="mutator"&&l.isOpen&&l.blockId){l=g(l.workspaceId).getBlockById(l.blockId);var h=l.type;(h==="procedures_defnoreturn"||h==="procedures_defreturn")&&(l=l.getIcon(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE).getWorkspace(),OI(l),l.addChangeListener(M2))}},M2=function(l){(l.type===t.CREATE$$module$build$src$core$events$utils||l.type===t.DELETE$$module$build$src$core$events$utils||l.type===t.CHANGE$$module$build$src$core$events$utils||l.type===Np)&&(l=g(l.workspaceId),OI(l))},uE=function(l,h){return h.getAllBlocks(!1).filter(m=>Qb(m,l)||YF(m)&&t.Names$$module$build$src$core$names.equals(m.getProcedureCall(),l))},Qb=function(l,h){return rg(l)&&!l.isProcedureDef()&&l.getProcedureModel()&&t.Names$$module$build$src$core$names.equals(l.getProcedureModel().getName(),h)},t.mutateCallers$$module$build$src$core$procedures=function(l){const h=de();var m=l.getProcedureDef()[0];const E=l.mutationToDom(!0);l=uE(m,l.workspace);for(let z=0,Oe;Oe=l[z];z++){m=(m=Oe.mutationToDom())&&me(m),Oe.domToMutation&&Oe.domToMutation(E);var k=Oe.mutationToDom();k=k&&me(k),m!==k&&(Q(!1),q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(Oe,"mutation",null,m,k)),Q(h))}},t.getDefinition$$module$build$src$core$procedures=function(l,h){for(const m of h.getAllBlocks(!1))if(rg(m)&&m.isProcedureDef()&&t.Names$$module$build$src$core$names.equals(m.getProcedureModel().getName(),l)||b_(m)&&t.Names$$module$build$src$core$names.equals(m.getProcedureDef()[0],l))return m;return null},R_=function(l){return l.isDynamic},k2=function(l){return l.pathDown!==void 0&&l.pathUp!==void 0},Ik=function(l){return l.pathLeft!==void 0&&l.pathRight!==void 0},dE=function(l){let h=l.outputConnection;return(!h||l.previousConnection&&l.previousConnection.isConnected())&&(h=l.previousConnection),h},Hh=function(l,h){if(!l||!h)throw Error("Cannot connect null connections.");l.targetConnection=h,h.targetConnection=l},RI=function(l,h){let m=null;h=h.outputConnection;const E=h==null?void 0:h.getConnectionChecker();for(let k=0,z;z=l.inputList[k];k++){const Oe=z.connection;let Je;if(Oe&&((Je=E)!=null&&Je.canConnect(h,Oe,!1))){if(m)return null;m=Oe}}return m},Rp=function(l,h){let m;for(;m=RI(l,h);)if(l=m.targetBlock(),!l||l.isShadow())return m;return null},Ql=function(l,h){i(Jt.RENDERER,l,h)},A2=function(l){o(Jt.RENDERER,l)},MI=function(l,h,m){return l=new(c(Jt.RENDERER,l))(l),l.init(h,m),l},kI=function(l){T_(l.getTargetWorkspace(),void 0,"String")},M_=function(l){T_(l.getTargetWorkspace(),void 0,"Number")},Vh=function(l){T_(l.getTargetWorkspace(),void 0,"Colour")},hE=function(l){let h=[],m=document.createElement("button");return m.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),m.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),h.push(m),m=document.createElement("button"),m.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),m.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),h.push(m),m=document.createElement("button"),m.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),m.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),h.push(m),l.registerButtonCallback("CREATE_VARIABLE_STRING",kI),l.registerButtonCallback("CREATE_VARIABLE_NUMBER",M_),l.registerButtonCallback("CREATE_VARIABLE_COLOUR",Vh),l=Lk(l),h=h.concat(l)},Lk=function(l){l=l.getAllVariables();const h=[];if(0<l.length){if(ea.variables_set_dynamic){var m=l[l.length-1];const E=t.createElement$$module$build$src$core$utils$xml("block");E.setAttribute("type","variables_set_dynamic"),E.setAttribute("gap","24"),E.appendChild(Tp(m)),h.push(E)}if(ea.variables_get_dynamic){l.sort(cT.compareByName);for(let E=0,k;k=l[E];E++)m=t.createElement$$module$build$src$core$utils$xml("block"),m.setAttribute("type","variables_get_dynamic"),m.setAttribute("gap","8"),m.appendChild(Tp(k)),h.push(m)}}return h},Mp=function(l){return l.toCopyData!==void 0},Ok=function(){Bs.registry.register({name:nf.ESCAPE,preconditionFn(l){return!l.options.readOnly},callback(l){return l.hideChaff(),!0},keyCodes:[Vi.ESC]})},AI=function(){Bs.registry.register({name:nf.DELETE,preconditionFn(l){const h=w();return!l.options.readOnly&&h!=null&&h.isDeletable()},callback(l,h){return h.preventDefault(),pg.inProgress()?!1:(w().checkAndDelete(),!0)},keyCodes:[Vi.DELETE,Vi.BACKSPACE]})},ml=function(){const l=Bs.registry.createSerializedKey(Vi.C,[Vi.CTRL]),h=Bs.registry.createSerializedKey(Vi.C,[Vi.ALT]),m=Bs.registry.createSerializedKey(Vi.C,[Vi.META]);Bs.registry.register({name:nf.COPY,preconditionFn(E){const k=w();return!E.options.readOnly&&!pg.inProgress()&&k!=null&&k.isDeletable()&&k.isMovable()&&Mp(k)},callback(E,k){return k.preventDefault(),E.hideChaff(),k=w(),!k||!Mp(k)?!1:(tS=k.toCopyData(),DL=E,!!tS)},keyCodes:[l,h,m]})},fE=function(){const l=Bs.registry.createSerializedKey(Vi.X,[Vi.CTRL]),h=Bs.registry.createSerializedKey(Vi.X,[Vi.ALT]),m=Bs.registry.createSerializedKey(Vi.X,[Vi.META]);Bs.registry.register({name:nf.CUT,preconditionFn(E){const k=w();return!E.options.readOnly&&!pg.inProgress()&&k!=null&&k instanceof tf&&k.isDeletable()&&k.isMovable()&&!k.workspace.isFlyout},callback(E){const k=w();return!k||!Mp(k)?!1:(tS=k.toCopyData(),DL=E,k.checkAndDelete(),!0)},keyCodes:[l,h,m]})},NI=function(){const l=Bs.registry.createSerializedKey(Vi.V,[Vi.CTRL]),h=Bs.registry.createSerializedKey(Vi.V,[Vi.ALT]),m=Bs.registry.createSerializedKey(Vi.V,[Vi.META]);Bs.registry.register({name:nf.PASTE,preconditionFn(E){return!E.options.readOnly&&!pg.inProgress()},callback(){return tS&&DL?!!Vd(tS,DL):!1},keyCodes:[l,h,m]})},Xu=function(){const l=Bs.registry.createSerializedKey(Vi.Z,[Vi.CTRL]),h=Bs.registry.createSerializedKey(Vi.Z,[Vi.ALT]),m=Bs.registry.createSerializedKey(Vi.Z,[Vi.META]);Bs.registry.register({name:nf.UNDO,preconditionFn(E){return!E.options.readOnly&&!pg.inProgress()},callback(E){return E.hideChaff(),E.undo(!1),!0},keyCodes:[l,h,m]})},gE=function(){const l=Bs.registry.createSerializedKey(Vi.Z,[Vi.SHIFT,Vi.CTRL]),h=Bs.registry.createSerializedKey(Vi.Z,[Vi.SHIFT,Vi.ALT]),m=Bs.registry.createSerializedKey(Vi.Z,[Vi.SHIFT,Vi.META]),E=Bs.registry.createSerializedKey(Vi.Y,[Vi.CTRL]);Bs.registry.register({name:nf.REDO,preconditionFn(k){return!pg.inProgress()&&!k.options.readOnly},callback(k){return k.hideChaff(),k.undo(!0),!0},keyCodes:[l,h,m,E]})},Zb=function(){Ok(),AI(),ml(),fE(),NI(),Xu(),gE()},ag=function(l){const h={id:l.getId(),name:l.getName(),returnTypes:l.getReturnTypes()};return l.getParameters().length&&(h.parameters=l.getParameters().map(m=>DI(m))),h},DI=function(l){const h={id:l.getId(),name:l.getName()};return l.getTypes().length&&(h.types=l.getTypes()),h},Zl=function(l,h,m,E){if(l=new l(E,m.name,m.id).setReturnTypes(m.returnTypes),!m.parameters)return l;for(const[k,z]of m.parameters.entries())l.insertParameter(pE(h,z,E),k);return l},pE=function(l,h,m){return l=new l(m,h.name,h.id),h.types&&l.setTypes(h.types),l},N2=function(l){const h=Object.create(null),m=d(Jt.SERIALIZER,!0);for(const E in m){let k;const z=(k=m[E])==null?void 0:k.save(l);z&&(h[E]=z)}return h},D2=function(l,h,{recordUndo:m=!1}={}){var E=d(Jt.SERIALIZER,!0);if(E){E=Object.entries(E).sort((z,Oe)=>Oe[1].priority-z[1].priority);var k=de();Q(m),(m=t.getGroup$$module$build$src$core$events$utils())||t.setGroup$$module$build$src$core$events$utils(!0),le(),h instanceof Qd&&h.setResizesEnabled(!1);for(const[,z]of E.reverse()){let Oe;(Oe=z)==null||Oe.clear(h)}for(let[z,Oe]of E.reverse())if(l[z]){let Je;(Je=Oe)==null||Je.load(l[z],h)}h instanceof Qd&&h.setResizesEnabled(!0),Fe(),q(new(Ne(qu))(h)),t.setGroup$$module$build$src$core$events$utils(m),Q(k)}},eT=function(l,h,m){const E=m.getBoundingRectangle(),k=E.right-E.left,z=La(h.top,E.top,h.top+h.height-(E.bottom-E.top))-E.top;let Oe=h.left;return h=h.left+h.width-k,l.RTL?Oe=Math.min(h,Oe):h=Math.max(Oe,h),(l=La(Oe,E.left,h)-E.left)||z?(m.moveBy(l,z,["inbounds"]),!0):!1},mE=function(l){return h=>{var m=l.getMetricsManager();if(m.hasFixedEdges()&&!l.isDragging()){var E;if(EE.indexOf((E=h.type)!=null?E:"")!==-1){E=m.getScrollMetrics(!0);const k=$2(l,h);k&&(m=t.getGroup$$module$build$src$core$events$utils()||!1,t.setGroup$$module$build$src$core$events$utils(h.group),eT(l,E,k)&&!h.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),t.setGroup$$module$build$src$core$events$utils(m))}else h.type===Gr&&h.scale&&h.oldScale&&h.scale>h.oldScale&&kp(l)}}},$2=function(l,h){let m=null;switch(h.type){case t.CREATE$$module$build$src$core$events$utils:case t.MOVE$$module$build$src$core$events$utils:(m=l.getBlockById(h.blockId))&&(m=m.getRootBlock());break;case ta:case au:m=l.getCommentById(h.commentId)}return m},kp=function(l){var h=l.getMetricsManager();if(h.hasFixedEdges()&&!l.isDragging()){h=h.getScrollMetrics(!0);var m=l.getTopBoundedElements();for(let E=0,k;k=m[E];E++)eT(l,h,k)}},$I=function(l,h){const m=[];for(const E of l.getIcons())(!Lp(E)||E.bubbleIsVisible())&&(m.push({location:h,icon:E}),E.onLocationChange(h));for(const E of l.getChildren(!1))m.push(...$I(E,_n.sum(h,E.relativeCoords)));return m},Rk=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.UNDO},preconditionFn(l){return 0<l.workspace.getUndoStack().length?"enabled":"disabled"},callback(l){l.workspace.undo(!1)},scopeType:Ks.ScopeType.WORKSPACE,id:"undoWorkspace",weight:1})},Mk=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.REDO},preconditionFn(l){return 0<l.workspace.getRedoStack().length?"enabled":"disabled"},callback(l){l.workspace.undo(!0)},scopeType:Ks.ScopeType.WORKSPACE,id:"redoWorkspace",weight:2})},k_=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.CLEAN_UP},preconditionFn(l){return l.workspace.isMovable()?1<l.workspace.getTopBlocks(!1).length?"enabled":"disabled":"hidden"},callback(l){l.workspace.cleanUp()},scopeType:Ks.ScopeType.WORKSPACE,id:"cleanWorkspace",weight:3})},kk=function(l,h){function m(z){k--,z.setCollapsed(l),k===0&&t.setGroup$$module$build$src$core$events$utils(!1)}let E=0,k=0;t.setGroup$$module$build$src$core$events$utils(!0);for(let z=0;z<h.length;z++){let Oe=h[z];for(;Oe;)k++,setTimeout(m.bind(null,Oe),E),Oe=Oe.getNextBlock(),E+=10}},Ak=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.COLLAPSE_ALL},preconditionFn(l){if(l.workspace.options.collapse){l=l.workspace.getTopBlocks(!1);for(let h=0;h<l.length;h++){let m=l[h];for(;m;){if(!m.isCollapsed())return"enabled";m=m.getNextBlock()}}return"disabled"}return"hidden"},callback(l){kk(!0,l.workspace.getTopBlocks(!0))},scopeType:Ks.ScopeType.WORKSPACE,id:"collapseWorkspace",weight:4})},_E=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.EXPAND_ALL},preconditionFn(l){if(l.workspace.options.collapse){l=l.workspace.getTopBlocks(!1);for(let h=0;h<l.length;h++){let m=l[h];for(;m;){if(m.isCollapsed())return"enabled";m=m.getNextBlock()}}return"disabled"}return"hidden"},callback(l){kk(!1,l.workspace.getTopBlocks(!0))},scopeType:Ks.ScopeType.WORKSPACE,id:"expandWorkspace",weight:5})},xI=function(l,h){if(l.isDeletable())Array.prototype.push.apply(h,l.getDescendants(!1));else{l=l.getChildren(!1);for(let m=0;m<l.length;m++)xI(l[m],h)}},PI=function(l){const h=[];l=l.getTopBlocks(!0);for(let m=0;m<l.length;m++)xI(l[m],h);return h},vE=function(l,h){h?t.setGroup$$module$build$src$core$events$utils(h):(t.setGroup$$module$build$src$core$events$utils(!0),h=t.getGroup$$module$build$src$core$events$utils());const m=l.shift();m&&(m.isDeadOrDying()?vE(l,h):(m.dispose(!1,!0),setTimeout(vE,10,l,h))),t.setGroup$$module$build$src$core$events$utils(!1)},Nk=function(){Ks.registry.register({displayText(l){return l.workspace?(l=PI(l.workspace).length,l===1?t.Msg$$module$build$src$core$msg.DELETE_BLOCK:t.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${l}`)):""},preconditionFn(l){return l.workspace&&0<PI(l.workspace).length?"enabled":"disabled"},callback(l){if(l.workspace){l.workspace.cancelCurrentGesture();var h=PI(l.workspace);2>h.length?vE(h):Yn(t.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(h.length)),function(m){m&&vE(h)})}},scopeType:Ks.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},Dk=function(){Rk(),Mk(),k_(),Ak(),_E(),Nk()},bE=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(l){return l=l.block,!l.isInFlyout&&l.isDeletable()&&l.isMovable()?l.isDuplicatable()?"enabled":"disabled":"hidden"},callback(l){if(l.block){var h=l.block.toCopyData();h&&Vd(h,l.block.workspace)}},scopeType:Ks.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},$k=function(){Ks.registry.register({displayText(l){return l.block.hasIcon(qa.TYPE)?t.Msg$$module$build$src$core$msg.REMOVE_COMMENT:t.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(l){return l=l.block,!l.isInFlyout&&l.workspace.options.comments&&!l.isCollapsed()&&l.isEditable()?"enabled":"hidden"},callback(l){l=l.block,l.hasIcon(qa.TYPE)?l.setCommentText(null):l.setCommentText("")},scopeType:Ks.ScopeType.BLOCK,id:"blockComment",weight:2})},TE=function(){Ks.registry.register({displayText(l){return l.block.getInputsInline()?t.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:t.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(l){if(l=l.block,!l.isInFlyout&&l.isMovable()&&!l.isCollapsed()){for(let h=1;h<l.inputList.length;h++)if(!(l.inputList[h-1]instanceof BL||l.inputList[h]instanceof BL))return"enabled"}return"hidden"},callback(l){l.block.setInputsInline(!l.block.getInputsInline())},scopeType:Ks.ScopeType.BLOCK,id:"blockInline",weight:3})},FI=function(){Ks.registry.register({displayText(l){return l.block.isCollapsed()?t.Msg$$module$build$src$core$msg.EXPAND_BLOCK:t.Msg$$module$build$src$core$msg.COLLAPSE_BLOCK},preconditionFn(l){return l=l.block,!l.isInFlyout&&l.isMovable()&&l.workspace.options.collapse?"enabled":"hidden"},callback(l){l.block.setCollapsed(!l.block.isCollapsed())},scopeType:Ks.ScopeType.BLOCK,id:"blockCollapseExpand",weight:4})},BI=function(){Ks.registry.register({displayText(l){return l.block.isEnabled()?t.Msg$$module$build$src$core$msg.DISABLE_BLOCK:t.Msg$$module$build$src$core$msg.ENABLE_BLOCK},preconditionFn(l){return l=l.block,!l.isInFlyout&&l.workspace.options.disable&&l.isEditable()?l.getInheritedDisabled()?"disabled":"enabled":"hidden"},callback(l){l=l.block;const h=t.getGroup$$module$build$src$core$events$utils();h||t.setGroup$$module$build$src$core$events$utils(!0),l.setEnabled(!l.isEnabled()),t.setGroup$$module$build$src$core$events$utils(h)},scopeType:Ks.ScopeType.BLOCK,id:"blockDisable",weight:5})},HI=function(){Ks.registry.register({displayText(l){var h=l.block;return l=h.getDescendants(!1).length,(h=h.getNextBlock())&&(l-=h.getDescendants(!1).length),l===1?t.Msg$$module$build$src$core$msg.DELETE_BLOCK:t.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${l}`)},preconditionFn(l){return!l.block.isInFlyout&&l.block.isDeletable()?"enabled":"hidden"},callback(l){l.block&&l.block.checkAndDelete()},scopeType:Ks.ScopeType.BLOCK,id:"blockDelete",weight:6})},tT=function(){Ks.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.HELP},preconditionFn(l){return l=l.block,(typeof l.helpUrl=="function"?l.helpUrl():l.helpUrl)?"enabled":"hidden"},callback(l){l.block.showHelp()},scopeType:Ks.ScopeType.BLOCK,id:"blockHelp",weight:7})},x2=function(){bE(),$k(),TE(),FI(),BI(),HI(),tT()},VI=function(){Dk(),x2()},xk=function(l,h){var m=null;m=typeof l=="string"?document.getElementById(l)||document.querySelector(l):l;let E;if(!document.contains(m)&&document!==((E=m)==null?void 0:E.ownerDocument))throw Error("Error: container is not in current document");l=new Jo(h||{}),h=document.createElement("div"),h.className="injectionDiv",h.tabIndex=0,bo(h,Ao.LABEL,t.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),m.appendChild(h),m=P2(h,l);const k=Pk(h,m,l);return F2(k),y(k),A(k),h.addEventListener("focusin",function(){y(k)}),k},P2=function(l,h){l.setAttribute("dir","LTR"),it(h.hasCss,h.pathToMedia),l=He(pt.SVG,{xmlns:ME,"xmlns:html":Kd,"xmlns:xlink":cu,version:"1.1",class:"blocklySvg",tabindex:"0"},l);const m=He(pt.DEFS,{},l),E=String(Math.random()).substring(2);return h.gridPattern=kA.createDom(E,h.gridOptions,m),l},Pk=function(l,h,m){m.parentWorkspace=null,m=new Qd(m);const E=m.options;m.scale=E.zoomOptions.startScale,h.appendChild(m.createDom("blocklyMainBackground",l));var k=m.getRenderer().getClassName();return k&&ke(l,k),(k=m.getTheme().getClassName())&&ke(l,k),!E.hasCategories&&E.languageTree&&(l=m.addFlyout(pt.SVG),En(l,h)),E.hasTrashcan&&m.addTrashcan(),E.zoomOptions&&E.zoomOptions.controls&&m.addZoomControls(),m.getThemeManager().subscribe(h,"workspaceBackgroundColour","background-color"),m.translate(0,0),m.addChangeListener(mE(m)),A(m),Jy(),vI(),gk(),m},F2=function(l){const h=l.options;var m=l.getParentSvg();if(ee(m.parentNode,"contextmenu",null,function(E){et(E)||E.preventDefault()}),m=ee(window,"resize",null,function(){$h(),l.hideComponents(!0),Vb(),ok(),A(l),kp(l)}),l.setResizeHandlerWrapper(m),Fk(),h.languageTree){m=l.getToolbox();const E=l.getFlyout(!0);m?m.init():E&&(E.init(l),E.show(h.languageTree),typeof E.scrollToStart=="function"&&E.scrollToStart())}h.hasTrashcan&&l.trashcan.init(),h.zoomOptions&&h.zoomOptions.controls&&l.zoomControls_.init(),h.moveOptions&&h.moveOptions.scrollbars?(l.scrollbar=new eN(l,h.moveOptions.scrollbars===!0||!!h.moveOptions.scrollbars.horizontal,h.moveOptions.scrollbars===!0||!!h.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),l.scrollbar.resize()):l.setMetrics({x:.5,y:.5}),h.hasSounds&&WI(h.pathToMedia,l)},UI=function(l){const h=C();h&&!(et(l)||h.rendered&&!h.isVisible())&&Bs.registry.onKeyDown(h,l)},Fk=function(){Ma||(ee(document,"scroll",null,function(){const l=p();for(let h=0,m;m=l[h];h++)m instanceof Qd&&m.updateInverseScreenCTM()}),ee(document,"keydown",null,UI),ye(document,"touchend",null,we),ye(document,"touchcancel",null,we),Sc&&ee(window,"orientationchange",document,function(){A(C())})),Ma=!0},WI=function(l,h){function m(){for(;k.length;){const z=k.pop();z&&Me(z)}E.preload()}const E=h.getAudioManager();E.load([l+"click.mp3",l+"click.wav",l+"click.ogg"],"click"),E.load([l+"disconnect.wav",l+"disconnect.mp3",l+"disconnect.ogg"],"disconnect"),E.load([l+"delete.mp3",l+"delete.ogg",l+"delete.wav"],"delete");const k=[];k.push(ee(document,"pointermove",null,m,!0)),k.push(ee(document,"touchstart",null,m,!0))},B2=function(l){return l.getType!==void 0&&l.initView!==void 0&&l.dispose!==void 0&&l.getWeight!==void 0&&l.getSize!==void 0&&l.applyColour!==void 0&&l.hideForInsertionMarker!==void 0&&l.updateEditable!==void 0&&l.updateCollapsed!==void 0&&l.isShownWhenCollapsed!==void 0&&l.setOffsetInBlock!==void 0&&l.onLocationChange!==void 0&&l.onClick!==void 0},GI=function(l){return l.paste!==void 0},os=function(l){return l.isSelectable()},H2=function(l){C().hideChaff(l)},gi=gi||{},gi.scope={},gi.ASSUME_ES5=!1,gi.ASSUME_NO_NATIVE_MAP=!1,gi.ASSUME_NO_NATIVE_SET=!1,gi.SIMPLE_FROUND_POLYFILL=!1,gi.ISOLATE_POLYFILLS=!1,gi.FORCE_POLYFILL_PROMISE=!1,gi.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,gi.defineProperty=gi.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(l,h,m){return l==Array.prototype||l==Object.prototype||(l[h]=m.value),l},gi.getGlobal=function(l){l=[typeof globalThis=="object"&&globalThis,l,typeof window=="object"&&window,typeof self=="object"&&self,typeof dC=="object"&&dC];for(var h=0;h<l.length;++h){var m=l[h];if(m&&m.Math==Math)return m}throw Error("Cannot find global object")},gi.global=gi.getGlobal(this),gi.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol",gi.TRUST_ES6_POLYFILLS=!gi.ISOLATE_POLYFILLS||gi.IS_SYMBOL_NATIVE,gi.polyfills={},gi.propertyToPolyfillSymbol={},gi.POLYFILL_PREFIX="$jscp$",gi.polyfill=function(l,h,m,E){h&&(gi.ISOLATE_POLYFILLS?gi.polyfillIsolated(l,h,m,E):gi.polyfillUnisolated(l,h,m,E))},gi.polyfillUnisolated=function(l,h,m,E){for(m=gi.global,l=l.split("."),E=0;E<l.length-1;E++){var k=l[E];if(!(k in m))return;m=m[k]}l=l[l.length-1],E=m[l],h=h(E),h!=E&&h!=null&&gi.defineProperty(m,l,{configurable:!0,writable:!0,value:h})},gi.polyfillIsolated=function(l,h,m,E){var k=l.split(".");l=k.length===1,E=k[0],E=!l&&E in gi.polyfills?gi.polyfills:gi.global;for(var z=0;z<k.length-1;z++){var Oe=k[z];if(!(Oe in E))return;E=E[Oe]}k=k[k.length-1],m=gi.IS_SYMBOL_NATIVE&&m==="es6"?E[k]:null,h=h(m),h!=null&&(l?gi.defineProperty(gi.polyfills,k,{configurable:!0,writable:!0,value:h}):h!==m&&(gi.propertyToPolyfillSymbol[k]===void 0&&(m=1e9*Math.random()>>>0,gi.propertyToPolyfillSymbol[k]=gi.IS_SYMBOL_NATIVE?gi.global.Symbol(k):gi.POLYFILL_PREFIX+m+"$"+k),gi.defineProperty(E,gi.propertyToPolyfillSymbol[k],{configurable:!0,writable:!0,value:h})))},gi.polyfill("globalThis",function(l){return l||gi.global},"es_2020","es3"),gi.arrayIteratorImpl=function(l){var h=0;return function(){return h<l.length?{done:!1,value:l[h++]}:{done:!0}}},gi.arrayIterator=function(l){return{next:gi.arrayIteratorImpl(l)}},gi.initSymbol=function(){},gi.iteratorPrototype=function(l){return l={next:l},l[Symbol.iterator]=function(){return this},l},gi.iteratorFromArray=function(l,h){l instanceof String&&(l+="");var m=0,E=!1,k={next:function(){if(!E&&m<l.length){var z=m++;return{value:h(z,l[z]),done:!1}}return E=!0,{done:!0,value:void 0}}};return k[Symbol.iterator]=function(){return k},k},gi.polyfill("Array.prototype.values",function(l){return l||function(){return gi.iteratorFromArray(this,function(h,m){return m})}},"es8","es3"),gi.polyfill("Array.prototype.flat",function(l){return l||function(h){h=h===void 0?1:h;var m=[];return Array.prototype.forEach.call(this,function(E){Array.isArray(E)&&0<h?(E=Array.prototype.flat.call(E,h-1),m.push.apply(m,E)):m.push(E)}),m}},"es9","es5"),gi.owns=function(l,h){return Object.prototype.hasOwnProperty.call(l,h)},gi.polyfill("Object.entries",function(l){return l||function(h){var m=[],E;for(E in h)gi.owns(h,E)&&m.push([E,h[E]]);return m}},"es8","es3"),gi.polyfill("Object.values",function(l){return l||function(h){var m=[],E;for(E in h)gi.owns(h,E)&&m.push(h[E]);return m}},"es8","es3");var Yu=Object.create(null),V2={typeMap:Yu},zI=Object.create(null),Uh="default",Jt=class{constructor(l){this.name=l}toString(){return this.name}};Jt.CONNECTION_CHECKER=new Jt("connectionChecker"),Jt.CONNECTION_PREVIEWER=new Jt("connectionPreviewer"),Jt.CURSOR=new Jt("cursor"),Jt.EVENT=new Jt("event"),Jt.FIELD=new Jt("field"),Jt.INPUT=new Jt("input"),Jt.RENDERER=new Jt("renderer"),Jt.TOOLBOX=new Jt("toolbox"),Jt.THEME=new Jt("theme"),Jt.TOOLBOX_ITEM=new Jt("toolboxItem"),Jt.FLYOUTS_VERTICAL_TOOLBOX=new Jt("flyoutsVerticalToolbox"),Jt.FLYOUTS_HORIZONTAL_TOOLBOX=new Jt("flyoutsHorizontalToolbox"),Jt.METRICS_MANAGER=new Jt("metricsManager"),Jt.BLOCK_DRAGGER=new Jt("blockDragger"),Jt.SERIALIZER=new Jt("serializer"),Jt.ICON=new Jt("icon"),Jt.PASTER=new Jt("paster");var cg={DEFAULT:Uh,TEST_ONLY:V2};cg.Type=Jt,cg.getAllItems=d,cg.getClass=c,cg.getClassFromOptions=f,cg.getObject=u,cg.hasItem=a,cg.register=i,cg.unregister=o;var ea=Object.create(null),A_=Object.create(null),Bk,Hk=null,yc,lu=[],KI={defineBlocksWithJsonArrayInternal:F},Ml={TEST_ONLY:KI};Ml.createBlockDefinitionsFromJsonArray=t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Ml.defineBlocks=t.defineBlocks$$module$build$src$core$common,Ml.defineBlocksWithJsonArray=P,Ml.draggingConnections=lu,Ml.getAllWorkspaces=p,Ml.getBlockTypeCounts=N,Ml.getMainWorkspace=C,Ml.getParentContainer=L,Ml.getSelected=w,Ml.getWorkspaceById=g,Ml.registerWorkspace=_,Ml.setMainWorkspace=y,Ml.setParentContainer=O,Ml.setSelected=I,Ml.svgResize=A,Ml.unregisterWorkpace=v;var CE="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Vk={genUid:()=>{const l=CE.length,h=[];for(let m=0;20>m;m++)h[m]=CE.charAt(Math.random()*l);return h.join("")}},Uk=0,jI={TEST_ONLY:Vk};jI.genUid=U,jI.getNextUniqueId=V;var yE,Ap,Wd,Np,za,Dp,N_,nT,D_,ug,dg,$_,Gd,iT,x_,P_,Gr,ta,F_,sT,au,qu,EE,$p,XI,Oa;yE="",Ap=!0,Wd=0,t.CREATE$$module$build$src$core$events$utils="create",t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils="delete",t.DELETE$$module$build$src$core$events$utils,t.CHANGE$$module$build$src$core$events$utils="change",t.CHANGE$$module$build$src$core$events$utils,Np="block_field_intermediate_change",t.MOVE$$module$build$src$core$events$utils="move",t.MOVE$$module$build$src$core$events$utils,za="var_create",Dp="var_delete",N_="var_rename",nT="ui",D_="drag",ug="selected",dg="click",$_="marker_move",Gd="bubble_open",iT="trashcan_open",x_="toolbox_item_select",P_="theme_change",Gr="viewport_change",ta="comment_create",F_="comment_delete",sT="comment_change",au="comment_move",qu="finished_loading",EE=[t.CREATE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,ta,au],$p=[],XI={FIRE_QUEUE:$p,fireNow:re,fireInternal:K,setGroupInternal:ve},Oa={BLOCK_CHANGE:t.CHANGE$$module$build$src$core$events$utils,BLOCK_CREATE:t.CREATE$$module$build$src$core$events$utils,BLOCK_DELETE:t.DELETE$$module$build$src$core$events$utils,BLOCK_DRAG:D_,BLOCK_FIELD_INTERMEDIATE_CHANGE:Np,BLOCK_MOVE:t.MOVE$$module$build$src$core$events$utils,BUBBLE_OPEN:Gd,BUMP_EVENTS:EE,CHANGE:t.CHANGE$$module$build$src$core$events$utils,CLICK:dg,COMMENT_CHANGE:sT,COMMENT_CREATE:ta,COMMENT_DELETE:F_,COMMENT_MOVE:au,CREATE:t.CREATE$$module$build$src$core$events$utils,DELETE:t.DELETE$$module$build$src$core$events$utils,FINISHED_LOADING:qu,MARKER_MOVE:$_,MOVE:t.MOVE$$module$build$src$core$events$utils,SELECTED:ug,TEST_ONLY:XI,THEME_CHANGE:P_,TOOLBOX_ITEM_SELECT:x_,TRASHCAN_OPEN:iT,UI:nT,VAR_CREATE:za,VAR_DELETE:Dp,VAR_RENAME:N_,VIEWPORT_CHANGE:Gr},Oa.clearPendingUndo=J,Oa.disable=t.disable$$module$build$src$core$events$utils,Oa.disableOrphans=qe,Oa.enable=t.enable$$module$build$src$core$events$utils,Oa.filter=Z,Oa.fire=q,Oa.fromJson=Ee,Oa.get=Ne,Oa.getDescendantIds=Le,Oa.getGroup=t.getGroup$$module$build$src$core$events$utils,Oa.getRecordUndo=de,Oa.isEnabled=ge,Oa.setGroup=t.setGroup$$module$build$src$core$events$utils,Oa.setRecordUndo=Q;var zd=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=t.getGroup$$module$build$src$core$events$utils(),this.recordUndo=de()}toJson(){return{type:this.type,group:this.group}}static fromJson(l,h,m){return m.isBlank=!1,m.group=l.group||"",m.workspaceId=h.id,m}isNull(){return!1}run(l){}getEventWorkspace_(){let l;if(this.workspaceId&&(l=g(this.workspaceId)),!l)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return l}},Ec=class extends zd{constructor(l){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof l>"u",this.workspaceId=l||""}},Wk=class extends Ec{constructor(l,h,m){h=l?l.workspace.id:h,h===null&&(h=void 0),super(h),this.type=dg,this.blockId=l?l.id:void 0,this.targetType=m}toJson(){const l=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return l.targetType=this.targetType,l.blockId=this.blockId,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new Wk),h.targetType=l.targetType,h.blockId=l.blockId,h}},YI;(function(l){l.BLOCK="block",l.WORKSPACE="workspace",l.ZOOM_CONTROLS="zoom_controls"})(YI||(YI={})),i(Jt.EVENT,dg,Wk);var U2=750,SE="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),wE=null,Wh={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},oT=0,Gh={TOUCH_ENABLED:SE,TOUCH_MAP:Wh};Gh.checkTouchIdentifier=ze,Gh.clearTouchIdentifier=Ve,Gh.getTouchIdentifierFromEvent=dt,Gh.longStart=Re,Gh.longStop=we,Gh.shouldHandleEvent=Ge;var Gk,zk,IE,Kk,rT,qI,JI,zh,jk,Xk;(function(l){function h(E){return m.indexOf(E.toUpperCase())!==-1}Gk=l;const m=Gk.toUpperCase();zk=h("JavaFX"),IE=h("WebKit"),Kk=h("Gecko")&&!IE,rT=h("Android"),l=globalThis.navigator&&globalThis.navigator.maxTouchPoints,qI=h("iPad")||h("Macintosh")&&0<l,JI=h("iPhone")&&!qI,zh=h("Macintosh"),jk=qI||rT&&!h("Mobile")||h("Silk"),Xk=!jk&&(JI||rT)})(globalThis.navigator&&globalThis.navigator.userAgent||"");var AG=Gk,Yk=zk,qk=Kk,QI=rT,Sc=qI,ZI=JI,LE=zh,OE=Xk,eL={ANDROID:QI,GECKO:qk,IPAD:Sc,IPHONE:ZI,JavaFx:Yk,MAC:LE,MOBILE:OE,raw:AG},B_=40,Ti=125,Ju={};Ju.bind=ye,Ju.conditionalBind=ee,Ju.getScrollDeltaPixels=Se,Ju.isRightButton=at,Ju.isTargetInput=et,Ju.mouseToSvg=Ue,Ju.unbind=Me;var tL={};tL.removeElem=Ie;var Ka=class{constructor(l){this.name_=l}toString(){return this.name_}};Ka.POSITIONABLE=new Ka("positionable"),Ka.DRAG_TARGET=new Ka("drag_target"),Ka.DELETE_AREA=new Ka("delete_area"),Ka.AUTOHIDEABLE=new Ka("autohideable");var Qr=class{constructor(){this.componentData=new Map,this.capabilityToComponentIds=new Map}addComponent(l,h){const m=l.component.id;if(!h&&this.componentData.has(m)){var E;throw Error('Plugin "'+m+'" with capabilities "'+((E=this.componentData.get(m))==null?void 0:E.capabilities)+'" already added.')}for(this.componentData.set(m,l),h=[],E=0;E<l.capabilities.length;E++){const k=String(l.capabilities[E]).toLowerCase();if(h.push(k),this.capabilityToComponentIds.has(k)){let z;(z=this.capabilityToComponentIds.get(k))==null||z.push(m)}else this.capabilityToComponentIds.set(k,[m])}this.componentData.get(m).capabilities=h}removeComponent(l){const h=this.componentData.get(l);if(h){for(let m=0;m<h.capabilities.length;m++){const E=String(h.capabilities[m]).toLowerCase();Ie(this.capabilityToComponentIds.get(E),l)}this.componentData.delete(l)}}addCapability(l,h){if(!this.getComponent(l))throw Error('Cannot add capability, "'+h+'". Plugin "'+l+'" has not been added to the ComponentManager');if(this.hasCapability(l,h))console.warn('Plugin "'+l+'already has capability "'+h+'"');else{h=`${h}`.toLowerCase();var m;(m=this.componentData.get(l))==null||m.capabilities.push(h);var E;(E=this.capabilityToComponentIds.get(h))==null||E.push(l)}}removeCapability(l,h){if(!this.getComponent(l))throw Error('Cannot remove capability, "'+h+'". Plugin "'+l+'" has not been added to the ComponentManager');this.hasCapability(l,h)?(h=`${h}`.toLowerCase(),Ie(this.componentData.get(l).capabilities,h),Ie(this.capabilityToComponentIds.get(h),l)):console.warn('Plugin "'+l+`doesn't have capability "`+h+'" to remove')}hasCapability(l,h){return h=`${h}`.toLowerCase(),this.componentData.has(l)&&this.componentData.get(l).capabilities.indexOf(h)!==-1}getComponent(l){let h;return(h=this.componentData.get(l))==null?void 0:h.component}getComponents(l,h){if(l=`${l}`.toLowerCase(),l=this.capabilityToComponentIds.get(l),!l)return[];const m=[];if(h){const E=[];l.forEach(k=>{E.push(this.componentData.get(k))}),E.sort(function(k,z){return k.weight-z.weight}),E.forEach(function(k){m.push(k.component)})}else l.forEach(E=>{m.push(this.componentData.get(E).component)});return m}};Qr.Capability=Ka;var RE=!1,nL=`
- .blocklySvg {
- background-color: #fff;
- outline: none;
- overflow: hidden; /* IE overflows by default. */
- position: absolute;
- display: block;
- }
- .blocklyWidgetDiv {
- display: none;
- position: absolute;
- z-index: 99999; /* big value for bootstrap3 compatibility */
- }
- .injectionDiv {
- height: 100%;
- position: relative;
- overflow: hidden; /* So blocks in drag surface disappear at edges */
- touch-action: none;
- }
- .blocklyNonSelectable {
- user-select: none;
- -ms-user-select: none;
- -webkit-user-select: none;
- }
- .blocklyBlockCanvas.blocklyCanvasTransitioning,
- .blocklyBubbleCanvas.blocklyCanvasTransitioning {
- transition: transform .5s;
- }
- .blocklyTooltipDiv {
- background-color: #ffffc7;
- border: 1px solid #ddc;
- box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);
- color: #000;
- display: none;
- font: 9pt sans-serif;
- opacity: .9;
- padding: 2px;
- position: absolute;
- z-index: 100000; /* big value for bootstrap3 compatibility */
- }
- .blocklyDropDownDiv {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1000;
- display: none;
- border: 1px solid;
- border-color: #dadce0;
- background-color: #fff;
- border-radius: 2px;
- padding: 4px;
- box-shadow: 0 0 3px 1px rgba(0,0,0,.3);
- }
- .blocklyDropDownDiv.blocklyFocused {
- box-shadow: 0 0 6px 1px rgba(0,0,0,.3);
- }
- .blocklyDropDownContent {
- max-height: 300px; /* @todo: spec for maximum height. */
- overflow: auto;
- overflow-x: hidden;
- position: relative;
- }
- .blocklyDropDownArrow {
- position: absolute;
- left: 0;
- top: 0;
- width: 16px;
- height: 16px;
- z-index: -1;
- background-color: inherit;
- border-color: inherit;
- }
- .blocklyDropDownButton {
- display: inline-block;
- float: left;
- padding: 0;
- margin: 4px;
- border-radius: 4px;
- outline: none;
- border: 1px solid;
- transition: box-shadow .1s;
- cursor: pointer;
- }
- .blocklyArrowTop {
- border-top: 1px solid;
- border-left: 1px solid;
- border-top-left-radius: 4px;
- border-color: inherit;
- }
- .blocklyArrowBottom {
- border-bottom: 1px solid;
- border-right: 1px solid;
- border-bottom-right-radius: 4px;
- border-color: inherit;
- }
- .blocklyResizeSE {
- cursor: se-resize;
- fill: #aaa;
- }
- .blocklyResizeSW {
- cursor: sw-resize;
- fill: #aaa;
- }
- .blocklyResizeLine {
- stroke: #515A5A;
- stroke-width: 1;
- }
- .blocklyHighlightedConnectionPath {
- fill: none;
- stroke: #fc3;
- stroke-width: 4px;
- }
- .blocklyPathLight {
- fill: none;
- stroke-linecap: round;
- stroke-width: 1;
- }
- .blocklySelected>.blocklyPathLight {
- display: none;
- }
- .blocklyDraggable {
- cursor: grab;
- cursor: -webkit-grab;
- }
- .blocklyDragging {
- cursor: grabbing;
- cursor: -webkit-grabbing;
- }
- /* Changes cursor on mouse down. Not effective in Firefox because of
- https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */
- .blocklyDraggable:active {
- cursor: grabbing;
- cursor: -webkit-grabbing;
- }
- .blocklyDragging.blocklyDraggingDelete {
- cursor: url("<<<PATH>>>/handdelete.cur"), auto;
- }
- .blocklyDragging>.blocklyPath,
- .blocklyDragging>.blocklyPathLight {
- fill-opacity: .8;
- stroke-opacity: .8;
- }
- .blocklyDragging>.blocklyPathDark {
- display: none;
- }
- .blocklyDisabled>.blocklyPath {
- fill-opacity: .5;
- stroke-opacity: .5;
- }
- .blocklyDisabled>.blocklyPathLight,
- .blocklyDisabled>.blocklyPathDark {
- display: none;
- }
- .blocklyInsertionMarker>.blocklyPath,
- .blocklyInsertionMarker>.blocklyPathLight,
- .blocklyInsertionMarker>.blocklyPathDark {
- fill-opacity: .2;
- stroke: none;
- }
- .blocklyMultilineText {
- font-family: monospace;
- }
- .blocklyNonEditableText>text {
- pointer-events: none;
- }
- .blocklyFlyout {
- position: absolute;
- z-index: 20;
- }
- .blocklyText text {
- cursor: default;
- }
- /*
- Don't allow users to select text. It gets annoying when trying to
- drag a block and selected text moves instead.
- */
- .blocklySvg text {
- user-select: none;
- -ms-user-select: none;
- -webkit-user-select: none;
- cursor: inherit;
- }
- .blocklyHidden {
- display: none;
- }
- .blocklyFieldDropdown:not(.blocklyHidden) {
- display: block;
- }
- .blocklyIconGroup {
- cursor: default;
- }
- .blocklyIconGroup:not(:hover),
- .blocklyIconGroupReadonly {
- opacity: .6;
- }
- .blocklyIconShape {
- fill: #00f;
- stroke: #fff;
- stroke-width: 1px;
- }
- .blocklyIconSymbol {
- fill: #fff;
- }
- .blocklyMinimalBody {
- margin: 0;
- padding: 0;
- }
- .blocklyHtmlInput {
- border: none;
- border-radius: 4px;
- height: 100%;
- margin: 0;
- outline: none;
- padding: 0;
- width: 100%;
- text-align: center;
- display: block;
- box-sizing: border-box;
- }
- /* Remove the increase and decrease arrows on the field number editor */
- input.blocklyHtmlInput[type=number]::-webkit-inner-spin-button,
- input.blocklyHtmlInput[type=number]::-webkit-outer-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- input[type=number] {
- -moz-appearance: textfield;
- }
- .blocklyMainBackground {
- stroke-width: 1;
- stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */
- }
- .blocklyMutatorBackground {
- fill: #fff;
- stroke: #ddd;
- stroke-width: 1;
- }
- .blocklyFlyoutBackground {
- fill: #ddd;
- fill-opacity: .8;
- }
- .blocklyMainWorkspaceScrollbar {
- z-index: 20;
- }
- .blocklyFlyoutScrollbar {
- z-index: 30;
- }
- .blocklyScrollbarHorizontal,
- .blocklyScrollbarVertical {
- position: absolute;
- outline: none;
- }
- .blocklyScrollbarBackground {
- opacity: 0;
- }
- .blocklyScrollbarHandle {
- fill: #ccc;
- }
- .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,
- .blocklyScrollbarHandle:hover {
- fill: #bbb;
- }
- /* Darken flyout scrollbars due to being on a grey background. */
- /* By contrast, workspace scrollbars are on a white background. */
- .blocklyFlyout .blocklyScrollbarHandle {
- fill: #bbb;
- }
- .blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,
- .blocklyFlyout .blocklyScrollbarHandle:hover {
- fill: #aaa;
- }
- .blocklyInvalidInput {
- background: #faa;
- }
- .blocklyVerticalMarker {
- stroke-width: 3px;
- fill: rgba(255,255,255,.5);
- pointer-events: none;
- }
- .blocklyComputeCanvas {
- position: absolute;
- width: 0;
- height: 0;
- }
- .blocklyNoPointerEvents {
- pointer-events: none;
- }
- .blocklyContextMenu {
- border-radius: 4px;
- max-height: 100%;
- }
- .blocklyDropdownMenu {
- border-radius: 2px;
- padding: 0 !important;
- }
- .blocklyDropdownMenu .blocklyMenuItem {
- /* 28px on the left for icon or checkbox. */
- padding-left: 28px;
- }
- /* BiDi override for the resting state. */
- .blocklyDropdownMenu .blocklyMenuItemRtl {
- /* Flip left/right padding for BiDi. */
- padding-left: 5px;
- padding-right: 28px;
- }
- .blocklyWidgetDiv .blocklyMenu {
- background: #fff;
- border: 1px solid transparent;
- box-shadow: 0 0 3px 1px rgba(0,0,0,.3);
- font: normal 13px Arial, sans-serif;
- margin: 0;
- outline: none;
- padding: 4px 0;
- position: absolute;
- overflow-y: auto;
- overflow-x: hidden;
- max-height: 100%;
- z-index: 20000; /* Arbitrary, but some apps depend on it... */
- }
- .blocklyWidgetDiv .blocklyMenu.blocklyFocused {
- box-shadow: 0 0 6px 1px rgba(0,0,0,.3);
- }
- .blocklyDropDownDiv .blocklyMenu {
- background: inherit; /* Compatibility with gapi, reset from goog-menu */
- border: inherit; /* Compatibility with gapi, reset from goog-menu */
- font: normal 13px "Helvetica Neue", Helvetica, sans-serif;
- outline: none;
- position: relative; /* Compatibility with gapi, reset from goog-menu */
- z-index: 20000; /* Arbitrary, but some apps depend on it... */
- }
- /* State: resting. */
- .blocklyMenuItem {
- border: none;
- color: #000;
- cursor: pointer;
- list-style: none;
- margin: 0;
- /* 7em on the right for shortcut. */
- min-width: 7em;
- padding: 6px 15px;
- white-space: nowrap;
- }
- /* State: disabled. */
- .blocklyMenuItemDisabled {
- color: #ccc;
- cursor: inherit;
- }
- /* State: hover. */
- .blocklyMenuItemHighlight {
- background-color: rgba(0,0,0,.1);
- }
- /* State: selected/checked. */
- .blocklyMenuItemCheckbox {
- height: 16px;
- position: absolute;
- width: 16px;
- }
- .blocklyMenuItemSelected .blocklyMenuItemCheckbox {
- background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;
- float: left;
- margin-left: -24px;
- position: static; /* Scroll with the menu. */
- }
- .blocklyMenuItemRtl .blocklyMenuItemCheckbox {
- float: right;
- margin-right: -24px;
- }
- .blocklyBlockDragSurface {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- overflow: visible !important;
- z-index: 80;
- pointer-events: none;
- }
- `,kl={};kl.inject=it,kl.register=Xe;var _n=class{constructor(l,h){this.x=l,this.y=h}clone(){return new _n(this.x,this.y)}scale(l){return this.x*=l,this.y*=l,this}translate(l,h){return this.x+=l,this.y+=h,this}static equals(l,h){return l===h?!0:l&&h?l.x===h.x&&l.y===h.y:!1}static distance(l,h){const m=l.x-h.x;return l=l.y-h.y,Math.sqrt(m*m+l*l)}static magnitude(l){return Math.sqrt(l.x*l.x+l.y*l.y)}static difference(l,h){return new _n(l.x-h.x,l.y-h.y)}static sum(l,h){return new _n(l.x+h.x,l.y+h.y)}},W2=new Set,Jk={};Jk.warn=Tt;var ME="http://www.w3.org/2000/svg",Kd="http://www.w3.org/1999/xhtml",cu="http://www.w3.org/1999/xlink",hg;(function(l){l[l.ELEMENT_NODE=1]="ELEMENT_NODE",l[l.TEXT_NODE=3]="TEXT_NODE",l[l.COMMENT_NODE=8]="COMMENT_NODE"})(hg||(hg={}));var jd=null,Xd=0,Al=null,zr={HTML_NS:Kd};zr.NodeType=hg,zr.SVG_NS=ME,zr.XLINK_NS=cu,zr.addClass=ke,zr.containsNode=fe,zr.createSvgElement=He,zr.getFastTextWidth=je,zr.getFastTextWidthWithSizeString=Ae,zr.getTextWidth=pe,zr.hasClass=Gt,zr.insertAfter=En,zr.measureFontMetrics=Et,zr.removeClass=Ct,zr.removeClasses=ot,zr.removeNode=Ot,zr.setCssTransform=se,zr.startTextWidthCache=le,zr.stopTextWidthCache=Fe;var pt=class{constructor(l){this.tagName=l}toString(){return this.tagName}};pt.ANIMATE=new pt("animate"),pt.CIRCLE=new pt("circle"),pt.CLIPPATH=new pt("clipPath"),pt.DEFS=new pt("defs"),pt.FECOMPOSITE=new pt("feComposite"),pt.FECOMPONENTTRANSFER=new pt("feComponentTransfer"),pt.FEFLOOD=new pt("feFlood"),pt.FEFUNCA=new pt("feFuncA"),pt.FEGAUSSIANBLUR=new pt("feGaussianBlur"),pt.FEPOINTLIGHT=new pt("fePointLight"),pt.FESPECULARLIGHTING=new pt("feSpecularLighting"),pt.FILTER=new pt("filter"),pt.FOREIGNOBJECT=new pt("foreignObject"),pt.G=new pt("g"),pt.IMAGE=new pt("image"),pt.LINE=new pt("line"),pt.PATH=new pt("path"),pt.PATTERN=new pt("pattern"),pt.POLYGON=new pt("polygon"),pt.RECT=new pt("rect"),pt.SVG=new pt("svg"),pt.TEXT=new pt("text"),pt.TSPAN=new pt("tspan");var lo=class{constructor(l,h,m,E){this.top=l,this.bottom=h,this.left=m,this.right=E}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(l,h){return l>=this.left&&l<=this.right&&h>=this.top&&h<=this.bottom}intersects(l){return!(this.left>l.right||this.right<l.left||this.top>l.bottom||this.bottom<l.top)}},ko=class{constructor(l,h){this.width=l,this.height=h}static equals(l,h){return l===h?!0:l&&h?l.width===h.width&&l.height===h.height:!1}},G2={getSizeInternal:Hn},Qu={TEST_ONLY:G2};Qu.getBorderBox=ti,Qu.getComputedStyle=vs,Qu.getContainerOffsetToScrollInto=ae,Qu.getPageOffset=Zn,Qu.getSize=Tn,Qu.getViewportPageOffset=Hi,Qu.scrollIntoContainerView=Ps;var Qk=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,Zk=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,NG={XY_REGEX:Qk,XY_STYLE_REGEX:Zk},H_={TEST_ONLY:NG};H_.getDocumentScroll=ue,H_.getInjectionDivXY=H,H_.getRelativeXY=xe,H_.getViewportBBox=j,H_.screenToWsCoordinates=ie,H_.wsToScreenCoordinates=Te;var kr=class{constructor(l,h,m,E,k){this.workspace=l,this.horizontal=h,this.oldHostMetrics=null,this.ratio=1,this.origin=new _n(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new _n(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=m||!1,this.margin=k!==void 0?k:kr.DEFAULT_SCROLLBAR_MARGIN,l="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),E&&(l+=" "+E),this.outerSvg=He(pt.SVG,{class:l}),E=He(pt.G,{},this.outerSvg),this.svgBackground=He(pt.RECT,{class:"blocklyScrollbarBackground"},E),l=Math.floor((kr.scrollbarThickness-5)/2),this.svgHandle=He(pt.RECT,{class:"blocklyScrollbarHandle",rx:l,ry:l},E),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),En(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),h?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=ee(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=ee(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const l=kr.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(l)),this.outerSvg.setAttribute("height",String(l)),this.svgHandle.setAttribute("height",String(l-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(l)),this.outerSvg.setAttribute("width",String(l)),this.svgHandle.setAttribute("width",String(l-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),Me(this.onMouseDownBarWrapper_),Me(this.onMouseDownHandleWrapper_),Ot(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(l){return l=0>=l||isNaN(l)?0:Math.min(l,this.scrollbarLength)}setHandleLength(l){this.handleLength=l,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(l){return l=0>=l||isNaN(l)?0:Math.min(l,this.scrollbarLength-this.handleLength)}setHandlePosition(l){this.handlePosition=l,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(l){this.scrollbarLength=l,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(l,h){this.position.x=l,this.position.y=h,se(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(l){!l&&(l=this.workspace.getMetrics(),!l)||this.oldHostMetrics&&kr.metricsAreEquivalent(l,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(l):this.resizeVertical(l),this.oldHostMetrics=l,this.updateMetrics())}requiresViewResize(l){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==l.viewWidth||this.oldHostMetrics.viewHeight!==l.viewHeight||this.oldHostMetrics.absoluteLeft!==l.absoluteLeft||this.oldHostMetrics.absoluteTop!==l.absoluteTop:!0}resizeHorizontal(l){this.requiresViewResize(l)?this.resizeViewHorizontal(l):this.resizeContentHorizontal(l)}resizeViewHorizontal(l){var h=l.viewWidth-2*this.margin;this.pair&&(h-=kr.scrollbarThickness),this.setScrollbarLength(Math.max(0,h)),h=l.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(h+=kr.scrollbarThickness),this.setPosition(h,l.absoluteTop+l.viewHeight-kr.scrollbarThickness-this.margin),this.resizeContentHorizontal(l)}resizeContentHorizontal(l){if(l.viewWidth>=l.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var h=this.scrollbarLength*l.viewWidth/l.scrollWidth;h=this.constrainHandleLength(h),this.setHandleLength(h),h=l.scrollWidth-l.viewWidth;var m=this.scrollbarLength-this.handleLength;l=(l.viewLeft-l.scrollLeft)/h*m,l=this.constrainHandlePosition(l),this.setHandlePosition(l),this.ratio=m/h}}resizeVertical(l){this.requiresViewResize(l)?this.resizeViewVertical(l):this.resizeContentVertical(l)}resizeViewVertical(l){let h=l.viewHeight-2*this.margin;this.pair&&(h-=kr.scrollbarThickness),this.setScrollbarLength(Math.max(0,h)),this.setPosition(this.workspace.RTL?l.absoluteLeft+this.margin:l.absoluteLeft+l.viewWidth-kr.scrollbarThickness-this.margin,l.absoluteTop+this.margin),this.resizeContentVertical(l)}resizeContentVertical(l){if(l.viewHeight>=l.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var h=this.scrollbarLength*l.viewHeight/l.scrollHeight;h=this.constrainHandleLength(h),this.setHandleLength(h),h=l.scrollHeight-l.viewHeight;var m=this.scrollbarLength-this.handleLength;l=(l.viewTop-l.scrollTop)/h*m,l=this.constrainHandlePosition(l),this.setHandlePosition(l),this.ratio=m/h}}isVisible(){return this.isHandleVisible}setContainerVisible(l){const h=l!==this.containerVisible;this.containerVisible=l,h&&this.updateDisplay_()}setVisible(l){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(l)}setVisibleInternal(l){const h=l!==this.isVisible();this.isHandleVisible=l,h&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(l){if(this.workspace.markFocused(),Ve(),this.cleanUp(),at(l))l.stopPropagation();else{var h=Ue(l,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());h=this.horizontal?h.x:h.y;var m=H(this.svgHandle);m=this.horizontal?m.x:m.y;var E=this.handlePosition,k=.95*this.handleLength;h<=m?E-=k:h>=m+this.handleLength&&(E+=k),this.setHandlePosition(this.constrainHandlePosition(E)),this.updateMetrics(),l.stopPropagation(),l.preventDefault()}}onMouseDownHandle(l){this.workspace.markFocused(),this.cleanUp(),at(l)?l.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?l.clientX:l.clientY,this.onMouseUpWrapper_=ee(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=ee(document,"pointermove",this,this.onMouseMoveHandle),l.stopPropagation(),l.preventDefault())}onMouseMoveHandle(l){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?l.clientX:l.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Ve(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(Me(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(Me(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let l=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(l)&&(l=0),l}updateMetrics(){const l=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:l}):this.workspace.setMetrics({y:l})}set(l,h){this.setHandlePosition(this.constrainHandlePosition(l*this.ratio)),(h||h===void 0)&&this.updateMetrics()}setOrigin(l,h){this.origin=new _n(l,h)}static metricsAreEquivalent(l,h){return l.viewWidth===h.viewWidth&&l.viewHeight===h.viewHeight&&l.viewLeft===h.viewLeft&&l.viewTop===h.viewTop&&l.absoluteTop===h.absoluteTop&&l.absoluteLeft===h.absoluteLeft&&l.scrollWidth===h.scrollWidth&&l.scrollHeight===h.scrollHeight&&l.scrollLeft===h.scrollLeft&&l.scrollTop===h.scrollTop}};kr.scrollbarThickness=SE?25:15,kr.DEFAULT_SCROLLBAR_MARGIN=.5;var iL={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},sL={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:kE,DOMParser:AE,XMLSerializer:V_}=globalThis;AE&&(iL=new AE),V_&&(sL=new V_);var eA="https://developers.google.com/blockly/xml",NE=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,xp={NAME_SPACE:eA};xp.createElement=t.createElement$$module$build$src$core$utils$xml,xp.createTextNode=t.createTextNode$$module$build$src$core$utils$xml,xp.domToText=me,xp.injectDependencies=De,xp.textToDom=t.textToDom$$module$build$src$core$utils$xml;var oL="categoryToolbox",tA="flyoutToolbox",Fi;(function(l){l[l.TOP=0]="TOP",l[l.BOTTOM=1]="BOTTOM",l[l.LEFT=2]="LEFT",l[l.RIGHT=3]="RIGHT"})(Fi||(Fi={}));var nA={hasCategoriesInternal:Ft},na={};na.Position=Fi,na.TEST_ONLY=nA,na.convertFlyoutDefToJsonArray=un,na.convertToolboxDefToJson=It,na.hasCategories=gt,na.isCategoryCollapsible=pn,na.parseToolboxTree=vi;var ja;(function(l){l[l.TOP=0]="TOP",l[l.BOTTOM=1]="BOTTOM"})(ja||(ja={}));var lT;(function(l){l[l.LEFT=0]="LEFT",l[l.RIGHT=1]="RIGHT"})(lT||(lT={}));var fg;(function(l){l[l.UP=0]="UP",l[l.DOWN=1]="DOWN"})(fg||(fg={}));var U_={};U_.bumpDirection=fg,U_.bumpPositionRect=vo,U_.getCornerOppositeToolbox=gl,U_.getStartPositionRect=go,U_.horizontalPosition=lT,U_.verticalPosition=ja;var Xa={width:96,height:124,url:"sprites.png"},z2=class{constructor(l){this.workspace=l,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=He(pt.G,{});const l=String(Math.random()).substring(2);return this.createZoomOutSvg(l),this.createZoomInSvg(l),this.workspace.isMovable()&&this.createZoomResetSvg(l),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:2,capabilities:[Qr.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&Ot(this.svgGroup);for(const l of this.boundEvents)Me(l);this.boundEvents.length=0}getBoundingRectangle(){let l=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(l+=this.LARGE_SPACING+this.HEIGHT),new lo(this.top,this.top+l,this.left,this.left+this.WIDTH)}position(l,h){if(this.initialized){var m=gl(this.workspace,l),E=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(E+=this.LARGE_SPACING+this.HEIGHT),l=go(m,new ko(this.WIDTH,E),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,l,this.workspace),m=m.vertical,h=vo(l,this.MARGIN_VERTICAL,m===ja.TOP?fg.DOWN:fg.UP,h),m===ja.TOP){var k=this.SMALL_SPACING+this.HEIGHT,z;(z=this.zoomInGroup)==null||z.setAttribute("transform","translate(0, "+k+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(k+this.LARGE_SPACING+this.HEIGHT)+")")}else{z=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let Je;(Je=this.zoomInGroup)==null||Je.setAttribute("transform","translate(0, "+z+")"),z=z+this.SMALL_SPACING+this.HEIGHT,(k=this.zoomOutGroup)==null||k.setAttribute("transform","translate(0, "+z+")")}this.top=h.top,this.left=h.left;var Oe;(Oe=this.svgGroup)==null||Oe.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(l){this.zoomOutGroup=He(pt.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const h=He(pt.CLIPPATH,{id:"blocklyZoomoutClipPath"+l},this.zoomOutGroup);He(pt.RECT,{width:32,height:32},h),He(pt.IMAGE,{width:Xa.width,height:Xa.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+l+")"},this.zoomOutGroup).setAttributeNS(cu,"xlink:href",this.workspace.options.pathToMedia+Xa.url),this.boundEvents.push(ee(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(l){this.zoomInGroup=He(pt.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const h=He(pt.CLIPPATH,{id:"blocklyZoominClipPath"+l},this.zoomInGroup);He(pt.RECT,{width:32,height:32},h),He(pt.IMAGE,{width:Xa.width,height:Xa.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+l+")"},this.zoomInGroup).setAttributeNS(cu,"xlink:href",this.workspace.options.pathToMedia+Xa.url),this.boundEvents.push(ee(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(l,h){this.workspace.markFocused(),this.workspace.zoomCenter(l),this.fireZoomEvent(),Ve(),h.stopPropagation(),h.preventDefault()}createZoomResetSvg(l){this.zoomResetGroup=He(pt.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const h=He(pt.CLIPPATH,{id:"blocklyZoomresetClipPath"+l},this.zoomResetGroup);He(pt.RECT,{width:32,height:32},h),He(pt.IMAGE,{width:Xa.width,height:Xa.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+l+")"},this.zoomResetGroup).setAttributeNS(cu,"xlink:href",this.workspace.options.pathToMedia+Xa.url),this.boundEvents.push(ee(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(l){this.workspace.markFocused();const h=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(h),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),Ve(),l.stopPropagation(),l.preventDefault()}fireZoomEvent(){const l=new(Ne(dg))(null,this.workspace.id,"zoom_controls");q(l)}};Xe(`
- .blocklyZoom>image, .blocklyZoom>svg>image {
- opacity: .4;
- }
- .blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {
- opacity: .6;
- }
- .blocklyZoom>image:active, .blocklyZoom>svg>image:active {
- opacity: .8;
- }
- `);var wc=class{constructor(l){this.name=l}toString(){return this.name}equals(l){return this.name===l.toString()}};wc.MUTATOR=new wc("mutator"),wc.WARNING=new wc("warning"),wc.COMMENT=new wc("comment"),function(l){l[l.VALUE=1]="VALUE",l[l.STATEMENT=3]="STATEMENT",l[l.DUMMY=5]="DUMMY",l[l.CUSTOM=6]="CUSTOM",l[l.END_ROW=7]="END_ROW"}(t.inputTypes$$module$build$src$core$inputs$input_types||(t.inputTypes$$module$build$src$core$inputs$input_types={})),t.inputTypes$$module$build$src$core$inputs$input_types;var K2=function(l,h){window.alert(l),h&&h()},j2=function(l,h){h(window.confirm(l))},X2=function(l,h,m){m(window.prompt(l,h))},Y2={confirmInternal:bi},W_={TEST_ONLY:Y2};W_.alert=At,W_.confirm=Yn,W_.prompt=Yl,W_.setAlert=In,W_.setConfirm=Ur,W_.setPrompt=RM;var iA,q2;t.Msg$$module$build$src$core$msg=Object.create(null),iA=function(l){Object.keys(l).forEach(function(h){t.Msg$$module$build$src$core$msg[h]=l[h]})},q2={Msg:t.Msg$$module$build$src$core$msg,setLocale:iA};var aT=class extends zd{constructor(l){super(),this.isBlank=typeof l>"u",l&&(this.varId=l.getId(),this.workspaceId=l.workspace.id)}toJson(){const l=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return l.varId=this.varId,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new aT),h.varId=l.varId,h}},rL=class extends aT{constructor(l){super(l),this.type=za,l&&(this.varType=l.type,this.varName=l.name)}toJson(){const l=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return l.varType=this.varType,l.varName=this.varName,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new rL),h.varType=l.varType,h.varName=l.varName,h}run(l){const h=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");l?h.createVariable(this.varName,this.varType,this.varId):h.deleteVariableById(this.varId)}};i(Jt.EVENT,za,rL);var cT=class{constructor(l,h,m,E){this.workspace=l,this.name=h,this.type=m||"",this.id_=E||U()}getId(){return this.id_}static compareByName(l,h){return l.name.localeCompare(h.name,void 0,{sensitivity:"base"})}},sA="VARIABLE",oA="ijkmnopqrstuvwxyzabcdefgh",J2={generateUniqueNameInternal:AM},ia={CATEGORY_NAME:sA,TEST_ONLY:J2,VAR_LETTER_OPTIONS:oA};ia.allDeveloperVariables=t.allDeveloperVariables$$module$build$src$core$variables,ia.allUsedVarModels=t.allUsedVarModels$$module$build$src$core$variables,ia.createVariableButtonHandler=T_,ia.flyoutCategory=nI,ia.flyoutCategoryBlocks=MM,ia.generateUniqueName=kM,ia.generateUniqueNameFromOptions=Ky,ia.generateVariableFieldDom=Tp,ia.getAddedVariables=Nb,ia.getOrCreateVariablePackage=t.getOrCreateVariablePackage$$module$build$src$core$variables,ia.getVariable=t.getVariable$$module$build$src$core$variables,ia.nameUsedWithAnyType=iI,ia.nameUsedWithConflictingParam=Ab,ia.promptName=kb,ia.renameVariable=t.renameVariable$$module$build$src$core$variables;var Kh=class{constructor(l,h,m,E,k){this.workspace=l,this.editable=this.movable=this.deletable=!0,this.disposed_=!1,this.isComment=!0,this.id=k&&!l.getCommentById(k)?k:U(),l.addTopComment(this),this.xy_=new _n(0,0),this.height_=m,this.width_=E,this.RTL=l.RTL,this.content_=h,Kh.fireCreateEvent(this)}dispose(){this.disposed_||(ge()&&q(new(Ne(F_))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)}getHeight(){return this.height_}setHeight(l){this.height_=l}getWidth(){return this.width_}setWidth(l){this.width_=l}getRelativeToSurfaceXY(){return new _n(this.xy_.x,this.xy_.y)}moveBy(l,h){const m=new(Ne(au))(this);this.xy_.translate(l,h),m.recordNew(),q(m)}isDeletable(){return this.deletable&&!(this.workspace&&this.workspace.options.readOnly)}setDeletable(l){this.deletable=l}isMovable(){return this.movable&&!(this.workspace&&this.workspace.options.readOnly)}setMovable(l){this.movable=l}isEditable(){return this.editable&&!(this.workspace&&this.workspace.options.readOnly)}setEditable(l){this.editable=l}getContent(){return this.content_}setContent(l){this.content_!==l&&(q(new(Ne(sT))(this,this.content_,l)),this.content_=l)}toXmlWithXY(l){return l=this.toXml(l),l.setAttribute("x",String(Math.round(this.xy_.x))),l.setAttribute("y",String(Math.round(this.xy_.y))),l.setAttribute("h",String(this.height_)),l.setAttribute("w",String(this.width_)),l}toXml(l){const h=t.createElement$$module$build$src$core$utils$xml("comment");return l||(h.id=this.id),h.textContent=this.getContent(),h}static fireCreateEvent(l){if(ge()){const h=t.getGroup$$module$build$src$core$events$utils();h||t.setGroup$$module$build$src$core$events$utils(!0);try{q(new(Ne(ta))(l))}finally{t.setGroup$$module$build$src$core$events$utils(h)}}}static fromXml(l,h){var m=Kh.parseAttributes(l);return h=new Kh(h,m.content,m.h,m.w,m.id),m=l.getAttribute("x"),l=l.getAttribute("y"),m=m?parseInt(m,10):NaN,l=l?parseInt(l,10):NaN,isNaN(m)||isNaN(l)||h.moveBy(m,l),Kh.fireCreateEvent(h),h}static parseAttributes(l){const h=l.getAttribute("h"),m=l.getAttribute("w"),E=l.getAttribute("x"),k=l.getAttribute("y"),z=l.getAttribute("id");if(!z)throw Error("No ID present in XML comment definition.");let Oe;return{id:z,h:h?parseInt(h):100,w:m?parseInt(m):100,x:E?parseInt(E):NaN,y:k?parseInt(k):NaN,content:(Oe=l.textContent)!=null?Oe:""}}},rA=class extends Ec{constructor(l,h,m){super(m),this.type=ug,this.oldElementId=l??void 0,this.newElementId=h??void 0}toJson(){const l=super.toJson();return l.oldElementId=this.oldElementId,l.newElementId=this.newElementId,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new rA),h.oldElementId=l.oldElementId,h.newElementId=l.newElementId,h}};i(Jt.EVENT,ug,rA);var lA={};lA.register=sI,lA.unregister=$M;var lL=class{paste(l,h,m){const E=l.commentState;if(m)E.setAttribute("x",`${m.x}`),E.setAttribute("y",`${m.y}`);else{var k;m=parseInt((k=E.getAttribute("x"))!=null?k:"0")+50;let z;k=parseInt((z=E.getAttribute("y"))!=null?z:"0")+50,E.setAttribute("x",`${m}`),E.setAttribute("y",`${k}`)}return sa.fromXmlRendered(l.commentState,h)}};lL.TYPE="workspace-comment",sI(lL.TYPE,new lL);var Zr=8,aL=3,Zu=2,sa=class extends Kh{constructor(l,h,m,E,k){super(l,h,m,E,k),this.onMouseMoveWrapper=this.onMouseUpWrapper=null,this.eventsInit=!1,this.deleteIconBorder=this.deleteGroup=this.resizeGroup=this.foreignObject=this.svgHandleTarget=this.svgRectTarget=this.textarea=null,this.rendered=this.autoLayout=this.focused=!1,this.svgGroup=He(pt.G,{class:"blocklyComment"}),this.workspace=l,this.svgRect_=He(pt.RECT,{class:"blocklyCommentRect",x:0,y:0,rx:aL,ry:aL}),this.svgGroup.appendChild(this.svgRect_),this.render()}dispose(){this.disposed_||(w()===this&&(this.unselect(),this.workspace.cancelCurrentGesture()),ge()&&q(new(Ne(F_))(this)),Ot(this.svgGroup),t.disable$$module$build$src$core$events$utils(),super.dispose(),t.enable$$module$build$src$core$events$utils())}initSvg(l){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");this.workspace.options.readOnly||this.eventsInit||(ee(this.svgRectTarget,"pointerdown",this,this.pathMouseDown),ee(this.svgHandleTarget,"pointerdown",this,this.pathMouseDown)),this.eventsInit=!0,this.updateMovable(),this.getSvgRoot().parentNode||this.workspace.getBubbleCanvas().appendChild(this.getSvgRoot()),!l&&this.textarea&&this.textarea.select()}pathMouseDown(l){const h=this.workspace.getGesture(l);h&&h.handleBubbleStart(l,this)}showContextMenu(l){throw Error("The implementation of showContextMenu should be monkey-patched in by blockly.ts")}select(){if(w()!==this){var l=null;if(w()){l=w().id,t.disable$$module$build$src$core$events$utils();try{w().unselect()}finally{t.enable$$module$build$src$core$events$utils()}}l=new(Ne(ug))(l,this.id,this.workspace.id),q(l),I(this),this.addSelect()}}unselect(){if(w()===this){var l=new(Ne(ug))(this.id,null,this.workspace.id);q(l),I(null),this.removeSelect(),this.blurFocus()}}addSelect(){ke(this.svgGroup,"blocklySelected"),this.setFocus()}removeSelect(){ke(this.svgGroup,"blocklySelected"),this.blurFocus()}addFocus(){ke(this.svgGroup,"blocklyFocused")}removeFocus(){Ct(this.svgGroup,"blocklyFocused")}getRelativeToSurfaceXY(){const l=this.workspace.getLayerManager();if(!l)throw Error("Cannot calculate position because the workspace has not been appended");let h=0,m=0,E=this.getSvgRoot();if(E)do{const k=xe(E);h+=k.x,m+=k.y,E=E.parentNode}while(E&&!l.hasLayer(E)&&E!==null);return this.xy_=new _n(h,m)}moveBy(l,h){const m=new(Ne(au))(this),E=this.getRelativeToSurfaceXY();this.translate(E.x+l,E.y+h),this.xy_=new _n(E.x+l,E.y+h),m.recordNew(),q(m),this.workspace.resizeContents()}translate(l,h){this.xy_=new _n(l,h),this.getSvgRoot().setAttribute("transform","translate("+l+","+h+")")}moveDuringDrag(l){l=`translate(${l.x}, ${l.y})`,this.getSvgRoot().setAttribute("transform",l)}moveTo(l,h){this.translate(l,h)}clearTransformAttributes(){this.getSvgRoot().removeAttribute("transform")}getBoundingRectangle(){var l=this.getRelativeToSurfaceXY();const h=this.getHeightWidth(),m=l.y,E=l.y+h.height;let k;return this.RTL?(k=l.x-h.width,l=l.x):(k=l.x,l=l.x+h.width),new lo(m,E,k,l)}updateMovable(){this.isMovable()?ke(this.svgGroup,"blocklyDraggable"):Ct(this.svgGroup,"blocklyDraggable")}setMovable(l){super.setMovable(l),this.updateMovable()}setEditable(l){super.setEditable(l),this.textarea&&(this.textarea.readOnly=!l)}setDragging(l){l?ke(this.getSvgRoot(),"blocklyDragging"):Ct(this.getSvgRoot(),"blocklyDragging")}getSvgRoot(){return this.svgGroup}getContent(){return this.textarea?this.textarea.value:this.content_}setContent(l){super.setContent(l),this.textarea&&(this.textarea.value=l)}setDeleteStyle(l){l?ke(this.svgGroup,"blocklyDraggingDelete"):Ct(this.svgGroup,"blocklyDraggingDelete")}setAutoLayout(l){}toXmlWithXY(l){let h=0;this.workspace.RTL&&(h=this.workspace.getWidth()),l=this.toXml(l);const m=this.getRelativeToSurfaceXY();return l.setAttribute("x",String(Math.round(this.workspace.RTL?h-m.x:m.x))),l.setAttribute("y",String(Math.round(m.y))),l.setAttribute("h",String(this.getHeight())),l.setAttribute("w",String(this.getWidth())),l}toCopyData(){return{paster:lL.TYPE,commentState:this.toXmlWithXY()}}getHeightWidth(){return{width:this.getWidth(),height:this.getHeight()}}render(){if(!this.rendered){var l=this.getHeightWidth(),h=this.createEditor();this.svgGroup.appendChild(h),this.svgHandleTarget=He(pt.RECT,{class:"blocklyCommentHandleTarget",x:0,y:0}),this.svgGroup.appendChild(this.svgHandleTarget),this.svgRectTarget=He(pt.RECT,{class:"blocklyCommentTarget",x:0,y:0,rx:aL,ry:aL}),this.svgGroup.appendChild(this.svgRectTarget),this.addResizeDom(),this.isDeletable()&&this.addDeleteDom(),this.setSize(l.width,l.height),this.textarea.value=this.content_,this.rendered=!0,this.resizeGroup&&ee(this.resizeGroup,"pointerdown",this,this.resizeMouseDown),this.isDeletable()&&(ee(this.deleteGroup,"pointerdown",this,this.deleteMouseDown),ee(this.deleteGroup,"pointerout",this,this.deleteMouseOut),ee(this.deleteGroup,"pointerup",this,this.deleteMouseUp))}}createEditor(){this.foreignObject=He(pt.FOREIGNOBJECT,{x:0,y:sa.TOP_OFFSET,class:"blocklyCommentForeignObject"});const l=document.createElementNS(Kd,"body");l.setAttribute("xmlns",Kd),l.className="blocklyMinimalBody";const h=document.createElementNS(Kd,"textarea");return h.className="blocklyCommentTextarea",h.setAttribute("dir",this.RTL?"RTL":"LTR"),h.readOnly=!this.isEditable(),l.appendChild(h),this.textarea=h,this.foreignObject.appendChild(l),ee(h,"wheel",this,function(m){m.stopPropagation()}),ee(h,"change",this,function(m){this.setContent(h.value)}),this.foreignObject}addResizeDom(){this.resizeGroup=He(pt.G,{class:this.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.svgGroup),He(pt.POLYGON,{points:`0,${Zr} ${Zr},${Zr} ${Zr},0`},this.resizeGroup),He(pt.LINE,{class:"blocklyResizeLine",x1:Zr/3,y1:Zr-1,x2:Zr-1,y2:Zr/3},this.resizeGroup),He(pt.LINE,{class:"blocklyResizeLine",x1:2*Zr/3,y1:Zr-1,x2:Zr-1,y2:2*Zr/3},this.resizeGroup)}addDeleteDom(){this.deleteGroup=He(pt.G,{class:"blocklyCommentDeleteIcon"},this.svgGroup),this.deleteIconBorder=He(pt.CIRCLE,{class:"blocklyDeleteIconShape",r:"7",cx:"7.5",cy:"7.5"},this.deleteGroup),He(pt.LINE,{x1:"5",y1:"10",x2:"10",y2:"5",stroke:"#fff","stroke-width":"2"},this.deleteGroup),He(pt.LINE,{x1:"5",y1:"5",x2:"10",y2:"10",stroke:"#fff","stroke-width":"2"},this.deleteGroup)}resizeMouseDown(l){this.unbindDragEvents(),at(l)||(this.workspace.startDrag(l,new _n(this.workspace.RTL?-this.width_:this.width_,this.height_)),this.onMouseUpWrapper=ee(document,"pointerup",this,this.resizeMouseUp),this.onMouseMoveWrapper=ee(document,"pointermove",this,this.resizeMouseMove),this.workspace.hideChaff()),l.stopPropagation()}deleteMouseDown(l){this.deleteIconBorder&&ke(this.deleteIconBorder,"blocklyDeleteIconHighlighted"),l.stopPropagation()}deleteMouseOut(l){this.deleteIconBorder&&Ct(this.deleteIconBorder,"blocklyDeleteIconHighlighted")}deleteMouseUp(l){this.dispose(),l.stopPropagation()}unbindDragEvents(){this.onMouseUpWrapper&&(Me(this.onMouseUpWrapper),this.onMouseUpWrapper=null),this.onMouseMoveWrapper&&(Me(this.onMouseMoveWrapper),this.onMouseMoveWrapper=null)}resizeMouseUp(l){Ve(),this.unbindDragEvents()}resizeMouseMove(l){this.autoLayout=!1,l=this.workspace.moveDrag(l),this.setSize(this.RTL?-l.x:l.x,l.y)}resizeComment(){const l=this.getHeightWidth(),h=sa.TOP_OFFSET,m=2*Zu;let E;(E=this.foreignObject)==null||E.setAttribute("width",String(l.width));let k;if((k=this.foreignObject)==null||k.setAttribute("height",String(l.height-h)),this.RTL){let z;(z=this.foreignObject)==null||z.setAttribute("x",String(-l.width))}this.textarea&&(this.textarea.style.width=l.width-m+"px",this.textarea.style.height=l.height-m-h+"px")}setSize(l,h){l=Math.max(l,45),h=Math.max(h,20+sa.TOP_OFFSET),this.width_=l,this.height_=h,this.svgRect_.setAttribute("width",`${l}`),this.svgRect_.setAttribute("height",`${h}`);let m;(m=this.svgRectTarget)==null||m.setAttribute("width",`${l}`);let E;(E=this.svgRectTarget)==null||E.setAttribute("height",`${h}`);let k;(k=this.svgHandleTarget)==null||k.setAttribute("width",`${l}`);let z;if((z=this.svgHandleTarget)==null||z.setAttribute("height",String(sa.TOP_OFFSET)),this.RTL){this.svgRect_.setAttribute("transform","scale(-1 1)");let Oe;(Oe=this.svgRectTarget)==null||Oe.setAttribute("transform","scale(-1 1)")}if(this.resizeGroup)if(this.RTL){this.resizeGroup.setAttribute("transform","translate("+(-l+Zr)+","+(h-Zr)+") scale(-1 1)");let Oe;(Oe=this.deleteGroup)==null||Oe.setAttribute("transform","translate("+(-l+Zr)+","+-Zr+") scale(-1 1)")}else{this.resizeGroup.setAttribute("transform","translate("+(l-Zr)+","+(h-Zr)+")");let Oe;(Oe=this.deleteGroup)==null||Oe.setAttribute("transform","translate("+(l-Zr)+","+-Zr+")")}this.resizeComment()}setFocus(){this.focused=!0,setTimeout(()=>{this.disposed_||(this.textarea.focus(),this.addFocus(),this.svgRectTarget&&ke(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&ke(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}blurFocus(){this.focused=!1,setTimeout(()=>{this.disposed_||(this.textarea.blur(),this.removeFocus(),this.svgRectTarget&&Ct(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&Ct(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}static fromXmlRendered(l,h,m){t.disable$$module$build$src$core$events$utils();let E;try{const k=Kh.parseAttributes(l);if(E=new sa(h,k.content,k.h,k.w,k.id),h.rendered&&(E.initSvg(!0),E.render()),!isNaN(k.x)&&!isNaN(k.y))if(h.RTL){const z=m||h.getWidth();E.moveBy(z-k.x,k.y)}else E.moveBy(k.x,k.y)}finally{t.enable$$module$build$src$core$events$utils()}return Kh.fireCreateEvent(E),E}};sa.DEFAULT_SIZE=100,sa.TOP_OFFSET=10,Xe(`
- .blocklyCommentForeignObject {
- position: relative;
- z-index: 0;
- }
- .blocklyCommentRect {
- fill: #E7DE8E;
- stroke: #bcA903;
- stroke-width: 1px;
- }
- .blocklyCommentTarget {
- fill: transparent;
- stroke: #bcA903;
- }
- .blocklyCommentTargetFocused {
- fill: none;
- }
- .blocklyCommentHandleTarget {
- fill: none;
- }
- .blocklyCommentHandleTargetFocused {
- fill: transparent;
- }
- .blocklyFocused>.blocklyCommentRect {
- fill: #B9B272;
- stroke: #B9B272;
- }
- .blocklySelected>.blocklyCommentTarget {
- stroke: #fc3;
- stroke-width: 3px;
- }
- .blocklyCommentDeleteIcon {
- cursor: pointer;
- fill: #000;
- display: none;
- }
- .blocklySelected > .blocklyCommentDeleteIcon {
- display: block;
- }
- .blocklyDeleteIconShape {
- fill: #000;
- stroke: #000;
- stroke-width: 1px;
- }
- .blocklyDeleteIconShape.blocklyDeleteIconHighlighted {
- stroke: #fc3;
- }
- `);var cL=new Set,aA=new WeakSet,G_=null,cA=null,Q2=0,uL={};uL.finishQueuedRenders=tg,uL.queueRender=jy,uL.triggerQueuedRenders=wa;var Ic={};Ic.appendDomToWorkspace=e2,Ic.blockToDom=Cp,Ic.blockToDomWithXY=Xy,Ic.clearWorkspaceAndLoadFromXml=cI,Ic.deleteNext=GM,Ic.domToBlock=t.domToBlock$$module$build$src$core$xml,Ic.domToBlockInternal=yp,Ic.domToPrettyText=ZF,Ic.domToText=Ah,Ic.domToVariables=UM,Ic.domToWorkspace=t.domToWorkspace$$module$build$src$core$xml,Ic.variablesToDom=BM,Ic.workspaceToDom=FM;var Pp=class extends Error{},Z2=class extends Pp{constructor(l){super("Expected to find a 'type' property, defining the block type"),this.state=l}},DE=class extends Pp{constructor(l,h,m){super(`The block ${h.toDevString()} is missing a(n) ${l}
- connection`),this.block=h,this.state=m}},eB=class extends Pp{constructor(l,h,m,E){super(`The block ${m.toDevString()} could not connect its
- ${h} to its parent, because: ${l}`),this.childBlock=m,this.childState=E}},tB=class extends Pp{constructor(l){super(`Encountered a real block which is defined as a child of a shadow
- block. It is an invariant of Blockly that shadow blocks only have shadow
- children`),this.state=l}},nB=class extends Pp{constructor(l,h,m){super(`Cannot add an icon of type '${l}' to the block ${h.toDevString()}, because there is no icon registered with type '${l}'. Make sure that all of your icons have been registered.`),this.block=h,this.state=m}},z_={};z_.BadConnectionCheck=eB,z_.DeserializationError=Pp,z_.MissingBlockType=Z2,z_.MissingConnection=DE,z_.RealChildOfShadow=tB,z_.UnregisteredIcon=nB;var iB=100,sB=75,oB=50,DG={BLOCKS:oB,PROCEDURES:sB,VARIABLES:iB},uA={};uA.register=Db,uA.unregister=Ep;var rB=class{constructor(){this.priority=oB}save(l){const h=[];for(const m of l.getTopBlocks(!1))(l=Hd(m,{addCoordinates:!0,doFullSerialization:!1}))&&h.push(l);return h.length?{languageVersion:0,blocks:h}:null}load(l,h){l=l.blocks;for(const m of l)qr(m,h,{recordUndo:de()})}clear(l){for(const h of l.getTopBlocks(!1))h.dispose(!1)}};Db("blocks",new rB);var $E={};$E.BlockSerializer=rB,$E.append=qr,$E.appendInternal=$b,$E.save=Hd;var K_=class extends zd{constructor(l){super(),this.isBlank=!l,l&&(this.blockId=l.id,this.workspaceId=l.workspace.id)}toJson(){const l=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return l.blockId=this.blockId,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new K_),h.blockId=l.blockId,h}},dA=class extends K_{constructor(l){super(l),this.type=t.CREATE$$module$build$src$core$events$utils,l&&(l.isShadow()&&(this.recordUndo=!1),this.xml=Xy(l),this.ids=Le(l),this.json=Hd(l,{addCoordinates:!0}))}toJson(){const l=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return l.xml=Ah(this.xml),l.ids=this.ids,l.json=this.json,this.recordUndo||(l.recordUndo=this.recordUndo),l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new dA),h.xml=t.textToDom$$module$build$src$core$utils$xml(l.xml),h.ids=l.ids,h.json=l.json,l.recordUndo!==void 0&&(h.recordUndo=l.recordUndo),h}run(l){const h=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!$G(h,this.ids))if(l)qr(this.json,h);else for(l=0;l<this.ids.length;l++){const m=this.ids[l],E=h.getBlockById(m);E?E.dispose(!1):m===this.blockId&&console.warn("Can't uncreate non-existent block: "+m)}}},$G=function(l,h){return h.map(m=>l.getBlockById(m)).filter(m=>m&&m.isShadow()).length===h.length};i(Jt.EVENT,t.CREATE$$module$build$src$core$events$utils,dA);var hA=class extends Ec{constructor(l,h){super(h),this.type=P_,this.themeName=l}toJson(){const l=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return l.themeName=this.themeName,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new hA),h.themeName=l.themeName,h}};i(Jt.EVENT,P_,hA);var fA=class extends Ec{constructor(l,h,m,E,k){super(E),this.type=Gr,this.viewTop=l,this.viewLeft=h,this.scale=m,this.oldScale=k}toJson(){const l=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return l.viewTop=this.viewTop,l.viewLeft=this.viewLeft,l.scale=this.scale,l.oldScale=this.oldScale,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new fA),h.viewTop=l.viewTop,h.viewLeft=l.viewLeft,h.scale=l.scale,h.oldScale=l.oldScale,h}};i(Jt.EVENT,Gr,fA);var gA;gA=28,t.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:gA,connectingSnapRadius:gA,currentConnectionPreference:8,bumpDelay:250},t.config$$module$build$src$core$config;var Pn;(function(l){l[l.INPUT_VALUE=1]="INPUT_VALUE",l[l.OUTPUT_VALUE=2]="OUTPUT_VALUE",l[l.NEXT_STATEMENT=3]="NEXT_STATEMENT",l[l.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(Pn||(Pn={}));var Fp=class{constructor(l){this.connectionChecker=l,this.connections=[]}addConnection(l,h){h=this.calculateIndexForYPos(h),this.connections.splice(h,0,l)}findIndexOfConnection(l,h){if(!this.connections.length)return-1;const m=this.calculateIndexForYPos(h);if(m>=this.connections.length)return-1;h=l.y;let E=m;for(;0<=E&&this.connections[E].y===h;){if(this.connections[E]===l)return E;E--}for(E=m;E<this.connections.length&&this.connections[E].y===h;){if(this.connections[E]===l)return E;E++}return-1}calculateIndexForYPos(l){if(!this.connections.length)return 0;let h=0,m=this.connections.length;for(;h<m;){const E=Math.floor((h+m)/2);if(this.connections[E].y<l)h=E+1;else if(this.connections[E].y>l)m=E;else{h=E;break}}return h}removeConnection(l,h){if(l=this.findIndexOfConnection(l,h),l===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(l,1)}getNeighbours(l,h){function m(kn){const Qo=k-E[kn].x,Vo=z-E[kn].y;return Math.sqrt(Qo*Qo+Vo*Vo)<=h&&Ht.push(E[kn]),Vo<h}const E=this.connections,k=l.x,z=l.y;l=0;let Oe=E.length-2,Je=Oe;for(;l<Je;)E[Je].y<z?l=Je:Oe=Je,Je=Math.floor((l+Oe)/2);const Ht=[];if(Oe=l=Je,E.length){for(;0<=l&&m(l);)l--;do Oe++;while(Oe<E.length&&m(Oe))}return Ht}isInYRange(l,h,m){return Math.abs(this.connections[l].y-h)<=m}searchForClosest(l,h,m){if(!this.connections.length)return{connection:null,radius:h};const E=l.y,k=l.x;l.x=k+m.x,l.y=E+m.y;var z=this.calculateIndexForYPos(l.y);m=null;let Oe=h,Je,Ht=z-1;for(;0<=Ht&&this.isInYRange(Ht,l.y,h);)Je=this.connections[Ht],this.connectionChecker.canConnect(l,Je,!0,Oe)&&(m=Je,Oe=Je.distanceFrom(l)),Ht--;for(;z<this.connections.length&&this.isInYRange(z,l.y,h);)Je=this.connections[z],this.connectionChecker.canConnect(l,Je,!0,Oe)&&(m=Je,Oe=Je.distanceFrom(l)),z++;return l.x=k,l.y=E,{connection:m,radius:Oe}}static init(l){const h=[];return h[Pn.INPUT_VALUE]=new Fp(l),h[Pn.OUTPUT_VALUE]=new Fp(l),h[Pn.NEXT_STATEMENT]=new Fp(l),h[Pn.PREVIOUS_STATEMENT]=new Fp(l),h}},uT=class{paste(l,h,m){if(!h.isCapacityAvailable(l.typeCounts))return null;m&&(l.blockState.x=m.x,l.blockState.y=m.y),t.disable$$module$build$src$core$events$utils();let E;try{E=qr(l.blockState,h),a2(E)}finally{t.enable$$module$build$src$core$events$utils()}return E&&(ge()&&!E.isShadow()&&q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(E)),E.select(),E)}};uT.TYPE="block",sI(uT.TYPE,new uT);var pA=null,mA=null,_A={duplicateInternal:nk,copyInternal:qy},j_={};j_.BlockPaster=uT,j_.TEST_ONLY=_A,j_.copy=ZM,j_.duplicate=tk,j_.paste=Vd,j_.registry=lA;var xG="aria-",PG="role",Lc;(function(l){l.GRID="grid",l.GRIDCELL="gridcell",l.GROUP="group",l.LISTBOX="listbox",l.MENU="menu",l.MENUITEM="menuitem",l.MENUITEMCHECKBOX="menuitemcheckbox",l.OPTION="option",l.PRESENTATION="presentation",l.ROW="row",l.TREE="tree",l.TREEITEM="treeitem"})(Lc||(Lc={}));var Ao;(function(l){l.ACTIVEDESCENDANT="activedescendant",l.COLCOUNT="colcount",l.DISABLED="disabled",l.EXPANDED="expanded",l.INVALID="invalid",l.LABEL="label",l.LABELLEDBY="labelledby",l.LEVEL="level",l.ORIENTATION="orientation",l.POSINSET="posinset",l.ROWCOUNT="rowcount",l.SELECTED="selected",l.SETSIZE="setsize",l.VALUEMAX="valuemax",l.VALUEMIN="valuemin"})(Ao||(Ao={}));var dT={};dT.Role=Lc,dT.State=Ao,dT.setRole=su,dT.setState=bo;var vA=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.mouseLeaveHandler=this.mouseEnterHandler=this.clickHandler=this.mouseOverHandler=this.highlightedItem=this.openingCoords=null}addChild(l){this.menuItems.push(l)}render(l){const h=document.createElement("div");h.className="blocklyMenu goog-menu blocklyNonSelectable",h.tabIndex=0,this.roleName&&su(h,this.roleName),this.element=h;for(let m=0,E;E=this.menuItems[m];m++)h.appendChild(E.createDom());return this.mouseOverHandler=ee(h,"pointerover",this,this.handleMouseOver,!0),this.clickHandler=ee(h,"pointerup",this,this.handleClick,!0),this.mouseEnterHandler=ee(h,"pointerenter",this,this.handleMouseEnter,!0),this.mouseLeaveHandler=ee(h,"pointerleave",this,this.handleMouseLeave,!0),this.onKeyDownHandler=ee(h,"keydown",this,this.handleKeyEvent),l.appendChild(h),h}getElement(){return this.element}focus(){const l=this.getElement();l&&(l.focus({preventScroll:!0}),ke(l,"blocklyFocused"))}blur(){const l=this.getElement();l&&(l.blur(),Ct(l,"blocklyFocused"))}setRole(l){this.roleName=l}dispose(){this.mouseOverHandler&&(Me(this.mouseOverHandler),this.mouseOverHandler=null),this.clickHandler&&(Me(this.clickHandler),this.clickHandler=null),this.mouseEnterHandler&&(Me(this.mouseEnterHandler),this.mouseEnterHandler=null),this.mouseLeaveHandler&&(Me(this.mouseLeaveHandler),this.mouseLeaveHandler=null),this.onKeyDownHandler&&(Me(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let l=0,h;h=this.menuItems[l];l++)h.dispose();this.element=null}getMenuItem(l){const h=this.getElement();for(;l&&l!==h;){if(l.classList.contains("blocklyMenuItem")){for(let m=0,E;E=this.menuItems[m];m++)if(E.getElement()===l)return E}l=l.parentElement}return null}setHighlighted(l){var h=this.highlightedItem;h&&(h.setHighlighted(!1),this.highlightedItem=null),l&&(l.setHighlighted(!0),this.highlightedItem=l,h=this.getElement(),Ps(l.getElement(),h),bo(h,Ao.ACTIVEDESCENDANT,l.getId()))}highlightNext(){const l=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(l,1)}highlightPrevious(){const l=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>l?this.menuItems.length:l,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(l,h){l+=h;let m;for(;m=this.menuItems[l];){if(m.isEnabled()){this.setHighlighted(m);break}l+=h}}handleMouseOver(l){(l=this.getMenuItem(l.target))&&(l.isEnabled()?this.highlightedItem!==l&&this.setHighlighted(l):this.setHighlighted(null))}handleClick(l){const h=this.openingCoords;if(this.openingCoords=null,h&&typeof l.clientX=="number"){const m=new _n(l.clientX,l.clientY);if(1>_n.distance(h,m))return}(l=this.getMenuItem(l.target))&&l.performAction()}handleMouseEnter(l){this.focus()}handleMouseLeave(l){this.getElement()&&(this.blur(),this.setHighlighted(null))}handleKeyEvent(l){if(this.menuItems.length&&!(l.shiftKey||l.ctrlKey||l.metaKey||l.altKey)){var h=this.highlightedItem;switch(l.key){case"Enter":case" ":h&&h.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}l.preventDefault(),l.stopPropagation()}}getSize(){const l=this.getElement(),h=Tn(l);return h.height=l.scrollHeight,h}},hT=class{constructor(l,h){this.content=l,this.opt_value=h,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const l=document.createElement("div");l.id=V(),this.element=l,l.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const h=document.createElement("div");if(h.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var m=document.createElement("div");m.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",h.appendChild(m)}return m=this.content,typeof this.content=="string"&&(m=document.createTextNode(this.content)),h.appendChild(m),l.appendChild(h),this.roleName&&su(l,this.roleName),bo(l,Ao.SELECTED,this.checkable&&this.checked||!1),bo(l,Ao.DISABLED,!this.enabled),l}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let l;return(l=this.opt_value)!=null?l:null}setRightToLeft(l){this.rightToLeft=l}setRole(l){this.roleName=l}setCheckable(l){this.checkable=l}setChecked(l){this.checked=l}setHighlighted(l){this.highlight=l;const h=this.getElement();h&&this.isEnabled()&&(l?(ke(h,"blocklyMenuItemHighlight"),ke(h,"goog-menuitem-highlight")):(Ct(h,"blocklyMenuItemHighlight"),Ct(h,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(l){this.enabled=l}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(l,h){this.actionHandler=l.bind(h)}},fT=null,dL=null,bA="blocklyWidgetDiv",gT="",pT="",jh,Xh={};Xh.createDom=Jy,Xh.getDiv=Sp,Xh.hide=Wu,Xh.hideIfOwner=Ia,Xh.isVisible=mI,Xh.positionWithAnchor=C_,Xh.repositionForWindowResize=ok,Xh.show=xb,Xh.testOnly_setDiv=d2;var hL=null,lB={},fL=null,Yh={};Yh.callbackFactory=t.callbackFactory$$module$build$src$core$contextmenu,Yh.commentDeleteOption=Fb,Yh.commentDuplicateOption=lk,Yh.dispose=Nh,Yh.getCurrentBlock=f2,Yh.hide=Pb,Yh.setCurrentBlock=rk,Yh.show=Zy,Yh.workspaceCommentOption=m2;var Ks=class{constructor(){this.registry_=new Map,this.reset()}reset(){this.registry_.clear()}register(l){if(this.registry_.has(l.id))throw Error('Menu item with ID "'+l.id+'" is already registered.');this.registry_.set(l.id,l)}unregister(l){if(!this.registry_.has(l))throw Error('Menu item with ID "'+l+'" not found.');this.registry_.delete(l)}getItem(l){let h;return(h=this.registry_.get(l))!=null?h:null}getContextMenuOptions(l,h){const m=[];for(const k of this.registry_.values())if(l===k.scopeType){var E=k.preconditionFn(h);E!=="hidden"&&(E={text:typeof k.displayText=="function"?k.displayText(h):k.displayText,enabled:E==="enabled",callback:k.callback,scope:h,weight:k.weight},m.push(E))}return m.sort(function(k,z){return k.weight-z.weight}),m}};(function(l){var h=l.ScopeType||(l.ScopeType={});h.BLOCK="block",h.WORKSPACE="workspace",l.registry=new l})(Ks),Ks.ScopeType;var gL={};gL.clamp=La,gL.toDegrees=wp,gL.toRadians=Bb;var xE=16,TA=1,aB=12,pL=16,PE=.25,CA=null,X_=null,mT="",_T="",Is,vT,Y_,yA=null,Bp=null,cB=null,EA={getBoundsInfo:function(){const l=Zn(yA),h=Tn(yA);return{left:l.x,right:l.x+h.width,top:l.y,bottom:l.y+h.height,width:h.width,height:h.height}},getPositionMetrics:function(l,h,m,E){const k=EA.getBoundsInfo(),z=Tn(Is);return h+z.height<k.bottom?zs(l,h,k,z):E-z.height>k.top?Wr(m,E,k,z):h+z.height<document.documentElement.clientHeight?zs(l,h,k,z):E-z.height>document.documentElement.clientTop?Wr(m,E,k,z):To(l,k,z)}},Ra={ANIMATION_TIME:PE,ARROW_HORIZONTAL_PADDING:aB,ARROW_SIZE:xE,BORDER_SIZE:TA,PADDING_Y:pL,TEST_ONLY:EA};Ra.clearContent=bI,Ra.createDom=vI,Ra.getContentDiv=Hb,Ra.getOwner=ck,Ra.getPositionX=S_,Ra.hide=w_,Ra.hideIfOwner=ql,Ra.hideWithoutAnimation=Ud,Ra.isVisible=uk,Ra.repositionForWindowResize=Vb,Ra.setBoundsElement=ak,Ra.setColour=TI,Ra.show=Pi,Ra.showPositionedByBlock=E_,Ra.showPositionedByField=bt;var mL=null,FE=null,BE={};BE.connectionUiEffect=CI,BE.disconnectUiEffect=yI,BE.disconnectUiStop=Gb,BE.disposeUiEffect=Ub;var SA=50,bT=100,uB=class{constructor(l,h){this.bubble=l,this.workspace=h,this.dragTarget_=null,this.wouldDeleteBubble_=!1,this.startXY_=this.bubble.getRelativeToSurfaceXY()}startBubbleDrag(){t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.workspace.setResizesEnabled(!1),this.bubble.setAutoLayout&&this.bubble.setAutoLayout(!1);let l;(l=this.workspace.getLayerManager())==null||l.moveToDragLayer(this.bubble),this.bubble.setDragging&&this.bubble.setDragging(!0)}dragBubble(l,h){h=this.pixelsToWorkspaceUnits_(h),h=_n.sum(this.startXY_,h),this.bubble.moveDuringDrag(h),h=this.dragTarget_,this.dragTarget_=this.workspace.getDragTarget(l),l=this.wouldDeleteBubble_,this.wouldDeleteBubble_=this.shouldDelete_(this.dragTarget_),l!==this.wouldDeleteBubble_&&this.updateCursorDuringBubbleDrag_(),this.dragTarget_!==h&&(h&&h.onDragExit(this.bubble),this.dragTarget_&&this.dragTarget_.onDragEnter(this.bubble)),this.dragTarget_&&this.dragTarget_.onDragOver(this.bubble)}shouldDelete_(l){return l&&this.workspace.getComponentManager().hasCapability(l.id,Qr.Capability.DELETE_AREA)?l.wouldDelete(this.bubble,!1):!1}updateCursorDuringBubbleDrag_(){this.bubble.setDeleteStyle(this.wouldDeleteBubble_)}endBubbleDrag(l,h){if(this.dragBubble(l,h),this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.bubble)?l=this.startXY_:(l=this.pixelsToWorkspaceUnits_(h),l=_n.sum(this.startXY_,l)),this.bubble.moveTo(l.x,l.y),this.dragTarget_&&this.dragTarget_.onDrop(this.bubble),this.wouldDeleteBubble_)this.fireMoveEvent_(),this.bubble.dispose();else{if(this.bubble.setDragging){this.bubble.setDragging(!1);let m;(m=this.workspace.getLayerManager())==null||m.moveOffDragLayer(this.bubble,bT)}this.fireMoveEvent_()}this.workspace.setResizesEnabled(!0),t.setGroup$$module$build$src$core$events$utils(!1)}fireMoveEvent_(){if(this.bubble instanceof sa){const l=new(Ne(au))(this.bubble);l.setOldCoordinate(this.startXY_),l.recordNew(),q(l)}}pixelsToWorkspaceUnits_(l){return l=new _n(l.x/this.workspace.scale,l.y/this.workspace.scale),this.workspace.isMutator&&l.scale(1/this.workspace.options.parentWorkspace.scale),l}},wA=30,IA=!0,gg=[];gg[Pn.INPUT_VALUE]=Pn.OUTPUT_VALUE,gg[Pn.OUTPUT_VALUE]=Pn.INPUT_VALUE,gg[Pn.NEXT_STATEMENT]=Pn.PREVIOUS_STATEMENT,gg[Pn.PREVIOUS_STATEMENT]=Pn.NEXT_STATEMENT;var _L="RENAME_VARIABLE_ID",vL="DELETE_VARIABLE_ID",Hp={};Hp.commonWordPrefix=zb,Hp.commonWordSuffix=Dh,Hp.isNumber=t.isNumber$$module$build$src$core$utils$string,Hp.shortestStringLength=eE,Hp.startsWith=_2,Hp.wrap=t.wrap$$module$build$src$core$utils$string;var HE=void 0,VE=!1,TT=!1,dB=50,UE=0,qh=0,LA=0,OA=0,Oc=null,CT=null,RA=0,MA=10,hB=10,fB=750,bL=5,el=null,uu={HOVER_MS:fB,LIMIT:dB,MARGINS:bL,OFFSET_X:RA,OFFSET_Y:MA,RADIUS_OK:hB};uu.bindMouseEvents=Yb,uu.block=mk,uu.createDom=gk,uu.dispose=pk,uu.getCustomTooltip=iE,uu.getDiv=jb,uu.getTooltipOfObject=Gu,uu.hide=$h,uu.isVisible=fk,uu.setCustomTooltip=hk,uu.unbindMouseEvents=EI,uu.unblock=_k;var gB=class{constructor(l){this.workspace=l,this.horizontalScrollEnabled_=this.workspace.isMovableHorizontally(),this.verticalScrollEnabled_=this.workspace.isMovableVertically(),this.startScrollXY_=new _n(l.scrollX,l.scrollY)}dispose(){this.workspace=null}startDrag(){w()&&w().unselect()}endDrag(l){this.drag(l)}drag(l){if(l=_n.sum(this.startScrollXY_,l),this.horizontalScrollEnabled_&&this.verticalScrollEnabled_)this.workspace.scroll(l.x,l.y);else if(this.horizontalScrollEnabled_)this.workspace.scroll(l.x,this.workspace.scrollY);else if(this.verticalScrollEnabled_)this.workspace.scroll(this.workspace.scrollX,l.y);else throw new TypeError("Invalid state.")}},FG=5,BG=6,pg=class{constructor(l,h){this.creatorWorkspace=h,this.mouseDownXY=new _n(0,0),this.startWorkspace_=this.targetBlock=this.startBlock=this.startIcon=this.startField=this.startBubble=null,this.hasExceededDragRadius=!1,this.boundEvents=[],this.flyout=this.workspaceDragger=this.blockDragger=this.bubbleDragger=null,this.isMultiTouch_=this.isEnding_=this.gestureHasStarted=this.calledUpdateIsDragging=!1,this.cachedPoints=new Map,this.startDistance=this.previousScale=0,this.currentDropdownOwner=this.isPinchZoomEnabled=null,this.mostRecentEvent=l,this.currentDragDeltaXY=new _n(0,0),this.healStack=!IA}dispose(){Ve(),_k(),this.creatorWorkspace.clearGesture();for(const l of this.boundEvents)Me(l);this.boundEvents.length=0,this.blockDragger&&this.blockDragger.dispose(),this.workspaceDragger&&this.workspaceDragger.dispose()}updateFromEvent(l){const h=new _n(l.clientX,l.clientY);this.updateDragDelta(h)&&(this.updateIsDragging(),we()),this.mostRecentEvent=l}updateDragDelta(l){return this.currentDragDeltaXY=_n.difference(l,this.mouseDownXY),this.hasExceededDragRadius?!1:this.hasExceededDragRadius=_n.magnitude(this.currentDragDeltaXY)>(this.flyout?t.config$$module$build$src$core$config.flyoutDragRadius:t.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let l;if(!this.targetBlock||(l=this.flyout)==null||!l.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' +
- 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),this.targetBlock.select(),!0):!1}updateIsDraggingBubble(){return this.startBubble?(this.startDraggingBubble(),!0):!1}updateIsDraggingBlock(){if(!this.targetBlock)return!1;if(this.flyout){if(this.updateIsDraggingFromFlyout())return this.startDraggingBlock(),!0}else if(this.targetBlock.isMovable())return this.startDraggingBlock(),!0;return!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger=new gB(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(){if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.updateIsDraggingBubble()||this.updateIsDraggingBlock()||this.updateIsDraggingWorkspace()}startDraggingBlock(){this.blockDragger=new(f(Jt.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(this.targetBlock,this.startWorkspace_),this.blockDragger.startDrag(this.currentDragDeltaXY,this.healStack),this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY)}startDraggingBubble(){if(!this.startBubble)throw Error("Cannot update dragging the bubble because the start bubble is undefined");if(!this.startWorkspace_)throw Error("Cannot update dragging the bubble because the start workspace is undefined");this.bubbleDragger=new uB(this.startBubble,this.startWorkspace_),this.bubbleDragger.startBubbleDrag(),this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY)}doStart(l){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,et(l)?this.cancel():(this.gestureHasStarted=!0,Gb(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=ck(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=l,mk(),this.targetBlock&&this.targetBlock.select(),at(l)?this.handleRightClick(l):(l.type.toLowerCase()==="pointerdown"&&l.pointerType!=="mouse"&&Re(l,this),this.mouseDownXY=new _n(l.clientX,l.clientY),this.healStack=l.altKey||l.ctrlKey||l.metaKey,this.bindMouseEvents(l),this.isEnding_||this.handleTouchStart(l)))}bindMouseEvents(l){this.boundEvents.push(ee(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(ee(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(ee(document,"pointerup",null,this.handleUp.bind(this),!0)),l.preventDefault(),l.stopPropagation()}handleStart(l){this.isDragging()||(this.handleTouchStart(l),this.isMultiTouch()&&we())}handleMove(l){this.isDragging()&&Ge(l)||!this.isMultiTouch()?(this.updateFromEvent(l),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.blockDragger?this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY):this.bubbleDragger&&this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY),l.preventDefault(),l.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(l),we())}handleUp(l){if(this.isDragging()||this.handleTouchEnd(l),!this.isMultiTouch()||this.isDragging()){if(!Ge(l))return;if(this.updateFromEvent(l),we(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.bubbleDragger?this.bubbleDragger.endBubbleDrag(l,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(l,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()?this.doBubbleClick():this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(l)}l.preventDefault(),l.stopPropagation(),this.dispose()}handleTouchStart(l){var h=dt(l);this.cachedPoints.set(h,this.getTouchPoint(l));var m=Array.from(this.cachedPoints.keys());m.length===2&&(h=this.cachedPoints.get(m[0]),m=this.cachedPoints.get(m[1]),this.startDistance=_n.distance(h,m),this.isMultiTouch_=!0,l.preventDefault())}handleTouchMove(l){const h=dt(l);this.cachedPoints.set(h,this.getTouchPoint(l)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(l):this.handleMove(l)}handlePinch(l){var h=Array.from(this.cachedPoints.keys()),m=this.cachedPoints.get(h[0]);if(h=this.cachedPoints.get(h[1]),m=_n.distance(m,h)/this.startDistance,0<this.previousScale&&1/0>this.previousScale){if(h=m-this.previousScale,h=0<h?h*FG:h*BG,!this.startWorkspace_)throw Error("Cannot handle a pinch because the start workspace is undefined");const E=this.startWorkspace_,k=Ue(l,E.getParentSvg(),E.getInverseScreenCTM());E.zoom(k.x,k.y,h)}this.previousScale=m,l.preventDefault()}handleTouchEnd(l){l=dt(l),this.cachedPoints.has(l)&&this.cachedPoints.delete(l),2>this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(l){return this.startWorkspace_?new _n(l.pageX,l.pageY):null}isMultiTouch(){return this.isMultiTouch_}cancel(){this.isEnding_||(we(),this.bubbleDragger?this.bubbleDragger.endBubbleDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(l){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(l)):this.startBubble?this.startBubble.showContextMenu(l):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(l)),l.preventDefault(),l.stopPropagation(),this.dispose()}handleWsStart(l,h){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(h),this.mostRecentEvent=l,this.doStart(l)}fireWorkspaceClick(l){q(new(Ne(dg))(null,l.id,"workspace"))}handleFlyoutStart(l,h){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(h),this.handleWsStart(l,h.getWorkspace())}handleBlockStart(l,h){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(h),this.mostRecentEvent=l}handleBubbleStart(l,h){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(h),this.mostRecentEvent=l}doBubbleClick(){this.startBubble instanceof sa&&(this.startBubble.setFocus(),this.startBubble.select())}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");this.targetBlock.isEnabled()&&(t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.flyout.createBlock(this.targetBlock).scheduleSnapAndBump())}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");const l=new(Ne(dg))(this.startBlock,this.startWorkspace_.id,"block");q(l)}this.bringBlockToFront(),t.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(l){l=this.creatorWorkspace,w()&&w().unselect(),this.fireWorkspaceClick(this.startWorkspace_||l)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(l){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=l)}setStartIcon(l){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=l)}setStartBubble(l){this.startBubble||(this.startBubble=l)}setStartBlock(l){this.startBlock||this.startBubble||(this.startBlock=l,l.isInFlyout&&l!==l.getRootBlock()?this.setTargetBlock(l.getRootBlock()):this.setTargetBlock(l))}setTargetBlock(l){l.isShadow()?this.setTargetBlock(l.getParent()):this.targetBlock=l}setStartWorkspace(l){this.startWorkspace_||(this.startWorkspace_=l)}setStartFlyout(l){this.flyout||(this.flyout=l)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const l=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&l}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}isDragging(){return!!this.workspaceDragger||!!this.blockDragger||!!this.bubbleDragger}hasStarted(){return this.gestureHasStarted}getInsertionMarkers(){return this.blockDragger?this.blockDragger.getInsertionMarkers():[]}getCurrentDragger(){let l,h;return(h=(l=this.blockDragger)!=null?l:this.workspaceDragger)!=null?h:this.bubbleDragger}static inProgress(){const l=p();for(let h=0,m;m=l[h];h++)if(m.currentGesture_)return!0;return!1}},kA=class{constructor(l,h){this.pattern=l,this.scale=1;let m;this.spacing=(m=h.spacing)!=null?m:0;let E;this.length=(E=h.length)!=null?E:1,this.line2=(this.line1=l.firstChild)&&this.line1.nextSibling;let k;this.snapToGrid=(k=h.snap)!=null?k:!1}setSpacing(l){this.spacing=l,this.update(this.scale)}setLength(l){this.length=l,this.update(this.scale)}setSnapToGrid(l){this.snapToGrid=l}shouldSnap(){return this.snapToGrid}getSpacing(){return this.spacing}getPatternId(){return this.pattern.id}update(l){this.scale=l;var h=this.spacing*l;this.pattern.setAttribute("width",`${h}`),this.pattern.setAttribute("height",`${h}`),h=Math.floor(this.spacing/2)+.5;let m=h-this.length/2,E=h+this.length/2;h*=l,m*=l,E*=l,this.setLineAttributes(this.line1,l,m,E,h,h),this.setLineAttributes(this.line2,l,h,h,m,E)}setLineAttributes(l,h,m,E,k,z){l&&(l.setAttribute("stroke-width",`${h}`),l.setAttribute("x1",`${m}`),l.setAttribute("y1",`${k}`),l.setAttribute("x2",`${E}`),l.setAttribute("y2",`${z}`))}moveTo(l,h){this.pattern.setAttribute("x",`${l}`),this.pattern.setAttribute("y",`${h}`)}static createDom(l,h,m){l=He(pt.PATTERN,{id:"blocklyGridPattern"+l,patternUnits:"userSpaceOnUse"},m);let E,k;if(0<((E=h.length)!=null?E:1)&&0<((k=h.spacing)!=null?k:0)){He(pt.LINE,{stroke:h.colour},l);let z;(z=h.length)!=null&&z&&He(pt.LINE,{stroke:h.colour},l)}else He(pt.LINE,{},l);return l}},Ya=class{constructor(l){this.workspace=l,this.cursorSvg_=this.cursor_=null,this.markers=new Map,this.markerSvg_=null}registerMarker(l,h){this.markers.has(l)&&this.unregisterMarker(l),h.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,h)),this.setMarkerSvg(h.getDrawer().createDom()),this.markers.set(l,h)}unregisterMarker(l){const h=this.markers.get(l);if(h)h.dispose(),this.markers.delete(l);else throw Error("Marker with ID "+l+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor_}getMarker(l){return this.markers.get(l)||null}setCursor(l){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=l)&&(l=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor_),this.cursor_.setDrawer(l),this.setCursorSvg(this.cursor_.getDrawer().createDom()))}setCursorSvg(l){l?(this.workspace.getBlockCanvas().appendChild(l),this.cursorSvg_=l):this.cursorSvg_=null}setMarkerSvg(l){l?this.workspace.getBlockCanvas()&&(this.cursorSvg_?this.workspace.getBlockCanvas().insertBefore(l,this.cursorSvg_):this.workspace.getBlockCanvas().appendChild(l)):this.markerSvg_=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace.getCursor().draw()}dispose(){const l=Object.keys(this.markers);for(let h=0,m;m=l[h];h++)this.unregisterMarker(m);this.markers.clear(),this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)}};Ya.LOCAL_MARKER="local_marker_1";var pB={};pB.deepMerge=xh;var q_=class{constructor(l,h,m,E){this.name=l,this.startHats=!1,this.blockStyles=h||Object.create(null),this.categoryStyles=m||Object.create(null),this.componentStyles=E||Object.create(null),this.fontStyle=Object.create(null),i(Jt.THEME,l,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(l,h){this.blockStyles[l]=h}setCategoryStyle(l,h){this.categoryStyles[l]=h}getComponentStyle(l){if(l=this.componentStyles[l],!l)return null;if(typeof l=="string"){const h=this.getComponentStyle(l);if(h)return h}return`${l}`}setComponentStyle(l,h){this.componentStyles[l]=h}setFontStyle(l){this.fontStyle=l}setStartHats(l){this.startHats=l}static defineTheme(l,h){l=l.toLowerCase();const m=new q_(l);let E=h.base;if(E){if(typeof E=="string"){let k;E=(k=u(Jt.THEME,E))!=null?k:void 0}E instanceof q_&&(xh(m,E),m.name=l)}return xh(m.blockStyles,h.blockStyles),xh(m.categoryStyles,h.categoryStyles),xh(m.componentStyles,h.componentStyles),xh(m.fontStyle,h.fontStyle),h.startHats!==null&&(m.startHats=h.startHats),m}},J_={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},Xi={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},TL=new q_("classic",J_,Xi),Jo=class{constructor(l){this.gridPattern=null,this.getMetrics=this.setMetrics=void 0;let h=null,m=!1;var E=!1,k=!1,z=!1,Oe=!1,Je=!1;const Ht=!!l.readOnly;if(!Ht){var kn;h=It((kn=l.toolbox)!=null?kn:null),m=gt(h),E=l.trashcan,E=E===void 0?m:E,k=l.collapse,k=k===void 0?m:k,z=l.comments,z=z===void 0?m:z,Oe=l.disable,Oe=Oe===void 0?m:Oe,Je=l.sounds,Je=Je===void 0?!0:Je}kn=l.maxTrashcanContents,E?kn===void 0&&(kn=32):kn=0;const Qo=!!l.rtl;let Vo=l.horizontalLayout;Vo===void 0&&(Vo=!1);var sd=l.toolboxPosition!=="end";sd=Vo?sd?Fi.TOP:Fi.BOTTOM:sd===Qo?Fi.RIGHT:Fi.LEFT;let VL=l.css;VL===void 0&&(VL=!0);let UL="blockly/media/";l.media?UL=l.media.endsWith("/")?l.media:l.media+"/":"path"in l&&(Tt("path","Nov 2014","Jul 2023","media"),UL=l.path+"media/");const Moe=l.oneBasedIndex,_Ne=l.renderer||"geras",vNe=l.plugins||{};let ez=l.modalInputs;ez===void 0&&(ez=!0),this.RTL=Qo,this.oneBasedIndex=Moe===void 0?!0:Moe,this.collapse=k,this.comments=z,this.disable=Oe,this.readOnly=Ht,this.maxBlocks=l.maxBlocks||1/0;let koe;this.maxInstances=(koe=l.maxInstances)!=null?koe:null,this.modalInputs=ez,this.pathToMedia=UL,this.hasCategories=m,this.moveOptions=Jo.parseMoveOptions_(l,m),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=E,this.maxTrashcanContents=kn,this.hasSounds=Je,this.hasCss=VL,this.horizontalLayout=Vo,this.languageTree=h,this.gridOptions=Jo.parseGridOptions_(l),this.zoomOptions=Jo.parseZoomOptions_(l),this.toolboxPosition=sd,this.theme=Jo.parseThemeOptions_(l),this.renderer=_Ne;let Aoe;this.rendererOverrides=(Aoe=l.rendererOverrides)!=null?Aoe:null;let Noe;this.parentWorkspace=(Noe=l.parentWorkspace)!=null?Noe:null,this.plugins=vNe}static parseMoveOptions_(l,h){const m=l.move||{},E={};return m.scrollbars===void 0&&l.scrollbars===void 0?E.scrollbars=h:typeof m.scrollbars=="object"?(E.scrollbars={horizontal:!!m.scrollbars.horizontal,vertical:!!m.scrollbars.vertical},E.scrollbars.horizontal&&E.scrollbars.vertical?E.scrollbars=!0:E.scrollbars.horizontal||E.scrollbars.vertical||(E.scrollbars=!1)):E.scrollbars=!!m.scrollbars||!!l.scrollbars,E.wheel=E.scrollbars&&m.wheel!==void 0?!!m.wheel:typeof E.scrollbars=="object",E.drag=E.scrollbars?m.drag===void 0?!0:!!m.drag:!1,E}static parseZoomOptions_(l){l=l.zoom||{};const h={};return h.controls=l.controls===void 0?!1:!!l.controls,h.wheel=l.wheel===void 0?!1:!!l.wheel,h.startScale=l.startScale===void 0?1:Number(l.startScale),h.maxScale=l.maxScale===void 0?3:Number(l.maxScale),h.minScale=l.minScale===void 0?.3:Number(l.minScale),h.scaleSpeed=l.scaleSpeed===void 0?1.2:Number(l.scaleSpeed),h.pinch=l.pinch===void 0?h.wheel||h.controls:!!l.pinch,h}static parseGridOptions_(l){l=l.grid||{};const h={};return h.spacing=Number(l.spacing)||0,h.colour=l.colour||"#888",h.length=l.length===void 0?1:Number(l.length),h.snap=0<h.spacing&&!!l.snap,h}static parseThemeOptions_(l){return l=l.theme||TL,typeof l=="string"?u(Jt.THEME,l):l instanceof q_?l:q_.defineTheme(l.name||"builtin"+V(),l)}},No=class extends K_{constructor(l,h,m,E,k){super(l),this.type=t.CHANGE$$module$build$src$core$events$utils,l&&(this.element=h,this.name=m||void 0,this.oldValue=E,this.newValue=k)}toJson(){const l=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");return l.element=this.element,l.name=this.name,l.oldValue=this.oldValue,l.newValue=this.newValue,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new No),h.element=l.element,h.name=l.name,h.oldValue=l.oldValue,h.newValue=l.newValue,h}isNull(){return this.oldValue===this.newValue}run(l){var h=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(h=h.getBlockById(this.blockId),!h)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");var m=h.getIcon(wc.MUTATOR);switch(m&&Lp(m)&&m.bubbleIsVisible()&&m.setBubbleVisible(!1),l=l?this.newValue:this.oldValue,this.element){case"field":(h=h.getField(this.name))?h.setValue(l):console.warn("Can't set non-existent field: "+this.name);break;case"comment":h.setCommentText(l||null);break;case"collapsed":h.setCollapsed(!!l);break;case"disabled":h.setEnabled(!l);break;case"inline":h.setInputsInline(!!l);break;case"mutation":m=No.getExtraBlockState_(h),h.loadExtraState?h.loadExtraState(JSON.parse(l||"{}")):h.domToMutation&&h.domToMutation(t.textToDom$$module$build$src$core$utils$xml(l||"<mutation/>")),q(new No(h,"mutation",null,m,l));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(l){return l.saveExtraState?(l=l.saveExtraState(!0))?JSON.stringify(l):"":l.mutationToDom&&(l=l.mutationToDom())?Ah(l):""}};i(Jt.EVENT,t.CHANGE$$module$build$src$core$events$utils,No);var AA=.45,Jh=.65,mB={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},ed={};ed.blend=O_,ed.getHsvSaturation=qb,ed.getHsvValue=Jb,ed.hexToRgb=L_,ed.hsvToHex=og,ed.hueToHex=vk,ed.names=mB,ed.parse=zu,ed.rgbToHex=sg,ed.setHsvSaturation=I_,ed.setHsvValue=Op;var WE={};WE.checkMessageReferences=lE,WE.parseBlockColour=Ph,WE.replaceMessageReferences=Tr,WE.tokenizeInterpolation=bk;var fs=class{constructor(l,h,m){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new ko(0,0),l!==fs.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(l),h&&this.setValidator(h))}configure_(l){l.tooltip&&this.setTooltip(Tr(l.tooltip))}setSourceBlock(l){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=l}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=He(pt.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=He(pt.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=He(pt.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const l=this.getClickTarget_();if(!l)throw Error("A click target has not been set.");Yb(l),this.mouseDownWrapper_=ee(l,"pointerdown",this,this.onMouseDown_)}fromXml(l){this.setValue(l.textContent)}toXml(l){return l.textContent=this.getValue(),l}saveState(l){return l=this.saveLegacyState(fs),l!==null?l:this.getValue()}loadState(l){this.loadLegacyState(fs,l)||this.setValue(l)}saveLegacyState(l){return l.prototype.saveState===this.saveState&&l.prototype.toXml!==this.toXml?(l=t.createElement$$module$build$src$core$utils$xml("field"),l.setAttribute("name",this.name||""),me(this.toXml(l)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(l,h){return l.prototype.loadState===this.loadState&&l.prototype.fromXml!==this.fromXml?(this.fromXml(t.textToDom$$module$build$src$core$utils$xml(h)),!0):!1}dispose(){ql(this),Ia(this);let l;(l=this.getSourceBlock())!=null&&l.isDeadOrDying()||Ot(this.fieldGroup_),this.disposed=!0}updateEditable(){const l=this.fieldGroup_,h=this.getSourceBlock();this.EDITABLE&&l&&h&&(this.enabled_&&h.isEditable()?(ke(l,"blocklyEditableText"),Ct(l,"blocklyNonEditableText"),l.style.cursor=this.CURSOR):(ke(l,"blocklyNonEditableText"),Ct(l,"blocklyEditableText"),l.style.cursor=""))}setEnabled(l){this.enabled_=l,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==fs.prototype.showEditor_}isClickableInFlyout(l){return!l}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let l=!1;return this.name&&(this.SERIALIZABLE?l=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),l=!0)),l}isVisible(){return this.visible_}setVisible(l){if(this.visible_!==l){this.visible_=l;var h=this.fieldGroup_;h&&(h.style.display=l?"block":"none")}}setValidator(l){this.validator_=l}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(l){this.isClickable()&&this.showEditor_(l)}showEditor_(l){}repositionForWindowResize(){return!1}updateSize_(l){const h=this.getConstants();l=l!==void 0?l:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let m=2*l,E=h.FIELD_TEXT_HEIGHT,k=0;this.textElement_&&(k=je(this.textElement_,h.FIELD_TEXT_FONTSIZE,h.FIELD_TEXT_FONTWEIGHT,h.FIELD_TEXT_FONTFAMILY),m+=k),this.isFullBlockField()||(E=Math.max(E,h.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=E,this.size_.width=m,this.positionTextElement_(l,k),this.positionBorderRect_()}positionTextElement_(l,h){if(this.textElement_){var m=this.getConstants(),E=this.size_.height/2,k;this.textElement_.setAttribute("x",String((k=this.getSourceBlock())!=null&&k.RTL?this.size_.width-h-l:l)),this.textElement_.setAttribute("y",String(m.FIELD_TEXT_BASELINE_CENTER?E:E-m.FIELD_TEXT_HEIGHT/2+m.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new ko(0,0)}getScaledBBox(){let l;var h=this.getSourceBlock();if(!h)throw new Co;if(this.isFullBlockField()){var m=this.sourceBlock_.getHeightWidth();const E=h.workspace.scale;l=this.getAbsoluteXY_(),h=(m.width+1)*E,m=(m.height+1)*E,qk?(l.x+=1.5*E,l.y+=1.5*E):(l.x-=.5*E,l.y-=.5*E)}else m=this.borderRect_.getBoundingClientRect(),l=Zn(this.borderRect_),h=m.width,m=m.height;return new lo(l.y,l.y+m,l.x,l.x+h)}onLocationChange(l){}getDisplayText_(){let l=this.getText();return l?(l.length>this.maxDisplayLength&&(l=l.substring(0,this.maxDisplayLength-2)+"…"),l=l.replace(/\s/g,fs.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(l+=""),l):fs.NBSP}getText(){const l=this.getText_();return String(l!==null?l:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.queueRender(),this.sourceBlock_.bumpNeighbours())}setValue(l,h=!0){if(l!==null){var m=this.doClassValidation_(l);if(l=this.processValidation_(l,m),!(l instanceof Error)){var E;m=(E=this.getValidator())==null?void 0:E.call(this,l),E=this.processValidation_(l,m),E instanceof Error||(l=this.sourceBlock_,l&&l.disposed||(m=this.getValue(),m===E?this.doValueUpdate_(E):(this.doValueUpdate_(E),h&&l&&ge()&&q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(l,"field",this.name||null,m,E)),this.isDirty_&&this.forceRerender())))}}}processValidation_(l,h){return h===null?(this.doValueInvalid_(l),this.isDirty_&&this.forceRerender(),Error()):h===void 0?l:h}getValue(){return this.value_}doClassValidation_(l){return l??null}doValueUpdate_(l){this.value_=l,this.isDirty_=!0}doValueInvalid_(l){}onMouseDown_(l){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(l=this.sourceBlock_.workspace.getGesture(l))&&l.setStartField(this)}setTooltip(l){l||l===""||(l=this.sourceBlock_);const h=this.getClickTarget_();h?h.tooltip=l:this.tooltip_=l}getTooltip(){const l=this.getClickTarget_();return Gu(l||{tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return Zn(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let l=null;const h=this.getSourceBlock();if(!h)throw new Co;const m=h.inputList;for(let E=0;E<h.inputList.length;E++){const k=m[E],z=k.fieldRow;for(let Oe=0;Oe<z.length;Oe++)if(z[Oe]===this){l=k;break}}return l}getFlipRtl(){return!1}isTabNavigable(){return!1}onShortcut(l){return!1}setCursorSvg(l){if(l){if(!this.fieldGroup_)throw Error(`The field group is ${this.fieldGroup_}.`);this.fieldGroup_.appendChild(l),this.cursorSvg_=l}else this.cursorSvg_=null}setMarkerSvg(l){if(l){if(!this.fieldGroup_)throw Error(`The field group is ${this.fieldGroup_}.`);this.fieldGroup_.appendChild(l),this.markerSvg_=l}else this.markerSvg_=null}updateMarkers_(){var l=this.getSourceBlock();if(!l)throw new Co;l=l.workspace,l.keyboardAccessibilityMode&&this.cursorSvg_&&l.getCursor().draw(),l.keyboardAccessibilityMode&&this.markerSvg_&&l.getMarker(Ya.LOCAL_MARKER).draw()}};fs.NBSP=" ",fs.SKIP_SETUP=Symbol("SKIP_SETUP");var Co=class extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}};t.Names$$module$build$src$core$names=class{constructor(l,h){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=h||"",this.reservedWords=new Set(l?l.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(l){this.variableMap=l}getNameForUserVariable(l){return this.variableMap?(l=this.variableMap.getVariableById(l))?l.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:
- Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(l){l=t.allUsedVarModels$$module$build$src$core$variables(l);for(let h=0;h<l.length;h++)this.getName(l[h].getId(),t.NameType$$module$build$src$core$names.VARIABLE)}populateProcedures(l){throw Error("The implementation of populateProcedures should be monkey-patched in by blockly.ts")}getName(l,h){let m=l;h===t.NameType$$module$build$src$core$names.VARIABLE&&(l=this.getNameForUserVariable(l))&&(m=l),l=m.toLowerCase();const E=h===t.NameType$$module$build$src$core$names.VARIABLE||h===t.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE?this.variablePrefix:"";this.db.has(h)||this.db.set(h,new Map);const k=this.db.get(h);return k.has(l)?E+k.get(l):(h=this.getDistinctName(m,h),k.set(l,h.substr(E.length)),h)}getUserNames(l){let h;return(l=(h=this.db.get(l))==null?void 0:h.keys())?Array.from(l):[]}getDistinctName(l,h){l=this.safeName(l);let m=null,E,k;for(;this.dbReverse.has(l+((E=m)!=null?E:""))||this.reservedWords.has(l+((k=m)!=null?k:""));)m=m?m+1:2;let z;return l+=(z=m)!=null?z:"",this.dbReverse.add(l),(h===t.NameType$$module$build$src$core$names.VARIABLE||h===t.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE?this.variablePrefix:"")+l}safeName(l){return l?(l=encodeURI(l.replace(/ /g,"_")).replace(/[^\w]/g,"_"),"0123456789".indexOf(l[0])!==-1&&(l="my_"+l)):l=t.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed",l}static equals(l,h){return l.toLowerCase()===h.toLowerCase()}},function(l){l=l.NameType||(l.NameType={}),l.DEVELOPER_VARIABLE="DEVELOPER_VARIABLE",l.VARIABLE="VARIABLE",l.PROCEDURE="PROCEDURE"}(t.Names$$module$build$src$core$names||(t.Names$$module$build$src$core$names={})),t.NameType$$module$build$src$core$names=t.Names$$module$build$src$core$names.NameType,t.Names$$module$build$src$core$names.DEVELOPER_VARIABLE_TYPE=t.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE,t.NameType$$module$build$src$core$names,t.Names$$module$build$src$core$names;var CL=class extends Map{constructor(){super()}set(l,h){return this.get(l)===h?this:(super.set(l,h),Be(h)&&h.startPublishing(),this)}delete(l){const h=this.get(l);return l=super.delete(l),l&&(Be(h)&&h.stopPublishing(),l)}clear(){if(this.size)for(const l of this.keys())this.delete(l)}add(l){return this.set(l.getId(),l)}getProcedures(){return[...this.values()]}},yL=class{constructor(l){this.sourceBlock=l,this.offsetInBlock=new _n(0,0),this.workspaceLocation=new _n(0,0),this.svgRoot=null,this.tooltip=l}getType(){throw Error("Icons must implement getType")}initView(l){if(!this.svgRoot){var h=this.sourceBlock;this.svgRoot=He(pt.G,{class:"blocklyIconGroup"}),h.getSvgRoot().appendChild(this.svgRoot),this.updateSvgRootOffset(),ee(this.svgRoot,"pointerdown",this,l),this.svgRoot.tooltip=this,Yb(this.svgRoot)}}dispose(){EI(this.svgRoot),Ot(this.svgRoot)}getWeight(){return-1}getSize(){return new ko(0,0)}setTooltip(l){this.tooltip=l??this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",Lp(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(l){this.offsetInBlock=l,this.updateSvgRootOffset()}updateSvgRootOffset(){let l;(l=this.svgRoot)==null||l.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(l){this.workspaceLocation=_n.sum(l,this.offsetInBlock)}onClick(){}isClickableInFlyout(l){return!0}setVisible(l){Tt("setVisible","v10","v11","setBubbleVisible"),Lp(this)&&this.setBubbleVisible(l)}},Qh={fromJsonInternal:ou},GE={TEST_ONLY:Qh};GE.fromJson=t.fromJson$$module$build$src$core$field_registry,GE.register=Rl,GE.unregister=aE;var du=class extends fs{constructor(l,h,m){super(fs.SKIP_SETUP),this.svgArrow=this.arrow=this.imageElement=this.menu_=this.selectedMenuItem=null,this.SERIALIZABLE=!0,this.CURSOR="default",this.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null,l!==fs.SKIP_SETUP&&(Array.isArray(l)?(Tk(l),l=bs(l),this.menuGenerator_=l.options,this.prefixField=l.prefix||null,this.suffixField=l.suffix||null):this.menuGenerator_=l,this.selectedOption=this.getOptions(!1)[0],m&&this.configure_(m),this.setValue(this.selectedOption[1]),h&&this.setValidator(h))}fromXml(l){this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(l.textContent)}loadState(l){this.loadLegacyState(du,l)||(this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(l))}initView(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot(),this.createTextElement_(),this.imageElement=He(pt.IMAGE,{},this.fieldGroup_),this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_(),this.borderRect_&&ke(this.borderRect_,"blocklyDropdownRect")}shouldAddBorderRect_(){let l;return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!((l=this.getSourceBlock())!=null&&l.isShadow())}createTextArrow_(){this.arrow=He(pt.TSPAN,{},this.textElement_);let l;this.arrow.appendChild(document.createTextNode((l=this.getSourceBlock())!=null&&l.RTL?du.ARROW_CHAR+" ":" "+du.ARROW_CHAR));let h;(h=this.getSourceBlock())!=null&&h.RTL?this.getTextElement().insertBefore(this.arrow,this.textContent_):this.getTextElement().appendChild(this.arrow)}createSVGArrow_(){this.svgArrow=He(pt.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_),this.svgArrow.setAttributeNS(cu,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}showEditor_(l){var h=this.getSourceBlock();if(!h)throw new Co;this.dropdownCreate(),this.menu_.openingCoords=l&&typeof l.clientX=="number"?new _n(l.clientX,l.clientY):null,bI(),l=this.menu_.render(Hb()),ke(l,"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV&&(h=h.getColour(),TI(h,this.sourceBlock_.style.colourTertiary)),bt(this,this.dropdownDispose_.bind(this)),this.menu_.focus(),this.selectedMenuItem&&(this.menu_.setHighlighted(this.selectedMenuItem),Ps(this.selectedMenuItem.getElement(),Hb(),!0)),this.applyColour()}dropdownCreate(){const l=this.getSourceBlock();if(!l)throw new Co;const h=new vA;h.setRole(Lc.LISTBOX),this.menu_=h;const m=this.getOptions(!1);this.selectedMenuItem=null;for(let k=0;k<m.length;k++){const[z,Oe]=m[k];if(typeof z=="object"){var E=new Image(z.width,z.height);E.src=z.src,E.alt=z.alt||""}else E=z;E=new hT(E,Oe),E.setRole(Lc.OPTION),E.setRightToLeft(l.RTL),E.setCheckable(!0),h.addChild(E),E.setChecked(Oe===this.value_),Oe===this.value_&&(this.selectedMenuItem=E),E.onAction(this.handleMenuActionEvent,this)}}dropdownDispose_(){this.menu_&&this.menu_.dispose(),this.selectedMenuItem=this.menu_=null,this.applyColour()}handleMenuActionEvent(l){ql(this,!0),this.onItemSelected_(this.menu_,l)}onItemSelected_(l,h){this.setValue(h.getValue())}isOptionListDynamic(){return typeof this.menuGenerator_=="function"}getOptions(l){if(!this.menuGenerator_)throw TypeError("A menu generator was never defined.");return Array.isArray(this.menuGenerator_)?this.menuGenerator_:l&&this.generatedOptions?this.generatedOptions:(this.generatedOptions=this.menuGenerator_(),Tk(this.generatedOptions),this.generatedOptions)}doClassValidation_(l){return this.getOptions(!0).some(h=>h[1]===l)?l:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+l),null)}doValueUpdate_(l){super.doValueUpdate_(l),l=this.getOptions(!0);for(let h=0,m;m=l[h];h++)m[1]===this.value_&&(this.selectedOption=m)}applyColour(){const l=this.sourceBlock_.style;this.borderRect_&&(this.borderRect_.setAttribute("stroke",l.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",l.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow&&(this.sourceBlock_.isShadow()?this.arrow.style.fill=l.colourSecondary:this.arrow.style.fill=l.colourPrimary)}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const l=this.selectedOption&&this.selectedOption[0];l&&typeof l=="object"?this.renderSelectedImage(l):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(l){const h=this.getSourceBlock();if(!h)throw new Co;this.imageElement.style.display="",this.imageElement.setAttributeNS(cu,"xlink:href",l.src),this.imageElement.setAttribute("height",String(l.height)),this.imageElement.setAttribute("width",String(l.width));const m=Number(l.height);l=Number(l.width);var E=!!this.borderRect_;const k=Math.max(E?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,m+Ar);E=E?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let z;z=this.svgArrow?this.positionSVGArrow(l+E,k/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):je(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=l+z+2*E,this.size_.height=k;let Oe=0;h.RTL?this.imageElement.setAttribute("x",`${E+z}`):(Oe=l+z,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${E}`)),this.imageElement.setAttribute("y",String(k/2-m/2)),this.positionTextElement_(Oe+E,l+z)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var l=this.getTextElement();ke(l,"blocklyDropdownText"),l.setAttribute("text-anchor","start");var h=!!this.borderRect_;l=Math.max(h?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const m=je(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);h=h?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let E=0;this.svgArrow&&(E=this.positionSVGArrow(m+h,l/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=m+E+2*h,this.size_.height=l,this.positionTextElement_(h,m)}positionSVGArrow(l,h){if(!this.svgArrow)return 0;const m=this.getSourceBlock();if(!m)throw new Co;const E=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,k=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,z=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(m.RTL?E:l+k)+","+h+")"),z+k}getText_(){if(!this.selectedOption)return null;const l=this.selectedOption[0];return typeof l=="object"?l.alt:l}static fromJson(l){if(!l.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(l.options,void 0,l)}};du.CHECKMARK_OVERHANG=25,du.MAX_MENU_HEIGHT_VH=.45,du.ARROW_CHAR="▾";var Cr=5,Ar=2*Cr;Rl("field_dropdown",du);var Rc,js=class{constructor(l,h,m){this.workspace=l,this.anchor=h,this.ownerRect=m,this.size=new ko(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.svgRoot=He(pt.G,{},l.getBubbleCanvas()),l=He(pt.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=He(pt.PATH,{},l),this.background=He(pt.RECT,{class:"blocklyDraggable",x:0,y:0,rx:Rc.BORDER_WIDTH,ry:Rc.BORDER_WIDTH},l),this.contentContainer=He(pt.G,{},this.svgRoot),ee(this.background,"pointerdown",this,this.onMouseDown)}dispose(){Ot(this.svgRoot),this.disposed=!0}setAnchorLocation(l,h=!1){this.anchor=l,h?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(l,h){this.relativeLeft=l,this.relativeTop=h,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(l,h=!1){l.width=Math.max(l.width,Rc.MIN_SIZE),l.height=Math.max(l.height,Rc.MIN_SIZE),this.size=l,this.background.setAttribute("width",`${l.width}`),this.background.setAttribute("height",`${l.height}`),h?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(l){this.colour=l,this.tail.setAttribute("fill",l),this.background.setAttribute("fill",l)}onMouseDown(l){let h;(h=this.workspace.getGesture(l))==null||h.handleBubbleStart(l,this)}positionRelativeToAnchor(){let l=this.anchor.x;l=this.workspace.RTL?l-(this.relativeLeft+this.size.width):l+this.relativeLeft,this.moveTo(l,this.relativeTop+this.anchor.y)}moveTo(l,h){this.svgRoot.setAttribute("transform",`translate(${l}, ${h})`)}positionByRect(l=new lo(0,0,0,0)){var h=this.workspace.getMetricsManager().getViewMetrics(!0),m=this.getOptimalRelativeLeft(h),E=this.getOptimalRelativeTop(h);const k={x:m,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},z={x:-this.size.width-30,y:E};E={x:l.getWidth(),y:E};var Oe={x:m,y:l.getHeight()};m=l.getWidth()<l.getHeight()?E:Oe,l=l.getWidth()<l.getHeight()?Oe:E,E=this.getOverlap(k,h),Oe=this.getOverlap(z,h);const Je=this.getOverlap(m,h);h=this.getOverlap(l,h),h=Math.max(E,Oe,Je,h),E===h?(this.relativeLeft=k.x,this.relativeTop=k.y):Oe===h?(this.relativeLeft=z.x,this.relativeTop=z.y):Je===h?(this.relativeLeft=m.x,this.relativeTop=m.y):(this.relativeLeft=l.x,this.relativeTop=l.y),this.positionRelativeToAnchor()}getOverlap(l,h){var m=this.workspace.RTL?this.anchor.x-l.x-this.size.width:l.x+this.anchor.x;return l=l.y+this.anchor.y,Math.max(0,Math.min(1,(Math.min(m+this.size.width,h.left+h.width)-Math.max(m,h.left))*(Math.min(l+this.size.height,h.top+h.height)-Math.max(l,h.top))/(this.size.width*this.size.height)))}getOptimalRelativeLeft(l){let h=-this.size.width/4;if(this.size.width>l.width)return h;if(l=this.getWorkspaceViewRect(l),this.workspace.RTL){var m=this.anchor.x-h;m-this.size.width<l.left?h=-(l.left-this.anchor.x+this.size.width):m>l.right&&(h=-(l.right-this.anchor.x))}else{m=h+this.anchor.x;const E=m+this.size.width;m<l.left?h=l.left-this.anchor.x:E>l.right&&(h=l.right-this.anchor.x-this.size.width)}return h}getOptimalRelativeTop(l){let h=-this.size.height/4;if(this.size.height>l.height)return h;const m=this.anchor.y+h,E=m+this.size.height;return l=this.getWorkspaceViewRect(l),m<l.top?h=l.top-this.anchor.y:E>l.bottom&&(h=l.bottom-this.anchor.y-this.size.height),h}getWorkspaceViewRect(l){const h=l.top;let m=l.top+l.height,E=l.left;return l=l.left+l.width,m-=this.getScrollbarThickness(),this.workspace.RTL?E-=this.getScrollbarThickness():l-=this.getScrollbarThickness(),new lo(h,m,E,l)}getScrollbarThickness(){return kr.scrollbarThickness/this.workspace.scale}renderTail(){const l=[];var h=this.size.width/2,m=this.size.height/2,E=-this.relativeLeft,k=-this.relativeTop;if(h===E&&m===k)l.push("M "+h+","+m);else{k-=m,E-=h,this.workspace.RTL&&(E*=-1);var z=Math.sqrt(k*k+E*E),Oe=Math.acos(E/z);0>k&&(Oe=2*Math.PI-Oe);var Je=Oe+Math.PI/2;Je>2*Math.PI&&(Je-=2*Math.PI);var Ht=Math.sin(Je);const Qo=Math.cos(Je);let Vo=(this.size.width+this.size.height)/Rc.TAIL_THICKNESS;Vo=Math.min(Vo,this.size.width,this.size.height)/4,Je=1-Rc.ANCHOR_RADIUS/z,E=h+Je*E,k=m+Je*k,Je=h+Vo*Qo;const sd=m+Vo*Ht;h-=Vo*Qo,m-=Vo*Ht,Ht=Bb(this.workspace.RTL?-Rc.TAIL_ANGLE:Rc.TAIL_ANGLE),Ht=Oe+Ht,Ht>2*Math.PI&&(Ht-=2*Math.PI),Oe=Math.sin(Ht)*z/Rc.TAIL_BEND,z=Math.cos(Ht)*z/Rc.TAIL_BEND,l.push("M"+Je+","+sd),l.push("C"+(Je+z)+","+(sd+Oe)+" "+E+","+k+" "+E+","+k),l.push("C"+E+","+k+" "+(h+z)+","+(m+Oe)+" "+h+","+m)}l.push("z");let kn;(kn=this.tail)==null||kn.setAttribute("d",l.join(" "))}bringToFront(){let l;const h=(l=this.svgRoot)==null?void 0:l.parentNode;return this.svgRoot&&(h==null?void 0:h.lastChild)!==this.svgRoot?(h==null||h.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new _n(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(l){this.moveTo(l.x,l.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-l.x-this.size.width:l.x-this.anchor.x,this.relativeTop=l.y-this.anchor.y,this.renderTail()}setDragging(l){}setDeleteStyle(l){}isDeletable(){return!1}showContextMenu(l){}};Rc=js,js.BORDER_WIDTH=6,js.DOUBLE_BORDER=2*Rc.BORDER_WIDTH,js.MIN_SIZE=Rc.DOUBLE_BORDER,js.TAIL_THICKNESS=1,js.TAIL_ANGLE=20,js.TAIL_BEND=4,js.ANCHOR_RADIUS=8;var mg=class extends js{constructor(l,h,m,E){super(h,m,E),this.workspace=h,this.anchor=m,this.ownerRect=E,this.autoLayout=!0,h=new Jo(l),this.validateWorkspaceOptions(h),this.svgDialog=He(pt.SVG,{x:js.BORDER_WIDTH,y:js.BORDER_WIDTH},this.contentContainer),l.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new Jo(l)),this.miniWorkspace.internalIsMutator=!0,l=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(l),h.languageTree&&(l.insertBefore(this.miniWorkspace.addFlyout(pt.G),this.miniWorkspace.getCanvas()),l=this.miniWorkspace.getFlyout(),l==null||l.init(this.miniWorkspace),l==null||l.show(h.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let k,z;(k=this.miniWorkspace.getFlyout())==null||(z=k.getWorkspace())==null||z.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(l){this.miniWorkspace.addChangeListener(l)}validateWorkspaceOptions(l){if(l.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(l.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(l.zoomOptions.controls||l.zoomOptions.wheel||l.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(l.moveOptions.scrollbars||l.moveOptions.wheel||l.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(l.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const l of this.miniWorkspace.getTopBlocks(!1)){const h=l.getRelativeToSurfaceXY();if(20>h.y&&l.moveBy(0,20-h.y),l.RTL){let m=-20;const E=this.miniWorkspace.getFlyout();E&&(m-=E.getWidth()),h.x>m&&l.moveBy(m-h.x,0)}else 20>h.x&&l.moveBy(20-h.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var l=this.getSize(),h=this.calculateWorkspaceSize();Math.abs(l.width-h.width)<mg.MINIMUM_VIEW_CHANGE&&Math.abs(l.height-h.height)<mg.MINIMUM_VIEW_CHANGE||(this.svgDialog.setAttribute("width",`${h.width}px`),this.svgDialog.setAttribute("height",`${h.height}px`),this.miniWorkspace.setCachedParentSvgSize(h.width,h.height),this.miniWorkspace.RTL&&this.miniWorkspace.getCanvas().setAttribute("transform",`translate(${h.width}, 0)`),this.setSize(new ko(h.width+js.DOUBLE_BORDER,h.height+js.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var l=this.miniWorkspace.getCanvas().getBBox();let h=l.width+mg.MARGIN;l=l.height+mg.MARGIN;const m=this.miniWorkspace.getFlyout();if(m){const E=m.getWorkspace().getMetricsManager().getScrollMetrics();l=Math.max(l,E.height+20),h+=m.getWidth()}return new ko(h,l)}updateBlockStyles(){for(var l of this.miniWorkspace.getAllBlocks(!1))l.setStyle(l.getStyleName());let h;if(l=(h=this.miniWorkspace.getFlyout())==null?void 0:h.getWorkspace())for(const m of l.getAllBlocks(!1))m.setStyle(m.getStyleName())}moveDuringDrag(l){super.moveDuringDrag(l),this.autoLayout=!1}moveTo(l,h){super.moveTo(l,h),this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(l){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts")}};mg.MINIMUM_VIEW_CHANGE=10,mg.MARGIN=3*js.DOUBLE_BORDER;var EL,SL;EL=17,SL=16,t.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends yL{constructor(l,h){super(h),this.flyoutBlockTypes=l,this.sourceBlock=h,this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(l){this.svgRoot||(super.initView(l),He(pt.RECT,{class:"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),He(pt.PATH,{class:"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},this.svgRoot),He(pt.CIRCLE,{class:"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),ke(this.svgRoot,"blockly-icon-mutator"))}dispose(){super.dispose();let l;(l=this.miniWorkspaceBubble)==null||l.dispose()}getWeight(){return t.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new ko(EL,EL)}applyColour(){super.applyColour();let l;(l=this.miniWorkspaceBubble)==null||l.setColour(this.sourceBlock.style.colourPrimary);let h;(h=this.miniWorkspaceBubble)==null||h.updateBlockStyles()}updateCollapsed(){super.updateCollapsed(),this.sourceBlock.isCollapsed()&&this.setBubbleVisible(!1)}onLocationChange(l){super.onLocationChange(l);let h;(h=this.miniWorkspaceBubble)==null||h.setAnchorLocation(this.getAnchorLocation())}onClick(){super.onClick(),this.sourceBlock.isEditable()&&this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.miniWorkspaceBubble}setBubbleVisible(l){if(this.bubbleIsVisible()!==l){if(l){this.miniWorkspaceBubble=new mg(this.getMiniWorkspaceConfig(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.applyColour(),this.createRootBlock(),this.addSaveConnectionsListener();let h;(h=this.miniWorkspaceBubble)==null||h.addWorkspaceChangeListener(this.createMiniWorkspaceChangeListener())}else{let h;(h=this.miniWorkspaceBubble)==null||h.dispose(),this.miniWorkspaceBubble=null,this.saveConnectionsListener&&this.sourceBlock.workspace.removeChangeListener(this.saveConnectionsListener),this.saveConnectionsListener=null}q(new(Ne(Gd))(this.sourceBlock,l,"mutator"))}}getMiniWorkspaceConfig(){let l;const h={disable:!1,media:this.sourceBlock.workspace.options.pathToMedia,rtl:this.sourceBlock.RTL,renderer:this.sourceBlock.workspace.options.renderer,rendererOverrides:(l=this.sourceBlock.workspace.options.rendererOverrides)!=null?l:void 0};return this.flyoutBlockTypes.length&&(h.toolbox={kind:"flyoutToolbox",contents:this.flyoutBlockTypes.map(m=>({kind:"block",type:m}))}),h}getAnchorLocation(){const l=EL/2;return _n.sum(this.workspaceLocation,new _n(l,l))}getBubbleOwnerRect(){const l=this.sourceBlock.getSvgRoot().getBBox();return new lo(l.y,l.y+l.height,l.x,l.x+l.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var l of this.rootBlock.getDescendants(!1))l.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let h,m,E,k;l=(k=(h=this.miniWorkspaceBubble)==null||(m=h.getWorkspace())==null||(E=m.getFlyout())==null?void 0:E.getWidth())!=null?k:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(l+SL):SL,SL)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return l=>{t.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(l)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(l){return l.isUiEvent||l.type===t.CREATE$$module$build$src$core$events$utils||l.type===t.CHANGE$$module$build$src$core$events$utils&&l.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var l=t.getGroup$$module$build$src$core$events$utils();l||t.setGroup$$module$build$src$core$events$utils(!0);var h=No.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var m=No.getExtraBlockState_(this.sourceBlock);h!==m&&q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,h,m)),t.setGroup$$module$build$src$core$events$utils(l)}}getWorkspace(){let l;return(l=this.miniWorkspaceBubble)==null?void 0:l.getWorkspace()}static reconnect(l,h,m){return Tt("MutatorIcon.reconnect","v10","v11","connection.reconnect"),l?l.reconnect(h,m):!1}static findParentWs(l){return Tt("MutatorIcon.findParentWs","v10","v11","workspace.getRootWorkspace"),l.getRootWorkspace()}},t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=wc.MUTATOR,t.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,t.MutatorIcon$$module$build$src$core$icons$mutator_icon;var yT=Object.create(null),HG={allExtensions:yT};t.register$$module$build$src$core$extensions("parent_tooltip_when_inline",Fh);var td={TEST_ONLY:HG};td.apply=wI,td.buildTooltipForDropdown=t.buildTooltipForDropdown$$module$build$src$core$extensions,td.buildTooltipWithFieldText=t.buildTooltipWithFieldText$$module$build$src$core$extensions,td.isRegistered=lg,td.register=t.register$$module$build$src$core$extensions,td.registerMixin=t.registerMixin$$module$build$src$core$extensions,td.registerMutator=t.registerMutator$$module$build$src$core$extensions,td.runAfterPageLoad=I2,td.unregister=C2;var Vi;(function(l){l[l.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",l[l.MAC_ENTER=3]="MAC_ENTER",l[l.BACKSPACE=8]="BACKSPACE",l[l.TAB=9]="TAB",l[l.NUM_CENTER=12]="NUM_CENTER",l[l.ENTER=13]="ENTER",l[l.SHIFT=16]="SHIFT",l[l.CTRL=17]="CTRL",l[l.ALT=18]="ALT",l[l.PAUSE=19]="PAUSE",l[l.CAPS_LOCK=20]="CAPS_LOCK",l[l.ESC=27]="ESC",l[l.SPACE=32]="SPACE",l[l.PAGE_UP=33]="PAGE_UP",l[l.PAGE_DOWN=34]="PAGE_DOWN",l[l.END=35]="END",l[l.HOME=36]="HOME",l[l.LEFT=37]="LEFT",l[l.UP=38]="UP",l[l.RIGHT=39]="RIGHT",l[l.DOWN=40]="DOWN",l[l.PLUS_SIGN=43]="PLUS_SIGN",l[l.PRINT_SCREEN=44]="PRINT_SCREEN",l[l.INSERT=45]="INSERT",l[l.DELETE=46]="DELETE",l[l.ZERO=48]="ZERO",l[l.ONE=49]="ONE",l[l.TWO=50]="TWO",l[l.THREE=51]="THREE",l[l.FOUR=52]="FOUR",l[l.FIVE=53]="FIVE",l[l.SIX=54]="SIX",l[l.SEVEN=55]="SEVEN",l[l.EIGHT=56]="EIGHT",l[l.NINE=57]="NINE",l[l.FF_SEMICOLON=59]="FF_SEMICOLON",l[l.FF_EQUALS=61]="FF_EQUALS",l[l.FF_DASH=173]="FF_DASH",l[l.FF_HASH=163]="FF_HASH",l[l.QUESTION_MARK=63]="QUESTION_MARK",l[l.AT_SIGN=64]="AT_SIGN",l[l.A=65]="A",l[l.B=66]="B",l[l.C=67]="C",l[l.D=68]="D",l[l.E=69]="E",l[l.F=70]="F",l[l.G=71]="G",l[l.H=72]="H",l[l.I=73]="I",l[l.J=74]="J",l[l.K=75]="K",l[l.L=76]="L",l[l.M=77]="M",l[l.N=78]="N",l[l.O=79]="O",l[l.P=80]="P",l[l.Q=81]="Q",l[l.R=82]="R",l[l.S=83]="S",l[l.T=84]="T",l[l.U=85]="U",l[l.V=86]="V",l[l.W=87]="W",l[l.X=88]="X",l[l.Y=89]="Y",l[l.Z=90]="Z",l[l.META=91]="META",l[l.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",l[l.CONTEXT_MENU=93]="CONTEXT_MENU",l[l.NUM_ZERO=96]="NUM_ZERO",l[l.NUM_ONE=97]="NUM_ONE",l[l.NUM_TWO=98]="NUM_TWO",l[l.NUM_THREE=99]="NUM_THREE",l[l.NUM_FOUR=100]="NUM_FOUR",l[l.NUM_FIVE=101]="NUM_FIVE",l[l.NUM_SIX=102]="NUM_SIX",l[l.NUM_SEVEN=103]="NUM_SEVEN",l[l.NUM_EIGHT=104]="NUM_EIGHT",l[l.NUM_NINE=105]="NUM_NINE",l[l.NUM_MULTIPLY=106]="NUM_MULTIPLY",l[l.NUM_PLUS=107]="NUM_PLUS",l[l.NUM_MINUS=109]="NUM_MINUS",l[l.NUM_PERIOD=110]="NUM_PERIOD",l[l.NUM_DIVISION=111]="NUM_DIVISION",l[l.F1=112]="F1",l[l.F2=113]="F2",l[l.F3=114]="F3",l[l.F4=115]="F4",l[l.F5=116]="F5",l[l.F6=117]="F6",l[l.F7=118]="F7",l[l.F8=119]="F8",l[l.F9=120]="F9",l[l.F10=121]="F10",l[l.F11=122]="F11",l[l.F12=123]="F12",l[l.NUMLOCK=144]="NUMLOCK",l[l.SCROLL_LOCK=145]="SCROLL_LOCK",l[l.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",l[l.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",l[l.SEMICOLON=186]="SEMICOLON",l[l.DASH=189]="DASH",l[l.EQUALS=187]="EQUALS",l[l.COMMA=188]="COMMA",l[l.PERIOD=190]="PERIOD",l[l.SLASH=191]="SLASH",l[l.APOSTROPHE=192]="APOSTROPHE",l[l.TILDE=192]="TILDE",l[l.SINGLE_QUOTE=222]="SINGLE_QUOTE",l[l.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",l[l.BACKSLASH=220]="BACKSLASH",l[l.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",l[l.WIN_KEY=224]="WIN_KEY",l[l.MAC_FF_META=224]="MAC_FF_META",l[l.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",l[l.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",l[l.WIN_IME=229]="WIN_IME",l[l.VK_NONAME=252]="VK_NONAME",l[l.PHANTOM=255]="PHANTOM"})(Vi||(Vi={}));var Yd={};Yd.arc=Mr,Yd.curve=Cc,Yd.line=ju,Yd.lineOnAxis=Vn,Yd.lineTo=Bh,Yd.moveBy=Bo,Yd.moveTo=pl,Yd.point=ci;var lr={};lr.Coordinate=_n,lr.KeyCodes=Vi,lr.Rect=lo,lr.Size=ko,lr.Svg=pt,lr.aria=dT,lr.array=tL,lr.browserEvents=Ju,lr.colour=ed,lr.deprecation=Jk,lr.dom=zr,lr.extensions=td,lr.idGenerator=jI,lr.math=gL,lr.object=pB,lr.parsing=WE,lr.string=Hp,lr.style=Qu,lr.svgMath=H_,lr.svgPaths=Yd,lr.toolbox=na,lr.userAgent=eL,lr.xml=xp;var wL={};wL.register=ru,wL.unregister=O2;var ET=class extends js{constructor(l,h,m,E){super(h,m,E),this.text=l,this.workspace=h,this.anchor=m,this.ownerRect=E,this.paragraph=this.stringToSvg(l,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(l){this.text=l,Ot(this.paragraph),this.paragraph=this.stringToSvg(l,this.contentContainer),this.updateBubbleSize()}stringToSvg(l,h){return h=this.createParagraph(h),l=this.createSpans(h,l),this.workspace.RTL&&this.rightAlignSpans(h.getBBox().width,l),h}createParagraph(l){return He(pt.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:js.BORDER_WIDTH},l)}createSpans(l,h){return h.split(`
- `).map(m=>{const E=He(pt.TSPAN,{dy:"1em",x:js.BORDER_WIDTH},l);return m=document.createTextNode(m),E.appendChild(m),E})}rightAlignSpans(l,h){for(const m of h)m.setAttribute("text-anchor","end"),m.setAttribute("x",`${l+js.BORDER_WIDTH}`)}updateBubbleSize(){const l=this.paragraph.getBBox();this.setSize(new ko(l.width+2*js.BORDER_WIDTH,l.height+2*js.BORDER_WIDTH),!0)}},Mc=class extends js{constructor(l,h,m){super(l,h,m),this.workspace=l,this.anchor=h,this.ownerRect=m,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new ko(160+js.DOUBLE_BORDER,80+js.DOUBLE_BORDER),this.MIN_SIZE=new ko(45+js.DOUBLE_BORDER,20+js.DOUBLE_BORDER),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(l){this.text=l,this.textArea.value=l,this.onTextChange()}addTextChangeListener(l){this.textChangeListeners.push(l)}addSizeChangeListener(l){this.sizeChangeListeners.push(l)}createEditor(l){l=He(pt.FOREIGNOBJECT,{x:js.BORDER_WIDTH,y:js.BORDER_WIDTH},l);const h=document.createElementNS(Kd,"body");h.setAttribute("xmlns",Kd),h.className="blocklyMinimalBody";const m=document.createElementNS(Kd,"textarea");return m.className="blocklyCommentTextarea",m.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),h.appendChild(m),l.appendChild(h),this.bindTextAreaEvents(m),setTimeout(()=>{m.focus()},0),{inputRoot:l,textArea:m}}bindTextAreaEvents(l){ee(l,"wheel",this,h=>{h.stopPropagation()}),ee(l,"focus",this,this.onStartEdit,!0),ee(l,"change",this,this.onTextChange)}createResizeHandle(l){l=He(pt.G,{class:this.workspace.RTL?"blocklyResizeSW":"blocklyResizeSE"},l);const h=2*js.BORDER_WIDTH;return He(pt.POLYGON,{points:`0,${h} ${h},${h} ${h},0`},l),He(pt.LINE,{class:"blocklyResizeLine",x1:h/3,y1:h-1,x2:h-1,y2:h/3},l),He(pt.LINE,{class:"blocklyResizeLine",x1:2*h/3,y1:h-1,x2:h-1,y2:2*h/3},l),ee(l,"pointerdown",this,this.onResizePointerDown),l}setSize(l,h=!1){l.width=Math.max(l.width,this.MIN_SIZE.width),l.height=Math.max(l.height,this.MIN_SIZE.height);const m=l.width-js.DOUBLE_BORDER,E=l.height-js.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${m}`),this.inputRoot.setAttribute("height",`${E}`),this.textArea.style.width=`${m-4}px`,this.textArea.style.height=`${E-4}px`,this.workspace.RTL?this.resizeGroup.setAttribute("transform",`translate(${js.DOUBLE_BORDER}, ${E}) scale(-1 1)`):this.resizeGroup.setAttribute("transform",`translate(${m}, ${E})`),super.setSize(l,h),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(l){this.bringToFront(),at(l)||(this.workspace.startDrag(l,new _n(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=ee(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=ee(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),l.stopPropagation()}onResizePointerUp(l){Ve(),this.resizePointerUpListener&&(Me(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(Me(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(l){l=this.workspace.moveDrag(l),this.setSize(new ko(this.workspace.RTL?-l.x:l.x,l.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const l of this.textChangeListeners)l()}onSizeChange(){for(const l of this.sizeChangeListeners)l()}};Xe(`
- .blocklyCommentTextarea {
- background-color: #fef49c;
- border: 0;
- display: block;
- margin: 0;
- outline: 0;
- padding: 3px;
- resize: none;
- text-overflow: hidden;
- }
- `);var Vp=17,_B=160,vB=80,qa=class extends yL{constructor(l){super(l),this.sourceBlock=l,this.textBubble=this.textInputBubble=null,this.text="",this.bubbleSize=new ko(_B,vB),this.bubbleVisiblity=!1}getType(){return qa.TYPE}initView(l){this.svgRoot||(super.initView(l),He(pt.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),He(pt.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),He(pt.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),ke(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let l;(l=this.textInputBubble)==null||l.dispose();let h;(h=this.textBubble)==null||h.dispose()}getWeight(){return qa.WEIGHT}getSize(){return new ko(Vp,Vp)}applyColour(){super.applyColour();const l=this.sourceBlock.style.colourPrimary;let h;(h=this.textInputBubble)==null||h.setColour(l);let m;(m=this.textBubble)==null||m.setColour(l)}updateEditable(){super.updateEditable(),this.bubbleIsVisible()&&(this.setBubbleVisible(!1),this.setBubbleVisible(!0))}onLocationChange(l){super.onLocationChange(l),l=this.getAnchorLocation();let h;(h=this.textInputBubble)==null||h.setAnchorLocation(l);let m;(m=this.textBubble)==null||m.setAnchorLocation(l)}setText(l){const h=this.text;q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,h,l)),this.text=l;let m;(m=this.textInputBubble)==null||m.setText(this.text);let E;(E=this.textBubble)==null||E.setText(this.text)}getText(){return this.text}setBubbleSize(l){this.bubbleSize=l;let h;(h=this.textInputBubble)==null||h.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(l){let h;this.text=(h=l.text)!=null?h:"";let m,E;this.bubbleSize=new ko((m=l.width)!=null?m:_B,(E=l.height)!=null?E:vB);let k;this.bubbleVisiblity=(k=l.pinned)!=null?k:!1,setTimeout(()=>this.setBubbleVisible(this.bubbleVisiblity),1)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var l=this.textInputBubble.getText();this.text!==l&&(q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,this.text,l)),this.text=l)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(l){(!l||!this.textBubble&&!this.textInputBubble)&&(l||this.textBubble||this.textInputBubble)&&(this.bubbleVisiblity=l,this.sourceBlock.rendered&&!this.sourceBlock.isInFlyout&&(l?(this.sourceBlock.isEditable()?this.showEditableBubble():this.showNonEditableBubble(),this.applyColour()):this.hideBubble(),q(new(Ne(Gd))(this.sourceBlock,l,"comment"))))}showEditableBubble(){this.textInputBubble=new Mc(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0),this.textInputBubble.addTextChangeListener(()=>this.onTextChange()),this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new ET(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let l;(l=this.textInputBubble)==null||l.dispose(),this.textInputBubble=null;let h;(h=this.textBubble)==null||h.dispose(),this.textBubble=null}getAnchorLocation(){const l=Vp/2;return _n.sum(this.workspaceLocation,new _n(l,l))}getBubbleOwnerRect(){const l=this.sourceBlock.getSvgRoot().getBBox();return new lo(l.y,l.y+l.height,l.x,l.x+l.width)}};qa.TYPE=wc.COMMENT,qa.WEIGHT=3,ru(qa.TYPE,qa);var NA=17,qd=class extends yL{constructor(l){super(l),this.sourceBlock=l,this.textMap=new Map,this.textBubble=null}getType(){return qd.TYPE}initView(l){this.svgRoot||(super.initView(l),He(pt.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),He(pt.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),He(pt.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),ke(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let l;(l=this.textBubble)==null||l.dispose()}getWeight(){return qd.WEIGHT}getSize(){return new ko(NA,NA)}applyColour(){super.applyColour();let l;(l=this.textBubble)==null||l.setColour(this.sourceBlock.style.colourPrimary)}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(l){super.onLocationChange(l);let h;(h=this.textBubble)==null||h.setAnchorLocation(this.getAnchorLocation())}addMessage(l,h){if(this.textMap.get(h)===l)return this;l?this.textMap.set(h,l):this.textMap.delete(h);let m;return(m=this.textBubble)==null||m.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(`
- `)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(l){if(this.bubbleIsVisible()!==l){if(l)this.textBubble=new ET(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.applyColour();else{let h;(h=this.textBubble)==null||h.dispose(),this.textBubble=null}q(new(Ne(Gd))(this.sourceBlock,l,"warning"))}}getAnchorLocation(){const l=NA/2;return _n.sum(this.workspaceLocation,new _n(l,l))}getBubbleOwnerRect(){const l=this.sourceBlock.getSvgRoot().getBBox();return new lo(l.y,l.y+l.height,l.x,l.x+l.width)}};qd.TYPE=wc.WARNING,qd.WEIGHT=2;var DA=class extends Error{constructor(l){super(`Tried to append an icon of type ${l.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=l}},Zh={};Zh.DuplicateIconType=DA;var Oi={};Oi.CommentIcon=qa,Oi.Icon=yL,Oi.IconType=wc,Oi.MutatorIcon=t.MutatorIcon$$module$build$src$core$icons$mutator_icon,Oi.WarningIcon=qd,Oi.exceptions=Zh,Oi.registry=wL;var zE,Ho;zE="PROCEDURE",t.DEFAULT_ARG$$module$build$src$core$procedures="x",Ho={CATEGORY_NAME:zE,DEFAULT_ARG:t.DEFAULT_ARG$$module$build$src$core$procedures},Ho.ObservableProcedureMap=CL,Ho.allProcedures=LI,Ho.findLegalName=t.findLegalName$$module$build$src$core$procedures,Ho.flyoutCategory=cE,Ho.getCallers=uE,Ho.getDefinition=t.getDefinition$$module$build$src$core$procedures,Ho.isNameUsed=Sk,Ho.isProcedureBlock=rg,Ho.mutateCallers=t.mutateCallers$$module$build$src$core$procedures,Ho.mutatorOpenListener=wk,Ho.rename=t.rename$$module$build$src$core$procedures;var bB=class{constructor(){this.NONE=0,this.FIELD=1,this.HAT=2,this.ICON=4,this.SPACER=8,this.BETWEEN_ROW_SPACER=16,this.IN_ROW_SPACER=32,this.EXTERNAL_VALUE_INPUT=64,this.INPUT=128,this.INLINE_INPUT=256,this.STATEMENT_INPUT=512,this.CONNECTION=1024,this.PREVIOUS_CONNECTION=2048,this.NEXT_CONNECTION=4096,this.OUTPUT_CONNECTION=8192,this.CORNER=16384,this.LEFT_SQUARE_CORNER=32768,this.LEFT_ROUND_CORNER=65536,this.RIGHT_SQUARE_CORNER=131072,this.RIGHT_ROUND_CORNER=262144,this.JAGGED_EDGE=524288,this.ROW=1048576,this.TOP_ROW=2097152,this.BOTTOM_ROW=4194304,this.INPUT_ROW=8388608,this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER,this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER,this.nextTypeValue_=16777216}getType(l){return Object.prototype.hasOwnProperty.call(this,l)||(this[l]=this.nextTypeValue_,this.nextTypeValue_<<=1),this[l]}isField(l){return l.type&this.FIELD}isHat(l){return l.type&this.HAT}isIcon(l){return l.type&this.ICON}isSpacer(l){return l.type&this.SPACER}isInRowSpacer(l){return l.type&this.IN_ROW_SPACER}isInput(l){return l.type&this.INPUT}isExternalInput(l){return l.type&this.EXTERNAL_VALUE_INPUT}isInlineInput(l){return l.type&this.INLINE_INPUT}isStatementInput(l){return l.type&this.STATEMENT_INPUT}isPreviousConnection(l){return l.type&this.PREVIOUS_CONNECTION}isNextConnection(l){return l.type&this.NEXT_CONNECTION}isPreviousOrNextConnection(l){return l.type&(this.PREVIOUS_CONNECTION|this.NEXT_CONNECTION)}isLeftRoundedCorner(l){return l.type&this.LEFT_ROUND_CORNER}isRightRoundedCorner(l){return l.type&this.RIGHT_ROUND_CORNER}isLeftSquareCorner(l){return l.type&this.LEFT_SQUARE_CORNER}isRightSquareCorner(l){return l.type&this.RIGHT_SQUARE_CORNER}isCorner(l){return l.type&this.CORNER}isJaggedEdge(l){return l.type&this.JAGGED_EDGE}isRow(l){return l.type&this.ROW}isBetweenRowSpacer(l){return l.type&this.BETWEEN_ROW_SPACER}isTopRow(l){return l.type&this.TOP_ROW}isBottomRow(l){return l.type&this.BOTTOM_ROW}isTopOrBottomRow(l){return l.type&(this.TOP_ROW|this.BOTTOM_ROW)}isInputRow(l){return l.type&this.INPUT_ROW}},ft=new bB,as=class{constructor(l){this.centerline=this.xPos=this.height=this.width=0,this.constants_=l,this.type=ft.NONE,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},KE=class{constructor(l){this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasStatement=this.hasExternalInput=!1,this.statementEdge=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1,this.align=null,this.constants_=l,this.type=ft.ROW,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let l=this.elements.length-1;0<=l;l--){const h=this.elements[l];if(ft.isInput(h))return h}return null}measure(){throw Error("Unexpected attempt to measure a base Row.")}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let l=0;l<this.elements.length;l++){const h=this.elements[l];if(ft.isSpacer(h))return h}return null}getLastSpacer(){for(let l=this.elements.length-1;0<=l;l--){const h=this.elements[l];if(ft.isSpacer(h))return h}return null}},IL=class extends KE{constructor(l){super(l),this.hasNextConnection=!1,this.connection=null,this.baseline=this.descenderHeight=0,this.type|=ft.BOTTOM_ROW}hasLeftSquareCorner(l){return!!l.outputConnection||!!l.getNextBlock()}hasRightSquareCorner(l){return!0}measure(){let l=0,h=0,m=0;for(let E=0;E<this.elements.length;E++){const k=this.elements[E];h+=k.width,ft.isSpacer(k)||(ft.isNextConnection(k)?m=Math.max(m,k.height):l=Math.max(l,k.height))}this.width=Math.max(this.minWidth,h),this.height=Math.max(this.minHeight,l)+m,this.descenderHeight=m,this.widthWithConnectedBlocks=this.width}startsWithElemSpacer(){return!1}endsWithElemSpacer(){return!1}},nd=class extends as{constructor(l,h){super(l),this.connectionModel=h,this.type|=ft.CONNECTION,this.shape=this.constants_.shapeFor(h),this.isDynamicShape="isDynamic"in this.shape&&this.shape.isDynamic,this.highlighted=h.isHighlighted()}},Up=class extends nd{constructor(l,h){super(l,h.connection),this.input=h,this.connectionOffsetY=this.connectionOffsetX=0,this.type|=ft.INPUT,this.align=h.align,(this.connectedBlock=h.connection&&h.connection.targetBlock()?h.connection.targetBlock():null)?(l=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=l.width,this.connectedBlockHeight=l.height):this.connectedBlockHeight=this.connectedBlockWidth=0}},LL=class extends Up{constructor(l,h){super(l,h),this.height=0,this.type|=ft.EXTERNAL_VALUE_INPUT,this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height,this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING,this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP,this.connectionHeight=this.shape.height,this.connectionWidth=this.shape.width}},ST=class extends as{constructor(l,h,m){super(l),this.field=h,this.parentInput=m,this.isEditable=h.EDITABLE,this.flipRtl=h.getFlipRtl(),this.type|=ft.FIELD,l=this.field.getSize(),this.height=l.height,this.width=l.width}},$A=class extends as{constructor(l){super(l),this.type|=ft.HAT,this.height=this.constants_.START_HAT.height,this.width=this.constants_.START_HAT.width,this.ascenderHeight=this.height}},TB=class extends as{constructor(l,h){super(l),this.icon=h,this.flipRtl=!1,this.isVisible=Lp(h)&&h.bubbleIsVisible(),this.type|=ft.ICON,l=h.getSize(),this.height=l.height,this.width=l.width}},hu=class extends as{constructor(l,h){super(l),this.type=this.type|ft.SPACER|ft.IN_ROW_SPACER,this.width=h,this.height=this.constants_.SPACER_DEFAULT_HEIGHT}},xA=class extends Up{constructor(l,h){super(l,h),this.type|=ft.INLINE_INPUT,this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING),this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):this.shape.height,this.connectionWidth=this.isDynamicShape?this.shape.width(this.height):this.shape.width,this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1)),this.connectionOffsetY="connectionOffsetY"in this.shape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP,this.connectionOffsetX="connectionOffsetX"in this.shape?this.shape.connectionOffsetX(this.connectionWidth):0}},jE=class extends Up{constructor(l,h){super(l,h),this.type|=ft.STATEMENT_INPUT,this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT,this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width}},PA=class extends KE{constructor(l){super(l),this.connectedBlockWidths=0,this.type|=ft.INPUT_ROW}measure(){this.width=this.minWidth,this.height=this.minHeight;let l=0;for(let h=0;h<this.elements.length;h++){const m=this.elements[h];this.width+=m.width,ft.isInput(m)&&m instanceof Up&&(ft.isStatementInput(m)&&m instanceof jE?l+=m.connectedBlockWidth:ft.isExternalInput(m)&&m instanceof LL&&m.connectedBlockWidth!==0&&(l+=m.connectedBlockWidth-m.connectionWidth)),ft.isSpacer(m)||(this.height=Math.max(this.height,m.height))}this.connectedBlockWidths=l,this.widthWithConnectedBlocks=this.width+l}endsWithElemSpacer(){return!this.hasExternalInput&&!this.hasStatement}},CB=class extends as{constructor(l){super(l),this.type|=ft.JAGGED_EDGE,this.height=this.constants_.JAGGED_TEETH.height,this.width=this.constants_.JAGGED_TEETH.width}},yB=class extends nd{constructor(l,h){super(l,h),this.type|=ft.NEXT_CONNECTION,this.height=this.shape.height,this.width=this.shape.width}},EB=class extends nd{constructor(l,h){super(l,h),this.connectionOffsetX=0,this.type|=ft.OUTPUT_CONNECTION,this.height=this.isDynamicShape?0:this.shape.height,this.startX=this.width=this.isDynamicShape?0:this.shape.width,this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP}},SB=class extends nd{constructor(l,h){super(l,h),this.type|=ft.PREVIOUS_CONNECTION,this.height=this.shape.height,this.width=this.shape.width}},Q_=class extends as{constructor(l,h){super(l),this.type=(h&&h!=="left"?ft.RIGHT_ROUND_CORNER:ft.LEFT_ROUND_CORNER)|ft.CORNER,this.width=this.constants_.CORNER_RADIUS,this.height=this.constants_.CORNER_RADIUS/2}},FA=class extends KE{constructor(l,h,m){super(l),this.height=h,this.width=m,this.precedesStatement=this.followsStatement=!1,this.widthWithConnectedBlocks=0,this.type=this.type|ft.SPACER|ft.BETWEEN_ROW_SPACER,this.elements=[new hu(this.constants_,m)]}measure(){}},Z_=class extends as{constructor(l,h){super(l),this.type=(h&&h!=="left"?ft.RIGHT_SQUARE_CORNER:ft.LEFT_SQUARE_CORNER)|ft.CORNER,this.width=this.height=this.constants_.NO_PADDING}},BA=class extends KE{constructor(l){super(l),this.ascenderHeight=this.capline=0,this.hasPreviousConnection=!1,this.connection=null,this.type|=ft.TOP_ROW}hasLeftSquareCorner(l){const h=(l.hat?l.hat==="cap":this.constants_.ADD_START_HATS)&&!l.outputConnection&&!l.previousConnection,m=l.getPreviousBlock();return!!l.outputConnection||h||(m?m.getNextBlock()===l:!1)}hasRightSquareCorner(l){return!0}measure(){let l=0,h=0,m=0;for(let E=0;E<this.elements.length;E++){const k=this.elements[E];h+=k.width,ft.isSpacer(k)||(ft.isHat(k)&&k instanceof $A?m=Math.max(m,k.ascenderHeight):l=Math.max(l,k.height))}this.width=Math.max(this.minWidth,h),this.height=Math.max(this.minHeight,l)+m,this.capline=this.ascenderHeight=m,this.widthWithConnectedBlocks=this.width}startsWithElemSpacer(){return!1}endsWithElemSpacer(){return!1}},XE=class{constructor(){this.NO_PADDING=0,this.SMALL_PADDING=3,this.MEDIUM_PADDING=5,this.MEDIUM_LARGE_PADDING=8,this.LARGE_PADDING=10,this.TAB_HEIGHT=15,this.TAB_OFFSET_FROM_TOP=5,this.TAB_VERTICAL_OVERLAP=2.5,this.TAB_WIDTH=8,this.NOTCH_WIDTH=15,this.NOTCH_HEIGHT=4,this.MIN_BLOCK_WIDTH=12,this.EMPTY_BLOCK_SPACER_HEIGHT=16,this.CORNER_RADIUS=8,this.NOTCH_OFFSET_LEFT=15,this.STATEMENT_BOTTOM_SPACER=0,this.STATEMENT_INPUT_PADDING_LEFT=20,this.BETWEEN_STATEMENT_PADDING_Y=4,this.ADD_START_HATS=!1,this.START_HAT_HEIGHT=15,this.START_HAT_WIDTH=100,this.SPACER_DEFAULT_HEIGHT=15,this.MIN_BLOCK_HEIGHT=24,this.EMPTY_INLINE_INPUT_PADDING=14.5,this.EXTERNAL_VALUE_INPUT_PADDING=2,this.JAGGED_TEETH_HEIGHT=12,this.JAGGED_TEETH_WIDTH=6,this.FIELD_TEXT_FONTSIZE=11,this.FIELD_TEXT_FONTWEIGHT="normal",this.FIELD_TEXT_FONTFAMILY="sans-serif",this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT=-1,this.FIELD_BORDER_RECT_RADIUS=4,this.FIELD_BORDER_RECT_HEIGHT=16,this.FIELD_BORDER_RECT_X_PADDING=5,this.FIELD_BORDER_RECT_Y_PADDING=3,this.FIELD_BORDER_RECT_COLOUR="#fff",this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1,this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12,this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1,this.FIELD_COLOUR_DEFAULT_WIDTH=26,this.defs=null,this.embossFilterId="",this.embossFilter=null,this.disabledPatternId="",this.disabledPattern=null,this.debugFilterId="",this.cssNode=this.debugFilter=null,this.CURSOR_COLOUR="#cc0a0a",this.MARKER_COLOUR="#4286f4",this.CURSOR_WS_WIDTH=100,this.WS_CURSOR_HEIGHT=5,this.CURSOR_STACK_PADDING=10,this.CURSOR_BLOCK_PADDING=2,this.CURSOR_STROKE_WIDTH=4,this.FULL_BLOCK_FIELDS=!1,this.INSERTION_MARKER_COLOUR="#000000",this.INSERTION_MARKER_OPACITY=.2,this.SHAPES={PUZZLE:1,NOTCH:2},this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT=this.TAB_HEIGHT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT,this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11,this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT,this.START_POINT=Bo(0,0),this.FIELD_TEXT_BASELINE_CENTER=!0,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",this.FIELD_COLOUR_DEFAULT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_CHECKBOX_X_OFFSET=this.FIELD_BORDER_RECT_X_PADDING-3,this.randomIdentifier=String(Math.random()).substring(2)}init(){this.JAGGED_TEETH=this.makeJaggedTeeth(),this.NOTCH=this.makeNotch(),this.START_HAT=this.makeStartHat(),this.PUZZLE_TAB=this.makePuzzleTab(),this.INSIDE_CORNERS=this.makeInsideCorners(),this.OUTSIDE_CORNERS=this.makeOutsideCorners()}setTheme(l){this.blockStyles=Object.create(null);const h=l.blockStyles;for(const m in h)this.blockStyles[m]=this.validatedBlockStyle_(h[m]);this.setDynamicProperties_(l)}setDynamicProperties_(l){this.setFontConstants_(l),this.setComponentConstants_(l),this.ADD_START_HATS=l.startHats!==void 0?l.startHats:this.ADD_START_HATS}setFontConstants_(l){l.fontStyle&&l.fontStyle.family&&(this.FIELD_TEXT_FONTFAMILY=l.fontStyle.family),l.fontStyle&&l.fontStyle.weight&&(this.FIELD_TEXT_FONTWEIGHT=l.fontStyle.weight),l.fontStyle&&l.fontStyle.size&&(this.FIELD_TEXT_FONTSIZE=l.fontStyle.size),l=Et("Hg",this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY),this.FIELD_TEXT_HEIGHT=l.height,this.FIELD_TEXT_BASELINE=l.baseline}setComponentConstants_(l){this.CURSOR_COLOUR=l.getComponentStyle("cursorColour")||this.CURSOR_COLOUR,this.MARKER_COLOUR=l.getComponentStyle("markerColour")||this.MARKER_COLOUR,this.INSERTION_MARKER_COLOUR=l.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR,this.INSERTION_MARKER_OPACITY=Number(l.getComponentStyle("insertionMarkerOpacity"))||this.INSERTION_MARKER_OPACITY}getBlockStyleForColour(l){const h="auto_"+l;return this.blockStyles[h]||(this.blockStyles[h]=this.createBlockStyle_(l)),{style:this.blockStyles[h],name:h}}getBlockStyle(l){return this.blockStyles[l||""]||(l&&l.indexOf("auto_")===0?this.getBlockStyleForColour(l.substring(5)).style:this.createBlockStyle_("#000000"))}createBlockStyle_(l){return this.validatedBlockStyle_({colourPrimary:l})}validatedBlockStyle_(l){const h={};return l&&Object.assign(h,l),l=Ph(h.colourPrimary||"#000"),h.colourPrimary=l.hex,h.colourSecondary=h.colourSecondary?Ph(h.colourSecondary).hex:this.generateSecondaryColour_(h.colourPrimary),h.colourTertiary=h.colourTertiary?Ph(h.colourTertiary).hex:this.generateTertiaryColour_(h.colourPrimary),h.hat=h.hat||"",h}generateSecondaryColour_(l){return O_("#fff",l,.6)||l}generateTertiaryColour_(l){return O_("#fff",l,.3)||l}dispose(){this.embossFilter&&Ot(this.embossFilter),this.disabledPattern&&Ot(this.disabledPattern),this.debugFilter&&Ot(this.debugFilter),this.cssNode=null}makeJaggedTeeth(){const l=this.JAGGED_TEETH_HEIGHT,h=this.JAGGED_TEETH_WIDTH,m=ju([ci(h,l/4),ci(2*-h,l/2),ci(h,l/4)]);return{height:l,width:h,path:m}}makeStartHat(){const l=this.START_HAT_HEIGHT,h=this.START_HAT_WIDTH,m=Cc("c",[ci(30,-l),ci(70,-l),ci(h,0)]);return{height:l,width:h,path:m}}makePuzzleTab(){function l(z){z=z?-1:1;const Oe=-z;var Je=m/2;const Ht=Je+2.5,kn=Je+.5,Qo=ci(-h,z*Je);return Je=ci(h,z*Je),Cc("c",[ci(0,z*Ht),ci(-h,Oe*kn),Qo])+Cc("s",[ci(h,2.5*Oe),Je])}const h=this.TAB_WIDTH,m=this.TAB_HEIGHT,E=l(!0),k=l(!1);return{type:this.SHAPES.PUZZLE,width:h,height:m,pathDown:k,pathUp:E}}makeNotch(){function l(Oe){return ju([ci(Oe*E,m),ci(3*Oe,0),ci(Oe*E,-m)])}const h=this.NOTCH_WIDTH,m=this.NOTCH_HEIGHT,E=(h-3)/2,k=l(1),z=l(-1);return{type:this.SHAPES.NOTCH,width:h,height:m,pathLeft:k,pathRight:z}}makeInsideCorners(){const l=this.CORNER_RADIUS,h=Mr("a","0 0,0",l,ci(-l,l)),m=Mr("a","0 0,0",l,ci(l,l));return{width:l,height:l,pathTop:h,pathBottom:m}}makeOutsideCorners(){const l=this.CORNER_RADIUS,h=Bo(0,l)+Mr("a","0 0,1",l,ci(l,-l)),m=Mr("a","0 0,1",l,ci(l,l)),E=Mr("a","0 0,1",l,ci(-l,-l)),k=Mr("a","0 0,1",l,ci(-l,l));return{topLeft:h,topRight:m,bottomRight:k,bottomLeft:E,rightHeight:l}}shapeFor(l){switch(l.type){case Pn.INPUT_VALUE:case Pn.OUTPUT_VALUE:return this.PUZZLE_TAB;case Pn.PREVIOUS_STATEMENT:case Pn.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type")}}createDom(l,h,m){this.injectCSS_(h,m),this.defs=He(pt.DEFS,{},l),l=He(pt.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},this.defs),He(pt.FEGAUSSIANBLUR,{in:"SourceAlpha",stdDeviation:1,result:"blur"},l),h=He(pt.FESPECULARLIGHTING,{in:"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},l),He(pt.FEPOINTLIGHT,{x:-5e3,y:-1e4,z:2e4},h),He(pt.FECOMPOSITE,{in:"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},l),He(pt.FECOMPOSITE,{in:"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},l),this.embossFilterId=l.id,this.embossFilter=l,l=He(pt.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs),He(pt.RECT,{width:10,height:10,fill:"#aaa"},l),He(pt.PATH,{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},l),this.disabledPatternId=l.id,this.disabledPattern=l,this.createDebugFilter()}createDebugFilter(){if(!this.debugFilter){const l=He(pt.FILTER,{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs),h=He(pt.FECOMPONENTTRANSFER,{result:"outBlur"},l);He(pt.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},h),He(pt.FEFLOOD,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},l),He(pt.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},l),this.debugFilterId=l.id,this.debugFilter=l}}injectCSS_(l,h){h=this.getCSS_(h),l="blockly-renderer-style-"+l,this.cssNode=document.getElementById(l);const m=h.join(`
- `);this.cssNode?this.cssNode.firstChild.textContent=m:(h=document.createElement("style"),h.id=l,l=document.createTextNode(m),h.appendChild(l),document.head.insertBefore(h,document.head.firstChild),this.cssNode=h)}getCSS_(l){return[`${l} .blocklyText, `,`${l} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${l} .blocklyText {`,"fill: #fff;","}",`${l} .blocklyNonEditableText>rect,`,`${l} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${l} .blocklyNonEditableText>text,`,`${l} .blocklyEditableText>text {`,"fill: #000;","}",`${l} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${l} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${l} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${l} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${l} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${l} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${l} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${l} .blocklyReplaceable .blocklyPathLight,`,`${l} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${l} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},YE=class{constructor(l,h){this.inlinePath_=this.outlinePath_="",this.block_=l,this.info_=h,this.topLeft_=l.getRelativeToSurfaceXY(),this.constants_=h.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+`
- `+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}hideHiddenIcons_(){Tt("hideHiddenIcons_","v10","v11")}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren}drawOutline_(){this.drawTop_();for(let l=1;l<this.info_.rows.length-1;l++){const h=this.info_.rows[l];h.hasJaggedEdge?this.drawJaggedEdge_(h):h.hasStatement?this.drawStatementInput_(h):h.hasExternalInput?this.drawValueInput_(h):this.drawRightSideRow_(h)}this.drawBottom_(),this.drawLeft_()}drawTop_(){const l=this.info_.topRow,h=l.elements;this.positionPreviousConnection_(),this.outlinePath_+=Bo(l.xPos,this.info_.startY);for(let m=0,E;E=h[m];m++)ft.isLeftRoundedCorner(E)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topLeft:ft.isRightRoundedCorner(E)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topRight:ft.isPreviousConnection(E)&&E instanceof nd?this.outlinePath_+=E.shape.pathLeft:ft.isHat(E)?this.outlinePath_+=this.constants_.START_HAT.path:ft.isSpacer(E)&&(this.outlinePath_+=Vn("h",E.width));this.outlinePath_+=Vn("v",l.height)}drawJaggedEdge_(l){this.outlinePath_+=this.constants_.JAGGED_TEETH.path+Vn("v",l.height-this.constants_.JAGGED_TEETH.height)}drawValueInput_(l){const h=l.getLastInput();this.positionExternalValueConnection_(l);const m=R_(h.shape)?h.shape.pathDown(h.height):h.shape.pathDown;this.outlinePath_+=Vn("H",h.xPos+h.width)+m+Vn("v",l.height-h.connectionHeight)}drawStatementInput_(l){var h=l.getLastInput();if(h){var m=h.xPos+h.notchOffset+h.shape.width;h=h.shape.pathRight+Vn("h",-(h.notchOffset-this.constants_.INSIDE_CORNERS.width))+this.constants_.INSIDE_CORNERS.pathTop;var E=l.height-2*this.constants_.INSIDE_CORNERS.height;this.outlinePath_+=Vn("H",m)+h+Vn("v",E)+this.constants_.INSIDE_CORNERS.pathBottom+Vn("H",l.xPos+l.width),this.positionStatementInputConnection_(l)}}drawRightSideRow_(l){this.outlinePath_+=Vn("V",l.yPos+l.height)}drawBottom_(){const l=this.info_.bottomRow,h=l.elements;this.positionNextConnection_();let m=0,E="";for(let k=h.length-1,z;z=h[k];k--)ft.isNextConnection(z)&&z instanceof nd?E+=z.shape.pathRight:ft.isLeftSquareCorner(z)?E+=Vn("H",l.xPos):ft.isLeftRoundedCorner(z)?E+=this.constants_.OUTSIDE_CORNERS.bottomLeft:ft.isRightRoundedCorner(z)?(E+=this.constants_.OUTSIDE_CORNERS.bottomRight,m=this.constants_.OUTSIDE_CORNERS.rightHeight):ft.isSpacer(z)&&(E+=Vn("h",-1*z.width));this.outlinePath_+=Vn("V",l.baseline-m),this.outlinePath_+=E}drawLeft_(){var l=this.info_.outputConnection;if(this.positionOutputConnection_(),l){const h=l.connectionOffsetY+l.height;l=R_(l.shape)?l.shape.pathUp(l.height):l.shape.pathUp,this.outlinePath_+=Vn("V",h)+l}this.outlinePath_+="z"}drawInternals_(){for(let l=0,h;h=this.info_.rows[l];l++)for(let m=0,E;E=h.elements[m];m++)ft.isInlineInput(E)?this.drawInlineInput_(E):(ft.isIcon(E)||ft.isField(E))&&this.layoutField_(E)}layoutField_(l){const h=l.centerline-l.height/2;let m=l.xPos;var E="";this.info_.RTL&&(m=-(m+l.width),l.flipRtl&&(m+=l.width,E="scale(-1 1)")),ft.isIcon(l)?(E=l.icon,E.setOffsetInBlock(new _n(m,h)),this.info_.isInsertionMarker&&E.hideForInsertionMarker()):(l=l.field.getSvgRoot(),l.setAttribute("transform","translate("+m+","+h+")"+E),this.info_.isInsertionMarker&&l.setAttribute("display","none"))}drawInlineInput_(l){const h=l.width,m=l.height,E=l.connectionOffsetY,k=l.connectionHeight+E;this.inlinePath_+=pl(l.xPos+l.connectionWidth,l.centerline-m/2)+Vn("v",E)+l.shape.pathDown+Vn("v",m-k)+Vn("h",h-l.connectionWidth)+Vn("v",-m)+"z",this.positionInlineInputConnection_(l)}positionInlineInputConnection_(l){const h=l.centerline-l.height/2;if(l.connectionModel){let m=l.xPos+l.connectionWidth+l.connectionOffsetX;this.info_.RTL&&(m*=-1),l.connectionModel.setOffsetInBlock(m,h+l.connectionOffsetY)}}positionStatementInputConnection_(l){const h=l.getLastInput();if(h!=null&&h.connectionModel){let m=l.xPos+l.statementEdge+h.notchOffset;this.info_.RTL&&(m*=-1),h.connectionModel.setOffsetInBlock(m,l.yPos)}}positionExternalValueConnection_(l){const h=l.getLastInput();if(h&&h.connectionModel){let m=l.xPos+l.width;this.info_.RTL&&(m*=-1),h.connectionModel.setOffsetInBlock(m,l.yPos)}}positionPreviousConnection_(){const l=this.info_.topRow;if(l.connection){const h=l.xPos+l.notchOffset;l.connection.connectionModel.setOffsetInBlock(this.info_.RTL?-h:h,0)}}positionNextConnection_(){const l=this.info_.bottomRow;if(l.connection){const h=l.connection,m=h.xPos;h.connectionModel.setOffsetInBlock(this.info_.RTL?-m:m,l.baseline)}}positionOutputConnection_(){if(this.info_.outputConnection){const l=this.info_.startX+this.info_.outputConnection.connectionOffsetX;this.block_.outputConnection.setOffsetInBlock(this.info_.RTL?-l:l,this.info_.outputConnection.connectionOffsetY)}}updateConnectionHighlights(){for(const l of this.info_.rows)for(const h of l.elements)if(h instanceof nd)if(h.highlighted)this.drawConnectionHighlightPath(h);else{let m,E;(E=(m=this.block_.pathObject).removeConnectionHighlight)==null||E.call(m,h.connectionModel)}}drawConnectionHighlightPath(l){const h=l.connectionModel;l=h.type===Pn.INPUT_VALUE||h.type===Pn.OUTPUT_VALUE?this.getExpressionConnectionHighlightPath(l):this.getStatementConnectionHighlightPath(l);const m=h.getSourceBlock();let E,k;(k=(E=m.pathObject).addConnectionHighlight)==null||k.call(E,h,l,h.getOffsetInBlock(),m.RTL)}getExpressionConnectionHighlightPath(l){let h="";return R_(l.shape)?h=l.shape.pathDown(l.height):k2(l.shape)&&(h=l.shape.pathDown),l=this.constants_.TAB_OFFSET_FROM_TOP,Bo(0,-l)+Vn("v",l)+h+Vn("v",l)}getStatementConnectionHighlightPath(l){if(!Ik(l.shape))throw Error("Statement connections should have notch shapes");const h=this.constants_.NOTCH_OFFSET_LEFT-this.constants_.CORNER_RADIUS;return Bo(-h,0)+Vn("h",h)+l.shape.pathLeft+Vn("h",h)}};(function(l){l[l.LEFT=-1]="LEFT",l[l.CENTRE=0]="CENTRE",l[l.RIGHT=1]="RIGHT"})(t.Align$$module$build$src$core$inputs$align||(t.Align$$module$build$src$core$inputs$align={})),t.Align$$module$build$src$core$inputs$align;var ar=class extends fs{constructor(l,h,m){super(fs.SKIP_SETUP),this.class=null,this.EDITABLE=!1,this.maxDisplayLength=1/0,l!==fs.SKIP_SETUP&&(m?this.configure_(m):this.class=h||null,this.setValue(l))}configure_(l){super.configure_(l),l.class&&(this.class=l.class)}initView(){this.createTextElement_(),this.class&&ke(this.getTextElement(),this.class)}doClassValidation_(l){return l==null?null:`${l}`}setClass(l){this.textElement_&&(this.class&&Ct(this.textElement_,this.class),l&&ke(this.textElement_,l)),this.class=l}static fromJson(l){return new this(Tr(l.text),void 0,l)}};Rl("field_label",ar),ar.prototype.DEFAULT_VALUE="";var Nr=class{constructor(l,h){this.name=l,this.sourceBlock=h,this.fieldRow=[],this.align=t.Align$$module$build$src$core$inputs$input.LEFT,this.visible=!0,this.type=t.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM,this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(l,h){return this.insertFieldAt(this.fieldRow.length,l,h),this}insertFieldAt(l,h,m){if(0>l||l>this.fieldRow.length)throw Error("index "+l+" out of bounds.");return(h||h===""&&m)&&(typeof h=="string"&&(h=t.fromJson$$module$build$src$core$field_registry({type:"field_label",text:h})),h.setSourceBlock(this.sourceBlock),this.sourceBlock.rendered&&(h.init(),h.applyColour()),h.name=m,h.setVisible(this.isVisible()),h.prefixField&&(l=this.insertFieldAt(l,h.prefixField)),this.fieldRow.splice(l,0,h),l++,h.suffixField&&(l=this.insertFieldAt(l,h.suffixField)),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours())),l}removeField(l,h){for(let m=0,E;E=this.fieldRow[m];m++)if(E.name===l)return E.dispose(),this.fieldRow.splice(m,1),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours()),!0;if(h)return!1;throw Error('Field "'+l+'" not found.')}isVisible(){return this.visible}setVisible(l){let h=[];if(this.visible===l)return h;this.visible=l;for(let E=0,k;k=this.fieldRow[E];E++)k.setVisible(l);if(this.connection){var m=this.connection;l?h=m.startTrackingAll():m.stopTrackingAll(),(m=m.targetBlock())&&(m.getSvgRoot().style.display=l?"block":"none")}return h}markDirty(){for(let l=0,h;h=this.fieldRow[l];l++)h.markDirty()}setCheck(l){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(l),this}setAlign(l){return this.align=l,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(l){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(l),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){if(this.sourceBlock.workspace.rendered)for(let l=0;l<this.fieldRow.length;l++)this.fieldRow[l].init()}dispose(){for(let l=0,h;h=this.fieldRow[l];l++)h.dispose();this.connection&&this.connection.dispose()}makeConnection(l){return this.sourceBlock.makeConnection_(l)}},wB;(function(l){l=l.Align||(l.Align={}),l[l.LEFT=-1]="LEFT",l[l.CENTRE=0]="CENTRE",l[l.RIGHT=1]="RIGHT"})(Nr),t.Align$$module$build$src$core$inputs$input=Nr.Align,wB={Align:t.Align$$module$build$src$core$inputs$input},wB.Input=Nr;var ef=class extends Nr{constructor(l,h){super(l,h),this.name=l,this.type=t.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},_g=class extends Nr{constructor(l,h){super(l,h),this.name=l,this.type=t.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},kc=class extends Nr{constructor(l,h){if(!l)throw Error("Statement inputs must have a non-empty name");super(l,h),this.name=l,this.type=t.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(Pn.NEXT_STATEMENT)}},IB;t.ValueInput$$module$build$src$core$inputs$value_input=class extends Nr{constructor(l,h){if(!l)throw Error("Value inputs must have a non-empty name");super(l,h),this.name=l,this.type=t.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(Pn.INPUT_VALUE)}},IB={},IB.ValueInput=t.ValueInput$$module$build$src$core$inputs$value_input;var wT=class{constructor(l,h){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=l,this.block_=h,this.constants_=this.renderer_.getConstants(),this.outputConnection=h.outputConnection?new EB(this.constants_,h.outputConnection):null,this.isInline=h.getInputsInline()&&!h.isCollapsed(),this.isCollapsed=h.isCollapsed(),this.isInsertionMarker=h.isInsertionMarker(),this.RTL=h.RTL,this.topRow=new BA(this.constants_),this.bottomRow=new IL(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let l=new PA(this.constants_);this.inputRows.push(l);var h=this.block_.getIcons();for(let m=0,E;E=h[m];m++){const k=new TB(this.constants_,E);this.isCollapsed&&!E.isShownWhenCollapsed()||l.elements.push(k)}h=void 0;for(let m=0,E;E=this.block_.inputList[m];m++)if(E.isVisible()){this.shouldStartNewRow_(E,h)&&(this.rows.push(l),l=new PA(this.constants_),this.inputRows.push(l));for(let k=0,z;z=E.fieldRow[k];k++)l.elements.push(new ST(this.constants_,z,E));this.addInput_(E,l),h=E}this.isCollapsed&&(l.hasJaggedEdge=!0,l.elements.push(new CB(this.constants_))),(l.elements.length||l.hasDummyInput)&&this.rows.push(l),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var l=!!this.block_.previousConnection;const h=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!l;let m=this.topRow.hasLeftSquareCorner(this.block_)?Z_:Q_;this.topRow.elements.push(new m(this.constants_)),h?(l=new $A(this.constants_),this.topRow.elements.push(l),this.topRow.capline=l.ascenderHeight):l&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new SB(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof kc&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,m=this.topRow.hasRightSquareCorner(this.block_)?Z_:Q_,this.topRow.elements.push(new m(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof kc?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new Z_(this.constants_)):this.bottomRow.elements.push(new Q_(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new yB(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new Z_(this.constants_,"right")):this.bottomRow.elements.push(new Q_(this.constants_,"right"))}addInput_(l,h){this.isInline&&l instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(h.elements.push(new xA(this.constants_,l)),h.hasInlineInput=!0):l instanceof kc?(h.elements.push(new jE(this.constants_,l)),h.hasStatement=!0):l instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(h.elements.push(new LL(this.constants_,l)),h.hasExternalInput=!0):(l instanceof ef||l instanceof _g)&&(h.minHeight=Math.max(h.minHeight,l.getSourceBlock()&&l.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),h.hasDummyInput=!0),h.align===null&&(h.align=l.align)}shouldStartNewRow_(l,h){return h?h instanceof _g||l instanceof kc||h instanceof kc?!0:l instanceof t.ValueInput$$module$build$src$core$inputs$value_input||l instanceof ef||h instanceof t.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let l=0,h;h=this.rows[l];l++){const m=h.elements;if(h.elements=[],h.startsWithElemSpacer()&&h.elements.push(new hu(this.constants_,this.getInRowSpacing_(null,m[0]))),m.length){for(let E=0;E<m.length-1;E++){h.elements.push(m[E]);const k=this.getInRowSpacing_(m[E],m[E+1]);h.elements.push(new hu(this.constants_,k))}h.elements.push(m[m.length-1]),h.endsWithElemSpacer()&&h.elements.push(new hu(this.constants_,this.getInRowSpacing_(m[m.length-1],null)))}}}getInRowSpacing_(l,h){if(!l&&h&&ft.isStatementInput(h))return this.constants_.STATEMENT_INPUT_PADDING_LEFT;if(l&&ft.isInput(l)&&!h){if(ft.isExternalInput(l))return this.constants_.NO_PADDING;if(ft.isInlineInput(l))return this.constants_.LARGE_PADDING;if(ft.isStatementInput(l))return this.constants_.NO_PADDING}return l&&ft.isLeftSquareCorner(l)&&h&&(ft.isPreviousConnection(h)||ft.isNextConnection(h))?h.notchOffset:l&&ft.isLeftRoundedCorner(l)&&h&&(ft.isPreviousConnection(h)||ft.isNextConnection(h))?h.notchOffset-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING}computeBounds_(){let l=0,h=0,m=0;for(let k=0,z;z=this.rows[k];k++){if(z.measure(),h=Math.max(h,z.width),z.hasStatement){var E=z.getLastInput();let Oe,Je;E=z.width-((Je=(Oe=E)==null?void 0:Oe.width)!=null?Je:0),l=Math.max(l,E)}m=Math.max(m,z.widthWithConnectedBlocks)}this.statementEdge=l,this.width=h;for(let k=0,z;z=this.rows[k];k++)z.hasStatement&&(z.statementEdge=this.statementEdge);this.widthWithChildren=Math.max(h,m),this.outputConnection&&(this.startX=this.outputConnection.width,this.width+=this.outputConnection.width,this.widthWithChildren+=this.outputConnection.width)}alignRowElements_(){for(let h=0,m;m=this.rows[h];h++)if(m.hasStatement)this.alignStatementRow_(m);else{var l=m.width;l=this.getDesiredRowWidth_(m)-l,0<l&&this.addAlignmentPadding_(m,l),ft.isTopOrBottomRow(m)&&(m.widthWithConnectedBlocks=m.width)}}getDesiredRowWidth_(l){return this.width-this.startX}addAlignmentPadding_(l,h){const m=l.getFirstSpacer(),E=l.getLastSpacer();if((l.hasExternalInput||l.hasStatement)&&(l.widthWithConnectedBlocks+=h),l.align===t.Align$$module$build$src$core$inputs$align.LEFT&&E)E.width+=h;else if(l.align===t.Align$$module$build$src$core$inputs$align.CENTRE&&m&&E)m.width+=h/2,E.width+=h/2;else if(l.align===t.Align$$module$build$src$core$inputs$align.RIGHT&&m)m.width+=h;else if(E)E.width+=h;else return;l.width+=h}alignStatementRow_(l){const h=l.getLastInput();if(h){var m=l.width-h.width,E=this.statementEdge;m=E-m,0<m&&this.addAlignmentPadding_(l,m),m=l.width,E=this.getDesiredRowWidth_(l),h.width+=E-m,h.height=Math.max(h.height,l.height),l.width+=E-m,l.widthWithConnectedBlocks=Math.max(l.width,this.statementEdge+l.connectedBlockWidths)}}addRowSpacing_(){const l=this.rows;this.rows=[];for(let h=0;h<l.length;h++)this.rows.push(l[h]),h!==l.length-1&&this.rows.push(this.makeSpacerRow_(l[h],l[h+1]))}makeSpacerRow_(l,h){var m=this.getSpacerRowHeight_(l,h);const E=this.getSpacerRowWidth_(l,h);return m=new FA(this.constants_,m,E),l.hasStatement&&(m.followsStatement=!0),h.hasStatement&&(m.precedesStatement=!0),m}getSpacerRowWidth_(l,h){return this.width-this.startX}getSpacerRowHeight_(l,h){return this.constants_.MEDIUM_PADDING}getElemCenterline_(l,h){return ft.isSpacer(h)?l.yPos+h.height/2:ft.isBottomRow(l)?(l=l.yPos+l.height-l.descenderHeight,ft.isNextConnection(h)?l+h.height/2:l-h.height/2):ft.isTopRow(l)?ft.isHat(h)?l.capline-h.height/2:l.capline+h.height/2:l.yPos+l.height/2}recordElemPositions_(l){let h=l.xPos;for(let m=0,E;E=l.elements[m];m++)ft.isSpacer(E)&&(E.height=l.height),E.xPos=h,E.centerline=this.getElemCenterline_(l,E),h+=E.width}finalize_(){let l=0,h=0;for(let m=0,E;E=this.rows[m];m++)E.yPos=h,E.xPos=this.startX,h+=E.height,l=Math.max(l,E.widthWithConnectedBlocks),this.recordElemPositions_(E);if(this.outputConnection&&this.block_.nextConnection){const m=this.block_.nextConnection.targetBlock();m&&(l=Math.max(l,m.getHeightWidth().width))}this.widthWithChildren=l+this.startX,this.height=h,this.startY=this.topRow.capline,this.bottomRow.baseline=h-this.bottomRow.descenderHeight}getMeasureableForConnection(l){let h;if(((h=this.outputConnection)==null?void 0:h.connectionModel)===l)return this.outputConnection;for(const m of this.rows)for(const E of m.elements)if(E instanceof nd&&E.connectionModel===l)return E;return null}},nn=class{constructor(l,h,m){if(this.wsCoordinate=null,!h)throw Error("Cannot create a node without a location.");this.type=l,this.isConnectionLocation=nn.isConnectionType(l),this.location=h,this.processParams(m||null)}processParams(l){l&&l.wsCoordinate&&(this.wsCoordinate=l.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var l=this.location.getParentInput();const h=l.getSourceBlock();for(l=h.inputList.indexOf(l),l+=1;l<h.inputList.length;l++){const m=h.inputList[l],E=m.fieldRow;for(let k=0;k<E.length;k++){const z=E[k];if(z.isClickable()||nn.NAVIGATE_ALL_FIELDS)return nn.createFieldNode(z)}if(m.connection)return nn.createInputNode(m)}return null}findNextForField(){var l=this.location,h=l.getParentInput();const m=l.getSourceBlock();if(!m)throw Error("The current AST location is not associated with a block");var E=m.inputList.indexOf(h);for(l=h.fieldRow.indexOf(l)+1;E<m.inputList.length;E++){h=m.inputList[E];const k=h.fieldRow;for(;l<k.length;){if(k[l].isClickable()||nn.NAVIGATE_ALL_FIELDS)return nn.createFieldNode(k[l]);l++}if(l=0,h.connection)return nn.createInputNode(h)}return null}findPrevForInput(){const l=this.location.getParentInput(),h=l.getSourceBlock();for(var m=h.inputList.indexOf(l);0<=m;m--){var E=h.inputList[m];if(E.connection&&E!==l)return nn.createInputNode(E);E=E.fieldRow;for(let k=E.length-1;0<=k;k--){const z=E[k];if(z.isClickable()||nn.NAVIGATE_ALL_FIELDS)return nn.createFieldNode(z)}}return null}findPrevForField(){var l=this.location;const h=l.getParentInput(),m=l.getSourceBlock();if(!m)throw Error("The current AST location is not associated with a block");var E=m.inputList.indexOf(h);for(l=h.fieldRow.indexOf(l)-1;0<=E;E--){var k=m.inputList[E];if(k.connection&&k!==h)return nn.createInputNode(k);for(k=k.fieldRow;-1<l;){if(k[l].isClickable()||nn.NAVIGATE_ALL_FIELDS)return nn.createFieldNode(k[l]);l--}0<=E-1&&(l=m.inputList[E-1].fieldRow.length-1)}return null}navigateBetweenStacks(l){var h=this.getLocation();if(h.getSourceBlock){var m=h.getSourceBlock();m&&(h=m)}if(!h||h.isDeadOrDying())return null;m=h.getRootBlock(),h=m.workspace.getTopBlocks(!0);for(let E=0;E<h.length;E++)if(m.id===h[E].id)return l=E+(l?1:-1),l===-1||l===h.length?null:nn.createStackNode(h[l]);throw Error("Couldn't find "+(l?"next":"previous")+" stack?!")}findTopASTNodeForBlock(l){const h=dE(l);return h?nn.createConnectionNode(h):nn.createBlockNode(l)}getOutAstNodeForBlock(l){if(!l)return null;l=l.getTopStackBlock();const h=dE(l);return h&&h.targetConnection&&h.targetConnection.getParentInput()?nn.createInputNode(h.targetConnection.getParentInput()):nn.createStackNode(l)}findFirstFieldOrInput(l){l=l.inputList;for(let h=0;h<l.length;h++){const m=l[h],E=m.fieldRow;for(let k=0;k<E.length;k++){const z=E[k];if(z.isClickable()||nn.NAVIGATE_ALL_FIELDS)return nn.createFieldNode(z)}if(m.connection)return nn.createInputNode(m)}return null}getSourceBlock(){return this.getType()===nn.types.BLOCK?this.getLocation():this.getType()===nn.types.STACK?this.getLocation():this.getType()===nn.types.WORKSPACE?null:this.getLocation().getSourceBlock()}next(){switch(this.type){case nn.types.STACK:return this.navigateBetweenStacks(!0);case nn.types.OUTPUT:return nn.createBlockNode(this.location.getSourceBlock());case nn.types.FIELD:return this.findNextForField();case nn.types.INPUT:return this.findNextForInput();case nn.types.BLOCK:const l=this.location.nextConnection;if(!l)break;return nn.createConnectionNode(l);case nn.types.PREVIOUS:return nn.createBlockNode(this.location.getSourceBlock());case nn.types.NEXT:return nn.createConnectionNode(this.location.targetConnection)}return null}in(){switch(this.type){case nn.types.WORKSPACE:const l=this.location.getTopBlocks(!0);if(0<l.length)return nn.createStackNode(l[0]);break;case nn.types.STACK:return this.findTopASTNodeForBlock(this.location);case nn.types.BLOCK:return this.findFirstFieldOrInput(this.location);case nn.types.INPUT:return nn.createConnectionNode(this.location.targetConnection)}return null}prev(){switch(this.type){case nn.types.STACK:return this.navigateBetweenStacks(!1);case nn.types.FIELD:return this.findPrevForField();case nn.types.INPUT:return this.findPrevForInput();case nn.types.BLOCK:var l=dE(this.location);if(!l)break;return nn.createConnectionNode(l);case nn.types.PREVIOUS:if((l=this.location.targetConnection)&&!l.getParentInput())return nn.createConnectionNode(l);break;case nn.types.NEXT:return nn.createBlockNode(this.location.getSourceBlock())}return null}out(){switch(this.type){case nn.types.STACK:var l=this.location,h=l.getRelativeToSurfaceXY();return h=new _n(h.x,h.y+nn.DEFAULT_OFFSET_Y),nn.createWorkspaceNode(l.workspace,h);case nn.types.OUTPUT:return l=this.location,(h=l.targetConnection)?nn.createConnectionNode(h):nn.createStackNode(l.getSourceBlock());case nn.types.FIELD:if(l=this.location.getSourceBlock(),!l)throw Error("The current AST location is not associated with a block");return nn.createBlockNode(l);case nn.types.INPUT:return nn.createBlockNode(this.location.getSourceBlock());case nn.types.BLOCK:return this.getOutAstNodeForBlock(this.location);case nn.types.PREVIOUS:return this.getOutAstNodeForBlock(this.location.getSourceBlock());case nn.types.NEXT:return this.getOutAstNodeForBlock(this.location.getSourceBlock())}return null}static isConnectionType(l){switch(l){case nn.types.PREVIOUS:case nn.types.NEXT:case nn.types.INPUT:case nn.types.OUTPUT:return!0}return!1}static createFieldNode(l){return l?new nn(nn.types.FIELD,l):null}static createConnectionNode(l){if(!l)return null;const h=l.type;return h===Pn.INPUT_VALUE||h===Pn.NEXT_STATEMENT&&l.getParentInput()?nn.createInputNode(l.getParentInput()):h===Pn.NEXT_STATEMENT?new nn(nn.types.NEXT,l):h===Pn.OUTPUT_VALUE?new nn(nn.types.OUTPUT,l):h===Pn.PREVIOUS_STATEMENT?new nn(nn.types.PREVIOUS,l):null}static createInputNode(l){return l&&l.connection?new nn(nn.types.INPUT,l.connection):null}static createBlockNode(l){return l?new nn(nn.types.BLOCK,l):null}static createStackNode(l){return l?new nn(nn.types.STACK,l):null}static createWorkspaceNode(l,h){return h&&l?new nn(nn.types.WORKSPACE,l,{wsCoordinate:h}):null}static createTopNode(l){const h=dE(l);return h?nn.createConnectionNode(h):nn.createBlockNode(l)}};nn.NAVIGATE_ALL_FIELDS=!1,nn.DEFAULT_OFFSET_Y=-20,function(l){l=l.types||(l.types={}),l.FIELD="field",l.BLOCK="block",l.INPUT="input",l.OUTPUT="output",l.NEXT="next",l.PREVIOUS="previous",l.STACK="stack",l.WORKSPACE="workspace"}(nn);var OL=class extends Ec{constructor(l,h,m,E){let k=l?l.workspace.id:void 0;E&&E.getType()===nn.types.WORKSPACE&&(k=E.getLocation().id),super(k),this.type=$_,this.blockId=l==null?void 0:l.id,this.oldNode=m||void 0,this.newNode=E,this.isCursor=h}toJson(){const l=super.toJson();if(this.isCursor===void 0)throw Error("Whether this is a cursor event or not is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newNode)throw Error("The new node is undefined. Either pass a node to the constructor, or call fromJson");return l.isCursor=this.isCursor,l.blockId=this.blockId,l.oldNode=this.oldNode,l.newNode=this.newNode,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new OL),h.isCursor=l.isCursor,h.blockId=l.blockId,h.oldNode=l.oldNode,h.newNode=l.newNode,h}};i(Jt.EVENT,$_,OL);var VG="blocklyCursor",UG="blocklyMarker",WG=.75,RL=class{constructor(l,h,m){this.workspace=l,this.marker=m,this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=this.currentMarkerSvg=this.parent=null,this.constants_=h,l=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR,this.colour_=m.colour||l}getSvgRoot(){return this.svgGroup_}getMarker(){return this.marker}isCursor(){return this.marker.type==="cursor"}createDom(){const l=this.isCursor()?VG:UG;return this.svgGroup_=He(pt.G,{class:l}),this.createDomInternal_(),this.svgGroup_}setParent_(l){this.isCursor()?(this.parent&&this.parent.setCursorSvg(null),l.setCursorSvg(this.getSvgRoot())):(this.parent&&this.parent.setMarkerSvg(null),l.setMarkerSvg(this.getSvgRoot())),this.parent=l}draw(l,h){if(h){this.constants_=this.workspace.getRenderer().getConstants();var m=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker.colour||m,this.applyColour_(h),this.showAtLocation_(h),this.fireMarkerEvent(l,h),l=this.currentMarkerSvg.childNodes[0],l!==void 0&&l.beginElement&&l.beginElement()}else this.hide()}showAtLocation_(l){const h=l.getLocation().type;l.getType()===nn.types.BLOCK?this.showWithBlock_(l):l.getType()===nn.types.OUTPUT?this.showWithOutput_(l):h===Pn.INPUT_VALUE?this.showWithInput_(l):h===Pn.NEXT_STATEMENT?this.showWithNext_(l):l.getType()===nn.types.PREVIOUS?this.showWithPrevious_(l):l.getType()===nn.types.FIELD?this.showWithField_(l):l.getType()===nn.types.WORKSPACE?this.showWithCoordinates_(l):l.getType()===nn.types.STACK&&this.showWithStack_(l)}showWithBlockPrevOutput(l){l=l.getSourceBlock();const h=l.width;var m=l.height,E=m*WG;const k=this.constants_.CURSOR_BLOCK_PADDING;l.previousConnection?(m=this.constants_.shapeFor(l.previousConnection),this.positionPrevious_(h,k,E,m)):l.outputConnection?(E=this.constants_.shapeFor(l.outputConnection),this.positionOutput_(h,m,E)):this.positionBlock_(h,k,E),this.setParent_(l),this.showCurrent_()}showWithBlock_(l){this.showWithBlockPrevOutput(l)}showWithPrevious_(l){this.showWithBlockPrevOutput(l)}showWithOutput_(l){this.showWithBlockPrevOutput(l)}showWithCoordinates_(l){var h=l.getWsCoordinate();l=h.x,h=h.y,this.workspace.RTL&&(l-=this.constants_.CURSOR_WS_WIDTH),this.positionLine_(l,h,this.constants_.CURSOR_WS_WIDTH),this.setParent_(this.workspace),this.showCurrent_()}showWithField_(l){l=l.getLocation();const h=l.getSize().width,m=l.getSize().height;this.positionRect_(0,0,h,m),this.setParent_(l),this.showCurrent_()}showWithInput_(l){l=l.getLocation();const h=l.getSourceBlock();this.positionInput_(l),this.setParent_(h),this.showCurrent_()}showWithNext_(l){var h=l.getLocation();l=h.getSourceBlock();let m=0;h=h.getOffsetInBlock().y;const E=l.getHeightWidth().width;this.workspace.RTL&&(m=-E),this.positionLine_(m,h,E),this.setParent_(l),this.showCurrent_()}showWithStack_(l){l=l.getLocation();var h=l.getHeightWidth();const m=h.width+this.constants_.CURSOR_STACK_PADDING;h=h.height+this.constants_.CURSOR_STACK_PADDING;const E=-this.constants_.CURSOR_STACK_PADDING/2,k=-this.constants_.CURSOR_STACK_PADDING/2;let z=E;this.workspace.RTL&&(z=-(m+E)),this.positionRect_(z,k,m,h),this.setParent_(l),this.showCurrent_()}showCurrent_(){this.hide(),this.currentMarkerSvg&&(this.currentMarkerSvg.style.display="")}positionBlock_(l,h,m){if(l=Bo(-h,m)+Vn("V",-h)+Vn("H",l+2*h)+Vn("V",m),!this.markerBlock_)throw Error("createDom should be called before positioning the marker");this.markerBlock_.setAttribute("d",l),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionInput_(l){const h=l.getOffsetInBlock().x,m=l.getOffsetInBlock().y;l=pl(0,0)+this.constants_.shapeFor(l).pathDown,this.markerInput_.setAttribute("d",l),this.markerInput_.setAttribute("transform","translate("+h+","+m+")"+(this.workspace.RTL?" scale(-1 1)":"")),this.currentMarkerSvg=this.markerInput_}positionLine_(l,h,m){if(!this.markerSvgLine_)throw Error("createDom should be called before positioning the line");this.markerSvgLine_.setAttribute("x",`${l}`),this.markerSvgLine_.setAttribute("y",`${h}`),this.markerSvgLine_.setAttribute("width",`${m}`),this.currentMarkerSvg=this.markerSvgLine_}positionOutput_(l,h,m){if(!this.markerBlock_)throw Error("createDom should be called before positioning the output");l=Bo(l,0)+Vn("h",-(l-m.width))+Vn("v",this.constants_.TAB_OFFSET_FROM_TOP)+m.pathDown+Vn("V",h)+Vn("H",l),this.markerBlock_.setAttribute("d",l),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionPrevious_(l,h,m,E){if(!this.markerBlock_)throw Error("createDom should be called before positioning the previous connection marker");l=Bo(-h,m)+Vn("V",-h)+Vn("H",this.constants_.NOTCH_OFFSET_LEFT)+E.pathLeft+Vn("H",l+2*h)+Vn("V",m),this.markerBlock_.setAttribute("d",l),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionRect_(l,h,m,E){if(!this.markerSvgRect_)throw Error("createDom should be called before positioning the rect");this.markerSvgRect_.setAttribute("x",`${l}`),this.markerSvgRect_.setAttribute("y",`${h}`),this.markerSvgRect_.setAttribute("width",`${m}`),this.markerSvgRect_.setAttribute("height",`${E}`),this.currentMarkerSvg=this.markerSvgRect_}flipRtl(l){l.setAttribute("transform","scale(-1 1)")}hide(){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before hiding the marker");this.markerSvgLine_.style.display="none",this.markerSvgRect_.style.display="none",this.markerInput_.style.display="none",this.markerBlock_.style.display="none"}fireMarkerEvent(l,h){const m=h.getSourceBlock();l=new(Ne($_))(m,this.isCursor(),l,h),q(l)}getBlinkProperties_(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}}createDomInternal_(){if(this.markerSvg_=He(pt.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_),this.markerSvgLine_=He(pt.RECT,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.markerSvg_),this.markerSvgRect_=He(pt.RECT,{class:"blocklyVerticalMarker",rx:10,ry:10},this.markerSvg_),this.markerInput_=He(pt.PATH,{transform:""},this.markerSvg_),this.markerBlock_=He(pt.PATH,{transform:"",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.hide(),this.isCursor()){const l=this.getBlinkProperties_();He(pt.ANIMATE,l,this.markerSvgLine_),He(pt.ANIMATE,l,this.markerInput_),He(pt.ANIMATE,Object.assign({},l,{attributeName:"stroke"}),this.markerBlock_)}return this.markerSvg_}applyColour_(l){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before applying color to the markerj");this.markerSvgLine_.setAttribute("fill",this.colour_),this.markerSvgRect_.setAttribute("stroke",this.colour_),this.markerInput_.setAttribute("fill",this.colour_),this.markerBlock_.setAttribute("stroke",this.colour_),this.isCursor()&&(l=this.colour_+";transparent;transparent;",this.markerSvgLine_.firstElementChild.setAttribute("values",l),this.markerInput_.firstElementChild.setAttribute("values",l),this.markerBlock_.firstElementChild.setAttribute("values",l))}dispose(){this.svgGroup_&&Ot(this.svgGroup_)}},qE=class{constructor(l,h,m){this.markerSvg=this.cursorSvg=null,this.connectionHighlights=new WeakMap,this.highlightOffsets=new WeakMap,this.constants=m,this.style=h,this.svgRoot=l,this.svgPath=He(pt.PATH,{class:"blocklyPath"},this.svgRoot)}setPath(l){this.svgPath.setAttribute("d",l)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)")}setCursorSvg(l){l?(this.svgRoot.appendChild(l),this.cursorSvg=l):this.cursorSvg=null}setMarkerSvg(l){l?(this.cursorSvg?this.svgRoot.insertBefore(l,this.cursorSvg):this.svgRoot.appendChild(l),this.markerSvg=l):this.markerSvg=null}applyColour(l){this.svgPath.setAttribute("stroke",this.style.colourTertiary),this.svgPath.setAttribute("fill",this.style.colourPrimary),this.updateShadow_(l.isShadow()),this.updateDisabled_(!l.isEnabled()||l.getInheritedDisabled())}setStyle(l){this.style=l}setClass_(l,h){l&&(h?ke(this.svgRoot,l):Ct(this.svgRoot,l))}updateHighlighted(l){l?this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"):this.svgPath.setAttribute("filter","none")}updateShadow_(l){l&&(this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))}updateDisabled_(l){this.setClass_("blocklyDisabled",l),l&&this.svgPath.setAttribute("fill","url(#"+this.constants.disabledPatternId+")")}updateSelected(l){this.setClass_("blocklySelected",l)}updateDraggingDelete(l){this.setClass_("blocklyDraggingDelete",l)}updateInsertionMarker(l){this.setClass_("blocklyInsertionMarker",l)}updateMovable(l){this.setClass_("blocklyDraggable",l)}updateReplacementFade(l){this.setClass_("blocklyReplaceable",l)}updateShapeForInputHighlight(l,h){}addConnectionHighlight(l,h,m,E){if(this.connectionHighlights.has(l)){if(this.currentHighlightMatchesNew(l,h,m))return;this.removeConnectionHighlight(l)}h=He(pt.PATH,{class:"blocklyHighlightedConnectionPath",d:h,transform:`translate(${m.x}, ${m.y})`+(E?" scale(-1 1)":"")},this.svgRoot),this.connectionHighlights.set(l,h)}currentHighlightMatchesNew(l,h,m){let E;const k=(E=this.connectionHighlights.get(l))==null?void 0:E.getAttribute("d");return l=this.highlightOffsets.get(l),k===h&&_n.equals(l,m)}removeConnectionHighlight(l){const h=this.connectionHighlights.get(l);h&&(Ot(h),this.connectionHighlights.delete(l))}},Ns=class{constructor(l,h){this.type=h,this.targetConnection=null,this.disposed=!1,this.shadowDom=this.check=null,this.y=this.x=0,this.shadowState=null,this.sourceBlock_=l}connect_(l){const h=Pn.INPUT_VALUE,m=this.getSourceBlock();var E=l.getSourceBlock();l.isConnected()&&l.disconnectInternal(!1);let k;if(this.isConnected()){const Oe=this.stashShadowState(),Je=this.targetBlock();Je.isShadow()?Je.dispose(!1):(this.disconnectInternal(),k=Je),this.applyShadowState(Oe)}let z;ge()&&(z=new(Ne(t.MOVE$$module$build$src$core$events$utils))(E),z.setReason(["connect"])),Hh(this,l),E.setParent(m),z&&(z.recordNew(),q(z)),k&&(l=this.type===h?k.outputConnection:k.previousConnection)&&((E=Ns.getConnectionForOrphanedConnection(E,l))?l.connect(E):l.onFailedConnect(this))}dispose(){if(this.isConnected()){this.setShadowStateInternal();const l=this.targetBlock();l&&!l.isDeadOrDying()&&l.unplug()}this.disposed=!0}getSourceBlock(){return this.sourceBlock_}isSuperior(){return this.type===Pn.INPUT_VALUE||this.type===Pn.NEXT_STATEMENT}isConnected(){return!!this.targetConnection}getConnectionChecker(){return this.sourceBlock_.workspace.connectionChecker}onFailedConnect(l){}connect(l){if(this.targetConnection===l)return!0;if(this.getConnectionChecker().canConnect(this,l,!1)){const h=t.getGroup$$module$build$src$core$events$utils();h||t.setGroup$$module$build$src$core$events$utils(!0),this.isSuperior()?this.connect_(l):l.connect_(this),t.setGroup$$module$build$src$core$events$utils(h)}return this.isConnected()}disconnect(){this.disconnectInternal()}disconnectInternal(l=!0){const{parentConnection:h,childConnection:m}=this.getParentAndChildConnections();if(!h||!m)throw Error("Source connection not connected.");const E=t.getGroup$$module$build$src$core$events$utils();E||t.setGroup$$module$build$src$core$events$utils(!0);let k;ge()&&(k=new(Ne(t.MOVE$$module$build$src$core$events$utils))(m.getSourceBlock()),k.setReason(["disconnect"]));const z=this.targetConnection;z&&(z.targetConnection=null),this.targetConnection=null,l&&m.getSourceBlock().setParent(null),k&&(k.recordNew(),q(k)),m.getSourceBlock().isShadow()||h.respawnShadow_(),t.setGroup$$module$build$src$core$events$utils(E)}getParentAndChildConnections(){return this.targetConnection?this.isSuperior()?{parentConnection:this,childConnection:this.targetConnection}:{parentConnection:this.targetConnection,childConnection:this}:{}}respawnShadow_(){this.createShadowBlock(!0)}reconnect(l,h){if(this.getSourceBlock().isDeadOrDying())return!1;var m;return h=(m=l.getInput(h))==null?void 0:m.connection,m=this.targetBlock(),m&&m!==l||!h||h.targetConnection===this?!1:(h.isConnected()&&h.disconnect(),h.connect(this),!0)}targetBlock(){if(this.isConnected()){let l,h;return(h=(l=this.targetConnection)==null?void 0:l.getSourceBlock())!=null?h:null}return null}onCheckChanged_(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(l){return l?(Array.isArray(l)||(l=[l]),this.check=l,this.onCheckChanged_()):this.check=null,this}getCheck(){return this.check}setShadowDom(l){this.setShadowStateInternal({shadowDom:l})}getShadowDom(l){return l&&this.targetBlock().isShadow()?Cp(this.targetBlock()):this.shadowDom}setShadowState(l){this.setShadowStateInternal({shadowState:l})}getShadowState(l){return l&&this.targetBlock()&&this.targetBlock().isShadow()?Hd(this.targetBlock()):this.shadowState}neighbours(l){return[]}getParentInput(){let l=null;const h=this.sourceBlock_.inputList;for(let m=0;m<h.length;m++)if(h[m].connection===this){l=h[m];break}return l}toString(){const l=this.sourceBlock_;if(!l)return"Orphan Connection";if(l.outputConnection===this)var h="Output Connection of ";else if(l.previousConnection===this)h="Previous Connection of ";else if(l.nextConnection===this)h="Next Connection of ";else{h=null;for(let m=0,E;E=l.inputList[m];m++)if(E.connection===this){h=E;break}if(h)h='Input "'+h.name+'" connection on ';else return console.warn("Connection not actually connected to sourceBlock_"),"Orphan Connection"}return h+l.toDevString()}stashShadowState(){const l=this.getShadowDom(!0),h=this.getShadowState(!0);return this.shadowState=this.shadowDom=null,{shadowDom:l,shadowState:h}}applyShadowState({shadowDom:l,shadowState:h}){this.shadowDom=l,this.shadowState=h}setShadowStateInternal({shadowDom:l=null,shadowState:h=null}={}){this.shadowDom=l,this.shadowState=h,(l=this.targetBlock())?l.isShadow()?(l.dispose(!1),this.getSourceBlock().isDeadOrDying()||(this.respawnShadow_(),this.targetBlock()&&this.targetBlock().isShadow()&&this.serializeShadow(this.targetBlock()))):(l=this.createShadowBlock(!1),this.serializeShadow(l),l&&l.dispose(!1)):(this.respawnShadow_(),this.targetBlock()&&this.targetBlock().isShadow()&&this.serializeShadow(this.targetBlock()))}createShadowBlock(l){var h=this.getSourceBlock();const m=this.getShadowState(),E=this.getShadowDom();if(h.isDeadOrDying()||!m&&!E)return null;if(m)return h=$b(m,h.workspace,{parentConnection:l?this:void 0,isShadow:!0,recordUndo:!1});if(E){if(h=yp(E,h.workspace),l)if(this.type===Pn.INPUT_VALUE){if(!h.outputConnection)throw Error("Shadow block is missing an output connection");if(!this.connect(h.outputConnection))throw Error("Could not connect shadow block to connection")}else if(this.type===Pn.NEXT_STATEMENT){if(!h.previousConnection)throw Error("Shadow block is missing previous connection");if(!this.connect(h.previousConnection))throw Error("Could not connect shadow block to connection")}else throw Error("Cannot connect a shadow block to a previous/output connection");return h}return null}serializeShadow(l){l&&(this.shadowDom=Cp(l),this.shadowState=Hd(l))}static getConnectionForOrphanedConnection(l,h){if(h.type===Pn.OUTPUT_VALUE)return Rp(l,h.getSourceBlock());l=l.lastConnectionInStack(!0);const m=h.getConnectionChecker();return l&&m.canConnect(h,l,!1)?l:null}};Ns.CAN_CONNECT=0,Ns.REASON_SELF_CONNECTION=1,Ns.REASON_WRONG_TYPE=2,Ns.REASON_TARGET_NULL=3,Ns.REASON_CHECKS_FAILED=4,Ns.REASON_DIFFERENT_WORKSPACES=5,Ns.REASON_SHADOW_PARENT=6,Ns.REASON_DRAG_CHECKS_FAILED=7,Ns.REASON_PREVIOUS_AND_OUTPUT=8;var ev="_TEMP_COLLAPSED_INPUT",ML="_TEMP_COLLAPSED_FIELD",GG={COLLAPSED_FIELD_NAME:ML,COLLAPSED_INPUT_NAME:ev},tv="The insertion marker manager tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined.",Jd=class{constructor(l){this.activeCandidate=this.lastMarker=this.lastOnStack=null,this.wouldDeleteBlock=!1,this.fadedBlock=this.highlightedBlock=this.markerConnection=null,I(l),this.topBlock=l,this.workspace=l.workspace,this.firstMarker=this.createMarkerBlock(this.topBlock),this.availableConnections=this.initAvailableConnections(),this.lastOnStack&&(this.lastMarker=this.createMarkerBlock(this.lastOnStack.getSourceBlock()))}dispose(){this.availableConnections.length=0,this.disposeInsertionMarker(this.firstMarker),this.disposeInsertionMarker(this.lastMarker)}updateAvailableConnections(){this.availableConnections=this.initAvailableConnections()}wouldConnectBlock(){return!!this.activeCandidate}applyConnections(){if(this.activeCandidate){t.disable$$module$build$src$core$events$utils(),this.hidePreview(),t.enable$$module$build$src$core$events$utils();var{local:l,closest:h}=this.activeCandidate;if(l.connect(h),this.topBlock.rendered){const m=l.isSuperior()?h:l,E=this.topBlock.getRootBlock();tg().then(()=>{CI(m.getSourceBlock()),setTimeout(()=>{E.bringToFront()},0)})}}}update(l,h){const m=this.getCandidate(l);((this.wouldDeleteBlock=this.shouldDelete(!!m,h))||this.shouldUpdatePreviews(m,l))&&(t.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(m),this.maybeShowPreview(m),t.enable$$module$build$src$core$events$utils())}createMarkerBlock(l){var h=l.type;t.disable$$module$build$src$core$events$utils();let m;try{if(m=this.workspace.newBlock(h),m.setInsertionMarker(!0),l.saveExtraState){var E=l.saveExtraState(!0);E&&m.loadExtraState&&m.loadExtraState(E)}else if(l.mutationToDom){const k=l.mutationToDom();k&&m.domToMutation&&m.domToMutation(k)}for(h=0;h<l.inputList.length;h++){const k=l.inputList[h];if(k.name===ev)continue;const z=m.inputList[h];if(!z)throw Error(tv.replace("%1","an input"));for(E=0;E<k.fieldRow.length;E++){const Oe=k.fieldRow[E],Je=z.fieldRow[E];if(!Je)throw Error(tv.replace("%1","a field"));Je.setValue(Oe.getValue())}}for(const k of m.getDescendants(!1))k.setInsertionMarker(!0);m.setCollapsed(l.isCollapsed()),m.setInputsInline(l.getInputsInline()),m.initSvg(),m.getSvgRoot().setAttribute("visibility","hidden")}finally{t.enable$$module$build$src$core$events$utils()}return m}initAvailableConnections(){const l=this.topBlock.getConnections_(!1),h=this.topBlock.lastConnectionInStack(!0);return h&&h!==this.topBlock.nextConnection&&(l.push(h),this.lastOnStack=h),l}shouldUpdatePreviews(l,h){if(!l)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:m,closest:E}=this.activeCandidate;if(E===l.closest&&m===l.local)return!1;const k=m.x+h.x-E.x;return h=m.y+h.y-E.y,l.radius<Math.sqrt(k*k+h*h)-t.config$$module$build$src$core$config.currentConnectionPreference}getCandidate(l){this.markerConnection&&this.markerConnection.isConnected()||this.updateAvailableConnections();let h=this.getStartRadius(),m=null;for(let E=0;E<this.availableConnections.length;E++){const k=this.availableConnections[E],z=k.closest(h,l);z.connection&&(m={closest:z.connection,local:k,radius:z.radius},h=z.radius)}return m}getStartRadius(){return this.activeCandidate?t.config$$module$build$src$core$config.connectingSnapRadius:t.config$$module$build$src$core$config.snapRadius}shouldDelete(l,h){return h&&this.workspace.getComponentManager().hasCapability(h.id,Qr.Capability.DELETE_AREA)?h.wouldDelete(this.topBlock,l):!1}maybeShowPreview(l){if(!this.wouldDeleteBlock&&l){var h=l.closest,m;h===((m=this.activeCandidate)==null?void 0:m.closest)||h.getSourceBlock().isInsertionMarker()?console.log("Trying to connect to an insertion marker"):(this.activeCandidate=l,this.showPreview(this.activeCandidate))}}showPreview(l){const h=this.workspace.getRenderer();switch(h.getConnectionPreviewMethod(l.closest,l.local,this.topBlock)){case Jd.PREVIEW_TYPE.INPUT_OUTLINE:this.showInsertionInputOutline(l);break;case Jd.PREVIEW_TYPE.INSERTION_MARKER:this.showInsertionMarker(l);break;case Jd.PREVIEW_TYPE.REPLACEMENT_FADE:this.showReplacementFade(l)}h.shouldHighlightConnection(l.closest)&&l.closest.highlight()}maybeHidePreview(l){if(!l)this.hidePreview();else if(this.activeCandidate){const h=this.activeCandidate.local!==l.local;(this.activeCandidate.closest!==l.closest||h||this.wouldDeleteBlock)&&this.hidePreview()}this.activeCandidate=this.markerConnection=null}hidePreview(){let l;const h=(l=this.activeCandidate)==null?void 0:l.closest;h&&h.targetBlock()&&this.workspace.getRenderer().shouldHighlightConnection(h)&&h.unhighlight(),this.hideReplacementFade(),this.hideInsertionInputOutline(),this.hideInsertionMarker()}showInsertionMarker(l){const{local:h,closest:m}=l;let E=(l=this.lastOnStack&&h===this.lastOnStack)?this.lastMarker:this.firstMarker;if(!E)throw Error("Cannot show the insertion marker because there is no insertion marker block");let k;try{k=E.getMatchingConnection(h.getSourceBlock(),h)}catch{if(l&&this.lastOnStack?(this.disposeInsertionMarker(this.lastMarker),E=this.lastMarker=this.createMarkerBlock(this.lastOnStack.getSourceBlock())):(this.disposeInsertionMarker(this.firstMarker),E=this.firstMarker=this.createMarkerBlock(this.topBlock)),!E)throw Error("Cannot show the insertion marker because there is no insertion marker block");k=E.getMatchingConnection(h.getSourceBlock(),h)}if(!k)throw Error("Cannot show the insertion marker because there is no associated connection");if(k===this.markerConnection)throw Error("Made it to showInsertionMarker_ even though the marker isn't changing");E.queueRender(),wa(),k.connect(m);const z={x:m.x-k.x,y:m.y-k.y},Oe=k.getOffsetInBlock().clone(),Je=k;tg().then(()=>{let Ht;(Ht=E)==null||Ht.positionNearConnection(Je,z,Oe);let kn;(kn=E)==null||kn.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=k}hideInsertionMarker(){if(this.markerConnection){var l=this.markerConnection,h=l.getSourceBlock(),m=h.outputConnection,E;if((E=h.previousConnection)!=null&&E.targetConnection||m!=null&&m.targetConnection)h.unplug(!0);else{let k;(k=l.targetBlock())==null||k.unplug(!1)}if(l.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(l=h.getSvgRoot())&&l.setAttribute("visibility","hidden")}}showInsertionInputOutline(l){l=l.closest,this.highlightedBlock=l.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(l,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(l){if(this.fadedBlock=l.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const l=[];return this.firstMarker&&l.push(this.firstMarker),this.lastMarker&&l.push(this.lastMarker),l}disposeInsertionMarker(l){if(l){t.disable$$module$build$src$core$events$utils();try{l.dispose()}finally{t.enable$$module$build$src$core$events$utils()}}}};(function(l){l=l.PREVIEW_TYPE||(l.PREVIEW_TYPE={}),l[l.INSERTION_MARKER=0]="INSERTION_MARKER",l[l.INPUT_OUTLINE=1]="INPUT_OUTLINE",l[l.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(Jd),Jd.PREVIEW_TYPE;var JE=class{constructor(l){this.overrides=null,this.name=l}getClassName(){return this.name+"-renderer"}init(l,h){this.constants_=this.makeConstants_(),h&&(this.overrides=h,Object.assign(this.constants_,h)),this.constants_.setTheme(l),this.constants_.init()}createDom(l,h){this.constants_.createDom(l,this.name+"-"+h.name,"."+this.getClassName()+"."+h.getClassName())}refreshDom(l,h){const m=this.getConstants();m.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=m.randomIdentifier,this.constants_.setTheme(h),this.constants_.init(),this.createDom(l,h)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new XE}makeRenderInfo_(l){return new wT(this,l)}makeDrawer_(l,h){return new YE(l,h)}makeMarkerDrawer(l,h){return new RL(l,this.getConstants(),h)}makePathObject(l,h){return new qE(l,h,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(l){return!0}orphanCanConnectAtEnd(l,h,m){return!!Ns.getConnectionForOrphanedConnection(l,m===Pn.OUTPUT_VALUE?h.outputConnection:h.previousConnection)}getConnectionPreviewMethod(l,h,m){return Tt("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),h.type===Pn.OUTPUT_VALUE||h.type===Pn.PREVIOUS_STATEMENT?!l.isConnected()||this.orphanCanConnectAtEnd(m,l.targetBlock(),h.type)?Jd.PREVIEW_TYPE.INSERTION_MARKER:Jd.PREVIEW_TYPE.REPLACEMENT_FADE:Jd.PREVIEW_TYPE.INSERTION_MARKER}render(l){const h=this.makeRenderInfo_(l);h.measure(),this.makeDrawer_(l,h).draw()}},qs={};qs.BottomRow=IL,qs.Connection=nd,qs.ConstantProvider=XE,qs.Drawer=YE,qs.ExternalValueInput=LL,qs.Field=ST,qs.Hat=$A,qs.Icon=TB,qs.InRowSpacer=hu,qs.InlineInput=xA,qs.InputConnection=Up,qs.InputRow=PA,qs.JaggedEdge=CB,qs.MarkerSvg=RL,qs.Measurable=as,qs.NextConnection=yB,qs.OutputConnection=EB,qs.PathObject=qE,qs.PreviousConnection=SB,qs.RenderInfo=wT,qs.Renderer=JE,qs.RoundCorner=Q_,qs.Row=KE,qs.SpacerRow=FA,qs.SquareCorner=Z_,qs.StatementInput=jE,qs.TopRow=BA,qs.Types=ft,qs.init=MI,qs.register=Ql,qs.unregister=A2;var LB=class{constructor(l,h){this.workspace=l,this.theme=h,this.subscribedWorkspaces_=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(l){var h=this.theme;this.theme=l,(l=this.workspace.getInjectionDiv())&&(h&&(h=h.getClassName())&&Ct(l,h),(h=this.theme.getClassName())&&ke(l,h));for(let m=0,E;E=this.subscribedWorkspaces_[m];m++)E.refreshTheme();for(const[m,E]of this.componentDB)for(const k of E){l=k.element,h=k.propertyName;const z=this.theme&&this.theme.getComponentStyle(m);l.style.setProperty(h,z||"")}for(const m of this.subscribedWorkspaces_)m.hideChaff()}subscribeWorkspace(l){this.subscribedWorkspaces_.push(l)}unsubscribeWorkspace(l){if(!Ie(this.subscribedWorkspaces_,l))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(l,h,m){this.componentDB.has(h)||this.componentDB.set(h,[]),this.componentDB.get(h).push({element:l,propertyName:m}),h=this.theme&&this.theme.getComponentStyle(h),l.style.setProperty(m,h||"")}unsubscribe(l){if(l)for(const[h,m]of this.componentDB){for(let E=m.length-1;0<=E;E--)m[E].element===l&&m.splice(E,1);m.length||this.componentDB.delete(h)}}dispose(){this.subscribedWorkspaces_.length=0,this.componentDB.clear()}},HA="VARIABLE_DYNAMIC",nv={CATEGORY_NAME:HA};nv.flyoutCategory=hE,nv.flyoutCategoryBlocks=Lk,nv.onCreateVariableButtonClick_Colour=Vh,nv.onCreateVariableButtonClick_Number=M_,nv.onCreateVariableButtonClick_String=kI;var VA=class{canConnect(l,h,m,E){return this.canConnectWithReason(l,h,m,E)===Ns.CAN_CONNECT}canConnectWithReason(l,h,m,E){const k=this.doSafetyChecks(l,h);return k!==Ns.CAN_CONNECT?k:this.doTypeChecks(l,h)?m&&!this.doDragChecks(l,h,E||0)?Ns.REASON_DRAG_CHECKS_FAILED:Ns.CAN_CONNECT:Ns.REASON_CHECKS_FAILED}getErrorMessage(l,h,m){switch(l){case Ns.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Ns.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Ns.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Ns.REASON_TARGET_NULL:return"Target connection is null.";case Ns.REASON_CHECKS_FAILED:return"Connection checks failed. "+(h+" expected "+h.getCheck()+", found "+m.getCheck());case Ns.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Ns.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Ns.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(l,h){if(!l||!h)return Ns.REASON_TARGET_NULL;let m,E,k;return l.isSuperior()?(m=l.getSourceBlock(),E=h.getSourceBlock(),k=h):(E=l.getSourceBlock(),m=h.getSourceBlock(),k=l,l=h),m===E?Ns.REASON_SELF_CONNECTION:k.type!==gg[l.type]?Ns.REASON_WRONG_TYPE:m.workspace!==E.workspace?Ns.REASON_DIFFERENT_WORKSPACES:m.isShadow()&&!E.isShadow()?Ns.REASON_SHADOW_PARENT:k.type===Pn.OUTPUT_VALUE&&E.previousConnection&&E.previousConnection.isConnected()||k.type===Pn.PREVIOUS_STATEMENT&&E.outputConnection&&E.outputConnection.isConnected()?Ns.REASON_PREVIOUS_AND_OUTPUT:Ns.CAN_CONNECT}doTypeChecks(l,h){if(l=l.getCheck(),h=h.getCheck(),!l||!h)return!0;for(let m=0;m<l.length;m++)if(h.indexOf(l[m])!==-1)return!0;return!1}doDragChecks(l,h,m){if(l.distanceFrom(h)>m||h.getSourceBlock().isInsertionMarker())return!1;switch(h.type){case Pn.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(l,h);case Pn.OUTPUT_VALUE:if(h.isConnected()&&!h.targetBlock().isInsertionMarker()||l.isConnected())return!1;break;case Pn.INPUT_VALUE:if(h.isConnected()&&!h.targetBlock().isMovable()&&!h.targetBlock().isShadow())return!1;break;case Pn.NEXT_STATEMENT:if(h.isConnected()&&!l.getSourceBlock().nextConnection&&!h.targetBlock().isShadow()&&h.targetBlock().nextConnection||h.targetBlock()&&!h.targetBlock().isMovable()&&!h.targetBlock().isShadow())return!1;break;default:return!1}return lu.indexOf(h)===-1}canConnectToPrevious_(l,h){return l.targetConnection||lu.indexOf(h)!==-1?!1:h.targetConnection?(l=h.targetBlock(),l.isInsertionMarker()?!l.getPreviousBlock():!1):!0}};i(Jt.CONNECTION_CHECKER,Uh,VA);var UA=class extends aT{constructor(l){super(l),this.type=Dp,l&&(this.varType=l.type,this.varName=l.name)}toJson(){const l=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return l.varType=this.varType,l.varName=this.varName,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new UA),h.varType=l.varType,h.varName=l.varName,h}run(l){const h=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");l?h.deleteVariableById(this.varId):h.createVariable(this.varName,this.varType,this.varId)}};i(Jt.EVENT,Dp,UA);var WA=class extends aT{constructor(l,h){super(l),this.type=N_,l&&(this.oldName=l.name,this.newName=typeof h>"u"?"":h)}toJson(){const l=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return l.oldName=this.oldName,l.newName=this.newName,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new WA),h.oldName=l.oldName,h.newName=l.newName,h}run(l){const h=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");l?h.renameVariableById(this.varId,this.newName):h.renameVariableById(this.varId,this.oldName)}};i(Jt.EVENT,N_,WA);var GA=class{constructor(l){this.workspace=l,this.variableMap=new Map}clear(){for(const l of this.variableMap.values())for(;0<l.length;)this.deleteVariable(l[0]);if(this.variableMap.size!==0)throw Error("Non-empty variable map")}renameVariable(l,h){if(l.name!==h){var m=this.getVariable(h,l.type),E=this.workspace.getAllBlocks(!1),k=t.getGroup$$module$build$src$core$events$utils();k||t.setGroup$$module$build$src$core$events$utils(!0);try{m&&m.getId()!==l.getId()?this.renameVariableWithConflict_(l,h,m,E):this.renameVariableAndUses_(l,h,E)}finally{t.setGroup$$module$build$src$core$events$utils(k)}}}renameVariableById(l,h){const m=this.getVariableById(l);if(!m)throw Error("Tried to rename a variable that didn't exist. ID: "+l);this.renameVariable(m,h)}renameVariableAndUses_(l,h,m){for(q(new(Ne(N_))(l,h)),l.name=h,h=0;h<m.length;h++)m[h].updateVarName(l)}renameVariableWithConflict_(l,h,m,E){const k=l.type;for(h!==m.name&&this.renameVariableAndUses_(m,h,E),h=0;h<E.length;h++)E[h].renameVarById(l.getId(),m.getId());q(new(Ne(Dp))(l)),Ie(this.variableMap.get(k),l)}createVariable(l,h,m){var E=this.getVariable(l,h);if(E){if(m&&E.getId()!==m)throw Error('Variable "'+l+'" is already in use and its id is "'+E.getId()+'" which conflicts with the passed in id, "'+m+'".');return E}if(m&&this.getVariableById(m))throw Error('Variable id, "'+m+'", is already in use.');return E=m||U(),h=h||"",E=new cT(this.workspace,l,h,E),l=this.variableMap.get(h)||[],l.push(E),this.variableMap.delete(h),this.variableMap.set(h,l),q(new(Ne(za))(E)),E}deleteVariable(l){const h=l.getId(),m=this.variableMap.get(l.type);if(m){for(let E=0;E<m.length;E++)if(m[E].getId()===h){m.splice(E,1),q(new(Ne(Dp))(l)),m.length===0&&this.variableMap.delete(l.type);break}}}deleteVariableById(l){const h=this.getVariableById(l);if(h){var m=h.name;const E=this.getVariableUsesById(l);for(let k=0,z;z=E[k];k++)if(z.type==="procedures_defnoreturn"||z.type==="procedures_defreturn"){l=String(z.getFieldValue("NAME")),m=t.Msg$$module$build$src$core$msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",m).replace("%2",l),At(m);return}1<E.length?(m=t.Msg$$module$build$src$core$msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(E.length)).replace("%2",m),Yn(m,k=>{k&&h&&this.deleteVariableInternal(h,E)})):this.deleteVariableInternal(h,E)}else console.warn("Can't delete non-existent variable: "+l)}deleteVariableInternal(l,h){const m=t.getGroup$$module$build$src$core$events$utils();m||t.setGroup$$module$build$src$core$events$utils(!0);try{for(let E=0;E<h.length;E++)h[E].dispose(!0);this.deleteVariable(l)}finally{t.setGroup$$module$build$src$core$events$utils(m)}}getVariable(l,h){if(h=this.variableMap.get(h||"")){for(let m=0,E;E=h[m];m++)if(t.Names$$module$build$src$core$names.equals(E.name,l))return E}return null}getVariableById(l){for(const h of this.variableMap.values())for(const m of h)if(m.getId()===l)return m;return null}getVariablesOfType(l){return(l=this.variableMap.get(l||""))?l.slice():[]}getVariableTypes(l){const h=new Set(this.variableMap.keys());if(l&&l.getPotentialVariableMap())for(const m of l.getPotentialVariableMap().variableMap.keys())h.add(m);return h.has("")||h.add(""),Array.from(h.values())}getAllVariables(){let l=[];for(const h of this.variableMap.values())l=l.concat(h);return l}getAllVariableNames(){return Array.from(this.variableMap.values()).flat().map(l=>l.name)}getVariableUsesById(l){const h=[],m=this.workspace.getAllBlocks(!1);for(let E=0;E<m.length;E++){const k=m[E].getVarModels();if(k)for(let z=0;z<k.length;z++)k[z].getId()===l&&h.push(m[E])}return h}},QE=class{get isFlyout(){return this.internalIsFlyout}get isMutator(){return this.internalIsMutator}constructor(l){this.isClearing=this.internalIsMutator=this.internalIsFlyout=this.rendered=!1,this.MAX_UNDO=1024,this.connectionDBList=[],this.topBlocks=[],this.topComments=[],this.commentDB=new Map,this.listeners=[],this.undoStack_=[],this.redoStack_=[],this.blockDB=new Map,this.typedBlocksDB=new Map,this.procedureMap=new CL,this.potentialVariableMap=null,this.id=U(),_(this),this.options=l||new Jo({}),this.RTL=!!this.options.RTL,this.horizontalLayout=!!this.options.horizontalLayout,this.toolboxPosition=this.options.toolboxPosition,this.connectionChecker=new(f(Jt.CONNECTION_CHECKER,this.options,!0))(this),this.variableMap=new GA(this)}dispose(){this.listeners.length=0,this.clear(),v(this)}sortObjects_(l,h){const m=Math.sin(Bb(QE.SCAN_ANGLE))*(this.RTL?-1:1);return l=l.getRelativeToSurfaceXY(),h=h.getRelativeToSurfaceXY(),l.y+m*l.x-(h.y+m*h.x)}addTopBlock(l){this.topBlocks.push(l)}removeTopBlock(l){if(!Ie(this.topBlocks,l))throw Error("Block not present in workspace's list of top-most blocks.")}getTopBlocks(l=!1){const h=[].concat(this.topBlocks);return l&&1<h.length&&h.sort(this.sortObjects_.bind(this)),h}addTypedBlock(l){this.typedBlocksDB.has(l.type)||this.typedBlocksDB.set(l.type,[]),this.typedBlocksDB.get(l.type).push(l)}removeTypedBlock(l){Ie(this.typedBlocksDB.get(l.type),l),this.typedBlocksDB.get(l.type).length||this.typedBlocksDB.delete(l.type)}getBlocksByType(l,h=!1){return this.typedBlocksDB.has(l)?(l=this.typedBlocksDB.get(l).slice(0),h&&l&&1<l.length&&l.sort(this.sortObjects_.bind(this)),l.filter(function(m){return!m.isInsertionMarker()})):[]}addTopComment(l){this.topComments.push(l),this.commentDB.has(l.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+l.id+'"'),this.commentDB.set(l.id,l)}removeTopComment(l){if(!Ie(this.topComments,l))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(l.id)}getTopComments(l=!1){const h=[].concat(this.topComments);return l&&1<h.length&&h.sort(this.sortObjects_.bind(this)),h}getAllBlocks(l=!1){if(l){var h=this.getTopBlocks(!0);l=[];for(let m=0;m<h.length;m++)l.push(...h[m].getDescendants(!0))}else for(l=this.getTopBlocks(!1),h=0;h<l.length;h++)l.push(...l[h].getChildren(!1));return l.filter(function(m){return!m.isInsertionMarker()})}clear(){this.isClearing=!0;try{const l=t.getGroup$$module$build$src$core$events$utils();for(l||t.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();t.setGroup$$module$build$src$core$events$utils(l),this.variableMap.clear(),this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(l,h){this.variableMap.renameVariableById(l,h)}createVariable(l,h,m){return this.variableMap.createVariable(l,h,m)}getVariableUsesById(l){return this.variableMap.getVariableUsesById(l)}deleteVariableById(l){this.variableMap.deleteVariableById(l)}getVariable(l,h){return this.variableMap.getVariable(l,h)}getVariableById(l){return this.variableMap.getVariableById(l)}getVariablesOfType(l){return this.variableMap.getVariablesOfType(l)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(l,h){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}remainingCapacity(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(l){return this.options.maxInstances?(this.options.maxInstances[l]!==void 0?this.options.maxInstances[l]:1/0)-this.getBlocksByType(l,!1).length:1/0}isCapacityAvailable(l){if(!this.hasBlockLimits())return!0;let h=0;for(const m in l){if(l[m]>this.remainingCapacityOfType(m))return!1;h+=l[m]}return!(h>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(l){var h=l?this.redoStack_:this.undoStack_,m=l?this.undoStack_:this.redoStack_;const E=h.pop();if(E){for(var k=[E];h.length&&E.group&&E.group===h[h.length-1].group;){const z=h.pop();z&&k.push(z)}for(h=0;h<k.length;h++)m.push(k[h]);k=Z(k,l),Q(!1);try{for(m=0;m<k.length;m++)k[m].run(l)}finally{Q(!0)}}}clearUndo(){this.undoStack_.length=0,this.redoStack_.length=0,J()}addChangeListener(l){return this.listeners.push(l),l}removeChangeListener(l){Ie(this.listeners,l)}fireChangeListener(l){if(l.recordUndo)for(this.undoStack_.push(l),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let h=0;h<this.listeners.length;h++)(0,this.listeners[h])(l)}getBlockById(l){return this.blockDB.get(l)||null}setBlockById(l,h){this.blockDB.set(l,h)}removeBlockById(l){this.blockDB.delete(l)}getCommentById(l){let h;return(h=this.commentDB.get(l))!=null?h:null}allInputsFilled(l){const h=this.getTopBlocks(!1);for(let m=0;m<h.length;m++)if(!h[m].allInputsFilled(l))return!1;return!0}getPotentialVariableMap(){return this.potentialVariableMap}createPotentialVariableMap(){this.potentialVariableMap=new GA(this)}getVariableMap(){return this.variableMap}setVariableMap(l){this.variableMap=l}getProcedureMap(){return this.procedureMap}getRootWorkspace(){let l=null;const h=this.options.parentWorkspace;return this.isFlyout?h&&h.options&&(l=h.options.parentWorkspace):h&&(l=h),l}static getById(l){return g(l)}static getAll(){return p()}};QE.SCAN_ANGLE=3;var zG=100,OB=class{constructor(l){this.parentWorkspace=l,this.sounds=new Map,this.lastSound_=null,this.muted=!1}dispose(){this.sounds.clear()}load(l,h){if(l.length){try{var m=new globalThis.Audio}catch{return}for(let k=0;k<l.length;k++){const z=l[k],Oe=z.match(/\.(\w+)$/);if(Oe&&m.canPlayType("audio/"+Oe[1])){var E=new globalThis.Audio(z);break}}E&&this.sounds.set(h,E)}}preload(){for(const l of this.sounds.values()){l.volume=.01;const h=l.play();if(h!==void 0?h.then(l.pause).catch(function(){}):l.pause(),Sc||ZI)break}}play(l,h){if(!this.muted){var m=this.sounds.get(l);m?(l=new Date,this.lastSound_!==null&&l.getTime()-this.lastSound_.getTime()<zG||(this.lastSound_=l,m=Sc||QI?m:m.cloneNode(),m.volume=h===void 0?1:h,m.play())):this.parentWorkspace&&this.parentWorkspace.getAudioManager().play(l,h)}}setMuted(l){this.muted=l}getMuted(){return this.muted}},KG=class{constructor(l){this.workspace=l,this.layers=new Map,(l=l.getInjectionDiv())&&(this.dragLayer=this.createDragLayer(l)),l=this.createLayer(SA),ke(l,"blocklyBlockCanvas"),l=this.createLayer(bT),ke(l,"blocklyBubbleCanvas")}createDragLayer(l){const h=He(pt.SVG,{class:"blocklyBlockDragSurface",xmlns:ME,"xmlns:html":Kd,"xmlns:xlink":cu,version:"1.1"});return l.append(h),He(pt.G,{},h)}translateLayers(l,h){l=`translate(${l.x}, ${l.y}) scale(${h})`;let m;(m=this.dragLayer)==null||m.setAttribute("transform",l);for(const[,E]of this.layers)E.setAttribute("transform",l)}moveToDragLayer(l){let h;(h=this.dragLayer)==null||h.appendChild(l.getSvgRoot())}moveOffDragLayer(l,h){this.append(l,h)}append(l,h){this.layers.has(h)||this.createLayer(h);let m;(m=this.layers.get(h))==null||m.appendChild(l.getSvgRoot())}createLayer(l){const h=this.workspace.getSvgGroup(),m=He(pt.G,{});let E=!1;const k=[...this.layers].sort((z,Oe)=>z[0]-Oe[0]);for(const[z,Oe]of k)if(l<z){h.insertBefore(m,Oe),E=!0;break}return E||h.appendChild(m),this.layers.set(l,m),m}hasLayer(l){return l===this.dragLayer||new Set(this.layers.values()).has(l)}getBlockLayer(){return this.layers.get(SA)}getBubbleLayer(){return this.layers.get(bT)}},jG=20,Qd=class extends QE{constructor(l){super(l),this.resizeHandlerWrapper=null,this.resizesEnabled=this.isVisible_=this.rendered=!0,this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0,this.dragDeltaXY=null,this.oldScale=this.scale=1,this.oldLeft=this.oldTop=0,this.inverseScreenCTM=this.targetWorkspace=this.dummyWheelListener=this.configureContextMenu=this.lastRecordedPageScroll=this.injectionDiv=this.currentGesture_=this.toolbox_=this.flyout=this.scrollbar=this.trashcan=null,this.inverseScreenCTMDirty=!0,this.highlightedBlocks=[],this.toolboxCategoryCallbacks=new Map,this.flyoutButtonCallbacks=new Map,this.cachedParentSvg=null,this.keyboardAccessibilityMode=!1,this.topBoundedElements=[],this.dragTargetAreas=[],this.zoomControls_=this.layerManager=null,this.metricsManager=new(f(Jt.METRICS_MANAGER,l,!0))(this),this.getMetrics=l.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager),this.setMetrics=l.setMetrics||Qd.setTopLevelWorkspaceMetrics_,this.componentManager=new Qr,this.connectionDBList=Fp.init(this.connectionChecker),this.audioManager=new OB(l.parentWorkspace),this.grid=this.options.gridPattern?new kA(this.options.gridPattern,l.gridOptions):null,this.markerManager=new Ya(this),nI&&this.registerToolboxCategoryCallback(sA,nI),hE&&this.registerToolboxCategoryCallback(HA,hE),Ho&&cE&&(this.registerToolboxCategoryCallback(zE,cE),this.addChangeListener(wk)),this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new LB(this,this.options.theme||TL),this.themeManager_.subscribeWorkspace(this);let h;this.renderer=MI(this.options.renderer||"geras",this.getTheme(),(h=this.options.rendererOverrides)!=null?h:void 0),this.cachedParentSvgSize=new ko(0,0)}getMarkerManager(){return this.markerManager}getMetricsManager(){return this.metricsManager}setMetricsManager(l){this.metricsManager=l,this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}setCursorSvg(l){this.markerManager.setCursorSvg(l)}setMarkerSvg(l){this.markerManager.setMarkerSvg(l)}getMarker(l){return this.markerManager?this.markerManager.getMarker(l):null}getCursor(){return this.markerManager?this.markerManager.getCursor():null}getRenderer(){return this.renderer}getThemeManager(){return this.themeManager_}getTheme(){return this.themeManager_.getTheme()}setTheme(l){l||(l=TL),this.themeManager_.setTheme(l)}refreshTheme(){this.svgGroup_&&this.renderer.refreshDom(this.svgGroup_,this.getTheme()),this.updateBlockStyles_(this.getAllBlocks(!1).filter(function(h){return!!h.getStyleName()})),this.refreshToolboxSelection(),this.toolbox_&&this.toolbox_.refreshTheme(),this.isVisible()&&this.setVisible(!0);const l=new(Ne(P_))(this.getTheme().name,this.id);q(l)}updateBlockStyles_(l){for(let h=0,m;m=l[h];h++){const E=m.getStyleName();E&&m.setStyle(E)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const l=this.getParentSvg().getScreenCTM();l&&(this.inverseScreenCTM=l.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.isVisible_}getSvgXY(l){let h=0,m=0,E=1;(this.getCanvas().contains(l)||this.getBubbleCanvas().contains(l))&&(E=this.scale);do{const k=xe(l);(l===this.getCanvas()||l===this.getBubbleCanvas())&&(E=1),h+=k.x*E,m+=k.y*E,l=l.parentNode}while(l&&l!==this.getParentSvg()&&l!==this.getInjectionDiv());return new _n(h,m)}getCachedParentSvgSize(){const l=this.cachedParentSvgSize;return new ko(l.width,l.height)}getOriginOffsetInPixels(){return H(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let l=this.svgGroup_;for(;l;){if((" "+(l.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")!==-1){this.injectionDiv=l;break}l=l.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(l){this.resizeHandlerWrapper=l}createDom(l,h){return this.injectionDiv||(this.injectionDiv=h??null),this.svgGroup_=He(pt.G,{class:"blocklyWorkspace"}),l&&(this.svgBackground_=He(pt.RECT,{height:"100%",width:"100%",class:l},this.svgGroup_),l==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.layerManager=new KG(this),this.svgBlockCanvas_=this.layerManager.getBlockLayer(),this.svgBubbleCanvas_=this.layerManager.getBubbleLayer(),this.isFlyout||(ee(this.svgGroup_,"pointerdown",this,this.onMouseDown_,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),ee(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(f(Jt.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(l=f(Jt.CURSOR,this.options))&&this.markerManager.setCursor(new l),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&Ot(this.svgGroup_),this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const l=this.getParentSvg();l&&l.parentNode&&Ot(l.parentNode)}this.resizeHandlerWrapper&&(Me(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=Qd.newTrashcan(this);const l=this.trashcan.createDom();this.svgGroup_.insertBefore(l,this.getCanvas())}static newTrashcan(l){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new z2(this);const l=this.zoomControls_.createDom();this.svgGroup_.appendChild(l)}addFlyout(l){const h=new Jo({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return h.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(f(Jt.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(h):new(f(Jt.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(h),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(l)}getFlyout(l){return this.flyout||l?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox_&&this.toolbox_.position(),this.flyout&&this.flyout.position();const l=this.componentManager.getComponents(Qr.Capability.POSITIONABLE,!0),h=this.getMetricsManager().getUiMetrics(),m=[];for(let E=0,k;k=l[E];E++){k.position(h,m);const z=k.getBoundingRectangle();z&&m.push(z)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()}updateScreenCalculationsIfScrolled(){const l=ue();_n.equals(this.lastRecordedPageScroll,l)||(this.lastRecordedPageScroll=l,this.updateScreenCalculations_())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(l,h){const m=this.getParentSvg();l!=null&&(this.cachedParentSvgSize.width=l,m.setAttribute("data-cached-width",`${l}`)),h!=null&&(this.cachedParentSvgSize.height=h,m.setAttribute("data-cached-height",`${h}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let l=this.svgGroup_;for(;l;){if(l.tagName==="svg"){this.cachedParentSvg=l;break}l=l.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(ge()){var l=this.scale,h=-this.scrollY,m=-this.scrollX;if(!(l===this.oldScale&&1>Math.abs(h-this.oldTop)&&1>Math.abs(m-this.oldLeft))){var E=new(Ne(Gr))(h,m,l,this.id,this.oldScale);this.oldScale=l,this.oldTop=h,this.oldLeft=m,q(E)}}}translate(l,h){let m;(m=this.layerManager)==null||m.translateLayers(new _n(l,h),this.scale);let E;(E=this.grid)==null||E.moveTo(l,h),this.maybeFireViewportChangeEvent()}getWidth(){const l=this.getMetrics();return l?l.viewWidth/this.scale:0}setVisible(l){this.isVisible_=l,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(l),this.getFlyout()&&this.getFlyout().setContainerVisible(l),this.getParentSvg().style.display=l?"block":"none",this.toolbox_&&this.toolbox_.setVisible(l),l||this.hideChaff(!0))}render(){for(var l=this.getAllBlocks(!1),h=l.length-1;0<=h;h--)l[h].queueRender();if(this.currentGesture_)for(l=this.currentGesture_.getInsertionMarkers(),h=0;h<l.length;h++)l[h].queueRender();tg().then(()=>void this.markerManager.updateMarkers())}highlightBlock(l,h){if(h===void 0){for(let m=0,E;E=this.highlightedBlocks[m];m++)E.setHighlighted(!1);this.highlightedBlocks.length=0}(l=l?this.getBlockById(l):null)&&((h=h===void 0||h)?this.highlightedBlocks.indexOf(l)===-1&&this.highlightedBlocks.push(l):Ie(this.highlightedBlocks,l),l.setHighlighted(h))}paste(l){if(Tt("Blockly.WorkspaceSvg.prototype.paste","v10","v11","Blockly.clipboard.paste"),!this.rendered||!l.type&&!l.tagName)return null;this.currentGesture_&&this.currentGesture_.cancel();const h=t.getGroup$$module$build$src$core$events$utils();h||t.setGroup$$module$build$src$core$events$utils(!0);let m;try{m=l.type?this.pasteBlock_(null,l):l.tagName.toLowerCase()==="comment"?this.pasteWorkspaceComment_(l):this.pasteBlock_(l,null)}finally{t.setGroup$$module$build$src$core$events$utils(h)}return m}pasteBlock_(l,h){t.disable$$module$build$src$core$events$utils();let m;try{let E=0,k=0;if(l){m=yp(l,this);let z;E=parseInt((z=l.getAttribute("x"))!=null?z:"0"),this.RTL&&(E=-E);let Oe;k=parseInt((Oe=l.getAttribute("y"))!=null?Oe:"0")}else h&&(m=qr(h,this),E=h.x||10,this.RTL&&(E=this.getWidth()-E),k=h.y||10);if(!isNaN(E)&&!isNaN(k)){let z;do{z=!1;const Oe=this.getAllBlocks(!1);for(let Je=0,Ht;Ht=Oe[Je];Je++){const kn=Ht.getRelativeToSurfaceXY();if(1>=Math.abs(E-kn.x)&&1>=Math.abs(k-kn.y)){z=!0;break}}if(!z){const Je=m.getConnections_(!1);for(let Ht=0,kn;kn=Je[Ht];Ht++)if(kn.closest(t.config$$module$build$src$core$config.snapRadius,new _n(E,k)).connection){z=!0;break}}z&&(E=this.RTL?E-t.config$$module$build$src$core$config.snapRadius:E+t.config$$module$build$src$core$config.snapRadius,k+=2*t.config$$module$build$src$core$config.snapRadius)}while(z);m.moveTo(new _n(E,k))}}finally{t.enable$$module$build$src$core$events$utils()}return ge()&&!m.isShadow()&&q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(m)),m.select(),m}pasteWorkspaceComment_(l){t.disable$$module$build$src$core$events$utils();let h;try{h=sa.fromXmlRendered(l,this);let m,E=parseInt((m=l.getAttribute("x"))!=null?m:"0"),k,z=parseInt((k=l.getAttribute("y"))!=null?k:"0");isNaN(E)||isNaN(z)||(this.RTL&&(E=-E),h.moveBy(E+50,z+50))}finally{t.enable$$module$build$src$core$events$utils()}return ge()&&Kh.fireCreateEvent(h),h.select(),h}refreshToolboxSelection(){const l=this.isFlyout?this.targetWorkspace:this;l&&!l.currentGesture_&&l.toolbox_&&l.toolbox_.getFlyout()&&l.toolbox_.refreshSelection()}renameVariableById(l,h){super.renameVariableById(l,h),this.refreshToolboxSelection()}deleteVariableById(l){super.deleteVariableById(l),this.refreshToolboxSelection()}createVariable(l,h,m){return l=super.createVariable(l,h,m),this.refreshToolboxSelection(),l}recordDragTargets(){const l=this.componentManager.getComponents(Qr.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let h=0,m;m=l[h];h++){const E=m.getClientRect();E&&this.dragTargetAreas.push({component:m,clientRect:E})}}newBlock(l,h){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}getDragTarget(l){for(let h=0,m;m=this.dragTargetAreas[h];h++)if(m.clientRect.contains(l.clientX,l.clientY))return m.component;return null}onMouseDown_(l){const h=this.getGesture(l);h&&h.handleWsStart(l,this)}startDrag(l,h){l=Ue(l,this.getParentSvg(),this.getInverseScreenCTM()),l.x/=this.scale,l.y/=this.scale,this.dragDeltaXY=_n.difference(h,l)}moveDrag(l){return l=Ue(l,this.getParentSvg(),this.getInverseScreenCTM()),l.x/=this.scale,l.y/=this.scale,_n.sum(this.dragDeltaXY,l)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const l=!!this.scrollbar;return this.isMovable()&&(!l||l&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const l=!!this.scrollbar;return this.isMovable()&&(!l||l&&this.scrollbar.canScrollVertically())}onMouseWheel_(l){if(pg.inProgress())l.preventDefault(),l.stopPropagation();else{var h=this.options.zoomOptions&&this.options.zoomOptions.wheel,m=this.options.moveOptions&&this.options.moveOptions.wheel;if(h||m){var E=Se(l);if(LE)var k=l.metaKey;h&&(l.ctrlKey||k||!m)?(E=-E.y/50,h=Ue(l,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(h.x,h.y,E)):(h=this.scrollX-E.x,m=this.scrollY-E.y,l.shiftKey&&!E.x&&(h=this.scrollX-E.y,m=this.scrollY),this.scroll(h,m)),l.preventDefault()}}}getBlocksBoundingBox(){const l=this.getTopBoundedElements();if(!l.length)return new lo(0,0,0,0);const h=l[0].getBoundingRectangle();for(let E=1;E<l.length;E++){var m=l[E];m.isInsertionMarker&&m.isInsertionMarker()||(m=m.getBoundingRectangle(),m.top<h.top&&(h.top=m.top),m.bottom>h.bottom&&(h.bottom=m.bottom),m.left<h.left&&(h.left=m.left),m.right>h.right&&(h.right=m.right))}return h}cleanUp(){this.setResizesEnabled(!1),t.setGroup$$module$build$src$core$events$utils(!0);const l=this.getTopBlocks(!0);let h=0;for(let m=0,E;E=l[m];m++){if(!E.isMovable())continue;const k=E.getRelativeToSurfaceXY();E.moveBy(-k.x,h-k.y,["cleanup"]),E.snapToGrid(),h=E.getRelativeToSurfaceXY().y+E.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}t.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(l){if(!this.options.readOnly&&!this.isFlyout){var h=Ks.registry.getContextMenuOptions(Ks.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(h,l),Zy(l,h,this.RTL)}}updateToolbox(l){if(l=It(l)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(gt(l)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=l,this.toolbox_.render(l)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=l,this.flyout.show(l)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(y(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(l,h,m){m=Math.pow(this.options.zoomOptions.scaleSpeed,m);const E=this.scale*m;if(this.scale!==E){E>this.options.zoomOptions.maxScale?m=this.options.zoomOptions.maxScale/this.scale:E<this.options.zoomOptions.minScale&&(m=this.options.zoomOptions.minScale/this.scale);var k=this.getCanvas().getCTM(),z=this.getParentSvg().createSVGPoint();z.x=l,z.y=h,z=z.matrixTransform(k.inverse()),l=z.x,h=z.y,k=k.translate(l*(1-m),h*(1-m)).scale(m),this.scrollX=k.e,this.scrollY=k.f,this.setScale(E)}}zoomCenter(l){var h=this.getMetrics();let m;this.flyout?(m=h.svgWidth?h.svgWidth/2:0,h=h.svgHeight?h.svgHeight/2:0):(m=h.viewWidth/2+h.absoluteLeft,h=h.viewHeight/2+h.absoluteTop),this.zoom(m,h,l)}zoomToFit(){if(this.isMovable()){var l=this.getMetrics(),h=l.viewWidth;l=l.viewHeight;var m=this.getBlocksBoundingBox(),E=2*jG,k=m.right-m.left+E;if(m=m.bottom-m.top+E,k){this.flyout&&(this.horizontalLayout?(l+=this.flyout.getHeight(),m+=this.flyout.getHeight()/this.scale):(h+=this.flyout.getWidth(),k+=this.flyout.getWidth()/this.scale)),h/=k,l/=m,t.disable$$module$build$src$core$events$utils();try{this.setScale(Math.min(h,l)),this.scrollCenter()}finally{t.enable$$module$build$src$core$events$utils()}this.maybeFireViewportChangeEvent()}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}beginCanvasTransition(){ke(this.getCanvas(),"blocklyCanvasTransitioning"),ke(this.getBubbleCanvas(),"blocklyCanvasTransitioning")}endCanvasTransition(){Ct(this.getCanvas(),"blocklyCanvasTransitioning"),Ct(this.getBubbleCanvas(),"blocklyCanvasTransitioning")}scrollCenter(){if(this.isMovable()){var l=this.getMetrics(),h=(l.scrollWidth-l.viewWidth)/2,m=(l.scrollHeight-l.viewHeight)/2;h=-h-l.scrollLeft,m=-m-l.scrollTop,this.scroll(h,m)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}centerOnBlock(l,h){if(this.isMovable()){var m=l?this.getBlockById(l):null;if(m){l=m.getRelativeToSurfaceXY(),m=h?{height:m.height,width:m.width}:m.getHeightWidth();var E=this.scale;h=(l.x+(this.RTL?-1:1)*m.width/2)*E,l=(l.y+m.height/2)*E,m=this.getMetrics(),this.scroll(-(h-m.viewWidth/2),-(l-m.viewHeight/2))}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}setScale(l){this.options.zoomOptions.maxScale&&l>this.options.zoomOptions.maxScale?l=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&l<this.options.zoomOptions.minScale&&(l=this.options.zoomOptions.minScale),this.scale=l,this.hideChaff(!1),(l=this.getFlyout(!1))&&l.isVisible()&&(l.reflow(),this.recordDragTargets()),this.grid&&this.grid.update(this.scale),l=this.getMetrics(),this.scrollX-=l.absoluteLeft,this.scrollY-=l.absoluteTop,l.viewLeft+=l.absoluteLeft,l.viewTop+=l.absoluteTop,this.scroll(this.scrollX,this.scrollY),this.scrollbar&&(this.flyout?this.scrollbar.resizeView(l):this.scrollbar.resizeContent(l))}getScale(){return this.options.parentWorkspace?this.options.parentWorkspace.getScale():this.scale}scroll(l,h){this.hideChaff(!0);const m=this.getMetrics();l=Math.min(l,-m.scrollLeft),h=Math.min(h,-m.scrollTop);const E=m.scrollTop+Math.max(0,m.scrollHeight-m.viewHeight);l=Math.max(l,-(m.scrollLeft+Math.max(0,m.scrollWidth-m.viewWidth))),h=Math.max(h,-E),this.scrollX=l,this.scrollY=h,this.scrollbar&&this.scrollbar.set(-(l+m.scrollLeft),-(h+m.scrollTop),!1),l+=m.absoluteLeft,h+=m.absoluteTop,this.translate(l,h)}getBlockById(l){return super.getBlockById(l)}getAllBlocks(l=!1){return super.getAllBlocks(l)}getTopBlocks(l=!1){return super.getTopBlocks(l)}addTopBlock(l){this.addTopBoundedElement(l),super.addTopBlock(l)}removeTopBlock(l){this.removeTopBoundedElement(l),super.removeTopBlock(l)}addTopComment(l){this.addTopBoundedElement(l),super.addTopComment(l)}removeTopComment(l){this.removeTopBoundedElement(l),super.removeTopComment(l)}getRootWorkspace(){return super.getRootWorkspace()}addTopBoundedElement(l){this.topBoundedElements.push(l)}removeTopBoundedElement(l){Ie(this.topBoundedElements,l)}getTopBoundedElements(){return[].concat(this.topBoundedElements)}setResizesEnabled(l){const h=!this.resizesEnabled&&l;this.resizesEnabled=l,h&&this.resizeContents()}clear(){this.setResizesEnabled(!1),super.clear(),this.topBoundedElements=[],this.setResizesEnabled(!0)}registerButtonCallback(l,h){if(typeof h!="function")throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks.set(l,h)}getButtonCallback(l){let h;return(h=this.flyoutButtonCallbacks.get(l))!=null?h:null}removeButtonCallback(l){this.flyoutButtonCallbacks.delete(l)}registerToolboxCategoryCallback(l,h){if(typeof h!="function")throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks.set(l,h)}getToolboxCategoryCallback(l){return this.toolboxCategoryCallbacks.get(l)||null}removeToolboxCategoryCallback(l){this.toolboxCategoryCallbacks.delete(l)}getGesture(l){const h=l.type==="pointerdown",m=this.currentGesture_;return m?h&&m.hasStarted()?(console.warn("Tried to start the same gesture twice."),m.cancel(),null):m:h?this.currentGesture_=new pg(l,this):null}clearGesture(){this.currentGesture_=null}cancelCurrentGesture(){this.currentGesture_&&this.currentGesture_.cancel()}getAudioManager(){return this.audioManager}getGrid(){return this.grid}hideChaff(l=!1){$h(),Wu(),Ud(),this.hideComponents(l)}hideComponents(l=!1){this.getComponentManager().getComponents(Qr.Capability.AUTOHIDEABLE,!0).forEach(h=>h.autoHide(l))}static setTopLevelWorkspaceMetrics_(l){const h=this.getMetrics();typeof l.x=="number"&&(this.scrollX=-(h.scrollLeft+(h.scrollWidth-h.viewWidth)*l.x)),typeof l.y=="number"&&(this.scrollY=-(h.scrollTop+(h.scrollHeight-h.viewHeight)*l.y)),this.translate(this.scrollX+h.absoluteLeft,this.scrollY+h.absoluteTop)}},zA=class extends Ec{constructor(l,h){super(h),this.type=iT,this.isOpen=l}toJson(){const l=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");return l.isOpen=this.isOpen,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new zA),h.isOpen=l.isOpen,h}};i(Jt.EVENT,iT,zA);var KA=class extends K_{constructor(l){if(super(l),this.type=t.DELETE$$module$build$src$core$events$utils,l){if(l.getParent())throw Error("Connected blocks cannot be deleted.");l.isShadow()&&(this.recordUndo=!1),this.oldXml=Xy(l),this.ids=Le(l),this.wasShadow=l.isShadow(),this.oldJson=Hd(l,{addCoordinates:!0})}}toJson(){const l=super.toJson();if(!this.oldXml)throw Error("The old block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(this.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");return l.oldXml=Ah(this.oldXml),l.ids=this.ids,l.wasShadow=this.wasShadow,l.oldJson=this.oldJson,this.recordUndo||(l.recordUndo=this.recordUndo),l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new KA),h.oldXml=t.textToDom$$module$build$src$core$utils$xml(l.oldXml),h.ids=l.ids,h.wasShadow=l.wasShadow||h.oldXml.tagName.toLowerCase()==="shadow",h.oldJson=l.oldJson,l.recordUndo!==void 0&&(h.recordUndo=l.recordUndo),h}run(l){const h=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(l)for(l=0;l<this.ids.length;l++){const m=this.ids[l],E=h.getBlockById(m);E?E.dispose(!1):m===this.blockId&&console.warn("Can't delete non-existent block: "+m)}else qr(this.oldJson,h)}};i(Jt.EVENT,t.DELETE$$module$build$src$core$events$utils,KA);var IT=class{constructor(l,h,m){if(this.data=null,this.disposed=!1,this.hue_=null,this.colour_="#000000",this.styleName_="",this.suppressPrefixSuffix=!1,this.previousConnection=this.nextConnection=this.outputConnection=null,this.inputList=[],this.icons=[],this.disabled=!1,this.tooltip="",this.contextMenu=!0,this.parentBlock_=null,this.childBlocks_=[],this.editable_=this.movable_=this.deletable_=!0,this.collapsed_=this.isShadow_=!1,this.outputShape_=null,this.isInsertionMarker_=this.disposing=!1,this.onchangeWrapper_=this.helpUrl=this.rendered=null,this.statementInputCount=0,this.workspace=l,this.id=m&&!l.getBlockById(m)?m:U(),l.setBlockById(this.id,this),this.xy_=new _n(0,0),this.isInFlyout=l.isFlyout,this.isInMutator=l.isMutator,this.RTL=l.RTL,h){if(this.type=h,m=ea[h],!m||typeof m!="object")throw TypeError("Invalid block definition for type: "+h);Object.assign(this,m)}l.addTopBlock(this),l.addTypedBlock(this),new.target===IT&&this.doInit_()}doInit_(){const l=t.getGroup$$module$build$src$core$events$utils();l||t.setGroup$$module$build$src$core$events$utils(!0);const h=de();try{typeof this.init=="function"&&(Q(!1),this.init(),Q(h)),ge()&&q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(this))}finally{t.setGroup$$module$build$src$core$events$utils(l),Q(h)}this.inputsInlineDefault=this.inputsInline,typeof this.onchange=="function"&&this.setOnChange(this.onchange)}dispose(l){this.isDeadOrDying()||(this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_),this.unplug(l),ge()&&q(new(Ne(t.DELETE$$module$build$src$core$events$utils))(this)),this.workspace.removeTopBlock(this),this.disposeInternal())}disposeInternal(){this.isDeadOrDying()||(this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_),this.workspace.removeTypedBlock(this),this.workspace.removeBlockById(this.id),this.disposing=!0,typeof this.destroy=="function"&&this.destroy(),this.childBlocks_.forEach(l=>l.disposeInternal()),this.inputList.forEach(l=>l.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(l=>l.dispose()),this.disposed=!0)}isDeadOrDying(){return this.disposing||this.disposed}initModel(){for(const l of this.inputList)for(const h of l.fieldRow)h.initModel&&h.initModel()}unplug(l){this.outputConnection&&this.unplugFromRow_(l),this.previousConnection&&this.unplugFromStack_(l)}unplugFromRow_(l){let h=null,m;(m=this.outputConnection)!=null&&m.isConnected()&&(h=this.outputConnection.targetConnection,this.outputConnection.disconnect()),h&&l&&(l=this.getOnlyValueConnection_())&&l.isConnected()&&!l.targetBlock().isShadow()&&(l=l.targetConnection,l==null||l.disconnect(),this.workspace.connectionChecker.canConnect(l,h,!1)?h.connect(l):l==null||l.onFailedConnect(h))}getOnlyValueConnection_(){let l=null;for(let h=0;h<this.inputList.length;h++){const m=this.inputList[h].connection;if(m&&m.type===Pn.INPUT_VALUE&&m.targetConnection){if(l)return null;l=m}}return l}unplugFromStack_(l){let h=null;var m;if((m=this.previousConnection)!=null&&m.isConnected()&&(h=this.previousConnection.targetConnection,this.previousConnection.disconnect()),m=this.getNextBlock(),l&&m&&!m.isShadow()){let E,k;l=(k=(E=this.nextConnection)==null?void 0:E.targetConnection)!=null?k:null,l==null||l.disconnect(),h&&this.workspace.connectionChecker.canConnect(h,l,!1)&&h.connect(l)}}getConnections_(l){l=[],this.outputConnection&&l.push(this.outputConnection),this.previousConnection&&l.push(this.previousConnection),this.nextConnection&&l.push(this.nextConnection);for(let h=0,m;m=this.inputList[h];h++)m.connection&&l.push(m.connection);return l}lastConnectionInStack(l){let h=this.nextConnection;for(;h;){const m=h.targetBlock();if(!m||l&&m.isShadow())return h;h=m.nextConnection}return null}bumpNeighbours(){}getParent(){return this.parentBlock_}getInputWithBlock(l){for(let h=0,m;m=this.inputList[h];h++)if(m.connection&&m.connection.targetBlock()===l)return m;return null}getSurroundParent(){let l=this,h;do if(h=l,l=l.getParent(),!l)return null;while(l.getNextBlock()===h);return l}getNextBlock(){return this.nextConnection&&this.nextConnection.targetBlock()}getPreviousBlock(){return this.previousConnection&&this.previousConnection.targetBlock()}getRootBlock(){let l,h=this;do l=h,h=l.parentBlock_;while(h);return l}getTopStackBlock(){let l=this,h;do h=l.getPreviousBlock();while(h&&h.getNextBlock()===l&&(l=h));return l}getChildren(l){if(!l)return this.childBlocks_;l=[];for(let m=0,E;E=this.inputList[m];m++)if(E.connection){var h=E.connection.targetBlock();h&&l.push(h)}return(h=this.getNextBlock())&&l.push(h),l}setParent(l){if(l!==this.parentBlock_){var h=this.previousConnection&&this.previousConnection.targetBlock()||this.outputConnection&&this.outputConnection.targetBlock(),m=!!h;if(m&&l&&h!==l)throw Error("Block connected to superior one that is not new parent.");if(!m&&l)throw Error("Block not connected to new parent.");if(m&&!l)throw Error("Cannot set parent to null while block is still connected to superior block.");this.parentBlock_?Ie(this.parentBlock_.childBlocks_,this):this.workspace.removeTopBlock(this),(this.parentBlock_=l)?l.childBlocks_.push(this):this.workspace.addTopBlock(this)}}getDescendants(l){const h=[this],m=this.getChildren(l);for(let E,k=0;E=m[k];k++)h.push(...E.getDescendants(l));return h}isDeletable(){return this.deletable_&&!this.isShadow_&&!this.isDeadOrDying()&&!this.workspace.options.readOnly}isOwnDeletable(){return this.deletable_}setDeletable(l){this.deletable_=l}isMovable(){return this.movable_&&!this.isShadow_&&!this.isDeadOrDying()&&!this.workspace.options.readOnly}isOwnMovable(){return this.movable_}setMovable(l){this.movable_=l}isDuplicatable(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(N(this,!0)):!0}isShadow(){return this.isShadow_}setShadow(l){this.isShadow_=l}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(l){this.isInsertionMarker_=l}isEditable(){return this.editable_&&!this.isDeadOrDying()&&!this.workspace.options.readOnly}isOwnEditable(){return this.editable_}setEditable(l){this.editable_=l;for(let h=0,m;m=this.inputList[h];h++)for(let E=0,k;k=m.fieldRow[E];E++)k.updateEditable()}isDisposed(){return this.disposed}isSimpleReporter(){if(!this.outputConnection)return!1;for(const l of this.inputList)if(l.connection||1<l.fieldRow.length)return!1;return!0}getMatchingConnection(l,h){const m=this.getConnections_(!0);if(l=l.getConnections_(!0),m.length!==l.length)throw Error("Connection lists did not match in length.");for(let E=0;E<l.length;E++)if(l[E]===h)return m[E];return null}setHelpUrl(l){this.helpUrl=l}setTooltip(l){this.tooltip=l}getTooltip(){return Gu(this)}getColour(){return this.colour_}getStyleName(){return this.styleName_}getHue(){return this.hue_}setColour(l){l=Ph(l),this.hue_=l.hue,this.colour_=l.hex}setStyle(l){this.styleName_=l}setOnChange(l){if(l&&typeof l!="function")throw Error("onchange must be a function.");this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_),this.onchange=l,this.onchangeWrapper_=l.bind(this),this.workspace.addChangeListener(this.onchangeWrapper_)}getField(l){if(typeof l!="string")throw TypeError("Block.prototype.getField expects a string with the field name but received "+(l===void 0?"nothing":l+" of type "+typeof l)+" instead");for(let h=0,m;m=this.inputList[h];h++)for(let E=0,k;k=m.fieldRow[E];E++)if(k.name===l)return k;return null}getVars(){const l=[];for(let h=0,m;m=this.inputList[h];h++)for(let E=0,k;k=m.fieldRow[E];E++)k.referencesVariables()&&l.push(k.getValue());return l}getVarModels(){const l=[];for(let h=0,m;m=this.inputList[h];h++)for(let E=0,k;k=m.fieldRow[E];E++)if(k.referencesVariables()){const z=this.workspace.getVariableById(k.getValue());z&&l.push(z)}return l}updateVarName(l){for(let h=0,m;m=this.inputList[h];h++)for(let E=0,k;k=m.fieldRow[E];E++)k.referencesVariables()&&l.getId()===k.getValue()&&k.refreshVariableName()}renameVarById(l,h){for(let m=0,E;E=this.inputList[m];m++)for(let k=0,z;z=E.fieldRow[k];k++)z.referencesVariables()&&l===z.getValue()&&z.setValue(h)}getFieldValue(l){return(l=this.getField(l))?l.getValue():null}setFieldValue(l,h){const m=this.getField(h);if(!m)throw Error('Field "'+h+'" not found.');m.setValue(l)}setPreviousStatement(l,h){if(l)h===void 0&&(h=null),this.previousConnection||(this.previousConnection=this.makeConnection_(Pn.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(h);else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.previousConnection.dispose(),this.previousConnection=null}}setNextStatement(l,h){if(l)h===void 0&&(h=null),this.nextConnection||(this.nextConnection=this.makeConnection_(Pn.NEXT_STATEMENT)),this.nextConnection.setCheck(h);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");this.nextConnection.dispose(),this.nextConnection=null}}setOutput(l,h){if(l)h===void 0&&(h=null),this.outputConnection||(this.outputConnection=this.makeConnection_(Pn.OUTPUT_VALUE)),this.outputConnection.setCheck(h);else if(this.outputConnection){if(this.outputConnection.isConnected())throw Error("Must disconnect output value before removing connection.");this.outputConnection.dispose(),this.outputConnection=null}}setInputsInline(l){this.inputsInline!==l&&(q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this,"inline",null,this.inputsInline,l)),this.inputsInline=l)}getInputsInline(){if(this.inputsInline!==void 0)return this.inputsInline;for(var l=1;l<this.inputList.length;l++)if(this.inputList[l-1]instanceof ef&&this.inputList[l]instanceof ef)return!1;for(l=1;l<this.inputList.length;l++)if(this.inputList[l-1]instanceof t.ValueInput$$module$build$src$core$inputs$value_input&&this.inputList[l]instanceof ef)return!0;for(l=0;l<this.inputList.length;l++)if(this.inputList[l]instanceof _g)return!0;return!1}setOutputShape(l){this.outputShape_=l}getOutputShape(){return this.outputShape_}isEnabled(){return!this.disabled}setEnabled(l){if(this.isEnabled()!==l){const h=this.disabled;this.disabled=!l,q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this,"disabled",null,h,!l))}}getInheritedDisabled(){let l=this.getSurroundParent();for(;l;){if(l.disabled)return!0;l=l.getSurroundParent()}return!1}isCollapsed(){return this.collapsed_}setCollapsed(l){this.collapsed_!==l&&(q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this,"collapsed",null,this.collapsed_,l)),this.collapsed_=l)}toString(l,h){h=this.toTokens(h);for(let E=2;E<h.length;E++)h[E-2]==="("&&h[E]===")"&&(h[E-2]=h[E-1],h.splice(E-1,2));let m="";return h=h.reduce((E,k)=>(E=E+(m==="("||k===")"?"":" ")+k,m=k[k.length-1],E),""),h=h.trim()||"???",l&&h.length>l&&(h=h.substring(0,l-3)+"..."),h}toTokens(l="?"){const h=[];for(const E of this.inputList)if(E.name!=ev){for(const k of E.fieldRow)h.push(k.getText());if(E.connection){const k=E.connection.targetBlock();if(k){var m=E.connection;let z=m.getCheck();!z&&m.targetConnection&&(z=m.targetConnection.getCheck()),(m=!!z&&(z.indexOf("Boolean")!==-1||z.indexOf("Number")!==-1))&&h.push("("),h.push(...k.toTokens(l)),m&&h.push(")")}else h.push(l)}}return h}appendValueInput(l){return this.appendInput(new t.ValueInput$$module$build$src$core$inputs$value_input(l,this))}appendStatementInput(l){return this.statementInputCount++,this.appendInput(new kc(l,this))}appendDummyInput(l=""){return this.appendInput(new ef(l,this))}appendEndRowInput(l=""){return this.appendInput(new _g(l,this))}appendInput(l){return this.inputList.push(l),l}appendInputFromRegistry(l,h){return(l=c(Jt.INPUT,l,!1))?this.appendInput(new l(h,this)):null}jsonInit(l){var h=l.type?'Block "'+l.type+'": ':"";if(l.output&&l.previousStatement)throw Error(h+"Must not have both an output and a previousStatement.");for(var m=0;l["args"+m];){if(l["message"+m]===void 0)throw Error(h+`args${m} must have a corresponding message (message${m}).`);m++}if(l.style&&l.style.hat&&(this.hat=l.style.hat,l.style=null),l.style&&l.colour)throw Error(h+"Must not have both a colour and a style.");for(l.style?this.jsonInitStyle_(l,h):this.jsonInitColour_(l,h),m=0;l["message"+m]!==void 0;)this.interpolate_(l["message"+m],l["args"+m]||[],l["implicitAlign"+m]||l["lastDummyAlign"+m],h),m++;if(l.inputsInline!==void 0&&(t.disable$$module$build$src$core$events$utils(),this.setInputsInline(l.inputsInline),t.enable$$module$build$src$core$events$utils()),l.output!==void 0&&this.setOutput(!0,l.output),l.outputShape!==void 0&&this.setOutputShape(l.outputShape),l.previousStatement!==void 0&&this.setPreviousStatement(!0,l.previousStatement),l.nextStatement!==void 0&&this.setNextStatement(!0,l.nextStatement),l.tooltip!==void 0&&(m=Tr(l.tooltip),this.setTooltip(m)),l.enableContextMenu!==void 0&&(this.contextMenu=!!l.enableContextMenu),l.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!l.suppressPrefixSuffix),l.helpUrl!==void 0&&(m=Tr(l.helpUrl),this.setHelpUrl(m)),typeof l.extensions=="string"&&(console.warn(h+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+l.type+"' block."),l.extensions=[l.extensions]),l.mutator!==void 0&&wI(l.mutator,this,!0),l=l.extensions,Array.isArray(l))for(h=0;h<l.length;h++)wI(l[h],this,!1)}jsonInitColour_(l,h){if("colour"in l)if(l.colour===void 0)console.warn(h+"Undefined colour value.");else{l=l.colour;try{this.setColour(l)}catch{console.warn(h+"Illegal colour value: ",l)}}}jsonInitStyle_(l,h){l=l.style;try{this.setStyle(l)}catch{console.warn(h+"Style does not exist: ",l)}}mixin(l,h){if(h!==void 0&&typeof h!="boolean")throw Error("opt_disableCheck must be a boolean if provided");if(!h){h=[];for(const m in l)this[m]!==void 0&&h.push(m);if(h.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(h))}Object.assign(this,l)}interpolate_(l,h,m,E){l=bk(l),this.validateTokens_(l,h.length),h=this.interpolateArguments_(l,h,m),m=[];for(let k=0,z;z=h[k];k++)if(this.isInputKeyword_(z.type)){if(l=this.inputFromJson_(z,E)){for(let Oe=0,Je;Je=m[Oe];Oe++)l.appendField(Je[0],Je[1]);m.length=0}}else(l=this.fieldFromJson_(z))&&m.push([l,z.name])}validateTokens_(l,h){const m=[];let E=0;for(let k=0;k<l.length;k++){const z=l[k];if(typeof z=="number"){if(1>z||z>h)throw Error('Block "'+this.type+'": Message index %'+z+" out of range.");if(m[z])throw Error('Block "'+this.type+'": Message index %'+z+" duplicated.");m[z]=!0,E++}}if(E!==h)throw Error('Block "'+this.type+'": Message does not reference all '+h+" arg(s).")}interpolateArguments_(l,h,m){const E=[];for(let z=0;z<l.length;z++){var k=l[z];if(typeof k=="number"&&(k=h[k-1]),typeof k=="string"){if(k===`
- `)k={type:"input_end_row"},m&&(k.align=m);else if(k=this.stringToFieldJson_(k),!k)continue}E.push(k)}return(l=E.length)&&!this.isInputKeyword_(E[l-1].type)&&(l={type:"input_dummy"},m&&(l.align=m),E.push(l)),E}fieldFromJson_(l){const h=t.fromJson$$module$build$src$core$field_registry(l);return!h&&l.alt?typeof l.alt=="string"?(l=this.stringToFieldJson_(l.alt))?this.fieldFromJson_(l):null:this.fieldFromJson_(l.alt):h}inputFromJson_(l,h){var m={LEFT:t.Align$$module$build$src$core$inputs$align.LEFT,RIGHT:t.Align$$module$build$src$core$inputs$align.RIGHT,CENTRE:t.Align$$module$build$src$core$inputs$align.CENTRE,CENTER:t.Align$$module$build$src$core$inputs$align.CENTRE};let E;switch(l.type){case"input_value":E=this.appendValueInput(l.name);break;case"input_statement":E=this.appendStatementInput(l.name);break;case"input_dummy":E=this.appendDummyInput(l.name);break;case"input_end_row":E=this.appendEndRowInput(l.name);break;default:E=this.appendInputFromRegistry(l.type,l.name)}return E?(l.check&&E.setCheck(l.check),l.align&&(m=m[l.align.toUpperCase()],m===void 0?console.warn(h+"Illegal align value: ",l.align):E.setAlign(m)),E):null}isInputKeyword_(l){return l==="input_value"||l==="input_statement"||l==="input_dummy"||l==="input_end_row"||a(Jt.INPUT,l)}stringToFieldJson_(l){return(l=l.trim())?{type:"field_label",text:l}:null}moveInputBefore(l,h){if(l!==h){var m=-1,E=h?-1:this.inputList.length;for(let k=0,z;z=this.inputList[k];k++)if(z.name===l){if(m=k,E!==-1)break}else if(h&&z.name===h&&(E=k,m!==-1))break;if(m===-1)throw Error('Named input "'+l+'" not found.');if(E===-1)throw Error('Reference input "'+h+'" not found.');this.moveNumberedInputBefore(m,E)}}moveNumberedInputBefore(l,h){if(l===h)throw Error("Can't move input to itself.");if(l>=this.inputList.length)throw RangeError("Input index "+l+" out of bounds.");if(h>this.inputList.length)throw RangeError("Reference input "+h+" out of bounds.");const m=this.inputList[l];this.inputList.splice(l,1),l<h&&h--,this.inputList.splice(h,0,m)}removeInput(l,h){for(let m=0,E;E=this.inputList[m];m++)if(E.name===l)return E instanceof kc&&this.statementInputCount--,E.dispose(),this.inputList.splice(m,1),!0;if(h)return!1;throw Error("Input not found: "+l)}getInput(l){for(let h=0,m;m=this.inputList[h];h++)if(m.name===l)return m;return null}getInputTargetBlock(l){return(l=this.getInput(l))&&l.connection&&l.connection.targetBlock()}getCommentText(){let l,h;return(h=(l=this.getIcon(qa.TYPE))==null?void 0:l.getText())!=null?h:null}setCommentText(l){var h;let m;const E=(m=(h=this.getIcon(qa.TYPE))==null?void 0:h.getText())!=null?m:null;E!==l&&(l!==null?((h=this.getIcon(qa.TYPE))||(h=this.addIcon(new qa(this))),t.disable$$module$build$src$core$events$utils(),h.setText(l),t.enable$$module$build$src$core$events$utils()):this.removeIcon(qa.TYPE),q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this,"comment",null,E,l)))}setWarningText(l,h){}setMutator(l){}addIcon(l){if(this.hasIcon(l.getType()))throw new DA(l);return this.icons.push(l),this.icons.sort((h,m)=>h.getWeight()-m.getWeight()),l}removeIcon(l){if(!this.hasIcon(l))return!1;let h;return(h=this.getIcon(l))==null||h.dispose(),this.icons=this.icons.filter(m=>!m.getType().equals(l)),!0}hasIcon(l){return this.icons.some(h=>h.getType().equals(l))}getIcon(l){return l instanceof wc?this.icons.find(h=>h.getType().equals(l)):this.icons.find(h=>h.getType().toString()===l)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy_}moveBy(l,h,m){if(this.parentBlock_)throw Error("Block has parent");const E=new(Ne(t.MOVE$$module$build$src$core$events$utils))(this);m&&E.setReason(m),this.xy_.translate(l,h),E.recordNew(),q(E)}makeConnection_(l){return new Ns(this,l)}allInputsFilled(l){if(l===void 0&&(l=!0),!l&&this.isShadow())return!1;for(let m=0,E;E=this.inputList[m];m++)if(E.connection){var h=E.connection.targetBlock();if(!h||!h.allInputsFilled(l))return!1}return(h=this.getNextBlock())?h.allInputsFilled(l):!0}toDevString(){let l=this.type?'"'+this.type+'" block':"Block";return this.id&&(l+=' (id="'+this.id+'")'),l}};IT.COLLAPSED_INPUT_NAME=ev,IT.COLLAPSED_FIELD_NAME=ML;var RB=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(l){this.drawer=l}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(l){const h=this.curNode;this.curNode=l,this.drawer&&this.drawer.draw(h,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},jA=class extends RB{constructor(){super(),this.type="cursor"}next(){var l=this.getCurNode();if(!l)return null;for(l=l.next();l&&l.next()&&(l.getType()===nn.types.NEXT||l.getType()===nn.types.BLOCK);)l=l.next();return l&&this.setCurNode(l),l}in(){var l=this.getCurNode();if(!l)return null;(l.getType()===nn.types.PREVIOUS||l.getType()===nn.types.OUTPUT)&&(l=l.next());let h,m;return(l=(m=(h=l)==null?void 0:h.in())!=null?m:null)&&this.setCurNode(l),l}prev(){var l=this.getCurNode();if(!l)return null;for(l=l.prev();l&&l.prev()&&(l.getType()===nn.types.NEXT||l.getType()===nn.types.BLOCK);)l=l.prev();return l&&this.setCurNode(l),l}out(){var l=this.getCurNode();return l?((l=l.out())&&l.getType()===nn.types.BLOCK&&(l=l.prev()||l),l&&this.setCurNode(l),l):null}};i(Jt.CURSOR,Uh,jA);var ZE=class extends jA{constructor(){super()}next(){var l=this.getCurNode();return l?((l=this.getNextNode_(l,this.validNode_))&&this.setCurNode(l),l):null}in(){return this.next()}prev(){var l=this.getCurNode();return l?((l=this.getPreviousNode_(l,this.validNode_))&&this.setCurNode(l),l):null}out(){return this.prev()}getNextNode_(l,h){if(!l)return null;const m=l.in()||l.next();return h(m)?m:m?this.getNextNode_(m,h):(l=this.findSiblingOrParent(l.out()),h(l)?l:l?this.getNextNode_(l,h):null)}getPreviousNode_(l,h){if(!l)return null;let m=l.prev();return m=m?this.getRightMostChild(m):l.out(),h(m)?m:m?this.getPreviousNode_(m,h):null}validNode_(l){let h=!1;return l=l&&l.getType(),(l===nn.types.OUTPUT||l===nn.types.INPUT||l===nn.types.FIELD||l===nn.types.NEXT||l===nn.types.PREVIOUS||l===nn.types.WORKSPACE)&&(h=!0),h}findSiblingOrParent(l){if(!l)return null;const h=l.next();return h||this.findSiblingOrParent(l.out())}getRightMostChild(l){if(!l.in())return l;for(l=l.in();l&&l.next();)l=l.next();return this.getRightMostChild(l)}};ZE.registrationName="basicCursor",i(Jt.CURSOR,ZE.registrationName,ZE);var MB=class extends ZE{validNode_(l){let h=!1;const m=l&&l.getType();return l&&(l=l.getLocation(),m===nn.types.FIELD&&l&&l.isTabNavigable()&&l.isClickable()&&(h=!0)),h}},XA=10,Ac=class extends Ns{constructor(l,h){super(l,h),this.highlighted=!1,this.targetConnection=null,this.db=l.workspace.connectionDBList[h],this.dbOpposite=l.workspace.connectionDBList[gg[h]],this.offsetInBlock=new _n(0,0),this.trackedState=Ac.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===Ac.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let l,h;(h=(l=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||h.call(l,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(l){const h=this.x-l.x;return l=this.y-l.y,Math.sqrt(h*h+l*l)}bumpAwayFrom(l){if(!this.sourceBlock_.workspace.isDragging()){var h=this.sourceBlock_.getRootBlock();if(!h.isInFlyout){var m=!1;if(!h.isMovable()){if(h=l.getSourceBlock().getRootBlock(),!h.isMovable())return;l=this,m=!0}var E=w()==h;E||h.addSelect();var k=l.x+t.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*XA)-this.x,z=l.y+t.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*XA)-this.y;m&&(z=-z),h.RTL&&(k=l.x-t.config$$module$build$src$core$config.snapRadius-Math.floor(Math.random()*XA)-this.x),h.moveBy(k,z,["bump"]),E||h.removeSelect()}}}moveTo(l,h){let m=!1;return this.trackedState===Ac.TrackedState.WILL_TRACK?(this.db.addConnection(this,h),this.trackedState=Ac.TrackedState.TRACKED,m=!0):this.trackedState===Ac.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,h),m=!0),this.x=l,this.y=h,m}moveBy(l,h){return this.moveTo(this.x+l,this.y+h)}moveToOffset(l){return this.moveTo(l.x+this.offsetInBlock.x,l.y+this.offsetInBlock.y)}setOffsetInBlock(l,h){this.offsetInBlock.x=l,this.offsetInBlock.y=h}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var l=this.targetConnection;const h=this.targetBlock();l&&h&&(l=_n.difference(this.offsetInBlock,l.offsetInBlock),h.translate(l.x,l.y))}closest(l,h){return this.dbOpposite.searchForClosest(this,l,h)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(l){l&&this.trackedState===Ac.TrackedState.TRACKED||!l&&this.trackedState===Ac.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(l?(this.db.addConnection(this,this.y),this.trackedState=Ac.TrackedState.TRACKED):(this.trackedState===Ac.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=Ac.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const l=this.targetBlock().getDescendants(!1);for(let h=0;h<l.length;h++){const m=l[h],E=m.getConnections_(!0);for(let k=0;k<E.length;k++)E[k].setTracking(!1);for(const k of m.getIcons())Lp(k)&&k.setBubbleVisible(!1)}}}startTrackingAll(){this.setTracking(!0);let l=[];if(this.type!==Pn.INPUT_VALUE&&this.type!==Pn.NEXT_STATEMENT)return l;const h=this.targetBlock();if(h){let m;h.isCollapsed()?(m=[],h.outputConnection&&m.push(h.outputConnection),h.nextConnection&&m.push(h.nextConnection),h.previousConnection&&m.push(h.previousConnection)):m=h.getConnections_(!0);for(let E=0;E<m.length;E++)l.push(...m[E].startTrackingAll());l.length||(l=[h])}return l}onFailedConnect(l){const h=this.getSourceBlock();if(de()){const m=t.getGroup$$module$build$src$core$events$utils();setTimeout((function(){h.isDisposed()||h.getParent()||(t.setGroup$$module$build$src$core$events$utils(m),this.bumpAwayFrom(l),t.setGroup$$module$build$src$core$events$utils(!1))}).bind(this),t.config$$module$build$src$core$config.bumpDelay)}}disconnectInternal(l=!0){const{parentConnection:h,childConnection:m}=this.getParentAndChildConnections();if(h&&m){var E=h.getSourceBlock(),k=m.getSourceBlock();super.disconnectInternal(l),E.rendered&&E.queueRender(),k.rendered&&(k.updateDisabled(),k.queueRender(),k.getSvgRoot().style.display="block")}}respawnShadow_(){super.respawnShadow_();const l=this.targetBlock();l&&(l.initSvg(),l.queueRender())}neighbours(l){return this.dbOpposite.getNeighbours(this,l)}connect_(l){super.connect_(l);var h=this.getSourceBlock();l=l.getSourceBlock();const m=h.rendered,E=l.rendered;m&&h.updateDisabled(),E&&l.updateDisabled(),m&&E&&(this.type===Pn.NEXT_STATEMENT||this.type===Pn.PREVIOUS_STATEMENT?l.queueRender():h.queueRender()),(h=h.getInputWithBlock(l))&&(h=h.isVisible(),l.getSvgRoot().style.display=h?"block":"none")}onCheckChanged_(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours())}setCheck(l){return super.setCheck(l),this.sourceBlock_.rendered&&this.sourceBlock_.queueRender(),this}};(function(l){l=l.TrackedState||(l.TrackedState={}),l[l.WILL_TRACK=-1]="WILL_TRACK",l[l.UNTRACKED=0]="UNTRACKED",l[l.TRACKED=1]="TRACKED"})(Ac),Ac.TrackedState;var tf=class extends IT{constructor(l,h,m){super(l,h,m),this.width=this.height=0,this.warningTextDb=new Map,this.warning=this.mutator=null,this.eventsInit_=this.renderIsInProgress_=this.visuallyDisabled=this.rendered=!1,this.translation="",this.bumpNeighboursPid=0,this.dragging=!1,this.relativeCoords=new _n(0,0),this.workspace=l,this.svgGroup_=He(pt.G,{}),this.style=l.getRenderer().getConstants().getBlockStyle(null),this.pathObject=l.getRenderer().makePathObject(this.svgGroup_,this.style),l=this.pathObject.svgPath,l.tooltip=this,Yb(l),this.svgGroup_.setAttribute("data-id",this.id),this.doInit_()}initSvg(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");for(let h=0,m;m=this.inputList[h];h++)m.init();for(var l of this.getIcons())l.initView(this.createIconPointerDownListener(l)),l.updateEditable();this.applyColour(),this.pathObject.updateMovable(this.isMovable()),l=this.getSvgRoot(),this.workspace.options.readOnly||this.eventsInit_||!l||ee(l,"pointerdown",this,this.onMouseDown_),this.eventsInit_=!0,l.parentNode||this.workspace.getCanvas().appendChild(l)}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){if(this.isShadow()&&this.getParent())this.getParent().select();else if(w()!==this){var l=null;if(w()){l=w().id,t.disable$$module$build$src$core$events$utils();try{w().unselect()}finally{t.enable$$module$build$src$core$events$utils()}}l=new(Ne(ug))(l,this.id,this.workspace.id),q(l),I(this),this.addSelect()}}unselect(){if(w()===this){var l=new(Ne(ug))(this.id,null,this.workspace.id);l.workspaceId=this.workspace.id,q(l),I(null),this.removeSelect()}}setParent(l){const h=this.parentBlock_;if(l!==h){le(),super.setParent(l),Fe();var m=this.getSvgRoot();if(!this.workspace.isClearing&&m){var E=this.getRelativeToSurfaceXY();l?l.getSvgRoot().appendChild(m):h&&((l=this.workspace.getCanvas().querySelector(".blocklyDragging"))?this.workspace.getCanvas().insertBefore(m,l):this.workspace.getCanvas().appendChild(m),this.translate(E.x,E.y)),this.applyColour()}}}getRelativeToSurfaceXY(){const l=this.workspace.getLayerManager();if(!l)throw Error("Cannot calculate position because the workspace has not been appended");let h=0,m=0,E=this.getSvgRoot();if(E)do{const k=xe(E);h+=k.x,m+=k.y,E=E.parentNode}while(E&&!l.hasLayer(E));return new _n(h,m)}moveBy(l,h,m){if(this.parentBlock_)throw Error("Block has parent");const E=ge();let k=null;E&&(k=new(Ne(t.MOVE$$module$build$src$core$events$utils))(this),m&&k.setReason(m)),l=new _n(l,h),h=this.getRelativeToSurfaceXY(),l=_n.sum(h,l),this.translate(l.x,l.y),this.updateComponentLocations(l),E&&k&&(k.recordNew(),q(k)),this.workspace.resizeContents()}translate(l,h){this.translation=`translate(${l}, ${h})`,this.relativeCoords=new _n(l,h),this.getSvgRoot().setAttribute("transform",this.getTranslation())}getTranslation(){return this.translation}moveTo(l,h){const m=this.getRelativeToSurfaceXY();this.moveBy(l.x-m.x,l.y-m.y,h)}moveDuringDrag(l){this.translate(l.x,l.y),this.getSvgRoot().setAttribute("transform",this.getTranslation()),this.updateComponentLocations(l)}snapToGrid(){if(!(this.isDeadOrDying()||this.workspace.isDragging()||this.getParent()||this.isInFlyout)){var l=this.workspace.getGrid();if(l&&l.shouldSnap()){var h=l.getSpacing(),m=h/2,E=this.getRelativeToSurfaceXY();l=Math.round(Math.round((E.x-m)/h)*h+m-E.x),h=Math.round(Math.round((E.y-m)/h)*h+m-E.y),(l||h)&&this.moveBy(l,h,["snap"])}}}getBoundingRectangle(){const l=this.getRelativeToSurfaceXY(),h=this.getHeightWidth();let m,E;return this.RTL?(m=l.x-h.width,E=l.x):(m=l.x,E=l.x+h.width),new lo(l.y,l.y+h.height,m,E)}markDirty(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(let l=0,h;h=this.inputList[l];l++)h.markDirty()}setCollapsed(l){this.collapsed_!==l&&(super.setCollapsed(l),this.updateCollapsed_())}updateCollapsed_(){var l=this.isCollapsed();const h=ev,m=ML;for(let k=0,z;z=this.inputList[k];k++)z.name!==h&&z.setVisible(!l);for(var E of this.getIcons())E.updateCollapsed();l?(l=this.toString(wA),(E=this.getField(m))?E.setValue(l):(this.getInput(h)||this.appendDummyInput(h)).appendField(new ar(l),m)):(this.updateDisabled(),this.removeInput(h))}tab(l,h){const m=new MB;m.setCurNode(nn.createFieldNode(l)),l=m.getCurNode(),h?m.next():m.prev(),(h=m.getCurNode())&&h!==l&&(h.getLocation().showEditor(),this.workspace.keyboardAccessibilityMode&&this.workspace.getCursor().setCurNode(h))}onMouseDown_(l){const h=this.workspace.getGesture(l);h&&h.handleBlockStart(l,this)}showHelp(){const l=typeof this.helpUrl=="function"?this.helpUrl():this.helpUrl;l&&window.open(l)}generateContextMenu(){if(this.workspace.options.readOnly||!this.contextMenu)return null;const l=Ks.registry.getContextMenuOptions(Ks.ScopeType.BLOCK,{block:this});return this.customContextMenu&&this.customContextMenu(l),l}showContextMenu(l){const h=this.generateContextMenu();h&&h.length&&(Zy(l,h,this.RTL),rk(this))}updateComponentLocations(l){if(this.rendered){this.dragging||this.updateConnectionLocations(l),this.updateIconLocations(l),this.updateFieldLocations(l);for(const h of this.getChildren(!1))h.updateComponentLocations(_n.sum(l,h.relativeCoords))}}updateConnectionLocations(l){for(const h of this.getConnections_(!1))h.moveToOffset(l)}updateIconLocations(l){for(const h of this.getIcons())h.onLocationChange(l)}updateFieldLocations(l){for(const h of this.inputList)for(const m of h.fieldRow)m.onLocationChange(l)}setDragging(l){(this.dragging=l)?(this.translation="",lu.push(...this.getConnections_(!0)),ke(this.svgGroup_,"blocklyDragging")):(lu.length=0,Ct(this.svgGroup_,"blocklyDragging"));for(let h=0;h<this.childBlocks_.length;h++)this.childBlocks_[h].setDragging(l)}setMovable(l){super.setMovable(l),this.pathObject.updateMovable(l)}setEditable(l){super.setEditable(l),l=this.getIcons();for(let h=0;h<l.length;h++)l[h].updateEditable()}setShadow(l){super.setShadow(l),this.applyColour()}setInsertionMarker(l){this.isInsertionMarker_!==l&&(this.isInsertionMarker_=l)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))}getSvgRoot(){return this.svgGroup_}dispose(l,h){this.isDeadOrDying()||(pk(),Pb(),h&&this.rendered&&(this.unplug(l),Ub(this)),super.dispose(!!l),Ot(this.svgGroup_))}disposeInternal(){this.isDeadOrDying()||(super.disposeInternal(),this.rendered=!1,w()===this&&(this.unselect(),this.workspace.cancelCurrentGesture()),[...this.warningTextDb.values()].forEach(l=>clearTimeout(l)),this.warningTextDb.clear(),this.getIcons().forEach(l=>l.dispose()))}checkAndDelete(){this.workspace.isFlyout||(t.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),t.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:uT.TYPE,blockState:Hd(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:N(this,!0)}}applyColour(){this.pathObject.applyColour(this);const l=this.getIcons();for(let h=0;h<l.length;h++)l[h].applyColour();for(let h=0,m;m=this.inputList[h];h++)for(let E=0,k;k=m.fieldRow[E];E++)k.applyColour()}updateDisabled(){const l=!this.isEnabled()||this.getInheritedDisabled();if(this.visuallyDisabled===l){let h;(h=this.getNextBlock())==null||h.updateDisabled()}else{this.applyColour(),this.visuallyDisabled=l;for(const h of this.getChildren(!1))h.updateDisabled()}}getCommentIcon(){Tt("getCommentIcon","v10","v11","getIcon");let l;return(l=this.getIcon(qa.TYPE))!=null?l:null}setWarningText(l,h=""){if(h)this.warningTextDb.has(h)&&(clearTimeout(this.warningTextDb.get(h)),this.warningTextDb.delete(h));else{for(var m of this.warningTextDb.values())clearTimeout(m);this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(h,setTimeout(()=>{this.isDeadOrDying()||(this.warningTextDb.delete(h),this.setWarningText(l,h))},100));else if(this.isInFlyout&&(l=null),m=this.getIcon(qd.TYPE),l){let E=this.getSurroundParent(),k=null;for(;E;)E.isCollapsed()&&(k=E),E=E.getSurroundParent();k&&k.setWarningText(t.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,tf.COLLAPSED_WARNING_ID),m?m.addMessage(l,h):this.addIcon(new qd(this).addMessage(l,h))}else m&&(h?(m.addMessage("",h),m.getText()||this.removeIcon(qd.TYPE)):this.removeIcon(qd.TYPE))}setMutator(l){this.removeIcon(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),l&&this.addIcon(l)}addIcon(l){return super.addIcon(l),l instanceof qd&&(this.warning=l),l instanceof t.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=l),this.rendered&&(l.initView(this.createIconPointerDownListener(l)),l.applyColour(),l.updateEditable(),this.queueRender(),wa(),this.bumpNeighbours()),l}createIconPointerDownListener(l){return h=>{this.isDeadOrDying()||(h=this.workspace.getGesture(h))&&h.setStartIcon(l)}}removeIcon(l){const h=super.removeIcon(l);return l.equals(qd.TYPE)&&(this.warning=null),l.equals(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.rendered&&(this.queueRender(),wa(),this.bumpNeighbours()),h}setEnabled(l){this.isEnabled()!==l&&(super.setEnabled(l),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())}setHighlighted(l){this.rendered&&this.pathObject.updateHighlighted(l)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(l){this.pathObject.updateDraggingDelete(l)}getColour(){return this.style.colourPrimary}setColour(l){super.setColour(l),l=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(l.style),this.style=l.style,this.styleName_=l.name,this.applyColour()}setStyle(l){const h=this.workspace.getRenderer().getConstants().getBlockStyle(l);if(this.styleName_=l,h)this.hat=h.hat,this.pathObject.setStyle(h),this.colour_=h.colourPrimary,this.style=h,this.applyColour();else throw Error("Invalid style name: "+l)}bringToFront(l=!1){let h=this;if(!h.isDeadOrDying())do{const m=h.getSvgRoot(),E=m.parentNode,k=E.childNodes;if(k[k.length-1]!==m&&E.appendChild(m),l)break;h=h.getParent()}while(h)}setPreviousStatement(l,h){super.setPreviousStatement(l,h),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setNextStatement(l,h){super.setNextStatement(l,h),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setOutput(l,h){super.setOutput(l,h),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setInputsInline(l){super.setInputsInline(l),this.rendered&&(this.queueRender(),this.bumpNeighbours())}removeInput(l,h){return l=super.removeInput(l,h),this.rendered&&(this.queueRender(),this.bumpNeighbours()),l}moveNumberedInputBefore(l,h){super.moveNumberedInputBefore(l,h),this.rendered&&(this.queueRender(),this.bumpNeighbours())}appendInput(l){return super.appendInput(l),this.rendered&&(this.queueRender(),this.bumpNeighbours()),l}setConnectionTracking(l){if(this.previousConnection&&this.previousConnection.setTracking(l),this.outputConnection&&this.outputConnection.setTracking(l),this.nextConnection){this.nextConnection.setTracking(l);var h=this.nextConnection.targetBlock();h&&h.setConnectionTracking(l)}if(!this.collapsed_)for(h=0;h<this.inputList.length;h++){var m=this.inputList[h].connection;m&&(m.setTracking(l),(m=m.targetBlock())&&m.setConnectionTracking(l))}}getConnections_(l){const h=[];if((l||this.rendered)&&(this.outputConnection&&h.push(this.outputConnection),this.previousConnection&&h.push(this.previousConnection),this.nextConnection&&h.push(this.nextConnection),l||!this.collapsed_))for(let m=0,E;E=this.inputList[m];m++)E.connection&&h.push(E.connection);return h}lastConnectionInStack(l){return super.lastConnectionInStack(l)}getMatchingConnection(l,h){return super.getMatchingConnection(l,h)}makeConnection_(l){return new Ac(this,l)}getNextBlock(){return super.getNextBlock()}getPreviousBlock(){return super.getPreviousBlock()}bumpNeighbours(){if(!this.bumpNeighboursPid){var l=t.getGroup$$module$build$src$core$events$utils();this.bumpNeighboursPid=setTimeout(()=>{const h=t.getGroup$$module$build$src$core$events$utils();t.setGroup$$module$build$src$core$events$utils(l),this.getRootBlock().bumpNeighboursInternal(),t.setGroup$$module$build$src$core$events$utils(h),this.bumpNeighboursPid=0},t.config$$module$build$src$core$config.bumpDelay)}}bumpNeighboursInternal(){const l=this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||l.isInFlyout))for(const h of this.getConnections_(!1)){if(h.isSuperior()){let m;(m=h.targetBlock())==null||m.bumpNeighboursInternal()}for(const m of h.neighbours(t.config$$module$build$src$core$config.snapRadius))m.getSourceBlock().getRootBlock()!==l&&(h.isConnected()&&m.isConnected()||(h.isSuperior()?m.bumpAwayFrom(h):h.bumpAwayFrom(m)))}}scheduleSnapAndBump(){const l=t.getGroup$$module$build$src$core$events$utils();setTimeout(()=>{t.setGroup$$module$build$src$core$events$utils(l),this.snapToGrid(),t.setGroup$$module$build$src$core$events$utils(!1)},t.config$$module$build$src$core$config.bumpDelay/2),this.bumpNeighbours()}positionNearConnection(l,h,m){if(l.type===Pn.NEXT_STATEMENT||l.type===Pn.INPUT_VALUE){let E=h.x;h=h.y,E+=m.x-l.getOffsetInBlock().x,h+=m.y-l.getOffsetInBlock().y,this.moveBy(E,h)}}getChildren(l){return super.getChildren(l)}queueRender(){return jy(this)}render(){this.queueRender(),wa()}renderEfficiently(){this.rendered=!0,le(),this.isCollapsed()&&this.updateCollapsed_(),this.isEnabled()||this.updateDisabled(),this.workspace.getRenderer().render(this),this.tightenChildrenEfficiently(),Fe(),this.updateMarkers_()}tightenChildrenEfficiently(){for(const l of this.inputList){const h=l.connection;h&&h.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}updateMarkers_(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw(),this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(Ya.LOCAL_MARKER).draw();for(const l of this.inputList)for(const h of l.fieldRow)h.updateMarkers_()}setCursorSvg(l){this.pathObject.setCursorSvg(l)}setMarkerSvg(l){this.pathObject.setMarkerSvg(l)}getHeightWidth(){let l=this.height,h=this.width;var m=this.getNextBlock();if(m){m=m.getHeightWidth();const E=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;l+=m.height-E,h=Math.max(h,m.width)}return{height:l,width:h}}fadeForReplacement(l){this.pathObject.updateReplacementFade(l)}highlightShapeForInput(l,h){this.pathObject.updateShapeForInputHighlight(l,h)}};tf.INLINE=-1,tf.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var kB=class{constructor(){}onDragEnter(l){}onDragOver(l){}onDragExit(l){}onDrop(l){}getClientRect(){return null}shouldPreventMove(l){return!1}},kL=class extends kB{constructor(){super(),this.wouldDelete_=!1}wouldDelete(l,h){return l instanceof tf?(l=!l.getParent()&&l.isDeletable(),this.updateWouldDelete_(l&&!h)):this.updateWouldDelete_(l.isDeletable()),this.wouldDelete_}updateWouldDelete_(l){this.wouldDelete_=l}},AB=class extends kL{constructor(l){super(),this.workspace=l,this.id="trashcan",this.contents=[],this.flyout=null,this.isLidOpen=!1,this.minOpenness=0,this.lidTask=this.svgLid=this.svgGroup=null,this.top=this.left=this.lidOpen=0,this.initialized=!1,0>=this.workspace.options.maxTrashcanContents||(l=new Jo({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(l.toolboxPosition=this.workspace.toolboxPosition===Fi.TOP?Fi.BOTTOM:Fi.TOP,this.flyout=new(f(Jt.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(l)):(l.toolboxPosition=this.workspace.toolboxPosition===Fi.RIGHT?Fi.LEFT:Fi.RIGHT,this.flyout=new(f(Jt.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(l)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=He(pt.G,{class:"blocklyTrash"});let l;const h=String(Math.random()).substring(2);l=He(pt.CLIPPATH,{id:"blocklyTrashBodyClipPath"+h},this.svgGroup),He(pt.RECT,{width:LT,height:AL,y:OT},l);const m=He(pt.IMAGE,{width:Xa.width,x:-YA,height:Xa.height,y:-qA,"clip-path":"url(#blocklyTrashBodyClipPath"+h+")"},this.svgGroup);return m.setAttributeNS(cu,"xlink:href",this.workspace.options.pathToMedia+Xa.url),l=He(pt.CLIPPATH,{id:"blocklyTrashLidClipPath"+h},this.svgGroup),He(pt.RECT,{width:LT,height:OT},l),this.svgLid=He(pt.IMAGE,{width:Xa.width,x:-YA,height:Xa.height,y:-qA,"clip-path":"url(#blocklyTrashLidClipPath"+h+")"},this.svgGroup),this.svgLid.setAttributeNS(cu,"xlink:href",this.workspace.options.pathToMedia+Xa.url),ye(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),ye(this.svgGroup,"pointerup",this,this.click),ye(m,"pointerover",this,this.mouseOver),ye(m,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0<this.workspace.options.maxTrashcanContents&&(En(this.flyout.createDom(pt.SVG),this.workspace.getParentSvg()),this.flyout.init(this.workspace)),this.workspace.getComponentManager().addComponent({component:this,weight:1,capabilities:[Qr.Capability.AUTOHIDEABLE,Qr.Capability.DELETE_AREA,Qr.Capability.DRAG_TARGET,Qr.Capability.POSITIONABLE]}),this.initialized=!0,this.setLidOpen(!1)}dispose(){this.workspace.getComponentManager().removeComponent("trashcan"),this.svgGroup&&Ot(this.svgGroup),this.lidTask&&clearTimeout(this.lidTask)}hasContents(){return!!this.contents.length}contentsIsOpen(){return!!this.flyout&&this.flyout.isVisible()}openFlyout(){if(!this.contentsIsOpen()){var l=this.contents.map(function(m){return JSON.parse(m)}),h=this.workspace.getParentSvg().style;h.cursor="wait",setTimeout(()=>{let m;(m=this.flyout)==null||m.show(l),h.cursor="";let E;(E=this.workspace.scrollbar)==null||E.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var l;(l=this.flyout)==null||l.hide();var h;(h=this.workspace.scrollbar)==null||h.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(l){!l&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(l,h){if(this.initialized){var m=gl(this.workspace,l);l=go(m,new ko(LT,AL+OT),NB,NL,l,this.workspace),h=vo(l,NL,m.vertical===ja.TOP?fg.DOWN:fg.UP,h),this.top=h.top,this.left=h.left;var E;(E=this.svgGroup)==null||E.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new lo(this.top,this.top+AL+OT,this.left,this.left+LT)}getClientRect(){if(!this.svgGroup)return null;var l=this.svgGroup.getBoundingClientRect();const h=l.top+qA-eS;return l=l.left+YA-eS,new lo(h,h+OT+AL+2*eS,l,l+LT+2*eS)}onDragOver(l){this.setLidOpen(this.wouldDelete_)}onDragExit(l){this.setLidOpen(!1)}onDrop(l){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(l){this.isLidOpen!==l&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=l,this.animateLid())}animateLid(){const l=YG;var h=1/(l+1);this.lidOpen+=this.isLidOpen?h:-h,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Ja),h=DB+this.lidOpen*(qG-DB),this.svgGroup&&(this.svgGroup.style.opacity=`${h}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),JA/l))}setLidAngle(l){const h=this.workspace.toolboxPosition===Fi.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let m;(m=this.svgLid)==null||m.setAttribute("transform","rotate("+(h?-l:l)+","+(h?4:LT-4)+","+(OT-2)+")")}setMinOpenness(l){this.minOpenness=l,this.isLidOpen||this.setLidAngle(l*Ja)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(l){l=new(Ne(iT))(l,this.workspace.id),q(l)}blockMouseDownWhenOpenable(l){!this.contentsIsOpen()&&this.hasContents()&&l.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(l){if(!(0>=this.workspace.options.maxTrashcanContents||l.type!==t.DELETE$$module$build$src$core$events$utils||l.type!==t.DELETE$$module$build$src$core$events$utils||l.wasShadow)){if(!l.oldJson)throw Error("Encountered a delete event without proper oldJson");if(l=JSON.stringify(this.cleanBlockJson(l.oldJson)),this.contents.indexOf(l)===-1){for(this.contents.unshift(l);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(XG)}}}cleanBlockJson(l){function h(m){if(m){if(delete m.id,delete m.x,delete m.y,delete m.enabled,m.icons&&m.icons.comment){var E=m.icons.comment;delete E.height,delete E.width,delete E.pinned}E=m.inputs;for(var k in E){var z=E[k];const Oe=z.block;z=z.shadow,Oe&&h(Oe),z&&h(z)}m.next&&(k=m.next,m=k.block,k=k.shadow,m&&h(m),k&&h(k))}}return l=JSON.parse(JSON.stringify(l)),h(l),Object.assign({},{kind:"BLOCK"},l)}},LT=47,AL=44,OT=16,NL=20,NB=20,eS=10,YA=0,qA=32,XG=.1,JA=80,YG=4,DB=.4,qG=.8,Ja=45,Bs=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(l,h){if(this.shortcuts.get(l.name)&&!h)throw Error(`Shortcut named "${l.name}" already exists.`);if(this.shortcuts.set(l.name,l),(h=l.keyCodes)&&0<h.length)for(let m=0;m<h.length;m++)this.addKeyMapping(h[m],l.name,!!l.allowCollision)}unregister(l){return this.shortcuts.get(l)?(this.removeAllKeyMappings(l),this.shortcuts.delete(l),!0):(console.warn(`Keyboard shortcut named "${l}" not found.`),!1)}addKeyMapping(l,h,m){l=`${l}`;const E=this.keyMap.get(l);if(E&&!m)throw Error(`Shortcut named "${h}" collides with shortcuts "${E}"`);E&&m?E.unshift(h):this.keyMap.set(l,[h])}removeKeyMapping(l,h,m){const E=this.keyMap.get(l);if(!E)return m||console.warn(`No keyboard shortcut named "${h}" registered with key code "${l}"`),!1;const k=E.indexOf(h);return-1<k?(E.splice(k,1),E.length===0&&this.keyMap.delete(l),!0):(m||console.warn(`No keyboard shortcut named "${h}" registered with key code "${l}"`),!1)}removeAllKeyMappings(l){for(const h of this.keyMap.keys())this.removeKeyMapping(h,l,!0)}setKeyMap(l){this.keyMap.clear();for(const h in l)this.keyMap.set(h,l[h])}getKeyMap(){const l=Object.create(null);for(const[h,m]of this.keyMap)l[h]=m;return l}getRegistry(){const l=Object.create(null);for(const[h,m]of this.shortcuts)l[h]=m;return xh(Object.create(null),l)}onKeyDown(l,h){var m=this.serializeKeyEvent_(h);if(m=this.getShortcutNamesByKeyCode(m),!m)return!1;for(let E=0,k;k=m[E];E++){const z=this.shortcuts.get(k);let Oe,Je;if((Oe=z)==null||!Oe.preconditionFn||(Je=z)!=null&&Je.preconditionFn(l)){let Ht,kn;if((Ht=z)!=null&&Ht.callback&&((kn=z)!=null&&kn.callback(l,h,z)))return!0}}return!1}getShortcutNamesByKeyCode(l){return this.keyMap.get(l)||[]}getKeyCodesByShortcutName(l){const h=[];for(const[m,E]of this.keyMap)-1<E.indexOf(l)&&h.push(m);return h}serializeKeyEvent_(l){let h="";for(const m in Bs.modifierKeys)l.getModifierState(m)&&(h!==""&&(h+="+"),h+=m);return h!==""&&l.keyCode?h=h+"+"+l.keyCode:l.keyCode&&(h=String(l.keyCode)),h}checkModifiers_(l){for(let h=0,m;m=l[h];h++)if(!(m in Bs.modifierKeys))throw Error(m+" is not a valid modifier key.")}createSerializedKey(l,h){let m="";if(h){this.checkModifiers_(h);for(const E in Bs.modifierKeys)-1<h.indexOf(Bs.modifierKeys[E])&&(m!==""&&(m+="+"),m+=E)}return m!==""&&l?m=m+"+"+l:l&&(m=`${l}`),m}};Bs.registry=new Bs,function(l){l=l.modifierKeys||(l.modifierKeys={}),l[l.Shift=16]="Shift",l[l.Control=17]="Control",l[l.Alt=18]="Alt",l[l.Meta=91]="Meta"}(Bs);var nf;(function(l){l.ESCAPE="escape",l.DELETE="delete",l.COPY="copy",l.CUT="cut",l.PASTE="paste",l.UNDO="undo",l.REDO="redo"})(nf||(nf={}));var tS=null,DL=null;Zb();var sf={};sf.names=nf,sf.registerCopy=ml,sf.registerCut=fE,sf.registerDefaultShortcuts=Zb,sf.registerDelete=AI,sf.registerEscape=Ok,sf.registerPaste=NI,sf.registerRedo=gE,sf.registerUndo=Xu;var QA=class{constructor(l,h){this.procedureModelClass=l,this.parameterModelClass=h,this.priority=sB}save(l){return l=l.getProcedureMap().getProcedures().map(h=>ag(h)),l.length?l:null}load(l,h){const m=h.getProcedureMap();for(const E of l)m.add(Zl(this.procedureModelClass,this.parameterModelClass,E,h))}clear(l){l.getProcedureMap().clear()}},RT={};RT.ProcedureSerializer=QA,RT.loadParameter=pE,RT.loadProcedure=Zl,RT.saveParameter=DI,RT.saveProcedure=ag;var $L=class{constructor(){this.priority=iB}save(l){const h=[];for(const m of l.getAllVariables())l={name:m.name,id:m.getId()},m.type&&(l.type=m.type),h.push(l);return h.length?h:null}load(l,h){for(const m of l)h.createVariable(m.name,m.type,m.id)}clear(l){l.getVariableMap().clear()}};Db("variables",new $L);var $B={};$B.VariableSerializer=$L;var ZA={};ZA.load=D2,ZA.save=N2;var JG={blocks:$E,exceptions:z_,priorities:DG,procedures:RT,registry:uA,variables:$B,workspaces:ZA},eN=class{constructor(l,h,m,E,k){this.workspace=l,this.oldHostMetrics_=this.corner_=this.vScroll=this.hScroll=null,h=h===void 0?!0:h,m=m===void 0?!0:m;const z=h&&m;h&&(this.hScroll=new kr(l,!0,z,E,k)),m&&(this.vScroll=new kr(l,!1,z,E,k)),z&&(this.corner_=He(pt.RECT,{height:kr.scrollbarThickness,width:kr.scrollbarThickness,class:"blocklyScrollbarBackground"}),En(this.corner_,l.getBubbleCanvas()))}dispose(){Ot(this.corner_),this.oldHostMetrics_=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const l=this.workspace.getMetrics();if(l){var h=!1,m=!1;if(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===l.viewWidth&&this.oldHostMetrics_.viewHeight===l.viewHeight&&this.oldHostMetrics_.absoluteTop===l.absoluteTop&&this.oldHostMetrics_.absoluteLeft===l.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth===l.scrollWidth&&this.oldHostMetrics_.viewLeft===l.viewLeft&&this.oldHostMetrics_.scrollLeft===l.scrollLeft||(h=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight===l.scrollHeight&&this.oldHostMetrics_.viewTop===l.viewTop&&this.oldHostMetrics_.scrollTop===l.scrollTop||(m=!0)):m=h=!0,h||m){try{t.disable$$module$build$src$core$events$utils(),this.hScroll&&h&&this.hScroll.resize(l),this.vScroll&&m&&this.vScroll.resize(l)}finally{t.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics_||this.oldHostMetrics_.viewWidth!==l.viewWidth||this.oldHostMetrics_.absoluteLeft!==l.absoluteLeft){let E;(E=this.corner_)==null||E.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics_||this.oldHostMetrics_.viewHeight!==l.viewHeight||this.oldHostMetrics_.absoluteTop!==l.absoluteTop){let E;(E=this.corner_)==null||E.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics_=l}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(l,h){this.hScroll&&this.hScroll.setOrigin(l,h),this.vScroll&&this.vScroll.setOrigin(l,h)}set(l,h,m){this.hScroll&&this.hScroll.set(l,!1),this.vScroll&&this.vScroll.set(h,!1),(m||m===void 0)&&(l={},this.hScroll&&(l.x=this.hScroll.getRatio_()),this.vScroll&&(l.y=this.vScroll.getRatio_()),this.workspace.setMetrics(l))}setX(l){this.hScroll&&this.hScroll.set(l,!0)}setY(l){this.vScroll&&this.vScroll.set(l,!0)}setContainerVisible(l){this.hScroll&&this.hScroll.setContainerVisible(l),this.vScroll&&this.vScroll.setContainerVisible(l)}isVisible(){let l=!1;return this.hScroll&&(l=this.hScroll.isVisible()),this.vScroll&&(l=l||this.vScroll.isVisible()),l}setVisible(l){this.hScroll&&this.hScroll.setVisibleInternal(l),this.vScroll&&this.vScroll.setVisibleInternal(l)}resizeContent(l){this.hScroll&&this.hScroll.resizeContentHorizontal(l),this.vScroll&&this.vScroll.resizeContentVertical(l)}resizeView(l){this.hScroll&&this.hScroll.resizeViewHorizontal(l),this.vScroll&&this.vScroll.resizeViewVertical(l)}},xL=class{constructor(l){this.workspace_=l}getDimensionsPx_(l){let h=0,m=0;return l&&(h=l.getWidth(),m=l.getHeight()),new ko(h,m)}getFlyoutMetrics(l){return l=this.getDimensionsPx_(this.workspace_.getFlyout(l)),{width:l.width,height:l.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const l=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:l.width,height:l.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let l=0,h=0;const m=this.getToolboxMetrics(),E=this.getFlyoutMetrics(),k=!!this.workspace_.getToolbox();var z;const Oe=!((z=this.workspace_.getFlyout())!=null&&z.autoClose);z=k?m.position:E.position;const Je=z===Fi.TOP;return z===Fi.LEFT&&(k&&(l+=m.width),Oe&&(l+=E.width)),Je&&(k&&(h+=m.height),Oe&&(h+=E.height)),{top:h,left:l}}getViewMetrics(l){l=l?this.workspace_.scale:1;const h=this.getSvgMetrics(),m=this.getToolboxMetrics(),E=this.getFlyoutMetrics(),k=!!this.workspace_.getToolbox();var z;const Oe=!((z=this.workspace_.getFlyout())!=null&&z.autoClose);z=k?m.position:E.position;const Je=z===Fi.LEFT||z===Fi.RIGHT;return(z===Fi.TOP||z===Fi.BOTTOM)&&(k&&(h.height-=m.height),Oe&&(h.height-=E.height)),Je&&(k&&(h.width-=m.width),Oe&&(h.width-=E.width)),{height:h.height/l,width:h.width/l,top:-this.workspace_.scrollY/l,left:-this.workspace_.scrollX/l}}getContentMetrics(l){l=l?1:this.workspace_.scale;const h=this.workspace_.getBlocksBoundingBox();return{height:(h.bottom-h.top)*l,width:(h.right-h.left)*l,top:h.top*l,left:h.left*l}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(l){if(!this.hasFixedEdges())return{};const h=this.workspace_.isMovableHorizontally(),m=this.workspace_.isMovableVertically();l=l||this.getViewMetrics(!1);const E={};return m||(E.top=l.top,E.bottom=l.top+l.height),h||(E.left=l.left,E.right=l.left+l.width),E}getPaddedContent_(l,h){const m=h.top+h.height,E=h.left+h.width,k=l.width;l=l.height;const z=k/2,Oe=l/2;return{top:Math.min(h.top-Oe,m-l),bottom:Math.max(m+Oe,h.top+l),left:Math.min(h.left-z,E-k),right:Math.max(E+z,h.left+k)}}getScrollMetrics(l,h,m){l=l?this.workspace_.scale:1,h=h||this.getViewMetrics(!1);var E=m||this.getContentMetrics();m=this.getComputedFixedEdges_(h),h=this.getPaddedContent_(h,E),E=m.top!==void 0?m.top:h.top;const k=m.left!==void 0?m.left:h.left;return{top:E/l,left:k/l,width:((m.right!==void 0?m.right:h.right)-k)/l,height:((m.bottom!==void 0?m.bottom:h.bottom)-E)/l}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const l=this.getToolboxMetrics(),h=this.getFlyoutMetrics(!0),m=this.getSvgMetrics(),E=this.getAbsoluteMetrics(),k=this.getViewMetrics(),z=this.getContentMetrics(),Oe=this.getScrollMetrics(!1,k,z);return{contentHeight:z.height,contentWidth:z.width,contentTop:z.top,contentLeft:z.left,scrollHeight:Oe.height,scrollWidth:Oe.width,scrollTop:Oe.top,scrollLeft:Oe.left,viewHeight:k.height,viewWidth:k.width,viewTop:k.top,viewLeft:k.left,absoluteTop:E.top,absoluteLeft:E.left,svgHeight:m.height,svgWidth:m.width,toolboxWidth:l.width,toolboxHeight:l.height,toolboxPosition:l.position,flyoutWidth:h.width,flyoutHeight:h.height}}};i(Jt.METRICS_MANAGER,Uh,xL);var xB=class extends zd{constructor(l){super(),this.isBlank=!0,this.recordUndo=!1,this.type=qu,this.isBlank=!!l,l&&(this.workspaceId=l.id)}};i(Jt.EVENT,qu,xB);var tN=class extends Ec{constructor(l,h,m){super(l?l.workspace.id:void 0),this.type=D_,l&&(this.blockId=l.id,this.isStart=h,this.blocks=m)}toJson(){const l=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return l.isStart=this.isStart,l.blockId=this.blockId,l.blocks=this.blocks,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new tN),h.isStart=l.isStart,h.blockId=l.blockId,h.blocks=l.blocks,h}};i(Jt.EVENT,D_,tN);var PL={};PL.bumpIntoBounds=eT,PL.bumpIntoBoundsHandler=mE,PL.bumpTopObjectsIntoBounds=kp;var FL=class{constructor(l,h){this.connectionCandidate=this.dragTarget_=null,this.wouldDeleteBlock_=!1,this.dragIconData_=[],this.draggingBlock_=l,this.workspace_=h,this.connectionPreviewer=new(f(Jt.CONNECTION_PREVIEWER,this.workspace_.options))(l),this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY(),this.dragIconData_=$I(l,this.startXY_)}dispose(){this.dragIconData_.length=0,this.connectionPreviewer.dispose()}startDrag(l,h){t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent_(),this.draggingBlock_.bringToFront(!0),le(),this.workspace_.setResizesEnabled(!1),Gb(),this.shouldDisconnect_(h)&&this.disconnectBlock_(h,l),this.draggingBlock_.setDragging(!0);let m;(m=this.workspace_.getLayerManager())==null||m.moveToDragLayer(this.draggingBlock_)}shouldDisconnect_(l){return!!(this.draggingBlock_.getParent()||l&&this.draggingBlock_.nextConnection&&this.draggingBlock_.nextConnection.targetBlock())}disconnectBlock_(l,h){this.draggingBlock_.unplug(l),l=this.pixelsToWorkspaceUnits_(h),l=_n.sum(this.startXY_,l),this.draggingBlock_.translate(l.x,l.y),yI(this.draggingBlock_)}fireDragStartEvent_(){const l=new(Ne(D_))(this.draggingBlock_,!0,this.draggingBlock_.getDescendants(!1));q(l)}drag(l,h){const m=this.draggingBlock_;this.moveBlock(m,h),this.updateDragTargets(l,m),this.wouldDeleteBlock_=this.wouldDeleteBlock(l,m,h),this.updateCursorDuringBlockDrag_(),this.updateConnectionPreview(m,h)}moveBlock(l,h){h=this.pixelsToWorkspaceUnits_(h),h=_n.sum(this.startXY_,h),l.moveDuringDrag(h)}updateDragTargets(l,h){if(l=this.workspace_.getDragTarget(l),this.dragTarget_!==l){let m;(m=this.dragTarget_)==null||m.onDragExit(h),l==null||l.onDragEnter(h)}l==null||l.onDragOver(h),this.dragTarget_=l}wouldDeleteBlock(l,h,m){return(l=this.workspace_.getDragTarget(l))&&this.workspace_.getComponentManager().hasCapability(l.id,Qr.Capability.DELETE_AREA)?l.wouldDelete(h,!!this.getConnectionCandidate(h,m)):!1}updateConnectionPreview(l,h){h=this.pixelsToWorkspaceUnits_(h);const m=this.connectionCandidate,E=this.getConnectionCandidate(l,h);if(E){this.connectionCandidate=h=m&&this.currCandidateIsBetter(m,h,E)?m:E;var{local:k,neighbour:z}=h;k.type!==Pn.OUTPUT_VALUE&&k.type!==Pn.PREVIOUS_STATEMENT||!z.isConnected()||z.targetBlock().isInsertionMarker()||this.orphanCanConnectAtEnd(l,z.targetBlock(),k.type)?this.connectionPreviewer.previewConnection(k,z):this.connectionPreviewer.previewReplacement(k,z,z.targetBlock())}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(l,h,m){return!!Ns.getConnectionForOrphanedConnection(l,m===Pn.OUTPUT_VALUE?h.outputConnection:h.previousConnection)}currCandidateIsBetter(l,h,m){const{local:E,neighbour:k}=l;l=new _n(E.x,E.y);const z=new _n(k.x,k.y);return h=_n.distance(_n.sum(l,h),z),m.distance>h-t.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(l,h){l=this.getLocalConnections(l);let m=this.connectionCandidate?t.config$$module$build$src$core$config.connectingSnapRadius:t.config$$module$build$src$core$config.snapRadius,E=null;for(const k of l){const{connection:z,radius:Oe}=k.closest(m,h);z&&(E={local:k,neighbour:z,distance:Oe},m=Oe)}return E}getLocalConnections(l){const h=l.getConnections_(!1),m=l.lastConnectionInStack(!0);return m&&m!==l.nextConnection&&h.push(m),h}endDrag(l,h){if(this.drag(l,h),this.fireDragEndEvent_(),Fe(),Gb(),this.connectionPreviewer.hidePreview(),l=null,this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBlock_)||(l=this.getNewLocationAfterDrag_(h).delta),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBlock_),!this.maybeDeleteBlock_()){let m;(m=this.workspace_.getLayerManager())==null||m.moveOffDragLayer(this.draggingBlock_,SA),this.draggingBlock_.setDragging(!1),l?this.updateBlockAfterMove_():eT(this.draggingBlock_.workspace,this.workspace_.getMetricsManager().getScrollMetrics(!0),this.draggingBlock_)}this.connectionPreviewer.dispose(),this.workspace_.setResizesEnabled(!0),t.setGroup$$module$build$src$core$events$utils(!1)}getNewLocationAfterDrag_(l){l=this.pixelsToWorkspaceUnits_(l);const h=_n.sum(this.startXY_,l);return{delta:l,newLocation:h}}maybeDeleteBlock_(){return this.wouldDeleteBlock_?(this.fireMoveEvent_(),this.draggingBlock_.dispose(!1,!0),lu.length=0,!0):!1}updateBlockAfterMove_(){this.fireMoveEvent_(),this.connectionCandidate?this.applyConnections(this.connectionCandidate):this.draggingBlock_.queueRender(),this.draggingBlock_.scheduleSnapAndBump()}applyConnections(l){const{local:h,neighbour:m}=l;if(h.connect(m),this.draggingBlock_.rendered){const E=h.isSuperior()?m:h,k=this.draggingBlock_.getRootBlock();tg().then(()=>{CI(E.getSourceBlock()),setTimeout(()=>{k.bringToFront()},0)})}}fireDragEndEvent_(){const l=new(Ne(D_))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));q(l)}updateToolboxStyle_(l){const h=this.workspace_.getToolbox();if(h){const m=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";l&&typeof h.removeStyle=="function"?h.removeStyle(m):l||typeof h.addStyle!="function"||h.addStyle(m)}}fireMoveEvent_(){if(!this.draggingBlock_.isDeadOrDying()){var l=new(Ne(t.MOVE$$module$build$src$core$events$utils))(this.draggingBlock_);l.setReason(["drag"]),l.oldCoordinate=this.startXY_,l.recordNew(),q(l)}}updateCursorDuringBlockDrag_(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)}pixelsToWorkspaceUnits_(l){return l=new _n(l.x/this.workspace_.scale,l.y/this.workspace_.scale),this.workspace_.isMutator&&l.scale(1/this.workspace_.options.parentWorkspace.scale),l}dragIcons_(){Tt("Blockly.BlockDragger.prototype.dragIcons_","v10","v11")}getInsertionMarkers(){return this.workspace_.getAllBlocks().filter(l=>l.isInsertionMarker())}};i(Jt.BLOCK_DRAGGER,Uh,FL);var iv={};iv.Bubble=js,iv.MiniWorkspaceBubble=mg,iv.TextBubble=ET,iv.TextInputBubble=Mc;var nN=class extends K_{constructor(l,h,m,E){super(l),this.type=Np,this.recordUndo=!1,l&&(this.name=h,this.oldValue=m,this.newValue=E)}toJson(){const l=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return l.name=this.name,l.oldValue=this.oldValue,l.newValue=this.newValue,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new nN),h.name=l.name,h.oldValue=l.oldValue,h.newValue=l.newValue,h}isNull(){return this.oldValue===this.newValue}run(l){var h=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(h=h.getBlockById(this.blockId),!h)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");l=l?this.newValue:this.oldValue,(h=h.getField(this.name))?h.setValue(l):console.warn("Can't set non-existent field: "+this.name)}};i(Jt.EVENT,Np,nN);var iN=class extends K_{constructor(l){super(l),this.type=t.MOVE$$module$build$src$core$events$utils,l&&(l.isShadow()&&(this.recordUndo=!1),l=this.currentLocation_(),this.oldParentId=l.parentId,this.oldInputName=l.inputName,this.oldCoordinate=l.coordinate)}toJson(){const l=super.toJson();return l.oldParentId=this.oldParentId,l.oldInputName=this.oldInputName,this.oldCoordinate&&(l.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),l.newParentId=this.newParentId,l.newInputName=this.newInputName,this.newCoordinate&&(l.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(l.reason=this.reason),this.recordUndo||(l.recordUndo=this.recordUndo),l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new iN),h.oldParentId=l.oldParentId,h.oldInputName=l.oldInputName,l.oldCoordinate&&(m=l.oldCoordinate.split(","),h.oldCoordinate=new _n(Number(m[0]),Number(m[1]))),h.newParentId=l.newParentId,h.newInputName=l.newInputName,l.newCoordinate&&(m=l.newCoordinate.split(","),h.newCoordinate=new _n(Number(m[0]),Number(m[1]))),l.reason!==void 0&&(h.reason=l.reason),l.recordUndo!==void 0&&(h.recordUndo=l.recordUndo),h}recordNew(){const l=this.currentLocation_();this.newParentId=l.parentId,this.newInputName=l.inputName,this.newCoordinate=l.coordinate}setReason(l){this.reason=l}currentLocation_(){var l=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var h=l.getBlockById(this.blockId);if(!h)throw Error("The block associated with the block move event could not be found");l={};const m=h.getParent();return m?(l.parentId=m.id,(h=m.getInputWithBlock(h))&&(l.inputName=h.name)):l.coordinate=h.getRelativeToSurfaceXY(),l}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&_n.equals(this.oldCoordinate,this.newCoordinate)}run(l){var h=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var m=h.getBlockById(this.blockId);if(m){var E=l?this.newParentId:this.oldParentId,k=l?this.newInputName:this.oldInputName;if(l=l?this.newCoordinate:this.oldCoordinate,E){var z=h.getBlockById(E);if(!z){console.warn("Can't connect to non-existent block: "+E);return}}if(m.getParent()&&m.unplug(),l)k=m.getRelativeToSurfaceXY(),m.moveBy(l.x-k.x,l.y-k.y,this.reason);else{h=m.outputConnection,(!h||m.previousConnection&&m.previousConnection.isConnected())&&(h=m.previousConnection);let Oe,Je;m=(Je=h)==null?void 0:Je.type,k?(m=z.getInput(k))&&(Oe=m.connection):m===Pn.PREVIOUS_STATEMENT&&(Oe=z.nextConnection),Oe&&h?h.connect(Oe):console.warn("Can't connect to non-existent input: "+k)}}else console.warn("Can't move non-existent block: "+this.blockId)}};i(Jt.EVENT,t.MOVE$$module$build$src$core$events$utils,iN);var sN=class extends Ec{constructor(l,h,m){super(l?l.workspace.id:void 0),this.type=Gd,l&&(this.blockId=l.id,this.isOpen=h,this.bubbleType=m)}toJson(){const l=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return l.isOpen=this.isOpen,l.bubbleType=this.bubbleType,l.blockId=this.blockId||"",l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new sN),h.isOpen=l.isOpen,h.bubbleType=l.bubbleType,h.blockId=l.blockId,h}},oN;(function(l){l.MUTATOR="mutator",l.COMMENT="comment",l.WARNING="warning"})(oN||(oN={})),i(Jt.EVENT,Gd,sN);var Wp=class extends zd{constructor(l){super(),this.isBlank=!l,l&&(this.commentId=l.id,this.workspaceId=l.workspace.id,this.group=t.getGroup$$module$build$src$core$events$utils(),this.recordUndo=de())}toJson(){const l=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return l.commentId=this.commentId,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new Wp),h.commentId=l.commentId,h}static CommentCreateDeleteHelper(l,h){var m=l.getEventWorkspace_();if(h){if(h=t.createElement$$module$build$src$core$utils$xml("xml"),!l.xml)throw Error("Ecountered a comment event without proper xml");h.appendChild(l.xml),t.domToWorkspace$$module$build$src$core$xml(h,m)}else{if(!l.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(m=m.getCommentById(l.commentId))?m.dispose():console.warn("Can't uncreate non-existent comment: "+l.commentId)}}},rN=class extends Wp{constructor(l,h,m){super(l),this.type=sT,l&&(this.oldContents_=typeof h>"u"?"":h,this.newContents_=typeof m>"u"?"":m)}toJson(){const l=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return l.oldContents=this.oldContents_,l.newContents=this.newContents_,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new rN),h.oldContents_=l.oldContents,h.newContents_=l.newContents,h}isNull(){return this.oldContents_===this.newContents_}run(l){var h=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(h=h.getCommentById(this.commentId)){var m=l?this.newContents_:this.oldContents_;if(!m)throw Error(l?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");h.setContent(m)}else console.warn("Can't change non-existent comment: "+this.commentId)}};i(Jt.EVENT,sT,rN);var lN=class extends Wp{constructor(l){super(l),this.type=ta,l&&(this.xml=l.toXmlWithXY())}toJson(){const l=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return l.xml=Ah(this.xml),l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new lN),h.xml=t.textToDom$$module$build$src$core$utils$xml(l.xml),h}run(l){Wp.CommentCreateDeleteHelper(this,l)}};i(Jt.EVENT,ta,lN);var aN=class extends Wp{constructor(l){super(l),this.type=F_,l&&(this.xml=l.toXmlWithXY())}run(l){Wp.CommentCreateDeleteHelper(this,!l)}toJson(){const l=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return l.xml=Ah(this.xml),l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new aN),h.xml=t.textToDom$$module$build$src$core$utils$xml(l.xml),h}};i(Jt.EVENT,F_,aN);var cN=class extends Wp{constructor(l){super(l),this.type=au,l&&(this.comment_=l,this.oldCoordinate_=l.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setOldCoordinate(l){this.oldCoordinate_=l}toJson(){const l=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return l.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,l.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new cN),m=l.oldCoordinate.split(","),h.oldCoordinate_=new _n(Number(m[0]),Number(m[1])),m=l.newCoordinate.split(","),h.newCoordinate_=new _n(Number(m[0]),Number(m[1])),h}isNull(){return _n.equals(this.oldCoordinate_,this.newCoordinate_)}run(l){var h=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(h=h.getCommentById(this.commentId)){if(l=l?this.newCoordinate_:this.oldCoordinate_,!l)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");var m=h.getRelativeToSurfaceXY();h.moveBy(l.x-m.x,l.y-m.y)}else console.warn("Can't move non-existent comment: "+this.commentId)}};i(Jt.EVENT,au,cN);var uN=class extends Ec{constructor(l,h,m){super(m),this.type=x_,this.oldItem=l??void 0,this.newItem=h??void 0}toJson(){const l=super.toJson();return l.oldItem=this.oldItem,l.newItem=this.newItem,l}static fromJson(l,h,m){return h=super.fromJson(l,h,m??new uN),h.oldItem=l.oldItem,h.newItem=l.newItem,h}};i(Jt.EVENT,x_,uN),t.CHANGE$$module$build$src$core$events$utils,t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,t.CHANGE$$module$build$src$core$events$utils,t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,t.disable$$module$build$src$core$events$utils,t.enable$$module$build$src$core$events$utils,t.getGroup$$module$build$src$core$events$utils,t.setGroup$$module$build$src$core$events$utils;var Wn={};Wn.Abstract=zd,Wn.BLOCK_CHANGE=t.CHANGE$$module$build$src$core$events$utils,Wn.BLOCK_CREATE=t.CREATE$$module$build$src$core$events$utils,Wn.BLOCK_DELETE=t.DELETE$$module$build$src$core$events$utils,Wn.BLOCK_DRAG=D_,Wn.BLOCK_FIELD_INTERMEDIATE_CHANGE=Np,Wn.BLOCK_MOVE=t.MOVE$$module$build$src$core$events$utils,Wn.BUBBLE_OPEN=Gd,Wn.BUMP_EVENTS=EE,Wn.BlockBase=K_,Wn.BlockChange=No,Wn.BlockCreate=dA,Wn.BlockDelete=KA,Wn.BlockDrag=tN,Wn.BlockFieldIntermediateChange=nN,Wn.BlockMove=iN,Wn.BubbleOpen=sN,Wn.BubbleType=oN,Wn.CHANGE=t.CHANGE$$module$build$src$core$events$utils,Wn.CLICK=dg,Wn.COMMENT_CHANGE=sT,Wn.COMMENT_CREATE=ta,Wn.COMMENT_DELETE=F_,Wn.COMMENT_MOVE=au,Wn.CREATE=t.CREATE$$module$build$src$core$events$utils,Wn.Click=Wk,Wn.ClickTarget=YI,Wn.CommentBase=Wp,Wn.CommentChange=rN,Wn.CommentCreate=lN,Wn.CommentDelete=aN,Wn.CommentMove=cN,Wn.DELETE=t.DELETE$$module$build$src$core$events$utils,Wn.FINISHED_LOADING=qu,Wn.FinishedLoading=xB,Wn.MARKER_MOVE=$_,Wn.MOVE=t.MOVE$$module$build$src$core$events$utils,Wn.MarkerMove=OL,Wn.SELECTED=ug,Wn.Selected=rA,Wn.THEME_CHANGE=P_,Wn.TOOLBOX_ITEM_SELECT=x_,Wn.TRASHCAN_OPEN=iT,Wn.ThemeChange=hA,Wn.ToolboxItemSelect=uN,Wn.TrashcanOpen=zA,Wn.UI=nT,Wn.UiBase=Ec,Wn.VAR_CREATE=za,Wn.VAR_DELETE=Dp,Wn.VAR_RENAME=N_,Wn.VIEWPORT_CHANGE=Gr,Wn.VarBase=aT,Wn.VarCreate=rL,Wn.VarDelete=UA,Wn.VarRename=WA,Wn.ViewportChange=fA,Wn.clearPendingUndo=J,Wn.disable=t.disable$$module$build$src$core$events$utils,Wn.disableOrphans=qe,Wn.enable=t.enable$$module$build$src$core$events$utils,Wn.filter=Z,Wn.fire=q,Wn.fromJson=Ee,Wn.get=Ne,Wn.getDescendantIds=Le,Wn.getGroup=t.getGroup$$module$build$src$core$events$utils,Wn.getRecordUndo=de,Wn.isEnabled=ge,Wn.setGroup=t.setGroup$$module$build$src$core$events$utils,Wn.setRecordUndo=Q;var PB=class extends XE{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(l){super.setFontConstants_(l),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(l){super.setDynamicProperties_(l),this.SELECTED_GLOW_COLOUR=l.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const h=Number(l.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=h&&!isNaN(h)?h:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=l.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(l=Number(l.getComponentStyle("replacementGlowSize")))&&!isNaN(l)?l:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&Ot(this.selectedGlowFilter),this.replacementGlowFilter&&Ot(this.replacementGlowFilter)}makeStartHat(){const l=this.START_HAT_HEIGHT,h=this.START_HAT_WIDTH,m=Cc("c",[ci(25,-l),ci(71,-l),ci(h,0)]);return{height:l,width:h,path:m}}makeHexagonal(){function l(m,E,k){var z=m/2;return z=z>h?h:z,k=k?-1:1,m=(E?-1:1)*m/2,Bh(-k*z,m)+Bh(k*z,m)}const h=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(m){return m/=2,m>h?h:m},height(m){return m},connectionOffsetY(m){return m/2},connectionOffsetX(m){return-m},pathDown(m){return l(m,!1,!1)},pathUp(m){return l(m,!0,!1)},pathRightDown(m){return l(m,!1,!0)},pathRightUp(m){return l(m,!1,!0)}}}makeRounded(){function l(E,k,z){const Oe=E>m?E-m:0;E=(E>m?m:E)/2;const Je=z===k?"0":"1";return Mr("a","0 0,"+Je,E,ci((z?1:-1)*E,(k?-1:1)*E))+Vn("v",(k?-1:1)*Oe)+Mr("a","0 0,"+Je,E,ci((z?-1:1)*E,(k?-1:1)*E))}const h=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,m=2*h;return{type:this.SHAPES.ROUND,isDynamic:!0,width(E){return E/=2,E>h?h:E},height(E){return E},connectionOffsetY(E){return E/2},connectionOffsetX(E){return-E},pathDown(E){return l(E,!1,!1)},pathUp(E){return l(E,!0,!1)},pathRightDown(E){return l(E,!1,!0)},pathRightUp(E){return l(E,!1,!0)}}}makeSquared(){function l(m,E,k){m-=2*h;const z=k===E?"0":"1";return Mr("a","0 0,"+z,h,ci((k?1:-1)*h,(E?-1:1)*h))+Vn("v",(E?-1:1)*m)+Mr("a","0 0,"+z,h,ci((k?-1:1)*h,(E?-1:1)*h))}const h=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(m){return h},height(m){return m},connectionOffsetY(m){return m/2},connectionOffsetX(m){return-m},pathDown(m){return l(m,!1,!1)},pathUp(m){return l(m,!0,!1)},pathRightDown(m){return l(m,!1,!0)},pathRightUp(m){return l(m,!1,!0)}}}shapeFor(l){let h=l.getCheck();switch(!h&&l.targetConnection&&(h=l.targetConnection.getCheck()),l.type){case Pn.INPUT_VALUE:case Pn.OUTPUT_VALUE:if(l=l.getSourceBlock().getOutputShape(),l!==null)switch(l){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return h&&h.indexOf("Boolean")!==-1?this.HEXAGONAL:h&&h.indexOf("Number")!==-1?this.ROUNDED:(h&&h.indexOf("String"),this.ROUNDED);case Pn.PREVIOUS_STATEMENT:case Pn.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function l(kn){return Cc("c",[ci(kn*k/2,0),ci(kn*k*3/4,Oe/2),ci(kn*k,Oe)])+ju([ci(kn*k,z)])+Cc("c",[ci(kn*k/4,Oe/2),ci(kn*k/2,Oe),ci(kn*k,Oe)])+Vn("h",kn*E)+Cc("c",[ci(kn*k/2,0),ci(kn*k*3/4,-(Oe/2)),ci(kn*k,-Oe)])+ju([ci(kn*k,-z)])+Cc("c",[ci(kn*k/4,-(Oe/2)),ci(kn*k/2,-Oe),ci(kn*k,-Oe)])}const h=this.NOTCH_WIDTH,m=this.NOTCH_HEIGHT,E=h/3,k=E/3,z=m/2,Oe=z/2,Je=l(1),Ht=l(-1);return{type:this.SHAPES.NOTCH,width:h,height:m,pathLeft:Je,pathRight:Ht}}makeInsideCorners(){const l=this.CORNER_RADIUS,h=Mr("a","0 0,0",l,ci(-l,l)),m=Mr("a","0 0,1",l,ci(-l,l)),E=Mr("a","0 0,0",l,ci(l,l)),k=Mr("a","0 0,1",l,ci(l,l));return{width:l,height:l,pathTop:h,pathBottom:E,rightWidth:l,rightHeight:l,pathTopRight:m,pathBottomRight:k}}generateSecondaryColour_(l){return O_("#000",l,.15)||l}generateTertiaryColour_(l){return O_("#000",l,.25)||l}createDom(l,h,m){super.createDom(l,h,m),l=He(pt.DEFS,{},l),h=He(pt.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},l),He(pt.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},h),m=He(pt.FECOMPONENTTRANSFER,{result:"outBlur"},h),He(pt.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},m),He(pt.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},h),He(pt.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},h),this.selectedGlowFilterId=h.id,this.selectedGlowFilter=h,l=He(pt.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},l),He(pt.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},l),h=He(pt.FECOMPONENTTRANSFER,{result:"outBlur"},l),He(pt.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},h),He(pt.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},l),He(pt.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},l),He(pt.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},l),this.replacementGlowFilterId=l.id,this.replacementGlowFilter=l}getCSS_(l){return[`${l} .blocklyText,`,`${l} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${l} .blocklyText {`,"fill: #fff;","}",`${l} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${l} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${l} .blocklyNonEditableText>text,`,`${l} .blocklyEditableText>text,`,`${l} .blocklyNonEditableText>g>text,`,`${l} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${l} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${l} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${l} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${l} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${l} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${l} .blocklyDropdownText {`,"fill: #fff !important;","}",`${l}.blocklyWidgetDiv .goog-menuitem,`,`${l}.blocklyDropDownDiv .goog-menuitem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${l}.blocklyDropDownDiv .goog-menuitem-content {`,"color: #fff;","}",`${l} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${l} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${l} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},FB=class extends YE{constructor(l,h){super(l,h)}draw(){const l=this.block_.pathObject;l.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),l.setPath(this.outlinePath_+`
- `+this.inlinePath_),this.info_.RTL&&l.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(l.outputShapeType=this.info_.outputConnection.shape.type),l.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(l){if(!(0>=l.height)){if(ft.isSpacer(l)){const E=l.precedesStatement;var h=l.followsStatement;if(E||h){const k=this.constants_.INSIDE_CORNERS;var m=k.rightHeight;m=l.height-(E?m:0),h=h?k.pathBottomRight:"",l=0<m?Vn("V",l.yPos+m):"",this.outlinePath_+=h+l+(E?k.pathTopRight:"");return}}this.outlinePath_+=Vn("V",l.yPos+l.height)}}drawRightDynamicConnection_(){if(!this.info_.outputConnection)throw Error("Cannot draw the output connection of a block that doesn't have one");this.outlinePath_+=this.info_.outputConnection.shape.pathRightDown(this.info_.outputConnection.height)}drawLeftDynamicConnection_(){if(!this.info_.outputConnection)throw Error("Cannot draw the output connection of a block that doesn't have one");this.positionOutputConnection_(),this.outlinePath_+=this.info_.outputConnection.shape.pathUp(this.info_.outputConnection.height),this.outlinePath_+="z"}drawFlatTop_(){const l=this.info_.topRow;this.positionPreviousConnection_(),this.outlinePath_+=Bo(l.xPos,this.info_.startY),this.outlinePath_+=Vn("h",l.width)}drawFlatBottom_(){const l=this.info_.bottomRow;this.positionNextConnection_(),this.outlinePath_+=Vn("V",l.baseline),this.outlinePath_+=Vn("h",-l.width)}drawInlineInput_(l){this.positionInlineInputConnection_(l);const h=l.input.name;l.connectedBlock||this.info_.isInsertionMarker||(l=pl(l.xPos+l.connectionWidth,l.centerline-l.height/2)+this.getInlineInputPath(l),this.block_.pathObject.setOutlinePath(h,l))}getInlineInputPath(l){const h=l.width-2*l.connectionWidth,m=l.height;return Vn("h",h)+l.shape.pathRightDown(m)+Vn("h",-h)+l.shape.pathUp(m)+"z"}drawStatementInput_(l){var h=l.getLastInput();const m=h.xPos+h.notchOffset+h.shape.width,E=this.constants_.INSIDE_CORNERS,k=h.shape.pathRight+Vn("h",-(h.notchOffset-E.width))+E.pathTop,z=l.height-2*E.height;h=E.pathBottom+Vn("h",h.notchOffset-E.width)+(h.connectedBottomNextConnection?"":h.shape.pathLeft),this.outlinePath_+=Vn("H",m)+k+Vn("v",z)+h+Vn("H",l.xPos+l.width),this.positionStatementInputConnection_(l)}drawConnectionHighlightPath(l){const h=l.connectionModel;if(h.type===Pn.NEXT_STATEMENT||h.type===Pn.PREVIOUS_STATEMENT||h.type===Pn.OUTPUT_VALUE&&!l.isDynamicShape)super.drawConnectionHighlightPath(l);else{l=h.type===Pn.INPUT_VALUE?pl(l.connectionWidth,-l.height/2)+this.getInlineInputPath(l):pl(l.width,-l.height/2)+l.shape.pathDown(l.height);var m=h.getSourceBlock(),E,k;(k=(E=m.pathObject).addConnectionHighlight)==null||k.call(E,h,l,h.getOffsetInBlock(),m.RTL)}}},sv=class extends fs{constructor(l,h,m,E,k,z,Oe){if(super(fs.SKIP_SETUP),this.imageElement=this.clickHandler=null,this.flipRtl=this.isDirty_=this.EDITABLE=!1,this.altText="",m=Number(Tr(m)),h=Number(Tr(h)),isNaN(m)||isNaN(h))throw Error("Height and width values of an image field must cast to numbers.");if(0>=m||0>=h)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new ko(h,m+sv.Y_PADDING),this.imageHeight=m,typeof k=="function"&&(this.clickHandler=k),l!==fs.SKIP_SETUP&&(Oe?this.configure_(Oe):(this.flipRtl=!!z,this.altText=Tr(E)||""),this.setValue(Tr(l)))}configure_(l){super.configure_(l),l.flipRtl&&(this.flipRtl=l.flipRtl),l.alt&&(this.altText=Tr(l.alt))}initView(){this.imageElement=He(pt.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(cu,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(l){return typeof l!="string"?null:l}doValueUpdate_(l){this.value_=l,this.imageElement&&this.imageElement.setAttributeNS(cu,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(l){l!==this.altText&&(this.altText=l||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(l){this.clickHandler=l}getText_(){return this.altText}static fromJson(l){if(!l.src||!l.width||!l.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(l.src,l.width,l.height,void 0,void 0,void 0,l)}};sv.Y_PADDING=1,Rl("field_image",sv),sv.prototype.DEFAULT_VALUE="";var nS=class extends fs{constructor(l,h,m){super(fs.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",l!==fs.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(l),h&&this.setValidator(h))}configure_(l){super.configure_(l),l.spellcheck!==void 0&&(this.spellcheck_=l.spellcheck)}initView(){if(!this.getSourceBlock())throw new Co;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const l=this.getSourceBlock();if(!l)throw new Co;let h;return this.fullBlockClickTarget_=!((h=this.getConstants())==null||!h.FULL_BLOCK_FIELDS)&&l.isSimpleReporter()}doValueInvalid_(l){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,l=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&ge()&&q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,l,this.value_)))}doValueUpdate_(l){this.isTextValid_=this.isDirty_=!0,this.value_=l}applyColour(){const l=this.getSourceBlock();if(!l)throw new Co;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",l.style.colourTertiary)):(this.borderRect_.style.display="none",l.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let l;return(l=this.getConstants())!=null&&l.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var l=this.htmlInput_;this.isTextValid_?(Ct(l,"blocklyInvalidInput"),bo(l,Ao.INVALID,!1)):(ke(l,"blocklyInvalidInput"),bo(l,Ao.INVALID,!0))}if(l=this.getSourceBlock(),!l)throw new Co;this.getConstants().FULL_BLOCK_FIELDS&&l.applyColour()}setSpellcheck(l){l!==this.spellcheck_&&(this.spellcheck_=l,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(l,h=!1){this.workspace_=this.sourceBlock_.workspace,!h&&this.workspace_.options.modalInputs&&(OE||QI||Sc)?this.showPromptEditor_():this.showInlineEditor_(h)}showPromptEditor_(){Yl(t.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),l=>{l!==null&&this.setValue(this.getValueFromEditorText_(l)),this.onFinishEditing_(this.value_)})}showInlineEditor_(l){const h=this.getSourceBlock();if(!h)throw new Co;xb(this,h.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,l||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var l=this.getSourceBlock();if(!l)throw new Co;t.setGroup$$module$build$src$core$events$utils(!0);const h=Sp();var m=this.getClickTarget_();if(!m)throw Error("A click target has not been set.");ke(m,"editing"),m=document.createElement("input"),m.className="blocklyHtmlInput",m.setAttribute("spellcheck",this.spellcheck_);const E=this.workspace_.getScale();var k=this.getConstants().FIELD_TEXT_FONTSIZE*E+"pt";return h.style.fontSize=k,m.style.fontSize=k,k=nS.BORDERRADIUS*E+"px",this.isFullBlockField()&&(k=this.getScaledBBox(),k=(k.bottom-k.top)/2+"px",l=l.getParent()?l.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,m.style.border=1*E+"px solid "+l,h.style.borderRadius=k,h.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(h.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*E+"px")),m.style.borderRadius=k,h.appendChild(m),m.value=m.defaultValue=this.getEditorText_(this.value_),m.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(m),m}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&ge()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(q(new(Ne(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),t.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var l=Sp().style;if(l.width="auto",l.height="auto",l.fontSize="",l.transition="",l.boxShadow="",this.htmlInput_=null,l=this.getClickTarget_(),!l)throw Error("A click target has not been set.");Ct(l,"editing")}onFinishEditing_(l){}bindInputEvents_(l){this.onKeyDownWrapper_=ee(l,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=ee(l,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(Me(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Me(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(l){l.key==="Enter"?(Wu(),Ud()):l.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Wu(),Ud()):l.key==="Tab"&&(Wu(),Ud(),this.sourceBlock_.tab(this,!l.shiftKey),l.preventDefault())}onHtmlInputChange_(l){l=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&ge()&&this.value_!==l&&q(new(Ne(Np))(this.sourceBlock_,this.name||null,l,this.value_))}setEditorValue_(l,h=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(l)),this.setValue(l,h)}resizeEditor_(){var l=this.getSourceBlock();if(!l)throw new Co;const h=Sp(),m=this.getScaledBBox();h.style.width=m.right-m.left+"px",h.style.height=m.bottom-m.top+"px",l=new _n(l.RTL?m.right-h.offsetWidth:m.left,m.top),h.style.left=l.x+"px",h.style.top=l.y+"px"}repositionForWindowResize(){const l=this.getSourceBlock();return l instanceof tf?(eT(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),l)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(l){return`${l}`}getValueFromEditorText_(l){return l}};nS.BORDERRADIUS=4;var MT=class extends nS{constructor(l,h,m){super(l,h,m)}doClassValidation_(l){return l===void 0?null:`${l}`}static fromJson(l){return new this(Tr(l.text),void 0,l)}};Rl("field_input",MT),MT.prototype.DEFAULT_VALUE="";var BB=class extends IL{constructor(l){super(l)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(l){return!!l.outputConnection}hasRightSquareCorner(l){return!!l.outputConnection&&!l.statementInputCount&&!l.nextConnection}},BL=class extends jE{constructor(l,h){if(super(l,h),this.connectedBottomNextConnection=!1,this.connectedBlock){for(l=this.connectedBlock;h=l.getNextBlock();)l=h;l.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},HB=class extends as{constructor(l){super(l),this.width=this.height=0,this.type|=ft.getType("RIGHT_CONNECTION")}},VB=class extends BA{constructor(l){super(l)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(l){const h=(l.hat?l.hat==="cap":this.constants_.ADD_START_HATS)&&!l.outputConnection&&!l.previousConnection;return!!l.outputConnection||h}hasRightSquareCorner(l){return!!l.outputConnection&&!l.statementInputCount&&!l.nextConnection}},UB=class extends wT{constructor(l,h){super(l,h),this.isInline=!0,this.renderer_=l,this.constants_=this.renderer_.getConstants(),this.topRow=new VB(this.constants_),this.bottomRow=new BB(this.constants_),this.isMultiRow=!h.getInputsInline()||h.isCollapsed(),this.hasStatementInput=0<h.statementInputCount,this.rightSide=this.outputConnection?new HB(this.constants_):null,this.rightAlignedDummyInputs=new WeakMap}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.adjustXPosition_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}shouldStartNewRow_(l,h){return h?h instanceof _g||l instanceof kc||h instanceof kc?!0:l instanceof t.ValueInput$$module$build$src$core$inputs$value_input||l instanceof ef||l instanceof _g?!this.isInline||this.isMultiRow:!1:!1}getDesiredRowWidth_(l){return l.hasStatement?this.width-this.startX-(this.constants_.INSIDE_CORNERS.rightWidth||0):super.getDesiredRowWidth_(l)}getInRowSpacing_(l,h){return l&&h||!this.outputConnection||!this.outputConnection.isDynamicShape||this.hasStatementInput||this.bottomRow.hasNextConnection?!l&&h&&ft.isStatementInput(h)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:l&&ft.isLeftRoundedCorner(l)&&h&&(ft.isPreviousConnection(h)||ft.isNextConnection(h))?h.notchOffset-this.constants_.CORNER_RADIUS:l&&ft.isLeftSquareCorner(l)&&h&&ft.isHat(h)?this.constants_.NO_PADDING:this.constants_.MEDIUM_PADDING:this.constants_.NO_PADDING}getSpacerRowHeight_(l,h){if(ft.isTopRow(l)&&ft.isBottomRow(h))return this.constants_.EMPTY_BLOCK_SPACER_HEIGHT;const m=ft.isInputRow(l)&&l.hasStatement,E=ft.isInputRow(h)&&h.hasStatement;return E||m?(l=Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.INSIDE_CORNERS.rightHeight||0),E&&m?Math.max(l,this.constants_.DUMMY_INPUT_MIN_HEIGHT):l):ft.isTopRow(l)?l.hasPreviousConnection||this.outputConnection&&!this.hasStatementInput?this.constants_.NO_PADDING:Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):ft.isBottomRow(h)?this.outputConnection?!h.hasNextConnection&&this.hasStatementInput?Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):this.constants_.NO_PADDING:Math.max(this.topRow.minHeight,Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.CORNER_RADIUS))-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING}getSpacerRowWidth_(l,h){const m=this.width-this.startX;return ft.isInputRow(l)&&l.hasStatement||ft.isInputRow(h)&&h.hasStatement?Math.max(m,this.constants_.STATEMENT_INPUT_SPACER_MIN_WIDTH):m}getElemCenterline_(l,h){if(l.hasStatement&&!ft.isSpacer(h)&&!ft.isStatementInput(h))return l.yPos+this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT/2;if(ft.isInlineInput(h)&&h instanceof Up){const m=h.connectedBlock;if(m&&m.outputConnection&&m.nextConnection)return l.yPos+m.height/2}return super.getElemCenterline_(l,h)}addInput_(l,h){if((l instanceof ef||l instanceof _g)&&h.hasDummyInput&&h.align===t.Align$$module$build$src$core$inputs$align.LEFT&&l.align===t.Align$$module$build$src$core$inputs$align.RIGHT)this.rightAlignedDummyInputs.set(h,l);else if(l instanceof kc){h.elements.push(new BL(this.constants_,l)),h.hasStatement=!0,h.align===null&&(h.align=l.align);return}super.addInput_(l,h)}addAlignmentPadding_(l,h){if(this.rightAlignedDummyInputs.get(l)){let m;for(let E=0;E<l.elements.length;E++){const k=l.elements[E];if(ft.isSpacer(k)&&(m=k),ft.isField(k)&&k instanceof ST&&k.parentInput===this.rightAlignedDummyInputs.get(l))break}if(m){m.width+=h,l.width+=h;return}}super.addAlignmentPadding_(l,h)}adjustXPosition_(){const l=this.constants_.NOTCH_OFFSET_LEFT+this.constants_.NOTCH_WIDTH;let h=l;for(let k=2;k<this.rows.length-1;k+=2){var m=this.rows[k-1];const z=this.rows[k];var E=this.rows[k+1];if(m=k===2?!!this.topRow.hasPreviousConnection:!!m.followsStatement,E=k+2>=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!E.precedesStatement,ft.isInputRow(z)&&z.hasStatement){z.measure();let Oe,Je;h=z.width-((Je=(Oe=z.getLastInput())==null?void 0:Oe.width)!=null?Je:0)+l}else if(m&&(k===2||E)&&ft.isInputRow(z)&&!z.hasStatement){E=z.xPos,m=null;for(let Oe=0;Oe<z.elements.length;Oe++){const Je=z.elements[Oe];ft.isSpacer(Je)&&(m=Je),m&&(ft.isField(Je)||ft.isInput(Je))&&E<h&&!(ft.isField(Je)&&Je instanceof ST&&(Je.field instanceof ar||Je.field instanceof sv))&&(m.width+=h-E),E+=Je.width}}}}finalizeOutputConnection_(){if(this.outputConnection&&this.outputConnection.isDynamicShape){var l=this.outputConnection.shape;if("isDynamic"in l&&l.isDynamic){for(var h=0,m=0;m<this.rows.length;m++){const E=this.rows[m];E.yPos=h,h+=E.height}this.height=h,m=this.bottomRow.hasNextConnection?this.height-this.bottomRow.descenderHeight:this.height,h=l.height(m),m=l.width(m),this.outputConnection.height=h,this.outputConnection.width=m,this.outputConnection.startX=m,this.outputConnection.connectionOffsetY=l.connectionOffsetY(h),this.outputConnection.connectionOffsetX=l.connectionOffsetX(m),l=0,this.hasStatementInput||this.bottomRow.hasNextConnection||(l=m,this.rightSide.height=h,this.rightSide.width=l,this.rightSide.centerline=h/2,this.rightSide.xPos=this.width+l),this.startX=m,this.width+=m+l,this.widthWithChildren+=m+l}}}finalizeHorizontalAlignment_(){if(this.outputConnection&&!this.hasStatementInput&&!this.bottomRow.hasNextConnection){for(var l=0,h=0;h<this.rows.length;h++){var m=this.rows[h];if(!ft.isInputRow(m))continue;l=m.elements[m.elements.length-2];let E=this.getNegativeSpacing_(m.elements[1]),k=this.getNegativeSpacing_(l);l=E+k;const z=this.constants_.MIN_BLOCK_WIDTH+2*this.outputConnection.width;this.width-l<z&&(l=this.width-z,E=l/2,k=l/2),m.elements.unshift(new hu(this.constants_,-E)),m.elements.push(new hu(this.constants_,-k))}if(l)for(this.width-=l,this.widthWithChildren-=l,this.rightSide.xPos-=l,h=0;h<this.rows.length;h++)m=this.rows[h],ft.isTopOrBottomRow(m)&&(m.elements[1].width-=l),m.width-=l,m.widthWithConnectedBlocks-=l}}getNegativeSpacing_(l){if(!l||!this.outputConnection)return 0;const h=this.outputConnection.width;var m=this.outputConnection.shape.type;const E=this.constants_;if(1<this.inputRows.length)switch(m){case E.SHAPES.ROUND:return m=this.constants_.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,m=this.height/2>m?m:this.height/2,h-m*(1-Math.sin(Math.acos((m-this.constants_.SMALL_PADDING)/m)));default:return 0}if(ft.isInlineInput(l)&&l instanceof Up){const k=l.connectedBlock;return l=k?k.pathObject.outputShapeType:l.shape.type,l==null||k&&k.outputConnection&&(k.statementInputCount||k.nextConnection)||m===E.SHAPES.HEXAGONAL&&m!==l?0:h-this.constants_.SHAPE_IN_SHAPE_PADDING[m][l]}return ft.isField(l)&&l instanceof ST?m===E.SHAPES.ROUND&&l.field instanceof MT?h-2.75*E.GRID_UNIT:h-this.constants_.SHAPE_IN_SHAPE_PADDING[m][0]:ft.isIcon(l)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let E=2;E<this.rows.length-1;E+=2){const k=this.rows[E-1],z=this.rows[E],Oe=this.rows[E+1];var l=E===2,h=E+2>=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!Oe.precedesStatement;if(l?this.topRow.hasPreviousConnection:k.followsStatement){var m=z.elements[1];if(m=z.elements.length===3&&m instanceof ST&&(m.field instanceof ar||m.field instanceof sv),!l&&m)k.height-=this.constants_.SMALL_PADDING,Oe.height-=this.constants_.SMALL_PADDING,z.height-=this.constants_.MEDIUM_PADDING;else if(!l&&!h)k.height+=this.constants_.SMALL_PADDING;else if(h){for(l=!1,h=0;h<z.elements.length;h++)if(m=z.elements[h],m instanceof Up&&ft.isInlineInput(m)&&m.connectedBlock&&!m.connectedBlock.isShadow()&&40<=m.connectedBlock.getHeightWidth().height){l=!0;break}l&&(k.height-=this.constants_.SMALL_PADDING,Oe.height-=this.constants_.SMALL_PADDING)}}}}finalize_(){this.finalizeOutputConnection_(),this.finalizeHorizontalAlignment_(),this.finalizeVerticalAlignment_(),super.finalize_(),this.rightSide&&(this.widthWithChildren+=this.rightSide.width)}},S=class extends RL{constructor(l,h,m){super(l,h,m),this.markerCircle=null}showWithInputOutput(l){const h=l.getSourceBlock();l=l.getLocation().getOffsetInBlock(),this.positionCircle(l.x,l.y),this.setParent_(h),this.showCurrent_()}showWithOutput_(l){this.showWithInputOutput(l)}showWithInput_(l){this.showWithInputOutput(l)}showWithBlock_(l){l=l.getLocation();const h=l.getHeightWidth();this.positionRect_(0,0,h.width,h.height),this.setParent_(l),this.showCurrent_()}positionCircle(l,h){let m;(m=this.markerCircle)==null||m.setAttribute("cx",`${l}`);let E;(E=this.markerCircle)==null||E.setAttribute("cy",`${h}`),this.currentMarkerSvg=this.markerCircle}hide(){super.hide(),this.markerCircle&&(this.markerCircle.style.display="none")}createDomInternal_(){if(super.createDomInternal_(),this.markerCircle=He(pt.CIRCLE,{r:this.constants_.CURSOR_RADIUS,"stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.hide(),this.isCursor()){const l=this.getBlinkProperties_();He(pt.ANIMATE,l,this.markerCircle)}return this.markerSvg_}applyColour_(l){super.applyColour_(l);let h;(h=this.markerCircle)==null||h.setAttribute("fill",this.colour_);let m;if((m=this.markerCircle)==null||m.setAttribute("stroke",this.colour_),this.isCursor()){l=this.colour_+";transparent;transparent;";let E;(E=this.markerCircle)==null||E.firstElementChild.setAttribute("values",l)}}},R=class extends qE{constructor(l,h,m){super(l,h,m),this.svgPathSelected=null,this.outlines=new Map,this.remainingOutlines=new Set,this.outputShapeType=null,this.constants=m}setPath(l){super.setPath(l),this.svgPathSelected&&this.svgPathSelected.setAttribute("d",l)}applyColour(l){super.applyColour(l);const h=l.getParent();l.isShadow()&&h&&this.svgPath.setAttribute("stroke",h.style.colourTertiary);for(const m of this.outlines.values())m.setAttribute("fill",this.style.colourTertiary)}flipRTL(){super.flipRTL();for(const l of this.outlines.values())l.setAttribute("transform","scale(-1 1)")}updateSelected(l){this.setClass_("blocklySelected",l),l?this.svgPathSelected||(this.svgPathSelected=this.svgPath.cloneNode(!0),this.svgPathSelected.setAttribute("fill","none"),this.svgPathSelected.setAttribute("filter","url(#"+this.constants.selectedGlowFilterId+")"),this.svgRoot.appendChild(this.svgPathSelected)):this.svgPathSelected&&(this.svgRoot.removeChild(this.svgPathSelected),this.svgPathSelected=null)}updateReplacementFade(l){this.setClass_("blocklyReplaceable",l),l?this.svgPath.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):this.svgPath.removeAttribute("filter")}updateShapeForInputHighlight(l,h){l=l.getParentInput().name,(l=this.getOutlinePath(l))&&(h?l.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):l.removeAttribute("filter"))}beginDrawing(){this.remainingOutlines.clear();for(const l of this.outlines.keys())this.remainingOutlines.add(l)}endDrawing(){if(this.remainingOutlines.size)for(const l of this.remainingOutlines)this.removeOutlinePath(l);this.remainingOutlines.clear()}setOutlinePath(l,h){l=this.getOutlinePath(l),l.setAttribute("d",h),l.setAttribute("fill",this.style.colourTertiary)}getOutlinePath(l){return this.outlines.has(l)||this.outlines.set(l,He(pt.PATH,{class:"blocklyOutlinePath",d:""},this.svgRoot)),this.remainingOutlines.delete(l),this.outlines.get(l)}removeOutlinePath(l){let h,m;(h=this.outlines.get(l))==null||(m=h.parentNode)==null||m.removeChild(this.outlines.get(l)),this.outlines.delete(l)}},B=class extends JE{constructor(l){super(l)}makeConstants_(){return new PB}makeRenderInfo_(l){return new UB(this,l)}makeDrawer_(l,h){return new FB(l,h)}makeMarkerDrawer(l,h){return new S(l,this.getConstants(),h)}makePathObject(l,h){return new R(l,h,this.getConstants())}getConstants(){return this.constants_}getConnectionPreviewMethod(l,h,m){return Tt("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),h.type===Pn.OUTPUT_VALUE?l.isConnected()?Jd.PREVIEW_TYPE.REPLACEMENT_FADE:Jd.PREVIEW_TYPE.INPUT_OUTLINE:super.getConnectionPreviewMethod(l,h,m)}};Ql("zelos",B);var ne={};ne.BottomRow=BB,ne.ConstantProvider=PB,ne.Drawer=FB,ne.MarkerSvg=S,ne.PathObject=R,ne.RenderInfo=UB,ne.Renderer=B,ne.RightConnectionShape=HB,ne.StatementInput=BL,ne.TopRow=VB,VI();var Ce={};Ce.registerCleanup=k_,Ce.registerCollapse=Ak,Ce.registerCollapseExpandBlock=FI,Ce.registerComment=$k,Ce.registerDefaultOptions=VI,Ce.registerDelete=HI,Ce.registerDeleteAll=Nk,Ce.registerDisable=BI,Ce.registerDuplicate=bE,Ce.registerExpand=_E,Ce.registerHelp=tT,Ce.registerInline=TE,Ce.registerRedo=Mk,Ce.registerUndo=Rk;var Pe=class extends nS{constructor(l,h,m){super(fs.SKIP_SETUP),this.clockwise=Pe.CLOCKWISE,this.offset=Pe.OFFSET,this.wrap=Pe.WRAP,this.round=Pe.ROUND,this.boundEvents=[],this.symbol_=this.gauge=this.line=null,l!==fs.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(l),h&&this.setValidator(h))}configure_(l){switch(super.configure_(l),l.mode){case lt.COMPASS:this.clockwise=!0,this.offset=90;break;case lt.PROTRACTOR:this.clockwise=!1,this.offset=0}l.clockwise&&(this.clockwise=l.clockwise),l.offset&&(this.offset=l.offset),l.wrap&&(this.wrap=l.wrap),l.round&&(this.round=l.round)}initView(){super.initView(),this.symbol_=He(pt.TSPAN,{}),this.symbol_.appendChild(document.createTextNode("°")),this.getTextElement().appendChild(this.symbol_)}render_(){super.render_(),this.updateGraph()}showEditor_(l){super.showEditor_(l,OE||QI||Sc),l=this.dropdownCreate(),Hb().appendChild(l),this.sourceBlock_ instanceof tf&&TI(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary),bt(this,this.dropdownDispose.bind(this)),this.updateGraph()}dropdownCreate(){const l=He(pt.SVG,{xmlns:ME,"xmlns:html":Kd,"xmlns:xlink":cu,version:"1.1",height:2*Pe.HALF+"px",width:2*Pe.HALF+"px"});l.style.touchAction="none";const h=He(pt.CIRCLE,{cx:Pe.HALF,cy:Pe.HALF,r:Pe.RADIUS,class:"blocklyAngleCircle"},l);this.gauge=He(pt.PATH,{class:"blocklyAngleGauge"},l),this.line=He(pt.LINE,{x1:Pe.HALF,y1:Pe.HALF,class:"blocklyAngleLine"},l);for(let m=0;360>m;m+=15)He(pt.LINE,{x1:Pe.HALF+Pe.RADIUS,y1:Pe.HALF,x2:Pe.HALF+Pe.RADIUS-(m%45===0?10:5),y2:Pe.HALF,class:"blocklyAngleMarks",transform:"rotate("+m+","+Pe.HALF+","+Pe.HALF+")"},l);return this.boundEvents.push(ee(l,"click",this,this.hide)),this.boundEvents.push(ee(h,"pointerdown",this,this.onMouseMove_,!0)),this.boundEvents.push(ee(h,"pointermove",this,this.onMouseMove_,!0)),l}dropdownDispose(){for(const l of this.boundEvents)Me(l);this.boundEvents.length=0,this.line=this.gauge=null}hide(){ql(this),Wu()}onMouseMove_(l){var h=this.gauge.ownerSVGElement.getBoundingClientRect();const m=l.clientX-h.left-Pe.HALF;l=l.clientY-h.top-Pe.HALF,h=Math.atan(-l/m),isNaN(h)||(h=wp(h),0>m?h+=180:0<l&&(h+=360),h=this.clockwise?this.offset+360-h:360-(this.offset-h),this.displayMouseOrKeyboardValue(h))}displayMouseOrKeyboardValue(l){if(this.round&&(l=Math.round(l/this.round)*this.round),l=this.wrapValue(l),l!==this.value_){const h=this.value_;this.setEditorValue_(l,!1),this.sourceBlock_&&ge()&&this.value_!==h&&q(new(Ne(Np))(this.sourceBlock_,this.name||null,h,this.value_))}}updateGraph(){if(this.gauge&&this.line){var l=Number(this.getText())+this.offset,h=Bb(l%360);l=["M ",Pe.HALF,",",Pe.HALF];var m=Pe.HALF,E=Pe.HALF;if(!isNaN(h)){const k=Number(this.clockwise),z=Bb(this.offset),Oe=Math.cos(z)*Pe.RADIUS,Je=Math.sin(z)*-Pe.RADIUS;k&&(h=2*z-h),m+=Math.cos(h)*Pe.RADIUS,E-=Math.sin(h)*Pe.RADIUS,h=Math.abs(Math.floor((h-z)/Math.PI)%2),k&&(h=1-h),l.push(" l ",Oe,",",Je," A ",Pe.RADIUS,",",Pe.RADIUS," 0 ",h," ",k," ",m,",",E," z")}this.gauge.setAttribute("d",l.join("")),this.line.setAttribute("x2",`${m}`),this.line.setAttribute("y2",`${E}`)}}onHtmlInputKeyDown_(l){super.onHtmlInputKeyDown_(l);var h=this.getSourceBlock();if(!h)throw new Co;let m=0;switch(l.key){case"ArrowLeft":m=h.RTL?1:-1;break;case"ArrowRight":m=h.RTL?-1:1;break;case"ArrowDown":m=-1;break;case"ArrowUp":m=1}m&&(h=this.getValue(),this.displayMouseOrKeyboardValue(h+m*this.round),l.preventDefault(),l.stopPropagation())}doClassValidation_(l){return l=Number(l),isNaN(l)||!isFinite(l)?null:this.wrapValue(l)}wrapValue(l){return l%=360,0>l&&(l+=360),l>this.wrap&&(l-=360),l}static fromJson(l){return new this(l.angle,void 0,l)}};Pe.HALF=50,Pe.RADIUS=Pe.HALF-1,Pe.CLOCKWISE=!1,Pe.OFFSET=0,Pe.WRAP=360,Pe.ROUND=15,Rl("field_angle",Pe),Pe.prototype.DEFAULT_VALUE=0,Xe(`
- .blocklyAngleCircle {
- stroke: #444;
- stroke-width: 1;
- fill: #ddd;
- fill-opacity: 0.8;
- }
- .blocklyAngleMarks {
- stroke: #444;
- stroke-width: 1;
- }
- .blocklyAngleGauge {
- fill: #f88;
- fill-opacity: 0.8;
- pointer-events: none;
- }
- .blocklyAngleLine {
- stroke: #f00;
- stroke-width: 2;
- stroke-linecap: round;
- pointer-events: none;
- }
- `);var lt;(function(l){l.COMPASS="compass",l.PROTRACTOR="protractor"})(lt||(lt={}));var ut=class extends fs{constructor(l,h,m){super(fs.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=ut.CHECK_CHAR,l!==fs.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(l),h&&this.setValidator(h))}configure_(l){super.configure_(l),l.checkCharacter&&(this.checkChar=l.checkCharacter)}saveState(){const l=this.saveLegacyState(ut);return l!==null?l:this.getValueBoolean()}initView(){super.initView();const l=this.getTextElement();ke(l,"blocklyCheckbox"),l.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(l){this.checkChar=l||ut.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(l){return l===!0||l==="TRUE"?"TRUE":l===!1||l==="FALSE"?"FALSE":null}doValueUpdate_(l){this.value_=this.convertValueToBool_(l),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool_(this.value_))}convertValueToBool_(l){return typeof l=="string"?l==="TRUE":!!l}static fromJson(l){return new this(l.checked,void 0,l)}};ut.CHECK_CHAR="✓",Rl("field_checkbox",ut),ut.prototype.DEFAULT_VALUE=!1;var _t=class extends fs{constructor(l,h,m){super(fs.SKIP_SETUP),this.highlightedIndex=this.picker=null,this.boundEvents=[],this.SERIALIZABLE=!0,this.CURSOR="default",this.isDirty_=!1,this.titles=this.colours=null,this.columns=0,l!==fs.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(l),h&&this.setValidator(h))}configure_(l){super.configure_(l),l.colourOptions&&(this.colours=l.colourOptions),l.colourTitles&&(this.titles=l.colourTitles),l.columns&&(this.columns=l.columns)}initView(){this.size_=new ko(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const l=this.getSourceBlock();if(!l)throw new Co;const h=this.getConstants();return l.isSimpleReporter()&&!(h==null||!h.FIELD_COLOUR_FULL_BLOCK)}applyColour(){const l=this.getSourceBlock();if(!l)throw new Co;if(this.fieldGroup_){var h=this.borderRect_;if(!h)throw Error("The border rect has not been initialized");this.isFullBlockField()?(h.style.display="none",l.pathObject.svgPath.setAttribute("fill",this.getValue()),l.pathObject.svgPath.setAttribute("stroke","#fff")):(h.style.display="block",h.style.fill=this.getValue())}}getSize(){let l;return(l=this.getConstants())!=null&&l.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const l=this.getSourceBlock();if(!l)throw new Co;l.applyColour()}updateSize_(l){var h=this.getConstants();this.isFullBlockField()?(l=2*(l??0),h=h.FIELD_TEXT_HEIGHT):(l=h.FIELD_COLOUR_DEFAULT_WIDTH,h=h.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=h,this.size_.width=l,this.positionBorderRect_()}doClassValidation_(l){return typeof l!="string"?null:zu(l)}getText(){let l=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(l)&&(l="#"+l[1]+l[3]+l[5]),l}setColours(l,h){return this.colours=l,h&&(this.titles=h),this}setColumns(l){return this.columns=l,this}showEditor_(){this.dropdownCreate(),Hb().appendChild(this.picker),bt(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(l){l=(l=l.target)&&l.getAttribute("data-colour"),l!==null&&(this.setValue(l),ql(this))}onKeyDown(l){let h=!0;var m;switch(l.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":(m=this.getHighlighted())&&(m=m.getAttribute("data-colour"),m!==null&&this.setValue(m)),Ud();break;default:h=!1}h&&l.stopPropagation()}moveHighlightBy(l,h){if(this.highlightedIndex){var m=this.colours||_t.COLOURS,E=this.columns||_t.COLUMNS,k=this.highlightedIndex%E,z=Math.floor(this.highlightedIndex/E);k+=l,z+=h,0>l?0>k&&0<z?(k=E-1,z--):0>k&&(k=0):0<l?k>E-1&&z<Math.floor(m.length/E)-1?(k=0,z++):k>E-1&&k--:0>h?0>z&&(z=0):0<h&&z>Math.floor(m.length/E)-1&&(z=Math.floor(m.length/E)-1),this.setHighlightedCell(this.picker.childNodes[z].childNodes[k],z*E+k)}}onMouseMove(l){const h=(l=l.target)&&Number(l.getAttribute("data-index"));h!==null&&h!==this.highlightedIndex&&this.setHighlightedCell(l,h)}onMouseEnter(){let l;(l=this.picker)==null||l.focus({preventScroll:!0})}onMouseLeave(){var l;(l=this.picker)==null||l.blur(),(l=this.getHighlighted())&&Ct(l,"blocklyColourHighlighted")}getHighlighted(){if(!this.highlightedIndex)return null;const l=this.columns||_t.COLUMNS,h=this.picker.childNodes[Math.floor(this.highlightedIndex/l)];return h?h.childNodes[this.highlightedIndex%l]:null}setHighlightedCell(l,h){const m=this.getHighlighted();m&&Ct(m,"blocklyColourHighlighted"),ke(l,"blocklyColourHighlighted"),this.highlightedIndex=h,(l=l.getAttribute("id"))&&this.picker&&bo(this.picker,Ao.ACTIVEDESCENDANT,l)}dropdownCreate(){const l=this.columns||_t.COLUMNS,h=this.colours||_t.COLOURS,m=this.titles||_t.TITLES,E=this.getValue(),k=document.createElement("table");k.className="blocklyColourTable",k.tabIndex=0,k.dir="ltr",su(k,Lc.GRID),bo(k,Ao.EXPANDED,!0),bo(k,Ao.ROWCOUNT,Math.floor(h.length/l)),bo(k,Ao.COLCOUNT,l);let z;for(let Oe=0;Oe<h.length;Oe++){Oe%l===0&&(z=document.createElement("tr"),su(z,Lc.ROW),k.appendChild(z));const Je=document.createElement("td");z.appendChild(Je),Je.setAttribute("data-colour",h[Oe]),Je.title=m[Oe]||h[Oe],Je.id=V(),Je.setAttribute("data-index",`${Oe}`),su(Je,Lc.GRIDCELL),bo(Je,Ao.LABEL,h[Oe]),bo(Je,Ao.SELECTED,h[Oe]===E),Je.style.backgroundColor=h[Oe],h[Oe]===E&&(Je.className="blocklyColourSelected",this.highlightedIndex=Oe)}this.boundEvents.push(ee(k,"pointerdown",this,this.onClick,!0)),this.boundEvents.push(ee(k,"pointermove",this,this.onMouseMove,!0)),this.boundEvents.push(ee(k,"pointerenter",this,this.onMouseEnter,!0)),this.boundEvents.push(ee(k,"pointerleave",this,this.onMouseLeave,!0)),this.boundEvents.push(ee(k,"keydown",this,this.onKeyDown,!1)),this.picker=k}dropdownDispose(){for(const l of this.boundEvents)Me(l);this.boundEvents.length=0,this.highlightedIndex=this.picker=null}static fromJson(l){return new this(l.colour,void 0,l)}};_t.COLOURS="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" "),_t.TITLES=[],_t.COLUMNS=7,_t.prototype.DEFAULT_VALUE=_t.COLOURS[0],Rl("field_colour",_t),Xe(`
- .blocklyColourTable {
- border-collapse: collapse;
- display: block;
- outline: none;
- padding: 1px;
- }
- .blocklyColourTable>tr>td {
- border: 0.5px solid #888;
- box-sizing: border-box;
- cursor: pointer;
- display: inline-block;
- height: 20px;
- padding: 0;
- width: 20px;
- }
- .blocklyColourTable>tr>td.blocklyColourHighlighted {
- border-color: #eee;
- box-shadow: 2px 2px 7px 2px rgba(0, 0, 0, 0.3);
- position: relative;
- }
- .blocklyColourSelected, .blocklyColourSelected:hover {
- border-color: #eee !important;
- outline: 1px solid #333;
- position: relative;
- }
- `);var Zt=class extends ar{constructor(l,h,m){super(String(l??""),h,m),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(l){return new this(Tr(l.text),void 0,l)}};Rl("field_label_serializable",Zt);var en=class extends MT{constructor(l,h,m){super(fs.SKIP_SETUP),this.textGroup=null,this.maxLines_=1/0,this.isOverflowedY_=!1,l!==fs.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(l),h&&this.setValidator(h))}configure_(l){super.configure_(l),l.maxLines&&this.setMaxLines(l.maxLines)}toXml(l){return l.textContent=this.getValue().replace(/\n/g," "),l}fromXml(l){this.setValue(l.textContent.replace(/ /g,`
- `))}saveState(){const l=this.saveLegacyState(en);return l!==null?l:this.getValue()}loadState(l){this.loadLegacyState(fs,l)||this.setValue(l)}initView(){this.createBorderRect_(),this.textGroup=He(pt.G,{class:"blocklyEditableText"},this.fieldGroup_)}getDisplayText_(){const l=this.getSourceBlock();if(!l)throw new Co;let h=this.getText();if(!h)return fs.NBSP;const m=h.split(`
- `);h="";const E=this.isOverflowedY_?this.maxLines_:m.length;for(let k=0;k<E;k++){let z=m[k];z.length>this.maxDisplayLength?z=z.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&k===E-1&&(z=z.substring(0,z.length-3)+"..."),z=z.replace(/\s/g,fs.NBSP),h+=z,k!==E-1&&(h+=`
- `)}return l.RTL&&(h+=""),h}doValueUpdate_(l){super.doValueUpdate_(l),this.value_!==null&&(this.isOverflowedY_=this.value_.split(`
- `).length>this.maxLines_)}render_(){var l=this.getSourceBlock();if(!l)throw new Co;for(var h,m=this.textGroup;h=m.firstChild;)m.removeChild(h);h=this.getDisplayText_().split(`
- `);let E=0;for(let k=0;k<h.length;k++){const z=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING;He(pt.TEXT,{class:"blocklyText blocklyMultilineText",x:this.getConstants().FIELD_BORDER_RECT_X_PADDING,y:E+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,dy:this.getConstants().FIELD_TEXT_BASELINE},m).appendChild(document.createTextNode(h[k])),E+=z}this.isBeingEdited_&&(m=this.htmlInput_,this.isOverflowedY_?ke(m,"blocklyHtmlTextAreaInputOverflowedY"):Ct(m,"blocklyHtmlTextAreaInputOverflowedY")),this.updateSize_(),this.isBeingEdited_&&(l.RTL?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),l=this.htmlInput_,this.isTextValid_?(Ct(l,"blocklyInvalidInput"),bo(l,Ao.INVALID,!1)):(ke(l,"blocklyInvalidInput"),bo(l,Ao.INVALID,!0)))}updateSize_(){var l=this.textGroup.childNodes;const h=this.getConstants().FIELD_TEXT_FONTSIZE,m=this.getConstants().FIELD_TEXT_FONTWEIGHT,E=this.getConstants().FIELD_TEXT_FONTFAMILY;let k=0,z=0;for(var Oe=0;Oe<l.length;Oe++){var Je=je(l[Oe],h,m,E);Je>k&&(k=Je),z+=this.getConstants().FIELD_TEXT_HEIGHT+(0<Oe?this.getConstants().FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){for(l=String(this.value_).split(`
- `),Oe=He(pt.TEXT,{class:"blocklyText blocklyMultilineText"}),Je=0;Je<l.length;Je++){l[Je].length>this.maxDisplayLength&&(l[Je]=l[Je].substring(0,this.maxDisplayLength)),Oe.textContent=l[Je];const Ht=je(Oe,h,m,E);Ht>k&&(k=Ht)}k+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(z+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,k+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",`${k}`),this.borderRect_.setAttribute("height",`${z}`)),this.size_.width=k,this.size_.height=z,this.positionBorderRect_()}showEditor_(l,h){super.showEditor_(l,h),this.forceRerender()}widgetCreate_(){const l=Sp(),h=this.workspace_.getScale(),m=document.createElement("textarea");m.className="blocklyHtmlInput blocklyHtmlTextAreaInput",m.setAttribute("spellcheck",String(this.spellcheck_));var E=this.getConstants().FIELD_TEXT_FONTSIZE*h+"pt";l.style.fontSize=E,m.style.fontSize=E,m.style.borderRadius=MT.BORDERRADIUS*h+"px",E=this.getConstants().FIELD_BORDER_RECT_X_PADDING*h;const k=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*h/2;return m.style.padding=k+"px "+E+"px "+k+"px "+E+"px",E=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,m.style.lineHeight=E*h+"px",l.appendChild(m),m.value=m.defaultValue=this.getEditorText_(this.value_),m.setAttribute("data-untyped-default-value",String(this.value_)),m.setAttribute("data-old-value",""),qk?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(m),m}setMaxLines(l){typeof l=="number"&&0<l&&l!==this.maxLines_&&(this.maxLines_=l,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(l){l.key!=="Enter"&&super.onHtmlInputKeyDown_(l)}static fromJson(l){return new this(Tr(l.text),void 0,l)}};Rl("field_multilinetext",en),Xe(`
- .blocklyHtmlTextAreaInput {
- font-family: monospace;
- resize: none;
- overflow: hidden;
- height: 100%;
- text-align: left;
- }
- .blocklyHtmlTextAreaInputOverflowedY {
- overflow-y: scroll;
- }
- `);var an=class extends nS{constructor(l,h,m,E,k,z){super(fs.SKIP_SETUP),this.min_=-1/0,this.max_=1/0,this.precision_=0,this.decimalPlaces=null,this.spellcheck_=!1,l!==fs.SKIP_SETUP&&(z?this.configure_(z):this.setConstraints(h,m,E),this.setValue(l),k&&this.setValidator(k))}configure_(l){super.configure_(l),this.setMinInternal(l.min),this.setMaxInternal(l.max),this.setPrecisionInternal(l.precision)}setConstraints(l,h,m){this.setMinInternal(l),this.setMaxInternal(h),this.setPrecisionInternal(m),this.setValue(this.getValue())}setMin(l){this.setMinInternal(l),this.setValue(this.getValue())}setMinInternal(l){l==null?this.min_=-1/0:(l=Number(l),isNaN(l)||(this.min_=l))}getMin(){return this.min_}setMax(l){this.setMaxInternal(l),this.setValue(this.getValue())}setMaxInternal(l){l==null?this.max_=1/0:(l=Number(l),isNaN(l)||(this.max_=l))}getMax(){return this.max_}setPrecision(l){this.setPrecisionInternal(l),this.setValue(this.getValue())}setPrecisionInternal(l){this.precision_=Number(l)||0;let h=String(this.precision_);h.indexOf("e")!==-1&&(h=this.precision_.toLocaleString("en-US",{maximumFractionDigits:20}));const m=h.indexOf(".");this.decimalPlaces=m===-1?l?0:null:h.length-m-1}getPrecision(){return this.precision_}doClassValidation_(l){return l===null||(l=`${l}`.replace(/O/gi,"0"),l=l.replace(/,/g,""),l=l.replace(/infinity/i,"Infinity"),l=Number(l||0),isNaN(l))?null:(l=Math.min(Math.max(l,this.min_),this.max_),this.precision_&&isFinite(l)&&(l=Math.round(l/this.precision_)*this.precision_),this.decimalPlaces!==null&&(l=Number(l.toFixed(this.decimalPlaces))),l)}widgetCreate_(){const l=super.widgetCreate_();return-1/0<this.min_&&(l.min=`${this.min_}`,bo(l,Ao.VALUEMIN,this.min_)),1/0>this.max_&&(l.max=`${this.max_}`,bo(l,Ao.VALUEMAX,this.max_)),l}static fromJson(l){return new this(l.value,void 0,void 0,void 0,void 0,l)}};Rl("field_number",an),an.prototype.DEFAULT_VALUE=0;var Rn=class extends du{constructor(l,h,m,E,k){super(fs.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Rn.dropdownCreate,this.defaultVariableName=typeof l=="string"?l:"",this.size_=new ko(0,0),l!==fs.SKIP_SETUP&&(k?this.configure_(k):this.setTypes(m,E),h&&this.setValidator(h))}configure_(l){super.configure_(l),this.setTypes(l.variableTypes,l.defaultType)}initModel(){var l=this.getSourceBlock();if(!l)throw new Co;this.variable||(l=t.getOrCreateVariablePackage$$module$build$src$core$variables(l.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(l.getId()))}shouldAddBorderRect_(){const l=this.getSourceBlock();if(!l)throw new Co;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||l.type!=="variables_get")}fromXml(l){var h=this.getSourceBlock();if(!h)throw new Co;const m=l.getAttribute("id"),E=l.textContent,k=l.getAttribute("variabletype")||l.getAttribute("variableType")||"";if(h=t.getOrCreateVariablePackage$$module$build$src$core$variables(h.workspace,m,E,k),k!==null&&k!==h.type)throw Error("Serialized variable type with id '"+h.getId()+"' had type "+h.type+", and does not match variable field that references it: "+Ah(l)+".");this.setValue(h.getId())}toXml(l){return this.initModel(),l.id=this.variable.getId(),l.textContent=this.variable.name,this.variable.type&&l.setAttribute("variabletype",this.variable.type),l}saveState(l){var h=this.saveLegacyState(Rn);return h!==null||(this.initModel(),h={id:this.variable.getId()},l&&(h.name=this.variable.name,h.type=this.variable.type)),h}loadState(l){const h=this.getSourceBlock();if(!h)throw new Co;this.loadLegacyState(Rn,l)||(l=t.getOrCreateVariablePackage$$module$build$src$core$variables(h.workspace,l.id||null,l.name,l.type||""),this.setValue(l.getId()))}setSourceBlock(l){if(l.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(l)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(l){if(l===null)return null;var h=this.getSourceBlock();if(!h)throw new Co;return h=t.getVariable$$module$build$src$core$variables(h.workspace,l),h?(h=h.type,this.typeIsAllowed(h)?l:(console.warn("Variable type doesn't match this field! Type was "+h),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+l),null)}doValueUpdate_(l){const h=this.getSourceBlock();if(!h)throw new Co;this.variable=t.getVariable$$module$build$src$core$variables(h.workspace,l),super.doValueUpdate_(l)}typeIsAllowed(l){const h=this.getVariableTypes();if(!h)return!0;for(let m=0;m<h.length;m++)if(l===h[m])return!0;return!1}getVariableTypes(){var l=this.variableTypes;if(l===null&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying())return this.sourceBlock_.workspace.getVariableTypes();if(l=l||[""],l.length===0)throw l=this.getText(),Error("'variableTypes' of field variable "+l+" was an empty list");return l}setTypes(l=null,h=""){if(Array.isArray(l)){let m=!1;for(let E=0;E<l.length;E++)l[E]===h&&(m=!0);if(!m)throw Error("Invalid default type '"+h+"' in the definition of a FieldVariable")}else if(l!==null)throw Error("'variableTypes' was not an array in the definition of a FieldVariable");this.defaultType=h,this.variableTypes=l}refreshVariableName(){this.forceRerender()}onItemSelected_(l,h){if(l=h.getValue(),this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()){if(l===_L){t.renameVariable$$module$build$src$core$variables(this.sourceBlock_.workspace,this.variable);return}if(l===vL){this.sourceBlock_.workspace.deleteVariableById(this.variable.getId());return}}this.setValue(l)}referencesVariables(){return!0}static fromJson(l){return new this(Tr(l.variable),void 0,void 0,void 0,l)}static dropdownCreate(){if(!this.variable)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");const l=this.getText();let h=[];if(this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying())for(var m=this.getVariableTypes(),E=0;E<m.length;E++){const k=this.sourceBlock_.workspace.getVariablesOfType(m[E]);h=h.concat(k)}for(h.sort(cT.compareByName),m=[],E=0;E<h.length;E++)m[E]=[h[E].name,h[E].getId()];return m.push([t.Msg$$module$build$src$core$msg.RENAME_VARIABLE,_L]),t.Msg$$module$build$src$core$msg.DELETE_VARIABLE&&m.push([t.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",l),vL]),m}};Rl("field_variable",Rn);var qn=class{constructor(l,h,m,E){this.workspace=l,this.targetWorkspace=h,this.isLabel_=E,this.onMouseUpWrapper=null,this.height=this.width=0,this.svgText=this.svgGroup=null,this.text=m.text,this.position=new _n(0,0),this.callbackKey=m.callbackKey||m.callbackkey,this.cssClass=m["web-class"]||null,this.info=m}createDom(){var l=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(l+=" "+this.cssClass),this.svgGroup=He(pt.G,{class:l},this.workspace.getCanvas());let h;this.isLabel_||(h=He(pt.RECT,{class:"blocklyFlyoutButtonShadow",rx:qn.BORDER_RADIUS,ry:qn.BORDER_RADIUS,x:1,y:1},this.svgGroup)),l=He(pt.RECT,{class:this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:qn.BORDER_RADIUS,ry:qn.BORDER_RADIUS},this.svgGroup);const m=He(pt.TEXT,{class:this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var E=Tr(this.text);this.workspace.RTL&&(E+=""),m.textContent=E,this.isLabel_&&(this.svgText=m,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const k=vs(m,"fontSize"),z=vs(m,"fontWeight"),Oe=vs(m,"fontFamily");if(this.width=Ae(m,k,z,Oe),E=Et(E,k,z,Oe),this.height=E.height,!this.isLabel_){this.width+=2*qn.TEXT_MARGIN_X,this.height+=2*qn.TEXT_MARGIN_Y;let Je;(Je=h)==null||Je.setAttribute("width",String(this.width));let Ht;(Ht=h)==null||Ht.setAttribute("height",String(this.height))}return l.setAttribute("width",String(this.width)),l.setAttribute("height",String(this.height)),m.setAttribute("x",String(this.width/2)),m.setAttribute("y",String(this.height/2-E.height/2+E.baseline)),this.updateTransform(),this.onMouseUpWrapper=ee(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(l,h){this.position.x=l,this.position.y=h,this.updateTransform()}isLabel(){return this.isLabel_}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}dispose(){this.onMouseUpWrapper&&Me(this.onMouseUpWrapper),this.svgGroup&&Ot(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}onMouseUp(l){(l=this.targetWorkspace.getGesture(l))&&l.cancel(),this.isLabel_&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isLabel_||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isLabel_||(l=this.targetWorkspace.getButtonCallback(this.callbackKey))&&l(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};qn.TEXT_MARGIN_X=5,qn.TEXT_MARGIN_Y=2,qn.BORDER_RADIUS=4,Xe(`
- .blocklyFlyoutButton {
- fill: #888;
- cursor: default;
- }
- .blocklyFlyoutButtonShadow {
- fill: #666;
- }
- .blocklyFlyoutButton:hover {
- fill: #aaa;
- }
- .blocklyFlyoutLabel {
- cursor: default;
- }
- .blocklyFlyoutLabelBackground {
- opacity: 0;
- }
- `);var Ei=class extends xL{constructor(l,h){super(l),this.flyout_=h}getBoundingBox_(){let l;try{l=this.workspace_.getCanvas().getBBox()}catch{l={height:0,y:0,width:0,x:0}}return l}getContentMetrics(l){const h=this.getBoundingBox_();return l=l?1:this.workspace_.scale,{height:h.height*l,width:h.width*l,top:h.y*l,left:h.x*l}}getScrollMetrics(l,h,m){return h=m||this.getContentMetrics(),m=this.flyout_.MARGIN*this.workspace_.scale,l=l?this.workspace_.scale:1,{height:(h.height+2*m)/l,width:(h.width+h.left+m)/l,top:0,left:0}}},Ui;(function(l){l.BLOCK="block",l.BUTTON="button"})(Ui||(Ui={}));var _i=class extends kL{constructor(l){super(),this.horizontalLayout=!1,this.boundEvents=[],this.filterWrapper=this.reflowWrapper=null,this.mats=[],this.buttons_=[],this.listeners=[],this.permanentlyDisabled=[],this.recycledBlocks=[],this.autoClose=!0,this.isVisible_=!1,this.containerVisible=!0,this.CORNER_RADIUS=8,this.SCROLLBAR_MARGIN=2.5,this.height_=this.width_=0,this.dragAngleRange_=70,this.svgGroup_=this.svgBackground_=null,l.setMetrics=this.setMetrics_.bind(this),this.workspace_=new Qd(l),this.workspace_.setMetricsManager(new Ei(this.workspace_,this)),this.workspace_.internalIsFlyout=!0,this.workspace_.setVisible(this.isVisible_),this.id=U(),this.RTL=!!l.RTL,this.toolboxPosition_=l.toolboxPosition,this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH,this.rectMap_=new WeakMap,this.MARGIN=this.CORNER_RADIUS,this.GAP_X=3*this.MARGIN,this.GAP_Y=3*this.MARGIN}createDom(l){return this.svgGroup_=He(l,{class:"blocklyFlyout"}),this.svgGroup_.style.display="none",this.svgBackground_=He(pt.PATH,{class:"blocklyFlyoutBackground"},this.svgGroup_),this.svgGroup_.appendChild(this.workspace_.createDom()),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity"),this.svgGroup_}init(l){this.targetWorkspace=l,this.workspace_.targetWorkspace=l,this.workspace_.scrollbar=new eN(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN),this.hide(),this.boundEvents.push(ee(this.svgGroup_,"wheel",this,this.wheel_)),this.filterWrapper=this.filterForCapacity.bind(this),this.targetWorkspace.addChangeListener(this.filterWrapper),this.boundEvents.push(ee(this.svgBackground_,"pointerdown",this,this.onMouseDown)),this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace),this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap()),this.workspace_.createPotentialVariableMap(),l.getComponentManager().addComponent({component:this,weight:1,capabilities:[Qr.Capability.AUTOHIDEABLE,Qr.Capability.DELETE_AREA,Qr.Capability.DRAG_TARGET]})}dispose(){this.hide(),this.targetWorkspace.getComponentManager().removeComponent(this.id);for(const l of this.boundEvents)Me(l);this.boundEvents.length=0,this.filterWrapper&&this.targetWorkspace.removeChangeListener(this.filterWrapper),this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.dispose()),this.svgGroup_&&Ot(this.svgGroup_)}getWidth(){return this.width_}getHeight(){return this.height_}getFlyoutScale(){return this.targetWorkspace.scale}getWorkspace(){return this.workspace_}setAutoClose(l){this.autoClose=l,this.targetWorkspace.recordDragTargets(),this.targetWorkspace.resizeContents()}autoHide(l){!l&&this.targetWorkspace.getFlyout(!0)===this&&this.autoClose&&this.hide()}isVisible(){return this.isVisible_}setVisible(l){const h=l!==this.isVisible();this.isVisible_=l,h&&(this.autoClose||this.targetWorkspace.recordDragTargets(),this.updateDisplay())}setContainerVisible(l){const h=l!==this.containerVisible;this.containerVisible=l,h&&this.updateDisplay()}updateDisplay(){let l;l=this.containerVisible?this.isVisible():!1,this.svgGroup_&&(this.svgGroup_.style.display=l?"block":"none");let h;(h=this.workspace_.scrollbar)==null||h.setContainerVisible(l)}positionAt_(l,h,m,E){let k;(k=this.svgGroup_)==null||k.setAttribute("width",`${l}`);let z;(z=this.svgGroup_)==null||z.setAttribute("height",`${h}`),this.workspace_.setCachedParentSvgSize(l,h),this.svgGroup_&&se(this.svgGroup_,"translate("+m+"px,"+E+"px)"),(l=this.workspace_.scrollbar)&&(l.setOrigin(m,E),l.resize(),l.hScroll&&l.hScroll.setPosition(l.hScroll.position.x,l.hScroll.position.y),l.vScroll&&l.vScroll.setPosition(l.vScroll.position.x,l.vScroll.position.y))}hide(){if(this.isVisible()){this.setVisible(!1);for(const l of this.listeners)Me(l);this.listeners.length=0,this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null)}}show(l){this.workspace_.setResizesEnabled(!1),this.hide(),this.clearOldBlocks(),typeof l=="string"&&(l=this.getDynamicCategoryContents(l)),this.setVisible(!0),l=un(l),l=this.createFlyoutInfo(l),wa(this.workspace_),this.layout_(l.contents,l.gaps),this.horizontalLayout?this.height_=0:this.width_=0,this.workspace_.setResizesEnabled(!0),this.reflow(),this.filterForCapacity(),this.position(),this.reflowWrapper=this.reflow.bind(this),this.workspace_.addChangeListener(this.reflowWrapper),this.emptyRecycledBlocks()}createFlyoutInfo(l){const h=[],m=[];this.permanentlyDisabled.length=0;const E=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const k of l){if("custom"in k){l=this.getDynamicCategoryContents(k.custom),l=un(l);const{contents:z,gaps:Oe}=this.createFlyoutInfo(l);h.push(...z),m.push(...Oe)}switch(k.kind.toUpperCase()){case"BLOCK":l=k;const z=this.createFlyoutBlock(l);h.push({type:Ui.BLOCK,block:z}),this.addBlockGap(l,m,E);break;case"SEP":this.addSeparatorGap(k,m,E);break;case"LABEL":l=this.createButton(k,!0),h.push({type:Ui.BUTTON,button:l}),m.push(E);break;case"BUTTON":l=this.createButton(k,!1),h.push({type:Ui.BUTTON,button:l}),m.push(E)}}return{contents:h,gaps:m}}getDynamicCategoryContents(l){if(l=this.workspace_.targetWorkspace.getToolboxCategoryCallback(l),typeof l!="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");return l(this.workspace_.targetWorkspace)}createButton(l,h){return new qn(this.workspace_,this.targetWorkspace,l,h)}createFlyoutBlock(l){let h;return l.blockxml?(l=typeof l.blockxml=="string"?t.textToDom$$module$build$src$core$utils$xml(l.blockxml):l.blockxml,(h=this.getRecycledBlock(l.getAttribute("type")))||(h=yp(l,this.workspace_))):(h=this.getRecycledBlock(l.type),h||(l.enabled===void 0&&(l.enabled=l.disabled!=="true"&&l.disabled!==!0),h=$b(l,this.workspace_))),h.isEnabled()||this.permanentlyDisabled.push(h),h}getRecycledBlock(l){let h=-1;for(let m=0;m<this.recycledBlocks.length;m++)if(this.recycledBlocks[m].type===l){h=m;break}return h===-1?void 0:this.recycledBlocks.splice(h,1)[0]}addBlockGap(l,h,m){let E;l.gap?E=parseInt(String(l.gap)):l.blockxml&&(l=typeof l.blockxml=="string"?t.textToDom$$module$build$src$core$utils$xml(l.blockxml):l.blockxml,E=parseInt(l.getAttribute("gap"))),h.push(!E||isNaN(E)?m:E)}addSeparatorGap(l,h,m){l=parseInt(String(l.gap)),!isNaN(l)&&0<h.length?h[h.length-1]=l:h.push(m)}clearOldBlocks(){var l=this.workspace_.getTopBlocks(!1);for(let m=0,E;E=l[m];m++)this.blockIsRecyclable_(E)?this.recycleBlock(E):E.dispose(!1,!1);for(l=0;l<this.mats.length;l++){const m=this.mats[l];m&&(EI(m),Ot(m))}this.mats.length=0;for(let m=0,E;E=this.buttons_[m];m++)E.dispose();this.buttons_.length=0;let h;(h=this.workspace_.getPotentialVariableMap())==null||h.clear()}emptyRecycledBlocks(){for(let l=0;l<this.recycledBlocks.length;l++)this.recycledBlocks[l].dispose();this.recycledBlocks=[]}blockIsRecyclable_(l){return!1}recycleBlock(l){const h=l.getRelativeToSurfaceXY();l.moveBy(-h.x,-h.y),this.recycledBlocks.push(l)}addBlockListeners_(l,h,m){this.listeners.push(ee(l,"pointerdown",null,this.blockMouseDown(h))),this.listeners.push(ee(m,"pointerdown",null,this.blockMouseDown(h))),this.listeners.push(ye(l,"pointerenter",h,()=>{this.targetWorkspace.isDragging()||h.addSelect()})),this.listeners.push(ye(l,"pointerleave",h,()=>{this.targetWorkspace.isDragging()||h.removeSelect()})),this.listeners.push(ye(m,"pointerenter",h,()=>{this.targetWorkspace.isDragging()||h.addSelect()})),this.listeners.push(ye(m,"pointerleave",h,()=>{this.targetWorkspace.isDragging()||h.removeSelect()}))}blockMouseDown(l){return h=>{const m=this.targetWorkspace.getGesture(h);m&&(m.setStartBlock(l),m.handleFlyoutStart(h,this))}}onMouseDown(l){const h=this.targetWorkspace.getGesture(l);h&&h.handleFlyoutStart(l,this)}isBlockCreatable(l){return l.isEnabled()}createBlock(l){let h=null;t.disable$$module$build$src$core$events$utils();var m=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{h=this.placeNewBlock(l)}finally{t.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),l=Nb(this.targetWorkspace,m),ge()){for(t.setGroup$$module$build$src$core$events$utils(!0),m=0;m<l.length;m++){const E=l[m];q(new(Ne(za))(E))}q(new(Ne(t.CREATE$$module$build$src$core$events$utils))(h))}return this.autoClose?this.hide():this.filterForCapacity(),h}initFlyoutButton_(l,h,m){const E=l.createDom();l.moveTo(h,m),l.show(),this.listeners.push(ee(E,"pointerdown",this,this.onMouseDown)),this.buttons_.push(l)}createRect_(l,h,m,E,k){return h=He(pt.RECT,{"fill-opacity":0,x:h,y:m,height:E.height,width:E.width}),h.tooltip=l,Yb(h),this.workspace_.getCanvas().insertBefore(h,l.getSvgRoot()),this.rectMap_.set(l,h),this.mats[k]=h}moveRectToBlock_(l,h){const m=h.getHeightWidth();l.setAttribute("width",String(m.width)),l.setAttribute("height",String(m.height)),h=h.getRelativeToSurfaceXY(),l.setAttribute("y",String(h.y)),l.setAttribute("x",String(this.RTL?h.x-m.width:h.x))}filterForCapacity(){const l=this.workspace_.getTopBlocks(!1);for(let h=0,m;m=l[h];h++)if(this.permanentlyDisabled.indexOf(m)===-1){const E=this.targetWorkspace.isCapacityAvailable(N(m));for(;m;)m.setEnabled(E),m=m.getNextBlock()}}reflow(){this.reflowWrapper&&this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowInternal_(),this.reflowWrapper&&this.workspace_.addChangeListener(this.reflowWrapper)}isScrollable(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1}placeNewBlock(l){var h=this.targetWorkspace;if(!l.getSvgRoot())throw Error("oldBlock is not rendered");const m=Hd(l);return h.setResizesEnabled(!1),h=qr(m,h),this.positionNewBlock(l,h),h}positionNewBlock(l,h){const m=this.targetWorkspace;var E=m.getOriginOffsetInPixels(),k=this.workspace_.getOriginOffsetInPixels();l=l.getRelativeToSurfaceXY(),l.scale(this.workspace_.scale),k=_n.sum(k,l),E=_n.difference(k,E),E.scale(1/m.scale),h.moveTo(new _n(E.x,E.y))}};_i.FlyoutItemType=Ui;var gs=class extends _i{constructor(l){super(l),this.horizontalLayout=!0}setMetrics_(l){if(this.isVisible()){var h=this.workspace_.getMetricsManager(),m=h.getScrollMetrics(),E=h.getViewMetrics();h=h.getAbsoluteMetrics(),typeof l.x=="number"&&(this.workspace_.scrollX=-(m.left+(m.width-E.width)*l.x)),this.workspace_.translate(this.workspace_.scrollX+h.left,this.workspace_.scrollY+h.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var l=this.targetWorkspace.getMetricsManager();const h=l.getAbsoluteMetrics(),m=l.getViewMetrics();l=l.getToolboxMetrics();const E=this.toolboxPosition_===Fi.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?E?l.height:m.height-this.height_:E?0:m.height:E?0:m.height+h.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var l=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=l.width,this.setBackgroundPath(l.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),l=this.getX();var h=this.getY();this.positionAt_(this.width_,this.height_,l,h)}}setBackgroundPath(l,h){const m=this.toolboxPosition_===Fi.TOP,E=["M 0,"+(m?0:this.CORNER_RADIUS)];m?(E.push("h",l+2*this.CORNER_RADIUS),E.push("v",h),E.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),E.push("h",-l),E.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(E.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),E.push("h",l),E.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),E.push("v",h),E.push("h",-l-2*this.CORNER_RADIUS)),E.push("z"),this.svgBackground_.setAttribute("d",E.join(" "))}scrollToStart(){let l;(l=this.workspace_.scrollbar)==null||l.setX(this.RTL?1/0:0)}wheel_(l){var h=Se(l);if(h=h.x||h.y){const m=this.workspace_.getMetricsManager(),E=m.getScrollMetrics();h=m.getViewMetrics().left-E.left+h;let k;(k=this.workspace_.scrollbar)==null||k.setX(h),Wu(),Ud()}l.preventDefault(),l.stopPropagation()}layout_(l,h){this.workspace_.scale=this.targetWorkspace.scale;const m=this.MARGIN;let E=m+this.tabWidth_;this.RTL&&(l=l.reverse());for(let Je=0,Ht;Ht=l[Je];Je++)if(Ht.type==="block"){var k=Ht.block,z=k.getDescendants(!1);for(let Qo=0,Vo;Vo=z[Qo];Qo++)Vo.isInFlyout=!0;z=k.getSvgRoot();const kn=k.getHeightWidth();var Oe=k.outputConnection?this.tabWidth_:0;Oe=this.RTL?E+kn.width:E-Oe,k.moveBy(Oe,m),Oe=this.createRect_(k,Oe,m,kn,Je),E+=kn.width+h[Je],this.addBlockListeners_(z,k,Oe)}else Ht.type==="button"&&(k=Ht.button,this.initFlyoutButton_(k,E,m),E+=k.width+h[Je])}isDragTowardWorkspace(l){l=Math.atan2(l.y,l.x)/Math.PI*180;const h=this.dragAngleRange_;return l<90+h&&l>90-h||l>-90-h&&l<-90+h}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const l=this.svgGroup_.getBoundingClientRect(),h=l.top;return this.toolboxPosition_===Fi.TOP?new lo(-1e9,h+l.height,-1e9,1e9):new lo(h,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let l=0;const h=this.workspace_.getTopBlocks(!1);for(let E=0,k;k=h[E];E++)l=Math.max(l,k.getHeightWidth().height);const m=this.buttons_;for(let E=0,k;k=m[E];E++)l=Math.max(l,k.height);if(l+=1.5*this.MARGIN,l*=this.workspace_.scale,l+=kr.scrollbarThickness,this.height_!==l){for(let E=0,k;k=h[E];E++)this.rectMap_.has(k)&&this.moveRectToBlock_(this.rectMap_.get(k),k);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Fi.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+l),this.height_=l,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};i(Jt.FLYOUTS_HORIZONTAL_TOOLBOX,Uh,gs);var Ts=class extends _i{constructor(l){super(l)}setMetrics_(l){if(this.isVisible()){var h=this.workspace_.getMetricsManager(),m=h.getScrollMetrics(),E=h.getViewMetrics();h=h.getAbsoluteMetrics(),typeof l.y=="number"&&(this.workspace_.scrollY=-(m.top+(m.height-E.height)*l.y)),this.workspace_.translate(this.workspace_.scrollX+h.left,this.workspace_.scrollY+h.top)}}getX(){if(!this.isVisible())return 0;var l=this.targetWorkspace.getMetricsManager();const h=l.getAbsoluteMetrics(),m=l.getViewMetrics();return l=l.getToolboxMetrics(),this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_===Fi.LEFT?l.width:m.width-this.width_:this.toolboxPosition_===Fi.LEFT?0:m.width:this.toolboxPosition_===Fi.LEFT?0:m.width+h.left-this.width_}getY(){return 0}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var l=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=l.height,this.setBackgroundPath(this.width_-this.CORNER_RADIUS,l.height-2*this.CORNER_RADIUS),l=this.getX();var h=this.getY();this.positionAt_(this.width_,this.height_,l,h)}}setBackgroundPath(l,h){const m=this.toolboxPosition_===Fi.RIGHT;var E=l+this.CORNER_RADIUS;E=["M "+(m?E:0)+",0"],E.push("h",m?-l:l),E.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,m?0:1,m?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),E.push("v",Math.max(0,h)),E.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,m?0:1,m?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),E.push("h",m?l:-l),E.push("z"),this.svgBackground_.setAttribute("d",E.join(" "))}scrollToStart(){let l;(l=this.workspace_.scrollbar)==null||l.setY(0)}wheel_(l){var h=Se(l);if(h.y){const m=this.workspace_.getMetricsManager(),E=m.getScrollMetrics();h=m.getViewMetrics().top-E.top+h.y;let k;(k=this.workspace_.scrollbar)==null||k.setY(h),Wu(),Ud()}l.preventDefault(),l.stopPropagation()}layout_(l,h){this.workspace_.scale=this.targetWorkspace.scale;var m=this.MARGIN;const E=this.RTL?m:m+this.tabWidth_;for(let Je=0,Ht;Ht=l[Je];Je++)if(Ht.type==="block"){var k=Ht.block,z=k.getDescendants(!1);for(let Qo=0,Vo;Vo=z[Qo];Qo++)Vo.isInFlyout=!0;z=k.getSvgRoot();const kn=k.getHeightWidth();var Oe=k.outputConnection?E-this.tabWidth_:E;k.moveBy(Oe,m),Oe=this.createRect_(k,this.RTL?Oe-kn.width:Oe,m,kn,Je),this.addBlockListeners_(z,k,Oe),m+=kn.height+h[Je]}else Ht.type==="button"&&(k=Ht.button,this.initFlyoutButton_(k,E,m),m+=k.height+h[Je])}isDragTowardWorkspace(l){l=Math.atan2(l.y,l.x)/Math.PI*180;const h=this.dragAngleRange_;return l<h&&l>-h||l<-180+h||l>180-h}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const l=this.svgGroup_.getBoundingClientRect(),h=l.left;return this.toolboxPosition_===Fi.LEFT?new lo(-1e9,1e9,-1e9,h+l.width):new lo(-1e9,1e9,h,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let l=0;var h=this.workspace_.getTopBlocks(!1);for(let E=0,k;k=h[E];E++){var m=k.getHeightWidth().width;k.outputConnection&&(m-=this.tabWidth_),l=Math.max(l,m)}for(let E=0,k;k=this.buttons_[E];E++)l=Math.max(l,k.width);if(l+=1.5*this.MARGIN+this.tabWidth_,l*=this.workspace_.scale,l+=kr.scrollbarThickness,this.width_!==l){for(let E=0,k;k=h[E];E++){if(this.RTL){m=k.getRelativeToSurfaceXY().x;let z=l/this.workspace_.scale-this.MARGIN;k.outputConnection||(z-=this.tabWidth_),k.moveBy(z-m,0)}this.rectMap_.has(k)&&this.moveRectToBlock_(this.rectMap_.get(k),k)}if(this.RTL)for(let E=0,k;k=this.buttons_[E];E++)h=k.getPosition().y,k.moveTo(l/this.workspace_.scale-k.width-this.MARGIN-this.tabWidth_,h);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Fi.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+l,this.targetWorkspace.scrollY),this.width_=l,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};Ts.registryName="verticalFlyout",i(Jt.FLYOUTS_VERTICAL_TOOLBOX,Uh,Ts);var Nc;t.CodeGenerator$$module$build$src$core$generator=class{constructor(l){this.forBlock=Object.create(null),this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}",this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null,this.INDENT=" ",this.COMMENT_WRAP=60,this.ORDER_OVERRIDES=[],this.isInitialized=null,this.RESERVED_WORDS_="",this.definitions_=Object.create(null),this.functionNames_=Object.create(null),this.nameDB_=void 0,this.name_=l,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")}workspaceToCode(l){l||(console.warn("No workspace specified in workspaceToCode call. Guessing."),l=C());var h=[];this.init(l),l=l.getTopBlocks(!0);for(let m=0,E;E=l[m];m++){let k=this.blockToCode(E);Array.isArray(k)&&(k=k[0]),k&&(E.outputConnection&&(k=this.scrubNakedValue(k),this.STATEMENT_PREFIX&&!E.suppressPrefixSuffix&&(k=this.injectId(this.STATEMENT_PREFIX,E)+k),this.STATEMENT_SUFFIX&&!E.suppressPrefixSuffix&&(k+=this.injectId(this.STATEMENT_SUFFIX,E))),h.push(k))}return h=h.join(`
- `),h=this.finish(h),h=h.replace(/^\s+\n/,""),h=h.replace(/\n\s+$/,`
- `),h=h.replace(/[ \t]+\n/g,`
- `)}prefixLines(l,h){return h+l.replace(/(?!\n$)\n/g,`
- `+h)}allNestedComments(l){const h=[];l=l.getDescendants(!0);for(let m=0;m<l.length;m++){const E=l[m].getCommentText();E&&h.push(E)}return h.length&&h.push(""),h.join(`
- `)}blockToCode(l,h){if(this.isInitialized===!1&&console.warn("CodeGenerator init was not called before blockToCode was called."),!l)return"";if(!l.isEnabled())return h?"":this.blockToCode(l.getNextBlock());if(l.isInsertionMarker())return h?"":this.blockToCode(l.getChildren(!1)[0]);var m=this.forBlock[l.type];if(!m&&this[l.type]&&(Tt("block generator functions on CodeGenerator objects","10.0","11.0","the .forBlock[blockType] dictionary"),m=this[l.type]),typeof m!="function")throw Error(`${this.name_} generator does not know how to generate code for block type "${l.type}".`);if(m=m.call(l,l,this),Array.isArray(m)){if(!l.outputConnection)throw TypeError("Expecting string from statement block: "+l.type);return[this.scrub_(l,m[0],h),m[1]]}if(typeof m=="string")return this.STATEMENT_PREFIX&&!l.suppressPrefixSuffix&&(m=this.injectId(this.STATEMENT_PREFIX,l)+m),this.STATEMENT_SUFFIX&&!l.suppressPrefixSuffix&&(m+=this.injectId(this.STATEMENT_SUFFIX,l)),this.scrub_(l,m,h);if(m===null)return"";throw SyntaxError("Invalid code generated: "+m)}valueToCode(l,h,m){if(isNaN(m))throw TypeError("Expecting valid order from block: "+l.type);var E=l.getInputTargetBlock(h);if(!E||(h=this.blockToCode(E),h===""))return"";if(!Array.isArray(h))throw TypeError(`Expecting tuple from value block: ${E.type} See developers.google.com/blockly/guides/create-custom-blocks/generating-code for more information`);if(l=h[0],h=h[1],isNaN(h))throw TypeError("Expecting valid order from value block: "+E.type);if(!l)return"";E=!1;var k=Math.floor(m);const z=Math.floor(h);if(k<=z&&(k!==z||k!==0&&k!==99)){for(E=!0,k=0;k<this.ORDER_OVERRIDES.length;k++)if(this.ORDER_OVERRIDES[k][0]===m&&this.ORDER_OVERRIDES[k][1]===h){E=!1;break}}return E&&(l="("+l+")"),l}statementToCode(l,h){if(l=l.getInputTargetBlock(h),h=this.blockToCode(l),typeof h!="string")throw TypeError("Expecting code from statement block: "+(l&&l.type));return h&&(h=this.prefixLines(h,this.INDENT)),h}addLoopTrap(l,h){return this.INFINITE_LOOP_TRAP&&(l=this.prefixLines(this.injectId(this.INFINITE_LOOP_TRAP,h),this.INDENT)+l),this.STATEMENT_SUFFIX&&!h.suppressPrefixSuffix&&(l=this.prefixLines(this.injectId(this.STATEMENT_SUFFIX,h),this.INDENT)+l),this.STATEMENT_PREFIX&&!h.suppressPrefixSuffix&&(l+=this.prefixLines(this.injectId(this.STATEMENT_PREFIX,h),this.INDENT)),l}injectId(l,h){return h=h.id.replace(/\$/g,"$$$$"),l.replace(/%1/g,"'"+h+"'")}addReservedWords(l){this.RESERVED_WORDS_+=l+","}provideFunction_(l,h){if(!this.definitions_[l]){const m=this.nameDB_.getDistinctName(l,t.NameType$$module$build$src$core$names.PROCEDURE);this.functionNames_[l]=m,Array.isArray(h)&&(h=h.join(`
- `)),h=h.trim().replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,m);let E;for(;E!==h;)E=h,h=h.replace(/^(( {2})*) {2}/gm,"$1\0");h=h.replace(/\0/g,this.INDENT),this.definitions_[l]=h}return this.functionNames_[l]}getVariableName(l){return this.getName(l,t.NameType$$module$build$src$core$names.VARIABLE)}getProcedureName(l){return this.getName(l,t.NameType$$module$build$src$core$names.PROCEDURE)}getName(l,h){if(!this.nameDB_)throw Error("Name database is not defined. You must initialize `nameDB_` in your generator class and call `init` first.");return this.nameDB_.getName(l,h)}init(l){this.definitions_=Object.create(null),this.functionNames_=Object.create(null)}scrub_(l,h,m){return h}finish(l){return this.definitions_=Object.create(null),this.functionNames_=Object.create(null),l}scrubNakedValue(l){return l}},Nc={},Nc.CodeGenerator=t.CodeGenerator$$module$build$src$core$generator;var Ma=!1,tl={};tl.Align=t.Align$$module$build$src$core$inputs$align,tl.DummyInput=ef,tl.EndRowInput=_g,tl.Input=Nr,tl.StatementInput=kc,tl.ValueInput=t.ValueInput$$module$build$src$core$inputs$value_input,tl.inputTypes=t.inputTypes$$module$build$src$core$inputs$input_types;var Dr="The insertion marker previewer tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined.",id=class{constructor(l){this.staticConn=this.draggedConn=this.markerConn=this.fadedBlock=null,this.workspace=l.workspace}previewReplacement(l,h,m){t.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.fadedBlock=m,m.fadeForReplacement(!0),this.workspace.getRenderer().shouldHighlightConnection(h)&&(h.highlight(),this.staticConn=h)}finally{t.enable$$module$build$src$core$events$utils()}}previewConnection(l,h){if(l!==this.draggedConn||h!==this.staticConn){t.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.shouldUseMarkerPreview(l,h)&&(this.markerConn=this.previewMarker(l,h)),this.workspace.getRenderer().shouldHighlightConnection(h)&&h.highlight(),this.draggedConn=l,this.staticConn=h}finally{t.enable$$module$build$src$core$events$utils()}}}shouldUseMarkerPreview(l,h){return h.type===Pn.PREVIOUS_STATEMENT||h.type===Pn.NEXT_STATEMENT||!(this.workspace.getRenderer()instanceof B)}previewMarker(l,h){const m=l.getSourceBlock(),E=this.createInsertionMarker(m),k=this.getMatchingConnection(m,E,l);if(!k)throw Error("Could not create insertion marker to preview connection");E.queueRender(),wa(),k.connect(h);const z={x:h.x-k.x,y:h.y-k.y},Oe=k.getOffsetInBlock().clone();return tg().then(()=>{E==null||E.positionNearConnection(k,z,Oe),E==null||E.getSvgRoot().setAttribute("visibility","visible")}),k}createInsertionMarker(l){const h=this.workspace.newBlock(l.type);if(h.setInsertionMarker(!0),l.saveExtraState){var m=l.saveExtraState(!0);m&&h.loadExtraState&&h.loadExtraState(m)}else l.mutationToDom&&(m=l.mutationToDom())&&h.domToMutation&&h.domToMutation(m);for(m=0;m<l.inputList.length;m++){const E=l.inputList[m];if(E.name===ev)continue;const k=h.inputList[m];if(!k)throw Error(Dr.replace("%1","an input"));for(let z=0;z<E.fieldRow.length;z++){const Oe=E.fieldRow[z],Je=k.fieldRow[z];if(!Je)throw Error(Dr.replace("%1","a field"));Je.setValue(Oe.getValue())}}for(const E of h.getDescendants(!1))E.setInsertionMarker(!0);return h.setCollapsed(l.isCollapsed()),h.setInputsInline(l.getInputsInline()),h.initSvg(),h.getSvgRoot().setAttribute("visibility","hidden"),h}getMatchingConnection(l,h,m){if(l=l.getConnections_(!0),h=h.getConnections_(!0),l.length!==h.length)return null;for(let E=0;E<l.length;E++)if(l[E]===m)return h[E];return null}hidePreview(){t.disable$$module$build$src$core$events$utils();try{this.staticConn&&(this.staticConn.unhighlight(),this.staticConn=null),this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null),this.markerConn&&(this.hideInsertionMarker(this.markerConn),this.draggedConn=this.markerConn=null)}finally{t.enable$$module$build$src$core$events$utils()}}hideInsertionMarker(l){const h=l.getSourceBlock(),m=h.outputConnection;let E;if((E=h.previousConnection)!=null&&E.targetConnection||m!=null&&m.targetConnection)h.unplug(!0);else{let k;(k=l.targetBlock())==null||k.unplug(!1)}h.dispose()}dispose(){this.hidePreview()}};i(Jt.CONNECTION_PREVIEWER,Uh,id);var of=class extends XE{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(l){return super.getCSS_(l).concat([`${l} .blocklyInsertionMarker>.blocklyPathLight,`,`${l} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},dN=class{constructor(l){this.inlineSteps_=this.steps_="",this.info_=l,this.RTL_=this.info_.RTL,l=l.getRenderer(),this.constants_=l.getConstants(),this.highlightConstants_=l.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+`
- `+this.inlineSteps_}drawTopCorner(l){this.steps_+=Bo(l.xPos,this.info_.startY);for(let h=0,m;m=l.elements[h];h++)ft.isLeftSquareCorner(m)?this.steps_+=this.highlightConstants_.START_POINT:ft.isLeftRoundedCorner(m)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):ft.isPreviousConnection(m)?this.steps_+=this.notchPaths_.pathLeft:ft.isHat(m)?this.steps_+=this.startPaths_.path(this.RTL_):ft.isSpacer(m)&&m.width!==0&&(this.steps_+=Vn("H",m.xPos+m.width-this.highlightOffset));this.steps_+=Vn("H",l.xPos+l.width-this.highlightOffset)}drawJaggedEdge_(l){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+Vn("v",l.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(l){const h=l.getLastInput();if(this.RTL_){const m=l.height-h.connectionHeight;this.steps_+=pl(h.xPos+h.width-this.highlightOffset,l.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+Vn("v",m)}else this.steps_+=pl(h.xPos+h.width,l.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(l){const h=l.getLastInput();if(h)if(this.RTL_){const m=l.height-2*this.insideCornerPaths_.height;this.steps_+=pl(h.xPos,l.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+Vn("v",m)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bh(l.width-h.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=pl(h.xPos,l.yPos+l.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bh(l.width-h.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(l){const h=l.xPos+l.width-this.highlightOffset;l instanceof FA&&l.followsStatement&&(this.steps_+=Vn("H",h)),this.RTL_&&(this.steps_+=Vn("H",h),l.height>this.highlightOffset&&(this.steps_+=Vn("V",l.yPos+l.height-this.highlightOffset)))}drawBottomRow(l){if(this.RTL_)this.steps_+=Vn("V",l.baseline-this.highlightOffset);else{const h=this.info_.bottomRow.elements[0];ft.isLeftSquareCorner(h)?this.steps_+=pl(l.xPos+this.highlightOffset,l.baseline-this.highlightOffset):ft.isLeftRoundedCorner(h)&&(this.steps_+=pl(l.xPos,l.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var l=this.info_.outputConnection;l&&(l=l.connectionOffsetY+l.height,this.RTL_?this.steps_+=pl(this.info_.startX,l):(this.steps_+=pl(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=Vn("V",l)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(l=this.info_.topRow,ft.isLeftRoundedCorner(l.elements[0])?this.steps_+=Vn("V",this.outsideCornerPaths_.height):this.steps_+=Vn("V",l.capline+this.highlightOffset))}drawInlineInput(l){const h=this.highlightOffset,m=l.xPos+l.connectionWidth;var E=l.centerline-l.height/2;const k=l.width-l.connectionWidth,z=E+h;this.RTL_?(E=l.connectionOffsetY-h,l=l.height-(l.connectionOffsetY+l.connectionHeight)+h,this.inlineSteps_+=pl(m-h,z)+Vn("v",E)+this.puzzleTabPaths_.pathDown(this.RTL_)+Vn("v",l)+Vn("h",k)):this.inlineSteps_+=pl(l.xPos+l.width+h,z)+Vn("v",l.height)+Vn("h",-k)+pl(m,E+l.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},moe=class extends YE{constructor(l,h){super(l,h),this.highlighter_=new dN(h)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const l=this.block_.pathObject;l.setPath(this.outlinePath_+`
- `+this.inlinePath_),l.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&l.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(l){this.highlighter_.drawJaggedEdge_(l),super.drawJaggedEdge_(l)}drawValueInput_(l){this.highlighter_.drawValueInput(l),super.drawValueInput_(l)}drawStatementInput_(l){this.highlighter_.drawStatementInput(l),super.drawStatementInput_(l)}drawRightSideRow_(l){this.highlighter_.drawRightSideRow(l),this.outlinePath_+=Vn("H",l.xPos+l.width)+Vn("V",l.yPos+l.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(l){this.highlighter_.drawInlineInput(l),super.drawInlineInput_(l)}positionInlineInputConnection_(l){const h=l.centerline-l.height/2;if(l.connectionModel){let m=l.xPos+l.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(m*=-1),l.connectionModel.setOffsetInBlock(m,h+l.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(l){const h=l.getLastInput();if(h!=null&&h.connectionModel){let m=l.xPos+l.statementEdge+h.notchOffset;m=this.info_.RTL?-1*m:m+this.constants_.DARK_PATH_OFFSET,h.connectionModel.setOffsetInBlock(m,l.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(l){const h=l.getLastInput();if(h&&h.connectionModel){let m=l.xPos+l.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(m*=-1),h.connectionModel.setOffsetInBlock(m,l.yPos)}}positionNextConnection_(){const l=this.info_.bottomRow;if(l.connection){const h=l.connection,m=h.xPos;h.connectionModel.setOffsetInBlock((this.info_.RTL?-m:m)+this.constants_.DARK_PATH_OFFSET/2,l.baseline+this.constants_.DARK_PATH_OFFSET)}}},_oe=class{constructor(l){this.OFFSET=.5,this.constantProvider=l,this.START_POINT=Bo(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const l=this.constantProvider.CORNER_RADIUS,h=this.OFFSET,m=(1-Math.SQRT1_2)*(l+h)-h,E=Bo(m,m)+Mr("a","0 0,0",l,ci(-m-h,l-m)),k=Mr("a","0 0,0",l+h,ci(l+h,l+h)),z=Bo(m,-m)+Mr("a","0 0,0",l+h,ci(l-m,m+h));return{width:l+h,height:l,pathTop(Oe){return Oe?E:""},pathBottom(Oe){return Oe?k:z}}}makeOutsideCorner(){const l=this.constantProvider.CORNER_RADIUS,h=this.OFFSET,m=(1-Math.SQRT1_2)*(l-h)+h,E=Bo(m,m)+Mr("a","0 0,1",l-h,ci(l-m,-m+h)),k=Bo(h,l)+Mr("a","0 0,1",l-h,ci(l,-l+h)),z=-m,Oe=Bo(m,z)+Mr("a","0 0,1",l-h,ci(-m+h,-z-l));return{height:l,topLeft(Je){return Je?E:k},bottomLeft(){return Oe}}}makePuzzleTab(){const l=this.constantProvider.TAB_WIDTH,h=this.constantProvider.TAB_HEIGHT,m=Bo(-2,-h+3.4)+Bh(-.45*l,-2.1),E=Vn("v",2.5)+Bo(.97*-l,2.5)+Cc("q",[ci(.05*-l,10),ci(.3*l,9.5)])+Bo(.67*l,-1.9)+Vn("v",2.5),k=Vn("v",-1.5)+Bo(-.92*l,-.5)+Cc("q",[ci(-.19*l,-5.5),ci(0,-11)])+Bo(.92*l,1),z=Bo(-5,h-.7)+Bh(.46*l,-2.1);return{width:l,height:h,pathUp(Oe){return Oe?m:k},pathDown(Oe){return Oe?E:z}}}makeNotch(){return{pathLeft:Vn("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Bh(5.1,2.6)+Bo(-10.2,6.8)+Bh(5.1,2.6),height:12,width:10.2}}makeStartHat(){const l=this.constantProvider.START_HAT.height,h=Bo(25,-8.7)+Cc("c",[ci(29.7,-6.2),ci(57.2,-.5),ci(75,8.7)]),m=Cc("c",[ci(17.8,-9.2),ci(45.3,-14.9),ci(75,-8.7)])+pl(100.5,l+.5);return{path(E){return E?h:m}}}},voe=class extends xA{constructor(l,h){super(l,h),this.constants_=l,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},boe=class extends jE{constructor(l,h){super(l,h),this.constants_=l,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Toe=class extends wT{constructor(l,h){super(l,h),this.renderer_=l}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof kc||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(l,h){this.isInline&&l instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(h.elements.push(new voe(this.constants_,l)),h.hasInlineInput=!0):l instanceof kc?(h.elements.push(new boe(this.constants_,l)),h.hasStatement=!0):l instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(h.elements.push(new LL(this.constants_,l)),h.hasExternalInput=!0):(l instanceof ef||l instanceof _g)&&(h.minHeight=Math.max(h.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),h.hasDummyInput=!0),this.isInline||h.align!==null||(h.align=l.align)}addElemSpacing_(){let l=!1;for(let m=0,E;E=this.rows[m];m++)E.hasExternalInput&&(l=!0);for(let m=0,E;E=this.rows[m];m++){var h=E.elements;if(E.elements=[],E.startsWithElemSpacer()&&E.elements.push(new hu(this.constants_,this.getInRowSpacing_(null,h[0]))),h.length){for(let k=0;k<h.length-1;k++){E.elements.push(h[k]);const z=this.getInRowSpacing_(h[k],h[k+1]);E.elements.push(new hu(this.constants_,z))}E.elements.push(h[h.length-1]),E.endsWithElemSpacer()&&(h=this.getInRowSpacing_(h[h.length-1],null),l&&E.hasDummyInput&&(h+=this.constants_.TAB_WIDTH),E.elements.push(new hu(this.constants_,h)))}}}getInRowSpacing_(l,h){if(!l)return h&&ft.isField(h)&&h.isEditable?this.constants_.MEDIUM_PADDING:h&&ft.isInlineInput(h)?this.constants_.MEDIUM_LARGE_PADDING:h&&ft.isStatementInput(h)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:this.constants_.LARGE_PADDING;if(!ft.isInput(l)&&(!h||ft.isStatementInput(h)))return ft.isField(l)&&l.isEditable?this.constants_.MEDIUM_PADDING:ft.isIcon(l)?2*this.constants_.LARGE_PADDING+1:ft.isHat(l)?this.constants_.NO_PADDING:ft.isPreviousOrNextConnection(l)?this.constants_.LARGE_PADDING:ft.isLeftRoundedCorner(l)?this.constants_.MIN_BLOCK_WIDTH:ft.isJaggedEdge(l)?this.constants_.NO_PADDING:this.constants_.LARGE_PADDING;if(ft.isInput(l)&&!h){if(ft.isExternalInput(l))return this.constants_.NO_PADDING;if(ft.isInlineInput(l))return this.constants_.LARGE_PADDING;if(ft.isStatementInput(l))return this.constants_.NO_PADDING}if(!ft.isInput(l)&&h&&ft.isInput(h)){if(ft.isField(l)&&l.isEditable){if(ft.isInlineInput(h)||ft.isExternalInput(h))return this.constants_.SMALL_PADDING}else{if(ft.isInlineInput(h)||ft.isExternalInput(h))return this.constants_.MEDIUM_LARGE_PADDING;if(ft.isStatementInput(h))return this.constants_.LARGE_PADDING}return this.constants_.LARGE_PADDING-1}if(ft.isIcon(l)&&h&&!ft.isInput(h))return this.constants_.LARGE_PADDING;if(ft.isInlineInput(l)&&h&&ft.isField(h))return h.isEditable?this.constants_.MEDIUM_PADDING:this.constants_.LARGE_PADDING;if(ft.isLeftSquareCorner(l)&&h){if(ft.isHat(h))return this.constants_.NO_PADDING;if(ft.isPreviousConnection(h))return h.notchOffset;if(ft.isNextConnection(h))return h.notchOffset+(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2}if(ft.isLeftRoundedCorner(l)&&h){if(ft.isPreviousConnection(h))return h.notchOffset-this.constants_.CORNER_RADIUS;if(ft.isNextConnection(h))return h.notchOffset-this.constants_.CORNER_RADIUS+(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2}return ft.isField(l)&&h&&ft.isField(h)&&l.isEditable===h.isEditable||h&&ft.isJaggedEdge(h)?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}getSpacerRowHeight_(l,h){return ft.isTopRow(l)&&ft.isBottomRow(h)?this.constants_.EMPTY_BLOCK_SPACER_HEIGHT:ft.isTopRow(l)||ft.isBottomRow(h)?this.constants_.NO_PADDING:l.hasExternalInput&&h.hasExternalInput?this.constants_.LARGE_PADDING:!l.hasStatement&&h.hasStatement?this.constants_.BETWEEN_STATEMENT_PADDING_Y:l.hasStatement&&h.hasStatement||!l.hasStatement&&h.hasDummyInput||l.hasDummyInput?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}getElemCenterline_(l,h){if(ft.isSpacer(h))return l.yPos+h.height/2;if(ft.isBottomRow(l))return l=l.yPos+l.height-l.descenderHeight,ft.isNextConnection(h)?l+h.height/2:l-h.height/2;if(ft.isTopRow(l))return ft.isHat(h)?l.capline-h.height/2:l.capline+h.height/2;let m=l.yPos;return ft.isField(h)||ft.isIcon(h)?(m+=h.height/2,(l.hasInlineInput||l.hasStatement)&&h.height+this.constants_.TALL_INPUT_FIELD_OFFSET_Y<=l.height&&(m+=this.constants_.TALL_INPUT_FIELD_OFFSET_Y)):m=ft.isInlineInput(h)?m+h.height/2:m+l.height/2,m}alignRowElements_(){if(this.isInline){var l=0,h=new WeakMap,m=null;for(let E=this.rows.length-1,k;k=this.rows[E];E--)h.set(k,l),ft.isInputRow(k)&&(k.hasStatement&&this.alignStatementRow_(k),m&&m.hasStatement&&k.width<m.width?h.set(k,m.width):l=k.hasStatement?k.width:Math.max(l,k.width),m=k);l=0;for(let E=0,k;k=this.rows[E];E++)k.hasStatement?l=this.getDesiredRowWidth_(k):ft.isSpacer(k)?k.width=Math.max(l,h.get(k)):(m=k.width,l=Math.max(l,h.get(k))-m,0<l&&this.addAlignmentPadding_(k,l),l=k.width)}else super.alignRowElements_()}getDesiredRowWidth_(l){return this.isInline&&l.hasStatement?this.statementEdge+this.constants_.MAX_BOTTOM_WIDTH+this.startX:super.getDesiredRowWidth_(l)}finalize_(){let l=0,h=0;for(let E=0,k;k=this.rows[E];E++){k.yPos=h,k.xPos=this.startX,h+=k.height,l=Math.max(l,k.widthWithConnectedBlocks);var m=h-this.topRow.ascenderHeight;k===this.bottomRow&&m<this.constants_.MIN_BLOCK_HEIGHT&&(m=this.constants_.MIN_BLOCK_HEIGHT-m,this.bottomRow.height+=m,h+=m),this.recordElemPositions_(k)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(m=this.block_.nextConnection.targetBlock())&&(l=Math.max(l,m.getHeightWidth().width-this.constants_.DARK_PATH_OFFSET)),this.bottomRow.baseline=h-this.bottomRow.descenderHeight,this.widthWithChildren=l+this.startX+this.constants_.DARK_PATH_OFFSET,this.width+=this.constants_.DARK_PATH_OFFSET,this.height=h+this.constants_.DARK_PATH_OFFSET,this.startY=this.topRow.capline}},Coe=class extends qE{constructor(l,h,m){super(l,h,m),this.constants=m,this.colourDark="#000000",this.svgPathDark=He(pt.PATH,{class:"blocklyPathDark",transform:"translate(1,1)"}),this.svgRoot.insertBefore(this.svgPathDark,this.svgPath),this.svgPathLight=He(pt.PATH,{class:"blocklyPathLight"},this.svgRoot)}setPath(l){this.svgPath.setAttribute("d",l),this.svgPathDark.setAttribute("d",l)}setHighlightPath(l){this.svgPathLight.setAttribute("d",l)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)"),this.svgPathLight.setAttribute("transform","scale(-1 1)"),this.svgPathDark.setAttribute("transform","translate(1,1) scale(-1 1)")}applyColour(l){if(this.svgPathLight.style.display="",this.svgPathDark.style.display="",!this.style.colourTertiary)throw Error("The renderer did not properly initialize the tertiary colour of the block style");this.svgPathLight.setAttribute("stroke",this.style.colourTertiary),this.svgPathDark.setAttribute("fill",this.colourDark),super.applyColour(l),this.svgPath.setAttribute("stroke","none")}setStyle(l){this.style=l,this.colourDark=O_("#000",this.style.colourPrimary,.2)||this.colourDark}updateHighlighted(l){l?(this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"),this.svgPathLight.style.display="none"):(this.svgPath.setAttribute("filter","none"),this.svgPathLight.style.display="inline")}updateShadow_(l){if(l){if(this.svgPathLight.style.display="none",!this.style.colourSecondary)throw Error("The renderer did not properly initialize the secondary colour of the block style block style");this.svgPathDark.setAttribute("fill",this.style.colourSecondary),this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary)}}updateDisabled_(l){super.updateDisabled_(l),l&&this.svgPath.setAttribute("stroke","none")}},yoe=class extends JE{constructor(l){super(l),this.highlightConstants=null}init(l,h){super.init(l,h),this.highlightConstants=this.makeHighlightConstants_(),this.highlightConstants.init()}refreshDom(l,h){super.refreshDom(l,h),this.getHighlightConstants().init()}makeConstants_(){return new of}makeRenderInfo_(l){return new Toe(this,l)}makeDrawer_(l,h){return new moe(l,h)}makePathObject(l,h){return new Coe(l,h,this.getConstants())}makeHighlightConstants_(){return new _oe(this.getConstants())}getHighlightConstants(){if(!this.highlightConstants)throw Error("Cannot access the highlight constants because init has not been called");return this.highlightConstants}};Ql("geras",yoe);var Gp={};Gp.ConstantProvider=of,Gp.Drawer=moe,Gp.HighlightConstantProvider=_oe,Gp.Highlighter=dN,Gp.InlineInput=voe,Gp.PathObject=Coe,Gp.RenderInfo=Toe,Gp.Renderer=yoe,Gp.StatementInput=boe;var Eoe=class extends XE{constructor(){super(),Tt("Blockly.minimalist.ConstantProvider","v10","v11","Blockly.blockRendering.ConstantProvider")}},Soe=class extends YE{constructor(l,h){super(l,h),Tt("Blockly.minimalist.Drawer","v10","v11","Blockly.blockRendering.Drawer")}},woe=class extends wT{constructor(l,h){super(l,h),Tt("Blockly.minimalist.RenderInfo","v10","v11","Blockly.blockRendering.RenderInfo")}getRenderer(){return this.renderer_}},Ioe=class extends JE{constructor(l){super(l),Tt("Blockly.minimalist.Renderer","v10","v11","Blockly.blockRendering.Renderer")}makeConstants_(){return new Eoe}makeRenderInfo_(l){return new woe(this,l)}makeDrawer_(l,h){return new Soe(l,h)}};Ql("minimalist",Ioe);var hN={};hN.ConstantProvider=Eoe,hN.Drawer=Soe,hN.RenderInfo=woe,hN.Renderer=Ioe;var Loe=class extends wT{constructor(l,h){super(l,h)}getRenderer(){return this.renderer_}addElemSpacing_(){let l=!1;for(var h=0;h<this.rows.length;h++)if(this.rows[h].hasExternalInput){l=!0;break}for(h=0;h<this.rows.length;h++){const E=this.rows[h];var m=E.elements;if(E.elements=[],E.startsWithElemSpacer()&&E.elements.push(new hu(this.constants_,this.getInRowSpacing_(null,m[0]))),m.length){for(let k=0;k<m.length-1;k++){E.elements.push(m[k]);const z=this.getInRowSpacing_(m[k],m[k+1]);E.elements.push(new hu(this.constants_,z))}E.elements.push(m[m.length-1]),E.endsWithElemSpacer()&&(m=this.getInRowSpacing_(m[m.length-1],null),l&&E.hasDummyInput&&(m+=this.constants_.TAB_WIDTH),E.elements.push(new hu(this.constants_,m)))}}}getInRowSpacing_(l,h){if(!l)return h&&ft.isField(h)&&h.isEditable?this.constants_.MEDIUM_PADDING:h&&ft.isInlineInput(h)?this.constants_.MEDIUM_LARGE_PADDING:h&&ft.isStatementInput(h)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:this.constants_.LARGE_PADDING;if(!ft.isInput(l)&&!h)return ft.isField(l)&&l.isEditable?this.constants_.MEDIUM_PADDING:ft.isIcon(l)?2*this.constants_.LARGE_PADDING+1:ft.isHat(l)?this.constants_.NO_PADDING:ft.isPreviousOrNextConnection(l)?this.constants_.LARGE_PADDING:ft.isLeftRoundedCorner(l)?this.constants_.MIN_BLOCK_WIDTH:ft.isJaggedEdge(l)?this.constants_.NO_PADDING:this.constants_.LARGE_PADDING;if(ft.isInput(l)&&!h){if(ft.isExternalInput(l))return this.constants_.NO_PADDING;if(ft.isInlineInput(l))return this.constants_.LARGE_PADDING;if(ft.isStatementInput(l))return this.constants_.NO_PADDING}if(!ft.isInput(l)&&h&&ft.isInput(h)){if(ft.isField(l)&&l.isEditable){if(ft.isInlineInput(h)||ft.isExternalInput(h))return this.constants_.SMALL_PADDING}else{if(ft.isInlineInput(h)||ft.isExternalInput(h))return this.constants_.MEDIUM_LARGE_PADDING;if(ft.isStatementInput(h))return this.constants_.LARGE_PADDING}return this.constants_.LARGE_PADDING-1}if(ft.isIcon(l)&&h&&!ft.isInput(h))return this.constants_.LARGE_PADDING;if(ft.isInlineInput(l)&&h&&ft.isField(h))return h.isEditable?this.constants_.MEDIUM_PADDING:this.constants_.LARGE_PADDING;if(ft.isLeftSquareCorner(l)&&h){if(ft.isHat(h))return this.constants_.NO_PADDING;if(ft.isPreviousConnection(h)||ft.isNextConnection(h))return h.notchOffset}return ft.isLeftRoundedCorner(l)&&h?h.notchOffset-this.constants_.CORNER_RADIUS:ft.isField(l)&&h&&ft.isField(h)&&l.isEditable===h.isEditable||h&&ft.isJaggedEdge(h)?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}getSpacerRowHeight_(l,h){return ft.isTopRow(l)&&ft.isBottomRow(h)?this.constants_.EMPTY_BLOCK_SPACER_HEIGHT:ft.isTopRow(l)||ft.isBottomRow(h)?this.constants_.NO_PADDING:l.hasExternalInput&&h.hasExternalInput?this.constants_.LARGE_PADDING:!l.hasStatement&&h.hasStatement?this.constants_.BETWEEN_STATEMENT_PADDING_Y:l.hasStatement&&h.hasStatement||l.hasDummyInput||h.hasDummyInput?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING}getElemCenterline_(l,h){if(ft.isSpacer(h))return l.yPos+h.height/2;if(ft.isBottomRow(l))return l=l.yPos+l.height-l.descenderHeight,ft.isNextConnection(h)?l+h.height/2:l-h.height/2;if(ft.isTopRow(l))return ft.isHat(h)?l.capline-h.height/2:l.capline+h.height/2;let m=l.yPos;return m=ft.isField(h)&&l.hasStatement?m+(this.constants_.TALL_INPUT_FIELD_OFFSET_Y+h.height/2):m+l.height/2}finalize_(){let l=0,h=0;for(var m=0;m<this.rows.length;m++){const k=this.rows[m];k.yPos=h,k.xPos=this.startX,h+=k.height,l=Math.max(l,k.widthWithConnectedBlocks);var E=h-this.topRow.ascenderHeight;k===this.bottomRow&&E<this.constants_.MIN_BLOCK_HEIGHT&&(E=this.constants_.MIN_BLOCK_HEIGHT-E,this.bottomRow.height+=E,h+=E),this.recordElemPositions_(k)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(m=this.block_.nextConnection.targetBlock())&&(l=Math.max(l,m.getHeightWidth().width)),this.bottomRow.baseline=h-this.bottomRow.descenderHeight,this.widthWithChildren=l+this.startX,this.height=h,this.startY=this.topRow.capline}},Ooe=class extends JE{constructor(l){super(l)}makeRenderInfo_(l){return new Loe(this,l)}};Ql("thrasos",Ooe);var QG={};QG.RenderInfo=Loe,QG.Renderer=Ooe;var ZAe={colour_blocks:{colourPrimary:"#CF63CF",colourSecondary:"#C94FC9",colourTertiary:"#BD42BD"},list_blocks:{colourPrimary:"#9966FF",colourSecondary:"#855CD6",colourTertiary:"#774DCB"},logic_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC"},loop_blocks:{colourPrimary:"#0fBD8C",colourSecondary:"#0DA57A",colourTertiary:"#0B8E69"},math_blocks:{colourPrimary:"#59C059",colourSecondary:"#46B946",colourTertiary:"#389438"},procedure_blocks:{colourPrimary:"#FF6680",colourSecondary:"#FF4D6A",colourTertiary:"#FF3355"},text_blocks:{colourPrimary:"#FFBF00",colourSecondary:"#E6AC00",colourTertiary:"#CC9900"},variable_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},variable_dynamic_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},hat_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC",hat:"cap"}},eNe={colour_category:{colour:"#CF63CF"},list_category:{colour:"#9966FF"},logic_category:{colour:"#4C97FF"},loop_category:{colour:"#0fBD8C"},math_category:{colour:"#59C059"},procedure_category:{colour:"#FF6680"},text_category:{colour:"#FFBF00"},variable_category:{colour:"#FF8C1A"},variable_dynamic_category:{colour:"#FF8C1A"}},tNe=new q_("zelos",ZAe,eNe),nNe={Classic:TL,Zelos:tNe},ZG=class{constructor(l,h,m){this.id_=l.toolboxitemid||V(),this.level_=(this.parent_=m||null)?this.parent_.getLevel()+1:0,this.toolboxItemDef_=l,this.parentToolbox_=h,this.workspace_=this.parentToolbox_.getWorkspace()}init(){}getDiv(){return null}getClickTarget(){return null}getId(){return this.id_}getParent(){return null}getLevel(){return this.level_}isSelectable(){return!1}isCollapsible(){return!1}dispose(){}setVisible_(l){}},vg=class extends ZG{constructor(l,h,m){super(l,h,m),this.colour_=this.name_="",this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null,this.isDisabled_=this.isHidden_=!1,this.flyoutItems_=[],this.cssConfig_=this.makeDefaultCssConfig_()}init(){this.parseCategoryDef_(this.toolboxItemDef_),this.parseContents_(this.toolboxItemDef_),this.createDom_(),this.toolboxItemDef_.hidden==="true"&&this.hide()}makeDefaultCssConfig_(){return{container:"blocklyToolboxCategory",row:"blocklyTreeRow",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyTreeIcon",label:"blocklyTreeLabel",contents:"blocklyToolboxContents",selected:"blocklyTreeSelected",openicon:"blocklyTreeIconOpen",closedicon:"blocklyTreeIconClosed"}}parseContents_(l){if("custom"in l)this.flyoutItems_=l.custom;else if(l=l.contents)for(let h=0;h<l.length;h++){const m=l[h];Array.isArray(this.flyoutItems_)&&this.flyoutItems_.push(m)}}parseCategoryDef_(l){this.name_="name"in l?Tr(l.name):"",this.colour_=this.getColour_(l),Object.assign(this.cssConfig_,l.cssconfig||l.cssConfig)}createDom_(){this.htmlDiv_=this.createContainer_(),su(this.htmlDiv_,Lc.TREEITEM),bo(this.htmlDiv_,Ao.SELECTED,!1),bo(this.htmlDiv_,Ao.LEVEL,this.level_+1),this.rowDiv_=this.createRowContainer_(),this.rowDiv_.style.pointerEvents="auto",this.htmlDiv_.appendChild(this.rowDiv_),this.rowContents_=this.createRowContentsContainer_(),this.rowContents_.style.pointerEvents="none",this.rowDiv_.appendChild(this.rowContents_),this.iconDom_=this.createIconDom_(),su(this.iconDom_,Lc.PRESENTATION),this.rowContents_.appendChild(this.iconDom_),this.labelDom_=this.createLabelDom_(this.name_),this.rowContents_.appendChild(this.labelDom_);const l=this.labelDom_.getAttribute("id");return l&&bo(this.htmlDiv_,Ao.LABELLEDBY,l),this.addColourBorder_(this.colour_),this.htmlDiv_}createContainer_(){const l=document.createElement("div"),h=this.cssConfig_.container;return h&&ke(l,h),l}createRowContainer_(){const l=document.createElement("div");var h=this.cssConfig_.row;return h&&ke(l,h),h=`${vg.nestedPadding*this.getLevel()}px`,this.workspace_.RTL?l.style.paddingRight=h:l.style.paddingLeft=h,l}createRowContentsContainer_(){const l=document.createElement("div"),h=this.cssConfig_.rowcontentcontainer;return h&&ke(l,h),l}createIconDom_(){const l=document.createElement("span");if(!this.parentToolbox_.isHorizontal()){const h=this.cssConfig_.icon;h&&ke(l,h)}return l.style.display="inline-block",l}createLabelDom_(l){const h=document.createElement("span");return h.setAttribute("id",this.getId()+".label"),h.textContent=l,(l=this.cssConfig_.label)&&ke(h,l),h}refreshTheme(){this.colour_=this.getColour_(this.toolboxItemDef_),this.addColourBorder_(this.colour_)}addColourBorder_(l){l&&(l=vg.borderWidth+"px solid "+(l||"#ddd"),this.workspace_.RTL?this.rowDiv_.style.borderRight=l:this.rowDiv_.style.borderLeft=l)}getColour_(l){const h=l.categorystyle||l.categoryStyle;if((l=l.colour)&&h)console.warn('Toolbox category "'+this.name_+'" must not have both a style and a colour');else{if(h)return this.getColourfromStyle_(h);if(l)return this.parseColour_(l)}return""}getColourfromStyle_(l){var h=this.workspace_.getTheme();if(l&&h){if((h=h.categoryStyles[l])&&h.colour)return this.parseColour_(h.colour);console.warn('Style "'+l+'" must exist and contain a colour value')}return""}getClickTarget(){return this.rowDiv_}parseColour_(l){if(l=Tr(l),l==null||l==="")return"";var h=Number(l);return isNaN(h)?(h=zu(l))?h:(console.warn('Toolbox category "'+this.name_+'" has unrecognized colour attribute: '+l),""):vk(h)}openIcon_(l){if(l){var h=this.cssConfig_.closedicon;h&&ot(l,h),(h=this.cssConfig_.openicon)&&ke(l,h)}}closeIcon_(l){if(l){var h=this.cssConfig_.openicon;h&&ot(l,h),(h=this.cssConfig_.closedicon)&&ke(l,h)}}setVisible_(l){this.htmlDiv_.style.display=l?"block":"none",this.isHidden_=!l,this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}hide(){this.setVisible_(!1)}show(){this.setVisible_(!0)}isVisible(){return!this.isHidden_&&this.allAncestorsExpanded_()}allAncestorsExpanded_(){let l=this;for(;l.getParent();)if(l=l.getParent(),!l.isExpanded())return!1;return!0}isSelectable(){return this.isVisible()&&!this.isDisabled_}onClick(l){}setSelected(l){if(this.rowDiv_){var h=this.cssConfig_.selected;if(l){const m=this.parseColour_(vg.defaultBackgroundColour);this.rowDiv_.style.backgroundColor=this.colour_||m,h&&ke(this.rowDiv_,h)}else this.rowDiv_.style.backgroundColor="",h&&Ct(this.rowDiv_,h);bo(this.htmlDiv_,Ao.SELECTED,l)}}setDisabled(l){this.isDisabled_=l,this.getDiv().setAttribute("disabled",`${l}`),l?this.getDiv().setAttribute("disabled","true"):this.getDiv().removeAttribute("disabled")}getName(){return this.name_}getParent(){return this.parent_}getDiv(){return this.htmlDiv_}getContents(){return this.flyoutItems_}updateFlyoutContents(l){this.flyoutItems_=[],this.toolboxItemDef_=typeof l=="string"?{kind:this.toolboxItemDef_.kind,custom:l,id:this.toolboxItemDef_.id,categorystyle:this.toolboxItemDef_.categorystyle,colour:this.toolboxItemDef_.colour,cssconfig:this.toolboxItemDef_.cssconfig,hidden:this.toolboxItemDef_.hidden}:{kind:this.toolboxItemDef_.kind,name:"name"in this.toolboxItemDef_?this.toolboxItemDef_.name:"",contents:un(l),id:this.toolboxItemDef_.id,categorystyle:this.toolboxItemDef_.categorystyle,colour:this.toolboxItemDef_.colour,cssconfig:this.toolboxItemDef_.cssconfig,hidden:this.toolboxItemDef_.hidden},this.parseContents_(this.toolboxItemDef_)}dispose(){Ot(this.htmlDiv_)}};vg.registrationName="category",vg.nestedPadding=19,vg.borderWidth=8,vg.defaultBackgroundColour="#57e",Xe(`
- .blocklyTreeRow:not(.blocklyTreeSelected):hover {
- background-color: rgba(255, 255, 255, .2);
- }
- .blocklyToolboxDiv[layout="h"] .blocklyToolboxCategory {
- margin: 1px 5px 1px 0;
- }
- .blocklyToolboxDiv[dir="RTL"][layout="h"] .blocklyToolboxCategory {
- margin: 1px 0 1px 5px;
- }
- .blocklyTreeRow {
- height: 22px;
- line-height: 22px;
- margin-bottom: 3px;
- padding-right: 8px;
- white-space: nowrap;
- }
- .blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {
- margin-left: 8px;
- padding-right: 0;
- }
- .blocklyTreeIcon {
- background-image: url(<<<PATH>>>/sprites.png);
- height: 16px;
- vertical-align: middle;
- visibility: hidden;
- width: 16px;
- }
- .blocklyTreeIconClosed {
- background-position: -32px -1px;
- }
- .blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed {
- background-position: 0 -1px;
- }
- .blocklyTreeSelected>.blocklyTreeIconClosed {
- background-position: -32px -17px;
- }
- .blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed {
- background-position: 0 -17px;
- }
- .blocklyTreeIconOpen {
- background-position: -16px -1px;
- }
- .blocklyTreeSelected>.blocklyTreeIconOpen {
- background-position: -16px -17px;
- }
- .blocklyTreeLabel {
- cursor: default;
- font: 16px sans-serif;
- padding: 0 3px;
- vertical-align: middle;
- }
- .blocklyToolboxDelete .blocklyTreeLabel {
- cursor: url("<<<PATH>>>/handdelete.cur"), auto;
- }
- .blocklyTreeSelected .blocklyTreeLabel {
- color: #fff;
- }
- `),i(Jt.TOOLBOX_ITEM,vg.registrationName,vg);var fN=class extends ZG{constructor(l,h){super(l,h),this.cssConfig_={container:"blocklyTreeSeparator"},this.htmlDiv_=null,Object.assign(this.cssConfig_,l.cssconfig||l.cssConfig)}init(){this.createDom_()}createDom_(){const l=document.createElement("div"),h=this.cssConfig_.container;return h&&ke(l,h),this.htmlDiv_=l}getDiv(){return this.htmlDiv_}dispose(){Ot(this.htmlDiv_)}};fN.registrationName="sep",Xe(`
- .blocklyTreeSeparator {
- border-bottom: solid #e5e5e5 1px;
- height: 0;
- margin: 5px 0;
- }
- .blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator {
- border-right: solid #e5e5e5 1px;
- border-bottom: none;
- height: auto;
- margin: 0 5px 0 5px;
- padding: 5px 0;
- width: 0;
- }
- `),i(Jt.TOOLBOX_ITEM,fN.registrationName,fN);var HL=class extends vg{constructor(l,h,m){super(l,h,m),this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[]}makeDefaultCssConfig_(){const l=super.makeDefaultCssConfig_();return l.contents="blocklyToolboxContents",l}parseContents_(l){if("custom"in l)this.flyoutItems_=l.custom;else{const h=l.contents;if(h){this.flyoutItems_=[],l=!0;for(let m=0;m<h.length;m++){const E=h[m];!a(Jt.TOOLBOX_ITEM,E.kind)||E.kind.toLowerCase()===fN.registrationName&&l?(this.flyoutItems_.push(E),l=!0):(this.createToolboxItem_(E),l=!1)}}}}createToolboxItem_(l){let h=l.kind;h.toUpperCase()==="CATEGORY"&&pn(l)&&(h=HL.registrationName),l=new(c(Jt.TOOLBOX_ITEM,h))(l,this.parentToolbox_,this),this.toolboxItems_.push(l)}init(){super.init(),this.setExpanded(this.toolboxItemDef_.expanded==="true"||this.toolboxItemDef_.expanded===!0)}createDom_(){super.createDom_();const l=this.getChildToolboxItems();return this.subcategoriesDiv_=this.createSubCategoriesDom_(l),su(this.subcategoriesDiv_,Lc.GROUP),this.htmlDiv_.appendChild(this.subcategoriesDiv_),this.closeIcon_(this.iconDom_),bo(this.htmlDiv_,Ao.EXPANDED,!1),this.htmlDiv_}createIconDom_(){const l=document.createElement("span");if(!this.parentToolbox_.isHorizontal()){const h=this.cssConfig_.icon;h&&ke(l,h),l.style.visibility="visible"}return l.style.display="inline-block",l}createSubCategoriesDom_(l){const h=document.createElement("div");h.style.display="none";var m=this.cssConfig_.contents;for(m&&ke(h,m),m=0;m<l.length;m++){const E=l[m];E.init();const k=E.getDiv();if(h.appendChild(k),E.getClickTarget){let z;(z=E.getClickTarget())==null||z.setAttribute("id",E.getId())}}return h}setExpanded(l){if(this.expanded_!==l){if(this.expanded_=l)this.subcategoriesDiv_.style.display="block",this.openIcon_(this.iconDom_);else{let h;(h=this.parentToolbox_.getFlyout())==null||h.setVisible(!1),this.subcategoriesDiv_.style.display="none",this.closeIcon_(this.iconDom_)}bo(this.htmlDiv_,Ao.EXPANDED,l),this.parentToolbox_.handleToolboxItemResize()}}setVisible_(l){this.htmlDiv_.style.display=l?"block":"none";const h=this.getChildToolboxItems();for(let m=0;m<h.length;m++)h[m].setVisible_(l);this.isHidden_=!l,this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}isExpanded(){return this.expanded_}isCollapsible(){return!0}onClick(l){this.toggleExpanded()}toggleExpanded(){this.setExpanded(!this.expanded_)}getDiv(){return this.htmlDiv_}getChildToolboxItems(){return this.toolboxItems_}};HL.registrationName="collapsibleCategory",i(Jt.TOOLBOX_ITEM,HL.registrationName,HL);var Roe=class extends kL{constructor(l){super(),this.id="toolbox",this.contentsDiv_=this.HtmlDiv=null,this.isVisible_=!1,this.contents_=[],this.height_=this.width_=0,this.previouslySelectedItem_=this.selectedItem_=this.flyout_=null,this.boundEvents_=[],this.workspace_=l,this.toolboxDef_=l.options.languageTree||{contents:[]},this.horizontalLayout_=l.options.horizontalLayout,this.RTL=l.options.RTL,this.contentMap_=Object.create(null),this.toolboxPosition=l.options.toolboxPosition}onShortcut(l){return!1}init(){var l=this.workspace_;const h=l.getParentSvg();this.flyout_=this.createFlyout_(),this.HtmlDiv=this.createDom_(this.workspace_),En(this.flyout_.createDom("svg"),h),this.setVisible(!0),this.flyout_.init(l),this.render(this.toolboxDef_),l=l.getThemeManager(),l.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color"),l.subscribe(this.HtmlDiv,"toolboxForegroundColour","color"),this.workspace_.getComponentManager().addComponent({component:this,weight:1,capabilities:[Qr.Capability.AUTOHIDEABLE,Qr.Capability.DELETE_AREA,Qr.Capability.DRAG_TARGET]})}createDom_(l){l=l.getParentSvg();const h=this.createContainer_();return this.contentsDiv_=this.createContentsContainer_(),this.contentsDiv_.tabIndex=0,su(this.contentsDiv_,Lc.TREE),h.appendChild(this.contentsDiv_),l.parentNode.insertBefore(h,l),this.attachEvents_(h,this.contentsDiv_),h}createContainer_(){const l=document.createElement("div");return l.setAttribute("layout",this.isHorizontal()?"h":"v"),ke(l,"blocklyToolboxDiv"),ke(l,"blocklyNonSelectable"),l.setAttribute("dir",this.RTL?"RTL":"LTR"),l}createContentsContainer_(){const l=document.createElement("div");return ke(l,"blocklyToolboxContents"),this.isHorizontal()&&(l.style.flexDirection="row"),l}attachEvents_(l,h){l=ee(l,"pointerdown",this,this.onClick_,!1),this.boundEvents_.push(l),h=ee(h,"keydown",this,this.onKeyDown_,!1),this.boundEvents_.push(h)}onClick_(l){if(at(l)||l.target===this.HtmlDiv)C().hideChaff(!1);else{var h=l.target.getAttribute("id");h&&(h=this.getToolboxItemById(h),h.isSelectable()&&(this.setSelectedItem(h),h.onClick(l))),C().hideChaff(!0)}Ve()}onKeyDown_(l){let h=!1;switch(l.key){case"ArrowDown":h=this.selectNext_();break;case"ArrowUp":h=this.selectPrevious_();break;case"ArrowLeft":h=this.selectParent_();break;case"ArrowRight":h=this.selectChild_();break;case"Enter":case" ":this.selectedItem_&&this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),h=!0);break;default:h=!1}!h&&this.selectedItem_&&this.selectedItem_.onKeyDown&&(h=this.selectedItem_.onKeyDown(l)),h&&l.preventDefault()}createFlyout_(){const l=this.workspace_,h=new Jo({parentWorkspace:l,rtl:l.RTL,oneBasedIndex:l.options.oneBasedIndex,horizontalLayout:l.horizontalLayout,renderer:l.options.renderer,rendererOverrides:l.options.rendererOverrides,move:{scrollbars:!0}});return h.toolboxPosition=l.options.toolboxPosition,new(l.horizontalLayout?f(Jt.FLYOUTS_HORIZONTAL_TOOLBOX,l.options,!0):f(Jt.FLYOUTS_VERTICAL_TOOLBOX,l.options,!0))(h)}render(l){this.toolboxDef_=l;for(let h=0;h<this.contents_.length;h++){const m=this.contents_[h];m&&m.dispose()}this.contents_=[],this.contentMap_=Object.create(null),this.renderContents_(l.contents),this.position(),this.handleToolboxItemResize()}renderContents_(l){const h=document.createDocumentFragment();for(let m=0;m<l.length;m++)this.createToolboxItem_(l[m],h);this.contentsDiv_.appendChild(h)}createToolboxItem_(l,h){var m=l.kind;m.toUpperCase()==="CATEGORY"&&pn(l)&&(m=HL.registrationName),(m=c(Jt.TOOLBOX_ITEM,m.toLowerCase()))&&(l=new m(l,this),l.init(),this.addToolboxItem_(l),(m=l.getDiv())&&h.appendChild(m),l.getClickTarget()&&l.getClickTarget().setAttribute("id",l.getId()))}addToolboxItem_(l){if(this.contents_.push(l),this.contentMap_[l.getId()]=l,l.isCollapsible()){l=l.getChildToolboxItems();for(let h=0;h<l.length;h++)this.addToolboxItem_(l[h])}}getToolboxItems(){return this.contents_}addStyle(l){l&&this.HtmlDiv&&ke(this.HtmlDiv,l)}removeStyle(l){l&&this.HtmlDiv&&Ct(this.HtmlDiv,l)}getClientRect(){if(!this.HtmlDiv||!this.isVisible_)return null;var l=this.HtmlDiv.getBoundingClientRect();const h=l.top,m=h+l.height,E=l.left;return l=E+l.width,this.toolboxPosition===Fi.TOP?new lo(-1e7,m,-1e7,1e7):this.toolboxPosition===Fi.BOTTOM?new lo(h,1e7,-1e7,1e7):this.toolboxPosition===Fi.LEFT?new lo(-1e7,1e7,-1e7,l):new lo(-1e7,1e7,E,1e7)}wouldDelete(l,h){return l instanceof tf?this.updateWouldDelete_(!l.getParent()&&l.isDeletable()):this.updateWouldDelete_(l.isDeletable()),this.wouldDelete_}onDragEnter(l){this.updateCursorDeleteStyle_(!0)}onDragExit(l){this.updateCursorDeleteStyle_(!1)}onDrop(l){this.updateCursorDeleteStyle_(!1)}updateWouldDelete_(l){l!==this.wouldDelete_&&(this.updateCursorDeleteStyle_(!1),this.wouldDelete_=l,this.updateCursorDeleteStyle_(!0))}updateCursorDeleteStyle_(l){const h=this.wouldDelete_?"blocklyToolboxDelete":"blocklyToolboxGrab";l?this.addStyle(h):this.removeStyle(h)}getToolboxItemById(l){return this.contentMap_[l]||null}getWidth(){return this.width_}getHeight(){return this.height_}getFlyout(){return this.flyout_}getWorkspace(){return this.workspace_}getSelectedItem(){return this.selectedItem_}getPreviouslySelectedItem(){return this.previouslySelectedItem_}isHorizontal(){return this.horizontalLayout_}position(){const l=this.workspace_.getMetrics(),h=this.HtmlDiv;h&&(this.horizontalLayout_?(h.style.left="0",h.style.height="auto",h.style.width="100%",this.height_=h.offsetHeight,this.width_=l.viewWidth,this.toolboxPosition===Fi.TOP?h.style.top="0":h.style.bottom="0"):(this.toolboxPosition===Fi.RIGHT?h.style.right="0":h.style.left="0",h.style.height="100%",this.width_=h.offsetWidth,this.height_=l.viewHeight),this.flyout_.position())}handleToolboxItemResize(){const l=this.workspace_,h=this.HtmlDiv.getBoundingClientRect();l.translate(this.toolboxPosition===Fi.LEFT?l.scrollX+h.width:l.scrollX,this.toolboxPosition===Fi.TOP?l.scrollY+h.height:l.scrollY),A(l)}clearSelection(){this.setSelectedItem(null)}refreshTheme(){for(let l=0;l<this.contents_.length;l++){const h=this.contents_[l];h.refreshTheme&&h.refreshTheme()}}refreshSelection(){this.selectedItem_&&this.selectedItem_.isSelectable()&&this.selectedItem_.getContents().length&&this.flyout_.show(this.selectedItem_.getContents())}setVisible(l){this.isVisible_!==l&&(this.HtmlDiv.style.display=l?"block":"none",this.isVisible_=l,this.workspace_.recordDragTargets())}autoHide(l){!l&&this.flyout_&&this.flyout_.autoClose&&this.clearSelection()}setSelectedItem(l){const h=this.selectedItem_;!l&&!h||l&&!os(l)||(this.shouldDeselectItem_(h,l)&&h!==null&&this.deselectItem_(h),this.shouldSelectItem_(h,l)&&l!==null&&this.selectItem_(h,l),this.updateFlyout_(h,l),this.fireSelectEvent_(h,l))}shouldDeselectItem_(l,h){return l!==null&&(!l.isCollapsible()||l!==h)}shouldSelectItem_(l,h){return h!==null&&h!==l}deselectItem_(l){this.selectedItem_=null,this.previouslySelectedItem_=l,l.setSelected(!1),bo(this.contentsDiv_,Ao.ACTIVEDESCENDANT,"")}selectItem_(l,h){this.selectedItem_=h,this.previouslySelectedItem_=l,h.setSelected(!0),bo(this.contentsDiv_,Ao.ACTIVEDESCENDANT,h.getId())}selectItemByPosition(l){-1<l&&l<this.contents_.length&&(l=this.contents_[l],l.isSelectable()&&this.setSelectedItem(l))}updateFlyout_(l,h){h&&(l!==h||h.isCollapsible())&&h.getContents().length?(this.flyout_.show(h.getContents()),this.flyout_.scrollToStart()):this.flyout_.hide()}fireSelectEvent_(l,h){const m=l&&l.getName();let E=h&&h.getName();l===h&&(E=null),l=new(Ne(x_))(m,E,this.workspace_.id),q(l)}selectParent_(){return this.selectedItem_?this.selectedItem_.isCollapsible()&&this.selectedItem_.isExpanded()?(this.selectedItem_.toggleExpanded(),!0):this.selectedItem_.getParent()&&this.selectedItem_.getParent().isSelectable()?(this.setSelectedItem(this.selectedItem_.getParent()),!0):!1:!1}selectChild_(){if(!this.selectedItem_||!this.selectedItem_.isCollapsible())return!1;const l=this.selectedItem_;return l.isExpanded()?this.selectNext_():l.toggleExpanded(),!0}selectNext_(){if(!this.selectedItem_)return!1;let l=this.contents_.indexOf(this.selectedItem_)+1;if(-1<l&&l<this.contents_.length){let h=this.contents_[l];for(;h&&!h.isSelectable();)h=this.contents_[++l];if(h&&h.isSelectable())return this.setSelectedItem(h),!0}return!1}selectPrevious_(){if(!this.selectedItem_)return!1;let l=this.contents_.indexOf(this.selectedItem_)-1;if(-1<l&&l<this.contents_.length){let h=this.contents_[l];for(;h&&!h.isSelectable();)h=this.contents_[--l];if(h&&h.isSelectable())return this.setSelectedItem(h),!0}return!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox"),this.flyout_.dispose();for(var l=0;l<this.contents_.length;l++)this.contents_[l].dispose();for(l=0;l<this.boundEvents_.length;l++)Me(this.boundEvents_[l]);this.boundEvents_=[],this.contents_=[],this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),Ot(this.HtmlDiv))}};Xe(`
- .blocklyToolboxDelete {
- cursor: url("<<<PATH>>>/handdelete.cur"), auto;
- }
- .blocklyToolboxGrab {
- cursor: url("<<<PATH>>>/handclosed.cur"), auto;
- cursor: grabbing;
- cursor: -webkit-grabbing;
- }
- /* Category tree in Toolbox. */
- .blocklyToolboxDiv {
- background-color: #ddd;
- overflow-x: visible;
- overflow-y: auto;
- padding: 4px 0 4px 0;
- position: absolute;
- z-index: 70; /* so blocks go under toolbox when dragging */
- -webkit-tap-highlight-color: transparent; /* issue #1345 */
- }
- .blocklyToolboxContents {
- display: flex;
- flex-wrap: wrap;
- flex-direction: column;
- }
- .blocklyToolboxContents:focus {
- outline: none;
- }
- `),i(Jt.TOOLBOX,Uh,Roe);var iNe="10.4.3",sNe=t.Align$$module$build$src$core$inputs$align.LEFT,oNe=t.Align$$module$build$src$core$inputs$align.CENTRE,rNe=t.Align$$module$build$src$core$inputs$align.RIGHT,lNe=Pn.INPUT_VALUE,aNe=Pn.OUTPUT_VALUE,cNe=Pn.NEXT_STATEMENT,uNe=Pn.PREVIOUS_STATEMENT,dNe=t.inputTypes$$module$build$src$core$inputs$input_types.DUMMY,hNe=Fi.TOP,fNe=Fi.BOTTOM,gNe=Fi.LEFT,pNe=Fi.RIGHT;QE.prototype.newBlock=function(l,h){return new IT(this,l,h)},Qd.prototype.newBlock=function(l,h){return new tf(this,l,h)},Qd.newTrashcan=function(l){return new AB(l)},sa.prototype.showContextMenu=function(l){if(!this.workspace.options.readOnly){var h=[];this.isDeletable()&&this.isMovable()&&(h.push(lk(this)),h.push(Fb(this))),Zy(l,h,this.RTL)}},mg.prototype.newWorkspaceSvg=function(l){return new Qd(l)},t.Names$$module$build$src$core$names.prototype.populateProcedures=function(l){l=LI(l),l=l[0].concat(l[1]);for(let h=0;h<l.length;h++)this.getName(l[h][0],t.Names$$module$build$src$core$names.NameType.PROCEDURE)};var mNe=Pn,$t={ALIGN_CENTRE:oNe,ALIGN_LEFT:sNe,ALIGN_RIGHT:rNe};return $t.ASTNode=nn,$t.BasicCursor=ZE,$t.Block=IT,$t.BlockDragger=FL,$t.BlockSvg=tf,$t.Blocks=ea,$t.Bubble=js,$t.BubbleDragger=uB,$t.COLLAPSED_FIELD_NAME=ML,$t.COLLAPSED_INPUT_NAME=ev,$t.COLLAPSE_CHARS=wA,$t.CodeGenerator=t.CodeGenerator$$module$build$src$core$generator,$t.CollapsibleToolboxCategory=HL,$t.ComponentManager=Qr,$t.Connection=Ns,$t.ConnectionChecker=VA,$t.ConnectionDB=Fp,$t.ConnectionType=Pn,$t.ContextMenu=Yh,$t.ContextMenuItems=Ce,$t.ContextMenuRegistry=Ks,$t.Css=kl,$t.Cursor=jA,$t.DELETE_VARIABLE_ID=vL,$t.DRAG_STACK=IA,$t.DUMMY_INPUT=dNe,$t.DeleteArea=kL,$t.DragTarget=kB,$t.DropDownDiv=Ra,$t.Events=Wn,$t.Extensions=td,$t.Field=fs,$t.FieldAngle=Pe,$t.FieldCheckbox=ut,$t.FieldColour=_t,$t.FieldDropdown=du,$t.FieldImage=sv,$t.FieldLabel=ar,$t.FieldLabelSerializable=Zt,$t.FieldMultilineInput=en,$t.FieldNumber=an,$t.FieldTextInput=MT,$t.FieldVariable=Rn,$t.Flyout=_i,$t.FlyoutButton=qn,$t.FlyoutMetricsManager=Ei,$t.Generator=t.CodeGenerator$$module$build$src$core$generator,$t.Gesture=pg,$t.Grid=kA,$t.HorizontalFlyout=gs,$t.INPUT_VALUE=lNe,$t.Input=Nr,$t.InsertionMarkerManager=Jd,$t.InsertionMarkerPreviewer=id,$t.Marker=RB,$t.MarkerManager=Ya,$t.Menu=vA,$t.MenuItem=hT,$t.MetricsManager=xL,$t.Msg=t.Msg$$module$build$src$core$msg,$t.NEXT_STATEMENT=cNe,$t.Names=t.Names$$module$build$src$core$names,$t.OPPOSITE_TYPE=gg,$t.OUTPUT_VALUE=aNe,$t.Options=Jo,$t.PREVIOUS_STATEMENT=uNe,$t.PROCEDURE_CATEGORY_NAME=zE,$t.Procedures=Ho,$t.RENAME_VARIABLE_ID=_L,$t.RenderedConnection=Ac,$t.Scrollbar=kr,$t.ScrollbarPair=eN,$t.ShortcutItems=sf,$t.ShortcutRegistry=Bs,$t.TOOLBOX_AT_BOTTOM=fNe,$t.TOOLBOX_AT_LEFT=gNe,$t.TOOLBOX_AT_RIGHT=pNe,$t.TOOLBOX_AT_TOP=hNe,$t.TabNavigateCursor=MB,$t.Theme=q_,$t.ThemeManager=LB,$t.Themes=nNe,$t.Toolbox=Roe,$t.ToolboxCategory=vg,$t.ToolboxItem=ZG,$t.ToolboxSeparator=fN,$t.Tooltip=uu,$t.Touch=Gh,$t.Trashcan=AB,$t.UnattachedFieldError=Co,$t.VARIABLE_CATEGORY_NAME=sA,$t.VARIABLE_DYNAMIC_CATEGORY_NAME=HA,$t.VERSION=iNe,$t.VariableMap=GA,$t.VariableModel=cT,$t.Variables=ia,$t.VariablesDynamic=nv,$t.VerticalFlyout=Ts,$t.WidgetDiv=Xh,$t.Workspace=QE,$t.WorkspaceAudio=OB,$t.WorkspaceComment=Kh,$t.WorkspaceCommentSvg=sa,$t.WorkspaceDragger=gB,$t.WorkspaceSvg=Qd,$t.Xml=Ic,$t.ZoomControls=z2,$t.blockAnimations=BE,$t.blockRendering=qs,$t.browserEvents=Ju,$t.bubbles=iv,$t.bumpObjects=PL,$t.clipboard=j_,$t.common=Ml,$t.config=t.config$$module$build$src$core$config,$t.connectionTypes=mNe,$t.constants=GG,$t.defineBlocksWithJsonArray=P,$t.dialog=W_,$t.fieldRegistry=GE,$t.geras=Gp,$t.getMainWorkspace=C,$t.getSelected=w,$t.hasBubble=Lp,$t.hideChaff=H2,$t.icons=Oi,$t.inject=xk,$t.inputTypes=t.inputTypes$$module$build$src$core$inputs$input_types,$t.inputs=tl,$t.isCopyable=Mp,$t.isIcon=B2,$t.isObservable=Be,$t.isPaster=GI,$t.isSerializable=Yr,$t.isVariableBackedParameterModel=tI,$t.minimalist=hN,$t.procedures=Ho,$t.registry=cg,$t.renderManagement=uL,$t.serialization=JG,$t.setLocale=iA,$t.setParentContainer=O,$t.svgResize=A,$t.thrasos=QG,$t.uiPosition=U_,$t.utils=lr,$t.zelos=ne,Object.defineProperties($t,{HSV_SATURATION:{get:function(){return Tt("Blockly.HSV_SATURATION","version 10","version 11","Blockly.utils.colour.getHsvSaturation()"),qb()},set:function(l){Tt("Blockly.HSV_SATURATION","version 10","version 11","Blockly.utils.colour.setHsvSaturation()"),I_(l)}},HSV_VALUE:{get:function(){return Tt("Blockly.HSV_VALUE","version 10","version 11","Blockly.utils.colour.getHsvValue()"),Jb()},set:function(l){Tt("Blockly.HSV_VALUE","version 10","version 11","Blockly.utils.colour.setHsvValue()"),Op(l)}}}),"Blockly"in globalThis||(globalThis.Blockly={Msg:q2}),$t.__namespace__=t,$t})}(YV)),YV.exports}var W$e=XV.exports,Tre;function G$e(){return Tre||(Tre=1,function(n,e){(function(t,i){n.exports=i(P5())})(W$e,function(t){/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */return t})}(XV)),XV.exports}var z$e=jV.exports,Cre;function FZ(){return Cre||(Cre=1,function(n,e){(function(t,i){n.exports=i(G$e())})(z$e,function(t){return t})}(jV)),jV.exports}var qV={exports:{}},K$e=qV.exports,yre;function j$e(){return yre||(yre=1,function(n,e){(function(t,i){n.exports=i()})(K$e,function(){var t=t||{Msg:Object.create(null)};return t.Msg.ADD_COMMENT="Add Comment",t.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="Can't delete the variable '%1' because it's part of the definition of the function '%2'",t.Msg.CHANGE_VALUE_TITLE="Change value:",t.Msg.CLEAN_UP="Clean up Blocks",t.Msg.COLLAPSED_WARNINGS_WARNING="Collapsed blocks contain warnings.",t.Msg.COLLAPSE_ALL="Collapse Blocks",t.Msg.COLLAPSE_BLOCK="Collapse Block",t.Msg.COLOUR_BLEND_COLOUR1="colour 1",t.Msg.COLOUR_BLEND_COLOUR2="colour 2",t.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp",t.Msg.COLOUR_BLEND_RATIO="ratio",t.Msg.COLOUR_BLEND_TITLE="blend",t.Msg.COLOUR_BLEND_TOOLTIP="Blends two colours together with a given ratio (0.0 - 1.0).",t.Msg.COLOUR_PICKER_HELPURL="https://en.wikipedia.org/wiki/Color",t.Msg.COLOUR_PICKER_TOOLTIP="Choose a colour from the palette.",t.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com",t.Msg.COLOUR_RANDOM_TITLE="random colour",t.Msg.COLOUR_RANDOM_TOOLTIP="Choose a colour at random.",t.Msg.COLOUR_RGB_BLUE="blue",t.Msg.COLOUR_RGB_GREEN="green",t.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html",t.Msg.COLOUR_RGB_RED="red",t.Msg.COLOUR_RGB_TITLE="colour with",t.Msg.COLOUR_RGB_TOOLTIP="Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.",t.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break out of loop",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue with next iteration of loop",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="Break out of the containing loop.",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="Skip the rest of this loop, and continue with the next iteration.",t.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="Warning: This block may only be used within a loop.",t.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each",t.Msg.CONTROLS_FOREACH_TITLE="for each item %1 in list %2",t.Msg.CONTROLS_FOREACH_TOOLTIP="For each item in a list, set the variable '%1' to the item, and then do some statements.",t.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with",t.Msg.CONTROLS_FOR_TITLE="count with %1 from %2 to %3 by %4",t.Msg.CONTROLS_FOR_TOOLTIP="Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.",t.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="Add a condition to the if block.",t.Msg.CONTROLS_IF_ELSE_TOOLTIP="Add a final, catch-all condition to the if block.",t.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse",t.Msg.CONTROLS_IF_IF_TOOLTIP="Add, remove, or reorder sections to reconfigure this if block.",t.Msg.CONTROLS_IF_MSG_ELSE="else",t.Msg.CONTROLS_IF_MSG_ELSEIF="else if",t.Msg.CONTROLS_IF_MSG_IF="if",t.Msg.CONTROLS_IF_TOOLTIP_1="If a value is true, then do some statements.",t.Msg.CONTROLS_IF_TOOLTIP_2="If a value is true, then do the first block of statements. Otherwise, do the second block of statements.",t.Msg.CONTROLS_IF_TOOLTIP_3="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.",t.Msg.CONTROLS_IF_TOOLTIP_4="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.",t.Msg.CONTROLS_REPEAT_HELPURL="https://en.wikipedia.org/wiki/For_loop",t.Msg.CONTROLS_REPEAT_INPUT_DO="do",t.Msg.CONTROLS_REPEAT_TITLE="repeat %1 times",t.Msg.CONTROLS_REPEAT_TOOLTIP="Do some statements several times.",t.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="repeat until",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="repeat while",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="While a value is false, then do some statements.",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="While a value is true, then do some statements.",t.Msg.DELETE_ALL_BLOCKS="Delete all %1 blocks?",t.Msg.DELETE_BLOCK="Delete Block",t.Msg.DELETE_VARIABLE="Delete the '%1' variable",t.Msg.DELETE_VARIABLE_CONFIRMATION="Delete %1 uses of the '%2' variable?",t.Msg.DELETE_X_BLOCKS="Delete %1 Blocks",t.Msg.DIALOG_CANCEL="Cancel",t.Msg.DIALOG_OK="OK",t.Msg.DISABLE_BLOCK="Disable Block",t.Msg.DUPLICATE_BLOCK="Duplicate",t.Msg.DUPLICATE_COMMENT="Duplicate Comment",t.Msg.ENABLE_BLOCK="Enable Block",t.Msg.EXPAND_ALL="Expand Blocks",t.Msg.EXPAND_BLOCK="Expand Block",t.Msg.EXTERNAL_INPUTS="External Inputs",t.Msg.HELP="Help",t.Msg.INLINE_INPUTS="Inline Inputs",t.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list",t.Msg.LISTS_CREATE_EMPTY_TITLE="create empty list",t.Msg.LISTS_CREATE_EMPTY_TOOLTIP="Returns a list, of length 0, containing no data records",t.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="list",t.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="Add, remove, or reorder sections to reconfigure this list block.",t.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_CREATE_WITH_INPUT_WITH="create list with",t.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="Add an item to the list.",t.Msg.LISTS_CREATE_WITH_TOOLTIP="Create a list with any number of items.",t.Msg.LISTS_GET_INDEX_FIRST="first",t.Msg.LISTS_GET_INDEX_FROM_END="# from end",t.Msg.LISTS_GET_INDEX_FROM_START="#",t.Msg.LISTS_GET_INDEX_GET="get",t.Msg.LISTS_GET_INDEX_GET_REMOVE="get and remove",t.Msg.LISTS_GET_INDEX_LAST="last",t.Msg.LISTS_GET_INDEX_RANDOM="random",t.Msg.LISTS_GET_INDEX_REMOVE="remove",t.Msg.LISTS_GET_INDEX_TAIL="",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="Returns the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="Returns the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="Returns the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="Returns a random item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="Removes and returns the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="Removes and returns the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="Removes and returns the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="Removes and returns a random item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="Removes the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="Removes the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="Removes the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="Removes a random item in a list.",t.Msg.LISTS_GET_SUBLIST_END_FROM_END="to # from end",t.Msg.LISTS_GET_SUBLIST_END_FROM_START="to #",t.Msg.LISTS_GET_SUBLIST_END_LAST="to last",t.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist",t.Msg.LISTS_GET_SUBLIST_START_FIRST="get sub-list from first",t.Msg.LISTS_GET_SUBLIST_START_FROM_END="get sub-list from # from end",t.Msg.LISTS_GET_SUBLIST_START_FROM_START="get sub-list from #",t.Msg.LISTS_GET_SUBLIST_TAIL="",t.Msg.LISTS_GET_SUBLIST_TOOLTIP="Creates a copy of the specified portion of a list.",t.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1 is the last item.",t.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1 is the first item.",t.Msg.LISTS_INDEX_OF_FIRST="find first occurrence of item",t.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list",t.Msg.LISTS_INDEX_OF_LAST="find last occurrence of item",t.Msg.LISTS_INDEX_OF_TOOLTIP="Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.",t.Msg.LISTS_INLIST="in list",t.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty",t.Msg.LISTS_ISEMPTY_TITLE="%1 is empty",t.Msg.LISTS_ISEMPTY_TOOLTIP="Returns true if the list is empty.",t.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of",t.Msg.LISTS_LENGTH_TITLE="length of %1",t.Msg.LISTS_LENGTH_TOOLTIP="Returns the length of a list.",t.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_REPEAT_TITLE="create list with item %1 repeated %2 times",t.Msg.LISTS_REPEAT_TOOLTIP="Creates a list consisting of the given value repeated the specified number of times.",t.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list",t.Msg.LISTS_REVERSE_MESSAGE0="reverse %1",t.Msg.LISTS_REVERSE_TOOLTIP="Reverse a copy of a list.",t.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set",t.Msg.LISTS_SET_INDEX_INPUT_TO="as",t.Msg.LISTS_SET_INDEX_INSERT="insert at",t.Msg.LISTS_SET_INDEX_SET="set",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="Inserts the item at the start of a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="Inserts the item at the specified position in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="Append the item to the end of a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="Inserts the item randomly in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="Sets the first item in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="Sets the item at the specified position in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="Sets the last item in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="Sets a random item in a list.",t.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list",t.Msg.LISTS_SORT_ORDER_ASCENDING="ascending",t.Msg.LISTS_SORT_ORDER_DESCENDING="descending",t.Msg.LISTS_SORT_TITLE="sort %1 %2 %3",t.Msg.LISTS_SORT_TOOLTIP="Sort a copy of a list.",t.Msg.LISTS_SORT_TYPE_IGNORECASE="alphabetic, ignore case",t.Msg.LISTS_SORT_TYPE_NUMERIC="numeric",t.Msg.LISTS_SORT_TYPE_TEXT="alphabetic",t.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists",t.Msg.LISTS_SPLIT_LIST_FROM_TEXT="make list from text",t.Msg.LISTS_SPLIT_TEXT_FROM_LIST="make text from list",t.Msg.LISTS_SPLIT_TOOLTIP_JOIN="Join a list of texts into one text, separated by a delimiter.",t.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="Split text into a list of texts, breaking at each delimiter.",t.Msg.LISTS_SPLIT_WITH_DELIMITER="with delimiter",t.Msg.LOGIC_BOOLEAN_FALSE="false",t.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values",t.Msg.LOGIC_BOOLEAN_TOOLTIP="Returns either true or false.",t.Msg.LOGIC_BOOLEAN_TRUE="true",t.Msg.LOGIC_COMPARE_HELPURL="https://en.wikipedia.org/wiki/Inequality_(mathematics)",t.Msg.LOGIC_COMPARE_TOOLTIP_EQ="Return true if both inputs equal each other.",t.Msg.LOGIC_COMPARE_TOOLTIP_GT="Return true if the first input is greater than the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_GTE="Return true if the first input is greater than or equal to the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_LT="Return true if the first input is smaller than the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_LTE="Return true if the first input is smaller than or equal to the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="Return true if both inputs are not equal to each other.",t.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not",t.Msg.LOGIC_NEGATE_TITLE="not %1",t.Msg.LOGIC_NEGATE_TOOLTIP="Returns true if the input is false. Returns false if the input is true.",t.Msg.LOGIC_NULL="null",t.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type",t.Msg.LOGIC_NULL_TOOLTIP="Returns null.",t.Msg.LOGIC_OPERATION_AND="and",t.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations",t.Msg.LOGIC_OPERATION_OR="or",t.Msg.LOGIC_OPERATION_TOOLTIP_AND="Return true if both inputs are true.",t.Msg.LOGIC_OPERATION_TOOLTIP_OR="Return true if at least one of the inputs is true.",t.Msg.LOGIC_TERNARY_CONDITION="test",t.Msg.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:",t.Msg.LOGIC_TERNARY_IF_FALSE="if false",t.Msg.LOGIC_TERNARY_IF_TRUE="if true",t.Msg.LOGIC_TERNARY_TOOLTIP="Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.",t.Msg.MATH_ADDITION_SYMBOL="+",t.Msg.MATH_ARITHMETIC_HELPURL="https://en.wikipedia.org/wiki/Arithmetic",t.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="Return the sum of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="Return the quotient of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="Return the difference of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="Return the product of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="Return the first number raised to the power of the second number.",t.Msg.MATH_ATAN2_HELPURL="https://en.wikipedia.org/wiki/Atan2",t.Msg.MATH_ATAN2_TITLE="atan2 of X:%1 Y:%2",t.Msg.MATH_ATAN2_TOOLTIP="Return the arctangent of point (X, Y) in degrees from -180 to 180.",t.Msg.MATH_CHANGE_HELPURL="https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter",t.Msg.MATH_CHANGE_TITLE="change %1 by %2",t.Msg.MATH_CHANGE_TOOLTIP="Add a number to variable '%1'.",t.Msg.MATH_CONSTANT_HELPURL="https://en.wikipedia.org/wiki/Mathematical_constant",t.Msg.MATH_CONSTANT_TOOLTIP="Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).",t.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)",t.Msg.MATH_CONSTRAIN_TITLE="constrain %1 low %2 high %3",t.Msg.MATH_CONSTRAIN_TOOLTIP="Constrain a number to be between the specified limits (inclusive).",t.Msg.MATH_DIVISION_SYMBOL="÷",t.Msg.MATH_IS_DIVISIBLE_BY="is divisible by",t.Msg.MATH_IS_EVEN="is even",t.Msg.MATH_IS_NEGATIVE="is negative",t.Msg.MATH_IS_ODD="is odd",t.Msg.MATH_IS_POSITIVE="is positive",t.Msg.MATH_IS_PRIME="is prime",t.Msg.MATH_IS_TOOLTIP="Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.",t.Msg.MATH_IS_WHOLE="is whole",t.Msg.MATH_MODULO_HELPURL="https://en.wikipedia.org/wiki/Modulo_operation",t.Msg.MATH_MODULO_TITLE="remainder of %1 ÷ %2",t.Msg.MATH_MODULO_TOOLTIP="Return the remainder from dividing the two numbers.",t.Msg.MATH_MULTIPLICATION_SYMBOL="×",t.Msg.MATH_NUMBER_HELPURL="https://en.wikipedia.org/wiki/Number",t.Msg.MATH_NUMBER_TOOLTIP="A number.",t.Msg.MATH_ONLIST_HELPURL="",t.Msg.MATH_ONLIST_OPERATOR_AVERAGE="average of list",t.Msg.MATH_ONLIST_OPERATOR_MAX="max of list",t.Msg.MATH_ONLIST_OPERATOR_MEDIAN="median of list",t.Msg.MATH_ONLIST_OPERATOR_MIN="min of list",t.Msg.MATH_ONLIST_OPERATOR_MODE="modes of list",t.Msg.MATH_ONLIST_OPERATOR_RANDOM="random item of list",t.Msg.MATH_ONLIST_OPERATOR_STD_DEV="standard deviation of list",t.Msg.MATH_ONLIST_OPERATOR_SUM="sum of list",t.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="Return the average (arithmetic mean) of the numeric values in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MAX="Return the largest number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="Return the median number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MIN="Return the smallest number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MODE="Return a list of the most common item(s) in the list.",t.Msg.MATH_ONLIST_TOOLTIP_RANDOM="Return a random element from the list.",t.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="Return the standard deviation of the list.",t.Msg.MATH_ONLIST_TOOLTIP_SUM="Return the sum of all the numbers in the list.",t.Msg.MATH_POWER_SYMBOL="^",t.Msg.MATH_RANDOM_FLOAT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation",t.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="random fraction",t.Msg.MATH_RANDOM_FLOAT_TOOLTIP="Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).",t.Msg.MATH_RANDOM_INT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation",t.Msg.MATH_RANDOM_INT_TITLE="random integer from %1 to %2",t.Msg.MATH_RANDOM_INT_TOOLTIP="Return a random integer between the two specified limits, inclusive.",t.Msg.MATH_ROUND_HELPURL="https://en.wikipedia.org/wiki/Rounding",t.Msg.MATH_ROUND_OPERATOR_ROUND="round",t.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="round down",t.Msg.MATH_ROUND_OPERATOR_ROUNDUP="round up",t.Msg.MATH_ROUND_TOOLTIP="Round a number up or down.",t.Msg.MATH_SINGLE_HELPURL="https://en.wikipedia.org/wiki/Square_root",t.Msg.MATH_SINGLE_OP_ABSOLUTE="absolute",t.Msg.MATH_SINGLE_OP_ROOT="square root",t.Msg.MATH_SINGLE_TOOLTIP_ABS="Return the absolute value of a number.",t.Msg.MATH_SINGLE_TOOLTIP_EXP="Return e to the power of a number.",t.Msg.MATH_SINGLE_TOOLTIP_LN="Return the natural logarithm of a number.",t.Msg.MATH_SINGLE_TOOLTIP_LOG10="Return the base 10 logarithm of a number.",t.Msg.MATH_SINGLE_TOOLTIP_NEG="Return the negation of a number.",t.Msg.MATH_SINGLE_TOOLTIP_POW10="Return 10 to the power of a number.",t.Msg.MATH_SINGLE_TOOLTIP_ROOT="Return the square root of a number.",t.Msg.MATH_SUBTRACTION_SYMBOL="-",t.Msg.MATH_TRIG_ACOS="acos",t.Msg.MATH_TRIG_ASIN="asin",t.Msg.MATH_TRIG_ATAN="atan",t.Msg.MATH_TRIG_COS="cos",t.Msg.MATH_TRIG_HELPURL="https://en.wikipedia.org/wiki/Trigonometric_functions",t.Msg.MATH_TRIG_SIN="sin",t.Msg.MATH_TRIG_TAN="tan",t.Msg.MATH_TRIG_TOOLTIP_ACOS="Return the arccosine of a number.",t.Msg.MATH_TRIG_TOOLTIP_ASIN="Return the arcsine of a number.",t.Msg.MATH_TRIG_TOOLTIP_ATAN="Return the arctangent of a number.",t.Msg.MATH_TRIG_TOOLTIP_COS="Return the cosine of a degree (not radian).",t.Msg.MATH_TRIG_TOOLTIP_SIN="Return the sine of a degree (not radian).",t.Msg.MATH_TRIG_TOOLTIP_TAN="Return the tangent of a degree (not radian).",t.Msg.NEW_COLOUR_VARIABLE="Create colour variable...",t.Msg.NEW_NUMBER_VARIABLE="Create number variable...",t.Msg.NEW_STRING_VARIABLE="Create string variable...",t.Msg.NEW_VARIABLE="Create variable...",t.Msg.NEW_VARIABLE_TITLE="New variable name:",t.Msg.NEW_VARIABLE_TYPE_TITLE="New variable type:",t.Msg.ORDINAL_NUMBER_SUFFIX="",t.Msg.PROCEDURES_ALLOW_STATEMENTS="allow statements",t.Msg.PROCEDURES_BEFORE_PARAMS="with:",t.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="Run the user-defined function '%1'.",t.Msg.PROCEDURES_CALLRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_CALLRETURN_TOOLTIP="Run the user-defined function '%1' and use its output.",t.Msg.PROCEDURES_CALL_BEFORE_PARAMS="with:",t.Msg.PROCEDURES_CREATE_DO="Create '%1'",t.Msg.PROCEDURES_DEFNORETURN_COMMENT="Describe this function...",t.Msg.PROCEDURES_DEFNORETURN_DO="",t.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="do something",t.Msg.PROCEDURES_DEFNORETURN_TITLE="to",t.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="Creates a function with no output.",t.Msg.PROCEDURES_DEFRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_DEFRETURN_RETURN="return",t.Msg.PROCEDURES_DEFRETURN_TOOLTIP="Creates a function with an output.",t.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="Warning: This function has duplicate parameters.",t.Msg.PROCEDURES_HIGHLIGHT_DEF="Highlight function definition",t.Msg.PROCEDURES_IFRETURN_HELPURL="https://c2.com/cgi/wiki?GuardClause",t.Msg.PROCEDURES_IFRETURN_TOOLTIP="If a value is true, then return a second value.",t.Msg.PROCEDURES_IFRETURN_WARNING="Warning: This block may be used only within a function definition.",t.Msg.PROCEDURES_MUTATORARG_TITLE="input name:",t.Msg.PROCEDURES_MUTATORARG_TOOLTIP="Add an input to the function.",t.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="inputs",t.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="Add, remove, or reorder inputs to this function.",t.Msg.REDO="Redo",t.Msg.REMOVE_COMMENT="Remove Comment",t.Msg.RENAME_VARIABLE="Rename variable...",t.Msg.RENAME_VARIABLE_TITLE="Rename all '%1' variables to:",t.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_APPEND_TITLE="to %1 append text %2",t.Msg.TEXT_APPEND_TOOLTIP="Append some text to variable '%1'.",t.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case",t.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="to lower case",t.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="to Title Case",t.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="to UPPER CASE",t.Msg.TEXT_CHANGECASE_TOOLTIP="Return a copy of the text in a different case.",t.Msg.TEXT_CHARAT_FIRST="get first letter",t.Msg.TEXT_CHARAT_FROM_END="get letter # from end",t.Msg.TEXT_CHARAT_FROM_START="get letter #",t.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text",t.Msg.TEXT_CHARAT_LAST="get last letter",t.Msg.TEXT_CHARAT_RANDOM="get random letter",t.Msg.TEXT_CHARAT_TAIL="",t.Msg.TEXT_CHARAT_TITLE="in text %1 %2",t.Msg.TEXT_CHARAT_TOOLTIP="Returns the letter at the specified position.",t.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings",t.Msg.TEXT_COUNT_MESSAGE0="count %1 in %2",t.Msg.TEXT_COUNT_TOOLTIP="Count how many times some text occurs within some other text.",t.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="Add an item to the text.",t.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="join",t.Msg.TEXT_CREATE_JOIN_TOOLTIP="Add, remove, or reorder sections to reconfigure this text block.",t.Msg.TEXT_GET_SUBSTRING_END_FROM_END="to letter # from end",t.Msg.TEXT_GET_SUBSTRING_END_FROM_START="to letter #",t.Msg.TEXT_GET_SUBSTRING_END_LAST="to last letter",t.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text",t.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="in text",t.Msg.TEXT_GET_SUBSTRING_START_FIRST="get substring from first letter",t.Msg.TEXT_GET_SUBSTRING_START_FROM_END="get substring from letter # from end",t.Msg.TEXT_GET_SUBSTRING_START_FROM_START="get substring from letter #",t.Msg.TEXT_GET_SUBSTRING_TAIL="",t.Msg.TEXT_GET_SUBSTRING_TOOLTIP="Returns a specified portion of the text.",t.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text",t.Msg.TEXT_INDEXOF_OPERATOR_FIRST="find first occurrence of text",t.Msg.TEXT_INDEXOF_OPERATOR_LAST="find last occurrence of text",t.Msg.TEXT_INDEXOF_TITLE="in text %1 %2 %3",t.Msg.TEXT_INDEXOF_TOOLTIP="Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.",t.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text",t.Msg.TEXT_ISEMPTY_TITLE="%1 is empty",t.Msg.TEXT_ISEMPTY_TOOLTIP="Returns true if the provided text is empty.",t.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation",t.Msg.TEXT_JOIN_TITLE_CREATEWITH="create text with",t.Msg.TEXT_JOIN_TOOLTIP="Create a piece of text by joining together any number of items.",t.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_LENGTH_TITLE="length of %1",t.Msg.TEXT_LENGTH_TOOLTIP="Returns the number of letters (including spaces) in the provided text.",t.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text",t.Msg.TEXT_PRINT_TITLE="print %1",t.Msg.TEXT_PRINT_TOOLTIP="Print the specified text, number or other value.",t.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user",t.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="Prompt for user for a number.",t.Msg.TEXT_PROMPT_TOOLTIP_TEXT="Prompt for user for some text.",t.Msg.TEXT_PROMPT_TYPE_NUMBER="prompt for number with message",t.Msg.TEXT_PROMPT_TYPE_TEXT="prompt for text with message",t.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings",t.Msg.TEXT_REPLACE_MESSAGE0="replace %1 with %2 in %3",t.Msg.TEXT_REPLACE_TOOLTIP="Replace all occurances of some text within some other text.",t.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text",t.Msg.TEXT_REVERSE_MESSAGE0="reverse %1",t.Msg.TEXT_REVERSE_TOOLTIP="Reverses the order of the characters in the text.",t.Msg.TEXT_TEXT_HELPURL="https://en.wikipedia.org/wiki/String_(computer_science)",t.Msg.TEXT_TEXT_TOOLTIP="A letter, word, or line of text.",t.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces",t.Msg.TEXT_TRIM_OPERATOR_BOTH="trim spaces from both sides of",t.Msg.TEXT_TRIM_OPERATOR_LEFT="trim spaces from left side of",t.Msg.TEXT_TRIM_OPERATOR_RIGHT="trim spaces from right side of",t.Msg.TEXT_TRIM_TOOLTIP="Return a copy of the text with spaces removed from one or both ends.",t.Msg.TODAY="Today",t.Msg.UNDO="Undo",t.Msg.UNNAMED_KEY="unnamed",t.Msg.VARIABLES_DEFAULT_NAME="item",t.Msg.VARIABLES_GET_CREATE_SET="Create 'set %1'",t.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get",t.Msg.VARIABLES_GET_TOOLTIP="Returns the value of this variable.",t.Msg.VARIABLES_SET="set %1 to %2",t.Msg.VARIABLES_SET_CREATE_GET="Create 'get %1'",t.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set",t.Msg.VARIABLES_SET_TOOLTIP="Sets this variable to be equal to the input.",t.Msg.VARIABLE_ALREADY_EXISTS="A variable named '%1' already exists.",t.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="A variable named '%1' already exists for another type: '%2'.",t.Msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER="A variable named '%1' already exists as a parameter in the procedure '%2'.",t.Msg.WORKSPACE_ARIA_LABEL="Blockly Workspace",t.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="Say something...",t.Msg.CONTROLS_FOREACH_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_FOR_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=t.Msg.CONTROLS_IF_MSG_ELSEIF,t.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=t.Msg.CONTROLS_IF_MSG_ELSE,t.Msg.CONTROLS_IF_IF_TITLE_IF=t.Msg.CONTROLS_IF_MSG_IF,t.Msg.CONTROLS_IF_MSG_THEN=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.LISTS_CREATE_WITH_ITEM_TITLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.LISTS_GET_INDEX_HELPURL=t.Msg.LISTS_INDEX_OF_HELPURL,t.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.MATH_CHANGE_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.PROCEDURES_DEFRETURN_COMMENT=t.Msg.PROCEDURES_DEFNORETURN_COMMENT,t.Msg.PROCEDURES_DEFRETURN_DO=t.Msg.PROCEDURES_DEFNORETURN_DO,t.Msg.PROCEDURES_DEFRETURN_PROCEDURE=t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,t.Msg.PROCEDURES_DEFRETURN_TITLE=t.Msg.PROCEDURES_DEFNORETURN_TITLE,t.Msg.TEXT_APPEND_VARIABLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.MATH_HUE="230",t.Msg.LOOPS_HUE="120",t.Msg.LISTS_HUE="260",t.Msg.LOGIC_HUE="210",t.Msg.VARIABLES_HUE="330",t.Msg.TEXTS_HUE="160",t.Msg.PROCEDURES_HUE="290",t.Msg.COLOUR_HUE="20",t.Msg.VARIABLES_DYNAMIC_HUE="310",t.Msg})}(qV)),qV.exports}var JV={exports:{}},QV={exports:{}},X$e=QV.exports,Ere;function Y$e(){return Ere||(Ere=1,function(n,e){(function(t,i){n.exports=i(P5())})(X$e,function(t){var i=t.__namespace__,s=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]),o={customContextMenu:function(se){if(this.isInFlyout)(this.type==="variables_get_dynamic"||this.type==="variables_get_reporter_dynamic")&&(Fe={text:i.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:r(this)},pe=this.getField("VAR").getText(),pe={text:i.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",pe),enabled:!0,callback:a(this)},se.unshift(Fe),se.unshift(pe));else{if(this.type==="variables_get_dynamic")var le="variables_set_dynamic",Fe=i.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET;else le="variables_get_dynamic",Fe=i.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var pe=this.getField("VAR");le={type:le,fields:{VAR:pe.saveState(!0)}},se.push({enabled:0<this.workspace.remainingCapacity(),text:Fe.replace("%1",pe.getText()),callback:i.callbackFactory$$module$build$src$core$contextmenu(this,le)})}},onchange:function(se){se=this.getFieldValue("VAR"),se=i.getVariable$$module$build$src$core$variables(this.workspace,se),this.type==="variables_get_dynamic"?this.outputConnection.setCheck(se.type):this.getInput("VALUE").connection.setCheck(se.type)}},r=function(se){return function(){const le=se.workspace,Fe=se.getField("VAR").getVariable();i.renameVariable$$module$build$src$core$variables(le,Fe)}},a=function(se){return function(){const le=se.workspace,Fe=se.getField("VAR").getVariable();le.deleteVariableById(Fe.getId()),le.refreshToolboxSelection()}};i.registerMixin$$module$build$src$core$extensions("contextMenu_variableDynamicSetterGetter",o),i.defineBlocks$$module$build$src$core$common(s);var c={blocks:s},u=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),d={customContextMenu:function(se){if(this.isInFlyout)(this.type==="variables_get"||this.type==="variables_get_reporter")&&(Fe={text:i.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:f(this)},pe=this.getField("VAR").getText(),pe={text:i.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",pe),enabled:!0,callback:g(this)},se.unshift(Fe),se.unshift(pe));else{if(this.type==="variables_get")var le="variables_set",Fe=i.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET;else le="variables_get",Fe=i.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var pe=this.getField("VAR");le={type:le,fields:{VAR:pe.saveState(!0)}},se.push({enabled:0<this.workspace.remainingCapacity(),text:Fe.replace("%1",pe.getText()),callback:i.callbackFactory$$module$build$src$core$contextmenu(this,le)})}}},f=function(se){return function(){const le=se.workspace,Fe=se.getField("VAR").getVariable();i.renameVariable$$module$build$src$core$variables(le,Fe)}},g=function(se){return function(){const le=se.workspace,Fe=se.getField("VAR").getVariable();le.deleteVariableById(Fe.getId()),le.refreshToolboxSelection()}};i.registerMixin$$module$build$src$core$extensions("contextMenu_variableSetterGetter",d),i.defineBlocks$$module$build$src$core$common(u);var p={blocks:u},_=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"},{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]),v={init:function(){this.WHERE_OPTIONS_1=[[i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]],this.setHelpUrl(i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("STRING").setCheck("String").appendField(i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL),this.setInputsInline(!0),this.setOutput(!0,"String"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");var le=this.getInput("AT1")instanceof i.ValueInput$$module$build$src$core$inputs$value_input;return se.setAttribute("at1",`${le}`),le=this.getInput("AT2")instanceof i.ValueInput$$module$build$src$core$inputs$value_input,se.setAttribute("at2",`${le}`),se},domToMutation:function(se){const le=se.getAttribute("at1")==="true";se=se.getAttribute("at2")==="true",this.updateAt_(1,le),this.updateAt_(2,se)},updateAt_:function(se,le){this.removeInput("AT"+se),this.removeInput("ORDINAL"+se,!0),le?(this.appendValueInput("AT"+se).setCheck("Number"),i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+se).appendField(i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+se),se===2&&i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(i.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL));const Fe=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+se]});Fe.setValidator(function(pe){const je=pe==="FROM_START"||pe==="FROM_END";if(je!==le){const Ae=this.getSourceBlock();return Ae.updateAt_(se,je),Ae.setFieldValue(pe,"WHERE"+se),null}}),this.getInput("AT"+se).appendField(Fe,"WHERE"+se),se===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}};_.text_getSubstring=v,_.text_changeCase={init:function(){const se=[[i.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[i.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[i.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(i.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("TEXT").setCheck("String").appendField(i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),"CASE"),this.setOutput(!0,"String"),this.setTooltip(i.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_TOOLTIP)}},_.text_trim={init:function(){const se=[[i.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[i.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[i.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(i.Msg$$module$build$src$core$msg.TEXT_TRIM_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("TEXT").setCheck("String").appendField(i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),"MODE"),this.setOutput(!0,"String"),this.setTooltip(i.Msg$$module$build$src$core$msg.TEXT_TRIM_TOOLTIP)}},_.text_print={init:function(){this.jsonInit({message0:i.Msg$$module$build$src$core$msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:i.Msg$$module$build$src$core$msg.TEXT_PRINT_TOOLTIP,helpUrl:i.Msg$$module$build$src$core$msg.TEXT_PRINT_HELPURL})}};var C={updateType_:function(se){this.outputConnection.setCheck(se==="NUMBER"?"Number":"String")},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("type",this.getFieldValue("TYPE")),se},domToMutation:function(se){this.updateType_(se.getAttribute("type"))}};_.text_prompt_ext=Object.assign({},C,{init:function(){var se=[[i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(i.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),se=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),se.setValidator(le=>{this.updateType_(le)}),this.appendValueInput("TEXT").appendField(se,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});var y=Object.assign({},C,{init:function(){this.mixin(w);var se=[[i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(i.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),se=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),se.setValidator(le=>{this.updateType_(le)}),this.appendDummyInput().appendField(se,"TYPE").appendField(this.newQuote_(!0)).appendField(i.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:i.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});_.text_prompt=y,_.text_count={init:function(){this.jsonInit({message0:i.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:i.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:i.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},_.text_replace={init:function(){this.jsonInit({message0:i.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:i.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:i.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},_.text_reverse={init:function(){this.jsonInit({message0:i.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:i.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:i.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var w={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(se){for(let le=0,Fe;Fe=this.inputList[le];le++)for(let pe=0,je;je=Fe.fieldRow[pe];pe++)if(se===je.name){Fe.insertFieldAt(pe,this.newQuote_(!0)),Fe.insertFieldAt(pe+2,this.newQuote_(!1));return}console.warn('field named "'+se+'" not found in '+this.toDevString())},newQuote_:function(se){return se=this.RTL?!se:se,i.fromJson$$module$build$src$core$field_registry({type:"field_image",src:se?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:se?"“":"”"})}},I=function(){this.mixin(w),this.quoteField_("TEXT")},L={itemCount_:0,mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("items",`${this.itemCount_}`),se},domToMutation:function(se){this.itemCount_=parseInt(se.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(se){this.itemCount_=se.itemCount,this.updateShape_()},decompose:function(se){const le=se.newBlock("text_create_join_container");le.initSvg();let Fe=le.getInput("STACK").connection;for(let pe=0;pe<this.itemCount_;pe++){const je=se.newBlock("text_create_join_item");je.initSvg(),Fe.connect(je.previousConnection),Fe=je.nextConnection}return le},compose:function(se){var le=se.getInputTargetBlock("STACK");for(se=[];le;)le.isInsertionMarker()||se.push(le.valueConnection_),le=le.getNextBlock();for(le=0;le<this.itemCount_;le++){const Fe=this.getInput("ADD"+le).connection.targetConnection;Fe&&se.indexOf(Fe)===-1&&Fe.disconnect()}for(this.itemCount_=se.length,this.updateShape_(),le=0;le<this.itemCount_;le++){let Fe;(Fe=se[le])==null||Fe.reconnect(this,"ADD"+le)}},saveConnections:function(se){se=se.getInputTargetBlock("STACK");let le=0;for(;se;){if(se.isInsertionMarker()){se=se.getNextBlock();continue}const Fe=this.getInput("ADD"+le);se.valueConnection_=Fe&&Fe.connection.targetConnection,se=se.getNextBlock(),le++}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var se=0;se<this.itemCount_;se++)if(!this.getInput("ADD"+se)){const le=this.appendValueInput("ADD"+se).setAlign(i.Align$$module$build$src$core$inputs$align.RIGHT);se===0&&le.appendField(i.Msg$$module$build$src$core$msg.TEXT_JOIN_TITLE_CREATEWITH)}for(se=this.itemCount_;this.getInput("ADD"+se);se++)this.removeInput("ADD"+se)}},O=function(){this.mixin(w),this.itemCount_=2,this.updateShape_(),this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(["text_create_join_item"],this))};i.register$$module$build$src$core$extensions("text_append_tooltip",i.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_TEXT_APPEND_TOOLTIP}","VAR"));var A=function(){this.setTooltip(()=>i.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},N={isAt_:!1,mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("at",`${this.isAt_}`),se},domToMutation:function(se){se=se.getAttribute("at")!=="false",this.updateAt_(se)},updateAt_:function(se){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),se&&(this.appendValueInput("AT").setCheck("Number"),i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),i.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(i.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=se}},D=function(){this.getField("WHERE").setValidator(function(se){se=se==="FROM_START"||se==="FROM_END";const le=this.getSourceBlock();se!==le.isAt_&&le.updateAt_(se)}),this.updateAt_(!0),this.setTooltip(()=>{var se=this.getFieldValue("WHERE");let le=i.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(se==="FROM_START"||se==="FROM_END")&&(se=se==="FROM_START"?i.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:i.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(le+=" "+se.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),le})};i.register$$module$build$src$core$extensions("text_indexOf_tooltip",A),i.register$$module$build$src$core$extensions("text_quotes",I),i.registerMixin$$module$build$src$core$extensions("quote_image_mixin",w),i.registerMutator$$module$build$src$core$extensions("text_join_mutator",L,O),i.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",N,D),i.defineBlocks$$module$build$src$core$common(_);var P={blocks:_},F={},V={setStatements_:function(se){this.hasStatements_!==se&&(se?(this.appendStatementInput("STACK").appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=se)},updateParams_:function(){let se="";this.arguments_.length&&(se=i.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),i.disable$$module$build$src$core$events$utils();try{this.setFieldValue(se,"PARAMS")}finally{i.enable$$module$build$src$core$events$utils()}},mutationToDom:function(se){const le=i.createElement$$module$build$src$core$utils$xml("mutation");se&&le.setAttribute("name",this.getFieldValue("NAME"));for(let Fe=0;Fe<this.argumentVarModels_.length;Fe++){const pe=i.createElement$$module$build$src$core$utils$xml("arg"),je=this.argumentVarModels_[Fe];pe.setAttribute("name",je.name),pe.setAttribute("varid",je.getId()),se&&this.paramIds_&&pe.setAttribute("paramId",this.paramIds_[Fe]),le.appendChild(pe)}return this.hasStatements_||le.setAttribute("statements","false"),le},domToMutation:function(se){this.arguments_=[],this.argumentVarModels_=[];for(let Fe=0,pe;pe=se.childNodes[Fe];Fe++)if(pe.nodeName.toLowerCase()==="arg"){var le=pe;const je=le.getAttribute("name");le=le.getAttribute("varid")||le.getAttribute("varId"),this.arguments_.push(je),le=i.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,le,je,""),le!==null?this.argumentVarModels_.push(le):console.log(`Failed to create a variable named "${je}", ignoring.`)}this.updateParams_(),i.mutateCallers$$module$build$src$core$procedures(this),this.setStatements_(se.getAttribute("statements")!=="false")},saveExtraState:function(){if(!this.argumentVarModels_.length&&this.hasStatements_)return null;const se=Object.create(null);if(this.argumentVarModels_.length){se.params=[];for(let le=0;le<this.argumentVarModels_.length;le++)se.params.push({name:this.argumentVarModels_[le].name,id:this.argumentVarModels_[le].getId()})}return this.hasStatements_||(se.hasStatements=!1),se},loadExtraState:function(se){if(this.arguments_=[],this.argumentVarModels_=[],se.params)for(let Fe=0;Fe<se.params.length;Fe++){var le=se.params[Fe];le=i.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,le.id,le.name,""),this.arguments_.push(le.name),this.argumentVarModels_.push(le)}this.updateParams_(),i.mutateCallers$$module$build$src$core$procedures(this),this.setStatements_(se.hasStatements!==!1)},decompose:function(se){const le=i.createElement$$module$build$src$core$utils$xml("block");le.setAttribute("type","procedures_mutatorcontainer");var Fe=i.createElement$$module$build$src$core$utils$xml("statement");Fe.setAttribute("name","STACK"),le.appendChild(Fe);for(let je=0;je<this.arguments_.length;je++){const Ae=i.createElement$$module$build$src$core$utils$xml("block");Ae.setAttribute("type","procedures_mutatorarg");var pe=i.createElement$$module$build$src$core$utils$xml("field");pe.setAttribute("name","NAME");const Et=i.createTextNode$$module$build$src$core$utils$xml(this.arguments_[je]);pe.appendChild(Et),Ae.appendChild(pe),pe=i.createElement$$module$build$src$core$utils$xml("next"),Ae.appendChild(pe),Fe.appendChild(Ae),Fe=pe}return se=i.domToBlock$$module$build$src$core$xml(le,se),this.type==="procedures_defreturn"?se.setFieldValue(this.hasStatements_,"STATEMENTS"):se.removeInput("STATEMENT_INPUT"),i.mutateCallers$$module$build$src$core$procedures(this),se},compose:function(se){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];let le=se.getInputTargetBlock("STACK");for(;le&&!le.isInsertionMarker();){var Fe=le.getFieldValue("NAME");this.arguments_.push(Fe),Fe=this.workspace.getVariable(Fe,""),this.argumentVarModels_.push(Fe),this.paramIds_.push(le.id),le=le.nextConnection&&le.nextConnection.targetBlock()}if(this.updateParams_(),i.mutateCallers$$module$build$src$core$procedures(this),se=se.getFieldValue("STATEMENTS"),se!==null&&(se=se==="TRUE",this.hasStatements_!==se))if(se){this.setStatements_(!0);var pe;(pe=this.statementConnection_)==null||pe.reconnect(this,"STACK"),this.statementConnection_=null}else pe=this.getInput("STACK").connection,(this.statementConnection_=pe.targetConnection)&&(pe=pe.targetBlock(),pe.unplug(),pe.bumpNeighbours()),this.setStatements_(!1)},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(se,le){var Fe=this.workspace.getVariableById(se);if(Fe.type===""){Fe=Fe.name,le=this.workspace.getVariableById(le);var pe=!1;for(let je=0;je<this.argumentVarModels_.length;je++)this.argumentVarModels_[je].getId()===se&&(this.arguments_[je]=le.name,this.argumentVarModels_[je]=le,pe=!0);pe&&(this.displayRenamedVar_(Fe,le.name),i.mutateCallers$$module$build$src$core$procedures(this))}},updateVarName:function(se){const le=se.name;let Fe=!1,pe;for(let je=0;je<this.argumentVarModels_.length;je++)this.argumentVarModels_[je].getId()===se.getId()&&(pe=this.arguments_[je],this.arguments_[je]=le,Fe=!0);Fe&&(this.displayRenamedVar_(pe,le),i.mutateCallers$$module$build$src$core$procedures(this))},displayRenamedVar_:function(se,le){this.updateParams_();var Fe=this.getIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);if(Fe&&Fe.bubbleIsVisible()){Fe=Fe.getWorkspace().getAllBlocks(!1);for(let pe=0,je;je=Fe[pe];pe++)je.type==="procedures_mutatorarg"&&i.Names$$module$build$src$core$names.equals(se,je.getFieldValue("NAME"))&&je.setFieldValue(le,"NAME")}},customContextMenu:function(se){if(!this.isInFlyout){var le=this.getFieldValue("NAME"),Fe={type:this.callType_,extraState:{name:le,params:this.arguments_}};if(se.push({enabled:!0,text:i.Msg$$module$build$src$core$msg.PROCEDURES_CREATE_DO.replace("%1",le),callback:i.callbackFactory$$module$build$src$core$contextmenu(this,Fe)}),!this.isCollapsed())for(le=0;le<this.argumentVarModels_.length;le++){Fe=this.argumentVarModels_[le];const pe={type:"variables_get",fields:{VAR:{name:Fe.name,id:Fe.getId(),type:Fe.type}}};se.push({enabled:!0,text:i.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",Fe.name),callback:i.callbackFactory$$module$build$src$core$contextmenu(this,pe)})}}}};F.procedures_defnoreturn=Object.assign({},V,{init:function(){var se=i.findLegalName$$module$build$src$core$procedures("",this);se=i.fromJson$$module$build$src$core$field_registry({type:"field_input",text:se}),se.setValidator(i.rename$$module$build$src$core$procedures),se.setSpellcheck(!1),this.appendDummyInput().appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_TITLE).appendField(se,"NAME").appendField("","PARAMS"),this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&i.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},callType_:"procedures_callnoreturn"}),F.procedures_defreturn=Object.assign({},V,{init:function(){var se=i.findLegalName$$module$build$src$core$procedures("",this);se=i.fromJson$$module$build$src$core$field_registry({type:"field_input",text:se}),se.setValidator(i.rename$$module$build$src$core$procedures),se.setSpellcheck(!1),this.appendDummyInput().appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_TITLE).appendField(se,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(i.Align$$module$build$src$core$inputs$input.RIGHT).appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},callType_:"procedures_callreturn"});var U={init:function(){this.appendDummyInput().appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_ALLOW_STATEMENTS).appendField(i.fromJson$$module$build$src$core$field_registry({type:"field_checkbox",checked:!0}),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(i.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}};F.procedures_mutatorcontainer=U;var Q={init:function(){const se=i.fromJson$$module$build$src$core$field_registry({type:"field_input",text:i.DEFAULT_ARG$$module$build$src$core$procedures});se.setValidator(this.validator_),se.oldShowEditorFn_=se.showEditor_,se.showEditor_=function(){this.createdVariables_=[],this.oldShowEditorFn_()},this.appendDummyInput().appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TITLE).appendField(se,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(i.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,se.onFinishEditing_=this.deleteIntermediateVars_,se.createdVariables_=[],se.onFinishEditing_("x")},validator_:function(se){var le=this.getSourceBlock();const Fe=le.workspace.getRootWorkspace();if(se=se.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""),!se)return null;const pe=(le.workspace.targetWorkspace||le.workspace).getAllBlocks(!1),je=se.toLowerCase();for(let Ae=0;Ae<pe.length;Ae++){if(pe[Ae].id===this.getSourceBlock().id)continue;const Et=pe[Ae].getFieldValue("NAME");if(Et&&Et.toLowerCase()===je)return null}return le.isInFlyout||((le=Fe.getVariable(se,""))&&le.name!==se&&Fe.renameVariableById(le.getId(),se),le||(le=Fe.createVariable(se,""))&&this.createdVariables_&&this.createdVariables_.push(le)),se},deleteIntermediateVars_:function(se){const le=this.getSourceBlock().workspace.getRootWorkspace();if(le)for(let Fe=0;Fe<this.createdVariables_.length;Fe++){const pe=this.createdVariables_[Fe];pe.name!==se&&le.deleteVariableById(pe.getId())}}};F.procedures_mutatorarg=Q;var de={getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(se,le){i.Names$$module$build$src$core$names.equals(se,this.getProcedureCall())&&(this.setFieldValue(le,"NAME"),this.setTooltip((this.outputConnection?i.Msg$$module$build$src$core$msg.PROCEDURES_CALLRETURN_TOOLTIP:i.Msg$$module$build$src$core$msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",le)))},setProcedureParameters_:function(se,le){var Fe=i.getDefinition$$module$build$src$core$procedures(this.getProcedureCall(),this.workspace);if((Fe=(Fe=Fe&&Fe.getIcon(i.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE))&&Fe.bubbleIsVisible())?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null),se.join(`
- `)===this.arguments_.join(`
- `))this.quarkIds_=le;else{if(le.length!==se.length)throw RangeError("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);for(let je=0;je<this.arguments_.length;je++){var pe=this.getInput("ARG"+je);pe&&(pe=pe.connection.targetConnection,this.quarkConnections_[this.quarkIds_[je]]=pe,Fe&&pe&&le.indexOf(this.quarkIds_[je])===-1&&(pe.disconnect(),pe.getSourceBlock().bumpNeighbours()))}for(this.arguments_=[].concat(se),this.argumentVarModels_=[],se=0;se<this.arguments_.length;se++)Fe=i.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,null,this.arguments_[se],""),this.argumentVarModels_.push(Fe);if(this.updateShape_(),this.quarkIds_=le){for(le=0;le<this.arguments_.length;le++)if(se=this.quarkIds_[le],se in this.quarkConnections_){let je;(je=this.quarkConnections_[se])!=null&&je.reconnect(this,"ARG"+le)||delete this.quarkConnections_[se]}}}},updateShape_:function(){for(var se=0;se<this.arguments_.length;se++){var le=this.getField("ARGNAME"+se);if(le){i.disable$$module$build$src$core$events$utils();try{le.setValue(this.arguments_[se])}finally{i.enable$$module$build$src$core$events$utils()}}else le=i.fromJson$$module$build$src$core$field_registry({type:"field_label",text:this.arguments_[se]}),this.appendValueInput("ARG"+se).setAlign(i.Align$$module$build$src$core$inputs$input.RIGHT).appendField(le,"ARGNAME"+se).init()}for(se=this.arguments_.length;this.getInput("ARG"+se);se++)this.removeInput("ARG"+se);(se=this.getInput("TOPROW"))&&(this.arguments_.length?this.getField("WITH")||(se.appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),se.init()):this.getField("WITH")&&se.removeField("WITH"))},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");se.setAttribute("name",this.getProcedureCall());for(let le=0;le<this.arguments_.length;le++){const Fe=i.createElement$$module$build$src$core$utils$xml("arg");Fe.setAttribute("name",this.arguments_[le]),se.appendChild(Fe)}return se},domToMutation:function(se){var le=se.getAttribute("name");this.renameProcedure(this.getProcedureCall(),le),le=[];const Fe=[];for(let pe=0,je;je=se.childNodes[pe];pe++)je.nodeName.toLowerCase()==="arg"&&(le.push(je.getAttribute("name")),Fe.push(je.getAttribute("paramId")));this.setProcedureParameters_(le,Fe)},saveExtraState:function(){const se=Object.create(null);return se.name=this.getProcedureCall(),this.arguments_.length&&(se.params=this.arguments_),se},loadExtraState:function(se){if(this.renameProcedure(this.getProcedureCall(),se.name),se=se.params){const le=[];le.length=se.length,le.fill(null),this.setProcedureParameters_(se,le)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(se){if(this.workspace&&!this.workspace.isFlyout&&se.recordUndo)if(se.type===i.CREATE$$module$build$src$core$events$utils&&se.ids.indexOf(this.id)!==-1){var le=this.getProcedureCall();if(le=i.getDefinition$$module$build$src$core$procedures(le,this.workspace),!le||le.type===this.defType_&&JSON.stringify(le.getVars())===JSON.stringify(this.arguments_)||(le=null),!le){i.setGroup$$module$build$src$core$events$utils(se.group),se=i.createElement$$module$build$src$core$utils$xml("xml"),le=i.createElement$$module$build$src$core$utils$xml("block"),le.setAttribute("type",this.defType_);var Fe=this.getRelativeToSurfaceXY(),pe=Fe.y+2*i.config$$module$build$src$core$config.snapRadius;le.setAttribute("x",`${Fe.x+i.config$$module$build$src$core$config.snapRadius*(this.RTL?-1:1)}`),le.setAttribute("y",`${pe}`),Fe=this.mutationToDom(),le.appendChild(Fe),Fe=i.createElement$$module$build$src$core$utils$xml("field"),Fe.setAttribute("name","NAME"),pe=this.getProcedureCall();const je=i.findLegalName$$module$build$src$core$procedures(pe,this);pe!==je&&this.renameProcedure(pe,je),Fe.appendChild(i.createTextNode$$module$build$src$core$utils$xml(pe)),le.appendChild(Fe),se.appendChild(le),i.domToWorkspace$$module$build$src$core$xml(se,this.workspace),i.setGroup$$module$build$src$core$events$utils(!1)}}else se.type===i.DELETE$$module$build$src$core$events$utils?(le=this.getProcedureCall(),i.getDefinition$$module$build$src$core$procedures(le,this.workspace)||(i.setGroup$$module$build$src$core$events$utils(se.group),this.dispose(!0),i.setGroup$$module$build$src$core$events$utils(!1))):se.type===i.CHANGE$$module$build$src$core$events$utils&&se.element==="disabled"&&(le=this.getProcedureCall(),(le=i.getDefinition$$module$build$src$core$procedures(le,this.workspace))&&le.id===se.blockId&&((le=i.getGroup$$module$build$src$core$events$utils())&&console.log("Saw an existing group while responding to a definition change"),i.setGroup$$module$build$src$core$events$utils(se.group),se.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),i.setGroup$$module$build$src$core$events$utils(le)))},customContextMenu:function(se){if(this.workspace.isMovable()){var le=this.getProcedureCall(),Fe=this.workspace;se.push({enabled:!0,text:i.Msg$$module$build$src$core$msg.PROCEDURES_HIGHLIGHT_DEF,callback:function(){const pe=i.getDefinition$$module$build$src$core$procedures(le,Fe);pe&&(Fe.centerOnBlock(pe.id),pe.select())}})}}};F.procedures_callnoreturn=Object.assign({},de,{init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(i.Msg$$module$build$src$core$msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},defType_:"procedures_defnoreturn"}),F.procedures_callreturn=Object.assign({},de,{init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(i.Msg$$module$build$src$core$msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},defType_:"procedures_defreturn"});var q={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(i.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(i.Msg$$module$build$src$core$msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(i.Msg$$module$build$src$core$msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("value",String(Number(this.hasReturnValue_))),se},domToMutation:function(se){this.hasReturnValue_=se.getAttribute("value")==="1",this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(se){if(!(this.workspace.isDragging&&this.workspace.isDragging()||se.type!==i.MOVE$$module$build$src$core$events$utils)){var le=!1,Fe=this;do{if(this.FUNCTION_TYPES.indexOf(Fe.type)!==-1){le=!0;break}Fe=Fe.getSurroundParent()}while(Fe);le?(Fe.type==="procedures_defnoreturn"&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):Fe.type!=="procedures_defreturn"||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(i.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(i.Msg$$module$build$src$core$msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||(Fe=i.getGroup$$module$build$src$core$events$utils(),i.setGroup$$module$build$src$core$events$utils(se.group),this.setEnabled(le),i.setGroup$$module$build$src$core$events$utils(Fe))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};F.procedures_ifreturn=q,i.defineBlocks$$module$build$src$core$common(F);var K={blocks:F},re=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]),Z={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};i.register$$module$build$src$core$extensions("math_op_tooltip",i.buildTooltipForDropdown$$module$build$src$core$extensions("OP",Z));var J={mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation"),le=this.getFieldValue("PROPERTY")==="DIVISIBLE_BY";return se.setAttribute("divisor_input",String(le)),se},domToMutation:function(se){se=se.getAttribute("divisor_input")==="true",this.updateShape_(se)},updateShape_:function(se){const le=this.getInput("DIVISOR");se?le||this.appendValueInput("DIVISOR").setCheck("Number"):le&&this.removeInput("DIVISOR")}},ge=function(){this.getField("PROPERTY").setValidator(function(se){se=se==="DIVISIBLE_BY",this.getSourceBlock().updateShape_(se)})};i.registerMutator$$module$build$src$core$extensions("math_is_divisibleby_mutator",J,ge),i.register$$module$build$src$core$extensions("math_change_tooltip",i.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_MATH_CHANGE_TOOLTIP}","VAR"));var ve={updateType_:function(se){se==="MODE"?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("op",this.getFieldValue("OP")),se},domToMutation:function(se){if(se=se.getAttribute("op"),se===null)throw new TypeError("xmlElement had no op attribute");this.updateType_(se)}},Le=function(){this.getField("OP").setValidator((function(se){this.updateType_(se)}).bind(this))};i.registerMutator$$module$build$src$core$extensions("math_modes_of_list_mutator",ve,Le),i.defineBlocks$$module$build$src$core$common(re);var Ee={blocks:re},Ne=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]),qe={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};i.register$$module$build$src$core$extensions("controls_whileUntil_tooltip",i.buildTooltipForDropdown$$module$build$src$core$extensions("MODE",qe));var Re={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};i.register$$module$build$src$core$extensions("controls_flow_tooltip",i.buildTooltipForDropdown$$module$build$src$core$extensions("FLOW",Re));var we={customContextMenu:function(se){if(!this.isInFlyout){var le=this.getField("VAR"),Fe=le.getVariable().name;this.isCollapsed()||Fe===null||(le={type:"variables_get",fields:{VAR:le.saveState(!0)}},se.push({enabled:!0,text:i.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",Fe),callback:i.callbackFactory$$module$build$src$core$contextmenu(this,le)}))}}};i.registerMixin$$module$build$src$core$extensions("contextMenu_newGetVariableBlock",we),i.register$$module$build$src$core$extensions("controls_for_tooltip",i.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR")),i.register$$module$build$src$core$extensions("controls_forEach_tooltip",i.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));var Ve=new Set(["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]),Ge={getSurroundLoop:function(){let se=this;do{if(Ve.has(se.type))return se;se=se.getSurroundParent()}while(se);return null},onchange:function(se){var le=this.workspace;if(le.isDragging&&!le.isDragging()&&se.type===i.MOVE$$module$build$src$core$events$utils&&(le=!!this.getSurroundLoop(),this.setWarningText(le?null:i.Msg$$module$build$src$core$msg.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout)){const Fe=i.getGroup$$module$build$src$core$events$utils();i.setGroup$$module$build$src$core$events$utils(se.group),this.setEnabled(le),i.setGroup$$module$build$src$core$events$utils(Fe)}}};i.registerMixin$$module$build$src$core$extensions("controls_flow_in_loop_check",Ge),i.defineBlocks$$module$build$src$core$common(Ne);var dt={blocks:Ne,loopTypes:Ve},ze=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),ee={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};i.register$$module$build$src$core$extensions("logic_op_tooltip",i.buildTooltipForDropdown$$module$build$src$core$extensions("OP",ee));var ye={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const se=i.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&se.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&se.setAttribute("else","1"),se},domToMutation:function(se){this.elseifCount_=parseInt(se.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(se.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const se=Object.create(null);return this.elseifCount_&&(se.elseIfCount=this.elseifCount_),this.elseCount_&&(se.hasElse=!0),se},loadExtraState:function(se){this.elseifCount_=se.elseIfCount||0,this.elseCount_=se.hasElse?1:0,this.updateShape_()},decompose:function(se){const le=se.newBlock("controls_if_if");le.initSvg();let Fe=le.nextConnection;for(let pe=1;pe<=this.elseifCount_;pe++){const je=se.newBlock("controls_if_elseif");je.initSvg(),Fe.connect(je.previousConnection),Fe=je.nextConnection}return this.elseCount_&&(se=se.newBlock("controls_if_else"),se.initSvg(),Fe.connect(se.previousConnection)),le},compose:function(se){se=se.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const le=[null],Fe=[null];let pe=null;for(;se;){if(!se.isInsertionMarker())switch(se.type){case"controls_if_elseif":this.elseifCount_++,le.push(se.valueConnection_),Fe.push(se.statementConnection_);break;case"controls_if_else":this.elseCount_++,pe=se.statementConnection_;break;default:throw TypeError("Unknown block type: "+se.type)}se=se.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(le,Fe,pe)},saveConnections:function(se){se=se.nextConnection.targetBlock();let le=1;for(;se;){if(!se.isInsertionMarker())switch(se.type){case"controls_if_elseif":var Fe=this.getInput("IF"+le);const pe=this.getInput("DO"+le);se.valueConnection_=Fe&&Fe.connection.targetConnection,se.statementConnection_=pe&&pe.connection.targetConnection,le++;break;case"controls_if_else":Fe=this.getInput("ELSE"),se.statementConnection_=Fe&&Fe.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+se.type)}se=se.getNextBlock()}},rebuildShape_:function(){const se=[null],le=[null];let Fe=null;this.getInput("ELSE")&&(Fe=this.getInput("ELSE").connection.targetConnection);for(let pe=1;this.getInput("IF"+pe);pe++){const je=this.getInput("IF"+pe),Ae=this.getInput("DO"+pe);se.push(je.connection.targetConnection),le.push(Ae.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(se,le,Fe)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var se=1;this.getInput("IF"+se);se++)this.removeInput("IF"+se),this.removeInput("DO"+se);for(se=1;se<=this.elseifCount_;se++)this.appendValueInput("IF"+se).setCheck("Boolean").appendField(i.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+se).appendField(i.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(i.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(se,le,Fe){for(let pe=1;pe<=this.elseifCount_;pe++){let je;(je=se[pe])==null||je.reconnect(this,"IF"+pe);let Ae;(Ae=le[pe])==null||Ae.reconnect(this,"DO"+pe)}Fe==null||Fe.reconnect(this,"ELSE")}};i.registerMutator$$module$build$src$core$extensions("controls_if_mutator",ye,null,["controls_if_elseif","controls_if_else"]);var Me=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return i.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return i.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return i.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return i.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};i.register$$module$build$src$core$extensions("controls_if_tooltip",Me);var et={onchange:function(se){this.prevBlocks_||(this.prevBlocks_=[null,null]);var le=this.getInputTargetBlock("A");const Fe=this.getInputTargetBlock("B");le&&Fe&&!this.workspace.connectionChecker.doTypeChecks(le.outputConnection,Fe.outputConnection)&&(i.setGroup$$module$build$src$core$events$utils(se.group),se=this.prevBlocks_[0],se!==le&&(le.unplug(),!se||se.isDisposed()||se.isShadow()||this.getInput("A").connection.connect(se.outputConnection)),le=this.prevBlocks_[1],le!==Fe&&(Fe.unplug(),!le||le.isDisposed()||le.isShadow()||this.getInput("B").connection.connect(le.outputConnection)),this.bumpNeighbours(),i.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},at=function(){this.mixin(et)};i.register$$module$build$src$core$extensions("logic_compare",at);var Ue={prevParentConnection_:null,onchange:function(se){const le=this.getInputTargetBlock("THEN"),Fe=this.getInputTargetBlock("ELSE"),pe=this.outputConnection.targetConnection;if((le||Fe)&&pe)for(let je=0;2>je;je++){const Ae=je===1?le:Fe;Ae&&!Ae.workspace.connectionChecker.doTypeChecks(Ae.outputConnection,pe)&&(i.setGroup$$module$build$src$core$events$utils(se.group),pe===this.prevParentConnection_?(this.unplug(),pe.getSourceBlock().bumpNeighbours()):(Ae.unplug(),Ae.bumpNeighbours()),i.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=pe}};i.registerMixin$$module$build$src$core$extensions("logic_ternary",Ue),i.defineBlocks$$module$build$src$core$common(ze);var Se=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),Ie={init:function(){this.setHelpUrl(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new i.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"],this)),this.setTooltip(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("items",String(this.itemCount_)),se},domToMutation:function(se){if(se=se.getAttribute("items"),!se)throw new TypeError("element did not have items");this.itemCount_=parseInt(se,10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(se){this.itemCount_=se.itemCount,this.updateShape_()},decompose:function(se){const le=se.newBlock("lists_create_with_container");le.initSvg();let Fe=le.getInput("STACK").connection;for(let pe=0;pe<this.itemCount_;pe++){const je=se.newBlock("lists_create_with_item");if(je.initSvg(),!je.previousConnection)throw Error("itemBlock has no previousConnection");Fe.connect(je.previousConnection),Fe=je.nextConnection}return le},compose:function(se){var le=se.getInputTargetBlock("STACK");for(se=[];le;)le.isInsertionMarker()||se.push(le.valueConnection_),le=le.getNextBlock();for(le=0;le<this.itemCount_;le++){const Fe=this.getInput("ADD"+le).connection.targetConnection;Fe&&se.indexOf(Fe)===-1&&Fe.disconnect()}for(this.itemCount_=se.length,this.updateShape_(),le=0;le<this.itemCount_;le++){let Fe;(Fe=se[le])==null||Fe.reconnect(this,"ADD"+le)}},saveConnections:function(se){se=se.getInputTargetBlock("STACK");let le=0;for(;se;){if(se.isInsertionMarker()){se=se.getNextBlock();continue}const Fe=this.getInput("ADD"+le);let pe;se.valueConnection_=(pe=Fe)==null?void 0:pe.connection.targetConnection,se=se.getNextBlock(),le++}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(i.Msg$$module$build$src$core$msg.LISTS_CREATE_EMPTY_TITLE);for(var se=0;se<this.itemCount_;se++)if(!this.getInput("ADD"+se)){const le=this.appendValueInput("ADD"+se).setAlign(i.Align$$module$build$src$core$inputs$align.RIGHT);se===0&&le.appendField(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_INPUT_WITH)}for(se=this.itemCount_;this.getInput("ADD"+se);se++)this.removeInput("ADD"+se)}};Se.lists_create_with=Ie;var Xe={init:function(){this.setStyle("list_blocks"),this.appendDummyInput().appendField(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};Se.lists_create_with_container=Xe;var it={init:function(){this.setStyle("list_blocks"),this.appendDummyInput().appendField(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(i.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};Se.lists_create_with_item=it;var Tt={init:function(){var se=[[i.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_FIRST,"FIRST"],[i.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_LAST,"LAST"]];if(this.setHelpUrl(i.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_HELPURL),this.setStyle("list_blocks"),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck("Array").appendField(i.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_INPUT_IN_LIST),se=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),!se)throw Error("field_dropdown not found");this.appendValueInput("FIND").appendField(se,"END"),this.setInputsInline(!0),this.setTooltip(()=>i.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};Se.lists_indexOf=Tt;var He={init:function(){var se=[[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),se=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),se.setValidator(function(le){le=le==="REMOVE",this.getSourceBlock().updateStatement_(le)}),this.appendValueInput("VALUE").setCheck("Array").appendField(i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(se,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const le=this.getFieldValue("MODE"),Fe=this.getFieldValue("WHERE");let pe="";switch(le+" "+Fe){case"GET FROM_START":case"GET FROM_END":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":pe=i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(Fe==="FROM_START"||Fe==="FROM_END")&&(pe+=" "+(Fe==="FROM_START"?i.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:i.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),pe})},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");se.setAttribute("statement",String(!this.outputConnection));const le=this.getInput("AT")instanceof i.ValueInput$$module$build$src$core$inputs$value_input;return se.setAttribute("at",String(le)),se},domToMutation:function(se){const le=se.getAttribute("statement")==="true";this.updateStatement_(le),se=se.getAttribute("at")!=="false",this.updateAt_(se)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(se){se.isStatement?this.updateStatement_(!0):typeof se=="string"&&this.domToMutation(i.textToDom$$module$build$src$core$utils$xml(se))},updateStatement_:function(se){se!==!this.outputConnection&&(this.unplug(!0,!0),se?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(se){this.removeInput("AT"),this.removeInput("ORDINAL",!0),se?(this.appendValueInput("AT").setCheck("Number"),i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const le=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});le.setValidator(function(Fe){const pe=Fe==="FROM_START"||Fe==="FROM_END";if(pe!==se){const je=this.getSourceBlock();return je.updateAt_(pe),je.setFieldValue(Fe,"WHERE"),null}}),this.getInput("AT").appendField(le,"WHERE"),i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};Se.lists_getIndex=He;var ke={init:function(){var se=[[i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[i.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),se=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:se}),this.appendDummyInput().appendField(se,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const le=this.getFieldValue("MODE"),Fe=this.getFieldValue("WHERE");let pe="";switch(le+" "+Fe){case"SET FROM_START":case"SET FROM_END":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":pe=i.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(Fe==="FROM_START"||Fe==="FROM_END")&&(pe+=" "+i.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),pe})},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation"),le=this.getInput("AT")instanceof i.ValueInput$$module$build$src$core$inputs$value_input;return se.setAttribute("at",String(le)),se},domToMutation:function(se){se=se.getAttribute("at")!=="false",this.updateAt_(se)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(se){this.removeInput("AT"),this.removeInput("ORDINAL",!0),se?(this.appendValueInput("AT").setCheck("Number"),i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const le=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});le.setValidator(function(Fe){const pe=Fe==="FROM_START"||Fe==="FROM_END";if(pe!==se){const je=this.getSourceBlock();return je.updateAt_(pe),je.setFieldValue(Fe,"WHERE"),null}}),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(le,"WHERE")}};Se.lists_setIndex=ke;var ot={init:function(){this.WHERE_OPTIONS_1=[[i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");var le=this.getInput("AT1")instanceof i.ValueInput$$module$build$src$core$inputs$value_input;return se.setAttribute("at1",String(le)),le=this.getInput("AT2")instanceof i.ValueInput$$module$build$src$core$inputs$value_input,se.setAttribute("at2",String(le)),se},domToMutation:function(se){const le=se.getAttribute("at1")==="true";se=se.getAttribute("at2")==="true",this.updateAt_(1,le),this.updateAt_(2,se)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(se,le){this.removeInput("AT"+se),this.removeInput("ORDINAL"+se,!0),le?(this.appendValueInput("AT"+se).setCheck("Number"),i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+se).appendField(i.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+se);const Fe=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+se]});Fe.setValidator(function(pe){const je=pe==="FROM_START"||pe==="FROM_END";if(je!==le){const Ae=this.getSourceBlock();return Ae.updateAt_(se,je),Ae.setFieldValue(pe,"WHERE"+se),null}}),this.getInput("AT"+se).appendField(Fe,"WHERE"+se),se===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),i.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};Se.lists_getSublist=ot,Se.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},Se.lists_split={init:function(){const se=i.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[i.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[i.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!se)throw Error("field_dropdown not found");se.setValidator(le=>{this.updateType_(le)}),this.setHelpUrl(i.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(se,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(i.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const le=this.getFieldValue("MODE");if(le==="SPLIT")return i.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(le==="JOIN")return i.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+le)})},updateType_:function(se){if(this.getFieldValue("MODE")!==se){const le=this.getInput("INPUT").connection;le.setShadowDom(null);const Fe=le.targetBlock();Fe&&(le.disconnect(),Fe.isShadow()?Fe.dispose(!1):this.bumpNeighbours())}se==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const se=i.createElement$$module$build$src$core$utils$xml("mutation");return se.setAttribute("mode",this.getFieldValue("MODE")),se},domToMutation:function(se){this.updateType_(se.getAttribute("mode"))},saveExtraState:function(){return null},loadExtraState:function(){}},i.defineBlocks$$module$build$src$core$common(Se);var Ct={blocks:Se},Gt=i.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]);i.defineBlocks$$module$build$src$core$common(Gt);var Ot={blocks:Gt},En=Object.assign({},Gt,Se,ze,Ne,re,F,u,s),fe={blocks:En,colour:Ot,lists:Ct,loops:dt,math:Ee,procedures:K,texts:P,variables:p,variablesDynamic:c};return fe.__namespace__=i,fe})}(QV)),QV.exports}var q$e=JV.exports,Sre;function Bve(){return Sre||(Sre=1,function(n,e){(function(t,i){n.exports=i(Y$e())})(q$e,function(t){/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */return t})}(JV)),JV.exports}var ZV={exports:{}},eU={exports:{}},J$e=eU.exports,wre;function Q$e(){return wre||(wre=1,function(n,e){(function(t,i){n.exports=i(P5())})(J$e,function(t){var i=t.__namespace__,s=function(H,j){return[j.quote_(H.getFieldValue("COLOUR")),fe.ATOMIC]},o=function(H,j){return[j.provideFunction_("colourRandom",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}() {
- var num = Math.floor(Math.random() * Math.pow(2, 24));
- return '#' + ('00000' + num.toString(16)).substr(-6);
- }
- `)+"()",fe.FUNCTION_CALL]},r=function(H,j){const ue=j.valueToCode(H,"RED",fe.NONE)||0,ie=j.valueToCode(H,"GREEN",fe.NONE)||0;return H=j.valueToCode(H,"BLUE",fe.NONE)||0,[j.provideFunction_("colourRgb",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
- r = Math.max(Math.min(Number(r), 100), 0) * 2.55;
- g = Math.max(Math.min(Number(g), 100), 0) * 2.55;
- b = Math.max(Math.min(Number(b), 100), 0) * 2.55;
- r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);
- g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);
- b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);
- return '#' + r + g + b;
- }
- `)+"("+ue+", "+ie+", "+H+")",fe.FUNCTION_CALL]},a=function(H,j){const ue=j.valueToCode(H,"COLOUR1",fe.NONE)||"'#000000'",ie=j.valueToCode(H,"COLOUR2",fe.NONE)||"'#000000'";return H=j.valueToCode(H,"RATIO",fe.NONE)||.5,[j.provideFunction_("colourBlend",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) {
- ratio = Math.max(Math.min(Number(ratio), 1), 0);
- var r1 = parseInt(c1.substring(1, 3), 16);
- var g1 = parseInt(c1.substring(3, 5), 16);
- var b1 = parseInt(c1.substring(5, 7), 16);
- var r2 = parseInt(c2.substring(1, 3), 16);
- var g2 = parseInt(c2.substring(3, 5), 16);
- var b2 = parseInt(c2.substring(5, 7), 16);
- var r = Math.round(r1 * (1 - ratio) + r2 * ratio);
- var g = Math.round(g1 * (1 - ratio) + g2 * ratio);
- var b = Math.round(b1 * (1 - ratio) + b2 * ratio);
- r = ('0' + (r || 0).toString(16)).slice(-2);
- g = ('0' + (g || 0).toString(16)).slice(-2);
- b = ('0' + (b || 0).toString(16)).slice(-2);
- return '#' + r + g + b;
- }
- `)+"("+ue+", "+ie+", "+H+")",fe.FUNCTION_CALL]},c=function(H,j){return["[]",fe.ATOMIC]},u=function(H,j){const ue=Array(H.itemCount_);for(let ie=0;ie<H.itemCount_;ie++)ue[ie]=j.valueToCode(H,"ADD"+ie,fe.NONE)||"null";return["["+ue.join(", ")+"]",fe.ATOMIC]},d=function(H,j){const ue=j.provideFunction_("listsRepeat",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(value, n) {
- var array = [];
- for (var i = 0; i < n; i++) {
- array[i] = value;
- }
- return array;
- }
- `),ie=j.valueToCode(H,"ITEM",fe.NONE)||"null";return H=j.valueToCode(H,"NUM",fe.NONE)||"0",[ue+"("+ie+", "+H+")",fe.FUNCTION_CALL]},f=function(H,j){return[(j.valueToCode(H,"VALUE",fe.MEMBER)||"[]")+".length",fe.MEMBER]},g=function(H,j){return["!"+(j.valueToCode(H,"VALUE",fe.MEMBER)||"[]")+".length",fe.LOGICAL_NOT]},p=function(H,j){const ue=H.getFieldValue("END")==="FIRST"?"indexOf":"lastIndexOf",ie=j.valueToCode(H,"FIND",fe.NONE)||"''";return j=(j.valueToCode(H,"VALUE",fe.MEMBER)||"[]")+"."+ue+"("+ie+")",H.workspace.options.oneBasedIndex?[j+" + 1",fe.ADDITION]:[j,fe.FUNCTION_CALL]},_=function(H,j){const ue=H.getFieldValue("MODE")||"GET",ie=H.getFieldValue("WHERE")||"FROM_START";var Te=j.valueToCode(H,"VALUE",ie==="RANDOM"?fe.NONE:fe.MEMBER)||"[]";switch(ie){case"FIRST":if(ue==="GET")return[Te+"[0]",fe.MEMBER];if(ue==="GET_REMOVE")return[Te+".shift()",fe.MEMBER];if(ue==="REMOVE")return Te+`.shift();
- `;break;case"LAST":if(ue==="GET")return[Te+".slice(-1)[0]",fe.MEMBER];if(ue==="GET_REMOVE")return[Te+".pop()",fe.MEMBER];if(ue==="REMOVE")return Te+`.pop();
- `;break;case"FROM_START":if(H=j.getAdjusted(H,"AT"),ue==="GET")return[Te+"["+H+"]",fe.MEMBER];if(ue==="GET_REMOVE")return[Te+".splice("+H+", 1)[0]",fe.FUNCTION_CALL];if(ue==="REMOVE")return Te+".splice("+H+`, 1);
- `;break;case"FROM_END":if(H=j.getAdjusted(H,"AT",1,!0),ue==="GET")return[Te+".slice("+H+")[0]",fe.FUNCTION_CALL];if(ue==="GET_REMOVE")return[Te+".splice("+H+", 1)[0]",fe.FUNCTION_CALL];if(ue==="REMOVE")return Te+".splice("+H+", 1);";break;case"RANDOM":if(Te=j.provideFunction_("listsGetRandomItem",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(list, remove) {
- var x = Math.floor(Math.random() * list.length);
- if (remove) {
- return list.splice(x, 1)[0];
- } else {
- return list[x];
- }
- }
- `)+"("+Te+", "+(ue!=="GET")+")",ue==="GET"||ue==="GET_REMOVE")return[Te,fe.FUNCTION_CALL];if(ue==="REMOVE")return Te+`;
- `}throw Error("Unhandled combination (lists_getIndex).")},v=function(H,j){function ue(){if(ie.match(/^\w+$/))return"";const tt=j.nameDB_.getDistinctName("tmpList",i.NameType$$module$build$src$core$names.VARIABLE),It="var "+tt+" = "+ie+`;
- `;return ie=tt,It}let ie=j.valueToCode(H,"LIST",fe.MEMBER)||"[]";const Te=H.getFieldValue("MODE")||"GET";var De=H.getFieldValue("WHERE")||"FROM_START";const me=j.valueToCode(H,"TO",fe.ASSIGNMENT)||"null";switch(De){case"FIRST":if(Te==="SET")return ie+"[0] = "+me+`;
- `;if(Te==="INSERT")return ie+".unshift("+me+`);
- `;break;case"LAST":if(Te==="SET")return ue()+(ie+"["+ie+".length - 1] = "+me+`;
- `);if(Te==="INSERT")return ie+".push("+me+`);
- `;break;case"FROM_START":if(H=j.getAdjusted(H,"AT"),Te==="SET")return ie+"["+H+"] = "+me+`;
- `;if(Te==="INSERT")return ie+".splice("+H+", 0, "+me+`);
- `;break;case"FROM_END":if(H=j.getAdjusted(H,"AT",1,!1,fe.SUBTRACTION),De=ue(),Te==="SET")return De+(ie+"["+ie+".length - "+H+"] = "+me+`;
- `);if(Te==="INSERT")return De+(ie+".splice("+ie+".length - "+H+", 0, "+me+`);
- `);break;case"RANDOM":if(H=ue(),De=j.nameDB_.getDistinctName("tmpX",i.NameType$$module$build$src$core$names.VARIABLE),H+="var "+De+" = Math.floor(Math.random() * "+ie+`.length);
- `,Te==="SET")return H+(ie+"["+De+"] = "+me+`;
- `);if(Te==="INSERT")return H+(ie+".splice("+De+", 0, "+me+`);
- `)}throw Error("Unhandled combination (lists_setIndex).")},C=function(H,j){var ue={FIRST:"First",LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"},ie=j.valueToCode(H,"LIST",fe.MEMBER)||"[]";const Te=H.getFieldValue("WHERE1"),De=H.getFieldValue("WHERE2");if(Te==="FIRST"&&De==="LAST")ie+=".slice(0)";else if(ie.match(/^\w+$/)||Te!=="FROM_END"&&De==="FROM_START"){switch(Te){case"FROM_START":ue=j.getAdjusted(H,"AT1");break;case"FROM_END":ue=j.getAdjusted(H,"AT1",1,!1,fe.SUBTRACTION),ue=ie+".length - "+ue;break;case"FIRST":ue="0";break;default:throw Error("Unhandled option (lists_getSublist).")}switch(De){case"FROM_START":j=j.getAdjusted(H,"AT2",1);break;case"FROM_END":j=j.getAdjusted(H,"AT2",0,!1,fe.SUBTRACTION),j=ie+".length - "+j;break;case"LAST":j=ie+".length";break;default:throw Error("Unhandled option (lists_getSublist).")}ie=ie+".slice("+ue+", "+j+")"}else{const me=j.getAdjusted(H,"AT1");H=j.getAdjusted(H,"AT2"),ie=j.provideFunction_("subsequence"+ue[Te]+ue[De],`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(sequence${Te==="FROM_END"||Te==="FROM_START"?", at1":""}${De==="FROM_END"||De==="FROM_START"?", at2":""}) {
- var start = ${Fe("sequence",Te,"at1")};
- var end = ${Fe("sequence",De,"at2")} + 1;
- return sequence.slice(start, end);
- }
- `)+"("+ie+(Te==="FROM_END"||Te==="FROM_START"?", "+me:"")+(De==="FROM_END"||De==="FROM_START"?", "+H:"")+")"}return[ie,fe.FUNCTION_CALL]},y=function(H,j){const ue=j.valueToCode(H,"LIST",fe.FUNCTION_CALL)||"[]",ie=H.getFieldValue("DIRECTION")==="1"?1:-1;return H=H.getFieldValue("TYPE"),j=j.provideFunction_("listsGetSortCompare",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(type, direction) {
- var compareFuncs = {
- 'NUMERIC': function(a, b) {
- return Number(a) - Number(b); },
- 'TEXT': function(a, b) {
- return String(a) > String(b) ? 1 : -1; },
- 'IGNORE_CASE': function(a, b) {
- return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; },
- };
- var compare = compareFuncs[type];
- return function(a, b) { return compare(a, b) * direction; };
- }
- `),[ue+".slice().sort("+j+'("'+H+'", '+ie+"))",fe.FUNCTION_CALL]},w=function(H,j){let ue=j.valueToCode(H,"INPUT",fe.MEMBER);if(j=j.valueToCode(H,"DELIM",fe.NONE)||"''",H=H.getFieldValue("MODE"),H==="SPLIT")ue||(ue="''"),H="split";else if(H==="JOIN")ue||(ue="[]"),H="join";else throw Error("Unknown mode: "+H);return[ue+"."+H+"("+j+")",fe.FUNCTION_CALL]},I=function(H,j){return[(j.valueToCode(H,"LIST",fe.FUNCTION_CALL)||"[]")+".slice().reverse()",fe.FUNCTION_CALL]},L=function(H,j){var ue=0;let ie="";j.STATEMENT_PREFIX&&(ie+=j.injectId(j.STATEMENT_PREFIX,H));do{const Te=j.valueToCode(H,"IF"+ue,fe.NONE)||"false";let De=j.statementToCode(H,"DO"+ue);j.STATEMENT_SUFFIX&&(De=j.prefixLines(j.injectId(j.STATEMENT_SUFFIX,H),j.INDENT)+De),ie+=(0<ue?" else ":"")+"if ("+Te+`) {
- `+De+"}",ue++}while(H.getInput("IF"+ue));return(H.getInput("ELSE")||j.STATEMENT_SUFFIX)&&(ue=j.statementToCode(H,"ELSE"),j.STATEMENT_SUFFIX&&(ue=j.prefixLines(j.injectId(j.STATEMENT_SUFFIX,H),j.INDENT)+ue),ie+=` else {
- `+ue+"}"),ie+`
- `},O=function(H,j){const ue={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[H.getFieldValue("OP")],ie=ue==="=="||ue==="!="?fe.EQUALITY:fe.RELATIONAL,Te=j.valueToCode(H,"A",ie)||"0";return H=j.valueToCode(H,"B",ie)||"0",[Te+" "+ue+" "+H,ie]},A=function(H,j){const ue=H.getFieldValue("OP")==="AND"?"&&":"||",ie=ue==="&&"?fe.LOGICAL_AND:fe.LOGICAL_OR;let Te=j.valueToCode(H,"A",ie);return H=j.valueToCode(H,"B",ie),Te||H?(j=ue==="&&"?"true":"false",Te||(Te=j),H||(H=j)):H=Te="false",[Te+" "+ue+" "+H,ie]},N=function(H,j){const ue=fe.LOGICAL_NOT;return["!"+(j.valueToCode(H,"BOOL",ue)||"true"),ue]},D=function(H,j){return[H.getFieldValue("BOOL")==="TRUE"?"true":"false",fe.ATOMIC]},P=function(H,j){return["null",fe.ATOMIC]},F=function(H,j){const ue=j.valueToCode(H,"IF",fe.CONDITIONAL)||"false",ie=j.valueToCode(H,"THEN",fe.CONDITIONAL)||"null";return H=j.valueToCode(H,"ELSE",fe.CONDITIONAL)||"null",[ue+" ? "+ie+" : "+H,fe.CONDITIONAL]},V=function(H,j){let ue;ue=H.getField("TIMES")?String(Number(H.getFieldValue("TIMES"))):j.valueToCode(H,"TIMES",fe.ASSIGNMENT)||"0";let ie=j.statementToCode(H,"DO");ie=j.addLoopTrap(ie,H),H="";const Te=j.nameDB_.getDistinctName("count",i.NameType$$module$build$src$core$names.VARIABLE);let De=ue;return ue.match(/^\w+$/)||i.isNumber$$module$build$src$core$utils$string(ue)||(De=j.nameDB_.getDistinctName("repeat_end",i.NameType$$module$build$src$core$names.VARIABLE),H+="var "+De+" = "+ue+`;
- `),H+("for (var "+Te+" = 0; "+Te+" < "+De+"; "+Te+`++) {
- `+ie+`}
- `)},U=function(H,j){const ue=H.getFieldValue("MODE")==="UNTIL";let ie=j.valueToCode(H,"BOOL",ue?fe.LOGICAL_NOT:fe.NONE)||"false",Te=j.statementToCode(H,"DO");return Te=j.addLoopTrap(Te,H),ue&&(ie="!"+ie),"while ("+ie+`) {
- `+Te+`}
- `},Q=function(H,j){var ue=j.getVariableName(H.getFieldValue("VAR")),ie=j.valueToCode(H,"FROM",fe.ASSIGNMENT)||"0",Te=j.valueToCode(H,"TO",fe.ASSIGNMENT)||"0";const De=j.valueToCode(H,"BY",fe.ASSIGNMENT)||"1";let me=j.statementToCode(H,"DO");if(me=j.addLoopTrap(me,H),i.isNumber$$module$build$src$core$utils$string(ie)&&i.isNumber$$module$build$src$core$utils$string(Te)&&i.isNumber$$module$build$src$core$utils$string(De))j=Number(ie)<=Number(Te),H="for ("+ue+" = "+ie+"; "+ue+(j?" <= ":" >= ")+Te+"; "+ue,ue=Math.abs(Number(De)),H=ue===1?H+(j?"++":"--"):H+((j?" += ":" -= ")+ue),H+=`) {
- `+me+`}
- `;else{H="";let tt=ie;ie.match(/^\w+$/)||i.isNumber$$module$build$src$core$utils$string(ie)||(tt=j.nameDB_.getDistinctName(ue+"_start",i.NameType$$module$build$src$core$names.VARIABLE),H+="var "+tt+" = "+ie+`;
- `),ie=Te,Te.match(/^\w+$/)||i.isNumber$$module$build$src$core$utils$string(Te)||(ie=j.nameDB_.getDistinctName(ue+"_end",i.NameType$$module$build$src$core$names.VARIABLE),H+="var "+ie+" = "+Te+`;
- `),Te=j.nameDB_.getDistinctName(ue+"_inc",i.NameType$$module$build$src$core$names.VARIABLE),H+="var "+Te+" = ",H=i.isNumber$$module$build$src$core$utils$string(De)?H+(Math.abs(Number(De))+`;
- `):H+("Math.abs("+De+`);
- `),H+="if ("+tt+" > "+ie+`) {
- `,H+=j.INDENT+Te+" = -"+Te+`;
- `,H=H+`}
- for (`+(ue+" = "+tt+"; "+Te+" >= 0 ? "+ue+" <= "+ie+" : "+ue+" >= "+ie+"; "+ue+" += "+Te+`) {
- `+me+`}
- `)}return H},de=function(H,j){const ue=j.getVariableName(H.getFieldValue("VAR"));var ie=j.valueToCode(H,"LIST",fe.ASSIGNMENT)||"[]";let Te=j.statementToCode(H,"DO");Te=j.addLoopTrap(Te,H),H="";let De=ie;return ie.match(/^\w+$/)||(De=j.nameDB_.getDistinctName(ue+"_list",i.NameType$$module$build$src$core$names.VARIABLE),H+="var "+De+" = "+ie+`;
- `),ie=j.nameDB_.getDistinctName(ue+"_index",i.NameType$$module$build$src$core$names.VARIABLE),Te=j.INDENT+ue+" = "+De+"["+ie+`];
- `+Te,H+("for (var "+ie+" in "+De+`) {
- `+Te+`}
- `)},q=function(H,j){let ue="";if(j.STATEMENT_PREFIX&&(ue+=j.injectId(j.STATEMENT_PREFIX,H)),j.STATEMENT_SUFFIX&&(ue+=j.injectId(j.STATEMENT_SUFFIX,H)),j.STATEMENT_PREFIX){const ie=H.getSurroundLoop();ie&&!ie.suppressPrefixSuffix&&(ue+=j.injectId(j.STATEMENT_PREFIX,ie))}switch(H.getFieldValue("FLOW")){case"BREAK":return ue+`break;
- `;case"CONTINUE":return ue+`continue;
- `}throw Error("Unknown flow statement.")},K=function(H,j){return H=Number(H.getFieldValue("NUM")),[String(H),0<=H?fe.ATOMIC:fe.UNARY_NEGATION]},re=function(H,j){var ue={ADD:[" + ",fe.ADDITION],MINUS:[" - ",fe.SUBTRACTION],MULTIPLY:[" * ",fe.MULTIPLICATION],DIVIDE:[" / ",fe.DIVISION],POWER:[null,fe.NONE]}[H.getFieldValue("OP")];const ie=ue[0];ue=ue[1];const Te=j.valueToCode(H,"A",ue)||"0";return H=j.valueToCode(H,"B",ue)||"0",ie?[Te+ie+H,ue]:["Math.pow("+Te+", "+H+")",fe.FUNCTION_CALL]},Z=function(H,j){const ue=H.getFieldValue("OP");let ie;if(ue==="NEG")return H=j.valueToCode(H,"NUM",fe.UNARY_NEGATION)||"0",H[0]==="-"&&(H=" "+H),["-"+H,fe.UNARY_NEGATION];switch(H=ue==="SIN"||ue==="COS"||ue==="TAN"?j.valueToCode(H,"NUM",fe.DIVISION)||"0":j.valueToCode(H,"NUM",fe.NONE)||"0",ue){case"ABS":ie="Math.abs("+H+")";break;case"ROOT":ie="Math.sqrt("+H+")";break;case"LN":ie="Math.log("+H+")";break;case"EXP":ie="Math.exp("+H+")";break;case"POW10":ie="Math.pow(10,"+H+")";break;case"ROUND":ie="Math.round("+H+")";break;case"ROUNDUP":ie="Math.ceil("+H+")";break;case"ROUNDDOWN":ie="Math.floor("+H+")";break;case"SIN":ie="Math.sin("+H+" / 180 * Math.PI)";break;case"COS":ie="Math.cos("+H+" / 180 * Math.PI)";break;case"TAN":ie="Math.tan("+H+" / 180 * Math.PI)"}if(ie)return[ie,fe.FUNCTION_CALL];switch(ue){case"LOG10":ie="Math.log("+H+") / Math.log(10)";break;case"ASIN":ie="Math.asin("+H+") / Math.PI * 180";break;case"ACOS":ie="Math.acos("+H+") / Math.PI * 180";break;case"ATAN":ie="Math.atan("+H+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+ue)}return[ie,fe.DIVISION]},J=function(H,j){return{PI:["Math.PI",fe.MEMBER],E:["Math.E",fe.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",fe.DIVISION],SQRT2:["Math.SQRT2",fe.MEMBER],SQRT1_2:["Math.SQRT1_2",fe.MEMBER],INFINITY:["Infinity",fe.ATOMIC]}[H.getFieldValue("CONSTANT")]},ge=function(H,j){var ue={EVEN:[" % 2 === 0",fe.MODULUS,fe.EQUALITY],ODD:[" % 2 === 1",fe.MODULUS,fe.EQUALITY],WHOLE:[" % 1 === 0",fe.MODULUS,fe.EQUALITY],POSITIVE:[" > 0",fe.RELATIONAL,fe.RELATIONAL],NEGATIVE:[" < 0",fe.RELATIONAL,fe.RELATIONAL],DIVISIBLE_BY:[null,fe.MODULUS,fe.EQUALITY],PRIME:[null,fe.NONE,fe.FUNCTION_CALL]};const ie=H.getFieldValue("PROPERTY"),[Te,De,me]=ue[ie];return ue=j.valueToCode(H,"NUMBER_TO_CHECK",De)||"0",ie==="PRIME"?H=j.provideFunction_("mathIsPrime",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(n) {
- // https://en.wikipedia.org/wiki/Primality_test#Naive_methods
- if (n == 2 || n == 3) {
- return true;
- }
- // False if n is NaN, negative, is 1, or not whole.
- // And false if n is divisible by 2 or 3.
- if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) {
- return false;
- }
- // Check all the numbers of form 6k +/- 1, up to sqrt(n).
- for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {
- if (n % (x - 1) === 0 || n % (x + 1) === 0) {
- return false;
- }
- }
- return true;
- }
- `)+"("+ue+")":ie==="DIVISIBLE_BY"?(H=j.valueToCode(H,"DIVISOR",fe.MODULUS)||"0",H=ue+" % "+H+" === 0"):H=ue+Te,[H,me]},ve=function(H,j){const ue=j.valueToCode(H,"DELTA",fe.ADDITION)||"0";return H=j.getVariableName(H.getFieldValue("VAR")),H+" = (typeof "+H+" === 'number' ? "+H+" : 0) + "+ue+`;
- `},Le=function(H,j){var ue=H.getFieldValue("OP");switch(ue){case"SUM":H=j.valueToCode(H,"LIST",fe.MEMBER)||"[]",H+=".reduce(function(x, y) {return x + y;}, 0)";break;case"MIN":H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H="Math.min.apply(null, "+H+")";break;case"MAX":H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H="Math.max.apply(null, "+H+")";break;case"AVERAGE":ue=j.provideFunction_("mathMean",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(myList) {
- return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length;
- }
- `),H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H=ue+"("+H+")";break;case"MEDIAN":ue=j.provideFunction_("mathMedian",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(myList) {
- var localList = myList.filter(function (x) {return typeof x === 'number';});
- if (!localList.length) return null;
- localList.sort(function(a, b) {return b - a;});
- if (localList.length % 2 === 0) {
- return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;
- } else {
- return localList[(localList.length - 1) / 2];
- }
- }
- `),H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H=ue+"("+H+")";break;case"MODE":ue=j.provideFunction_("mathModes",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(values) {
- var modes = [];
- var counts = [];
- var maxCount = 0;
- for (var i = 0; i < values.length; i++) {
- var value = values[i];
- var found = false;
- var thisCount;
- for (var j = 0; j < counts.length; j++) {
- if (counts[j][0] === value) {
- thisCount = ++counts[j][1];
- found = true;
- break;
- }
- }
- if (!found) {
- counts.push([value, 1]);
- thisCount = 1;
- }
- maxCount = Math.max(thisCount, maxCount);
- }
- for (var j = 0; j < counts.length; j++) {
- if (counts[j][1] === maxCount) {
- modes.push(counts[j][0]);
- }
- }
- return modes;
- }
- `),H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H=ue+"("+H+")";break;case"STD_DEV":ue=j.provideFunction_("mathStandardDeviation",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(numbers) {
- var n = numbers.length;
- if (!n) return null;
- var mean = numbers.reduce(function(x, y) {return x + y;}) / n;
- var variance = 0;
- for (var j = 0; j < n; j++) {
- variance += Math.pow(numbers[j] - mean, 2);
- }
- variance = variance / n;
- return Math.sqrt(variance);
- }
- `),H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H=ue+"("+H+")";break;case"RANDOM":ue=j.provideFunction_("mathRandomList",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(list) {
- var x = Math.floor(Math.random() * list.length);
- return list[x];
- }
- `),H=j.valueToCode(H,"LIST",fe.NONE)||"[]",H=ue+"("+H+")";break;default:throw Error("Unknown operator: "+ue)}return[H,fe.FUNCTION_CALL]},Ee=function(H,j){const ue=j.valueToCode(H,"DIVIDEND",fe.MODULUS)||"0";return H=j.valueToCode(H,"DIVISOR",fe.MODULUS)||"0",[ue+" % "+H,fe.MODULUS]},Ne=function(H,j){const ue=j.valueToCode(H,"VALUE",fe.NONE)||"0",ie=j.valueToCode(H,"LOW",fe.NONE)||"0";return H=j.valueToCode(H,"HIGH",fe.NONE)||"Infinity",["Math.min(Math.max("+ue+", "+ie+"), "+H+")",fe.FUNCTION_CALL]},qe=function(H,j){const ue=j.valueToCode(H,"FROM",fe.NONE)||"0";return H=j.valueToCode(H,"TO",fe.NONE)||"0",[j.provideFunction_("mathRandomInt",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
- if (a > b) {
- // Swap a and b to ensure a is smaller.
- var c = a;
- a = b;
- b = c;
- }
- return Math.floor(Math.random() * (b - a + 1) + a);
- }
- `)+"("+ue+", "+H+")",fe.FUNCTION_CALL]},Re=function(H,j){return["Math.random()",fe.FUNCTION_CALL]},we=function(H,j){const ue=j.valueToCode(H,"X",fe.NONE)||"0";return["Math.atan2("+(j.valueToCode(H,"Y",fe.NONE)||"0")+", "+ue+") / Math.PI * 180",fe.DIVISION]},Ve=function(H,j){const ue=j.getProcedureName(H.getFieldValue("NAME"));var ie="";j.STATEMENT_PREFIX&&(ie+=j.injectId(j.STATEMENT_PREFIX,H)),j.STATEMENT_SUFFIX&&(ie+=j.injectId(j.STATEMENT_SUFFIX,H)),ie&&(ie=j.prefixLines(ie,j.INDENT));let Te="";j.INFINITE_LOOP_TRAP&&(Te=j.prefixLines(j.injectId(j.INFINITE_LOOP_TRAP,H),j.INDENT));const De=j.statementToCode(H,"STACK");let me=j.valueToCode(H,"RETURN",fe.NONE)||"",tt="";De&&me&&(tt=ie),me&&(me=j.INDENT+"return "+me+`;
- `);const It=[],kt=H.getVars();for(let un=0;un<kt.length;un++)It[un]=j.getVariableName(kt[un]);return ie="function "+ue+"("+It.join(", ")+`) {
- `+ie+Te+De+tt+me+"}",ie=j.scrub_(H,ie),j.definitions_["%"+ue]=ie,null},Ge=function(H,j){const ue=j.getProcedureName(H.getFieldValue("NAME")),ie=[],Te=H.getVars();for(let De=0;De<Te.length;De++)ie[De]=j.valueToCode(H,"ARG"+De,fe.NONE)||"null";return[ue+"("+ie.join(", ")+")",fe.FUNCTION_CALL]},dt=function(H,j){return j.forBlock.procedures_callreturn(H,j)[0]+`;
- `},ze=function(H,j){let ue="if ("+(j.valueToCode(H,"CONDITION",fe.NONE)||"false")+`) {
- `;return j.STATEMENT_SUFFIX&&(ue+=j.prefixLines(j.injectId(j.STATEMENT_SUFFIX,H),j.INDENT)),H.hasReturnValue_?(H=j.valueToCode(H,"VALUE",fe.NONE)||"null",ue+=j.INDENT+"return "+H+`;
- `):ue+=j.INDENT+`return;
- `,ue+`}
- `},ee=function(H,j){return[j.quote_(H.getFieldValue("TEXT")),fe.ATOMIC]},ye=function(H,j){return H=j.multiline_quote_(H.getFieldValue("TEXT")),j=H.indexOf("+")!==-1?fe.ADDITION:fe.ATOMIC,[H,j]},Me=function(H,j){switch(H.itemCount_){case 0:return["''",fe.ATOMIC];case 1:return H=j.valueToCode(H,"ADD0",fe.NONE)||"''",Xn(H);case 2:var ue=j.valueToCode(H,"ADD0",fe.NONE)||"''";return H=j.valueToCode(H,"ADD1",fe.NONE)||"''",[Xn(ue)[0]+" + "+Xn(H)[0],fe.ADDITION];default:ue=Array(H.itemCount_);for(let ie=0;ie<H.itemCount_;ie++)ue[ie]=j.valueToCode(H,"ADD"+ie,fe.NONE)||"''";return["["+ue.join(",")+"].join('')",fe.FUNCTION_CALL]}},et=function(H,j){const ue=j.getVariableName(H.getFieldValue("VAR"));return H=j.valueToCode(H,"TEXT",fe.NONE)||"''",ue+" += "+Xn(H)[0]+`;
- `},at=function(H,j){return[(j.valueToCode(H,"VALUE",fe.MEMBER)||"''")+".length",fe.MEMBER]},Ue=function(H,j){return["!"+(j.valueToCode(H,"VALUE",fe.MEMBER)||"''")+".length",fe.LOGICAL_NOT]},Se=function(H,j){const ue=H.getFieldValue("END")==="FIRST"?"indexOf":"lastIndexOf",ie=j.valueToCode(H,"FIND",fe.NONE)||"''";return j=(j.valueToCode(H,"VALUE",fe.MEMBER)||"''")+"."+ue+"("+ie+")",H.workspace.options.oneBasedIndex?[j+" + 1",fe.ADDITION]:[j,fe.FUNCTION_CALL]},Ie=function(H,j){const ue=H.getFieldValue("WHERE")||"FROM_START",ie=j.valueToCode(H,"VALUE",ue==="RANDOM"?fe.NONE:fe.MEMBER)||"''";switch(ue){case"FIRST":return[ie+".charAt(0)",fe.FUNCTION_CALL];case"LAST":return[ie+".slice(-1)",fe.FUNCTION_CALL];case"FROM_START":return H=j.getAdjusted(H,"AT"),[ie+".charAt("+H+")",fe.FUNCTION_CALL];case"FROM_END":return H=j.getAdjusted(H,"AT",1,!0),[ie+".slice("+H+").charAt(0)",fe.FUNCTION_CALL];case"RANDOM":return[j.provideFunction_("textRandomLetter",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(text) {
- var x = Math.floor(Math.random() * text.length);
- return text[x];
- }
- `)+"("+ie+")",fe.FUNCTION_CALL]}throw Error("Unhandled option (text_charAt).")},Xe=function(H,j){var ue={FIRST:"First",LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"};const ie=H.getFieldValue("WHERE1"),Te=H.getFieldValue("WHERE2");var De=ie!=="FROM_END"&&ie!=="LAST"&&Te!=="FROM_END"&&Te!=="LAST",me=j.valueToCode(H,"STRING",De?fe.MEMBER:fe.NONE)||"''";if(ie==="FIRST"&&Te==="LAST")return[me,fe.NONE];if(me.match(/^'?\w+'?$/)||De){switch(ie){case"FROM_START":ue=j.getAdjusted(H,"AT1");break;case"FROM_END":ue=j.getAdjusted(H,"AT1",1,!1,fe.SUBTRACTION),ue=me+".length - "+ue;break;case"FIRST":ue="0";break;default:throw Error("Unhandled option (text_getSubstring).")}switch(Te){case"FROM_START":j=j.getAdjusted(H,"AT2",1);break;case"FROM_END":j=j.getAdjusted(H,"AT2",0,!1,fe.SUBTRACTION),j=me+".length - "+j;break;case"LAST":j=me+".length";break;default:throw Error("Unhandled option (text_getSubstring).")}me=me+".slice("+ue+", "+j+")"}else De=j.getAdjusted(H,"AT1"),H=j.getAdjusted(H,"AT2"),me=j.provideFunction_("subsequence"+ue[ie]+ue[Te],`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(sequence${ie==="FROM_END"||ie==="FROM_START"?", at1":""}${Te==="FROM_END"||Te==="FROM_START"?", at2":""}) {
- var start = ${vs("sequence",ie,"at1")};
- var end = ${vs("sequence",Te,"at2")} + 1;
- return sequence.slice(start, end);
- }
- `)+"("+me+(ie==="FROM_END"||ie==="FROM_START"?", "+De:"")+(Te==="FROM_END"||Te==="FROM_START"?", "+H:"")+")";return[me,fe.FUNCTION_CALL]},it=function(H,j){const ue={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[H.getFieldValue("CASE")];return H=j.valueToCode(H,"TEXT",ue?fe.MEMBER:fe.NONE)||"''",[ue?H+ue:j.provideFunction_("textToTitleCase",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(str) {
- return str.replace(/\\S+/g,
- function(txt) {return txt[0].toUpperCase() + txt.substring(1).toLowerCase();});
- }
- `)+"("+H+")",fe.FUNCTION_CALL]},Tt=function(H,j){const ue={LEFT:".replace(/^[\\s\\xa0]+/, '')",RIGHT:".replace(/[\\s\\xa0]+$/, '')",BOTH:".trim()"}[H.getFieldValue("MODE")];return[(j.valueToCode(H,"TEXT",fe.MEMBER)||"''")+ue,fe.FUNCTION_CALL]},He=function(H,j){return"window.alert("+(j.valueToCode(H,"TEXT",fe.NONE)||"''")+`);
- `},ke=function(H,j){return j="window.prompt("+(H.getField("TEXT")?j.quote_(H.getFieldValue("TEXT")):j.valueToCode(H,"TEXT",fe.NONE)||"''")+")",H.getFieldValue("TYPE")==="NUMBER"&&(j="Number("+j+")"),[j,fe.FUNCTION_CALL]},ot=function(H,j){const ue=j.valueToCode(H,"TEXT",fe.NONE)||"''";return H=j.valueToCode(H,"SUB",fe.NONE)||"''",[j.provideFunction_("textCount",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
- if (needle.length === 0) {
- return haystack.length + 1;
- } else {
- return haystack.split(needle).length - 1;
- }
- }
- `)+"("+ue+", "+H+")",fe.FUNCTION_CALL]},Ct=function(H,j){const ue=j.valueToCode(H,"TEXT",fe.NONE)||"''",ie=j.valueToCode(H,"FROM",fe.NONE)||"''";return H=j.valueToCode(H,"TO",fe.NONE)||"''",[j.provideFunction_("textReplace",`
- function ${j.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
- needle = needle.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')
- .replace(/\\x08/g, '\\\\x08');
- return haystack.replace(new RegExp(needle, 'g'), replacement);
- }
- `)+"("+ue+", "+ie+", "+H+")",fe.FUNCTION_CALL]},Gt=function(H,j){return[(j.valueToCode(H,"TEXT",fe.MEMBER)||"''")+".split('').reverse().join('')",fe.FUNCTION_CALL]},Ot=function(H,j){return[j.getVariableName(H.getFieldValue("VAR")),fe.ATOMIC]},En=function(H,j){const ue=j.valueToCode(H,"VALUE",fe.ASSIGNMENT)||"0";return j.getVariableName(H.getFieldValue("VAR"))+" = "+ue+`;
- `},fe;(function(H){H[H.ATOMIC=0]="ATOMIC",H[H.NEW=1.1]="NEW",H[H.MEMBER=1.2]="MEMBER",H[H.FUNCTION_CALL=2]="FUNCTION_CALL",H[H.INCREMENT=3]="INCREMENT",H[H.DECREMENT=3]="DECREMENT",H[H.BITWISE_NOT=4.1]="BITWISE_NOT",H[H.UNARY_PLUS=4.2]="UNARY_PLUS",H[H.UNARY_NEGATION=4.3]="UNARY_NEGATION",H[H.LOGICAL_NOT=4.4]="LOGICAL_NOT",H[H.TYPEOF=4.5]="TYPEOF",H[H.VOID=4.6]="VOID",H[H.DELETE=4.7]="DELETE",H[H.AWAIT=4.8]="AWAIT",H[H.EXPONENTIATION=5]="EXPONENTIATION",H[H.MULTIPLICATION=5.1]="MULTIPLICATION",H[H.DIVISION=5.2]="DIVISION",H[H.MODULUS=5.3]="MODULUS",H[H.SUBTRACTION=6.1]="SUBTRACTION",H[H.ADDITION=6.2]="ADDITION",H[H.BITWISE_SHIFT=7]="BITWISE_SHIFT",H[H.RELATIONAL=8]="RELATIONAL",H[H.IN=8]="IN",H[H.INSTANCEOF=8]="INSTANCEOF",H[H.EQUALITY=9]="EQUALITY",H[H.BITWISE_AND=10]="BITWISE_AND",H[H.BITWISE_XOR=11]="BITWISE_XOR",H[H.BITWISE_OR=12]="BITWISE_OR",H[H.LOGICAL_AND=13]="LOGICAL_AND",H[H.LOGICAL_OR=14]="LOGICAL_OR",H[H.CONDITIONAL=15]="CONDITIONAL",H[H.ASSIGNMENT=16]="ASSIGNMENT",H[H.YIELD=17]="YIELD",H[H.COMMA=18]="COMMA",H[H.NONE=99]="NONE"})(fe||(fe={}));var se=class extends i.CodeGenerator$$module$build$src$core$generator{constructor(H="JavaScript"){super(H),this.ORDER_OVERRIDES=[[fe.FUNCTION_CALL,fe.MEMBER],[fe.FUNCTION_CALL,fe.FUNCTION_CALL],[fe.MEMBER,fe.MEMBER],[fe.MEMBER,fe.FUNCTION_CALL],[fe.LOGICAL_NOT,fe.LOGICAL_NOT],[fe.MULTIPLICATION,fe.MULTIPLICATION],[fe.ADDITION,fe.ADDITION],[fe.LOGICAL_AND,fe.LOGICAL_AND],[fe.LOGICAL_OR,fe.LOGICAL_OR]],this.isInitialized=!1;for(const j in fe)H=fe[j],typeof H!="string"&&(this["ORDER_"+j]=H);this.addReservedWords("break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(globalThis).join(","))}init(H){super.init(H),this.nameDB_?this.nameDB_.reset():this.nameDB_=new i.Names$$module$build$src$core$names(this.RESERVED_WORDS_),this.nameDB_.setVariableMap(H.getVariableMap()),this.nameDB_.populateVariables(H),this.nameDB_.populateProcedures(H);const j=[];var ue=i.allDeveloperVariables$$module$build$src$core$variables(H);for(let ie=0;ie<ue.length;ie++)j.push(this.nameDB_.getName(ue[ie],i.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE));for(H=i.allUsedVarModels$$module$build$src$core$variables(H),ue=0;ue<H.length;ue++)j.push(this.nameDB_.getName(H[ue].getId(),i.NameType$$module$build$src$core$names.VARIABLE));j.length&&(this.definitions_.variables="var "+j.join(", ")+";"),this.isInitialized=!0}finish(H){const j=Object.values(this.definitions_);return super.finish(H),this.isInitialized=!1,this.nameDB_.reset(),j.join(`
- `)+`
- `+H}scrubNakedValue(H){return H+`;
- `}quote_(H){return H=H.replace(/\\/g,"\\\\").replace(/\n/g,`\\
- `).replace(/'/g,"\\'"),"'"+H+"'"}multiline_quote_(H){return H.split(/\n/g).map(this.quote_).join(` + '\\n' +
- `)}scrub_(H,j,ue=!1){let ie="";if(!H.outputConnection||!H.outputConnection.targetConnection){var Te=H.getCommentText();Te&&(Te=i.wrap$$module$build$src$core$utils$string(Te,this.COMMENT_WRAP-3),ie+=this.prefixLines(Te+`
- `,"// "));for(let De=0;De<H.inputList.length;De++)H.inputList[De].type===i.inputTypes$$module$build$src$core$inputs$input_types.VALUE&&(Te=H.inputList[De].connection.targetBlock())&&(Te=this.allNestedComments(Te))&&(ie+=this.prefixLines(Te,"// "))}return H=H.nextConnection&&H.nextConnection.targetBlock(),ue=ue?"":this.blockToCode(H),ie+j+ue}getAdjusted(H,j,ue=0,ie=!1,Te=fe.NONE){H.workspace.options.oneBasedIndex&&ue--;const De=H.workspace.options.oneBasedIndex?"1":"0";let me=Te;return 0<ue?me=fe.ADDITION:0>ue?me=fe.SUBTRACTION:ie&&(me=fe.UNARY_NEGATION),H=this.valueToCode(H,j,me)||De,ue===0&&!ie?H:i.isNumber$$module$build$src$core$utils$string(H)?(H=String(Number(H)+ue),ie&&(H=String(-Number(H))),H):(0<ue?H=`${H} + ${ue}`:0>ue&&(H=`${H} - ${-ue}`),ie&&(H=ue?`-(${H})`:`-${H}`),Math.floor(Te)>=Math.floor(me)&&(H=`(${H})`),H)}},le={};le.colour_blend=a,le.colour_picker=s,le.colour_random=o,le.colour_rgb=r;var Fe=function(H,j,ue){return j==="FIRST"?"0":j==="FROM_END"?H+".length - 1 - "+ue:j==="LAST"?H+".length - 1":ue},pe={};pe.lists_create_empty=c,pe.lists_create_with=u,pe.lists_getIndex=_,pe.lists_getSublist=C,pe.lists_indexOf=p,pe.lists_isEmpty=g,pe.lists_length=f,pe.lists_repeat=d,pe.lists_reverse=I,pe.lists_setIndex=v,pe.lists_sort=y,pe.lists_split=w;var je={};je.controls_if=L,je.controls_ifelse=L,je.logic_boolean=D,je.logic_compare=O,je.logic_negate=N,je.logic_null=P,je.logic_operation=A,je.logic_ternary=F;var Ae={};Ae.controls_flow_statements=q,Ae.controls_for=Q,Ae.controls_forEach=de,Ae.controls_repeat=V,Ae.controls_repeat_ext=V,Ae.controls_whileUntil=U;var Et={};Et.math_arithmetic=re,Et.math_atan2=we,Et.math_change=ve,Et.math_constant=J,Et.math_constrain=Ne,Et.math_modulo=Ee,Et.math_number=K,Et.math_number_property=ge,Et.math_on_list=Le,Et.math_random_float=Re,Et.math_random_int=qe,Et.math_round=Z,Et.math_single=Z,Et.math_trig=Z;var Tn={};Tn.procedures_callnoreturn=dt,Tn.procedures_callreturn=Ge,Tn.procedures_defnoreturn=Ve,Tn.procedures_defreturn=Ve,Tn.procedures_ifreturn=ze;var Hn=/^\s*'([^']|\\')*'\s*$/,Xn=function(H){return Hn.test(H)?[H,fe.ATOMIC]:["String("+H+")",fe.FUNCTION_CALL]},vs=function(H,j,ue){return j==="FIRST"?"0":j==="FROM_END"?H+".length - 1 - "+ue:j==="LAST"?H+".length - 1":ue},Zn={};Zn.text=ee,Zn.text_append=et,Zn.text_changeCase=it,Zn.text_charAt=Ie,Zn.text_count=ot,Zn.text_getSubstring=Xe,Zn.text_indexOf=Se,Zn.text_isEmpty=Ue,Zn.text_join=Me,Zn.text_length=at,Zn.text_multiline=ye,Zn.text_print=He,Zn.text_prompt=ke,Zn.text_prompt_ext=ke,Zn.text_replace=Ct,Zn.text_reverse=Gt,Zn.text_trim=Tt;var Hi={};Hi.variables_get=Ot,Hi.variables_set=En;var ti={};ti.variables_get_dynamic=Ot,ti.variables_set_dynamic=En;var Ps=new se,ae=Object.assign({},le,pe,je,Ae,Et,Tn,Zn,Hi,ti);for(const H in ae)Ps.forBlock[H]=ae[H];var xe={};return xe.JavascriptGenerator=se,xe.Order=fe,xe.javascriptGenerator=Ps,xe.__namespace__=i,xe})}(eU)),eU.exports}var Z$e=ZV.exports,Ire;function exe(){return Ire||(Ire=1,function(n,e){(function(t,i){n.exports=i(FZ(),Q$e())})(Z$e,function(t,i){/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */return i})}(ZV)),ZV.exports}var txe=KV.exports,Lre;function nxe(){return Lre||(Lre=1,function(n,e){(function(t,i){n.exports=i(FZ(),j$e(),Bve(),exe())})(txe,function(t,i,s,o){return t.setLocale(i),t})}(KV)),KV.exports}var ixe=zV.exports,Ore;function sxe(){return Ore||(Ore=1,function(n,e){(function(t,i){n.exports=i(nxe())})(ixe,function(t){/**
- * @license
- * Copyright 2019 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */return t})}(zV)),zV.exports}var b=sxe();const ra=cp(b),xr=bNe({__proto__:null,default:ra},[b]);var M=M||{Msg:Object.create(null)};M.Msg.catLogic="逻辑";M.Msg.catLoops="循环";M.Msg.catMath="数学";M.Msg.catText="文本";M.Msg.catVariables="变量";M.Msg.catLists="列表";M.Msg.catDictionary="字典";M.Msg.catTuples="元组";M.Msg.catSet="集合";M.Msg.catFunctions="函数";M.Msg.catOutput="输入/输出";M.Msg.catFiles="文件";M.Msg.catTime="时间";M.Msg.catSerial="串口";M.Msg.catBasicFunctions="基础功能";M.Msg.catBasic="基础";M.Msg.catSensors="传感器";M.Msg.catPower="动力";M.Msg.catServo="舵机";M.Msg.catMOTOR="电机";M.Msg.catAIScreen="屏幕";M.Msg.catCamera="摄像头";M.Msg.catMicrophone="麦克风";M.Msg.catSpeaker="扬声器";M.Msg.catSystem="系统功能";M.Msg.ExtendedFunction="媒体处理";M.Msg.catImage="图像处理";M.Msg.AI="人工智能";M.Msg.catIOT="物联网";M.Msg.catIOT_WIFI="Wi-Fi";M.Msg.catNetworkCommunication="网络通信";M.Msg.Get_weather="获取天气";M.Msg.ADD_COMMENT="添加注释";M.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="不能删除变量“%1”,因为它是函数“%2”定义的一部分";M.Msg.CHANGE_VALUE_TITLE="更改值:";M.Msg.CLEAN_UP="整理块";M.Msg.COLLAPSED_WARNINGS_WARNING="已收起的信息块内包含警告。";M.Msg.COLLAPSE_ALL="折叠块";M.Msg.COLLAPSE_BLOCK="折叠块";M.Msg.COLOUR_BLEND_COLOUR1="颜色1";M.Msg.COLOUR_BLEND_COLOUR2="颜色2";M.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp";M.Msg.COLOUR_BLEND_RATIO="比例";M.Msg.COLOUR_BLEND_TITLE="混合";M.Msg.COLOUR_BLEND_TOOLTIP="把两种颜色以一个给定的比例(0.0-1.0)进行混合。";M.Msg.COLOUR_PICKER_HELPURL="https://zh.wikipedia.org/wiki/颜色";M.Msg.COLOUR_PICKER_TOOLTIP="从调色板中选择一种颜色。";M.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com";M.Msg.COLOUR_RANDOM_TITLE="随机颜色";M.Msg.COLOUR_RANDOM_TOOLTIP="随机选择一种颜色。";M.Msg.COLOUR_RGB_BLUE="蓝色";M.Msg.COLOUR_RGB_GREEN="绿色";M.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html";M.Msg.COLOUR_RGB_RED="红色";M.Msg.COLOUR_RGB_TITLE="颜色";M.Msg.COLOUR_RGB_TOOLTIP="通过指定红色、绿色和蓝色的量创建一种颜色。所有的值必须在0和100之间。";M.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";M.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="跳出循环";M.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="继续下一轮循环";M.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="跳出包含它的循环。";M.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="跳过本轮循环的剩余部分,并继进行续下一轮循环。";M.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="警告:这个块只能在循环内使用。";M.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";M.Msg.CONTROLS_FOREACH_TITLE="遍历列表 %2 里的每一项 %1";M.Msg.CONTROLS_FOREACH_TOOLTIP="遍历列表中的每一项,将变量“%1”设为所选项,并执行一些语句。";M.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";M.Msg.CONTROLS_FOR_TITLE="变量 %1 从 %2 数到 %3 每次增加 %4";M.Msg.CONTROLS_FOR_TOOLTIP="让变量“%1”记录开始数到结束数之间指定间隔的值,并执行指定的块。";M.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="在这个if语句块中增加一个条件。";M.Msg.CONTROLS_IF_ELSE_TOOLTIP="在这个if语句块中添加一个最终的,包括所有其余情况的条件。";M.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";M.Msg.CONTROLS_IF_IF_TOOLTIP="增加、删除或重新排列各节来重新配置这个if语句块。";M.Msg.CONTROLS_IF_MSG_ELSE="否则";M.Msg.CONTROLS_IF_MSG_ELSEIF="否则如果";M.Msg.CONTROLS_IF_MSG_IF="如果";M.Msg.CONTROLS_IF_TOOLTIP_1="如果值为真,执行一些语句。";M.Msg.CONTROLS_IF_TOOLTIP_2="如果值为真,则执行第一块语句。否则,则执行第二块语句。";M.Msg.CONTROLS_IF_TOOLTIP_3="如果第一个值为真,则执行第一块的语句。否则,如果第二个值为真,则执行第二块的语句。";M.Msg.CONTROLS_IF_TOOLTIP_4="如果第一个值为真,则执行第一块对语句。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行最后一块的语句。";M.Msg.CONTROLS_REPEAT_HELPURL="https://zh.wikipedia.org/wiki/For循环";M.Msg.CONTROLS_REPEAT_INPUT_DO="执行";M.Msg.CONTROLS_REPEAT_TITLE="重复 %1 次";M.Msg.CONTROLS_REPEAT_TOOLTIP="多次执行一些语句。";M.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";M.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="重复直到条件满足";M.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="当条件满足时重复";M.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="只要值为假,就一直循环执行一些语句。";M.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="只要值为真,就一直循环执行一些语句。";M.Msg.DELETE_ALL_BLOCKS="删除所有 %1 个块吗?";M.Msg.DELETE_BLOCK="删除块";M.Msg.DELETE_VARIABLE="删除变量“%1”";M.Msg.DELETE_VARIABLE_CONFIRMATION="要删除对变量“%2”的%1个引用吗?";M.Msg.DELETE_X_BLOCKS="删除 %1 个块";M.Msg.DIALOG_CANCEL="取消";M.Msg.DIALOG_OK="确认";M.Msg.DISABLE_BLOCK="禁用块";M.Msg.DUPLICATE_BLOCK="复制";M.Msg.DUPLICATE_COMMENT="复制注释";M.Msg.ENABLE_BLOCK="启用块";M.Msg.EXPAND_ALL="展开块";M.Msg.EXPAND_BLOCK="展开块";M.Msg.EXTERNAL_INPUTS="外部输入";M.Msg.HELP="帮助";M.Msg.INLINE_INPUTS="单行输入";M.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list";M.Msg.LISTS_CREATE_EMPTY_TITLE="创建空列表";M.Msg.LISTS_CREATE_EMPTY_TOOLTIP="返回一个列表,长度为 0,不包含任何数据记录";M.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="列表";M.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个列表块。";M.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";M.Msg.LISTS_CREATE_WITH_INPUT_WITH="创建列表,内容:";M.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到列表中。";M.Msg.LISTS_CREATE_WITH_TOOLTIP="建立一个具有任意数量项目的列表。";M.Msg.LISTS_GET_INDEX_FIRST="第一项";M.Msg.LISTS_GET_INDEX_FROM_END="倒数第#项";M.Msg.LISTS_GET_INDEX_FROM_START="#";M.Msg.LISTS_GET_INDEX_GET="取得";M.Msg.LISTS_GET_INDEX_GET_REMOVE="取得并移除";M.Msg.LISTS_GET_INDEX_LAST="最后一项";M.Msg.LISTS_GET_INDEX_RANDOM="随机的一项";M.Msg.LISTS_GET_INDEX_REMOVE="移除";M.Msg.LISTS_GET_INDEX_TAIL="";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="返回列表中的第一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="返回在列表中的指定位置的项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="返回列表中的最后一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="返回列表中的随机一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="移除并返回列表中的第一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="移除并返回列表中的指定位置的项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="移除并返回列表中的最后一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="移除并返回列表中的随机一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="移除列表中的第一项";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="移除在列表中的指定位置的项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="移除列表中的最后一项";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="删除列表中的随机一项。";M.Msg.LISTS_GET_SUBLIST_END_FROM_END="到倒数第#项";M.Msg.LISTS_GET_SUBLIST_END_FROM_START="到第#项";M.Msg.LISTS_GET_SUBLIST_END_LAST="到最后一项";M.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist";M.Msg.LISTS_GET_SUBLIST_START_FIRST="获取子列表,从第一项";M.Msg.LISTS_GET_SUBLIST_START_FROM_END="获取子列表,从倒数第#项";M.Msg.LISTS_GET_SUBLIST_START_FROM_START="获取子列表,从第#项";M.Msg.LISTS_GET_SUBLIST_TAIL="";M.Msg.LISTS_GET_SUBLIST_TOOLTIP="复制列表中指定的部分。";M.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1是最后一项。";M.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1是第一项。";M.Msg.LISTS_INDEX_OF_FIRST="寻找第一次出现的项";M.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";M.Msg.LISTS_INDEX_OF_LAST="寻找最后一次出现的项";M.Msg.LISTS_INDEX_OF_TOOLTIP="返回在列表中的第一/最后一个匹配项的索引值。如果找不到项目则返回%1。";M.Msg.LISTS_INLIST="在列表中";M.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty";M.Msg.LISTS_ISEMPTY_TITLE="%1是空的";M.Msg.LISTS_ISEMPTY_TOOLTIP="如果改列表为空,则返回真。";M.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of";M.Msg.LISTS_LENGTH_TITLE="%1的长度";M.Msg.LISTS_LENGTH_TOOLTIP="返回列表的长度。";M.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";M.Msg.LISTS_REPEAT_TITLE="建立列表使用项 %1 重复 %2 次";M.Msg.LISTS_REPEAT_TOOLTIP="建立包含指定重复次数的值的列表。";M.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list";M.Msg.LISTS_REVERSE_MESSAGE0="倒转%1";M.Msg.LISTS_REVERSE_TOOLTIP="倒转一个列表,返回副本。";M.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set";M.Msg.LISTS_SET_INDEX_INPUT_TO="值为";M.Msg.LISTS_SET_INDEX_INSERT="插入在";M.Msg.LISTS_SET_INDEX_SET="设置";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="在列表的起始处添加该项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="在列表中指定位置插入项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="在列表的末尾处添加该项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="在列表的随机位置插入该项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="设置列表中的第一项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="设置在列表中指定位置的项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="设置列表中的最后一项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="设置列表中的随机一项。";M.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";M.Msg.LISTS_SORT_ORDER_ASCENDING="升序";M.Msg.LISTS_SORT_ORDER_DESCENDING="降序";M.Msg.LISTS_SORT_TITLE="排序%1 %2 %3";M.Msg.LISTS_SORT_TOOLTIP="排序一个列表,返回副本。";M.Msg.LISTS_SORT_TYPE_IGNORECASE="按字母(忽略大小写)";M.Msg.LISTS_SORT_TYPE_NUMERIC="按数字";M.Msg.LISTS_SORT_TYPE_TEXT="按字母";M.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";M.Msg.LISTS_SPLIT_LIST_FROM_TEXT="从文本制作列表";M.Msg.LISTS_SPLIT_TEXT_FROM_LIST="将列表合并为文本";M.Msg.LISTS_SPLIT_TOOLTIP_JOIN="加入文本列表至一个文本,由分隔符分隔。";M.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="将文本按指定的分隔符拆分为文本组成的列表。";M.Msg.LISTS_SPLIT_WITH_DELIMITER="分隔符:";M.Msg.LOGIC_BOOLEAN_FALSE="false";M.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";M.Msg.LOGIC_BOOLEAN_TOOLTIP="返回 true 或 false。";M.Msg.LOGIC_BOOLEAN_TRUE="true";M.Msg.LOGIC_COMPARE_HELPURL="https://zh.wikipedia.org/wiki/不等";M.Msg.LOGIC_COMPARE_TOOLTIP_EQ="如果两个输入结果相等,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_GT="如果第一个输入结果比第二个大,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_GTE="如果第一个输入结果大于或等于第二个输入结果,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_LT="如果第一个输入结果比第二个小,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_LTE="如果第一个输入结果小于或等于第二个输入结果,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="如果两个输入结果不相等,则返回真。";M.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";M.Msg.LOGIC_NEGATE_TITLE="非 %1";M.Msg.LOGIC_NEGATE_TOOLTIP="如果输入结果为false,则返回true;如果输入结果为true,则返回false。";M.Msg.LOGIC_NULL="空";M.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";M.Msg.LOGIC_NULL_TOOLTIP="返回空值。";M.Msg.LOGIC_OPERATION_AND="并且";M.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";M.Msg.LOGIC_OPERATION_OR="或";M.Msg.LOGIC_OPERATION_TOOLTIP_AND="如果两个输入结果都为真,则返回真。";M.Msg.LOGIC_OPERATION_TOOLTIP_OR="如果至少有一个输入结果为真,则返回真。";M.Msg.LOGIC_TERNARY_CONDITION="断言";M.Msg.LOGIC_TERNARY_HELPURL="https://zh.wikipedia.org/wiki/条件运算符";M.Msg.LOGIC_TERNARY_IF_FALSE="如果为 false";M.Msg.LOGIC_TERNARY_IF_TRUE="如果为 true";M.Msg.LOGIC_TERNARY_TOOLTIP="检查“断言”里的条件语句。如果条件为真,则返回“如果为真”的值,否则,则返回“如果为假”的值。";M.Msg.MATH_ADDITION_SYMBOL="+";M.Msg.MATH_ARITHMETIC_HELPURL="https://zh.wikipedia.org/wiki/算术";M.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="返回两个数的和。";M.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="返回两个数的商。";M.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="返回两个数的差。";M.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="返回两个数的积。";M.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="返回第一个数的第二个数次幂。";M.Msg.MATH_ATAN2_HELPURL="https://zh.wikipedia.org/wiki/反正切2";M.Msg.MATH_ATAN2_TITLE="点(x:%1,y:%2)的方位角";M.Msg.MATH_ATAN2_TOOLTIP="返回点(X,Y)的反正切值,范围为-180到180度。";M.Msg.MATH_CHANGE_HELPURL="https://zh.wikipedia.org/wiki/加法";M.Msg.MATH_CHANGE_TITLE="给 %1 加 %2";M.Msg.MATH_CHANGE_TOOLTIP="把数加到变量“%1”。";M.Msg.MATH_CONSTANT_HELPURL="https://zh.wikipedia.org/wiki/数学常数";M.Msg.MATH_CONSTANT_TOOLTIP="返回一个以下常见常数:π (3.141…)、e (2.718…)、φ (1.618…)、根号2 (1.414…)、根号½ (0.707…)或∞ (无穷)。";M.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)";M.Msg.MATH_CONSTRAIN_TITLE="将 %1 限制在 最低 %2 到最高 %3 之间";M.Msg.MATH_CONSTRAIN_TOOLTIP="把一个数限制在指定的极限(含)之间。";M.Msg.MATH_DIVISION_SYMBOL="÷";M.Msg.MATH_IS_DIVISIBLE_BY="可整除被";M.Msg.MATH_IS_EVEN="是偶数";M.Msg.MATH_IS_NEGATIVE="是负数";M.Msg.MATH_IS_ODD="是奇数";M.Msg.MATH_IS_POSITIVE="是正数";M.Msg.MATH_IS_PRIME="是质数";M.Msg.MATH_IS_TOOLTIP="检查一个数是否是偶数、奇数、质数、整数、正数、负数,或者是否能被某数整除。返回真或假。";M.Msg.MATH_IS_WHOLE="是整数";M.Msg.MATH_MODULO_HELPURL="https://zh.wikipedia.org/wiki/模除";M.Msg.MATH_MODULO_TITLE="%1 ÷ %2 的余数";M.Msg.MATH_MODULO_TOOLTIP="返回两个数相除的余数。";M.Msg.MATH_MULTIPLICATION_SYMBOL="×";M.Msg.MATH_NUMBER_HELPURL="https://zh.wikipedia.org/wiki/数";M.Msg.MATH_NUMBER_TOOLTIP="一个数。";M.Msg.MATH_ONLIST_HELPURL="";M.Msg.MATH_ONLIST_OPERATOR_AVERAGE="列表的平均";M.Msg.MATH_ONLIST_OPERATOR_MAX="列表的最大数";M.Msg.MATH_ONLIST_OPERATOR_MEDIAN="列表的中位数";M.Msg.MATH_ONLIST_OPERATOR_MIN="列表的最小数";M.Msg.MATH_ONLIST_OPERATOR_MODE="列表的众数";M.Msg.MATH_ONLIST_OPERATOR_RANDOM="列表的随机项";M.Msg.MATH_ONLIST_OPERATOR_STD_DEV="列表的标准差";M.Msg.MATH_ONLIST_OPERATOR_SUM="列表的和";M.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="返回列表内数值的平均(算术平均)。";M.Msg.MATH_ONLIST_TOOLTIP_MAX="返回列表内的最大数。";M.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="返回列表内数的中位数。";M.Msg.MATH_ONLIST_TOOLTIP_MIN="返回列表内的最小数。";M.Msg.MATH_ONLIST_TOOLTIP_MODE="返回列表中的出现次数最多的项的列表。";M.Msg.MATH_ONLIST_TOOLTIP_RANDOM="返回列表内的一个随机元素。";M.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="返回列表的标准差。";M.Msg.MATH_ONLIST_TOOLTIP_SUM="返回列表内的所有数的和。";M.Msg.MATH_POWER_SYMBOL="^";M.Msg.MATH_RANDOM_FLOAT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器";M.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="随机小数";M.Msg.MATH_RANDOM_FLOAT_TOOLTIP="返回一个从0.0(含)到1.0(不含)之间的随机数。";M.Msg.MATH_RANDOM_INT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器";M.Msg.MATH_RANDOM_INT_TITLE="从 %1 到 %2 范围内的随机整数";M.Msg.MATH_RANDOM_INT_TOOLTIP="返回两个指定的极限(含)之间的随机整数。";M.Msg.MATH_ROUND_HELPURL="https://zh.wikipedia.org/wiki/数值修约";M.Msg.MATH_ROUND_OPERATOR_ROUND="四舍五入";M.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="向下舍入";M.Msg.MATH_ROUND_OPERATOR_ROUNDUP="向上舍入";M.Msg.MATH_ROUND_TOOLTIP="数向上或向下取整。";M.Msg.MATH_SINGLE_HELPURL="https://zh.wikipedia.org/wiki/平方根";M.Msg.MATH_SINGLE_OP_ABSOLUTE="绝对值";M.Msg.MATH_SINGLE_OP_ROOT="平方根";M.Msg.MATH_SINGLE_TOOLTIP_ABS="返回一个数的绝对值。";M.Msg.MATH_SINGLE_TOOLTIP_EXP="返回e的一个数次幂。";M.Msg.MATH_SINGLE_TOOLTIP_LN="返回一个数的自然对数。";M.Msg.MATH_SINGLE_TOOLTIP_LOG10="返回一个数的以10为底的对数。";M.Msg.MATH_SINGLE_TOOLTIP_NEG="返回一个数的相反数。";M.Msg.MATH_SINGLE_TOOLTIP_POW10="返回10的一个数次幂。";M.Msg.MATH_SINGLE_TOOLTIP_ROOT="返回一个数的平方根。";M.Msg.MATH_SUBTRACTION_SYMBOL="-";M.Msg.MATH_TRIG_ACOS="反余弦";M.Msg.MATH_TRIG_ASIN="反正弦";M.Msg.MATH_TRIG_ATAN="反正切";M.Msg.MATH_TRIG_COS="余弦";M.Msg.MATH_TRIG_HELPURL="https://zh.wikipedia.org/wiki/三角函数";M.Msg.MATH_TRIG_SIN="正弦";M.Msg.MATH_TRIG_TAN="正切";M.Msg.MATH_TRIG_TOOLTIP_ACOS="返回一个数的反余弦。";M.Msg.MATH_TRIG_TOOLTIP_ASIN="返回一个数的反正弦。";M.Msg.MATH_TRIG_TOOLTIP_ATAN="返回一个数的反正切。";M.Msg.MATH_TRIG_TOOLTIP_COS="返回角度(非弧度)的余弦。";M.Msg.MATH_TRIG_TOOLTIP_SIN="返回角度(非弧度)的正弦。";M.Msg.MATH_TRIG_TOOLTIP_TAN="返回角度(非弧度)的正切。";M.Msg.NEW_COLOUR_VARIABLE="创建颜色变量...";M.Msg.NEW_NUMBER_VARIABLE="创建数变量...";M.Msg.NEW_STRING_VARIABLE="创建字符串变量...";M.Msg.NEW_VARIABLE="创建变量...";M.Msg.NEW_VARIABLE_TITLE="新变量的名称:";M.Msg.NEW_VARIABLE_TYPE_TITLE="新变量的类型:";M.Msg.ORDINAL_NUMBER_SUFFIX="";M.Msg.PROCEDURES_ALLOW_STATEMENTS="允许声明";M.Msg.PROCEDURES_BEFORE_PARAMS="与:";M.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="运行用户定义的函数“%1”。";M.Msg.PROCEDURES_CALLRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_CALLRETURN_TOOLTIP="运行用户定义的函数“%1”,并使用它的输出值。";M.Msg.PROCEDURES_CALL_BEFORE_PARAMS="与:";M.Msg.PROCEDURES_CREATE_DO="创建“%1”";M.Msg.PROCEDURES_DEFNORETURN_COMMENT="描述该功能...";M.Msg.PROCEDURES_DEFNORETURN_DO="";M.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="做点什么";M.Msg.PROCEDURES_DEFNORETURN_TITLE="至";M.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="创建一个不带输出值的函数。";M.Msg.PROCEDURES_DEFRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_DEFRETURN_RETURN="返回";M.Msg.PROCEDURES_DEFRETURN_TOOLTIP="创建一个有输出值的函数。";M.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="警告:此函数具有重复参数。";M.Msg.PROCEDURES_HIGHLIGHT_DEF="突出显示函数定义";M.Msg.PROCEDURES_IFRETURN_HELPURL="https://c2.com/cgi/wiki?GuardClause";M.Msg.PROCEDURES_IFRETURN_TOOLTIP="如果值为真,则返回第二个值。";M.Msg.PROCEDURES_IFRETURN_WARNING="警告:这个块只能在函数内部使用。";M.Msg.PROCEDURES_MUTATORARG_TITLE="输入名称:";M.Msg.PROCEDURES_MUTATORARG_TOOLTIP="添加函数输入。";M.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="输入";M.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="添加、移除或重新排此函数的输入。";M.Msg.REDO="重做";M.Msg.REMOVE_COMMENT="删除注释";M.Msg.RENAME_VARIABLE="重命名变量...";M.Msg.RENAME_VARIABLE_TITLE="将所有“%1”变量重命名为:";M.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";M.Msg.TEXT_APPEND_TITLE="在%1之后加上文本%2";M.Msg.TEXT_APPEND_TOOLTIP="将一些文本追加到变量“%1”里。";M.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";M.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="转为小写";M.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="转为首字母大写";M.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="转为大写";M.Msg.TEXT_CHANGECASE_TOOLTIP="用不同的大小写模式复制并返回这段文字。";M.Msg.TEXT_CHARAT_FIRST="获取第一个字符";M.Msg.TEXT_CHARAT_FROM_END="获取倒数第#个字符";M.Msg.TEXT_CHARAT_FROM_START="获取第#个字符";M.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";M.Msg.TEXT_CHARAT_LAST="获取最后一个字符";M.Msg.TEXT_CHARAT_RANDOM="获取随机一个字符";M.Msg.TEXT_CHARAT_TAIL="";M.Msg.TEXT_CHARAT_TITLE="在文本%1 里 %2";M.Msg.TEXT_CHARAT_TOOLTIP="返回位于指定位置的字符。";M.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings";M.Msg.TEXT_COUNT_MESSAGE0="计算%1在%2里出现的次数";M.Msg.TEXT_COUNT_TOOLTIP="计算在一段文本中,某个部分文本重复出现了多少次。";M.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="将一个项添加到文本中。";M.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="拼接";M.Msg.TEXT_CREATE_JOIN_TOOLTIP="添加、移除或重新排列各节来重新配置这个文本块。";M.Msg.TEXT_GET_SUBSTRING_END_FROM_END="到倒数第#个字符";M.Msg.TEXT_GET_SUBSTRING_END_FROM_START="到第#个字符";M.Msg.TEXT_GET_SUBSTRING_END_LAST="到最后一个字符";M.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";M.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="从文本";M.Msg.TEXT_GET_SUBSTRING_START_FIRST="获取子串,从第一个字符";M.Msg.TEXT_GET_SUBSTRING_START_FROM_END="获取子串,从倒数第#个字符";M.Msg.TEXT_GET_SUBSTRING_START_FROM_START="获取子串,从第#个字符";M.Msg.TEXT_GET_SUBSTRING_TAIL="";M.Msg.TEXT_GET_SUBSTRING_TOOLTIP="返回文本中指定的一部分。";M.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";M.Msg.TEXT_INDEXOF_OPERATOR_FIRST="寻找第一次出现的文本";M.Msg.TEXT_INDEXOF_OPERATOR_LAST="寻找最后一次出现的文本";M.Msg.TEXT_INDEXOF_TITLE="在文本 %1 里 %2 %3";M.Msg.TEXT_INDEXOF_TOOLTIP="返回第一个文本段在第二个文本段中的第一/最后一个匹配项的起始位置。如果未找到,则返回%1。";M.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";M.Msg.TEXT_ISEMPTY_TITLE="%1是空的";M.Msg.TEXT_ISEMPTY_TOOLTIP="如果给定的文本为空,则返回真。";M.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";M.Msg.TEXT_JOIN_TITLE_CREATEWITH="创建文本,内容:";M.Msg.TEXT_JOIN_TOOLTIP="通过串起任意数量的项以建立一段文本。";M.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";M.Msg.TEXT_LENGTH_TITLE="%1的长度";M.Msg.TEXT_LENGTH_TOOLTIP="返回给定文本的字母数(包括空格)。";M.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";M.Msg.TEXT_PRINT_TITLE="输出%1";M.Msg.TEXT_PRINT_TOOLTIP="打印指定的文字、数或其他值。";M.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";M.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="提示用户输入一个数。";M.Msg.TEXT_PROMPT_TOOLTIP_TEXT="要求用户输入一些文本。";M.Msg.TEXT_PROMPT_TYPE_NUMBER="提示输入数并显示消息";M.Msg.TEXT_PROMPT_TYPE_TEXT="要求输入文本,并显示提示消息";M.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings";M.Msg.TEXT_REPLACE_MESSAGE0="把%3中的%1替换为%2";M.Msg.TEXT_REPLACE_TOOLTIP="在一段文本中,将出现过的某部分文本都替换掉。";M.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text";M.Msg.TEXT_REVERSE_MESSAGE0="倒转文本%1";M.Msg.TEXT_REVERSE_TOOLTIP="将文本中各个字符的顺序倒转。";M.Msg.TEXT_TEXT_HELPURL="https://zh.wikipedia.org/wiki/字符串";M.Msg.TEXT_TEXT_TOOLTIP="一个字、词或一行文本。";M.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";M.Msg.TEXT_TRIM_OPERATOR_BOTH="消除其两侧的空格";M.Msg.TEXT_TRIM_OPERATOR_LEFT="消除其左侧的空格";M.Msg.TEXT_TRIM_OPERATOR_RIGHT="消除其右侧的空格";M.Msg.TEXT_TRIM_TOOLTIP="从某一端或同时从两端删除多余的空白,并返回这段文字的一个副本。";M.Msg.TODAY="今天";M.Msg.UNDO="撤销";M.Msg.UNNAMED_KEY="未命名";M.Msg.VARIABLES_DEFAULT_NAME="项目";M.Msg.VARIABLES_GET_CREATE_SET="创建“设定%1”";M.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";M.Msg.VARIABLES_GET_TOOLTIP="返回此变量的值。";M.Msg.VARIABLES_SET="赋值 %1 为 %2";M.Msg.VARIABLES_SET_CREATE_GET="创建“获得%1”";M.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";M.Msg.VARIABLES_SET_TOOLTIP="设置此变量,以使它和输入值相等。";M.Msg.VARIABLE_ALREADY_EXISTS="名字叫“%1”的变量已经存在了。";M.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="名字叫“%1”的变量已经有了另一个类型:“%2”。";M.Msg.WORKSPACE_ARIA_LABEL="Blockly工作区";M.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="说点什么...";M.Msg.CONTROLS_FOREACH_INPUT_DO=M.Msg.CONTROLS_REPEAT_INPUT_DO;M.Msg.CONTROLS_FOR_INPUT_DO=M.Msg.CONTROLS_REPEAT_INPUT_DO;M.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=M.Msg.CONTROLS_IF_MSG_ELSEIF;M.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=M.Msg.CONTROLS_IF_MSG_ELSE;M.Msg.CONTROLS_IF_IF_TITLE_IF=M.Msg.CONTROLS_IF_MSG_IF;M.Msg.CONTROLS_IF_MSG_THEN=M.Msg.CONTROLS_REPEAT_INPUT_DO;M.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=M.Msg.CONTROLS_REPEAT_INPUT_DO;M.Msg.LISTS_CREATE_WITH_ITEM_TITLE=M.Msg.VARIABLES_DEFAULT_NAME;M.Msg.LISTS_GET_INDEX_HELPURL=M.Msg.LISTS_INDEX_OF_HELPURL;M.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=M.Msg.LISTS_INLIST;M.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=M.Msg.LISTS_INLIST;M.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=M.Msg.LISTS_INLIST;M.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=M.Msg.LISTS_INLIST;M.Msg.MATH_CHANGE_TITLE_ITEM=M.Msg.VARIABLES_DEFAULT_NAME;M.Msg.PROCEDURES_DEFRETURN_COMMENT=M.Msg.PROCEDURES_DEFNORETURN_COMMENT;M.Msg.PROCEDURES_DEFRETURN_DO=M.Msg.PROCEDURES_DEFNORETURN_DO;M.Msg.PROCEDURES_DEFRETURN_PROCEDURE=M.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;M.Msg.PROCEDURES_DEFRETURN_TITLE=M.Msg.PROCEDURES_DEFNORETURN_TITLE;M.Msg.TEXT_APPEND_VARIABLE=M.Msg.VARIABLES_DEFAULT_NAME;M.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=M.Msg.VARIABLES_DEFAULT_NAME;M.Msg.MATH_HUE="230";M.Msg.LOOPS_HUE="120";M.Msg.LISTS_HUE="260";M.Msg.LOGIC_HUE="210";M.Msg.VARIABLES_HUE="330";M.Msg.TEXTS_HUE="160";M.Msg.PROCEDURES_HUE="290";M.Msg.COLOUR_HUE="20";M.Msg.VARIABLES_DYNAMIC_HUE="310";M.Msg.TEXT_IS_NUMBER_HELPURL="";M.Msg.TEXT_IS_NUMBER_TOOLTIP="判断文本%1,并返回True或False";M.Msg.TEXT_IS_NUMBER_MESSAGE0="%1 %2";M.Msg.TEXT_IS_DIGIT="是数字";M.Msg.TEXT_IS_ALPHA="是字母";M.Msg.TEXT_IS_ALNUM="是数字和字母的组合";M.Msg.TEXT_LIST_START="初始化列表 [";M.Msg.TEXT_LIST_END="]";M.Msg.TEXT_TUPLE_START="初始化元组 (";M.Msg.TEXT_TUPLE_END=")";M.Msg.TEXT_DICT_START="初始化字典 {";M.Msg.TEXT_DICT_END="}";M.Msg.TEXT_SET_START="初始化集合 {";M.Msg.TEXT_SET_END="}";M.Msg.TEXT_SET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/index.html";M.Msg.ADD_COMMENT="添加注释";M.Msg.CHANGE_VALUE_TITLE="更改值:";M.Msg.CLEAN_UP="整理块";M.Msg.COLLAPSE_ALL="折叠块";M.Msg.COLLAPSE_BLOCK="折叠块";M.Msg.COLOUR_BLEND_COLOUR1="颜色1";M.Msg.COLOUR_BLEND_COLOUR2="颜色2";M.Msg.COLOUR_BLEND_HELPURL="http://meyerweb.com/eric/tools/color-blend/";M.Msg.COLOUR_BLEND_RATIO="比例";M.Msg.COLOUR_BLEND_TITLE="混合";M.Msg.COLOUR_BLEND_TOOLTIP="用一个给定的比率(0.0-1.0)混合两种颜色。";M.Msg.COLOUR_PICKER_HELPURL="https://zh.wikipedia.org/wiki/颜色";M.Msg.COLOUR_PICKER_TOOLTIP="从调色板中选择一种颜色。";M.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com";M.Msg.COLOUR_RANDOM_TITLE="随机颜色";M.Msg.COLOUR_RANDOM_TOOLTIP="随机选择一种颜色。";M.Msg.COLOUR_RGB_BLUE="蓝色";M.Msg.COLOUR_RGB_GREEN="绿色";M.Msg.COLOUR_RGB_HELPURL="http://www.december.com/html/spec/colorper.html";M.Msg.COLOUR_RGB_RED="红色";M.Msg.COLOUR_RGB_TITLE="颜色";M.Msg.COLOUR_RGB_TOOLTIP="通过指定红色、绿色和蓝色的量创建一种颜色。所有的值必须介于0和100之间。";M.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";M.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="中断循环";M.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="继续下一次循环";M.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="中断包含它的循环。";M.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="跳过这个循环的剩余部分,并继续下一次迭代。";M.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="警告:此块仅可用于在一个循环内。";M.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";M.Msg.CONTROLS_FOREACH_TITLE="在列表 %2 中以 %1 遍历每个项目";M.Msg.CONTROLS_FOREACH_TOOLTIP="遍历每个列表中的项目,将变量“%1”设定到该项中,然后执行某些语句。";M.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";M.Msg.CONTROLS_FOR_TITLE="使用 %1 从范围 %2 到 %3 每隔 %4";M.Msg.CONTROLS_FOR_TOOLTIP="从起始数到结尾数中取出变量“%1”的值,按指定的时间间隔,执行指定的块。";M.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="在if语句块中增加一个条件。";M.Msg.CONTROLS_IF_ELSE_TOOLTIP="添加一个最终的,包括所有情况的节到if块中。";M.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";M.Msg.TRY_EXCEPT_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/index.html";M.Msg.CONTROLS_IF_IF_TOOLTIP="增加、删除或重新排列各节来重新配置“if”块。";M.Msg.CONTROLS_IF_MSG_ELSE="否则";M.Msg.CONTROLS_IF_MSG_ELSEIF="否则如果";M.Msg.TRY_EXCEPT_FINALLY="最后";M.Msg.TRY_EXCEPT_FINALLY_TOOLTIP="";M.Msg.TRY_EXCEPT_EXCEPT="除了";M.Msg.TRY_EXCEPT_EXCEPT_TOOLTIP="";M.Msg.TRY_EXCEPT_TRY="尝试";M.Msg.TRY_EXCEPT_TRY_TOOLTIP="";M.Msg.CONTROLS_IF_MSG_IF="如果";M.Msg.CONTROLS_IF_TOOLTIP_1="如果值为真,执行一些语句。";M.Msg.CONTROLS_IF_TOOLTIP_2="如果值为真,则执行第一块语句。否则,则执行第二块语句。";M.Msg.CONTROLS_IF_TOOLTIP_3="如果第一个值为真,则执行第一块的语句。否则,如果第二个值为真,则执行第二块的语句。";M.Msg.CONTROLS_IF_TOOLTIP_4="如果第一个值为真,则执行第一块对语句。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行最后一块的语句。";M.Msg.CONTROLS_REPEAT_FOREVER="一直重复";M.Msg.CONTROLS_REPEAT_FOREVER_TOOLTIP="一直执行一些语句。";M.Msg.CONTROLS_REPEAT_HELPURL="https://zh.wikipedia.org/wiki/For循环";M.Msg.CONTROLS_REPEAT_INPUT_DO="执行";M.Msg.CONTROLS_REPEAT_TITLE="重复 %1 次";M.Msg.CONTROLS_REPEAT_TOOLTIP="多次执行一些语句。";M.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";M.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="重复直到";M.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="重复当";M.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="只要值为假,执行一些语句。";M.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="只要值为真,执行一些语句。";M.Msg.DELETE_ALL_BLOCKS="删除所有%1块吗?";M.Msg.DELETE_BLOCK="删除块";M.Msg.DELETE_VARIABLE="删除“%1”变量";M.Msg.DELETE_VARIABLE_CONFIRMATION="删除“%2”变量的%1种用途么?";M.Msg.DELETE_X_BLOCKS="删除块";M.Msg.DISABLE_BLOCK="禁用块";M.Msg.DUPLICATE_BLOCK="复制";M.Msg.ENABLE_BLOCK="启用块";M.Msg.EXPAND_ALL="展开块";M.Msg.EXPAND_BLOCK="展开块";M.Msg.EXTERNAL_INPUTS="多行输入";M.Msg.HELP="帮助";M.Msg.INLINE_INPUTS="单行输入";M.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list";M.Msg.LISTS_CREATE_EMPTY_TITLE="创建空列表";M.Msg.TUPLE_CREATE_EMPTY_TITLE="创建空元组";M.Msg.DICT_CREATE_EMPTY_TITLE="创建空字典";M.Msg.SET_CREATE_EMPTY_TITLE="创建空集合";M.Msg.LISTS_CREATE_EMPTY_TOOLTIP="返回一个列表,长度为 0,不包含任何数据记录";M.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="列表";M.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD="元组";M.Msg.DICT_CREATE_WITH_CONTAINER_TITLE_ADD="字典";M.Msg.SET_CREATE_WITH_CONTAINER_TITLE_ADD="集合";M.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个列表块。";M.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个元组块。";M.Msg.DICT_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个字典块。";M.Msg.SET_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个集合块。";M.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";M.Msg.LISTS_CREATE_WITH_INPUT_WITH="初始化列表";M.Msg.TUPLE_CREATE_WITH_INPUT_WITH="初始化元组";M.Msg.DICT_CREATE_WITH_INPUT_WITH="初始化字典";M.Msg.SET_CREATE_WITH_INPUT_WITH="初始化集合";M.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到列表中。";M.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到元组中。";M.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到字典中。";M.Msg.SET_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到集合中。";M.Msg.LISTS_CREATE_WITH_TOOLTIP="建立一个具有任意数量项目的列表。";M.Msg.LISTS_GET_INDEX_FIRST="第一";M.Msg.LISTS_GET_INDEX_FROM_END="倒数第";M.Msg.LISTS_GET_INDEX_FROM_START="第";M.Msg.LISTS_GET_INDEX_GET="获得";M.Msg.LISTS_GET_INDEX_GET_REMOVE="取出并移除";M.Msg.LISTS_GET_INDEX_LAST="最后";M.Msg.LISTS_GET_INDEX_RANDOM="随机";M.Msg.LISTS_GET_INDEX_REMOVE="移除";M.Msg.LISTS_POP_HELPURL="";M.Msg.LISTS_POP_TOOLTIP="";M.Msg.LISTS_POP_MESSAGE0="在列表 %1 中移除 %2 项";M.Msg.LISTS_GET_INDEX_TAIL="";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="返回列表中的第一个项目。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="返回在列表中的指定位置的项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="返回列表中的最后一项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="随机返回列表中的一个项目。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="移除并返回列表中的第一个项目。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="移除并返回列表中的指定位置的项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="移除并返回列表中的最后一个项目。";M.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="移除并返回列表中的一个随机项目中。";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="移除列表中的第一项";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="移除在列表中的指定位置的项。";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="移除列表中的最后一项";M.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="删除列表中的一个随机的项。";M.Msg.LISTS_GET_SUBLIST_END_FROM_END="到倒数第#";M.Msg.LISTS_GET_SUBLIST_END_FROM_START="到#";M.Msg.LISTS_GET_SUBLIST_END_LAST="到最后";M.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist";M.Msg.LISTS_GET_SUBLIST_START_FIRST="从头获得子列表";M.Msg.LISTS_GET_SUBLIST_START_FROM_END="从倒数#取得子列表";M.Msg.LISTS_GET_SUBLIST_START_FROM_START="从#取得子列表";M.Msg.LISTS_GET_SUBLIST_TAIL="";M.Msg.LISTS_GET_SUBLIST_TOOLTIP="复制列表中指定的部分。";M.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1是最后一项。";M.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1是第一个项目。";M.Msg.LISTS_INDEX_OF_FIRST="找出第一个项出现";M.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";M.Msg.LISTS_INDEX_OF_LAST="找出最后一个项出现";M.Msg.LISTS_INDEX_OF_TOOLTIP="返回在列表中的第一/最后一个匹配项的索引值。如果找不到项目则返回0";M.Msg.LISTS_INLIST="在列表中";M.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty";M.Msg.LISTS_ISEMPTY_TITLE="%1是空的";M.Msg.LISTS_ISEMPTY_TOOLTIP="如果改列表为空,则返回真。";M.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of";M.Msg.LISTS_LENGTH_TITLE="%1的长度";M.Msg.LISTS_LENGTH_TOOLTIP="返回列表的长度。";M.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";M.Msg.LISTS_REPEAT_TITLE="建立列表 项 %1 重复 %2 次";M.Msg.LISTS_REPEAT_TOOLTIP="建立包含指定重复次数的值的列表。";M.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set";M.Msg.LISTS_SET_INDEX_INPUT_TO="为";M.Msg.LISTS_SET_INDEX_INSERT="插入在";M.Msg.LISTS_SET_INDEX_SET="设置";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="在列表的起始处添加该项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="插入在列表中指定位置的项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="将该项追加到列表的末尾。";M.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="在列表中随机插入项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="设置列表中的第一个项目。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="设置在列表中指定位置的项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="设置列表中的最后一项。";M.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="设置列表中一个随机的项目。";M.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";M.Msg.LISTS_SORT_ORDER_ASCENDING="升序";M.Msg.LISTS_SORT_ORDER_DESCENDING="降序";M.Msg.LISTS_SORT_TITLE="排序%1 %2 %3";M.Msg.LISTS_SORT_TOOLTIP="排序一个列表的拷贝。";M.Msg.LISTS_SORT_TYPE_IGNORECASE="按字母排序,忽略大小写";M.Msg.LISTS_SORT_TYPE_NUMERIC="按数字排序";M.Msg.LISTS_SORT_TYPE_TEXT="按字母排序";M.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";M.Msg.LISTS_SPLIT_LIST_FROM_TEXT="从文本制作列表";M.Msg.LISTS_SPLIT_TEXT_FROM_LIST="从列表组合文本";M.Msg.LISTS_SPLIT_TOOLTIP_JOIN="加入文本列表至一个文本,由分隔符分隔。";M.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="拆分文本到文本列表,按每个分隔符拆分。";M.Msg.LISTS_SPLIT_WITH_DELIMITER="用分隔符";M.Msg.LOGIC_BOOLEAN_FALSE="假";M.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";M.Msg.LOGIC_BOOLEAN_TOOLTIP="返回真或假。";M.Msg.LOGIC_BOOLEAN_TRUE="真";M.Msg.LOGIC_COMPARE_HELPURL="https://zh.wikipedia.org/wiki/不等";M.Msg.LOGIC_COMPARE_TOOLTIP_EQ="如果两个输入结果相等,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_GT="如果第一个输入结果比第二个大,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_GTE="如果第一个输入结果大于或等于第二个输入结果,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_LT="如果第一个输入结果比第二个小,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_LTE="如果第一个输入结果小于或等于第二个输入结果,则返回真。";M.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="如果两个输入结果不相等,则返回真。";M.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";M.Msg.LOGIC_NEGATE_TITLE="非%1";M.Msg.LOGIC_NEGATE_TOOLTIP="如果输入结果为假,则返回真;如果输入结果为真,则返回假。";M.Msg.LOGIC_NULL="空";M.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";M.Msg.LOGIC_NULL_TOOLTIP="返回空值。";M.Msg.LOGIC_OPERATION_AND="和";M.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";M.Msg.LOGIC_OPERATION_OR="或";M.Msg.LOGIC_OPERATION_TOOLTIP_AND="如果两个输入结果都为真,则返回真。";M.Msg.LOGIC_OPERATION_TOOLTIP_OR="如果至少有一个输入结果为真,则返回真。";M.Msg.LOGIC_TERNARY_CONDITION="测试";M.Msg.LOGIC_TERNARY_HELPURL="https://zh.wikipedia.org/wiki/条件运算符";M.Msg.LOGIC_TERNARY_IF_FALSE="如果为假";M.Msg.LOGIC_TERNARY_IF_TRUE="如果为真";M.Msg.LOGIC_TERNARY_TOOLTIP="检查“test”中的条件。如果条件为真,则返回“if true”的值,否则,则返回“if false”的值。";M.Msg.MATH_ADDITION_SYMBOL="+";M.Msg.MATH_ARITHMETIC_HELPURL="https://zh.wikipedia.org/wiki/算术";M.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="返回两个数字的和。";M.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="返回两个数字的商。";M.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="返回两个数字的区别。";M.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="返回两个数字的乘积。";M.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="返回第一个数的第二个数次幂。";M.Msg.MATH_CHANGE_HELPURL="https://zh.wikipedia.org/wiki/%E5%8A%A0%E6%B3%95";M.Msg.MATH_CHANGE_TITLE="将变量 %1 的值增加 %2";M.Msg.MATH_CHANGE_TOOLTIP="将一个数添加到变量“%1”。";M.Msg.MATH_CONSTANT_HELPURL="https://zh.wikipedia.org/wiki/数学常数";M.Msg.MATH_CONSTANT_TOOLTIP="返回一个常见常量:π (3.141......),e (2.718...)、φ (1.618...)、 sqrt(2) (1.414......)、sqrt(½) (0.707......)或 ∞(无穷大)。";M.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_%28graphics%29";M.Msg.MATH_CONSTRAIN_TITLE="限制数字 %1 介于 (低) %2 到 (高) %3";M.Msg.MATH_CONSTRAIN_TOOLTIP="限制数字介于两个指定的数字之间";M.Msg.MATH_CONVERT_HELPURL="";M.Msg.MATH_CONVERT_MESSAGE0="%1 %2";M.Msg.MATH_CONVERT_TOOLTIP="强制转换数据类型";M.Msg.MATH_DIVISION_CONSULT_HELPURL="";M.Msg.MATH_DIVISION_CONSULT_TITLE="%1 ÷ %2 商的整数部分";M.Msg.MATH_DIVISION_CONSULT_TOOLTIP="返回两数商的整数部分";M.Msg.MATH_DIVISION_SYMBOL="÷";M.Msg.MATH_IS_DIVISIBLE_BY="可被整除";M.Msg.MATH_IS_EVEN="是偶数";M.Msg.MATH_IS_NEGATIVE="为负";M.Msg.MATH_IS_ODD="是奇数";M.Msg.MATH_IS_POSITIVE="为正";M.Msg.MATH_IS_PRIME="是质数";M.Msg.MATH_IS_TOOLTIP="如果数字是偶数、奇数、非负整数、正数、负数或如果它可被某数字整除,则返回真或假。";M.Msg.MATH_IS_WHOLE="为整数";M.Msg.MATH_MODULO_HELPURL="https://zh.wikipedia.org/wiki/模除";M.Msg.MATH_MODULO_TITLE="%1 ÷ %2 的余数";M.Msg.MATH_MODULO_TOOLTIP="返回这两个数字相除后的余数。";M.Msg.MATH_MULTIPLICATION_SYMBOL="×";M.Msg.MATH_NUMBER_BITS_OPS_HELPURL="";M.Msg.MATH_NUMBER_BITS_OPS_MESSAGE0="%1 %2 %3";M.Msg.MATH_NUMBER_BITS_OPS_TOOLTIP="对数字进行位运算";M.Msg.MATH_NUMBER_HELPURL="https://zh.wikipedia.org/wiki/数";M.Msg.MATH_NUMBER_TOOLTIP="一个数字。";M.Msg.MATH_ONLIST_HELPURL="";M.Msg.MATH_ONLIST_OPERATOR_AVERAGE="列表中的平均数";M.Msg.MATH_ONLIST_OPERATOR_MAX="列表中的最大值";M.Msg.MATH_ONLIST_OPERATOR_MEDIAN="列表中位数";M.Msg.MATH_ONLIST_OPERATOR_MIN="列表中的最小值";M.Msg.MATH_ONLIST_OPERATOR_MODE="列表模式";M.Msg.MATH_ONLIST_OPERATOR_RANDOM="列表的随机项";M.Msg.MATH_ONLIST_OPERATOR_STD_DEV="列表中的标准差";M.Msg.MATH_ONLIST_OPERATOR_SUM="列表中的数的总和";M.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="返回列表中的数值的平均值。";M.Msg.MATH_ONLIST_TOOLTIP_MAX="返回列表中最大数。";M.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="返回列表中的中位数。";M.Msg.MATH_ONLIST_TOOLTIP_MIN="返回列表中最小数。";M.Msg.MATH_ONLIST_TOOLTIP_MODE="返回列表中的最常见的项的列表。";M.Msg.MATH_ONLIST_TOOLTIP_RANDOM="从列表中返回一个随机的元组。";M.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="返回列表的标准偏差。";M.Msg.MATH_ONLIST_TOOLTIP_SUM="返回列表中的所有数字的和。";M.Msg.MATH_POWER_SYMBOL="**";M.Msg.MATH_RANDOM_FLOAT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器";M.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="随机小数";M.Msg.MATH_RANDOM_FLOAT_TOOLTIP="返回介于(包含)0.0到1.0之间的随机数。";M.Msg.MATH_RANDOM_INT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器";M.Msg.MATH_RANDOM_INT_TITLE="从 %1 到 %2 之间的随机整数";M.Msg.MATH_RANDOM_INT_TOOLTIP="返回两个指定的范围(含)之间的随机整数。";M.Msg.MATH_ROUND_HELPURL="https://zh.wikipedia.org/wiki/数值修约";M.Msg.MATH_ROUND_OPERATOR_ROUND="四舍五入";M.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="向下舍入";M.Msg.MATH_ROUND_OPERATOR_ROUNDUP="向上舍入";M.Msg.MATH_ROUND_TOOLTIP="数字向上或向下舍入。";M.Msg.MATH_SINGLE_HELPURL="https://zh.wikipedia.org/wiki/平方根";M.Msg.MATH_SINGLE_OP_ABSOLUTE="绝对";M.Msg.MATH_SINGLE_OP_ROOT="平方根";M.Msg.MATH_SINGLE_TOOLTIP_ABS="返回一个数的绝对值。";M.Msg.MATH_SINGLE_TOOLTIP_EXP="返回数的e次幂。";M.Msg.MATH_SINGLE_TOOLTIP_LN="返回一个数的自然对数。";M.Msg.MATH_SINGLE_TOOLTIP_LOG10="返回数字的对数。";M.Msg.MATH_SINGLE_TOOLTIP_NEG="返回数的逻辑非。";M.Msg.MATH_SINGLE_TOOLTIP_POW10="返回数的10次幂。";M.Msg.MATH_SINGLE_TOOLTIP_ROOT="返回数的平方根。";M.Msg.MATH_SUBTRACTION_SYMBOL="-";M.Msg.MATH_TRIG_ACOS="acos";M.Msg.MATH_TRIG_ASIN="asin";M.Msg.MATH_TRIG_ATAN="atan";M.Msg.MATH_TRIG_COS="cos";M.Msg.MATH_TRIG_HELPURL="https://zh.wikipedia.org/wiki/三角函数";M.Msg.MATH_TRIG_SIN="sin";M.Msg.MATH_TRIG_TAN="tan";M.Msg.MATH_TRIG_TOOLTIP_ACOS="返回一个数的反余弦值。";M.Msg.MATH_TRIG_TOOLTIP_ASIN="返回一个数的反正弦值。";M.Msg.MATH_TRIG_TOOLTIP_ATAN="返回指定角度的反正切值。";M.Msg.MATH_TRIG_TOOLTIP_COS="返回指定角度的余弦值(非弧度)。";M.Msg.MATH_TRIG_TOOLTIP_SIN="返回指定角度的正弦值(非弧度)。";M.Msg.MATH_TRIG_TOOLTIP_TAN="返回指定角度的正切值(非弧度)。";M.Msg.NEW_VARIABLE="创建变量...";M.Msg.NEW_VARIABLE_TITLE="新变量的名称:";M.Msg.ORDINAL_NUMBER_SUFFIX="";M.Msg.PROCEDURES_ALLOW_STATEMENTS="允许声明";M.Msg.PROCEDURES_BEFORE_PARAMS="参数:";M.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="运行用户定义的函数“%1”。";M.Msg.PROCEDURES_CALLRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_CALLRETURN_TOOLTIP="运行用户定义的函数“%1”,并使用它的输出值。";M.Msg.PROCEDURES_CALL_BEFORE_PARAMS="与:";M.Msg.PROCEDURES_CREATE_DO="创建“%1”";M.Msg.PROCEDURES_DEFNORETURN_COMMENT="";M.Msg.PROCEDURES_DEFNORETURN_DO="";M.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="my_func";M.Msg.PROCEDURES_DEFNORETURN_TITLE="定义函数";M.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="创建一个不带输出值的函数。";M.Msg.PROCEDURES_DEFRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";M.Msg.PROCEDURES_DEFRETURN_RETURN="返回";M.Msg.PROCEDURES_DEFRETURN_TOOLTIP="创建一个有输出值的函数。";M.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="警告: 此函数具有重复参数。";M.Msg.PROCEDURES_HIGHLIGHT_DEF="突出显示函数定义";M.Msg.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause";M.Msg.PROCEDURES_IFRETURN_TOOLTIP="如果值为真,则返回第二个值。";M.Msg.PROCEDURES_IFRETURN_WARNING="警告: 仅在定义函数内可使用此块。";M.Msg.PROCEDURES_MUTATORARG_TITLE="输入名称:";M.Msg.PROCEDURES_MUTATORARG_TOOLTIP="添加函数输入。";M.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="输入";M.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="添加、删除或重新排此函数的输入。";M.Msg.REDO="重做";M.Msg.REMOVE_COMMENT="删除注释";M.Msg.RENAME_VARIABLE="重命名变量...";M.Msg.RENAME_VARIABLE_TITLE="将所有“%1”变量重命名为:";M.Msg.TEXT_APPEND_APPENDTEXT="追加文本";M.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";M.Msg.TEXT_APPEND_TO="";M.Msg.TEXT_APPEND_TOOLTIP="将一些文本追加到变量“%1”。";M.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";M.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="转为小写";M.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="转为首字母大写";M.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="转为大写";M.Msg.TEXT_CHANGECASE_TOOLTIP="使用不同的大小写复制这段文字。";M.Msg.TEXT_CHARAT_FIRST="获得第一个字符";M.Msg.TEXT_CHARAT_FROM_END="获得倒数第#个字符";M.Msg.TEXT_CHARAT_FROM_START="获得字符#";M.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";M.Msg.TEXT_CHARAT_INPUT_INTEXT="从文本";M.Msg.TEXT_CHARAT_LAST="获得最后一个字符";M.Msg.TEXT_CHARAT_RANDOM="获取随机的字母";M.Msg.TEXT_CHARAT_TAIL="";M.Msg.TEXT_CHARAT_TOOLTIP="返回位于指定位置的字母。";M.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="将一个项添加到文本中。";M.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="加入";M.Msg.TEXT_CREATE_JOIN_TOOLTIP="添加、移除或重新排列各节来重新配置这个文本块。";M.Msg.TEXT_GET_SUBSTRING_END_FROM_END="到倒数第#个字符";M.Msg.TEXT_GET_SUBSTRING_END_FROM_START="到字符#";M.Msg.TEXT_GET_SUBSTRING_END_LAST="到最后一个字符";M.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";M.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="从文本";M.Msg.TEXT_GET_SUBSTRING_START_FIRST="取得一段字串自第一个字符";M.Msg.TEXT_GET_SUBSTRING_START_FROM_END="取得一段字串自倒数第#个字符";M.Msg.TEXT_GET_SUBSTRING_START_FROM_START="取得一段字串自#";M.Msg.TEXT_GET_SUBSTRING_TAIL="";M.Msg.TEXT_GET_SUBSTRING_TOOLTIP="返回指定的部分文本。";M.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";M.Msg.TEXT_INDEXOF_INPUT_INTEXT="在文本";M.Msg.TEXT_INDEXOF_OPERATOR_FIRST="中查找 最先 出现";M.Msg.TEXT_INDEXOF_OPERATOR_LAST="中查找 最后 出现";M.Msg.TEXT_INDEXOF_TAIL="的位置";M.Msg.TEXT_INDEXOF_TOOLTIP="返回在第二个字串中的第一/最后一个匹配项的索引值。如果未找到则返回%1。";M.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";M.Msg.TEXT_ISEMPTY_TITLE="%1是空的";M.Msg.TEXT_ISEMPTY_TOOLTIP="如果提供的文本为空,则返回真。";M.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";M.Msg.TEXT_JOIN_TITLE_CREATEWITH="转为文本";M.Msg.TEXT_JOIN_TOOLTIP="通过串起任意数量的项以建立一段文字。";M.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";M.Msg.TEXT_LENGTH_TITLE="%1的长度";M.Msg.TEXT_LENGTH_TOOLTIP="返回提供文本的字母数(包括空格)。";M.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";M.Msg.TEXT_PRINT_TITLE="打印%1";M.Msg.CocoRobo_INPUT_MESSAGE0="输入%1";M.Msg.TEXT_PRINT_TOOLTIP="打印指定的文字、数字或其他值。";M.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";M.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="提示用户输入数字。";M.Msg.TEXT_PROMPT_TOOLTIP_TEXT="提示用户输入一些文本。";M.Msg.TEXT_PROMPT_TYPE_NUMBER="输入数字并显示提示消息";M.Msg.TEXT_PROMPT_TYPE_TEXT="输入数字并显示提示消息";M.Msg.TEXT_TEXT_HELPURL="https://zh.wikipedia.org/wiki/字符串";M.Msg.TEXT_TEXT_TOOLTIP="一个字母、单词或一行文本。";M.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";M.Msg.TEXT_TRIM_OPERATOR_BOTH="消除两侧空格";M.Msg.TEXT_TRIM_OPERATOR_LEFT="消除左侧空格";M.Msg.TEXT_TRIM_OPERATOR_RIGHT="消除右侧空格";M.Msg.TEXT_TRIM_TOOLTIP="复制这段文字的同时删除两端多余的空格。";M.Msg.TODAY="今天";M.Msg.UNDO="撤销";M.Msg.VARIABLES_DEFAULT_NAME="item";M.Msg.VARIABLES_GET_CREATE_SET="创建“设定%1”";M.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";M.Msg.VARIABLES_GET_TOOLTIP="返回此变量的值。";M.Msg.VARIABLES_SET="将变量 %1 设定为 %2";M.Msg.VARIABLES_SET_CREATE_GET="创建“获得%1”";M.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";M.Msg.VARIABLES_SET_TOOLTIP="设置此变量,以使它和输入值相等。";M.Msg.VARIABLE_ALREADY_EXISTS="已存在名为“%1”的变量。";M.Msg.PROCEDURES_DEFRETURN_TITLE=M.Msg.PROCEDURES_DEFNORETURN_TITLE;M.Msg.CONTROLS_IF_IF_TITLE_IF=M.Msg.CONTROLS_IF_MSG_IF;M.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=M.Msg.CONTROLS_REPEAT_INPUT_DO;M.Msg.CONTROLS_IF_MSG_THEN=M.Msg.CONTROLS_REPEAT_INPUT_DO;M.Msg.TRY_EXCEPT_TRY="尝试";M.Msg.CocoRobo_RETURN_TOOLTIP="返回一个值";M.Msg.CocoRobo_RETURN_MESSAGE0="返回 %1";M.Msg.CocoRobo_TYPE_MESSAGE0="值 %1 的类型";M.Msg.CocoRobo_TYPE_TOOLTIP="返回当前值的类型";M.Msg.CocoRobo_TYPE_IS_MESSAGE0="值 %1 的类型为 %2";M.Msg.CocoRobo_TYPE_IS_TOOLTIP="设置当前值的类型为%2,并返回结果";M.Msg.CocoRobo_EVAL_HELPURL="";M.Msg.CocoRobo_EVAL_MESSAGE0="计算表达式 %1 的结果";M.Msg.CocoRobo_EVAL_TOOLTIP="计算字符串表达式,并返回结果";M.Msg.CocoRobo_RETURN_HELPURL="";M.Msg.CocoRobo_RETURN_MESSAGE0="返回 %1";M.Msg.CocoRobo_RETURN_TOOLTIP="返回一个值";M.Msg.math_degrad_rad="转换角度为弧度";M.Msg.math_degrad_deg="转换弧度为角度";M.Msg.MATH_KEEP_DECIMAL_HELPURL="";M.Msg.MATH_KEEP_DECIMAL_TOOLTIP="返回指定值保留小数点的结果";M.Msg.MATH_KEEP_DECIMAL_MESSAGE0="%1 保留 %2 位小数";M.Msg.labplus_mapping_MESSAGE0="映射%1 从%2 , %3到%4 , %5";M.Msg.labplus_mapping_TOOLTIP="将0~100中的10映射到0~200中并返回映射值";M.Msg.labplus_mapping_HELPURL="";M.Msg.MATH_RANDOM_RANDRANGE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.MATH_RANDOM_RANDRANGE_TOOLTIP="返回指定递增基数集合中的一个随机数,基数缺省值为1";M.Msg.MATH_RANDOM_RANDRANGE_MESSAGE0="随机数 从递增区间 [%1 ,%2) 递增步长%3";M.Msg.BIT_INVERSION_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.BIT_INVERSION_TOOLTIP="对数据的每个二进制位取反";M.Msg.BIT_INVERSION_MESSAGE0="二进制取反 %1";M.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL="";M.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0="10进制整数 %1 转化为 %2 字符串";M.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP="将10进制整数转化为%2字符串,并返回结果";M.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_HELPURL="";M.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_MESSAGE0="线程锁对象 %1 请求锁";M.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_TOOLTIP="";M.Msg.CocoRobo_START_NEW_THREAD_HELPURL="";M.Msg.CocoRobo_START_NEW_THREAD_MESSAGE0="子线程 %1";M.Msg.CocoRobo_START_NEW_THREAD_TOOLTIP="";M.Msg.CocoRobo_BAUDRATE_HELPURL="";M.Msg.CocoRobo_BAUDRATE_MESSAGE0="%1";M.Msg.CocoRobo_BAUDRATE_TOOLTIP="";M.Msg.CocoRobo_HIGH_LOW_HELPURL="";M.Msg.CocoRobo_HIGH_LOW_MESSAGE0="%1";M.Msg.CocoRobo_HIGH_LOW_TOOLTIP="";M.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL="";M.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0="10进制整数 %1 转化为 %2 字符串";M.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP="将10进制整数转化为%2字符串,并返回结果";M.Msg.CocoRobo_BIN="二进制";M.Msg.CocoRobo_OCT="八进制";M.Msg.CocoRobo_HEX="十六进制";M.Msg.CocoRobo_CONVERT_TO_TEN_HELPURL="";M.Msg.CocoRobo_CONVERT_TO_TEN_MESSAGE0="%1 字符串 %2 转 10进制整数";M.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP="将%2字符串转化为10进制整数,并返回结果";M.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_HELPURL="";M.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_MESSAGE0="10进制整数 %2 转 %1 字节";M.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP="将10进制整数转为%1字节,并返回结果";M.Msg.CocoRobo_INT_TO_CHR_HELPURL="";M.Msg.CocoRobo_INT_TO_CHR_MESSAGE0="整型 %1 转 ASCII 单字符";M.Msg.CocoRobo_INT_TO_CHR_TOOLTIP="ASCII:基于拉丁字母的一套电脑编码系统,主要用于显示现代英语和其他西欧语言。";M.Msg.CocoRobo_CHR_TO_INT_HELPURL="";M.Msg.CocoRobo_CHR_TO_INT_MESSAGE0="ASCII 单字符 %1 转 整型";M.Msg.CocoRobo_CHR_TO_INT_TOOLTIP="ASCII是基于拉丁字母的一套电脑编码系统,主要用于显示现代英语和其他西欧语言。";M.Msg.CocoRobo_STR_TO_HEX_HELPURL="";M.Msg.CocoRobo_STR_TO_HEX_MESSAGE0="字符串 %1 转 十六进制 字节";M.Msg.CocoRobo_STR_TO_HEX_TOOLTIP="返回结果中用空格分隔两个十六进制数";M.Msg.CocoRobo_HEX_TO_BIN_STR_HELPURL="";M.Msg.CocoRobo_HEX_TO_BIN_STR_MESSAGE0="十六进制字符串 %1 转 二进制 字节";M.Msg.CocoRobo_HEX_TO_BIN_STR_TOOLTIP="十六进制字符串转二进制字节,并返回结果";M.Msg.CocoRobo_DATA_TO_BASE64_HELPURL="";M.Msg.CocoRobo_DATA_TO_BASE64_MESSAGE0="%1 以 base64 格式编码 返回字节对象";M.Msg.CocoRobo_DATA_TO_BASE64_TOOLTIP="Base64编码是从二进制到字符的过程";M.Msg.CocoRobo_BASE64_TO_DATA_HELPURL="";M.Msg.CocoRobo_BASE64_TO_DATA_MESSAGE0="解码 base64 数据 %1 返回字节对象";M.Msg.CocoRobo_BASE64_TO_DATA_TOOLTIP="Base64编码是从二进制到字符的过程";M.Msg.CocoRobo_UJSON_DUMPS_HELPURL="";M.Msg.CocoRobo_UJSON_DUMPS_MESSAGE0="%1 转 json 字符串";M.Msg.CocoRobo_UJSON_DUMPS_TOOLTIP="JSON 格式的 key 必须是字符串,value 可以是合法的 JSON 数据类型(字符串, 数字, 对象, 数组, 布尔值或 none)";M.Msg.CocoRobo_UJSON_LOADS_HELPURL="";M.Msg.CocoRobo_UJSON_LOADS_MESSAGE0="解析 json 字符串 %1 返回对象";M.Msg.CocoRobo_UJSON_LOADS_TOOLTIP="JSON 格式的 key 必须是字符串,value 可以是合法的 JSON 数据类型(字符串, 数字, 对象, 数组, 布尔值或 none)";M.Msg.CocoRobo_code_annotation_HELPURL="";M.Msg.CocoRobo_code_annotation_MESSAGE0="注释 # %1";M.Msg.CocoRobo_code_annotation_TOOLTIP="生成代码注释";M.Msg.TEXT_FORMAT_MESSAGE0="格式化字符串 %1 % %2";M.Msg.TEXT_FORMAT_TOOLTIP='使用"%"的方式格式化字符串,并返回结果';M.Msg.TEXT_FORMAT_HELPURL="";M.Msg.TEXT_FORMAT2_MESSAGE0="格式化字符串 %1 format %2";M.Msg.TEXT_FORMAT2_TOOLTIP='使用"format"的方式格式化字符串,并返回结果';M.Msg.TEXT_FORMAT2_HELPURL="";M.Msg.TEXT_TO_BYTE_MESSAGE0="转字节 %1";M.Msg.TEXT_TO_BYTE_TOOLTIP="支持数据类型:string";M.Msg.TEXT_TO_BYTE_HELPURL="";M.Msg.CocoRobo_BYTES_DECODE_HELPURL="";M.Msg.CocoRobo_BYTES_DECODE_MESSAGE0="字节 %1 转 字符串";M.Msg.CocoRobo_BYTES_DECODE_TOOLTIP="返回指定字节转字符串的结果";M.Msg.OTHER_TO_BYTE_MESSAGE0="非文本转字节 %1";M.Msg.OTHER_TO_BYTE_TOOLTIP="";M.Msg.OTHER_TO_BYTE_HELPURL="";M.Msg.text_additional_delimiter_string="将字符串";M.Msg.text_additional_delimiter_deli="使用分隔符:";M.Msg.text_additional_delimiter_end="进行拆分并生成列表";M.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.CocoRobo_TEXT_ESC_HELPURL="";M.Msg.CocoRobo_TEXT_ESC_MESSAGE0="文本转义字符 %1";M.Msg.CocoRobo_TEXT_ESC_TOOLTIP="文本转义字符";M.Msg.TEXT_APPEND_TEXT_HELPURL="";M.Msg.TEXT_APPEND_TEXT_TOOLTIP="在指定文本后追加文本,并返回结果";M.Msg.TEXT_APPEND_TEXT_MESSAGE0="%1 追加文本 %2";M.Msg.TEXT_APPEND_TEXT_HELPURL="";M.Msg.TEXT_APPEND_TEXT_TOOLTIP="在指定文本後追加文本,並返回結果";M.Msg.TEXT_APPEND_TEXT_MESSAGE0="%1 追加文本 %2";M.Msg.TEXT_IS_NUMBER_HELPURL="";M.Msg.TEXT_IS_NUMBER_TOOLTIP="判断文本%1,并返回True或False";M.Msg.TEXT_IS_NUMBER_MESSAGE0="%1 %2";M.Msg.CocoRobo_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.CocoRobo_return_list_MESSAGE0="定义列表 %1 = %2";M.Msg.CocoRobo_return_list_TOOLTIP="定义一个列表";M.Msg.CocoRobo_ORDER="第";M.Msg.CocoRobo_REVERSE_ORDER="倒数第";M.Msg.LIST_ORDER_ITEM_MESSAGE0="列表%1 %2 %3 项";M.Msg.LIST_ORDER_ITEM_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.CocoRobo_lists_append_MESSAGE0="列表%1 末尾添加项%2";M.Msg.CocoRobo_lists_append_TOOLTIP="列表末尾添加项";M.Msg.CocoRobo_lists_append_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.LIST_ITEM_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.LIST_ITEM_EXIST_TOOLTIP="列表包含特定的字符串";M.Msg.LIST_ITEM_EXIST_MESSAGE0="列表%1 包含%2";M.Msg.SET_LIST_ORDER_ITEM_MESSAGE0="设列表%1 %2 %3 项为%4";M.Msg.SET_LIST_ORDER_ITEM_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.SET_LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.INSERT_LIST_ORDER_ITEM_MESSAGE0="插入列表%1 %2 %3 项为%4";M.Msg.INSERT_LIST_ORDER_ITEM_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.INSERT_LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.LIST_ORDER_ITEM_MESSAGE0="列表%1 %2 %3 项";M.Msg.LIST_ORDER_ITEM_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.PARTS_OF_LIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.PARTS_OF_LIST_TOOLTIP=`递增顺序取项
- 举例:
- 倒数第5到倒数第2;
- 第0到第5`;M.Msg.PARTS_OF_LIST_MESSAGE0="返回列表%1 取%2 %3 项到 %4 %5 项";M.Msg.LIST_TO_TUPLE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.LIST_TO_TUPLE_TOOLTIP="列表转元组";M.Msg.LIST_TO_TUPLE_MESSAGE0="列表%1 转元组";M.Msg.CocoRobo_lists_clear_MESSAGE0="列表%1 清空";M.Msg.CocoRobo_lists_clear_TOOLTIP="清空列表";M.Msg.CocoRobo_lists_clear_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.CocoRobo_lists_extend_MESSAGE0="列表%1 追加列表%2";M.Msg.CocoRobo_lists_extend_TOOLTIP="在列表中追加列表";M.Msg.CocoRobo_lists_extend_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.LIST_FIRST_INDEX_HELPURL="";M.Msg.LIST_FIRST_INDEX_MESSAGE0="项 %1 在列表 %2 %3 出现的位置";M.Msg.LIST_FIRST_INDEX_TOOLTIP="返回指定字符串在列表中%3出现的位置";M.Msg.FIRST="第一次";M.Msg.LAST="最后一次";M.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到字典中。";M.Msg.DICT_CREATE_WITH_ITEMS_INSERT_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.DICT_CREATE_WITH_ITEMS_INSERT_TOOLTIP="初始化字典";M.Msg.DICT_KEY_VALUE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.DICT_KEY_VALUE_TOOLTIP="返回字典指定键的值";M.Msg.DICT_KEY_VALUE_MESSAGE0="字典%1 键%2 的值";M.Msg.ADD_DICT_KEY_VALUE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.ADD_DICT_KEY_VALUE_TOOLTIP="已有该键则更新该键";M.Msg.ADD_DICT_KEY_VALUE_MESSAGE0="字典%1 添加键%2 值%3";M.Msg.DICT_LENGTH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.DICT_LENGTH_TOOLTIP="返回字典的长度";M.Msg.DICT_LENGTH_MESSAGE0="字典%1 长度";M.Msg.DICT_KEY_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.DICT_KEY_EXIST_TOOLTIP="判断字典中是否包含指定键,并返回True或False";M.Msg.DICT_KEY_EXIST_MESSAGE0="字典%1 包含键%2";M.Msg.DICT_KEY_OR_VAL_LIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP="返回字典%2的列表";M.Msg.DICT_KEY_OR_VAL_LIST_MESSAGE0="字典%1 %2的列表";M.Msg.DICT_KEYS="键";M.Msg.DICT_VALUES="值";M.Msg.DICT_CREATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.DICT_CREATE_WITH_TOOLTIP="定义一个字典";M.Msg.DICT_CREATE_WITH_MESSAGE0="定义字典 %1 = %2";M.Msg.tuple_create_with_MESSAGE0="定义元组 %1 = %2 ";M.Msg.tuple_create_with_TOOLTIP="只包含一个元组时,需要在元组后面添加逗号";M.Msg.tuple_create_with_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.tuple_order_item_MESSAGE0="元组%1 %2 %3 项";M.Msg.tuple_order_item_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.tuple_order_item_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.CocoRobo_MIN="最小值";M.Msg.CocoRobo_MAX="最大值";M.Msg.CocoRobo_LENTH="长度";M.Msg.TUPLE_MIN_MAX_LEN_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP="返回元组的%2";M.Msg.TUPLE_MIN_MAX_LEN_MESSAGE0="元组 %1 %2";M.Msg.TUPLE_ITEM_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.TUPLE_ITEM_EXIST_TOOLTIP="判断是否包含指定值,并返回True或False";M.Msg.TUPLE_ITEM_EXIST_MESSAGE0="元组%1 包含%2";M.Msg.PARTS_OF_TUPLE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.PARTS_OF_TUPLE_TOOLTIP="正序计数从0开始,倒序计数从1开始";M.Msg.PARTS_OF_TUPLE_MESSAGE0="返回元组%1 取第%2 项到尾项";M.Msg.PARTS_OF_TUPLE2_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.PARTS_OF_TUPLE2_TOOLTIP=`递增顺序取项
- 举例:
- 倒数第5到倒数第2;
- 第0到第5`;M.Msg.PARTS_OF_TUPLE2_MESSAGE0="返回元组%1 取%2 %3 项到 %4 %5 项";M.Msg.SET_CREATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.SET_CREATE_WITH_TOOLTIP="定义集合";M.Msg.SET_CREATE_WITH_MESSAGE0="定义集合 %1 = %2";M.Msg.SET_UPDATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.SET_UPDATE_WITH_TOOLTIP="添加参数可为字符串、列表、元组、集合、字典(只添加key),已有元组则不进行操作";M.Msg.SET_UPDATE_WITH_MESSAGE0="集合 %1 添加 %2";M.Msg.INTERSECTION_OF_SETS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.INTERSECTION_OF_SETS_TOOLTIP="返回两集合的%1";M.Msg.INTERSECTION_OF_SETS_MESSAGE0="取 %1 集合 %2 集合 %3";M.Msg.CocoRobo_INTERSECTION="交集";M.Msg.CocoRobo_UNION="并集";M.Msg.CocoRobo_DIFFERENCE="差集";M.Msg.SETS_UPDATE_WAYS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.SETS_UPDATE_WAYS_TOOLTIP="集合更新为与指定集合的%3";M.Msg.SETS_UPDATE_WAYS_MESSAGE0="集合 %1 更新为 与集合 %2 的 %3";M.Msg.SUBSET_SUPERSET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.SUBSET_SUPERSET_TOOLTIP="集合为集合的%3";M.Msg.SUBSET_SUPERSET_MESSAGE0="集合 %1 为集合 %2 的 %3";M.Msg.CocoRobo_SUBSET="子集";M.Msg.CocoRobo_SUPERSET="超集";M.Msg.LEN_OF_SETS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.LEN_OF_SETS_TOOLTIP="返回指定集合的长度";M.Msg.LEN_OF_SETS_MESSAGE0="集合 %1 长度";M.Msg.GET_SETS_POP_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.GET_SETS_POP_TOOLTIP="返回移除随机项后的集合";M.Msg.GET_SETS_POP_MESSAGE0="返回随机项并移除之 从集合 %1";M.Msg.CREATE_EMPTY_SET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";M.Msg.CREATE_EMPTY_SET_TOOLTIP="";M.Msg.CREATE_EMPTY_SET_MESSAGE0="创建空集合 %1";M.Msg.io_high="高电平";M.Msg.io_low="低电平";M.Msg.digital_set="设置引脚 #";M.Msg.digital_set_as="为";M.Msg.digital_get="获取引脚 #";M.Msg.digital_get_value="的数字信号数值";M.Msg.digital_set_title="设置特定引脚为指定电平";M.Msg.digital_get_value_title="返回特定引脚的数字信号数值";M.Msg.time_iot_module="IoT 模块 ";M.Msg.time_ai_module="AI 模块";M.Msg.analog_get_moudule="模块获取引脚 #";M.Msg.analog_get_value="的模拟信号数值 (PWM)";M.Msg.set_pin="(范围:0 ~ 1023)";M.Msg.Esp32_Main_Controller_Io_From_Analog_Pin_TOOLTIP="模块获取特定引脚的模拟信号数值";M.Msg.serialcomm_print="串口打印";M.Msg.serialcomm_write_title_text="通过串口发送数据至其他设备";M.Msg.serialcomm_read_setup_title_text="通过串口获取数据";M.Msg.serialcomm_read_setup_title_text_1="初始化";M.Msg.serial_read_data="从";M.Msg.Serial_Read_Data_all="获取串口的数据,并将其存到";M.Msg.ARD_SERIAL_RECEIVE_DATASET_GET_TEXT="获取接收到串口数据中第";M.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_TEXT="位的数据,数据类型为:";M.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_FLOAT="浮点数";M.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_INTEGER="Number";M.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_STRING="字符";M.Msg.serialcomm_write_item_first="第 ";M.Msg.serialcomm_write_item_last=" 位数据:";M.Msg.serialcomm_write_item="项目";M.Msg.serialcomm_write_data="数据";M.Msg.serialcomm_write_data_bps_title="设置波特率为:";M.Msg.serial_send_data_on_send_data_cocorobo="CocoPi 发送数据至一代和二代";M.Msg.serialcomm_write_data_bps_attrib="比特/秒";M.Msg.serialcomm_write_on="使用";M.Msg.serialcomm_write_on_ai="AI 模块";M.Msg.serialcomm_write_on_iot="IoT 模块";M.Msg.serialcomm_write_on_iot_lite="IoT Lite 模块";M.Msg.serial_send_data_on="在";M.Msg.serial_send_data_on_send_data="模块上发送数据至 Microbit";M.Msg.serial_new_send_data="串口写入文本";M.Msg.serial_new_send_data_1="不换行";M.Msg.serial_new_send_data_2="自动换行";M.Msg.serial_new_send_data_3="串口写入单字节";M.Msg.serial_new_send_data_4="串口写入字节列表";M.Msg.serial_new_get_data_1="串口有可读数据";M.Msg.serial_new_get_data_2="串口读取一行数据";M.Msg.serial_new_get_data_3="串口读取数据";M.Msg.serial_new_get_data_4="串口读取数据长度为";M.Msg.serial_close="关闭串口";M.Msg.serial_clear_data="清除串口数据";M.Msg.SYSTEM="重启系统";M.Msg.SYSTEM_GC="启动内存回收";M.Msg.SYSTEM_CREATE="创建文本文件 ";M.Msg.SYSTEM_CREATE_FILE="创建文件 ";M.Msg.SYSTEM_CREATE_F="文件名:";M.Msg.SYSTEM_CREATE_F_1="文件路径为:";M.Msg.SYSTEM_RUN="运行程序文件";M.Msg.SYSTEM_RUN_F="文件名:";M.Msg.SYSTEM_WRITE="创建文本文件";M.Msg.SYSTEM_OPEN_FILE="打开文件";M.Msg.SYSTEM_WRITE_FILE="写入文件";M.Msg.SYSTEM_CLOSE_FILE="关闭文件";M.Msg.SYSTEM_WRITE_F="文件名:";M.Msg.SYSTEM_WRITE_W="写入内容:";M.Msg.SYSTEM_WRITE_S="分隔符为:";M.Msg.SYSTEM_WRITE_S_N="换行";M.Msg.SYSTEM_WRITE_S_C="逗号";M.Msg.SYSTEM_WRITE_S_S="空格";M.Msg.SYSTEM_WRITE_S_SE="分号";M.Msg.SYSTEM_INPUT="读取文本文件为列表";M.Msg.SYSTEM_INPUT_FILE="读取文件为列表";M.Msg.ARD_TIME_DELAY="等待";M.Msg.ARD_TIME_MS="毫秒";M.Msg.ARD_TIME_SECOND="秒";M.Msg.ARD_TIME_DELAY_TIP="等待一定的时间(以毫秒为单位)";M.Msg.ARD_TIME_DELAY_seconds_TIP="等待一定的时间(以秒为单位)";M.Msg.ARD_TIME_DELAY_seconds="秒";M.Msg.ARD_TIME_DO="执行";M.Msg.ARD_TIME_DO_MS="执行";M.Msg.ARD_TIME_EVERY="每隔";M.Msg.time_init_timer="初始化计时器";M.Msg.time_timer_get_time="获取计时器已过时间(毫秒)";M.Msg.time_timer_clear="清除计时器";M.Msg.time_timer_periodically="启用周期重复计时器";M.Msg.time_timer_every="每隔";M.Msg.time_timer_ms="毫秒";M.Msg.time_execution="运行";M.Msg.time_timer_periodically_clear="清除周期重复计时器";M.Msg.time_get_current_date_title="获取本地时间:";M.Msg.Esp32_Get_Current_Date_TOOLTIP="获取本地时间的%1";M.Msg.time_get_current_date_y="年";M.Msg.time_get_current_date_m="月";M.Msg.time_get_current_date_d="日";M.Msg.time_get_current_date_hour="时";M.Msg.time_get_current_date_min="分";M.Msg.time_get_current_date_sec="秒";M.Msg.Esp32_Main_Controller_Time_Timer_Init_TOOLTIP="%1初始化计时器";M.Msg.Esp32_Main_Controller_Time_Timer_Get_Current_TOOLTIP="%1获取计时器已过时间";M.Msg.Esp32_Main_Controller_Time_Timer_Clear_TOOLTIP="%1清除计时器";M.Msg.Esp32_Main_Controller_Time_Period_Timer_TOOLTIP="%1启用周期重复计时器,并隔一定的时间运行指定的条件";M.Msg.Esp32_Main_Controller_Time_Period_Timer_Clear_TOOLTIP="%1清除周期重复计时器";M.Msg.serial_Comm_Print_TOOLTIP="串口打印";M.Msg.Serial_Write_Data_TOOLTIP="通过串口发送数据至其他设备";M.Msg.Serial_Read_Data_Setup_TOOLTIP="使用%1通过串口获取其他设备发送的数据初始化";M.Msg.Serial_Read_Data_all_TOOLTIP="获取串口的数据并存储到serial_data中";M.Msg.Serial_Read_Data_TOOLTIP="从serial_data获取接收到串口数据中的某一位数据";M.Msg.Serial_Send_Data_To_Microbit_TOOLTIP="在%1模块上发送数据至Microbit";M.Msg.rgb_R="红";M.Msg.rgb_G="绿";M.Msg.rgb_B="蓝";M.Msg.ai_lcd_rgb_value_input_TOOLTIP="返回指定的rgb值";M.Msg.image_process_xy_x="X";M.Msg.image_process_xy_y="Y";M.Msg.image_process_wh_width="宽";M.Msg.image_process_wh_height="高";M.Msg.COLOR="颜色";M.Msg.image_start_X="起点X轴坐标";M.Msg.image_start_Y="起点Y轴坐标";M.Msg.image_start_W="检测框的宽度";M.Msg.image_start_H="检测框的高度";M.Msg.image_start_CX="检测框中心点X轴坐标";M.Msg.image_start_CY="检测框中心点Y轴坐标";M.Msg.image_start_result="结果";M.Msg.image_start_confidence="置信度";M.Msg.ai_model_digital_new_text="对检测的每一个手写数字结果";M.Msg.ai_basic_button_when="当按钮";M.Msg.ai_basic_pressed="按下时";M.Msg.ai_basic_released="松开时";M.Msg.ai_basic_led_set="设置";M.Msg.ai_basic_led_blue="蓝色LED";M.Msg.ai_basic_led_red="LED2(右侧)";M.Msg.ai_basic_led_on="点亮";M.Msg.ai_basic_led_off="熄灭";M.Msg.ai_basic_rgb_set_on="点亮 RGB 灯,灯颜色为";M.Msg.ai_basic_rgb_set_off="熄灭 RGB 灯";M.Msg.ai_basic_led_analog_set="设置";M.Msg.ai_basic_led_analog_led1="LED1";M.Msg.ai_basic_led_analog_led2="LED2";M.Msg.ai_basic_led_analog_brightness_text="的灯光亮度为";M.Msg.ai_basic_led_analog_range_text="(数值范围: 0~100)";M.Msg.ai_k210_button_read_pressed_TOOLTIP="当按钮%1按下时";M.Msg.ai_k210_button_read_released_TOOLTIP="当按钮%1松开时";M.Msg.ai_k210_led_light_up_TOOLTIP="设置%1点亮";M.Msg.ai_basic_light_up_led_analog_TOOLTIP="设置%1的灯光亮度";M.Msg.ai_k210_led_light_off_TOOLTIP="设置%1熄灭";M.Msg.basic_light_get="获取光线值(0~4095)";M.Msg.ESP32_ENV_GET_TEXT="获取";M.Msg.basic_temperature="温度";M.Msg.basic_humidity="湿度";M.Msg.basic_env_value="数值";M.Msg.Esp32_Main_Controller_Get_Environmental_Value_TOOLTIP="获取%1数值";M.Msg.Esp32_Main_Controller_Motion_When_Shaking_STATEMENT_TOOLTIP="当模块%1摇晃状态时,执行操作";M.Msg.Esp32_Main_Controller_Motion_When_Tilting_STATEMENT_TOOLTIP="当模块%1倾斜时,执行操作";M.Msg.Esp32_Main_Controller_Motion_Acceleration_TOOLTIP="获取%1轴的加速度";M.Msg.Esp32_Main_Controller_Motion_Rotation_Measurement_TOOLTIP="获取%1轴的旋转测量值";M.Msg.Esp32_Main_Controller_Motion_Tilt_Angle_TOOLTIP="获取%1轴的倾斜角度";M.Msg.basic_motion_get_along="获取沿";M.Msg.basic_motion_accel="轴的加速度";M.Msg.basic_motion_angle="轴的倾斜角度";M.Msg.basic_motion_rotation_measurement="轴的旋转测量值";M.Msg.basic_when_tilting_get="当模块";M.Msg.servo_setup_ai="舵机初始化";M.Msg.servo_set_gpio_ai="设置位于引脚 #";M.Msg.servo_rotate_to_ai="的舵机转动至";M.Msg.servo_degree_ai="度 (0˚~180˚)";M.Msg.extension_servo_setup_on_ai_TOOLTIP="模块舵机初始化";M.Msg.extension_servo_write_on_ai_TOOLTIP="模块设置位于指定引脚的舵机转动至指定角度";M.Msg.x_motor_set_motor_ai="电机驱动初始化设置";M.Msg.x_motor_set_motor_turn_ai="设定电机";M.Msg.x_motor_set_motor_speed_ai="以速度";M.Msg.x_motor_exec_ai="(0~255)进行";M.Msg.x_motor_cw_ai="顺时针";M.Msg.x_motor_acw_ai="逆时针";M.Msg.x_motor_set_motor_turns_ai="转动";M.Msg.ai_motor_setup_TOOLTIP="电机驱动初始化";M.Msg.ai_motor_run_TOOLTIP="设置电机以指定速度进行指定方向的转动";M.Msg.image_process_lcd_init="LCD 屏幕初始化";M.Msg.image_process_lcd_direction="设置屏幕方向";M.Msg.image_process_lcd_landscape_screen="横屏";M.Msg.image_process_lcd_vertical_screen="竖屏";M.Msg.image_process_text_let_canvas="将图像";M.Msg.image_process_text_image_canvas="图片化";M.Msg.image_process_text_let_canvas_filled_with_color="铺满颜色";M.Msg.image_process_text_on_canvas="显示图像";M.Msg.image_process_text_on_draw="显示";M.Msg.image_process_draw_line="绘制直线";M.Msg.image_text_on_draw="绘制";M.Msg.image_process_text_set_canvas_setup="设置画布";M.Msg.image_process_draw_qrcode="二维码";M.Msg.image_process_draw_qr_code_size="二维码大小";M.Msg.image_lcd_set_font="设置字体为";M.Msg.image_process_create_blank_canvas="创建空白画布";M.Msg.image_process_show_canvas="显示画布";M.Msg.image_process_clear_canvas_1="清除画布";M.Msg.image_process_clear_canvas_2="清除所有内容";M.Msg.image_process_set_lcd_rotation="旋转至";M.Msg.image_process_text_start_coord="坐标:";M.Msg.image_process_text_size="尺寸:";M.Msg.image_process_text_color="颜色:";M.Msg.image_process_background_color="背景颜色:";M.Msg.image_process_text_thick="厚度:";M.Msg.image_process_text_radius="半径:";M.Msg.image_process_text_content="内容";M.Msg.image_process_draw_text_font_size="文本大小:(由 1 至 3 之间的整数)";M.Msg.image_process_draw_rectangle_text="矩形";M.Msg.image_process_draw_circle_text="圆形";M.Msg.image_process_draw_circle_text_start="圆心坐标";M.Msg.image_process_draw_sensor_image_path="设置图像源:";M.Msg.OLCD_COORDINATE="起始点坐标";M.Msg.image_process_text_filled="实心";M.Msg.image_process_text_stroked="空心";M.Msg.ai_lcd_screeninit_TOOLTIP="LCD屏幕初始化";M.Msg.ai_lcd_rotation_TOOLTIP="将LCD屏幕方向旋转指定的角度";M.Msg.ai_lcd_filp_TOOLTIP="是否将LCD屏幕进行镜面翻转";M.Msg.ai_lcd_screen_TOOLTIP="将LCD屏幕填充颜色为%1";M.Msg.ai_lcd_fill_screen_with_rgb_TOOLTIP="将LCD屏幕填充颜色为指定rgb值";M.Msg.ai_lcd_clear_TOOLTIP="清除屏幕";M.Msg.ai_lcd_XY_TOOLTIP="返回指定的x和y";M.Msg.ai_lcd_WH_TOOLTIP="返回指定的宽与高";M.Msg.ai_lcd_createnonecarvas_TOOLTIP="创建指定尺寸的空白画布";M.Msg.ai_lcd_fillcanvas_TOOLTIP="将画布铺满指定的颜色";M.Msg.ai_lcd_createcarvas_TOOLTIP="创建图像画布";M.Msg.ai_lcd_showcarvas_set_cord_TOOLTIP="设置画布的起始点坐标";M.Msg.ai_lcd_textcarvas_TOOLTIP="在画布上绘制文本";M.Msg.ai_lcd_characterscarvas_TOOLTIP="在画布上绘制汉字字符";M.Msg.ai_lcd_linecarvas_TOOLTIP="在画布上绘制直线";M.Msg.ai_lcd_ractanglecarvas_TOOLTIP="在画布上绘制%1矩形";M.Msg.ai_lcd_drawcirclecarvas_TOOLTIP="在画布上绘制%1圆形";M.Msg.ai_lcd_draw_cross_sign_TOOLTIP="在画布上绘制十字标";M.Msg.ai_lcd_draw_arrow_sign_TOOLTIP="在画布上绘制箭头";M.Msg.ai_lcd_draw_image_on_canvas_TOOLTIP="在画布上绘制图片";M.Msg.ai_lcd_draw_sensor_image_on_canvas_TOOLTIP="在画布上绘制相机捕捉的图像";M.Msg.ai_lcd_showcarvas_set_display_TOOLTIP="显示画布";M.Msg.ai_lcd_clearcanvas_TOOLTIP="清除画布中的所有内容";M.Msg.ai_lcd_qrcode_TOOLTIP="在画布上绘制二维码";M.Msg.read_img_path_to="读取图片文件自";M.Msg.take_the_picture="将图片";M.Msg.save_img_path_to="保存图片至";M.Msg.display_draw_vertical="垂直";M.Msg.display_draw_horizontal="水平";M.Msg.MAIXDUINO_DISPLAY_ORIENTATION_ROTATE="翻转";M.Msg.MAIXDUINO_DISPLAY_ORIENTATION_ROTATE_title="将图像进行 %1 翻转";M.Msg.image_process_rotate="将图像旋转";M.Msg.image_process_rotate_angle="度";M.Msg.image_process_imgcut_cutting="将图像进行裁剪处理";M.Msg.image_process_imgcut_start_coord="裁剪起始坐标:";M.Msg.image_process_imgcut_size="裁剪尺寸:";M.Msg.image_process_img_resize="将图像进行缩放至";M.Msg.ai_vision_detection_color_threshold_set="获取用于颜色追踪的默认颜色:";M.Msg.ai_vision_get_threshold_default_TOOLTIP="设置获取用于颜色追踪的默认颜色为%1";M.Msg.ai_vision_detection_color_threshold_set_black="黑色";M.Msg.ai_vision_detection_color_threshold_set_white="白色";M.Msg.ai_vision_detection_color_threshold_set_red="亮红色";M.Msg.ai_vision_detection_color_threshold_set_green="绿色";M.Msg.ai_vision_detection_color_threshold_set_blue="浅蓝色";M.Msg.ai_vision_detection_color_threshold_set_orange="橙色";M.Msg.image_process_find_blobs="寻找指定颜色的块";M.Msg.image_get_find_blobs_result="获取指定颜色的识别结果";M.Msg.ai_vision_lane_tracking_setup_threshold="设置追踪的颜色";M.Msg.ai_vision_find_blobs_start_coord="设置检测区域的起始坐标:";M.Msg.ai_vision_find_blobs_size="设置检测区域的尺寸:";M.Msg.image_process_find_lines="寻找指定颜色的线:";M.Msg.image_get_find_lines_result="获取寻找到线的识别结果";M.Msg.ai_vision_lane_tracking_setup_left="设置左侧识别区域:";M.Msg.ai_vision_lane_tracking_setup_Right="设置右侧识别区域:";M.Msg.ai_vision_lane_tracking_setup_axis="设置中心线位置:";M.Msg.image_process_find_qrcodes="获取图像二维码检测结果";M.Msg.image_process_get_qrcodes_result="获取二维码的";M.Msg.image_process_find_barcodes="获取图像条形码检测结果";M.Msg.image_process_get_barcodes_result="获取条形码的";M.Msg.ai_vision_canvas_area_tuple="创建区域元组";M.Msg.ai_vision_pattern_detection_content="源文本";M.Msg.ai_vision_pattern_detection_x="边界框X轴坐标";M.Msg.ai_vision_pattern_detection_y="边界框Y轴坐标";M.Msg.ai_vision_pattern_detection_w="边界框宽度";M.Msg.ai_vision_pattern_detection_h="边界框高度";M.Msg.ai_vision_qrcode_get_info_TOOLTIP="获取二维码的%1";M.Msg.ai_vision_barcode_get_info_TOOLTIP="获取条形码的%1";M.Msg.image_process_find_apriltag="获取图像AprilTag检测结果";M.Msg.ai_vision_apriltag_get_info="获取AprilTag的";M.Msg.ai_vision_apriltag_get_info_TOOLTIP="获取AprilTag的%1";M.Msg.system_poweroff="关机";M.Msg.system_restart="重启系统";M.Msg.system_gc="启动内存回收";M.Msg.system_create_file="创建文件";M.Msg.system_create_file_name="文件名:";M.Msg.system_create_file_path="文件路径为:";M.Msg.system_run_file="运行程序文件";M.Msg.system_run_file_name="文件名:";M.Msg.ChatGpt_get_problem_result="返回提问结果";M.Msg.ChatGpt_ai_agent_chat_set_appID="设置AI智能体apiKey";M.Msg.ChatGpt_ai_agent_chat_result="返回AI智能体结果";M.Msg.ai_set_ai_agent_title="设置智能体apikey和问题,并返回结果";M.Msg.ChatGpt_set_problem_content="设置文字提问内容";M.Msg.set_weather_city="设置获取天气城市";M.Msg.beijing="北京";M.Msg.shanghai="上海";M.Msg.guangzhou="广州";M.Msg.shenzhen="深圳";M.Msg.tianjin="天津";M.Msg.HongKong="香港";M.Msg.weather_resulet="天气结果";M.Msg.weather_condition="天气状况";M.Msg.windDir="风向";M.Msg.windScale="风向等级";M.Msg.windSpeed="风速";M.Msg.image_process_humidity="湿度";M.Msg.image_process_temperature="温度";M.Msg.iotservice_ifttt_send_title="发送数据到 IFTTT Webhooks 事件";M.Msg.iotservice_ifttt_send_webhook="Webhooks API Key:";M.Msg.iotservice_ifttt_send_eventname="事件名称:";M.Msg.iotservice_ifttt_send_1="数据 1:";M.Msg.iotservice_ifttt_send_2="数据 2:";M.Msg.iotservice_ifttt_send_3="数据 3:";M.Msg.iotservice_ifttt_trigger_title="触发 IFTTT 事件";M.Msg.iotservice_ifttt_trigger_webhook="Webhook API Key:";M.Msg.iotservice_ifttt_trigger_eventname="事件名称:";M.Msg.Esp32_Main_Controller_Ifttt_Touched_TOOLTIP="触发指定的IFTTT事件";M.Msg.Esp32_Main_Controller_Ifttt_Send_Data_TOOLTIP="发送数据到IFTTT Webhooks事件";M.Msg.iotservice_thingspeak_send_title="发送数据至 ThingSpeak 频道 (Channel)";M.Msg.iotservice_thingspeak_send_api_set="设置频道 API Key:";M.Msg.iotservice_thingspeak_send_title="发送数据至 ThingSpeak 频道";M.Msg.iotservice_thingspeak_send_api="频道 API Key:";M.Msg.iotservice_thingspeak_query_title="查找 ThingSpeak 指定频道的数据";M.Msg.iotservice_thingspeak_query_api="频道 API Key:";M.Msg.iotservice_thingspeak_channel_id="频道 ID:";M.Msg.iotservice_thingspeak_read_total="获取 ThingSpeak 频道中的数据总量";M.Msg.iotservice_thingspeak_get_title="获取 ThingSpeak 频道中第";M.Msg.iotservice_thingspeaK_get_field="条数据的 Field";M.Msg.iotservice_thingspeaK_get_value="的数值";M.Msg.Iot_Service_Thingspeak_TOOLTIP="发送数据至指定ThingSpeak频道";M.Msg.Iot_Service_Thingspeak_Read_TOOLTIP="查找ThingSpeak指定频道的数据";M.Msg.Iot_Service_Thingspeak_Read_Total_TOOLTIP="获取ThingSpeak频道中的数据总量";M.Msg.Iot_Service_Thingspeak_Read_Specific_TOOLTIP="获取ThingSpeak频道中指定数据的指定Field的数值";M.Msg.Iot_Service_Cococloud_TOOLTIP="发送数据至CocoCloud指定事件";M.Msg.Iot_Service_Cococloud_Read_TOOLTIP="获取CocoCloud指定事件中的数据";M.Msg.Iot_Service_Cococloud_Read_Data_TOOLTIP="获取CocoCloud事件中指定属性的数据";M.Msg.send_email_title="发送邮件";M.Msg.send_email_to="发送到";M.Msg.send_email_content="邮件内容:";M.Msg.send_email_title_title="发送邮件到指定邮箱";M.Msg.wifi_web_http_server_setup="HTTP 服务器初始化";M.Msg.wifi_web_http_server_route_setting_title="HTTP 服务器设置访问路径";M.Msg.wifi_web_http_server_route_setting_path="当路径:";M.Msg.wifi_web_http_server_route_setting_being_requested="被请求时";M.Msg.wifi_web_http_server_route_setting_property="设置请求属性为:";M.Msg.wifi_web_http_server_route_setting_get="GET 请求";M.Msg.wifi_web_http_server_route_setting_post="POST 请求";M.Msg.wifi_web_http_server_route_setting_do="运行";M.Msg.wifi_web_http_server_respond_title="HTTP 服务器设置响应内容";M.Msg.wifi_web_http_server_respond_type="设置返回数据类型:";M.Msg.wifi_web_http_server_respond_text="纯文本";M.Msg.wifi_web_http_server_respond_json="字典类型数据 (JSON)";M.Msg.wifi_web_http_server_respond_html="网页 (HTML 代码)";M.Msg.wifi_web_http_server_respond_exec="响应";M.Msg.wifi_web_http_server_get_title="HTTP 服务器获取从客户端收到的数据,类型为";M.Msg.wifi_web_http_server_get_as_json="字典类型数据 (JSON)";M.Msg.wifi_web_http_server_get_as_text="文本";M.Msg.Esp32_Network_Http_Server_Route_TOOLTIP="當指定路徑被請求時,設定請求屬性爲%1請求,並執行操作";M.Msg.Esp32_Network_Http_Server_Route_Respond_TOOLTIP="HTTP伺服器設置響應內容,並設置返回數據類型爲%1";M.Msg.Esp32_Network_Http_Server_Get_Data_TOOLTIP="HTTP伺服器獲取從客戶端收到的數據,類型爲%1";M.Msg.internet_http_get_title="发送 HTTP GET 请求";M.Msg.internet_http_get_url="设置目标网址:";M.Msg.internet_http_post_title="发送 HTTP POST 请求";M.Msg.internet_http_post_url="设置目标网址:";M.Msg.internet_http_post_json="提交数据 (JSON):";M.Msg.Esp32_Network_Http_Get_TOOLTIP="發送http get請求";M.Msg.Esp32_Network_Http_Post_TOOLTIP="發送http post請求";M.Msg.CocoRobo_get_TOOLTIP="獲取HTTP響應內容的%1";M.Msg.internet_response_http_content_title="获取 HTTP 响应内容的";M.Msg.internet_response_text="文本";M.Msg.internet_response_content="内容";M.Msg.internet_response_status="状态码";M.Msg.internet_response_json="JSON数据";M.Msg.internet_response_encode="编码";M.Msg.internet_response_reason="原因短语";const oxe=M.Msg;var x=x||{Msg:Object.create(null)};x.Msg.catLogic="邏輯";x.Msg.catLoops="循環";x.Msg.catMath="數學";x.Msg.catText="文本";x.Msg.catVariables="變量";x.Msg.catLists="陣列";x.Msg.catDictionary="字典";x.Msg.catTuples="元組";x.Msg.catSet="集合";x.Msg.catFunctions="函數";x.Msg.catOutput="輸入/輸出";x.Msg.catFiles="變量";x.Msg.ADD_COMMENT="加入註解";x.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="無法刪除變數「%1」,因為這是功能「%2」定義的一部份內容";x.Msg.CHANGE_VALUE_TITLE="修改值:";x.Msg.CLEAN_UP="清理區塊";x.Msg.COLLAPSED_WARNINGS_WARNING="收合含有警告的區塊。";x.Msg.COLLAPSE_ALL="收合區塊";x.Msg.COLLAPSE_BLOCK="收合區塊";x.Msg.COLOUR_BLEND_COLOUR1="顏色 1";x.Msg.COLOUR_BLEND_COLOUR2="顏色 2";x.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp";x.Msg.COLOUR_BLEND_RATIO="比例";x.Msg.COLOUR_BLEND_TITLE="混合";x.Msg.COLOUR_BLEND_TOOLTIP="用一個給定的比率(0.0-1.0)混合兩種顏色。";x.Msg.COLOUR_PICKER_HELPURL="https://zh.wikipedia.org/wiki/顏色";x.Msg.COLOUR_PICKER_TOOLTIP="從調色板中選擇一種顏色。";x.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com";x.Msg.COLOUR_RANDOM_TITLE="隨機顏色";x.Msg.COLOUR_RANDOM_TOOLTIP="隨機選擇一種顏色。";x.Msg.COLOUR_RGB_BLUE="藍";x.Msg.COLOUR_RGB_GREEN="綠";x.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html";x.Msg.COLOUR_RGB_RED="紅";x.Msg.COLOUR_RGB_TITLE="顏色";x.Msg.COLOUR_RGB_TOOLTIP="透過指定紅、綠、 藍色的值來建立一種顏色。所有的值必須介於 0 和 100 之間。";x.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";x.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="中斷循環";x.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="繼續下一個循環";x.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="中斷當前的循環。";x.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="跳過這個循環的其餘步驟,並繼續下一次的循環。";x.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="警告:此區塊僅可用於循環內。";x.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";x.Msg.CONTROLS_FOREACH_TITLE="為列表 %2 裡的每一項 %1";x.Msg.CONTROLS_FOREACH_TOOLTIP="遍歷每個清單中的項目,將變數「%1」設定到該項目中,然後執行某些陳述式。";x.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";x.Msg.CONTROLS_FOR_TITLE="循環計數 %1 從 %2 到 %3 每次增加 %4";x.Msg.CONTROLS_FOR_TOOLTIP="從起始數到結尾數中取出變數「%1」的值,按指定的時間間隔,執行指定的區塊。";x.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="添加條件到「如果」區塊。";x.Msg.CONTROLS_IF_ELSE_TOOLTIP="加入一個最終、所有條件都執行的部份到「如果」區塊中。";x.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";x.Msg.CONTROLS_IF_IF_TOOLTIP="添加、刪除或重新排列各部份以重新配置這個「如果」區塊。";x.Msg.CONTROLS_IF_MSG_ELSE="否則";x.Msg.CONTROLS_IF_MSG_ELSEIF="否則,如果";x.Msg.CONTROLS_IF_MSG_IF="如果";x.Msg.CONTROLS_IF_TOOLTIP_1="當值為 true 時,執行一些陳述式。";x.Msg.CONTROLS_IF_TOOLTIP_2="值為是(true)就執行第一塊陳述式,否則執行第二塊。";x.Msg.CONTROLS_IF_TOOLTIP_3="如果第一個值為 true,則執行第一塊陳述式。否則,當第二個值為 true 時,則執行第二塊陳述式。";x.Msg.CONTROLS_IF_TOOLTIP_4="如果第一個值為 true,則執行第一塊陳述式。否則當第二個值為 true 時,則執行第二塊陳述式。如果前幾個敘述都不為 ture,則執行最後一塊陳述式。";x.Msg.CONTROLS_REPEAT_HELPURL="https://zh.wikipedia.org/wiki/For迴圈";x.Msg.CONTROLS_REPEAT_INPUT_DO="執行";x.Msg.CONTROLS_REPEAT_TITLE="重複%1次";x.Msg.CONTROLS_REPEAT_TOOLTIP="重複執行某些陳述式多次。";x.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";x.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="重複直到";x.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="重複,當";x.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="當值為 false 時,執行一些陳述式。";x.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="當值為 true 時,執行一些陳述式。";x.Msg.DELETE_ALL_BLOCKS="刪除全部 %1 個區塊?";x.Msg.DELETE_BLOCK="刪除區塊";x.Msg.DELETE_VARIABLE="刪除變數「%1」";x.Msg.DELETE_VARIABLE_CONFIRMATION="刪除使用%1次的「%2」變數?";x.Msg.DELETE_X_BLOCKS="刪除%1個區塊";x.Msg.DIALOG_CANCEL="取消";x.Msg.DIALOG_OK="確定";x.Msg.DISABLE_BLOCK="停用區塊";x.Msg.DUPLICATE_BLOCK="重複";x.Msg.DUPLICATE_COMMENT="複製註解";x.Msg.ENABLE_BLOCK="啟用區塊";x.Msg.EXPAND_ALL="展開區塊";x.Msg.EXPAND_BLOCK="展開區塊";x.Msg.EXTERNAL_INPUTS="外部輸入";x.Msg.HELP="說明";x.Msg.INLINE_INPUTS="單行輸入";x.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list";x.Msg.LISTS_CREATE_EMPTY_TITLE="建立空的清單";x.Msg.LISTS_CREATE_EMPTY_TOOLTIP="返回一個長度(項目數量)為 0 的清單,不包含任何資料記錄";x.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="清單";x.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="添加、刪除或重新排列各部份以重新配置這個清單區塊。";x.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";x.Msg.LISTS_CREATE_WITH_INPUT_WITH="使用這些值建立清單";x.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="添加一個項目到清單裡。";x.Msg.LISTS_CREATE_WITH_TOOLTIP="建立一個具備任意數量項目的清單。";x.Msg.LISTS_GET_INDEX_FIRST="第一筆";x.Msg.LISTS_GET_INDEX_FROM_END="倒數第 # 筆";x.Msg.LISTS_GET_INDEX_FROM_START="#";x.Msg.LISTS_GET_INDEX_GET="取得";x.Msg.LISTS_GET_INDEX_GET_REMOVE="取得並移除";x.Msg.LISTS_GET_INDEX_LAST="最後一筆";x.Msg.LISTS_GET_INDEX_RANDOM="隨機";x.Msg.LISTS_GET_INDEX_REMOVE="移除";x.Msg.LISTS_GET_INDEX_TAIL="";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="返回清單中的第一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="返回在清單中指定位置的項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="返回清單中的最後一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="返回清單中隨機一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="移除並返回清單中的第一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="移除並返回清單中的指定位置的項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="移除並返回清單中的最後一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="移除並返回清單中的隨機項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="移除清單中的第一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="移除在清單中指定位置的項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="移除清單中的最後一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="移除清單中隨機一個項目。";x.Msg.LISTS_GET_SUBLIST_END_FROM_END="到倒數 #";x.Msg.LISTS_GET_SUBLIST_END_FROM_START="到 #";x.Msg.LISTS_GET_SUBLIST_END_LAST="到 最後面";x.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist";x.Msg.LISTS_GET_SUBLIST_START_FIRST="從最前面取得子清單";x.Msg.LISTS_GET_SUBLIST_START_FROM_END="從倒數# 取得子清單";x.Msg.LISTS_GET_SUBLIST_START_FROM_START="從 #取得子清單";x.Msg.LISTS_GET_SUBLIST_TAIL="";x.Msg.LISTS_GET_SUBLIST_TOOLTIP="複製清單中指定的部分。";x.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1 是最後一個項目。";x.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1 是第一個項目。";x.Msg.LISTS_INDEX_OF_FIRST="從 最前面 索引項目";x.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";x.Msg.LISTS_INDEX_OF_LAST="從 最後面 索引項目";x.Msg.LISTS_INDEX_OF_TOOLTIP="在清單中檢索是否有包含項目,如果有,返回從頭/倒數算起的索引值。如果沒有則返回 %1。";x.Msg.LISTS_INLIST="自清單";x.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty";x.Msg.LISTS_ISEMPTY_TITLE="%1 值為空";x.Msg.LISTS_ISEMPTY_TOOLTIP="如果該清單為空,則返回 true。";x.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of";x.Msg.LISTS_LENGTH_TITLE="長度 %1";x.Msg.LISTS_LENGTH_TOOLTIP="返回清單的長度(項目數)。";x.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";x.Msg.LISTS_REPEAT_TITLE="使用項目 %1 重複 %2 次建立清單";x.Msg.LISTS_REPEAT_TOOLTIP="建立一個清單,項目中包含指定重複次數的值。";x.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list";x.Msg.LISTS_REVERSE_MESSAGE0="反轉%1";x.Msg.LISTS_REVERSE_TOOLTIP="反轉清單的複製內容。";x.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set";x.Msg.LISTS_SET_INDEX_INPUT_TO="為";x.Msg.LISTS_SET_INDEX_INSERT="添加";x.Msg.LISTS_SET_INDEX_SET="設定";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="添加一個項目到清單中的第一個位置。";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="添加一個項目到清單中的指定位置。";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="添加一個項目到清單中的最後一個位置。";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="添加一個項目到清單中的隨機位置。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="設定清單中的第一個項目。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="設定清單中指定位置的項目。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="設定清單中的最後一個項目。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="設定清單中隨機一個項目。";x.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";x.Msg.LISTS_SORT_ORDER_ASCENDING="升序";x.Msg.LISTS_SORT_ORDER_DESCENDING="降序";x.Msg.LISTS_SORT_TITLE="排列 %1 %2 %3";x.Msg.LISTS_SORT_TOOLTIP="排序清單的複製內容。";x.Msg.LISTS_SORT_TYPE_IGNORECASE="依字母排序,忽略大小寫";x.Msg.LISTS_SORT_TYPE_NUMERIC="依數字";x.Msg.LISTS_SORT_TYPE_TEXT="依字母";x.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";x.Msg.LISTS_SPLIT_LIST_FROM_TEXT="從文本製作清單";x.Msg.LISTS_SPLIT_TEXT_FROM_LIST="從清單拆出文本";x.Msg.LISTS_SPLIT_TOOLTIP_JOIN="串起清單項目成一個文本,並用分隔符號分開。";x.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="將文本變成清單項目,按分隔符號拆分。";x.Msg.LISTS_SPLIT_WITH_DELIMITER="用分隔符";x.Msg.LOGIC_BOOLEAN_FALSE="假";x.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";x.Msg.LOGIC_BOOLEAN_TOOLTIP="返回真或假。";x.Msg.LOGIC_BOOLEAN_TRUE="真";x.Msg.LOGIC_COMPARE_HELPURL="https://zh.wikipedia.org/wiki/不等";x.Msg.LOGIC_COMPARE_TOOLTIP_EQ="如果這兩個輸入的結果相等,返回 true。";x.Msg.LOGIC_COMPARE_TOOLTIP_GT="如果第一個輸入結果大於第二個,返回 true。";x.Msg.LOGIC_COMPARE_TOOLTIP_GTE="如果第一個輸入結果大於或等於第二個,返回 true。";x.Msg.LOGIC_COMPARE_TOOLTIP_LT="如果第一個輸入結果比第二個小,返回 true。";x.Msg.LOGIC_COMPARE_TOOLTIP_LTE="如果第一個輸入結果小於或等於第二個,返回 true。";x.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="如果這兩個輸入的結果不相等,返回 true。";x.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";x.Msg.LOGIC_NEGATE_TITLE="%1 不成立";x.Msg.LOGIC_NEGATE_TOOLTIP="如果輸入結果是 false,則返回 true。如果輸入結果是 true,則返回 false。";x.Msg.LOGIC_NULL="空";x.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";x.Msg.LOGIC_NULL_TOOLTIP="返回空值。";x.Msg.LOGIC_OPERATION_AND="和";x.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";x.Msg.LOGIC_OPERATION_OR="或";x.Msg.LOGIC_OPERATION_TOOLTIP_AND="如果兩個輸入結果都為 true,則返回 true。";x.Msg.LOGIC_OPERATION_TOOLTIP_OR="如果至少一個輸入結果為 true,返回 true。";x.Msg.LOGIC_TERNARY_CONDITION="測試";x.Msg.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:";x.Msg.LOGIC_TERNARY_IF_FALSE="如果為假";x.Msg.LOGIC_TERNARY_IF_TRUE="如果為真";x.Msg.LOGIC_TERNARY_TOOLTIP="檢查「測試」中的條件。如果條件為真,將返回「如果為真」的值;否則,返回「如果為假」的值。";x.Msg.MATH_ADDITION_SYMBOL="+";x.Msg.MATH_ARITHMETIC_HELPURL="https://zh.wikipedia.org/wiki/算術";x.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="返回兩個數字的總和。";x.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="傳回兩數之商。";x.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="傳回兩數之差。";x.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="返回兩個數字的乘積。";x.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="返回以第一個數值為底數,以第二個數值為冪的結果。";x.Msg.MATH_ATAN2_HELPURL="https://zh.wikipedia.org/wiki/Atan2";x.Msg.MATH_ATAN2_TITLE="X:%1 Y:%2 的 Atan2";x.Msg.MATH_ATAN2_TOOLTIP="回傳點(X,Y)從 -180 至 180 度的反正切值。";x.Msg.MATH_CHANGE_HELPURL="https://zh.wikipedia.org/wiki/加法";x.Msg.MATH_CHANGE_TITLE="修改 %1 自 %2";x.Msg.MATH_CHANGE_TOOLTIP="將數字加到變數「%1」。";x.Msg.MATH_CONSTANT_HELPURL="https://zh.wikipedia.org/wiki/數學常數";x.Msg.MATH_CONSTANT_TOOLTIP="返回一個的常見常量: π (3.141......),e (2.718...)、 φ (1.618...)、 開方(2) (1.414......)、 開方(½) (0.707......) 或 ∞ (無窮大)。";x.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)";x.Msg.MATH_CONSTRAIN_TITLE="限制數字 %1 介於(低)%2 到(高)%3";x.Msg.MATH_CONSTRAIN_TOOLTIP="限制數字介於兩個指定的數字之間(包含)。";x.Msg.MATH_DIVISION_SYMBOL="÷";x.Msg.MATH_IS_DIVISIBLE_BY="可被整除";x.Msg.MATH_IS_EVEN="是偶數";x.Msg.MATH_IS_NEGATIVE="是負數";x.Msg.MATH_IS_ODD="是奇數";x.Msg.MATH_IS_POSITIVE="是正值";x.Msg.MATH_IS_PRIME="是質數";x.Msg.MATH_IS_TOOLTIP="如果數字是偶數,奇數,非負整數,正數、 負數,或如果它是可被某數字整除,則返回 true 或 false。";x.Msg.MATH_IS_WHOLE="是整數";x.Msg.MATH_MODULO_HELPURL="https://zh.wikipedia.org/wiki/模除";x.Msg.MATH_MODULO_TITLE="%1 除以 %2 的餘數";x.Msg.MATH_MODULO_TOOLTIP="返回兩個數字相除的餘數。";x.Msg.MATH_MULTIPLICATION_SYMBOL="×";x.Msg.MATH_NUMBER_HELPURL="https://zh.wikipedia.org/wiki/數";x.Msg.MATH_NUMBER_TOOLTIP="數字";x.Msg.MATH_ONLIST_HELPURL="";x.Msg.MATH_ONLIST_OPERATOR_AVERAGE="清單的平均數";x.Msg.MATH_ONLIST_OPERATOR_MAX="清單的最大數字";x.Msg.MATH_ONLIST_OPERATOR_MEDIAN="清單的中位數";x.Msg.MATH_ONLIST_OPERATOR_MIN="清單的最小數字";x.Msg.MATH_ONLIST_OPERATOR_MODE="清單中的眾數";x.Msg.MATH_ONLIST_OPERATOR_RANDOM="清單中的隨機一項";x.Msg.MATH_ONLIST_OPERATOR_STD_DEV="清單的標準差";x.Msg.MATH_ONLIST_OPERATOR_SUM="清單中數值的和";x.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="返回清單中數值的平均值(算術平均值)。";x.Msg.MATH_ONLIST_TOOLTIP_MAX="返回清單中最大的數字。";x.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="返回清單中數值的中位數。";x.Msg.MATH_ONLIST_TOOLTIP_MIN="返回清單中最小的數字。";x.Msg.MATH_ONLIST_TOOLTIP_MODE="返回一個清單中的最常見的項目列表。";x.Msg.MATH_ONLIST_TOOLTIP_RANDOM="從清單中返回一個隨機的項目。";x.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="返回清單中數字的標準差。";x.Msg.MATH_ONLIST_TOOLTIP_SUM="返回清單中的所有數字的總和。";x.Msg.MATH_POWER_SYMBOL="^";x.Msg.MATH_RANDOM_FLOAT_HELPURL="https://zh.wikipedia.org/wiki/隨機數生成器";x.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="隨機取分數";x.Msg.MATH_RANDOM_FLOAT_TOOLTIP="在 0.0(包含)和 1.0(不包含)之間隨機取一個分數。";x.Msg.MATH_RANDOM_INT_HELPURL="https://zh.wikipedia.org/wiki/隨機數生成器";x.Msg.MATH_RANDOM_INT_TITLE="隨機取整數 %1 到 %2";x.Msg.MATH_RANDOM_INT_TOOLTIP="在指定二個數之間隨機取一個整數(包含)。";x.Msg.MATH_ROUND_HELPURL="https://zh.wikipedia.org/wiki/數值簡化";x.Msg.MATH_ROUND_OPERATOR_ROUND="四捨五入";x.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="無條件捨去";x.Msg.MATH_ROUND_OPERATOR_ROUNDUP="無條件進位";x.Msg.MATH_ROUND_TOOLTIP="上捨入或下捨入數字";x.Msg.MATH_SINGLE_HELPURL="https://zh.wikipedia.org/wiki/平方根";x.Msg.MATH_SINGLE_OP_ABSOLUTE="絕對值";x.Msg.MATH_SINGLE_OP_ROOT="開根號";x.Msg.MATH_SINGLE_TOOLTIP_ABS="返回指定數字的絕對值。";x.Msg.MATH_SINGLE_TOOLTIP_EXP="返回e的指定數字次冪。";x.Msg.MATH_SINGLE_TOOLTIP_LN="返回指定數字的自然對數。";x.Msg.MATH_SINGLE_TOOLTIP_LOG10="返回指定數字的對數。";x.Msg.MATH_SINGLE_TOOLTIP_NEG="返回指定數字的相反數。";x.Msg.MATH_SINGLE_TOOLTIP_POW10="返回10的指定數字次冪。";x.Msg.MATH_SINGLE_TOOLTIP_ROOT="返回指定數字的平方根。";x.Msg.MATH_SUBTRACTION_SYMBOL="-";x.Msg.MATH_TRIG_ACOS="反餘弦";x.Msg.MATH_TRIG_ASIN="反正弦";x.Msg.MATH_TRIG_ATAN="反正切";x.Msg.MATH_TRIG_COS="餘弦";x.Msg.MATH_TRIG_HELPURL="https://zh.wikipedia.org/wiki/三角函數";x.Msg.MATH_TRIG_SIN="正弦";x.Msg.MATH_TRIG_TAN="正切";x.Msg.MATH_TRIG_TOOLTIP_ACOS="返回指定數字的反餘弦值。";x.Msg.MATH_TRIG_TOOLTIP_ASIN="返回指定角度的反正弦值(非弧度)。";x.Msg.MATH_TRIG_TOOLTIP_ATAN="返回指定數字的反正切值。";x.Msg.MATH_TRIG_TOOLTIP_COS="返回指定角度的餘弦值(非弧度)。";x.Msg.MATH_TRIG_TOOLTIP_SIN="返回指定角度的正弦值(非弧度)。";x.Msg.MATH_TRIG_TOOLTIP_TAN="返回指定角度的正切值(非弧度)。";x.Msg.NEW_COLOUR_VARIABLE="建立顏色變數…";x.Msg.NEW_NUMBER_VARIABLE="建立數值變數……";x.Msg.NEW_STRING_VARIABLE="建立字串變數……";x.Msg.NEW_VARIABLE="建立變數…";x.Msg.NEW_VARIABLE_TYPE_TITLE="新變數類型:";x.Msg.ORDINAL_NUMBER_SUFFIX="";x.Msg.PROCEDURES_ALLOW_STATEMENTS="允許陳述式";x.Msg.PROCEDURES_BEFORE_PARAMS="與:";x.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程式";x.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="執行使用者定義的函式「%1」。";x.Msg.PROCEDURES_CALLRETURN_HELPURL="https://zh.wikipedia.org/wiki/%E5%AD%90%E7%A8%8B%E5%BA%8F";x.Msg.PROCEDURES_CALLRETURN_TOOLTIP="執行使用者定義的函式「%1」,並使用它的回傳值。";x.Msg.PROCEDURES_CALL_BEFORE_PARAMS="與:";x.Msg.PROCEDURES_CREATE_DO="建立「%1」";x.Msg.PROCEDURES_DEFNORETURN_COMMENT="描述此函式...";x.Msg.PROCEDURES_DEFNORETURN_DO="";x.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程式";x.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="做些什麼";x.Msg.PROCEDURES_DEFNORETURN_TITLE="到";x.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="創建一個無回傳值的函式。";x.Msg.PROCEDURES_DEFRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程式";x.Msg.PROCEDURES_DEFRETURN_RETURN="返回";x.Msg.PROCEDURES_DEFRETURN_TOOLTIP="創建一個有回傳值的的函式。";x.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="警告: 此函式中有重複的參數。";x.Msg.PROCEDURES_HIGHLIGHT_DEF="反白顯示函式定義";x.Msg.PROCEDURES_IFRETURN_HELPURL="https://c2.com/cgi/wiki?GuardClause";x.Msg.PROCEDURES_IFRETURN_TOOLTIP="如果值為 true,則返回第二個值。";x.Msg.PROCEDURES_IFRETURN_WARNING="警告:這個區塊只可以在定義函式時使用。";x.Msg.PROCEDURES_MUTATORARG_TITLE="輸入名稱:";x.Msg.PROCEDURES_MUTATORARG_TOOLTIP="添加一個輸入區塊到函式。";x.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="輸入";x.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="添加、刪除或重新排列此函式的輸入。";x.Msg.REDO="重做";x.Msg.REMOVE_COMMENT="移除註解";x.Msg.RENAME_VARIABLE="重新命名變數...";x.Msg.RENAME_VARIABLE_TITLE="將所有「%1」變數重新命名為:";x.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";x.Msg.TEXT_APPEND_TITLE="至 %1 套用文字 %2";x.Msg.TEXT_APPEND_TOOLTIP="添加一些文字到變數「%1」之後。";x.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";x.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="轉成英文小寫";x.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="轉成英文首字大寫";x.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="轉成英文大寫";x.Msg.TEXT_CHANGECASE_TOOLTIP="使用不同的大小寫複製這段文字。";x.Msg.TEXT_CHARAT_FIRST="擷取首字元";x.Msg.TEXT_CHARAT_FROM_END="取得倒數第#字元";x.Msg.TEXT_CHARAT_FROM_START="取得 字元 #";x.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";x.Msg.TEXT_CHARAT_LAST="取得 最後一個字元";x.Msg.TEXT_CHARAT_RANDOM="取得 任意字元";x.Msg.TEXT_CHARAT_TAIL="";x.Msg.TEXT_CHARAT_TITLE="在文字 %1 %2";x.Msg.TEXT_CHARAT_TOOLTIP="返回位於指定位置的字元。";x.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings";x.Msg.TEXT_COUNT_MESSAGE0="計算%1在%2裡出現的次數";x.Msg.TEXT_COUNT_TOOLTIP="計算在一段文本中,某個部分文本重複出現了多少次。";x.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="添加一個項目到字串中。";x.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="加入";x.Msg.TEXT_CREATE_JOIN_TOOLTIP="添加、刪除或重新排列各部份以重新配置這個文字區塊。";x.Msg.TEXT_GET_SUBSTRING_END_FROM_END="到倒數第#字元";x.Msg.TEXT_GET_SUBSTRING_END_FROM_START="到 字元 #";x.Msg.TEXT_GET_SUBSTRING_END_LAST="到尾字元";x.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";x.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="在字串";x.Msg.TEXT_GET_SUBSTRING_START_FIRST="取得首字元";x.Msg.TEXT_GET_SUBSTRING_START_FROM_END="取得 倒數第 # 個字元";x.Msg.TEXT_GET_SUBSTRING_START_FROM_START="取得 字元 #";x.Msg.TEXT_GET_SUBSTRING_TAIL="";x.Msg.TEXT_GET_SUBSTRING_TOOLTIP="返回指定的部分文字。";x.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";x.Msg.TEXT_INDEXOF_OPERATOR_FIRST="從 最前面 索引字串";x.Msg.TEXT_INDEXOF_OPERATOR_LAST="從 最後面 索引字串";x.Msg.TEXT_INDEXOF_TITLE="在文字 %1 %2 %3";x.Msg.TEXT_INDEXOF_TOOLTIP="在字串1中檢索是否有包含字串2,如果有,返回從頭/倒數算起的索引值。如果沒有則返回 %1。";x.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";x.Msg.TEXT_ISEMPTY_TITLE="%1 為空";x.Msg.TEXT_ISEMPTY_TOOLTIP="如果提供的字串為空,則返回 true。";x.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";x.Msg.TEXT_JOIN_TITLE_CREATEWITH="字串組合";x.Msg.TEXT_JOIN_TOOLTIP="通過連接任意數量的項目來建立一串文字。";x.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";x.Msg.TEXT_LENGTH_TITLE="%1的長度";x.Msg.TEXT_LENGTH_TOOLTIP="返回這串文字的字元數(包含空格)。";x.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";x.Msg.TEXT_PRINT_TITLE="輸出 %1";x.Msg.TEXT_PRINT_TOOLTIP="輸出指定的文字、 數字或其他值。";x.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";x.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="要求用戶輸入數字";x.Msg.TEXT_PROMPT_TOOLTIP_TEXT="要求用戶輸入文字";x.Msg.TEXT_PROMPT_TYPE_NUMBER="要求輸入數字,並顯示提示訊息";x.Msg.TEXT_PROMPT_TYPE_TEXT="要求輸入文字,並顯示提示訊息";x.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings";x.Msg.TEXT_REPLACE_MESSAGE0="在%3以%2取代%1";x.Msg.TEXT_REPLACE_TOOLTIP="取代在內容裡的全部某些文字。";x.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text";x.Msg.TEXT_REVERSE_MESSAGE0="反轉%1";x.Msg.TEXT_REVERSE_TOOLTIP="反轉排序在文字裡的字元。";x.Msg.TEXT_TEXT_HELPURL="https://zh.wikipedia.org/wiki/字串";x.Msg.TEXT_TEXT_TOOLTIP="一粒字元、一個字詞或一行字";x.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";x.Msg.TEXT_TRIM_OPERATOR_BOTH="消除兩側空格";x.Msg.TEXT_TRIM_OPERATOR_LEFT="消除左側空格";x.Msg.TEXT_TRIM_OPERATOR_RIGHT="消除右側空格";x.Msg.TEXT_TRIM_TOOLTIP="複製這段文字,同時刪除兩端多餘的空格。";x.Msg.TODAY="今天";x.Msg.UNDO="還原";x.Msg.UNNAMED_KEY="未命名";x.Msg.VARIABLES_DEFAULT_NAME="項目";x.Msg.VARIABLES_GET_CREATE_SET="建立「賦值 %1」";x.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";x.Msg.VARIABLES_GET_TOOLTIP="返回此變數的值。";x.Msg.VARIABLES_SET="賦值 %1 成 %2";x.Msg.VARIABLES_SET_CREATE_GET="建立「取得 %1」";x.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";x.Msg.VARIABLES_SET_TOOLTIP="設定此變數,好和輸入結果相等。";x.Msg.VARIABLE_ALREADY_EXISTS="已存在變數「%1」。";x.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="已存在名為「%1」,且用於其它類型「%2」的變數。";x.Msg.WORKSPACE_ARIA_LABEL="Blockly工作區";x.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="來說些事情...";x.Msg.CONTROLS_FOREACH_INPUT_DO=x.Msg.CONTROLS_REPEAT_INPUT_DO;x.Msg.CONTROLS_FOR_INPUT_DO=x.Msg.CONTROLS_REPEAT_INPUT_DO;x.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=x.Msg.CONTROLS_IF_MSG_ELSEIF;x.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=x.Msg.CONTROLS_IF_MSG_ELSE;x.Msg.CONTROLS_IF_IF_TITLE_IF=x.Msg.CONTROLS_IF_MSG_IF;x.Msg.CONTROLS_IF_MSG_THEN=x.Msg.CONTROLS_REPEAT_INPUT_DO;x.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=x.Msg.CONTROLS_REPEAT_INPUT_DO;x.Msg.LISTS_CREATE_WITH_ITEM_TITLE=x.Msg.VARIABLES_DEFAULT_NAME;x.Msg.LISTS_GET_INDEX_HELPURL=x.Msg.LISTS_INDEX_OF_HELPURL;x.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=x.Msg.LISTS_INLIST;x.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=x.Msg.LISTS_INLIST;x.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=x.Msg.LISTS_INLIST;x.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=x.Msg.LISTS_INLIST;x.Msg.MATH_CHANGE_TITLE_ITEM=x.Msg.VARIABLES_DEFAULT_NAME;x.Msg.PROCEDURES_DEFRETURN_COMMENT=x.Msg.PROCEDURES_DEFNORETURN_COMMENT;x.Msg.PROCEDURES_DEFRETURN_DO=x.Msg.PROCEDURES_DEFNORETURN_DO;x.Msg.PROCEDURES_DEFRETURN_PROCEDURE=x.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;x.Msg.PROCEDURES_DEFRETURN_TITLE=x.Msg.PROCEDURES_DEFNORETURN_TITLE;x.Msg.TEXT_APPEND_VARIABLE=x.Msg.VARIABLES_DEFAULT_NAME;x.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=x.Msg.VARIABLES_DEFAULT_NAME;x.Msg.MATH_HUE="230";x.Msg.LOOPS_HUE="120";x.Msg.LISTS_HUE="260";x.Msg.LOGIC_HUE="210";x.Msg.VARIABLES_HUE="330";x.Msg.TEXTS_HUE="160";x.Msg.PROCEDURES_HUE="290";x.Msg.COLOUR_HUE="20";x.Msg.VARIABLES_DYNAMIC_HUE="310";x.Msg.TEXT_IS_NUMBER_HELPURL="";x.Msg.TEXT_IS_NUMBER_TOOLTIP="判斷文本%1,並返回True或False";x.Msg.TEXT_IS_NUMBER_MESSAGE0="%1 %2";x.Msg.TEXT_IS_DIGIT="是數字";x.Msg.TEXT_IS_ALPHA="是字母";x.Msg.TEXT_IS_ALNUM="是數字和字母的組合";x.Msg.TEXT_LIST_START="初始化陣列 [";x.Msg.TEXT_LIST_END="]";x.Msg.TEXT_TUPLE_START="初始化元組 (";x.Msg.TEXT_TUPLE_END=")";x.Msg.TEXT_DICT_START="初始化字典 {";x.Msg.TEXT_DICT_END="}";x.Msg.TEXT_SET_START="初始化集合 {";x.Msg.TEXT_SET_END="}";x.Msg.TEXT_SET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/index.html";x.Msg.ADD_COMMENT="添加註釋";x.Msg.CHANGE_VALUE_TITLE="更改值:";x.Msg.CLEAN_UP="整理塊";x.Msg.COLLAPSE_ALL="折疊塊";x.Msg.COLLAPSE_BLOCK="折疊塊";x.Msg.COLOUR_BLEND_COLOUR1="顏色1";x.Msg.COLOUR_BLEND_COLOUR2="顏色2";x.Msg.COLOUR_BLEND_HELPURL="http://meyerweb.com/eric/tools/color-blend/";x.Msg.COLOUR_BLEND_RATIO="比例";x.Msg.COLOUR_BLEND_TITLE="混合";x.Msg.COLOUR_BLEND_TOOLTIP="用一個給定的比率(0.0-1.0)混合兩種顏色。";x.Msg.COLOUR_PICKER_HELPURL="https://zh.wikipedia.org/wiki/顏色";x.Msg.COLOUR_PICKER_TOOLTIP="從調色板中選擇壹種顏色。";x.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com";x.Msg.COLOUR_RANDOM_TITLE="隨機顏色";x.Msg.COLOUR_RANDOM_TOOLTIP="隨機選擇壹種顏色。";x.Msg.COLOUR_RGB_BLUE="藍色";x.Msg.COLOUR_RGB_GREEN="綠色";x.Msg.COLOUR_RGB_HELPURL="http://www.december.com/html/spec/colorper.html";x.Msg.COLOUR_RGB_RED="紅色";x.Msg.COLOUR_RGB_TITLE="顏色";x.Msg.COLOUR_RGB_TOOLTIP="透過指定紅色、綠色和藍色的量創建壹種顏色。所有的值必須介於0和100之間。";x.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";x.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="中斷循環";x.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="繼續下一次循環";x.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="中斷包含它的循環。";x.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="跳過這個循環的剩余部分,並繼續下一次疊代。";x.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="警告:此塊僅可用於在一個循環內。";x.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";x.Msg.CONTROLS_FOREACH_TITLE="在陣列 %2 中以 %1 遍歷每個項目";x.Msg.CONTROLS_FOREACH_TOOLTIP="遍歷每個陣列中的項目,將變量“%1”設定到該項中,然後執行某些語句。";x.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";x.Msg.CONTROLS_FOR_TITLE="使用 %1 從範圍 %2 到 %3 每隔 %4";x.Msg.CONTROLS_FOR_TOOLTIP="從起始數到結尾數中取出變量“%1”的值,按指定的時間間隔,執行指定的塊。";x.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="在if語句塊中增加一個條件。";x.Msg.CONTROLS_IF_ELSE_TOOLTIP="添加一個最終的,包括所有情況的節到if塊中。";x.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";x.Msg.TRY_EXCEPT_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/index.html";x.Msg.CONTROLS_IF_IF_TOOLTIP="增加、刪除或重新排列各節來重新配置“if”塊。";x.Msg.CONTROLS_IF_MSG_ELSE="否則";x.Msg.CONTROLS_IF_MSG_ELSEIF="否則如果";x.Msg.TRY_EXCEPT_FINALLY="最後";x.Msg.TRY_EXCEPT_FINALLY_TOOLTIP="";x.Msg.TRY_EXCEPT_EXCEPT="除了";x.Msg.TRY_EXCEPT_EXCEPT_TOOLTIP="";x.Msg.TRY_EXCEPT_TRY="嘗試";x.Msg.TRY_EXCEPT_TRY_TOOLTIP="";x.Msg.CONTROLS_IF_MSG_IF="如果";x.Msg.CONTROLS_IF_TOOLTIP_1="如果值為真,執行壹些語句。";x.Msg.CONTROLS_IF_TOOLTIP_2="如果值為真,則執行首個塊語句。否則,則執行第二塊語句。";x.Msg.CONTROLS_IF_TOOLTIP_3="如果首個值為真,則執行首個塊的語句。否則,如果第二個值為真,則執行第二塊的語句。";x.Msg.CONTROLS_IF_TOOLTIP_4="如果首個值為真,則執行首個塊對語句。否則,如果第二個值為真,則執行語句的第二塊。如果沒有值為真,則執行最後壹塊的語句。";x.Msg.CONTROLS_REPEAT_FOREVER="一直重複";x.Msg.CONTROLS_REPEAT_FOREVER_TOOLTIP="壹直執行壹些語句。";x.Msg.CONTROLS_REPEAT_HELPURL="https://zh.wikipedia.org/wiki/For循環";x.Msg.CONTROLS_REPEAT_INPUT_DO="執行";x.Msg.CONTROLS_REPEAT_TITLE="重複 %1 次";x.Msg.CONTROLS_REPEAT_TOOLTIP="多次執行壹些語句。";x.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";x.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="重複直到";x.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="重複當";x.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="只要值為假,執行壹些語句。";x.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="只要值為真,執行壹些語句。";x.Msg.DELETE_ALL_BLOCKS="刪除所有%1塊嗎?";x.Msg.DELETE_BLOCK="刪除塊";x.Msg.DELETE_VARIABLE="刪除“%1”變量";x.Msg.DELETE_VARIABLE_CONFIRMATION="刪除“%2”變量的%1種用途麼?";x.Msg.DELETE_X_BLOCKS="刪除塊";x.Msg.DISABLE_BLOCK="禁用塊";x.Msg.DUPLICATE_BLOCK="復制";x.Msg.ENABLE_BLOCK="啟用塊";x.Msg.EXPAND_ALL="展開塊";x.Msg.EXPAND_BLOCK="展開塊";x.Msg.EXTERNAL_INPUTS="多欄輸入";x.Msg.HELP="幫助";x.Msg.INLINE_INPUTS="單欄輸入";x.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list";x.Msg.LISTS_CREATE_EMPTY_TITLE="創建空陣列";x.Msg.TUPLE_CREATE_EMPTY_TITLE="創建空元組";x.Msg.DICT_CREATE_EMPTY_TITLE="創建空字典";x.Msg.SET_CREATE_EMPTY_TITLE="創建空集合";x.Msg.LISTS_CREATE_EMPTY_TOOLTIP="返回一個陣列,長度為 0,不包含任何數據記錄";x.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="陣列";x.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD="元組";x.Msg.DICT_CREATE_WITH_CONTAINER_TITLE_ADD="字典";x.Msg.SET_CREATE_WITH_CONTAINER_TITLE_ADD="集合";x.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="增加、刪除或重新排列各部分以此重新配置這個陣列塊。";x.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP="增加、刪除或重新排列各部分以此重新配置這個元組塊。";x.Msg.DICT_CREATE_WITH_CONTAINER_TOOLTIP="增加、刪除或重新排列各部分以此重新配置這個字典塊。";x.Msg.SET_CREATE_WITH_CONTAINER_TOOLTIP="增加、刪除或重新排列各部分以此重新配置這個集合塊。";x.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";x.Msg.LISTS_CREATE_WITH_INPUT_WITH="初始化陣列";x.Msg.TUPLE_CREATE_WITH_INPUT_WITH="初始化元組";x.Msg.DICT_CREATE_WITH_INPUT_WITH="初始化字典";x.Msg.SET_CREATE_WITH_INPUT_WITH="初始化集合";x.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="將一個項添加到陣列中。";x.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP="將一個項添加到元組中。";x.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP="將一個項添加到字典中。";x.Msg.SET_CREATE_WITH_ITEM_TOOLTIP="將一個項添加到集合中。";x.Msg.LISTS_CREATE_WITH_TOOLTIP="建立一個具有任意數量項目的陣列。";x.Msg.LISTS_GET_INDEX_FIRST="首個";x.Msg.LISTS_GET_INDEX_FROM_END="倒數第";x.Msg.LISTS_GET_INDEX_FROM_START="第";x.Msg.LISTS_GET_INDEX_GET="獲得";x.Msg.LISTS_GET_INDEX_GET_REMOVE="取出並移除";x.Msg.LISTS_GET_INDEX_LAST="最後";x.Msg.LISTS_GET_INDEX_RANDOM="隨機";x.Msg.LISTS_GET_INDEX_REMOVE="移除";x.Msg.LISTS_POP_HELPURL="";x.Msg.LISTS_POP_TOOLTIP="";x.Msg.LISTS_POP_MESSAGE0="在陣列 %1 中移除 %2 項";x.Msg.LISTS_GET_INDEX_TAIL="";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="返回陣列中的首個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="返回在陣列中的指定位置的項。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="返回陣列中的最後壹項。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="隨機返回陣列中的一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="移除並返回陣列中的首個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="移除並返回陣列中的指定位置的項。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="移除並返回陣列中的最後一個項目。";x.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="移除並返回陣列中的一個隨機項目中。";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="移除陣列中的首個項";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="移除在陣列中的指定位置的項。";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="移除陣列中的最後壹項";x.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="刪除陣列中的一個隨機的項。";x.Msg.LISTS_GET_SUBLIST_END_FROM_END="到倒數第#";x.Msg.LISTS_GET_SUBLIST_END_FROM_START="到#";x.Msg.LISTS_GET_SUBLIST_END_LAST="到最後";x.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist";x.Msg.LISTS_GET_SUBLIST_START_FIRST="從頭獲得子陣列";x.Msg.LISTS_GET_SUBLIST_START_FROM_END="從倒數#取得子陣列";x.Msg.LISTS_GET_SUBLIST_START_FROM_START="從#取得子陣列";x.Msg.LISTS_GET_SUBLIST_TAIL="";x.Msg.LISTS_GET_SUBLIST_TOOLTIP="復制陣列中指定的部分。";x.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1是最後壹項。";x.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1是首個項目。";x.Msg.LISTS_INDEX_OF_FIRST="找出首個項出現";x.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";x.Msg.LISTS_INDEX_OF_LAST="找出最後一個項出現";x.Msg.LISTS_INDEX_OF_TOOLTIP="返回在陣列中的首個/最後一個匹配項的索引值。如果找不到項目則返回0";x.Msg.LISTS_INLIST="在陣列中";x.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty";x.Msg.LISTS_ISEMPTY_TITLE="%1是空的";x.Msg.LISTS_ISEMPTY_TOOLTIP="如果改陣列為空,則返回真。";x.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of";x.Msg.LISTS_LENGTH_TITLE="%1的長度";x.Msg.LISTS_LENGTH_TOOLTIP="返回陣列的長度。";x.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";x.Msg.LISTS_REPEAT_TITLE="建立陣列 項 %1 重複 %2 次";x.Msg.LISTS_REPEAT_TOOLTIP="建立包含指定重複次數的值的陣列。";x.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set";x.Msg.LISTS_SET_INDEX_INPUT_TO="為";x.Msg.LISTS_SET_INDEX_INSERT="插入在";x.Msg.LISTS_SET_INDEX_SET="設置";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="在陣列的起始處添加該項。";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="插入在陣列中指定位置的項。";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="將該項追加到陣列的末尾。";x.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="在陣列中隨機插入項。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="設置陣列中的首個項目。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="設置在陣列中指定位置的項。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="設置陣列中的最後壹項。";x.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="設置陣列中一個隨機的項目。";x.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";x.Msg.LISTS_SORT_ORDER_ASCENDING="升序";x.Msg.LISTS_SORT_ORDER_DESCENDING="降序";x.Msg.LISTS_SORT_TITLE="排序%1 %2 %3";x.Msg.LISTS_SORT_TOOLTIP="排序一個陣列的拷貝。";x.Msg.LISTS_SORT_TYPE_IGNORECASE="按字母排序,忽略大小寫";x.Msg.LISTS_SORT_TYPE_NUMERIC="按數字排序";x.Msg.LISTS_SORT_TYPE_TEXT="按字母排序";x.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";x.Msg.LISTS_SPLIT_LIST_FROM_TEXT="從文本制作陣列";x.Msg.LISTS_SPLIT_TEXT_FROM_LIST="從陣列組合文本";x.Msg.LISTS_SPLIT_TOOLTIP_JOIN="加入文本陣列至一個文本,由分隔符分隔。";x.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="拆分文本到文本陣列,按每個分隔符拆分。";x.Msg.LISTS_SPLIT_WITH_DELIMITER="用分隔符";x.Msg.LOGIC_BOOLEAN_FALSE="假";x.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";x.Msg.LOGIC_BOOLEAN_TOOLTIP="返回真或假。";x.Msg.LOGIC_BOOLEAN_TRUE="真";x.Msg.LOGIC_COMPARE_HELPURL="https://zh.wikipedia.org/wiki/不等";x.Msg.LOGIC_COMPARE_TOOLTIP_EQ="如果兩個輸入結果相等,則返回真。";x.Msg.LOGIC_COMPARE_TOOLTIP_GT="如果首個輸入結果比第二個大,則返回真。";x.Msg.LOGIC_COMPARE_TOOLTIP_GTE="如果首個輸入結果大於或等於第二個輸入結果,則返回真。";x.Msg.LOGIC_COMPARE_TOOLTIP_LT="如果首個輸入結果比第二個小,則返回真。";x.Msg.LOGIC_COMPARE_TOOLTIP_LTE="如果首個輸入結果小於或等於第二個輸入結果,則返回真。";x.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="如果兩個輸入結果不相等,則返回真。";x.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";x.Msg.LOGIC_NEGATE_TITLE="非%1";x.Msg.LOGIC_NEGATE_TOOLTIP="如果輸入結果為假,則返回真;如果輸入結果為真,則返回假。";x.Msg.LOGIC_NULL="空";x.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";x.Msg.LOGIC_NULL_TOOLTIP="返回空值。";x.Msg.LOGIC_OPERATION_AND="和";x.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";x.Msg.LOGIC_OPERATION_OR="或";x.Msg.LOGIC_OPERATION_TOOLTIP_AND="如果兩個輸入結果都為真,則返回真。";x.Msg.LOGIC_OPERATION_TOOLTIP_OR="如果至少有一個輸入結果為真,則返回真。";x.Msg.LOGIC_TERNARY_CONDITION="測試";x.Msg.LOGIC_TERNARY_HELPURL="https://zh.wikipedia.org/wiki/條件運算符";x.Msg.LOGIC_TERNARY_IF_FALSE="如果為假";x.Msg.LOGIC_TERNARY_IF_TRUE="如果為真";x.Msg.LOGIC_TERNARY_TOOLTIP="檢查“test”中的條件。如果條件為真,則返回“if true”的值,否則,則返回“if false”的值。";x.Msg.MATH_ADDITION_SYMBOL="+";x.Msg.MATH_ARITHMETIC_HELPURL="https://zh.wikipedia.org/wiki/算術";x.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="返回兩個數字的和。";x.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="返回兩個數字的商。";x.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="返回兩個數字的區別。";x.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="返回兩個數字的乘積。";x.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="返回首個數的第二個數次方。";x.Msg.MATH_CHANGE_HELPURL="https://zh.wikipedia.org/wiki/%E5%8A%A0%E6%B3%95";x.Msg.MATH_CHANGE_TITLE="將變量 %1 的值增加 %2";x.Msg.MATH_CHANGE_TOOLTIP="將一個數添加到變量“%1”。";x.Msg.MATH_CONSTANT_HELPURL="https://zh.wikipedia.org/wiki/數學常數";x.Msg.MATH_CONSTANT_TOOLTIP="返回一個常見常量:π (3.141......),e (2.718...)、φ (1.618...)、 sqrt(2) (1.414......)、sqrt(½) (0.707......)或 ∞(無窮大)。";x.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_%28graphics%29";x.Msg.MATH_CONSTRAIN_TITLE="限制數字 %1 介於 (低) %2 到 (高) %3";x.Msg.MATH_CONSTRAIN_TOOLTIP="限制數字介於兩個指定的數字之間";x.Msg.MATH_CONVERT_HELPURL="";x.Msg.MATH_CONVERT_MESSAGE0="%1 %2";x.Msg.MATH_CONVERT_TOOLTIP="強制轉換數據類型";x.Msg.MATH_DIVISION_CONSULT_HELPURL="";x.Msg.MATH_DIVISION_CONSULT_TITLE="%1 ÷ %2 商的整數部分";x.Msg.MATH_DIVISION_CONSULT_TOOLTIP="返回兩數商的整數部分";x.Msg.MATH_DIVISION_SYMBOL="÷";x.Msg.MATH_IS_DIVISIBLE_BY="可被整除";x.Msg.MATH_IS_EVEN="是偶數";x.Msg.MATH_IS_NEGATIVE="為負";x.Msg.MATH_IS_ODD="是奇數";x.Msg.MATH_IS_POSITIVE="為正";x.Msg.MATH_IS_PRIME="是質數";x.Msg.MATH_IS_TOOLTIP="如果數字是偶數、奇數、非負整數、正數、負數或如果它可被某數字整除,則返回真或假。";x.Msg.MATH_IS_WHOLE="為整數";x.Msg.MATH_MODULO_HELPURL="https://zh.wikipedia.org/wiki/模除";x.Msg.MATH_MODULO_TITLE="%1 ÷ %2 的餘數";x.Msg.MATH_MODULO_TOOLTIP="返回這兩個數字相除後的餘數。";x.Msg.MATH_MULTIPLICATION_SYMBOL="×";x.Msg.MATH_NUMBER_BITS_OPS_HELPURL="";x.Msg.MATH_NUMBER_BITS_OPS_MESSAGE0="%1 %2 %3";x.Msg.MATH_NUMBER_BITS_OPS_TOOLTIP="對數字進行位運算";x.Msg.MATH_NUMBER_HELPURL="https://zh.wikipedia.org/wiki/數";x.Msg.MATH_NUMBER_TOOLTIP="一個數字。";x.Msg.MATH_ONLIST_HELPURL="";x.Msg.MATH_ONLIST_OPERATOR_AVERAGE="陣列中的平均數";x.Msg.MATH_ONLIST_OPERATOR_MAX="陣列中的最大值";x.Msg.MATH_ONLIST_OPERATOR_MEDIAN="陣列中位數";x.Msg.MATH_ONLIST_OPERATOR_MIN="陣列中的最小值";x.Msg.MATH_ONLIST_OPERATOR_MODE="陣列模式";x.Msg.MATH_ONLIST_OPERATOR_RANDOM="陣列的隨機項";x.Msg.MATH_ONLIST_OPERATOR_STD_DEV="陣列中的標準差";x.Msg.MATH_ONLIST_OPERATOR_SUM="陣列中的數的總和";x.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="返回陣列中的數值的平均值。";x.Msg.MATH_ONLIST_TOOLTIP_MAX="返回陣列中最大數。";x.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="返回陣列中的中位數。";x.Msg.MATH_ONLIST_TOOLTIP_MIN="返回陣列中最小數。";x.Msg.MATH_ONLIST_TOOLTIP_MODE="返回陣列中的最常見的項的陣列。";x.Msg.MATH_ONLIST_TOOLTIP_RANDOM="從陣列中返回一個隨機的元素。";x.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="返回陣列的標準偏差。";x.Msg.MATH_ONLIST_TOOLTIP_SUM="返回陣列中的所有數字的和。";x.Msg.MATH_POWER_SYMBOL="**";x.Msg.MATH_RANDOM_FLOAT_HELPURL="https://zh.wikipedia.org/wiki/隨機數生成器";x.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="隨機小數";x.Msg.MATH_RANDOM_FLOAT_TOOLTIP="返回介於(包含)0.0到1.0之間的隨機數。";x.Msg.MATH_RANDOM_INT_HELPURL="https://zh.wikipedia.org/wiki/隨機數生成器";x.Msg.MATH_RANDOM_INT_TITLE="從 %1 到 %2 之間的隨機整數";x.Msg.MATH_RANDOM_INT_TOOLTIP="返回兩個指定的範圍(含)之間的隨機整數。";x.Msg.MATH_ROUND_HELPURL="https://zh.wikipedia.org/wiki/數值修約";x.Msg.MATH_ROUND_OPERATOR_ROUND="四舍五入";x.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="向下舍入";x.Msg.MATH_ROUND_OPERATOR_ROUNDUP="向上舍入";x.Msg.MATH_ROUND_TOOLTIP="數字向上或向下舍入。";x.Msg.MATH_SINGLE_HELPURL="https://zh.wikipedia.org/wiki/平方根";x.Msg.MATH_SINGLE_OP_ABSOLUTE="絕對";x.Msg.MATH_SINGLE_OP_ROOT="平方根";x.Msg.MATH_SINGLE_TOOLTIP_ABS="返回一個數的絕對值。";x.Msg.MATH_SINGLE_TOOLTIP_EXP="返回數的e次方。";x.Msg.MATH_SINGLE_TOOLTIP_LN="返回一個數的自然對數。";x.Msg.MATH_SINGLE_TOOLTIP_LOG10="返回數字的對數。";x.Msg.MATH_SINGLE_TOOLTIP_NEG="返回數的邏輯非。";x.Msg.MATH_SINGLE_TOOLTIP_POW10="返回數的10次方。";x.Msg.MATH_SINGLE_TOOLTIP_ROOT="返回數的平方根。";x.Msg.MATH_SUBTRACTION_SYMBOL="-";x.Msg.MATH_TRIG_ACOS="acos";x.Msg.MATH_TRIG_ASIN="asin";x.Msg.MATH_TRIG_ATAN="atan";x.Msg.MATH_TRIG_COS="cos";x.Msg.MATH_TRIG_HELPURL="https://zh.wikipedia.org/wiki/三角函數";x.Msg.MATH_TRIG_SIN="sin";x.Msg.MATH_TRIG_TAN="tan";x.Msg.MATH_TRIG_TOOLTIP_ACOS="返回一個數的反余弦值。";x.Msg.MATH_TRIG_TOOLTIP_ASIN="返回一個數的反正弦值。";x.Msg.MATH_TRIG_TOOLTIP_ATAN="返回指定角度的反正切值。";x.Msg.MATH_TRIG_TOOLTIP_COS="返回指定角度的余弦值(非弧度)。";x.Msg.MATH_TRIG_TOOLTIP_SIN="返回指定角度的正弦值(非弧度)。";x.Msg.MATH_TRIG_TOOLTIP_TAN="返回指定角度的正切值(非弧度)。";x.Msg.NEW_VARIABLE_TITLE="新變量的名稱:";x.Msg.ORDINAL_NUMBER_SUFFIX="";x.Msg.PROCEDURES_ALLOW_STATEMENTS="允許宣告";x.Msg.PROCEDURES_BEFORE_PARAMS="參數:";x.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";x.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="運行用戶定義的函數“%1”。";x.Msg.PROCEDURES_CALLRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";x.Msg.PROCEDURES_CALLRETURN_TOOLTIP="運行用戶定義的函數“%1”,並使用它的輸出值。";x.Msg.PROCEDURES_CALL_BEFORE_PARAMS="與:";x.Msg.PROCEDURES_CREATE_DO="創建“%1”";x.Msg.PROCEDURES_DEFNORETURN_COMMENT="";x.Msg.PROCEDURES_DEFNORETURN_DO="";x.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";x.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="my_func";x.Msg.PROCEDURES_DEFNORETURN_TITLE="定義函數";x.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="創建一個不帶輸出值的函數。";x.Msg.PROCEDURES_DEFRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序";x.Msg.PROCEDURES_DEFRETURN_RETURN="返回";x.Msg.PROCEDURES_DEFRETURN_TOOLTIP="創建一個有輸出值的函數。";x.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="警告: 此函數具有重複參數。";x.Msg.PROCEDURES_HIGHLIGHT_DEF="突出顯示函數定義";x.Msg.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause";x.Msg.PROCEDURES_IFRETURN_TOOLTIP="如果值為真,則返回第二個值。";x.Msg.PROCEDURES_IFRETURN_WARNING="警告: 僅在定義函數內可使用此塊。";x.Msg.PROCEDURES_MUTATORARG_TITLE="輸入名稱:";x.Msg.PROCEDURES_MUTATORARG_TOOLTIP="添加函數輸入。";x.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="輸入";x.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="添加、刪除或重新排此函數的輸入。";x.Msg.REDO="重做";x.Msg.REMOVE_COMMENT="刪除註釋";x.Msg.RENAME_VARIABLE="重命名變量...";x.Msg.RENAME_VARIABLE_TITLE="將所有“%1”變量重命名為:";x.Msg.TEXT_APPEND_APPENDTEXT="追加文本";x.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";x.Msg.TEXT_APPEND_TO="";x.Msg.TEXT_APPEND_TOOLTIP="將壹些文本追加到變量“%1”。";x.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";x.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="轉為小寫";x.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="轉為首字母大寫";x.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="轉為大寫";x.Msg.TEXT_CHANGECASE_TOOLTIP="使用不同的大小寫復制這段文字。";x.Msg.TEXT_CHARAT_FIRST="獲得首個字元";x.Msg.TEXT_CHARAT_FROM_END="獲得倒數第#個字元";x.Msg.TEXT_CHARAT_FROM_START="獲得字元#";x.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";x.Msg.TEXT_CHARAT_INPUT_INTEXT="從文本";x.Msg.TEXT_CHARAT_LAST="獲得最後一個字元";x.Msg.TEXT_CHARAT_RANDOM="獲取隨機的字母";x.Msg.TEXT_CHARAT_TAIL="";x.Msg.TEXT_CHARAT_TOOLTIP="返回位於指定位置的字母。";x.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="將一個項添加到文本中。";x.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="加入";x.Msg.TEXT_CREATE_JOIN_TOOLTIP="添加、移除或重新排列各節來重新配置這個文本塊。";x.Msg.TEXT_GET_SUBSTRING_END_FROM_END="到倒數第#個字元";x.Msg.TEXT_GET_SUBSTRING_END_FROM_START="到字元#";x.Msg.TEXT_GET_SUBSTRING_END_LAST="到最後一個字元";x.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";x.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="從文本";x.Msg.TEXT_GET_SUBSTRING_START_FIRST="取得段落字串自首個字元";x.Msg.TEXT_GET_SUBSTRING_START_FROM_END="取得段落字串自倒數第#個字元";x.Msg.TEXT_GET_SUBSTRING_START_FROM_START="取得段落字串自#";x.Msg.TEXT_GET_SUBSTRING_TAIL="";x.Msg.TEXT_GET_SUBSTRING_TOOLTIP="返回指定的部分文本。";x.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";x.Msg.TEXT_INDEXOF_INPUT_INTEXT="在文本";x.Msg.TEXT_INDEXOF_OPERATOR_FIRST="中查找 最先 出現";x.Msg.TEXT_INDEXOF_OPERATOR_LAST="中查找 最後 出現";x.Msg.TEXT_INDEXOF_TAIL="的位置";x.Msg.TEXT_INDEXOF_TOOLTIP="返回在第二個字串中的首個/最後一個匹配項的索引值。如果未找到則返回%1。";x.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";x.Msg.TEXT_ISEMPTY_TITLE="%1是空的";x.Msg.TEXT_ISEMPTY_TOOLTIP="如果提供的文本為空,則返回真。";x.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";x.Msg.TEXT_JOIN_TITLE_CREATEWITH="轉為文本";x.Msg.TEXT_JOIN_TOOLTIP="透過串起任意數量的項以建立壹段文字。";x.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";x.Msg.TEXT_LENGTH_TITLE="%1的長度";x.Msg.TEXT_LENGTH_TOOLTIP="返回提供文本的字母數(包括空格)。";x.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";x.Msg.TEXT_PRINT_TITLE="打印%1";x.Msg.CocoRobo_INPUT_MESSAGE0="輸入%1";x.Msg.TEXT_PRINT_TOOLTIP="打印指定的文字、數字或其他值。";x.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";x.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="提示用戶輸入數字。";x.Msg.TEXT_PROMPT_TOOLTIP_TEXT="提示用戶輸入壹些文本。";x.Msg.TEXT_PROMPT_TYPE_NUMBER="輸入數字並顯示提示消息";x.Msg.TEXT_PROMPT_TYPE_TEXT="輸入數字並顯示提示消息";x.Msg.TEXT_TEXT_HELPURL="https://zh.wikipedia.org/wiki/字串";x.Msg.TEXT_TEXT_TOOLTIP="一個字母、單詞或壹欄文本。";x.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";x.Msg.TEXT_TRIM_OPERATOR_BOTH="消除兩側空格";x.Msg.TEXT_TRIM_OPERATOR_LEFT="消除左側空格";x.Msg.TEXT_TRIM_OPERATOR_RIGHT="消除右側空格";x.Msg.TEXT_TRIM_TOOLTIP="復制這段文字的同時刪除兩端多余的空格。";x.Msg.TODAY="今天";x.Msg.UNDO="撤銷";x.Msg.VARIABLES_DEFAULT_NAME="item";x.Msg.VARIABLES_GET_CREATE_SET="創建“設定%1”";x.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";x.Msg.VARIABLES_GET_TOOLTIP="返回此變量的值。";x.Msg.VARIABLES_SET="將變量 %1 設定為 %2";x.Msg.VARIABLES_SET_CREATE_GET="創建“獲得%1”";x.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";x.Msg.VARIABLES_SET_TOOLTIP="設置此變量,以使它和輸入值相等。";x.Msg.VARIABLE_ALREADY_EXISTS="已存在名為“%1”的變量。";x.Msg.PROCEDURES_DEFRETURN_TITLE=x.Msg.PROCEDURES_DEFNORETURN_TITLE;x.Msg.CONTROLS_IF_IF_TITLE_IF=x.Msg.CONTROLS_IF_MSG_IF;x.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=x.Msg.CONTROLS_REPEAT_INPUT_DO;x.Msg.CONTROLS_IF_MSG_THEN=x.Msg.CONTROLS_REPEAT_INPUT_DO;x.Msg.TRY_EXCEPT_TRY="嘗試";x.Msg.CocoRobo_RETURN_TOOLTIP="返回一個值";x.Msg.CocoRobo_RETURN_MESSAGE0="返回 %1";x.Msg.CocoRobo_TYPE_MESSAGE0="值 %1 的類型";x.Msg.CocoRobo_TYPE_TOOLTIP="返回當前值的類型";x.Msg.CocoRobo_TYPE_IS_MESSAGE0="值 %1 的類型為 %2";x.Msg.CocoRobo_TYPE_IS_TOOLTIP="設定當前值的類型爲%2,並返回結果";x.Msg.CocoRobo_EVAL_HELPURL="";x.Msg.CocoRobo_EVAL_MESSAGE0="計算運算式 %1 的結果";x.Msg.CocoRobo_EVAL_TOOLTIP="計算字串運算式,並返回結果";x.Msg.CocoRobo_RETURN_HELPURL="";x.Msg.CocoRobo_RETURN_MESSAGE0="返回 %1";x.Msg.CocoRobo_RETURN_TOOLTIP="返回一個值";x.Msg.math_degrad_rad="轉換角度為弧度";x.Msg.math_degrad_deg="轉換弧度為角度";x.Msg.MATH_KEEP_DECIMAL_HELPURL="";x.Msg.MATH_KEEP_DECIMAL_TOOLTIP="返回指定值保留小數點的結果";x.Msg.MATH_KEEP_DECIMAL_MESSAGE0="%1 保留 %2 位小數";x.Msg.labplus_mapping_MESSAGE0="映射%1 從%2 , %3到%4 , %5";x.Msg.labplus_mapping_TOOLTIP="將0~100中的10映射到0~200中並返回映射值";x.Msg.labplus_mapping_HELPURL="";x.Msg.MATH_RANDOM_RANDRANGE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.MATH_RANDOM_RANDRANGE_TOOLTIP="返回指定遞增基數集合中的一個隨機數,基數缺省值為1";x.Msg.MATH_RANDOM_RANDRANGE_MESSAGE0="隨機數 從遞增區間 [%1 ,%2) 遞增長度%3";x.Msg.BIT_INVERSION_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.BIT_INVERSION_TOOLTIP="對數據的每個二進制位取反";x.Msg.BIT_INVERSION_MESSAGE0="二進制取反 %1";x.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL="";x.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0="10進制整數 %1 轉化為 %2 字串";x.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP="將10進制整數轉化爲%2字元串,並返回結果";x.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_HELPURL="";x.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_MESSAGE0="綫程鎖對象 %1 請求鎖";x.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_TOOLTIP="";x.Msg.CocoRobo_START_NEW_THREAD_HELPURL="";x.Msg.CocoRobo_START_NEW_THREAD_MESSAGE0="子綫程 %1";x.Msg.CocoRobo_START_NEW_THREAD_TOOLTIP="";x.Msg.CocoRobo_BAUDRATE_HELPURL="";x.Msg.CocoRobo_BAUDRATE_MESSAGE0="%1";x.Msg.CocoRobo_BAUDRATE_TOOLTIP="";x.Msg.CocoRobo_HIGH_LOW_HELPURL="";x.Msg.CocoRobo_HIGH_LOW_MESSAGE0="%1";x.Msg.CocoRobo_HIGH_LOW_TOOLTIP="";x.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL="";x.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0="10進制整數 %1 轉化為 %2 字串";x.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP="將10進制整數轉化爲%2字元串,並返回結果";x.Msg.CocoRobo_BIN="二進制";x.Msg.CocoRobo_OCT="八進制";x.Msg.CocoRobo_HEX="十六進制";x.Msg.CocoRobo_CONVERT_TO_TEN_HELPURL="";x.Msg.CocoRobo_CONVERT_TO_TEN_MESSAGE0="%1 字串 %2 轉 10進制整數";x.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP="將%2字元串轉化爲10進制整數,並返回結果";x.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_HELPURL="";x.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_MESSAGE0="10進制整數 %2 轉 %1 字節";x.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP="將10進制整數轉爲%1字節,並返回結果";x.Msg.CocoRobo_INT_TO_CHR_HELPURL="";x.Msg.CocoRobo_INT_TO_CHR_MESSAGE0="整型 %1 轉 ASCII 單字元";x.Msg.CocoRobo_INT_TO_CHR_TOOLTIP="ASCII:基於拉丁字母的壹套電腦編碼系統,主要用於顯示現代英語和其他西歐語言";x.Msg.CocoRobo_CHR_TO_INT_HELPURL="";x.Msg.CocoRobo_CHR_TO_INT_MESSAGE0="ASCII 單字元 %1 轉 整型";x.Msg.CocoRobo_CHR_TO_INT_TOOLTIP="ASCII:基於拉丁字母的壹套電腦編碼系統,主要用於顯示現代英語和其他西歐語言。";x.Msg.CocoRobo_STR_TO_HEX_HELPURL="";x.Msg.CocoRobo_STR_TO_HEX_MESSAGE0="字串 %1 轉 十六進制 字節";x.Msg.CocoRobo_STR_TO_HEX_TOOLTIP="返回結果中用空格分隔兩個十六進制數";x.Msg.CocoRobo_HEX_TO_BIN_STR_HELPURL="";x.Msg.CocoRobo_HEX_TO_BIN_STR_MESSAGE0="十六進制字串 %1 轉 二進制 字節";x.Msg.CocoRobo_HEX_TO_BIN_STR_TOOLTIP="十六進制字元串轉二進制字節,並返回結果";x.Msg.CocoRobo_DATA_TO_BASE64_HELPURL="";x.Msg.CocoRobo_DATA_TO_BASE64_MESSAGE0="%1 以 base64 格式編碼 返回字節對象";x.Msg.CocoRobo_DATA_TO_BASE64_TOOLTIP="";x.Msg.CocoRobo_BASE64_TO_DATA_HELPURL="";x.Msg.CocoRobo_BASE64_TO_DATA_MESSAGE0="解碼 base64 數據 %1 返回字節對象";x.Msg.CocoRobo_BASE64_TO_DATA_TOOLTIP="";x.Msg.CocoRobo_UJSON_DUMPS_HELPURL="";x.Msg.CocoRobo_UJSON_DUMPS_MESSAGE0="%1 轉 json 字串";x.Msg.CocoRobo_UJSON_DUMPS_TOOLTIP="JSON 格式的 key 必須是字串 ,value 可以是合法的 JSON 數據類型(字串, 數字, 對象, 陣列, 布爾值或 none)";x.Msg.CocoRobo_UJSON_LOADS_HELPURL="";x.Msg.CocoRobo_UJSON_LOADS_MESSAGE0="解析 json 字串 %1 返回對象";x.Msg.CocoRobo_UJSON_LOADS_TOOLTIP="JSON 格式的 key 必須是字串 ,value 可以是合法的 JSON 數據類型(字串, 數字, 對象, 陣列, 布爾值或 none)";x.Msg.CocoRobo_code_annotation_HELPURL="";x.Msg.CocoRobo_code_annotation_MESSAGE0="註釋 # %1";x.Msg.CocoRobo_code_annotation_TOOLTIP="生成代碼註釋";x.Msg.TEXT_FORMAT_MESSAGE0="格式化字串 %1 % %2";x.Msg.TEXT_FORMAT_TOOLTIP='使用"%"的方式格式化字元串,並返回結果';x.Msg.TEXT_FORMAT_HELPURL="";x.Msg.TEXT_FORMAT2_MESSAGE0="格式化字串 %1 format %2";x.Msg.TEXT_FORMAT2_TOOLTIP='使用"format"的方式格式化字元串,並返回結果';x.Msg.TEXT_FORMAT2_HELPURL="";x.Msg.text_additional_delimiter_string="將字串";x.Msg.text_additional_delimiter_deli="使用分隔符:";x.Msg.text_additional_delimiter_end="進行拆分並生成陣列";x.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.CocoRobo_TEXT_ESC_HELPURL="";x.Msg.CocoRobo_TEXT_ESC_MESSAGE0="文本轉義字元 %1 ";x.Msg.CocoRobo_TEXT_ESC_TOOLTIP="文本轉義字元";x.Msg.TEXT_IS_NUMBER_HELPURL="";x.Msg.TEXT_IS_NUMBER_TOOLTIP="判斷文本%1,並返回True或False";x.Msg.TEXT_IS_NUMBER_MESSAGE0="%1 %2";x.Msg.CocoRobo_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.CocoRobo_return_list_MESSAGE0="定義陣列 %1 = %2";x.Msg.CocoRobo_return_list_TOOLTIP="定義一個陣列";x.Msg.CocoRobo_ORDER="第";x.Msg.CocoRobo_REVERSE_ORDER="倒數第";x.Msg.LIST_ORDER_ITEM_MESSAGE0="陣列%1 %2 %3 項";x.Msg.LIST_ORDER_ITEM_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.CocoRobo_lists_append_MESSAGE0="陣列%1 末尾添加項%2";x.Msg.CocoRobo_lists_append_TOOLTIP="陣列末尾添加項";x.Msg.CocoRobo_lists_append_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.LIST_ITEM_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.LIST_ITEM_EXIST_TOOLTIP="陣列包含特定的字串";x.Msg.LIST_ITEM_EXIST_MESSAGE0="陣列%1 包含%2";x.Msg.SET_LIST_ORDER_ITEM_MESSAGE0="設陣列%1 %2 %3 項為%4";x.Msg.SET_LIST_ORDER_ITEM_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.SET_LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.INSERT_LIST_ORDER_ITEM_MESSAGE0="插入陣列%1 %2 %3 項為%4";x.Msg.INSERT_LIST_ORDER_ITEM_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.INSERT_LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.LIST_ORDER_ITEM_MESSAGE0="陣列%1 %2 %3 項";x.Msg.LIST_ORDER_ITEM_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.PARTS_OF_LIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.PARTS_OF_LIST_TOOLTIP=`遞增順序取項
- 舉例:
- 倒數第5到倒數第2;
- 第0到第5`;x.Msg.PARTS_OF_LIST_MESSAGE0="返回陣列%1 取%2 %3 項到 %4 %5 項";x.Msg.LIST_TO_TUPLE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.LIST_TO_TUPLE_TOOLTIP="陣列轉元組";x.Msg.LIST_TO_TUPLE_MESSAGE0="陣列%1 轉元組";x.Msg.CocoRobo_lists_clear_MESSAGE0="陣列%1 清空";x.Msg.CocoRobo_lists_clear_TOOLTIP="清空陣列";x.Msg.CocoRobo_lists_clear_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.CocoRobo_lists_extend_MESSAGE0="陣列%1 追加陣列%2";x.Msg.CocoRobo_lists_extend_TOOLTIP="在陣列中追加陣列";x.Msg.CocoRobo_lists_extend_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.LIST_FIRST_INDEX_HELPURL="";x.Msg.LIST_FIRST_INDEX_MESSAGE0="項 %1 在陣列 %2 %3 出現的位置";x.Msg.LIST_FIRST_INDEX_TOOLTIP="返回指定字串在陣列中%3出現的位置";x.Msg.FIRST="首次";x.Msg.LAST="最後一次";x.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP="將一個項添加到字典中。";x.Msg.DICT_KEY_VALUE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.DICT_KEY_VALUE_TOOLTIP="返回字典指定鍵的值";x.Msg.DICT_KEY_VALUE_MESSAGE0="字典%1 鍵%2 的值";x.Msg.ADD_DICT_KEY_VALUE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.ADD_DICT_KEY_VALUE_TOOLTIP="已有該鍵則更新該鍵";x.Msg.ADD_DICT_KEY_VALUE_MESSAGE0="字典%1 添加鍵%2 值%3";x.Msg.DICT_LENGTH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.DICT_LENGTH_TOOLTIP="返回字典的長度";x.Msg.DICT_LENGTH_MESSAGE0="字典%1 長度";x.Msg.DICT_KEY_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.DICT_KEY_EXIST_TOOLTIP="判斷字典中是否包含指定鍵,並返回True或False";x.Msg.DICT_KEY_EXIST_MESSAGE0="字典%1 包含鍵%2";x.Msg.DICT_KEY_OR_VAL_LIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP="返回字典%2的陣列";x.Msg.DICT_KEY_OR_VAL_LIST_MESSAGE0="字典%1 %2的陣列";x.Msg.DICT_KEYS="鍵";x.Msg.DICT_VALUES="值";x.Msg.DICT_CREATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.DICT_CREATE_WITH_TOOLTIP="定義一個字典";x.Msg.DICT_CREATE_WITH_MESSAGE0="定義字典 %1 = %2";x.Msg.tuple_create_with_MESSAGE0="定義元組 %1 = %2 ";x.Msg.tuple_create_with_TOOLTIP="只包含一個元素時,需要在元素後面添加逗號";x.Msg.tuple_create_with_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.tuple_order_item_MESSAGE0="元組%1 %2 %3 項";x.Msg.tuple_order_item_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.CocoRobo_MIN="最小值";x.Msg.CocoRobo_MAX="最大值";x.Msg.CocoRobo_LENTH="長度";x.Msg.tuple_order_item_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.TUPLE_MIN_MAX_LEN_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP="返回元組的%2";x.Msg.TUPLE_MIN_MAX_LEN_MESSAGE0="元組 %1 %2";x.Msg.TUPLE_ITEM_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.TUPLE_ITEM_EXIST_TOOLTIP="判斷是否包含指定值,並返回True或False";x.Msg.TUPLE_ITEM_EXIST_MESSAGE0="元組%1 包含%2";x.Msg.PARTS_OF_TUPLE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.PARTS_OF_TUPLE_TOOLTIP="正序計數從0開始,倒序計數從1開始";x.Msg.PARTS_OF_TUPLE_MESSAGE0="返回元組%1 取第%2 項到尾項";x.Msg.PARTS_OF_TUPLE2_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.PARTS_OF_TUPLE2_TOOLTIP=`遞增順序取項
- 舉例:
- 倒數第5到倒數第2;
- 第0到第5`;x.Msg.PARTS_OF_TUPLE2_MESSAGE0="返回元組%1 取%2 %3 項到 %4 %5 項";x.Msg.SET_CREATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.SET_CREATE_WITH_TOOLTIP="定義集合";x.Msg.SET_CREATE_WITH_MESSAGE0="定義集合 %1 = %2";x.Msg.SET_UPDATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.SET_UPDATE_WITH_TOOLTIP="添加參數可為字串、陣列、元組、集合、字典(只添加key),已有元素則不進行操作";x.Msg.SET_UPDATE_WITH_MESSAGE0="集合 %1 添加 %2";x.Msg.INTERSECTION_OF_SETS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.INTERSECTION_OF_SETS_TOOLTIP="返回兩集合的%1";x.Msg.INTERSECTION_OF_SETS_MESSAGE0="取 %1 集合 %2 集合 %3";x.Msg.CocoRobo_INTERSECTION="交集";x.Msg.CocoRobo_UNION="並集";x.Msg.CocoRobo_DIFFERENCE="差集";x.Msg.SETS_UPDATE_WAYS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.SETS_UPDATE_WAYS_TOOLTIP="集合更新爲與指定集合的%3";x.Msg.SETS_UPDATE_WAYS_MESSAGE0="集合 %1 更新為 與集合 %2 的 %3";x.Msg.SUBSET_SUPERSET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.SUBSET_SUPERSET_TOOLTIP="集合爲集合的%3";x.Msg.SUBSET_SUPERSET_MESSAGE0="集合 %1 為集合 %2 的 %3";x.Msg.CocoRobo_SUBSET="子集";x.Msg.CocoRobo_SUPERSET="超集";x.Msg.LEN_OF_SETS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.LEN_OF_SETS_TOOLTIP="返回指定集合的長度";x.Msg.LEN_OF_SETS_MESSAGE0="集合 %1 長度";x.Msg.GET_SETS_POP_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.GET_SETS_POP_TOOLTIP="返回移除隨機項後的集合";x.Msg.GET_SETS_POP_MESSAGE0="返回隨機項並移除之 從集合 %1";x.Msg.CREATE_EMPTY_SET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";x.Msg.CREATE_EMPTY_SET_TOOLTIP="";x.Msg.CREATE_EMPTY_SET_MESSAGE0="創建空集合 %1";x.Msg.io_high="高電平";x.Msg.io_low="低電平";x.Msg.digital_set="設定引腳 #";x.Msg.digital_set_as="爲";x.Msg.digital_get="獲取引腳 #";x.Msg.digital_get_value="的數碼訊號數值";x.Msg.digital_set_title="設置特定引腳爲指定電平";x.Msg.digital_get_value_title="返回特定引腳的數字信號數值";x.Msg.time_iot_module="IoT 模組 ";x.Msg.time_ai_module="AI 模組";x.Msg.analog_get_moudule="模組獲取引脚 #";x.Msg.analog_get_value="的類比訊號數值 (PWM)";x.Msg.set_pin="(範圍:0 ~ 1023)";x.Msg.Esp32_Main_Controller_Io_From_Analog_Pin_TOOLTIP="模組獲取特定引腳的模擬信號數值";x.Msg.time_init_timer="初始化計時器";x.Msg.time_timer_get_time="獲取計時器已過時間(毫秒)";x.Msg.time_timer_clear="清除計時器";x.Msg.time_timer_periodically="啟用週期重複計時器";x.Msg.time_timer_every="每隔";x.Msg.time_timer_ms="毫秒";x.Msg.time_execution="執行";x.Msg.time_timer_periodically_clear="清除週期重複計時器";x.Msg.time_get_current_date_title="獲取本地時間:";x.Msg.time_get_current_date_y="年";x.Msg.time_get_current_date_m="月";x.Msg.time_get_current_date_d="日";x.Msg.time_get_current_date_hour="時";x.Msg.time_get_current_date_min="分";x.Msg.time_get_current_date_sec="秒";x.Msg.serialcomm_print="序列埠打印";x.Msg.serialcomm_write_title_text="透過序列埠傳送數據至其他設備";x.Msg.serialcomm_read_setup_title_text="透過序列埠獲取數據";x.Msg.serialcomm_read_setup_title_text_1="初始化";x.Msg.serial_read_data="從";x.Msg.Serial_Read_Data_all="獲取序列埠的數據,並將其存到";x.Msg.ARD_SERIAL_RECEIVE_DATASET_GET_TEXT="獲取接收到序列埠數據中第";x.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_TEXT="位的數據,數據型別為:";x.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_FLOAT="浮點數";x.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_INTEGER="Number";x.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_STRING="字元";x.Msg.serialcomm_write_item_first="第 ";x.Msg.serialcomm_write_item_last=" 位數據:";x.Msg.serialcomm_write_item="項目";x.Msg.serialcomm_write_data="數據";x.Msg.serialcomm_write_data_bps_title="設定波特率為:";x.Msg.serialcomm_write_data_bps_attrib="位元/秒";x.Msg.serialcomm_write_on="使用";x.Msg.serialcomm_write_on_ai="AI 模組";x.Msg.serialcomm_write_on_iot="IoT 模組";x.Msg.serialcomm_write_on_iot_lite="IoT Lite 模組";x.Msg.serial_send_data_on="在";x.Msg.serial_send_data_on_send_data="模組上載送數據至 Microbit";x.Msg.serial_new_send_data="序列埠寫入文本";x.Msg.serial_new_send_data_1="不換行";x.Msg.serial_new_send_data_2="自動換行";x.Msg.serial_new_send_data_3="序列埠寫入單字節";x.Msg.serial_new_send_data_4="序列埠寫入字節陣列";x.Msg.serial_new_get_data_1="序列埠有可讀數據";x.Msg.serial_new_get_data_2="序列埠讀取一行數據";x.Msg.serial_new_get_data_3="序列埠讀取數據";x.Msg.serial_new_get_data_4="序列埠讀取數據長度爲";x.Msg.serial_close="關閉序列埠";x.Msg.SYSTEM="重啟系統";x.Msg.SYSTEM_GC="啟動記憶體回收";x.Msg.SYSTEM_RUN="執行 Python 程式";x.Msg.SYSTEM_RUN_F="程式所在路徑:";x.Msg.SYSTEM_CREATE="創建文本檔案";x.Msg.SYSTEM_CREATE_FILE="創建檔案";x.Msg.SYSTEM_CREATE_F="檔名:";x.Msg.SYSTEM_CREATE_F_1="檔案路徑爲:";x.Msg.SYSTEM_WRITE="創建文本檔案";x.Msg.SYSTEM_OPEN_FILE="打開檔案";x.Msg.SYSTEM_WRITE_FILE="寫入檔案";x.Msg.SYSTEM_CLOSE_FILE="關閉檔案";x.Msg.SYSTEM_WRITE_F="檔案名稱:";x.Msg.SYSTEM_WRITE_W="寫入內容:";x.Msg.SYSTEM_WRITE_S="分隔符號為:";x.Msg.SYSTEM_WRITE_S_N="換欄";x.Msg.SYSTEM_WRITE_S_C="逗號";x.Msg.SYSTEM_WRITE_S_S="空格";x.Msg.SYSTEM_WRITE_S_SE="分號";x.Msg.SYSTEM_INPUT="讀取文本檔案為陣列";x.Msg.SYSTEM_INPUT_FILE="讀取檔案為陣列";const rxe=x.Msg;var X=X||{Msg:Object.create(null)};X.Msg.catLogic="Logic";X.Msg.catLoops="Loops";X.Msg.catMath="Math";X.Msg.catText="Text";X.Msg.catVariables="Variables";X.Msg.catLists="Lists";X.Msg.catDictionary="Dictionary";X.Msg.catTuples="Tuples";X.Msg.catSet="Sets";X.Msg.catFunctions="Functions";X.Msg.catOutput="Output";X.Msg.catFiles="File";X.Msg.ADD_COMMENT="Add Comment";X.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="Can't delete the variable '%1' because it's part of the definition of the function '%2'";X.Msg.CHANGE_VALUE_TITLE="Change value:";X.Msg.CLEAN_UP="Clean up Blocks";X.Msg.COLLAPSED_WARNINGS_WARNING="Collapsed blocks contain warnings.";X.Msg.COLLAPSE_ALL="Collapse Blocks";X.Msg.COLLAPSE_BLOCK="Collapse Block";X.Msg.COLOUR_BLEND_COLOUR1="colour 1";X.Msg.COLOUR_BLEND_COLOUR2="colour 2";X.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp";X.Msg.COLOUR_BLEND_RATIO="ratio";X.Msg.COLOUR_BLEND_TITLE="blend";X.Msg.COLOUR_BLEND_TOOLTIP="Blends two colours together with a given ratio (0.0 - 1.0).";X.Msg.COLOUR_PICKER_HELPURL="https://en.wikipedia.org/wiki/Color";X.Msg.COLOUR_PICKER_TOOLTIP="Choose a colour from the palette.";X.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com";X.Msg.COLOUR_RANDOM_TITLE="random colour";X.Msg.COLOUR_RANDOM_TOOLTIP="Choose a colour at random.";X.Msg.COLOUR_RGB_BLUE="blue";X.Msg.COLOUR_RGB_GREEN="green";X.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html";X.Msg.COLOUR_RGB_RED="red";X.Msg.COLOUR_RGB_TITLE="colour with";X.Msg.COLOUR_RGB_TOOLTIP="Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.";X.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";X.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break out of loop";X.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue with next iteration of loop";X.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="Break out of the containing loop.";X.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="Skip the rest of this loop, and continue with the next iteration.";X.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="Warning: This block may only be used within a loop.";X.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";X.Msg.CONTROLS_FOREACH_TITLE="for each item %1 in list %2";X.Msg.CONTROLS_FOREACH_TOOLTIP="For each item in a list, set the variable '%1' to the item, and then do some statements.";X.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";X.Msg.CONTROLS_FOR_TITLE="count with %1 from %2 to %3 by %4";X.Msg.CONTROLS_FOR_TOOLTIP="Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.";X.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="Add a condition to the if block.";X.Msg.CONTROLS_IF_ELSE_TOOLTIP="Add a final, catch-all condition to the if block.";X.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";X.Msg.CONTROLS_IF_IF_TOOLTIP="Add, remove, or reorder sections to reconfigure this if block.";X.Msg.CONTROLS_IF_MSG_ELSE="else";X.Msg.CONTROLS_IF_MSG_ELSEIF="else if";X.Msg.CONTROLS_IF_MSG_IF="if";X.Msg.CONTROLS_IF_TOOLTIP_1="If a value is true, then do some statements.";X.Msg.CONTROLS_IF_TOOLTIP_2="If a value is true, then do the first block of statements. Otherwise, do the second block of statements.";X.Msg.CONTROLS_IF_TOOLTIP_3="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.";X.Msg.CONTROLS_IF_TOOLTIP_4="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.";X.Msg.CONTROLS_REPEAT_HELPURL="https://en.wikipedia.org/wiki/For_loop";X.Msg.CONTROLS_REPEAT_INPUT_DO="do";X.Msg.CONTROLS_REPEAT_TITLE="repeat %1 times";X.Msg.CONTROLS_REPEAT_TOOLTIP="Do some statements several times.";X.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";X.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="repeat until";X.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="repeat while";X.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="While a value is false, then do some statements.";X.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="While a value is true, then do some statements.";X.Msg.DELETE_ALL_BLOCKS="Delete all %1 blocks?";X.Msg.DELETE_BLOCK="Delete Block";X.Msg.DELETE_VARIABLE="Delete the '%1' variable";X.Msg.DELETE_VARIABLE_CONFIRMATION="Delete %1 uses of the '%2' variable?";X.Msg.DELETE_X_BLOCKS="Delete %1 Blocks";X.Msg.DIALOG_CANCEL="Cancel";X.Msg.DIALOG_OK="OK";X.Msg.DISABLE_BLOCK="Disable Block";X.Msg.DUPLICATE_BLOCK="Duplicate";X.Msg.DUPLICATE_COMMENT="Duplicate Comment";X.Msg.ENABLE_BLOCK="Enable Block";X.Msg.EXPAND_ALL="Expand Blocks";X.Msg.EXPAND_BLOCK="Expand Block";X.Msg.EXTERNAL_INPUTS="External Inputs";X.Msg.HELP="Help";X.Msg.LOGIC_BOOLEAN_FALSE="false";X.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";X.Msg.LOGIC_BOOLEAN_TOOLTIP="Returns either true or false.";X.Msg.LOGIC_BOOLEAN_TRUE="true";X.Msg.LOGIC_COMPARE_HELPURL="https://en.wikipedia.org/wiki/Inequality_(mathematics)";X.Msg.LOGIC_COMPARE_TOOLTIP_EQ="Return true if both inputs equal each other.";X.Msg.LOGIC_COMPARE_TOOLTIP_GT="Return true if the first input is greater than the second input.";X.Msg.LOGIC_COMPARE_TOOLTIP_GTE="Return true if the first input is greater than or equal to the second input.";X.Msg.LOGIC_COMPARE_TOOLTIP_LT="Return true if the first input is smaller than the second input.";X.Msg.LOGIC_COMPARE_TOOLTIP_LTE="Return true if the first input is smaller than or equal to the second input.";X.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="Return true if both inputs are not equal to each other.";X.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";X.Msg.LOGIC_NEGATE_TITLE="not %1";X.Msg.LOGIC_NEGATE_TOOLTIP="Returns true if the input is false. Returns false if the input is true.";X.Msg.LOGIC_NULL="null";X.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";X.Msg.LOGIC_NULL_TOOLTIP="Returns null.";X.Msg.LOGIC_OPERATION_AND="and";X.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";X.Msg.LOGIC_OPERATION_OR="or";X.Msg.LOGIC_OPERATION_TOOLTIP_AND="Return true if both inputs are true.";X.Msg.LOGIC_OPERATION_TOOLTIP_OR="Return true if at least one of the inputs is true.";X.Msg.LOGIC_TERNARY_CONDITION="test";X.Msg.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:";X.Msg.LOGIC_TERNARY_IF_FALSE="if false";X.Msg.LOGIC_TERNARY_IF_TRUE="if true";X.Msg.LOGIC_TERNARY_TOOLTIP="Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.";X.Msg.MATH_ADDITION_SYMBOL="+";X.Msg.MATH_ARITHMETIC_HELPURL="https://en.wikipedia.org/wiki/Arithmetic";X.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="Return the sum of the two numbers.";X.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="Return the quotient of the two numbers.";X.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="Return the difference of the two numbers.";X.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="Return the product of the two numbers.";X.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="Return the first number raised to the power of the second number.";X.Msg.MATH_ATAN2_HELPURL="https://en.wikipedia.org/wiki/Atan2";X.Msg.MATH_ATAN2_TITLE="atan2 of X:%1 Y:%2";X.Msg.MATH_ATAN2_TOOLTIP="Return the arctangent of point (X, Y) in degrees from -180 to 180.";X.Msg.MATH_CHANGE_HELPURL="https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";X.Msg.MATH_CHANGE_TITLE="change %1 by %2";X.Msg.MATH_CHANGE_TOOLTIP="Add a number to variable '%1'.";X.Msg.MATH_CONSTANT_HELPURL="https://en.wikipedia.org/wiki/Mathematical_constant";X.Msg.MATH_CONSTANT_TOOLTIP="Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).";X.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)";X.Msg.MATH_CONSTRAIN_TITLE="constrain %1 low %2 high %3";X.Msg.MATH_CONSTRAIN_TOOLTIP="Constrain a number to be between the specified limits (inclusive).";X.Msg.MATH_DIVISION_SYMBOL="÷";X.Msg.MATH_IS_DIVISIBLE_BY="is divisible by";X.Msg.MATH_IS_EVEN="is even";X.Msg.MATH_IS_NEGATIVE="is negative";X.Msg.MATH_IS_ODD="is odd";X.Msg.MATH_IS_POSITIVE="is positive";X.Msg.MATH_IS_PRIME="is prime";X.Msg.MATH_IS_TOOLTIP="Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.";X.Msg.MATH_IS_WHOLE="is whole";X.Msg.MATH_MODULO_HELPURL="https://en.wikipedia.org/wiki/Modulo_operation";X.Msg.MATH_MODULO_TITLE="remainder of %1 ÷ %2";X.Msg.MATH_MODULO_TOOLTIP="Return the remainder from dividing the two numbers.";X.Msg.MATH_MULTIPLICATION_SYMBOL="×";X.Msg.MATH_NUMBER_HELPURL="https://en.wikipedia.org/wiki/Number";X.Msg.MATH_NUMBER_TOOLTIP="A number.";X.Msg.MATH_ONLIST_HELPURL="";X.Msg.MATH_ONLIST_OPERATOR_AVERAGE="average of list";X.Msg.MATH_ONLIST_OPERATOR_MAX="max of list";X.Msg.MATH_ONLIST_OPERATOR_MEDIAN="median of list";X.Msg.MATH_ONLIST_OPERATOR_MIN="min of list";X.Msg.MATH_ONLIST_OPERATOR_MODE="modes of list";X.Msg.MATH_ONLIST_OPERATOR_RANDOM="random item of list";X.Msg.MATH_ONLIST_OPERATOR_STD_DEV="standard deviation of list";X.Msg.MATH_ONLIST_OPERATOR_SUM="sum of list";X.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="Return the average (arithmetic mean) of the numeric values in the list.";X.Msg.MATH_ONLIST_TOOLTIP_MAX="Return the largest number in the list.";X.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="Return the median number in the list.";X.Msg.MATH_ONLIST_TOOLTIP_MIN="Return the smallest number in the list.";X.Msg.MATH_ONLIST_TOOLTIP_MODE="Return a list of the most common item(s) in the list.";X.Msg.MATH_ONLIST_TOOLTIP_RANDOM="Return a random element from the list.";X.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="Return the standard deviation of the list.";X.Msg.MATH_ONLIST_TOOLTIP_SUM="Return the sum of all the numbers in the list.";X.Msg.MATH_POWER_SYMBOL="^";X.Msg.MATH_RANDOM_FLOAT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation";X.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="random fraction";X.Msg.MATH_RANDOM_FLOAT_TOOLTIP="Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).";X.Msg.MATH_RANDOM_INT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation";X.Msg.MATH_RANDOM_INT_TITLE="random integer from %1 to %2";X.Msg.MATH_RANDOM_INT_TOOLTIP="Return a random integer between the two specified limits, inclusive.";X.Msg.MATH_ROUND_HELPURL="https://en.wikipedia.org/wiki/Rounding";X.Msg.MATH_ROUND_OPERATOR_ROUND="round";X.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="round down";X.Msg.MATH_ROUND_OPERATOR_ROUNDUP="round up";X.Msg.MATH_ROUND_TOOLTIP="Round a number up or down.";X.Msg.MATH_SINGLE_HELPURL="https://en.wikipedia.org/wiki/Square_root";X.Msg.MATH_SINGLE_OP_ABSOLUTE="absolute";X.Msg.MATH_SINGLE_OP_ROOT="square root";X.Msg.MATH_SINGLE_TOOLTIP_ABS="Return the absolute value of a number.";X.Msg.MATH_SINGLE_TOOLTIP_EXP="Return e to the power of a number.";X.Msg.MATH_SINGLE_TOOLTIP_LN="Return the natural logarithm of a number.";X.Msg.MATH_SINGLE_TOOLTIP_LOG10="Return the base 10 logarithm of a number.";X.Msg.MATH_SINGLE_TOOLTIP_NEG="Return the negation of a number.";X.Msg.MATH_SINGLE_TOOLTIP_POW10="Return 10 to the power of a number.";X.Msg.MATH_SINGLE_TOOLTIP_ROOT="Return the square root of a number.";X.Msg.MATH_SUBTRACTION_SYMBOL="-";X.Msg.MATH_TRIG_ACOS="acos";X.Msg.MATH_TRIG_ASIN="asin";X.Msg.MATH_TRIG_ATAN="atan";X.Msg.MATH_TRIG_COS="cos";X.Msg.MATH_TRIG_HELPURL="https://en.wikipedia.org/wiki/Trigonometric_functions";X.Msg.MATH_TRIG_SIN="sin";X.Msg.MATH_TRIG_TAN="tan";X.Msg.MATH_TRIG_TOOLTIP_ACOS="Return the arccosine of a number.";X.Msg.MATH_TRIG_TOOLTIP_ASIN="Return the arcsine of a number.";X.Msg.MATH_TRIG_TOOLTIP_ATAN="Return the arctangent of a number.";X.Msg.MATH_TRIG_TOOLTIP_COS="Return the cosine of a degree (not radian).";X.Msg.MATH_TRIG_TOOLTIP_SIN="Return the sine of a degree (not radian).";X.Msg.MATH_TRIG_TOOLTIP_TAN="Return the tangent of a degree (not radian).";X.Msg.NEW_COLOUR_VARIABLE="Create colour variable...";X.Msg.NEW_NUMBER_VARIABLE="Create number variable...";X.Msg.NEW_STRING_VARIABLE="Create string variable...";X.Msg.NEW_VARIABLE="Create variable...";X.Msg.NEW_VARIABLE_TITLE="New variable name:";X.Msg.NEW_VARIABLE_TYPE_TITLE="New variable type:";X.Msg.ORDINAL_NUMBER_SUFFIX="";X.Msg.REDO="Redo";X.Msg.REMOVE_COMMENT="Remove Comment";X.Msg.RENAME_VARIABLE="Rename variable...";X.Msg.RENAME_VARIABLE_TITLE="Rename all '%1' variables to:";X.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";X.Msg.TEXT_APPEND_TITLE="to %1 append text %2";X.Msg.TEXT_APPEND_TOOLTIP="Append some text to variable '%1'.";X.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";X.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="to lower case";X.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="to Title Case";X.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="to UPPER CASE";X.Msg.TEXT_CHANGECASE_TOOLTIP="Return a copy of the text in a different case.";X.Msg.TEXT_CHARAT_FIRST="get first letter";X.Msg.TEXT_CHARAT_FROM_END="get letter # from end";X.Msg.TEXT_CHARAT_FROM_START="get letter #";X.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";X.Msg.TEXT_CHARAT_LAST="get last letter";X.Msg.TEXT_CHARAT_RANDOM="get random letter";X.Msg.TEXT_CHARAT_TAIL="";X.Msg.TEXT_CHARAT_TITLE="in text %1 %2";X.Msg.TEXT_CHARAT_TOOLTIP="Returns the letter at the specified position.";X.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings";X.Msg.TEXT_COUNT_MESSAGE0="count %1 in %2";X.Msg.TEXT_COUNT_TOOLTIP="Count how many times some text occurs within some other text.";X.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="Add an item to the text.";X.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="join";X.Msg.TEXT_CREATE_JOIN_TOOLTIP="Add, remove, or reorder sections to reconfigure this text block.";X.Msg.TEXT_GET_SUBSTRING_END_FROM_END="to letter # from end";X.Msg.TEXT_GET_SUBSTRING_END_FROM_START="to letter #";X.Msg.TEXT_GET_SUBSTRING_END_LAST="to last letter";X.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";X.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="in text";X.Msg.TEXT_GET_SUBSTRING_START_FIRST="get substring from first letter";X.Msg.TEXT_GET_SUBSTRING_START_FROM_END="get substring from letter # from end";X.Msg.TEXT_GET_SUBSTRING_START_FROM_START="get substring from letter #";X.Msg.TEXT_GET_SUBSTRING_TAIL="";X.Msg.TEXT_GET_SUBSTRING_TOOLTIP="Returns a specified portion of the text.";X.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";X.Msg.TEXT_INDEXOF_OPERATOR_FIRST="find first occurrence of text";X.Msg.TEXT_INDEXOF_OPERATOR_LAST="find last occurrence of text";X.Msg.TEXT_INDEXOF_TITLE="in text %1 %2 %3";X.Msg.TEXT_INDEXOF_TOOLTIP="Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.";X.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";X.Msg.TEXT_ISEMPTY_TITLE="%1 is empty";X.Msg.TEXT_ISEMPTY_TOOLTIP="Returns true if the provided text is empty.";X.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";X.Msg.TEXT_JOIN_TITLE_CREATEWITH="create text with";X.Msg.TEXT_JOIN_TOOLTIP="Create a piece of text by joining together any number of items.";X.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";X.Msg.TEXT_LENGTH_TITLE="length of %1";X.Msg.TEXT_LENGTH_TOOLTIP="Returns the number of letters (including spaces) in the provided text.";X.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";X.Msg.TEXT_PRINT_TITLE="print %1";X.Msg.TEXT_PRINT_TOOLTIP="Print the specified text, number or other value.";X.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";X.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="Prompt for user for a number.";X.Msg.TEXT_PROMPT_TOOLTIP_TEXT="Prompt for user for some text.";X.Msg.TEXT_PROMPT_TYPE_NUMBER="prompt for number with message";X.Msg.TEXT_PROMPT_TYPE_TEXT="prompt for text with message";X.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings";X.Msg.TEXT_REPLACE_MESSAGE0="replace %1 with %2 in %3";X.Msg.TEXT_REPLACE_TOOLTIP="Replace all occurances of some text within some other text.";X.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text";X.Msg.TEXT_REVERSE_MESSAGE0="reverse %1";X.Msg.TEXT_REVERSE_TOOLTIP="Reverses the order of the characters in the text.";X.Msg.TEXT_TEXT_HELPURL="https://en.wikipedia.org/wiki/String_(computer_science)";X.Msg.TEXT_TEXT_TOOLTIP="A letter, word, or line of text.";X.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";X.Msg.TEXT_TRIM_OPERATOR_BOTH="trim spaces from both sides of";X.Msg.TEXT_TRIM_OPERATOR_LEFT="trim spaces from left side of";X.Msg.TEXT_TRIM_OPERATOR_RIGHT="trim spaces from right side of";X.Msg.TEXT_TRIM_TOOLTIP="Return a copy of the text with spaces removed from one or both ends.";X.Msg.TODAY="Today";X.Msg.UNDO="Undo";X.Msg.UNNAMED_KEY="unnamed";X.Msg.VARIABLES_DEFAULT_NAME="item";X.Msg.VARIABLES_GET_CREATE_SET="Create 'set %1'";X.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";X.Msg.VARIABLES_GET_TOOLTIP="Returns the value of this variable.";X.Msg.VARIABLES_SET="set %1 to %2";X.Msg.VARIABLES_SET_CREATE_GET="Create 'get %1'";X.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";X.Msg.VARIABLES_SET_TOOLTIP="Sets this variable to be equal to the input.";X.Msg.VARIABLE_ALREADY_EXISTS="A variable named '%1' already exists.";X.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="A variable named '%1' already exists for another type: '%2'.";X.Msg.WORKSPACE_ARIA_LABEL="Blockly Workspace";X.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="Say something...";X.Msg.TEXT_IS_NUMBER_HELPURL="";X.Msg.TEXT_IS_NUMBER_TOOLTIP="Judge the text %1 and return True or False";X.Msg.TEXT_IS_NUMBER_MESSAGE0="%1 %2";X.Msg.TEXT_IS_DIGIT="Is number";X.Msg.TEXT_IS_ALPHA="Is letter";X.Msg.TEXT_IS_ALNUM="Is mix of numbers and letters";X.Msg.REDO="Redo";X.Msg.UNDO="Undo";X.Msg.DELETE_VARIABLE='Delete "%1" variable';X.Msg.DELETE_VARIABLE_CONFIRMATION='Delete %1 of the "%2" variable?';X.Msg.CONTROLS_REPEAT_FOREVER="Repeat forever";X.Msg.CONTROLS_REPEAT_FOREVER_TOOLTIP="Do some statements forever times";X.Msg.TEXT_LIST_START="Create list [";X.Msg.TEXT_LIST_END="]";X.Msg.TEXT_TUPLE_START="Create tuple (";X.Msg.TEXT_TUPLE_END=")";X.Msg.TEXT_DICT_START="Create dictionary {";X.Msg.TEXT_DICT_END="}";X.Msg.TEXT_SET_START="Create set {";X.Msg.TEXT_SET_END="}";X.Msg.TEXT_SET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/index.html";X.Msg.TUPLE_CREATE_EMPTY_TITLE="Create empty tuple";X.Msg.DICT_CREATE_EMPTY_TITLE="Create empty dictionary";X.Msg.SET_CREATE_EMPTY_TITLE="Create empty sets";X.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD="Tuple";X.Msg.DICT_CREATE_WITH_CONTAINER_TITLE_ADD="Dictionary";X.Msg.SET_CREATE_WITH_CONTAINER_TITLE_ADD="Sets";X.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP="Add, remove, or rearrange sections to reconfigure this tuple block.";X.Msg.DICT_CREATE_WITH_CONTAINER_TOOLTIP="Add, remove, or rearrange sections to reconfigure this dictionary block.";X.Msg.TUPLE_CREATE_WITH_INPUT_WITH="Create tuple with";X.Msg.DICT_CREATE_WITH_INPUT_WITH="Create dictionary with";X.Msg.SET_CREATE_WITH_INPUT_WITH="Create sets with";X.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP="Add an item to the tuple.";X.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP="Add an item to the dictionary.";X.Msg.SET_CREATE_WITH_ITEM_TOOLTIP="Add an item to the sets.";X.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";X.Msg.LISTS_SORT_ORDER_ASCENDING="Ascending";X.Msg.LISTS_SORT_ORDER_DESCENDING="Descending";X.Msg.LISTS_SORT_TITLE="Sort %1 %2 %3";X.Msg.LISTS_SORT_TOOLTIP="Sort a copy of a list.";X.Msg.LISTS_SORT_TYPE_IGNORECASE="By letter, ignore case";X.Msg.LISTS_SORT_TYPE_NUMERIC="By number";X.Msg.LISTS_SORT_TYPE_TEXT="By letter";X.Msg.labplus_mapping_MESSAGE0="Map %1 from %2 , %3 to %4 , %5";X.Msg.labplus_mapping_TOOLTIP="Map 10 of 0~100 to 0~200 and return the mapped value";X.Msg.labplus_mapping_HELPURL="";X.Msg.CocoRobo_OPEN="On";X.Msg.CocoRobo_CLOSE="Off";X.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_LEFT="Shift left";X.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_RIGHT="Shift right";X.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_UP="Shift up";X.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_DOWN="Shift down";X.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_GRAYSCALE="Grayscale";X.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_RAINBOW="Rainbow";X.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_NEGATE="Negate";X.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_INVERT="Invert";X.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_LINPOLAR="Line polar";X.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_LOGPOLAR="Log polar";X.Msg.CocoRobo_AI_SENSOR_PATTERN_GRAYSCALE="Grayscale";X.Msg.CocoRobo_AI_SENSOR_PATTERN_COLOR="Color";X.Msg.CocoRobo_AI_SENSOR_ENABLE_START="Start capturing image";X.Msg.CocoRobo_AI_SENSOR_ENABLE_STOP="Stop capturing image";X.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_H="Horizontal mirror";X.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_V="Vertical flip";X.Msg.CocoRobo_AI_SENSOR_SETS_CONTRAST="Contrast";X.Msg.CocoRobo_AI_SENSOR_SETS_BRIGHTNESS="Brightness";X.Msg.CocoRobo_AI_SENSOR_SETS_SATURATION="Saturation";X.Msg.CocoRobo_AI2_FACE_YOLO="FACE YOLO";X.Msg.CocoRobo_AI2_CLASS_20_YOLO="CLASS 20 YOLO";X.Msg.CocoRobo_AI_TRACE_COLOR_RECTANGLE="Rectangle";X.Msg.CocoRobo_AI_TRACE_COLOR_CROSS="Cross";X.Msg.TEXT_APPEND_TEXT_HELPURL="";X.Msg.TEXT_APPEND_TEXT_TOOLTIP="Append text after the specified text and return the result";X.Msg.TEXT_APPEND_TEXT_MESSAGE0="%1 append text %2";X.Msg.CocoRobo_RETURN_TOOLTIP="Return a value";X.Msg.CocoRobo_RETURN_MESSAGE0="Return %1";X.Msg.CocoRobo_TYPE_MESSAGE0="Type %1";X.Msg.CocoRobo_TYPE_TOOLTIP="Returns the type of the current value";X.Msg.CocoRobo_TYPE_IS_MESSAGE0="Type %1 is %2";X.Msg.CocoRobo_TYPE_IS_TOOLTIP="Set the type of the current value to %2 and return the result";X.Msg.CocoRobo_EVAL_HELPURL="";X.Msg.CocoRobo_EVAL_MESSAGE0="Eval %1";X.Msg.CocoRobo_EVAL_TOOLTIP="Simulate a string expression and return the result";X.Msg.CocoRobo_RETURN_HELPURL="";X.Msg.CocoRobo_RETURN_MESSAGE0="Return %1";X.Msg.CocoRobo_RETURN_TOOLTIP="Return a value";X.Msg.math_degrad_rad="Convert Degrees to Radians";X.Msg.math_degrad_deg="Convert Radians to Degrees";X.Msg.MATH_KEEP_DECIMAL_HELPURL="";X.Msg.MATH_KEEP_DECIMAL_TOOLTIP="Returns the result of the specified value keeping the decimal point";X.Msg.MATH_KEEP_DECIMAL_MESSAGE0="%1 keep %2 decimal places";X.Msg.labplus_mapping_MESSAGE0="Map %1 from %2 , %3 to %4 , %5";X.Msg.labplus_mapping_TOOLTIP="Map 10 of 0~100 to 0~200 and return the mapped value";X.Msg.labplus_mapping_HELPURL="";X.Msg.MATH_RANDOM_RANDRANGE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.MATH_RANDOM_RANDRANGE_TOOLTIP="Returns a random number in the specified incremental cardinality set, the base value defaults to 1";X.Msg.MATH_RANDOM_RANDRANGE_MESSAGE0="Random number increments from increment interval [%1 , %2) by step %3";X.Msg.BIT_INVERSION_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.BIT_INVERSION_TOOLTIP="Reverse each binary bit of data";X.Msg.BIT_INVERSION_MESSAGE0="Invert each binary bit of the data %1";X.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL="";X.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0="Decimal int num %1 converted to %2 string";X.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP="Convert a decimal integer to a %2 string and return the result";X.Msg.MATH_DIVISION_CONSULT_HELPURL="";X.Msg.MATH_DIVISION_CONSULT_TITLE="The integer part of the quotient %1 ÷ %2";X.Msg.MATH_DIVISION_CONSULT_TOOLTIP="Returns the integer part of the quotient of two numbers";X.Msg.MATH_CONVERT_MESSAGE0="%1 %2";X.Msg.MATH_NUMBER_BITS_OPS_MESSAGE0="%1 %2 %3";X.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_HELPURL="";X.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_MESSAGE0="Thread lock object %1 requests lock";X.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_TOOLTIP="";X.Msg.CocoRobo_START_NEW_THREAD_HELPURL="";X.Msg.CocoRobo_START_NEW_THREAD_MESSAGE0="Thread %1";X.Msg.CocoRobo_START_NEW_THREAD_TOOLTIP="";X.Msg.TEXT_FORMAT_MESSAGE0="Format string %1 % %2";X.Msg.TEXT_FORMAT_TOOLTIP='Use "%" to format the string and return the result';X.Msg.TEXT_FORMAT_HELPURL="";X.Msg.TEXT_FORMAT2_MESSAGE0="Format string %1 with %2";X.Msg.TEXT_FORMAT2_TOOLTIP='Use "format" to format the string and return the result';X.Msg.TEXT_FORMAT2_HELPURL="";X.Msg.CocoRobo_BAUDRATE_HELPURL="";X.Msg.CocoRobo_BAUDRATE_MESSAGE0="%1";X.Msg.CocoRobo_BAUDRATE_TOOLTIP="";X.Msg.CocoRobo_HIGH_LOW_HELPURL="";X.Msg.CocoRobo_HIGH_LOW_MESSAGE0="%1";X.Msg.CocoRobo_HIGH_LOW_TOOLTIP="";X.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL="";X.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0="Decimal int num %1 converted to %2 string";X.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP="Convert a decimal integer to a %2 string and return the result";X.Msg.CocoRobo_BIN="BIN";X.Msg.CocoRobo_OCT="OCT";X.Msg.CocoRobo_HEX="HEX";X.Msg.CocoRobo_CONVERT_TO_TEN_HELPURL="";X.Msg.CocoRobo_CONVERT_TO_TEN_MESSAGE0="%1 string %2 converted to decimal int num";X.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP="Convert a %2 string to a decimal integer and return the result";X.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_HELPURL="";X.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_MESSAGE0="Decimal int num %2 converted to %1 bytes";X.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP="Convert a decimal integer to %1 bytes and return the result";X.Msg.CocoRobo_INT_TO_CHR_HELPURL="";X.Msg.CocoRobo_INT_TO_CHR_MESSAGE0="Shaping number %1 converted to character in ASCII";X.Msg.CocoRobo_INT_TO_CHR_TOOLTIP="ASCII is a computer coding system based on the Latin alphabet, mainly used to display modern English and other Western European languages";X.Msg.CocoRobo_STR_TO_HEX_HELPURL="";X.Msg.CocoRobo_STR_TO_HEX_MESSAGE0="String %1 converted to hex bytes";X.Msg.CocoRobo_STR_TO_HEX_TOOLTIP="Returns two hexadecimal numbers separated by spaces in the result";X.Msg.CocoRobo_CHR_TO_INT_HELPURL="";X.Msg.CocoRobo_CHR_TO_INT_MESSAGE0="Character in ASCII %1 converted to shaping number";X.Msg.CocoRobo_CHR_TO_INT_TOOLTIP="ASCII is a computer coding system based on the Latin alphabet, mainly used to display modern English and other Western European languages";X.Msg.CocoRobo_HEX_TO_BIN_STR_HELPURL="";X.Msg.CocoRobo_HEX_TO_BIN_STR_MESSAGE0="Hex string %1 converted to bin bytes";X.Msg.CocoRobo_HEX_TO_BIN_STR_TOOLTIP="Convert hexadecimal string to binary byte and return the result";X.Msg.CocoRobo_DATA_TO_BASE64_HELPURL="";X.Msg.CocoRobo_DATA_TO_BASE64_MESSAGE0="Encoding data %1 in base64 and return byte object";X.Msg.CocoRobo_DATA_TO_BASE64_TOOLTIP="Base64 encoding is a process from binary to character";X.Msg.CocoRobo_BASE64_TO_DATA_HELPURL="";X.Msg.CocoRobo_BASE64_TO_DATA_MESSAGE0="Decoding base64 data %1 and return byte object";X.Msg.CocoRobo_BASE64_TO_DATA_TOOLTIP="Base64 encoding is a process from binary to character";X.Msg.CocoRobo_UJSON_DUMPS_HELPURL="";X.Msg.CocoRobo_UJSON_DUMPS_MESSAGE0="%1 converted to json string";X.Msg.CocoRobo_UJSON_DUMPS_TOOLTIP="Key in json format must be a string, and value can be a legitimate json data type (string, number, object, array, Boolean, or none";X.Msg.CocoRobo_UJSON_LOADS_HELPURL="";X.Msg.CocoRobo_UJSON_LOADS_MESSAGE0="Parse json string %1 and return the object";X.Msg.CocoRobo_UJSON_LOADS_TOOLTIP="Key in json format must be a string, and value can be a legitimate json data type (string, number, object, array, Boolean, or none";X.Msg.CocoRobo_code_annotation_HELPURL="";X.Msg.CocoRobo_code_annotation_MESSAGE0="Comment # %1";X.Msg.CocoRobo_code_annotation_TOOLTIP="Generate code comments";X.Msg.CocoRobo_SETS_PIN_MODE_HELPURL="https://CocoRobo.readthedocs.io/zh/master/board/hardware.html#CocoRobopindesc";X.Msg.CocoRobo_SETS_PIN_MODE_TOOLTIP="Right-click help to view the pin declaration";X.Msg.CocoRobo_SETS_PIN_MODE_MESSAGE0="Set pin %1 as %2 mode %3 and set the value to %4";X.Msg.CocoRobo_SET_PIN_IN="Input";X.Msg.CocoRobo_SET_PIN_PUSH_PULL_OUT="Push-pull output";X.Msg.CocoRobo_SET_PIN_LEAKY_OUT="Leaky output";X.Msg.CocoRobo_SET_PIN_NO_PULL="No pull";X.Msg.CocoRobo_SET_PIN_DOWN_PULL="Ppull down";X.Msg.CocoRobo_SET_PIN_UP_PULL="Pull up";X.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_HELPURL="";X.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_MESSAGE0="Thread lock object %1 requests lock";X.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_TOOLTIP="";X.Msg.CocoRobo_START_NEW_THREAD_HELPURL="";X.Msg.CocoRobo_START_NEW_THREAD_MESSAGE0="Thread %1";X.Msg.CocoRobo_START_NEW_THREAD_TOOLTIP="";X.Msg.text_additional_delimiter_string="Split string to a list";X.Msg.text_additional_delimiter_deli="by delimiter:";X.Msg.text_additional_delimiter_end="Split and generate a list";X.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.CocoRobo_TEXT_ESC_HELPURL="";X.Msg.CocoRobo_TEXT_ESC_MESSAGE0="Text ESC %1";X.Msg.CocoRobo_TEXT_ESC_TOOLTIP="Text ESC";X.Msg.TEXT_APPEND_TEXT_HELPURL="";X.Msg.TEXT_APPEND_TEXT_TOOLTIP="Append text after the specified text and return the result";X.Msg.TEXT_APPEND_TEXT_MESSAGE0="%1 append text %2";X.Msg.TEXT_IS_NUMBER_HELPURL="";X.Msg.TEXT_IS_NUMBER_TOOLTIP="Judge the text %1 and return True or False";X.Msg.TEXT_IS_NUMBER_MESSAGE0="%1 %2";X.Msg.CocoRobo_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.CocoRobo_return_list_MESSAGE0="Define list %1 = %2";X.Msg.CocoRobo_return_list_TOOLTIP="Define a list";X.Msg.CocoRobo_ORDER="#";X.Msg.CocoRobo_REVERSE_ORDER="Countdown #";X.Msg.LIST_ORDER_ITEM_MESSAGE0="List %1 %2 %3 item";X.Msg.LIST_ORDER_ITEM_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.CocoRobo_lists_append_MESSAGE0="Add item %2 at the end of list %1";X.Msg.CocoRobo_lists_append_TOOLTIP="Add item to the end of the list";X.Msg.CocoRobo_lists_append_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.LIST_ITEM_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.LIST_ITEM_EXIST_TOOLTIP="The list contains a specific string";X.Msg.LIST_ITEM_EXIST_MESSAGE0="List %1 include %2";X.Msg.SET_LIST_ORDER_ITEM_MESSAGE0="Set list %1 %2 %3 item as %4";X.Msg.SET_LIST_ORDER_ITEM_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.SET_LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.INSERT_LIST_ORDER_ITEM_MESSAGE0="Insert list %1 %2 %3 item as %4";X.Msg.INSERT_LIST_ORDER_ITEM_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.INSERT_LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.LIST_ORDER_ITEM_MESSAGE0="List %1 %2 %3 item";X.Msg.LIST_ORDER_ITEM_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.LIST_ORDER_ITEM_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.PARTS_OF_LIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.PARTS_OF_LIST_TOOLTIP=`Incremental order fetching
- Example:
- reciprocal number 5 to reciprocal number 2;
- 0th to 5th`;X.Msg.PARTS_OF_LIST_MESSAGE0="Return list %1 takes %2 %3 items to %4 %5 items";X.Msg.LIST_TO_TUPLE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.LIST_TO_TUPLE_TOOLTIP="List conversion to tuple";X.Msg.LIST_TO_TUPLE_MESSAGE0="List %1 conversion to tuple";X.Msg.CocoRobo_lists_clear_MESSAGE0="Clear list %1";X.Msg.CocoRobo_lists_clear_TOOLTIP="Clear the list";X.Msg.CocoRobo_lists_clear_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.CocoRobo_lists_extend_MESSAGE0="List %1 append list %2";X.Msg.CocoRobo_lists_extend_TOOLTIP="Append list to list";X.Msg.CocoRobo_lists_extend_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.LIST_FIRST_INDEX_HELPURL="";X.Msg.LIST_FIRST_INDEX_MESSAGE0="Location of item%1 in list%2 %3";X.Msg.LIST_FIRST_INDEX_TOOLTIP="Returns the position where the specified string appears in the list %3";X.Msg.FIRST="First";X.Msg.LAST="Last";X.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP="Add an item to the dictionary.";X.Msg.DICT_KEY_VALUE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.DICT_KEY_VALUE_TOOLTIP="Returns the value of the specified key of the dictionary";X.Msg.DICT_KEY_VALUE_MESSAGE0="Value of the key %2 in dictionary %1";X.Msg.ADD_DICT_KEY_VALUE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.ADD_DICT_KEY_VALUE_TOOLTIP="Update the key if the key already exists";X.Msg.ADD_DICT_KEY_VALUE_MESSAGE0="Add key %2 & value %3 to dictionary %1";X.Msg.DICT_LENGTH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.DICT_LENGTH_TOOLTIP="Returns the length of the dictionary";X.Msg.DICT_LENGTH_MESSAGE0="Length of dictionary %1";X.Msg.DICT_KEY_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.DICT_KEY_EXIST_TOOLTIP="Determine whether the dictionary contains the specified key, and return True or False";X.Msg.DICT_KEY_EXIST_MESSAGE0="Dictionary %1 include key %2";X.Msg.DICT_KEY_OR_VAL_LIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP="Return list of %2 in dictionary";X.Msg.DICT_KEY_OR_VAL_LIST_MESSAGE0="List of %2 in dictionary %1";X.Msg.DICT_KEYS="KEY";X.Msg.DICT_VALUES="VALUE";X.Msg.DICT_CREATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.DICT_CREATE_WITH_TOOLTIP="Define a dictionary";X.Msg.DICT_CREATE_WITH_MESSAGE0="Define dictionary %1 = %2";X.Msg.tuple_create_with_MESSAGE0="Define tuple %1 = %2 ";X.Msg.tuple_create_with_TOOLTIP="When you only have one element, you need to add a comma after the element";X.Msg.tuple_create_with_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.tuple_order_item_MESSAGE0="Tuple %1 %2 %3 item";X.Msg.tuple_order_item_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.tuple_order_item_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.CocoRobo_MIN="Min value";X.Msg.CocoRobo_MAX="Max value";X.Msg.CocoRobo_LENTH="length";X.Msg.TUPLE_MIN_MAX_LEN_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP="Return %2 of tuple";X.Msg.TUPLE_MIN_MAX_LEN_MESSAGE0="Tuple %1 %2";X.Msg.TUPLE_ITEM_EXIST_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.TUPLE_ITEM_EXIST_TOOLTIP="Determine whether the specified value is included, and return True or False";X.Msg.TUPLE_ITEM_EXIST_MESSAGE0="Tuple %1 include %2";X.Msg.PARTS_OF_TUPLE_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.PARTS_OF_TUPLE_TOOLTIP="The sequence count starts from 0, and the reverse count starts from 1.";X.Msg.PARTS_OF_TUPLE_MESSAGE0="Return tuple %1 from the %2 to the last item";X.Msg.PARTS_OF_TUPLE2_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.PARTS_OF_TUPLE2_TOOLTIP=`Incremental order fetching
- Example:
- reciprocal number 5 to reciprocal number 2;
- 0th to 5th`;X.Msg.PARTS_OF_TUPLE2_MESSAGE0="Return tuple %1 takes %2 %3 items to %4 %5 items";X.Msg.SET_CREATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.SET_CREATE_WITH_TOOLTIP="Define collection";X.Msg.SET_CREATE_WITH_MESSAGE0="Define set %1 = %2";X.Msg.SET_UPDATE_WITH_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.SET_UPDATE_WITH_TOOLTIP="Add parameters as strings, lists, tuples, sets, dictionaries (add only key). For existing elements, do not do anything";X.Msg.SET_UPDATE_WITH_MESSAGE0="Update set %1 with %2";X.Msg.INTERSECTION_OF_SETS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.INTERSECTION_OF_SETS_TOOLTIP="Return %1 of both collection";X.Msg.INTERSECTION_OF_SETS_MESSAGE0="%1 of set %2 and set %3";X.Msg.CocoRobo_INTERSECTION="Intersection";X.Msg.CocoRobo_UNION="Union";X.Msg.CocoRobo_DIFFERENCE="Difference";X.Msg.SETS_UPDATE_WAYS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.SETS_UPDATE_WAYS_TOOLTIP="The collection is updated to the %3 of the specified collection";X.Msg.SETS_UPDATE_WAYS_MESSAGE0="Update set %1 as the %3 with set %2";X.Msg.SUBSET_SUPERSET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.SUBSET_SUPERSET_TOOLTIP="Collection is %3 of collection";X.Msg.SUBSET_SUPERSET_MESSAGE0="Set %1 is %3 of set %2";X.Msg.CocoRobo_SUBSET="Subset";X.Msg.CocoRobo_SUPERSET="Superset";X.Msg.GET_SETS_POP_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.GET_SETS_POP_TOOLTIP="Return the collection with random items removed";X.Msg.GET_SETS_POP_MESSAGE0="Return a random item from the set %1, and remove it";X.Msg.LEN_OF_SETS_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.LEN_OF_SETS_TOOLTIP="Returns the length of the specified collection";X.Msg.LEN_OF_SETS_MESSAGE0="Length of set %1";X.Msg.CREATE_EMPTY_SET_HELPURL="https://CocoRobox.readthedocs.io/zh_CN/latest/CocoRoboX.html";X.Msg.CREATE_EMPTY_SET_TOOLTIP="";X.Msg.CREATE_EMPTY_SET_MESSAGE0="Create empty sets %1";X.Msg.io_high="HIGH";X.Msg.io_low="LOW";X.Msg.digital_set="Set GPIO #";X.Msg.digital_set_as="to";X.Msg.digital_get="Get GPIO #";X.Msg.digital_get_value="Digital Read";X.Msg.digital_set_title="Setting specific pins for specific levels";X.Msg.digital_get_value_title="Returns the digital signal value of a specific pin";X.Msg.time_iot_module="IoT Module ";X.Msg.time_ai_module="A.I. Module";X.Msg.analog_get_moudule="Module Get Pin #";X.Msg.analog_get_value="Analog Value (PWM)";X.Msg.set_pin="(range:0 ~ 1023)";X.Msg.Esp32_Main_Controller_Io_From_Analog_Pin_TOOLTIP="The module obtains the analog signal value of a specific pin";X.Msg.time_init_timer="Initialize Timer";X.Msg.time_timer_get_time="Get time elapsed from Timer (ms)";X.Msg.time_timer_clear="Clear Timer";X.Msg.time_timer_periodically="Enable Periodical Timer";X.Msg.time_timer_every="Every";X.Msg.time_timer_ms="Millisecond(s)";X.Msg.time_execution="Do";X.Msg.time_timer_periodically_clear="Clear Periodical Timer";X.Msg.time_get_current_date_title="Get Current Time:";X.Msg.time_get_current_date_y="Year";X.Msg.time_get_current_date_m="Month";X.Msg.time_get_current_date_d="Day";X.Msg.time_get_current_date_hour="Hour";X.Msg.time_get_current_date_min="Minute";X.Msg.time_get_current_date_sec="Second";X.Msg.serialcomm_print="Serial print";X.Msg.serialcomm_write_title_text="Send Data to other devices through the serial port";X.Msg.serialcomm_read_setup_title_text="Obtain data through the serial port";X.Msg.serialcomm_read_setup_title_text_1=" to initialize";X.Msg.serial_read_data="From ";X.Msg.Serial_Read_Data_all="Get the data of the serial port and save it to";X.Msg.ARD_SERIAL_RECEIVE_DATASET_GET_TEXT="Get Serial (UART) Data at ";X.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_TEXT="as Type";X.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_FLOAT="Float";X.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_INTEGER="Number";X.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_STRING="String";X.Msg.serialcomm_write_item_first="Data ";X.Msg.serialcomm_write_item_last="";X.Msg.serialcomm_write_item="Item";X.Msg.serialcomm_write_data="Data";X.Msg.serialcomm_write_data_bps_title="Set Baud Rate:";X.Msg.serialcomm_write_data_bps_attrib="bps";X.Msg.serialcomm_write_on="On";X.Msg.serialcomm_write_on_ai="AI Module ";X.Msg.serialcomm_write_on_iot="IoT Module ";X.Msg.serialcomm_write_on_iot_lite="IoT Lite Module ";X.Msg.serial_send_data_on="On";X.Msg.serial_send_data_on_send_data="Module Send Data to Microbit";X.Msg.serial_new_send_data="Serial port writing text";X.Msg.serial_new_send_data_1="Nowrap";X.Msg.serial_new_send_data_2="Wrap";X.Msg.serial_new_send_data_3="Serial port writing single byte";X.Msg.serial_new_send_data_4="Serial port write byte list";X.Msg.serial_new_get_data_1="Serial port has readable data";X.Msg.serial_new_get_data_2="Serial port reads a row of data";X.Msg.serial_new_get_data_3="Serial port reading data";X.Msg.serial_new_get_data_4="The length of data read by serial port is";X.Msg.serial_close="Close the serial port";X.Msg.SYSTEM="Restart System";X.Msg.SYSTEM_GC="Start memory reclaim";X.Msg.SYSTEM_RUN="Execute Python Code:";X.Msg.SYSTEM_RUN_F="Filename:";X.Msg.SYSTEM_CREATE="Create Text file";X.Msg.SYSTEM_CREATE_FILE="Create file";X.Msg.SYSTEM_CREATE_F="Filename:";X.Msg.SYSTEM_CREATE_F_1="File Path:";X.Msg.SYSTEM_WRITE="Create Text file";X.Msg.SYSTEM_OPEN_FILE="Open file";X.Msg.SYSTEM_WRITE_FILE="Write file";X.Msg.SYSTEM_CLOSE_FILE="Close file";X.Msg.SYSTEM_WRITE_F="Filename:";X.Msg.SYSTEM_WRITE_W="Write content:";X.Msg.SYSTEM_WRITE_S="The separator is:";X.Msg.SYSTEM_WRITE_S_N="newline";X.Msg.SYSTEM_WRITE_S_C="comma";X.Msg.SYSTEM_WRITE_S_S="space";X.Msg.SYSTEM_WRITE_S_SE="semicolon";X.Msg.SYSTEM_INPUT="Read Text File as List";X.Msg.SYSTEM_INPUT_FILE="Read File as List";const lxe=X.Msg,axe={xml:`<xml style="height: 100%">
- <category id="catLogic" name="Logic" colour="#4c97ff">
- <block type="controls_if"></block>
- <block type="logic_compare"></block>
- <block type="logic_operation"></block>
- <block type="logic_negate"></block>
- <block type="logic_boolean"></block>
- <block type="logic_null"></block>
- <block type="logic_ternary"></block>
- <block type="CocoRobo_return"></block>
- <block type="CocoRobo_try_except"></block>
- <block type="CocoRobo_try_except_finally"></block>
- <block type="CocoRobo_type"></block>
- <block type="CocoRobo_type_is"></block>
- <block type="CocoRobo_eval"></block>
- </category>
- <category id="catLoops" name="Loops" colour="#9d64fd">
- <block type="controls_repeat_forever"></block>
- <block type="controls_repeat_ext">
- <value name="TIMES">
- <shadow type="math_number">
- <field name="NUM">10</field>
- </shadow>
- </value>
- </block>
- <block type="controls_whileUntil"></block>
- <block type="controls_for">
- <value name="FROM">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="TO">
- <shadow type="math_number">
- <field name="NUM">10</field>
- </shadow>
- </value>
- <value name="BY">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="controls_forEach"></block>
- <block type="controls_flow_statements"></block>
- </category>
- <category id="catMath" name="Math" colour="#5472ea">
- <block type="math_number" gap="32"></block>
- <block type="math_arithmetic">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="math_degrad"></block>
- <block type="math_single">
- <value name="NUM">
- <shadow type="math_number">
- <field name="NUM">9</field>
- </shadow>
- </value>
- </block>
- <block type="math_trig">
- <value name="NUM">
- <shadow type="math_angle">
- <field name="angle">45</field>
- </shadow>
- </value>
- </block>
- <block type="math_constant"></block>
- <block type="math_number_property">
- <value name="NUMBER_TO_CHECK">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- <block type="math_round">
- <value name="NUM">
- <shadow type="math_number">
- <field name="NUM">3.1</field>
- </shadow>
- </value>
- </block>
- <block type="math_keep_decimal">
- <value name="NUM">
- <shadow type="math_number">
- <field name="NUM">3.1415926</field>
- </shadow>
- </value>
- <value name="PLACE">
- <shadow type="math_number">
- <field name="NUM">2</field>
- </shadow>
- </value>
- </block>
- <block type="math_on_list"></block>
- <block type="math_modulo">
- <value name="DIVIDEND">
- <shadow type="math_number">
- <field name="NUM">64</field>
- </shadow>
- </value>
- <value name="DIVISOR">
- <shadow type="math_number">
- <field name="NUM">10</field>
- </shadow>
- </value>
- </block>
- <block type="math_division_consult">
- <value name="DIVIDEND">
- <shadow type="math_number">
- <field name="NUM">64</field>
- </shadow>
- </value>
- <value name="DIVISOR">
- <shadow type="math_number">
- <field name="NUM">10</field>
- </shadow>
- </value>
- </block>
- <block type="math_constrain">
- <value name="VALUE">
- <shadow type="math_number">
- <field name="NUM">50</field>
- </shadow>
- </value>
- <value name="LOW">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="HIGH">
- <shadow type="math_number">
- <field name="NUM">100</field>
- </shadow>
- </value>
- </block>
- <block type="labplus_mapping">
- <value name="inputNum"><shadow type="math_number"><field name="NUM">10</field></shadow></value>
- <value name="bMin"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="bMax"><shadow type="math_number"><field name="NUM">100</field></shadow></value>
- <value name="cMin"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="cMax"><shadow type="math_number"><field name="NUM">200</field></shadow></value>
- </block>
- <block type="math_random_int">
- <value name="FROM">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="TO">
- <shadow type="math_number">
- <field name="NUM">100</field>
- </shadow>
- </value>
- </block>
- <block type="math_random_randrange">
- <value name="start"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="stop"><shadow type="math_number"><field name="NUM">10</field></shadow></value>
- <value name="step"><shadow type="math_number"><field name="NUM">2</field></shadow></value>
- </block>
- <block type="math_random_float"></block>
- <block type="math_convert"></block>
- <block type="math_number_bits_ops">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="bit_inversion">
- <value name="data"><shadow type="math_number"><field name="NUM">60</field></shadow></value>
- </block>
- <block type="CocoRobo_ten_convert_to">
- <value name="int_num"><shadow type="math_number"><field name="NUM">10</field></shadow></value>
- </block>
- <block type="CocoRobo_convert_to_ten">
- <value name="convert_str"><shadow type="text"><field name="TEXT">11</field></shadow></value>
- </block>
- <block type="CocoRobo_ten_converted_to_bytes">
- <value name="convert_num"><shadow type="math_number"><field name="NUM">11</field></shadow></value>
- </block>
- <block type="CocoRobo_int_to_chr">
- <value name="convert_num"><shadow type="math_number"><field name="NUM">97</field></shadow></value>
- </block>
- <block type="CocoRobo_chr_to_int">
- <value name="convert_chr"><shadow type="text"><field name="TEXT">a</field></shadow></value>
- </block>
- <block type="CocoRobo_str_to_hex">
- <value name="convert_chr"><shadow type="text"><field name="TEXT">abcdfg</field></shadow></value>
- </block>
- <block type="CocoRobo_hex_to_bin_str">
- <value name="convert_chr"><shadow type="text"><field name="TEXT">313233</field></shadow></value>
- </block>
- <block type="CocoRobo_data_to_base64">
- <value name="data"><shadow type="text"><field name="TEXT">cocorobo</field></shadow></value>
- </block>
- <block type="CocoRobo_base64_to_data">
- <value name="data"><shadow type="text"><field name="TEXT">bXB5dGhvbg==</field></shadow></value>
- </block>
- </category>
- <category id="catVariables" name="Variables" custom="VARIABLE" colour="#ffab2f">' +
- </category>
- <category id="catText" name="Text" colour="#33cc99">
- <block type="text"><field name="TEXT"></field></block>
- <block type="text_join"><mutation items="1"></mutation></block>
- <block type="text_join"></block>
- <block type="text_split_string_by_delimiter"></block>
-
- <block type="text_format">
- <value name="FORMAT">
- <shadow type="text"><field name="TEXT">Value: %.2f</field></shadow>
- </value>
- <value name="CONTENT">
- <block type="tuple_create_with_items_insert">
- <mutation items="1"></mutation>
- <value name="ADD0">
- <block type="math_number">
- <field name="NUM">3.1415926</field>
- </block>
- </value>
- </block>
- </value>
- </block>
- <block type="text_format2">
- <value name="FORMAT">
- <shadow type="text"><field name="TEXT">Value: {:.3}</field></shadow>
- </value>
- <value name="CONTENT">
- <block type="tuple_create_with_items_insert">
- <mutation items="1"></mutation>
- <value name="ADD0">
- <block type="math_number">
- <field name="NUM">3.1415926</field>
- </block>
- </value>
- </block>
- </value>
- </block>
- <block type="CocoRobo_text_ESC"></block>
- <block type="text_append_text">
- <value name="text_abc">
- <shadow type="text"><field name="TEXT">abc</field></shadow>
- </value>
- <value name="append_text">
- <shadow type="text"><field name="TEXT">def</field></shadow>
- </value>
- </block>
- <block type="text_is_number">
- <value name="TEXT">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- <block type="text_length">
- <value name="VALUE">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- <block type="text_isEmpty">
- <value name="VALUE">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- <block type="text_indexOf">
- <value name="VALUE">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- <value name="FIND">
- <shadow type="text">
- <field name="TEXT">b</field>
- </shadow>
- </value>
- </block>
- <block type="text_charAt">
- <value name="VALUE">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="text_getSubstring">
- <value name="STRING">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="text_changeCase">
- <value name="TEXT">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- <block type="text_trim">
- <value name="TEXT">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- <block type="text_to_byte">
- <value name="TEXT">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="CocoRobo_bytes_decode">
- <value name="bytes_decode"></value>
- </block>
- <block type="CocoRobo_ujson_dumps">
- <value name="data">
- <shadow type="text_dict">
- <field name="TEXT">"Age":8</field>
- </shadow>
- </value>
- </block>
- <block type="CocoRobo_ujson_loads">
- <value name="data">
- <shadow type="text">
- <field name="TEXT">{"Age":8}</field>
- </shadow>
- </value>
- </block>
- <block type="CocoRobo_code_annotation">
- <value name="data">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- </category>
- <category id="catLists" name="Lists" colour="#40bfe4">
- <block type="lists_create_with"><mutation items="0"></mutation></block>
- <block type="lists_create_with"></block>
- <block type="text_list"><field name="TEXT">0, 0, 0</field></block>
- <block type="CocoRobo_return_list">
- <value name="list_name"><block type="variables_get"><field name="VAR">my_list</field></block></value>
- <value name="list_items"><shadow type="text_list"><field name="TEXT">0, 0, 0</field></shadow></value>
- </block>
- <block type="list_order_item">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- <value name="list_order_item"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- </block>
- <block type="lists_append">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- </block>
- <block type="list_item_exist">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- <value name="list_item"><shadow type="text"><field name="TEXT">cocorobo</field></shadow></value>
- </block>
- <block type="lists_extend">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- <value name="extend_list"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- </block>
- <block type="lists_clear">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- </block>
- <block type="lists_repeat">
- <value name="NUM">
- <shadow type="math_number">
- <field name="NUM">5</field>
- </shadow>
- </value>
- </block>
- <block type="lists_length"></block>
- <block type="lists_isEmpty"></block>
- <block type="list_first_index">
- <value name="elem"><shadow type="text"><field name="TEXT">cocorobo</field></shadow></value>
- <value name="my_list"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- </block>
- <block type="set_list_order_item">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- <value name="list_order_item"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="set_value"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- </block>
- <block type="insert_list_order_item">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- <value name="list_order_item"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="set_value"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- </block>
- <block type="parts_of_list">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- <value name="start_item"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="end_item"><shadow type="math_number"><field name="NUM">2</field></shadow></value>
- </block>
- <block type="lists_getIndex">
- <mutation statement="true" at="true"></mutation>
- <field name="MODE">REMOVE</field>
- <field name="WHERE">FROM_START</field>
- <value name="VALUE">
- <shadow type="text_list"><field name="TEXT"></field></shadow>
- </value>
- </block>
- <block type="lists_getIndex">
- <mutation statement="false" at="true"></mutation>
- <field name="MODE">GET_REMOVE</field>
- <field name="WHERE">FROM_START</field>
- <value name="VALUE">
- <shadow type="text_list"><field name="TEXT"></field></shadow>
- </value>
- </block>
- <block type="lists_split">
- <value name="DELIM"><shadow type="text"><field name="TEXT">,</field></shadow></value>
- </block>
- <block type="lists_sort"></block>
- </category>
- <category id="catDictionary" name="Dictionary" colour="32">
- <block type="text_dict"><field name="TEXT">"Age":8</field></block>
- <block type="dict_create_with">
- <value name="dict_name"><block type="variables_get"><field name="VAR">my_dict</field></block></value>
- <value name="dict_items"><shadow type="text_dict"><field name="TEXT">"Age":8</field></shadow></value>
- </block>
- <block type="add_dict_key_value">
- <value name="dict_name"><shadow type="text_dict"><field name="TEXT"></field></shadow></value>
- <value name="dict_items"><shadow type="text"><field name="TEXT">Age</field></shadow></value>
- <value name="add_value"><shadow type="math_number"><field name="NUM">10</field></shadow></value>
- </block>
- <block type="dict_key_value">
- <value name="dict_name"><shadow type="text_dict"><field name="TEXT"></field></shadow></value>
- <value name="dict_items"><shadow type="text"><field name="TEXT">Age</field></shadow></value>
- </block>
- <block type="dict_length">
- <value name="dict_name"><shadow type="text_dict"><field name="TEXT"></field></shadow></value>
- </block>
- <block type="dict_key_exist">
- <value name="dict_name"><shadow type="text_dict"><field name="TEXT"></field></shadow></value>
- <value name="dict_items"><shadow type="text"><field name="TEXT">Age</field></shadow></value>
- </block>
- <block type="dict_key_or_val_list">
- <value name="dict_name"><shadow type="text_dict"><field name="TEXT"></field></shadow></value>
- </block>
- </category>
- <category id="catTuples" name="Tuples" colour="192">
- <block type="tuple_create_with_items_insert"></block>
- <block type="text_tuple"><field name="TEXT">"cocorobo",</field></block>
- <block type="tuple_create_with">
- <value name="tuple_name"><block type="variables_get"><field name="VAR">my_tuple</field></block></value>
- <value name="tuple_items"><shadow type="text_tuple"><field name="TEXT">"cocorobo",</field></shadow></value>
- </block>
- <block type="tuple_order_item">
- <value name="tuple_name"><shadow type="text_tuple"><field name="TEXT"></field></shadow></value>
- <value name="tuple_order_item"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- </block>
- <block type="tuple_min_max_len">
- <value name="tuple_name"><shadow type="text_tuple"><field name="TEXT"></field></shadow></value>
- </block>
- <block type="tuple_item_exist">
- <value name="tuple_name"><shadow type="text_tuple"><field name="TEXT"></field></shadow></value>
- <value name="tuple_item"><shadow type="text"><field name="TEXT">cocorobo</field></shadow></value>
- </block>
- <block type="parts_of_tuple">
- <value name="tuple_name"><shadow type="text_tuple"><field name="TEXT"></field></shadow></value>
- <value name="tuple_item"><shadow type="math_number"><field name="NUM">2</field></shadow></value>
- </block>
- <block type="parts_of_tuple2">
- <value name="tuple_name"><shadow type="text_tuple"><field name="TEXT"></field></shadow></value>
- <value name="start_item"><shadow type="math_number"><field name="NUM">0</field></shadow></value>
- <value name="end_item"><shadow type="math_number"><field name="NUM">2</field></shadow></value>
- </block>
- <block type="list_to_tuple">
- <value name="list_name"><shadow type="text_list"><field name="TEXT"></field></shadow></value>
- </block>
- </category>
- <category id="catSet" name="Set" colour="160">
- <block type="set_create_with_items_insert"></block>
- <block type="text_set"><field name="TEXT">"string", 0.9, ("tuple",)</field></block>
- <block type="set_create_with">
- <value name="set_name"><block type="variables_get"><field name="VAR">my_set</field></block></value>
- <value name="set_items"><shadow type="text_set"></shadow></value>
- </block>
- <block type="sets_update_ways">
- <value name="set_name"><block type="variables_get"><field name="VAR">my_set</field></block></value>
- <value name="set_1_name"><shadow type="text_set"></shadow></value>
- </block>
- <block type="set_update_with">
- <value name="set_name"><shadow type="text_set"></shadow></value>
- <value name="set_items"></value>
- </block>
- <block type="set_subset_superset">
- <value name="set_name"><shadow type="text_set"></shadow></value>
- <value name="set_1_name"><shadow type="text_set"></shadow></value>
- </block>
- <block type="intersection_of_sets">
- <value name="set_name"><shadow type="text_set"></shadow></value>
- <value name="set_1_name"><shadow type="text_set"></shadow></value>
- </block>
- <block type="len_of_sets">
- <value name="set_name"><shadow type="text_set"></shadow></value>
- </block>
- <block type="get_sets_pop">
- <value name="set_name"><shadow type="text_set"></shadow></value>
- </block>
- </category>
- <category id="catFunctions" name="Functions" colour="#ff6381" custom="PROCEDURE">
- </category>
- <category id="catOutput" name="Output" colour="#ff8b2c" >
- <block type="esp32_main_controller_io_from_digital_pin">
- <value name="digital_pin_input">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="esp32_main_controller_io_set_digital_pin">
- <value name="digital_pin_input">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="high_low">
- <shadow type="esp32_main_controller_io_high_low"></shadow>
- </value>
- </block>
- <block type="esp32_main_controller_io_from_analog_pin"></block>
- </category>
- <category id="catFiles" name="Files" colour="32">
- <block type="iot_system_run">
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/your_python_code.py</field>
- </shadow>
- </value>
- </block>
- <block type="iot_system_create_file">
- <value name="filename">
- <shadow type="text">
- <field name="TEXT">cocorobo.txt</field>
- </shadow>
- </value>'
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/</field>
- </shadow>
- </value>'
- </block>
- <block type="iot_system_open_file">
- <value name="filename">
- <shadow type="text">
- <field name="TEXT">cocorobo.txt</field>
- </shadow>
- </value>'
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/</field>
- </shadow>
- </value>
- </block>
- <block type="iot_system_write_file">
- <value name="WPATH">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- </block>
- <block type="iot_system_close_file"></block>
- <block type="iot_system_input_file">
- <value name="filename">
- <shadow type="text">
- <field name="TEXT">cocorobo.txt</field>
- </shadow>
- </value>'
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/</field>
- </shadow>
- </value>'
- </block>
- <block type="iot_system_delete_file">
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/cocorobo.txt</field>
- </shadow>
- </value>
- </block>
- </category>
- <category id="catTime" name="Time" colour="#fabe23">
- <block type="time_delay">
- <value name="DELAY_TIME_MILI">
- <block type="math_number">
- <field name="NUM">1000</field>
- </block>
- </value>
- </block>
- <block type="time_delayseconds">
- <value name="DELAY_TIME_MICRO">
- <block type="math_number">
- <field name="NUM">1</field>
- </block>
- </value>
- </block>
- <block type="esp32_get_current_date"></block>
- <block type="esp32_main_controller_time_timer_init"></block>
- <block type="esp32_main_controller_time_timer_get_current"></block>
- <block type="esp32_main_controller_time_timer_clear"></block>
- <block type="esp32_main_controller_time_period_timer"></block>
- <block type="esp32_main_controller_time_period_timer_clear"></block>
- </category>
- <category id="catSerial" name="SerialComm" colour="#22b845">
- <block type="serial_comm_print">
- <value name="serial_comm_input">
- <shadow type="text">
- <field name="TEXT">Hello World!</field>
- </shadow>
- </value>
- </block>
- <block type="serial_write_data_coco">
- <value name="ADD0">
- <shadow type="text">
- <field name="TEXT">Data</field>
- </shadow>
- </value>
- </block>
- <block type="serial_write_data">
- <value name="ADD1">
- <shadow type="text">
- <field name="TEXT">Data</field>
- </shadow>
- </value>
- </block>
- <block type="serial_read_data_setup"></block>
- <block type="serial_read_data_all"></block>
- <block type="serial_read_data"></block>
- <block type="serial_read_data_clear"></block>
- <block type="serial_send_data_to_microbit">
- <value name="NAME">
- <shadow type="text">
- <field name="TEXT">Data</field>
- </shadow>
- </value>
- </block>
- <block type="serial_send_data_to_control_panel">
- <value name="NAME">
- <shadow type="text">
- <field name="TEXT">Data</field>
- </shadow>
- </value>
- </block>
- </category>
- <category id="catBasicFunctions" name="基础功能" colour="#3163ed">
- <category id="catBasic" name="Basics" colour="#d42b03">
- <label id="basis_button" text="Basis button" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_v831_button_read_pressed"></block>
- <block type="ai_v831_button_read_released"></block>
- <label id="catFASTLED" text="灯光" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_v831_led_light_up"></block>
- <block type="ai_v831_led_light_off"></block>
- <label id="rgb_light" text="RGB灯光" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_v831_rgb_light_up">
- <value name="rgb_value">'
- <block type="ai_lcd_rgb_value_input">'
- <value name="rgb_value_r">'
- <shadow type="math_number">'
- <field name="NUM">0</field>'
- </shadow>'
- </value>'
- <value name="rgb_value_g">'
- <shadow type="math_number">'
- <field name="NUM">0</field>'
- </shadow>'
- </value>'
- <value name="rgb_value_b">'
- <shadow type="math_number">'
- <field name="NUM">0</field>'
- </shadow>'
- </value>'
- </block>'
- </value>'
- </block>
- <block type="ai_v831_rgb_light_off"></block>
- </category>
- <category id="catSensors" name="传感器" colour="#5fcd8e">
- <label id="basis_light" text="光照传感器" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="esp32_main_controller_get_light"></block>
- <label id="basis_environmental" text="温湿度传感器" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="esp32_main_controller_get_environmental_value"></block>
- <label id="" text="QMI8658" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="esp32_main_controller_motion_acceleration"></block>
- <block type="esp32_main_controller_motion_rotation_measurement"></block>
- <block type="esp32_main_controller_motion_tilt_angle"></block>
- </category>
- <category id="catPower" name="动力" colour="#386dc8">
- <label id="catServo" text="舵机" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="extension_servo_setup_on_ai"></block>
- <block type="extension_servo_write_on_ai">
- <value name="degree">
- <shadow type="math_number">
- <field name="NUM">90</field>
- </shadow>
- </value>
- </block>
- <label id="catMOTOR" text="电机" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_motor_setup"></block>
- <block type="ai_motor_run">
- <value name="speed">
- <shadow type="math_number">
- <field name="NUM">150</field>
- </shadow>
- </value>
- </block>
- </category>
- <category id="catAIScreen" name="Screen" colour="#5cb2d6">
- <label id="catBasicFunctions" text="Basis function" web-class="myLabelStyle" style="font-size:20px;"></label><label id="catLCD" text="LCD" web-class="myLabelStyle" style="font-size:20px;"></label>
-
- <block type="ai_lcd_font">
- <value name="save_path">
- <shadow type="text">
- <field name="TEXT">/root/preset/fonts/CascadiaCodePL-Italic.ttf</field>
- </shadow>
- </value>
- </block>
- <label id="basis_carvas_draw" text="Basis carvas drawing" web-class="myLabelStyle" style="font-size:20px;"></label>
-
- <block type="ai_lcd_fill_screen_with_rgb">
- <value name="rgb_value">
- <block type="ai_lcd_rgb_value_input">
- <value name="rgb_value_r">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="rgb_value_g">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="rgb_value_b">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- <block type="ai_lcd_textcarvas">
- <value name="POSA">
- <block type="lcd_set_position">
- <value name="POSX">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="POSY">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="CONTENT">
- <shadow type="text">
- <field name="TEXT"></field>
- </shadow>
- </value>
- <value name="COLOR">
- <block type="lcd_set_color">
- </block>
- </value>
- <value name="Scale">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="ai_lcd_linecarvas">
- <value name="POSA">
- <block type="lcd_set_position">
- <value name="POSX">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="POSY">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="POSB">
- <block type="lcd_set_position">
- <value name="POSX">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="POSY">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="COLOR">
- <block type="lcd_set_color"></block>
- </value>
- <value name="Scale">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="ai_lcd_draw_rectangle">
- <value name="POSA">
- <block type="lcd_set_position">
- <value name="POSX">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="POSY">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="POSB">
- <block type="lcd_set_width_height">
- <value name="WIDTH">
- <shadow type="math_number">
- <field name="NUM">320</field>
- </shadow>
- </value>
- <value name="HEIGHT">
- <shadow type="math_number">
- <field name="NUM">240</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="COLOR">
- <block type="lcd_set_color"></block>
- </value>
- <value name="Scale">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="ai_lcd_drawcirclecarvas">
- <value name="POSA">
- <block type="lcd_set_position">
- <value name="POSX">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="POSY">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="Scale">
- <shadow type="math_number">
- <field name="NUM">2</field>
- </shadow>
- </value>
- <value name="COLOR">
- <block type="lcd_set_color">
- </block>
- </value>
- <value name="Scale_0">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <block type="ai_lcd_draw_image_on_canvas">
- <value name="image_path">
- <block type="image_open">
- <value name="save_path">
- <shadow type="text">
- <field name="TEXT">/root/user/img/saved.jpg</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="scale_y">
- <block type="lcd_set_position">
- <value name="POSX">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="POSY">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- <block type="ai_lcd_showcarvas_set_display"></block>
- <block type="ai_lcd_clearcanvas"></block>
- </category>
- <category id="catCamera" name="摄像头" colour="#60c1bb">
- <block type="ai_camera_windows"></block>
- <block type="ai_camera_image_property_change"></block>
- <block type="ai_camera_snapshot"></block>
- <block type="v831_camera_graph_transmission"></block>
- </category>
- <category id="catMicrophone" name="Camera" colour="#5fcd8e">
- <label id="catMicrophone" text="麦克风" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_mphone_record_init"></block>
- <block type="ai_mphone_record_setting">' +
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/root/user/audio/record.wav</field>
- </shadow>
- </value>
- <value name="record_time">
- <shadow type="math_number">
- <field name="NUM">4</field>
- </shadow>
- </value>
- </block>
- <block type="ai_mphone_Record_audio_start"></block>
- <block type="ai_mphone_Record_audio_sound_loudness_analysis"></block>
- <block type="mphone_audio_spectrum_init"></block>
- <block type="ai_mphone_read_sound_sensitivity">
- </category>
- <category id="catSpeaker" name="扬声器" colour="#603ea0">
- <block type="ai_speaker_play_wav">
- <value name="PATH">
- <shadow type="text">
- <field name="TEXT">/root/user/audio/record.wav</field>
- </shadow>
- </value>
- </block>
- <block type="set_volume">
- <value name="VOLUME">
- <shadow type="math_number">
- <field name="NUM">50</field>
- </shadow>
- </value>
- </block>
- </category>
- <category id="catSystem" name="系统功能" colour="#22398e">
- <block type="system_poweroff"></block>
- <block type="system_reboot"></block>
- <block type="system_get_cpu_temperature"></block>
- <block type="system_set_thread1">
- <block type="procedures_callNothirdreturn">
- <mutation name="system_set_thread1"></mutation>
- <value name="ARG0">
- <block type="math_number">
- <field name="NUM">1000</field>
- </block>
- </value>
- </block>
- </block>
- <block type="system_start_thread"></block>
- </category>
- </category>
- <category id="ExtendedFunction" name="媒体处理" colour="#2fc67b">
- <category id="catImage" name="图像处理" colour="#f2a247">
- <label id="basis_function" text="Basis function" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="image_save">
- <value name="save_path">
- <shadow type="text">
- <field name="TEXT">/root/user/img/saved.jpg</field>
- </shadow>
- </value>
- </block>
- <block type="image_open">
- <value name="save_path">
- <shadow type="text">
- <field name="TEXT">/root/user/img/saved.jpg</field>
- </shadow>
- </value>
- </block>
- <block type="image_rotating">
- <value name="route">
- <shadow type="math_number">
- <field name="NUM">90</field>
- </shadow>
- </value>
- </block>
- <block type="image_crop">
- <value name="xy">
- <block type="ai_lcd_XY_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="wh">
- <block type="ai_lcd_WH_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- <block type="image_resize">
- <value name="wh">
- <block type="ai_lcd_WH_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- <block type="image_find_blobs">
- <value name="color">
- <block type="ai_vision_get_threshold_default"></block>
- </value>
- <value name="xy">
- <block type="ai_lcd_XY_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="wh">
- <block type="ai_lcd_WH_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- <block type="ai_vision_get_blobs"></block>
- <block type="image_find_lines">
- <value name="color">
- <block type="ai_vision_get_threshold_default"></block>
- </value>
- <value name="xy">
- <block type="ai_lcd_XY_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="wh">
- <block type="ai_lcd_WH_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- <block type="image_get_lines_result"></block>
- <block type="ai_lane_tracking_setup">
- <value name="color">
- <block type="ai_vision_get_threshold_default"></block>
- </value>
- <value name="lsize">
- <block type="ai_canvas_area_tuple">
- <value name="xy">
- <block type="ai_lcd_XY_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">140</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="wh">
- <block type="ai_lcd_WH_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">100</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">240</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- </value>
- <value name="rsize">
- <block type="ai_canvas_area_tuple">
- <value name="xy">
- <block type="ai_lcd_XY_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">220</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">140</field>
- </shadow>
- </value>
- </block>
- </value>
- <value name="wh">
- <block type="ai_lcd_WH_vision">
- <value name="A">
- <shadow type="math_number">
- <field name="NUM">320</field>
- </shadow>
- </value>
- <value name="B">
- <shadow type="math_number">
- <field name="NUM">240</field>
- </shadow>
- </value>
- </block>
- </value>
- </block>
- </value>
- <value name="axis">
- <block type="math_number"><field name="NUM">112</field></block>
- </value>
- </block>
- <block type="image_find_qrcodes"></block>
- <block type="image_get_qrcodes_result"></block>
- <block type="image_find_barcodes"></block>
- <block type="image_get_barcodes_result"></block>
- <block type="image_find_apriltag"></block>
- <block type="image_get_apriltag_result"></block>
- </category>
- <category id="catVideo" name="视频处理" colour="#4d9994">
- <block type="record_video">
- <value name="time">
- <shadow type="math_number">
- <field name="NUM">4</field>
- </shadow>
- </value>
- <value name="save_path">
- <shadow type="text">
- <field name="TEXT">/root/user/img/saved.jpg</field>
- </shadow>
- </value>
- </block>
- <block type="play_video">
- <value name="video_path">
- <shadow type="text">
- <field name="TEXT">/root/user/video/video.mp4</field>
- </shadow>
- </value>
- </block>
- </category>
- </category>
- <category id="AI" name="人工智能" colour="#ee783a">
- <category id="AI" name="人工智能" colour="#ee783a">
- <label id="Object_classification" text="物体分类" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_object_classification"></block>
- <block type="ai_get_object_classification_result"></block>
- <label id="Object_detection" text="物体检测" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_object_detection"></block>
- <block type="ai_get_object_detection_is_result"></block>
- <block type="ai_get_object_detection_result"></block>
- <label id="face_and_keypoint detection" text="人脸及关键点检测" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_face_and_keypoint_detection"></block>
- <block type="ai_get_face_and_keypoint_detection_result"></block>
- <label id="facial_Keypoint_detection" text="人脸多关键点检测" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_facial_Keypoint_detection"></block>
- <block type="ai_get_facial_Keypoint_detection_result"></block>
- <label id="face_recognition" text="人脸识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_face_recognition"></block>
- <block type="ai_get_face_recognition_result"></block>
- <label id="Facial_expression_recognition" text="人脸表情识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_facial_expression_recognition"></block>
- <block type="ai_get_facial_expression_recognition_result"></block>
- <label id="Human_keypoint_detection" text="人体关键点检测" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_human_keypoint_detection"></block>
- <block type="ai_get_human_keypoint_detection_result"></block>
- <label id="Self_learning_classifier" text="自学习分类器" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_self_learning_classifier_init">
- <value name="class_input">
- <block type="lists_create_with">
- <value name="ADD0">
- <block type="text"><field name="TEXT">Object 1 Name</field></block>
- </value>
- <value name="ADD1">
- <block type="text"><field name="TEXT">Object 2 Name</field></block>
- </value>
- <value name="ADD2">
- <block type="text"><field name="TEXT">Object 3 Name</field></block>
- </value>
- </block>
- </value>
- </block>
- <block type="ai_set_self_learning_classifier_add_train_data"></block>
- <block type="ai_set_self_learning_classifier_save_model"></block>
- <block type="ai_set_self_learning_classifier_load_model"></block>
- <block type="ai_set_self_learning_classifier_result"></block>
- <label id="Object_trajectory_tracking_and_counting" text="物体轨迹跟踪和计数" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_object_trajectory_tracking_and_counting"></block>
- <block type="ai_set_object_trajectory_tracking_and_counting_result"></block>
- <label id="OCR_text_recognition" text="OCR文字识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_ocr_text_recognition"></block>
- <block type="ai_get_ocr_text_recognition_result"></block>
- <label id="gesture_recognition" text="手势识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_gesture_recognition"></block>
- <block type="ai_set_gesture_recognition_result"></block>
- <label id="pose_recognition" text="姿态识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_pose_recognition"></block>
- <block type="ai_set_pose_recognition_result"></block>
- <label id="Real_time_speech_recognition" text="语音实时识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_real_time_speech_recognition"></block>
- <block type="ai_get_real_time_speech_recognition_result"></block>
- <label id="Keyword_recognition" text="关键词识别" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_keyword_recognition"></block>
- <block type="ai_get_keyword_recognition_result"></block>
- </category>
- <category id="AIGC" name="AIGC" colour="#0000FF">
- <block type="Initialize_the_AIGC_large_model"></block>
- <block type="ai_set_aigc_image_generation">
- <value name="generation">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="ai_get_aigc_image_generation_result"></block>
- <label id="ai_agent" text="智能体" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="ai_set_ai_agent">
- <value name="NAME">
- <shadow type="text">
- <field name="TEXT">ENTER_YOUR_EVENT_API_KEY</field>
- </shadow>
- </value>
- <value name="NAME1">
- <shadow type="text">
- <field name="TEXT">Problem</field>
- </shadow>
- </value>
- </block>
- </category>
- </category>
- <category id="catIOT" name="物联网" colour="#7e3cca">
- <category id="catIOT_WIFI" name="WIFI" colour="#7e3cca">
- <block type="wifi_connect"></block>
- <block type="wifi_disconnect"></block>
- <block type="wifi_is_connected"></block>
- <block type="wifi_get_ip"></block>
- <block type="network_time"></block>
- </category>
- <category id="catNetworkCommunication" name="网络通信" colour="#3062c1">
- <label id="Get_weather" text="获取天气信息" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="set_network_weather"></block>
- <block type="get_network_weather"></block>
- <label id="IFTTT" text="IFTTT" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="esp32_main_controller_ifttt_send_data">
- <value name="ifttt_data_1">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="ifttt_data_2">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- <value name="ifttt_data_3">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- <block type="esp32_main_controller_ifttt_touched"></block>
- <label id="basis_service_thingspeak" text="Basis service thingspeak" web-class="myLabelStyle" style="font-size:20px;"></label>' +
- <block type="iot_service_thingspeak">
- <value name="ADD0">
- <shadow type="math_number">
- <field name="NUM">0</field>
- </shadow>
- </value>
- </block>
- <block type="iot_service_thingspeak_read"></block>
- <block type="iot_service_thingspeak_read_total"></block>
- <block type="iot_service_thingspeak_read_specific">
- <value name="entry">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- <value name="field">
- <shadow type="math_number">
- <field name="NUM">1</field>
- </shadow>
- </value>
- </block>
- <label id="send_email_label" text="发送邮件" web-class="myLabelStyle" style="font-size:20px;"></label>' +
- <block type="cocopi_email_send">
- <value name="email">
- <shadow type="text">
- <field name="TEXT">jidechao@cocorobo.cc</field>
- </shadow>
- </value>
- <value name="email_content">
- <shadow type="text">
- <field name="TEXT">content</field>
- </shadow>
- </value>
- </block>
- <label id="Flask Web" text="Flask Web" web-class="myLabelStyle" style="font-size:20px;"></label>
- <block type="websocket_server_set_request"></block>
- <block type="network_http_get">
- <value name="http_get_url">
- <shadow type="text">
- <field name="TEXT">HTTP://ENTER_AN_URL</field>
- </shadow>
- </value>
- </block>
- <block type="network_http_post">
- <value name="http_post_url">
- <shadow type="text">
- <field name="TEXT">HTTP://ENTER_AN_URL</field>
- </shadow>
- </value>
- <value name="data">
- <block type="dict_create_with_items_insert"></block>
- </value>
- </block>
- <block type="CocoRobo_get"></block>
- </category>
- <category id="WebSocket" name="WebSocket" colour="#5C81A6">
- <block type="websocket_server_init"></block>
- <block type="websocket_server_send">
- <value name="data">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="websocket_server_receive"></block>
- <block type="websocket_client_init"></block>
- <block type="websocket_client_send">
- <value name="data">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="websocket_client_receive"></block>
- <block type="websocket_client_close"></block>
- </category>
- <category id="MQTT" name="MQTT" colour="#e8795b">
- <block type="MQTT_connected"></block>
- <block type="MQTT_is_connected"></block>
- <block type="mqtt_subscribe">
- <value name="content">
- <shadow type="text">
- <field name="TEXT">hello</field>
- </shadow>
- </value>
- <value name="topic">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="mqtt_received">
- <value name="topic">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="mqtt_accept_data"></block>
- </category>
- <category name="Socket" text="Socket 通信" colour="#5C8EFF" >
- <block type="socket_TCP_server_init"></block>
- <block type="socket_TCP_server_send">
- <value name="data">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="socket_TCP_server_receive"></block>
- <block type="socket_TCP_client_init"></block>
- <block type="socket_TCP_client_send">
- <value name="data">
- <shadow type="text">
- <field name="TEXT">abc</field>
- </shadow>
- </value>
- </block>
- <block type="socket_TCP_client_receive"></block>
- <block type="socket_TCP_client_close"></block>
- </category>
- </category>
- </xml>`};var tU={exports:{}},nU={exports:{}},cxe=nU.exports,Rre;function uxe(){return Rre||(Rre=1,function(n,e){(function(t,i){n.exports=i(P5())})(cxe,function(t){var i=t.__namespace__,s=function(ae,xe){return[xe.quote_(ae.getFieldValue("COLOUR")),fe.ATOMIC]},o=function(ae,xe){return xe.definitions_.import_random="import random",["'#%06x' % random.randint(0, 2**24 - 1)",fe.FUNCTION_CALL]},r=function(ae,xe){const H=xe.provideFunction_("colour_rgb",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(r, g, b):
- r = round(min(100, max(0, r)) * 2.55)
- g = round(min(100, max(0, g)) * 2.55)
- b = round(min(100, max(0, b)) * 2.55)
- return '#%02x%02x%02x' % (r, g, b)
- `),j=xe.valueToCode(ae,"RED",fe.NONE)||0,ue=xe.valueToCode(ae,"GREEN",fe.NONE)||0;return ae=xe.valueToCode(ae,"BLUE",fe.NONE)||0,[H+"("+j+", "+ue+", "+ae+")",fe.FUNCTION_CALL]},a=function(ae,xe){const H=xe.provideFunction_("colour_blend",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(colour1, colour2, ratio):
- r1, r2 = int(colour1[1:3], 16), int(colour2[1:3], 16)
- g1, g2 = int(colour1[3:5], 16), int(colour2[3:5], 16)
- b1, b2 = int(colour1[5:7], 16), int(colour2[5:7], 16)
- ratio = min(1, max(0, ratio))
- r = round(r1 * (1 - ratio) + r2 * ratio)
- g = round(g1 * (1 - ratio) + g2 * ratio)
- b = round(b1 * (1 - ratio) + b2 * ratio)
- return '#%02x%02x%02x' % (r, g, b)
- `),j=xe.valueToCode(ae,"COLOUR1",fe.NONE)||"'#000000'",ue=xe.valueToCode(ae,"COLOUR2",fe.NONE)||"'#000000'";return ae=xe.valueToCode(ae,"RATIO",fe.NONE)||0,[H+"("+j+", "+ue+", "+ae+")",fe.FUNCTION_CALL]},c=function(ae,xe){return["[]",fe.ATOMIC]},u=function(ae,xe){const H=Array(ae.itemCount_);for(let j=0;j<ae.itemCount_;j++)H[j]=xe.valueToCode(ae,"ADD"+j,fe.NONE)||"None";return["["+H.join(", ")+"]",fe.ATOMIC]},d=function(ae,xe){const H=xe.valueToCode(ae,"ITEM",fe.NONE)||"None";return ae=xe.valueToCode(ae,"NUM",fe.MULTIPLICATIVE)||"0",["["+H+"] * "+ae,fe.MULTIPLICATIVE]},f=function(ae,xe){return["len("+(xe.valueToCode(ae,"VALUE",fe.NONE)||"[]")+")",fe.FUNCTION_CALL]},g=function(ae,xe){return["not len("+(xe.valueToCode(ae,"VALUE",fe.NONE)||"[]")+")",fe.LOGICAL_NOT]},p=function(ae,xe){const H=xe.valueToCode(ae,"FIND",fe.NONE)||"[]",j=xe.valueToCode(ae,"VALUE",fe.NONE)||"''";let ue=" -1",ie="",Te=" - 1";return ae.workspace.options.oneBasedIndex&&(ue=" 0",ie=" + 1",Te=""),[(ae.getFieldValue("END")==="FIRST"?xe.provideFunction_("first_index",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(my_list, elem):
- try: index = my_list.index(elem)${ie}
- except: index =${ue}
- return index
- `):xe.provideFunction_("last_index",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(my_list, elem):
- try: index = len(my_list) - my_list[::-1].index(elem)${Te}
- except: index =${ue}
- return index
- `))+"("+j+", "+H+")",fe.FUNCTION_CALL]},_=function(ae,xe){const H=ae.getFieldValue("MODE")||"GET",j=ae.getFieldValue("WHERE")||"FROM_START";var ue=xe.valueToCode(ae,"VALUE",j==="RANDOM"?fe.NONE:fe.MEMBER)||"[]";switch(j){case"FIRST":if(H==="GET")return[ue+"[0]",fe.MEMBER];if(H==="GET_REMOVE")return[ue+".pop(0)",fe.FUNCTION_CALL];if(H==="REMOVE")return ue+`.pop(0)
- `;break;case"LAST":if(H==="GET")return[ue+"[-1]",fe.MEMBER];if(H==="GET_REMOVE")return[ue+".pop()",fe.FUNCTION_CALL];if(H==="REMOVE")return ue+`.pop()
- `;break;case"FROM_START":if(ae=xe.getAdjustedInt(ae,"AT"),H==="GET")return[ue+"["+ae+"]",fe.MEMBER];if(H==="GET_REMOVE")return[ue+".pop("+ae+")",fe.FUNCTION_CALL];if(H==="REMOVE")return ue+".pop("+ae+`)
- `;break;case"FROM_END":if(ae=xe.getAdjustedInt(ae,"AT",1,!0),H==="GET")return[ue+"["+ae+"]",fe.MEMBER];if(H==="GET_REMOVE")return[ue+".pop("+ae+")",fe.FUNCTION_CALL];if(H==="REMOVE")return ue+".pop("+ae+`)
- `;break;case"RANDOM":if(xe.definitions_.import_random="import random",H==="GET")return["random.choice("+ue+")",fe.FUNCTION_CALL];if(ue=xe.provideFunction_("lists_remove_random_item",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(myList):
- x = int(random.random() * len(myList))
- return myList.pop(x)
- `)+"("+ue+")",H==="GET_REMOVE")return[ue,fe.FUNCTION_CALL];if(H==="REMOVE")return ue+`
- `}throw Error("Unhandled combination (lists_getIndex).")},v=function(ae,xe){let H=xe.valueToCode(ae,"LIST",fe.MEMBER)||"[]";const j=ae.getFieldValue("MODE")||"GET";var ue=ae.getFieldValue("WHERE")||"FROM_START";const ie=xe.valueToCode(ae,"TO",fe.NONE)||"None";switch(ue){case"FIRST":if(j==="SET")return H+"[0] = "+ie+`
- `;if(j==="INSERT")return H+".insert(0, "+ie+`)
- `;break;case"LAST":if(j==="SET")return H+"[-1] = "+ie+`
- `;if(j==="INSERT")return H+".append("+ie+`)
- `;break;case"FROM_START":if(xe=xe.getAdjustedInt(ae,"AT"),j==="SET")return H+"["+xe+"] = "+ie+`
- `;if(j==="INSERT")return H+".insert("+xe+", "+ie+`)
- `;break;case"FROM_END":if(xe=xe.getAdjustedInt(ae,"AT",1,!0),j==="SET")return H+"["+xe+"] = "+ie+`
- `;if(j==="INSERT")return H+".insert("+xe+", "+ie+`)
- `;break;case"RANDOM":if(xe.definitions_.import_random="import random",H.match(/^\w+$/)?ae="":(ae=xe.nameDB_.getDistinctName("tmp_list",i.NameType$$module$build$src$core$names.VARIABLE),ue=ae+" = "+H+`
- `,H=ae,ae=ue),xe=xe.nameDB_.getDistinctName("tmp_x",i.NameType$$module$build$src$core$names.VARIABLE),ae+=xe+" = int(random.random() * len("+H+`))
- `,j==="SET")return ae+(H+"["+xe+"] = "+ie+`
- `);if(j==="INSERT")return ae+(H+".insert("+xe+", "+ie+`)
- `)}throw Error("Unhandled combination (lists_setIndex).")},C=function(ae,xe){const H=xe.valueToCode(ae,"LIST",fe.MEMBER)||"[]";var j=ae.getFieldValue("WHERE1");const ue=ae.getFieldValue("WHERE2");switch(j){case"FROM_START":j=xe.getAdjustedInt(ae,"AT1"),j===0&&(j="");break;case"FROM_END":j=xe.getAdjustedInt(ae,"AT1",1,!0);break;case"FIRST":j="";break;default:throw Error("Unhandled option (lists_getSublist)")}switch(ue){case"FROM_START":ae=xe.getAdjustedInt(ae,"AT2",1);break;case"FROM_END":ae=xe.getAdjustedInt(ae,"AT2",0,!0),i.isNumber$$module$build$src$core$utils$string(String(ae))?ae===0&&(ae=""):(xe.definitions_.import_sys="import sys",ae+=" or sys.maxsize");break;case"LAST":ae="";break;default:throw Error("Unhandled option (lists_getSublist)")}return[H+"["+j+" : "+ae+"]",fe.MEMBER]},y=function(ae,xe){const H=xe.valueToCode(ae,"LIST",fe.NONE)||"[]",j=ae.getFieldValue("TYPE");return ae=ae.getFieldValue("DIRECTION")==="1"?"False":"True",[xe.provideFunction_("lists_sort",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(my_list, type, reverse):
- def try_float(s):
- try:
- return float(s)
- except:
- return 0
- key_funcs = {
- "NUMERIC": try_float,
- "TEXT": str,
- "IGNORE_CASE": lambda s: str(s).lower()
- }
- key_func = key_funcs[type]
- list_cpy = list(my_list)
- return sorted(list_cpy, key=key_func, reverse=reverse)
- `)+"("+H+', "'+j+'", '+ae+")",fe.FUNCTION_CALL]},w=function(ae,xe){var H=ae.getFieldValue("MODE");if(H==="SPLIT")H=xe.valueToCode(ae,"INPUT",fe.MEMBER)||"''",ae=xe.valueToCode(ae,"DELIM",fe.NONE),ae=H+".split("+ae+")";else if(H==="JOIN")H=xe.valueToCode(ae,"INPUT",fe.NONE)||"[]",ae=(xe.valueToCode(ae,"DELIM",fe.MEMBER)||"''")+".join("+H+")";else throw Error("Unknown mode: "+H);return[ae,fe.FUNCTION_CALL]},I=function(ae,xe){return["list(reversed("+(xe.valueToCode(ae,"LIST",fe.NONE)||"[]")+"))",fe.FUNCTION_CALL]},L=function(ae,xe){let H=0,j="",ue,ie;xe.STATEMENT_PREFIX&&(j+=xe.injectId(xe.STATEMENT_PREFIX,ae));do ie=xe.valueToCode(ae,"IF"+H,fe.NONE)||"False",ue=xe.statementToCode(ae,"DO"+H)||xe.PASS,xe.STATEMENT_SUFFIX&&(ue=xe.prefixLines(xe.injectId(xe.STATEMENT_SUFFIX,ae),xe.INDENT)+ue),j+=(H===0?"if ":"elif ")+ie+`:
- `+ue,H++;while(ae.getInput("IF"+H));return(ae.getInput("ELSE")||xe.STATEMENT_SUFFIX)&&(ue=xe.statementToCode(ae,"ELSE")||xe.PASS,xe.STATEMENT_SUFFIX&&(ue=xe.prefixLines(xe.injectId(xe.STATEMENT_SUFFIX,ae),xe.INDENT)+ue),j+=`else:
- `+ue),j},O=function(ae,xe){const H={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[ae.getFieldValue("OP")],j=fe.RELATIONAL,ue=xe.valueToCode(ae,"A",j)||"0";return ae=xe.valueToCode(ae,"B",j)||"0",[ue+" "+H+" "+ae,j]},A=function(ae,xe){const H=ae.getFieldValue("OP")==="AND"?"and":"or",j=H==="and"?fe.LOGICAL_AND:fe.LOGICAL_OR;let ue=xe.valueToCode(ae,"A",j);return ae=xe.valueToCode(ae,"B",j),ue||ae?(xe=H==="and"?"True":"False",ue||(ue=xe),ae||(ae=xe)):ae=ue="False",[ue+" "+H+" "+ae,j]},N=function(ae,xe){return["not "+(xe.valueToCode(ae,"BOOL",fe.LOGICAL_NOT)||"True"),fe.LOGICAL_NOT]},D=function(ae,xe){return[ae.getFieldValue("BOOL")==="TRUE"?"True":"False",fe.ATOMIC]},P=function(ae,xe){return["None",fe.ATOMIC]},F=function(ae,xe){const H=xe.valueToCode(ae,"IF",fe.CONDITIONAL)||"False",j=xe.valueToCode(ae,"THEN",fe.CONDITIONAL)||"None";return ae=xe.valueToCode(ae,"ELSE",fe.CONDITIONAL)||"None",[j+" if "+H+" else "+ae,fe.CONDITIONAL]},V=function(ae,xe){let H;H=ae.getField("TIMES")?String(parseInt(ae.getFieldValue("TIMES"),10)):xe.valueToCode(ae,"TIMES",fe.NONE)||"0",H=i.isNumber$$module$build$src$core$utils$string(H)?parseInt(H,10):"int("+H+")";let j=xe.statementToCode(ae,"DO");return j=xe.addLoopTrap(j,ae)||xe.PASS,"for "+xe.nameDB_.getDistinctName("count",i.NameType$$module$build$src$core$names.VARIABLE)+" in range("+H+`):
- `+j},U=function(ae,xe){const H=ae.getFieldValue("MODE")==="UNTIL";let j=xe.valueToCode(ae,"BOOL",H?fe.LOGICAL_NOT:fe.NONE)||"False",ue=xe.statementToCode(ae,"DO");return ue=xe.addLoopTrap(ue,ae)||xe.PASS,H&&(j="not "+j),"while "+j+`:
- `+ue},Q=function(ae,xe){const H=xe.getVariableName(ae.getFieldValue("VAR"));var j=xe.valueToCode(ae,"FROM",fe.NONE)||"0",ue=xe.valueToCode(ae,"TO",fe.NONE)||"0",ie=xe.valueToCode(ae,"BY",fe.NONE)||"1";let Te=xe.statementToCode(ae,"DO");Te=xe.addLoopTrap(Te,ae)||xe.PASS;let De="";ae=function(){return xe.provideFunction_("upRange",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step):
- while start <= stop:
- yield start
- start += abs(step)
- `)};const me=function(){return xe.provideFunction_("downRange",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step):
- while start >= stop:
- yield start
- start -= abs(step)
- `)};if(i.isNumber$$module$build$src$core$utils$string(j)&&i.isNumber$$module$build$src$core$utils$string(ue)&&i.isNumber$$module$build$src$core$utils$string(ie))j=Number(j),ue=Number(ue),ie=Math.abs(Number(ie)),j%1===0&&ue%1===0&&ie%1===0?(j<=ue?(ue++,ae=j===0&&ie===1?ue:j+", "+ue,ie!==1&&(ae+=", "+ie)):(ue--,ae=j+", "+ue+", -"+ie),ae="range("+ae+")"):(ae=j<ue?ae():me(),ae+="("+j+", "+ue+", "+ie+")");else{const tt=function(It,kt){return i.isNumber$$module$build$src$core$utils$string(It)?It=String(Number(It)):It.match(/^\w+$/)||(kt=xe.nameDB_.getDistinctName(H+kt,i.NameType$$module$build$src$core$names.VARIABLE),De+=kt+" = "+It+`
- `,It=kt),It};j=tt(j,"_start"),ue=tt(ue,"_end"),ie=tt(ie,"_inc"),typeof j=="number"&&typeof ue=="number"?(ae=j<ue?ae():me(),ae+="("+j+", "+ue+", "+ie+")"):ae="("+j+" <= "+ue+") and "+ae()+"("+j+", "+ue+", "+ie+") or "+me()+"("+j+", "+ue+", "+ie+")"}return De+="for "+H+" in "+ae+`:
- `+Te},de=function(ae,xe){const H=xe.getVariableName(ae.getFieldValue("VAR")),j=xe.valueToCode(ae,"LIST",fe.RELATIONAL)||"[]";let ue=xe.statementToCode(ae,"DO");return ue=xe.addLoopTrap(ue,ae)||xe.PASS,"for "+H+" in "+j+`:
- `+ue},q=function(ae,xe){let H="";if(xe.STATEMENT_PREFIX&&(H+=xe.injectId(xe.STATEMENT_PREFIX,ae)),xe.STATEMENT_SUFFIX&&(H+=xe.injectId(xe.STATEMENT_SUFFIX,ae)),xe.STATEMENT_PREFIX){const j=ae.getSurroundLoop();j&&!j.suppressPrefixSuffix&&(H+=xe.injectId(xe.STATEMENT_PREFIX,j))}switch(ae.getFieldValue("FLOW")){case"BREAK":return H+`break
- `;case"CONTINUE":return H+`continue
- `}throw Error("Unknown flow statement.")},K=function(ae,xe){return ae=Number(ae.getFieldValue("NUM")),ae===1/0?['float("inf")',fe.FUNCTION_CALL]:ae===-1/0?['-float("inf")',fe.UNARY_SIGN]:[String(ae),0>ae?fe.UNARY_SIGN:fe.ATOMIC]},re=function(ae,xe){var H={ADD:[" + ",fe.ADDITIVE],MINUS:[" - ",fe.ADDITIVE],MULTIPLY:[" * ",fe.MULTIPLICATIVE],DIVIDE:[" / ",fe.MULTIPLICATIVE],POWER:[" ** ",fe.EXPONENTIATION]}[ae.getFieldValue("OP")];const j=H[0];H=H[1];const ue=xe.valueToCode(ae,"A",H)||"0";return ae=xe.valueToCode(ae,"B",H)||"0",[ue+j+ae,H]},Z=function(ae,xe){const H=ae.getFieldValue("OP");let j;if(H==="NEG")return j=xe.valueToCode(ae,"NUM",fe.UNARY_SIGN)||"0",["-"+j,fe.UNARY_SIGN];switch(xe.definitions_.import_math="import math",ae=H==="SIN"||H==="COS"||H==="TAN"?xe.valueToCode(ae,"NUM",fe.MULTIPLICATIVE)||"0":xe.valueToCode(ae,"NUM",fe.NONE)||"0",H){case"ABS":j="math.fabs("+ae+")";break;case"ROOT":j="math.sqrt("+ae+")";break;case"LN":j="math.log("+ae+")";break;case"LOG10":j="math.log10("+ae+")";break;case"EXP":j="math.exp("+ae+")";break;case"POW10":j="math.pow(10,"+ae+")";break;case"ROUND":j="round("+ae+")";break;case"ROUNDUP":j="math.ceil("+ae+")";break;case"ROUNDDOWN":j="math.floor("+ae+")";break;case"SIN":j="math.sin("+ae+" / 180.0 * math.pi)";break;case"COS":j="math.cos("+ae+" / 180.0 * math.pi)";break;case"TAN":j="math.tan("+ae+" / 180.0 * math.pi)"}if(j)return[j,fe.FUNCTION_CALL];switch(H){case"ASIN":j="math.asin("+ae+") / math.pi * 180";break;case"ACOS":j="math.acos("+ae+") / math.pi * 180";break;case"ATAN":j="math.atan("+ae+") / math.pi * 180";break;default:throw Error("Unknown math operator: "+H)}return[j,fe.MULTIPLICATIVE]},J=function(ae,xe){const H={PI:["math.pi",fe.MEMBER],E:["math.e",fe.MEMBER],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",fe.MULTIPLICATIVE],SQRT2:["math.sqrt(2)",fe.MEMBER],SQRT1_2:["math.sqrt(1.0 / 2)",fe.MEMBER],INFINITY:["float('inf')",fe.ATOMIC]};return ae=ae.getFieldValue("CONSTANT"),ae!=="INFINITY"&&(xe.definitions_.import_math="import math"),H[ae]},ge=function(ae,xe){var H={EVEN:[" % 2 == 0",fe.MULTIPLICATIVE,fe.RELATIONAL],ODD:[" % 2 == 1",fe.MULTIPLICATIVE,fe.RELATIONAL],WHOLE:[" % 1 == 0",fe.MULTIPLICATIVE,fe.RELATIONAL],POSITIVE:[" > 0",fe.RELATIONAL,fe.RELATIONAL],NEGATIVE:[" < 0",fe.RELATIONAL,fe.RELATIONAL],DIVISIBLE_BY:[null,fe.MULTIPLICATIVE,fe.RELATIONAL],PRIME:[null,fe.NONE,fe.FUNCTION_CALL]};const j=ae.getFieldValue("PROPERTY"),[ue,ie,Te]=H[j];if(H=xe.valueToCode(ae,"NUMBER_TO_CHECK",ie)||"0",j==="PRIME")xe.definitions_.import_math="import math",xe.definitions_.from_numbers_import_Number="from numbers import Number",ae=xe.provideFunction_("math_isPrime",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(n):
- # https://en.wikipedia.org/wiki/Primality_test#Naive_methods
- # If n is not a number but a string, try parsing it.
- if not isinstance(n, Number):
- try:
- n = float(n)
- except:
- return False
- if n == 2 or n == 3:
- return True
- # False if n is negative, is 1, or not whole, or if n is divisible by 2 or 3.
- if n <= 1 or n % 1 != 0 or n % 2 == 0 or n % 3 == 0:
- return False
- # Check all the numbers of form 6k +/- 1, up to sqrt(n).
- for x in range(6, int(math.sqrt(n)) + 2, 6):
- if n % (x - 1) == 0 or n % (x + 1) == 0:
- return False
- return True
- `)+"("+H+")";else if(j==="DIVISIBLE_BY"){if(ae=xe.valueToCode(ae,"DIVISOR",fe.MULTIPLICATIVE)||"0",ae==="0")return["False",fe.ATOMIC];ae=H+" % "+ae+" == 0"}else ae=H+ue;return[ae,Te]},ve=function(ae,xe){xe.definitions_.from_numbers_import_Number="from numbers import Number";const H=xe.valueToCode(ae,"DELTA",fe.ADDITIVE)||"0";return ae=xe.getVariableName(ae.getFieldValue("VAR")),ae+" = ("+ae+" if isinstance("+ae+", Number) else 0) + "+H+`
- `},Le=function(ae,xe){const H=ae.getFieldValue("OP");switch(ae=xe.valueToCode(ae,"LIST",fe.NONE)||"[]",H){case"SUM":xe="sum("+ae+")";break;case"MIN":xe="min("+ae+")";break;case"MAX":xe="max("+ae+")";break;case"AVERAGE":xe.definitions_.from_numbers_import_Number="from numbers import Number",xe=xe.provideFunction_("math_mean",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(myList):
- localList = [e for e in myList if isinstance(e, Number)]
- if not localList: return
- return float(sum(localList)) / len(localList)
- `)+"("+ae+")";break;case"MEDIAN":xe.definitions_.from_numbers_import_Number="from numbers import Number",xe=xe.provideFunction_("math_median",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(myList):
- localList = sorted([e for e in myList if isinstance(e, Number)])
- if not localList: return
- if len(localList) % 2 == 0:
- return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0
- else:
- return localList[(len(localList) - 1) // 2]
- `)+"("+ae+")";break;case"MODE":xe=xe.provideFunction_("math_modes",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(some_list):
- modes = []
- # Using a lists of [item, count] to keep count rather than dict
- # to avoid "unhashable" errors when the counted item is itself a list or dict.
- counts = []
- maxCount = 1
- for item in some_list:
- found = False
- for count in counts:
- if count[0] == item:
- count[1] += 1
- maxCount = max(maxCount, count[1])
- found = True
- if not found:
- counts.append([item, 1])
- for counted_item, item_count in counts:
- if item_count == maxCount:
- modes.append(counted_item)
- return modes
- `)+"("+ae+")";break;case"STD_DEV":xe.definitions_.import_math="import math",xe=xe.provideFunction_("math_standard_deviation",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(numbers):
- n = len(numbers)
- if n == 0: return
- mean = float(sum(numbers)) / n
- variance = sum((x - mean) ** 2 for x in numbers) / n
- return math.sqrt(variance)
- `)+"("+ae+")";break;case"RANDOM":xe.definitions_.import_random="import random",xe="random.choice("+ae+")";break;default:throw Error("Unknown operator: "+H)}return[xe,fe.FUNCTION_CALL]},Ee=function(ae,xe){const H=xe.valueToCode(ae,"DIVIDEND",fe.MULTIPLICATIVE)||"0";return ae=xe.valueToCode(ae,"DIVISOR",fe.MULTIPLICATIVE)||"0",[H+" % "+ae,fe.MULTIPLICATIVE]},Ne=function(ae,xe){const H=xe.valueToCode(ae,"VALUE",fe.NONE)||"0",j=xe.valueToCode(ae,"LOW",fe.NONE)||"0";return ae=xe.valueToCode(ae,"HIGH",fe.NONE)||"float('inf')",["min(max("+H+", "+j+"), "+ae+")",fe.FUNCTION_CALL]},qe=function(ae,xe){xe.definitions_.import_random="import random";const H=xe.valueToCode(ae,"FROM",fe.NONE)||"0";return ae=xe.valueToCode(ae,"TO",fe.NONE)||"0",["random.randint("+H+", "+ae+")",fe.FUNCTION_CALL]},Re=function(ae,xe){return xe.definitions_.import_random="import random",["random.random()",fe.FUNCTION_CALL]},we=function(ae,xe){xe.definitions_.import_math="import math";const H=xe.valueToCode(ae,"X",fe.NONE)||"0";return["math.atan2("+(xe.valueToCode(ae,"Y",fe.NONE)||"0")+", "+H+") / math.pi * 180",fe.MULTIPLICATIVE]},Ve=function(ae,xe){var H=[],j=ae.workspace,ue=i.allUsedVarModels$$module$build$src$core$variables(j)||[];for(var ie of ue)ue=ie.name,ae.getVars().indexOf(ue)===-1&&H.push(xe.getVariableName(ue));for(j=i.allDeveloperVariables$$module$build$src$core$variables(j),ie=0;ie<j.length;ie++)H.push(xe.nameDB_.getName(j[ie],i.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE));j=H.length?xe.INDENT+"global "+H.join(", ")+`
- `:"",H=xe.getProcedureName(ae.getFieldValue("NAME")),ie="",xe.STATEMENT_PREFIX&&(ie+=xe.injectId(xe.STATEMENT_PREFIX,ae)),xe.STATEMENT_SUFFIX&&(ie+=xe.injectId(xe.STATEMENT_SUFFIX,ae)),ie&&(ie=xe.prefixLines(ie,xe.INDENT)),ue="",xe.INFINITE_LOOP_TRAP&&(ue=xe.prefixLines(xe.injectId(xe.INFINITE_LOOP_TRAP,ae),xe.INDENT));let Te=xe.statementToCode(ae,"STACK"),De=xe.valueToCode(ae,"RETURN",fe.NONE)||"",me="";Te&&De&&(me=ie),De?De=xe.INDENT+"return "+De+`
- `:Te||(Te=xe.PASS);const tt=[],It=ae.getVars();for(let kt=0;kt<It.length;kt++)tt[kt]=xe.getVariableName(It[kt]);return j="def "+H+"("+tt.join(", ")+`):
- `+j+ie+ue+Te+me+De,j=xe.scrub_(ae,j),xe.definitions_["%"+H]=j,null},Ge=function(ae,xe){const H=xe.getProcedureName(ae.getFieldValue("NAME")),j=[],ue=ae.getVars();for(let ie=0;ie<ue.length;ie++)j[ie]=xe.valueToCode(ae,"ARG"+ie,fe.NONE)||"None";return[H+"("+j.join(", ")+")",fe.FUNCTION_CALL]},dt=function(ae,xe){return xe.forBlock.procedures_callreturn(ae,xe)[0]+`
- `},ze=function(ae,xe){let H="if "+(xe.valueToCode(ae,"CONDITION",fe.NONE)||"False")+`:
- `;return xe.STATEMENT_SUFFIX&&(H+=xe.prefixLines(xe.injectId(xe.STATEMENT_SUFFIX,ae),xe.INDENT)),ae.hasReturnValue_?(ae=xe.valueToCode(ae,"VALUE",fe.NONE)||"None",H+=xe.INDENT+"return "+ae+`
- `):H+=xe.INDENT+`return
- `,H},ee=function(ae,xe){return[xe.quote_(ae.getFieldValue("TEXT")),fe.ATOMIC]},ye=function(ae,xe){return ae=xe.multiline_quote_(ae.getFieldValue("TEXT")),xe=ae.indexOf("+")!==-1?fe.ADDITIVE:fe.ATOMIC,[ae,xe]},Me=function(ae,xe){switch(ae.itemCount_){case 0:return["''",fe.ATOMIC];case 1:return ae=xe.valueToCode(ae,"ADD0",fe.NONE)||"''",Hn(ae);case 2:var H=xe.valueToCode(ae,"ADD0",fe.NONE)||"''";return ae=xe.valueToCode(ae,"ADD1",fe.NONE)||"''",[Hn(H)[0]+" + "+Hn(ae)[0],fe.ADDITIVE];default:H=[];for(let j=0;j<ae.itemCount_;j++)H[j]=xe.valueToCode(ae,"ADD"+j,fe.NONE)||"''";return ae=xe.nameDB_.getDistinctName("x",i.NameType$$module$build$src$core$names.VARIABLE),["''.join([str("+ae+") for "+ae+" in ["+H.join(", ")+"]])",fe.FUNCTION_CALL]}},et=function(ae,xe){const H=xe.getVariableName(ae.getFieldValue("VAR"));return ae=xe.valueToCode(ae,"TEXT",fe.NONE)||"''",H+" = str("+H+") + "+Hn(ae)[0]+`
- `},at=function(ae,xe){return["len("+(xe.valueToCode(ae,"VALUE",fe.NONE)||"''")+")",fe.FUNCTION_CALL]},Ue=function(ae,xe){return["not len("+(xe.valueToCode(ae,"VALUE",fe.NONE)||"''")+")",fe.LOGICAL_NOT]},Se=function(ae,xe){const H=ae.getFieldValue("END")==="FIRST"?"find":"rfind",j=xe.valueToCode(ae,"FIND",fe.NONE)||"''";return xe=(xe.valueToCode(ae,"VALUE",fe.MEMBER)||"''")+"."+H+"("+j+")",ae.workspace.options.oneBasedIndex?[xe+" + 1",fe.ADDITIVE]:[xe,fe.FUNCTION_CALL]},Ie=function(ae,xe){const H=ae.getFieldValue("WHERE")||"FROM_START",j=xe.valueToCode(ae,"VALUE",H==="RANDOM"?fe.NONE:fe.MEMBER)||"''";switch(H){case"FIRST":return[j+"[0]",fe.MEMBER];case"LAST":return[j+"[-1]",fe.MEMBER];case"FROM_START":return ae=xe.getAdjustedInt(ae,"AT"),[j+"["+ae+"]",fe.MEMBER];case"FROM_END":return ae=xe.getAdjustedInt(ae,"AT",1,!0),[j+"["+ae+"]",fe.MEMBER];case"RANDOM":return xe.definitions_.import_random="import random",[xe.provideFunction_("text_random_letter",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(text):
- x = int(random.random() * len(text))
- return text[x]
- `)+"("+j+")",fe.FUNCTION_CALL]}throw Error("Unhandled option (text_charAt).")},Xe=function(ae,xe){var H=ae.getFieldValue("WHERE1");const j=ae.getFieldValue("WHERE2"),ue=xe.valueToCode(ae,"STRING",fe.MEMBER)||"''";switch(H){case"FROM_START":H=xe.getAdjustedInt(ae,"AT1"),H===0&&(H="");break;case"FROM_END":H=xe.getAdjustedInt(ae,"AT1",1,!0);break;case"FIRST":H="";break;default:throw Error("Unhandled option (text_getSubstring)")}switch(j){case"FROM_START":ae=xe.getAdjustedInt(ae,"AT2",1);break;case"FROM_END":ae=xe.getAdjustedInt(ae,"AT2",0,!0),i.isNumber$$module$build$src$core$utils$string(String(ae))?ae===0&&(ae=""):(xe.definitions_.import_sys="import sys",ae+=" or sys.maxsize");break;case"LAST":ae="";break;default:throw Error("Unhandled option (text_getSubstring)")}return[ue+"["+H+" : "+ae+"]",fe.MEMBER]},it=function(ae,xe){const H={UPPERCASE:".upper()",LOWERCASE:".lower()",TITLECASE:".title()"}[ae.getFieldValue("CASE")];return[(xe.valueToCode(ae,"TEXT",fe.MEMBER)||"''")+H,fe.FUNCTION_CALL]},Tt=function(ae,xe){const H={LEFT:".lstrip()",RIGHT:".rstrip()",BOTH:".strip()"}[ae.getFieldValue("MODE")];return[(xe.valueToCode(ae,"TEXT",fe.MEMBER)||"''")+H,fe.FUNCTION_CALL]},He=function(ae,xe){return"print("+(xe.valueToCode(ae,"TEXT",fe.NONE)||"''")+`)
- `},ke=function(ae,xe){var H=xe.provideFunction_("text_prompt",`
- def ${xe.FUNCTION_NAME_PLACEHOLDER_}(msg):
- try:
- return raw_input(msg)
- except NameError:
- return input(msg)
- `);return xe=ae.getField("TEXT")?xe.quote_(ae.getFieldValue("TEXT")):xe.valueToCode(ae,"TEXT",fe.NONE)||"''",H=H+"("+xe+")",ae.getFieldValue("TYPE")==="NUMBER"&&(H="float("+H+")"),[H,fe.FUNCTION_CALL]},ot=function(ae,xe){const H=xe.valueToCode(ae,"TEXT",fe.MEMBER)||"''";return ae=xe.valueToCode(ae,"SUB",fe.NONE)||"''",[H+".count("+ae+")",fe.FUNCTION_CALL]},Ct=function(ae,xe){const H=xe.valueToCode(ae,"TEXT",fe.MEMBER)||"''",j=xe.valueToCode(ae,"FROM",fe.NONE)||"''";return ae=xe.valueToCode(ae,"TO",fe.NONE)||"''",[H+".replace("+j+", "+ae+")",fe.MEMBER]},Gt=function(ae,xe){return[(xe.valueToCode(ae,"TEXT",fe.MEMBER)||"''")+"[::-1]",fe.MEMBER]},Ot=function(ae,xe){return[xe.getVariableName(ae.getFieldValue("VAR")),fe.ATOMIC]},En=function(ae,xe){const H=xe.valueToCode(ae,"VALUE",fe.NONE)||"0";return xe.getVariableName(ae.getFieldValue("VAR"))+" = "+H+`
- `},fe;(function(ae){ae[ae.ATOMIC=0]="ATOMIC",ae[ae.COLLECTION=1]="COLLECTION",ae[ae.STRING_CONVERSION=1]="STRING_CONVERSION",ae[ae.MEMBER=2.1]="MEMBER",ae[ae.FUNCTION_CALL=2.2]="FUNCTION_CALL",ae[ae.EXPONENTIATION=3]="EXPONENTIATION",ae[ae.UNARY_SIGN=4]="UNARY_SIGN",ae[ae.BITWISE_NOT=4]="BITWISE_NOT",ae[ae.MULTIPLICATIVE=5]="MULTIPLICATIVE",ae[ae.ADDITIVE=6]="ADDITIVE",ae[ae.BITWISE_SHIFT=7]="BITWISE_SHIFT",ae[ae.BITWISE_AND=8]="BITWISE_AND",ae[ae.BITWISE_XOR=9]="BITWISE_XOR",ae[ae.BITWISE_OR=10]="BITWISE_OR",ae[ae.RELATIONAL=11]="RELATIONAL",ae[ae.LOGICAL_NOT=12]="LOGICAL_NOT",ae[ae.LOGICAL_AND=13]="LOGICAL_AND",ae[ae.LOGICAL_OR=14]="LOGICAL_OR",ae[ae.CONDITIONAL=15]="CONDITIONAL",ae[ae.LAMBDA=16]="LAMBDA",ae[ae.NONE=99]="NONE"})(fe||(fe={}));var se=class extends i.CodeGenerator$$module$build$src$core$generator{constructor(ae="Python"){super(ae),this.ORDER_OVERRIDES=[[fe.FUNCTION_CALL,fe.MEMBER],[fe.FUNCTION_CALL,fe.FUNCTION_CALL],[fe.MEMBER,fe.MEMBER],[fe.MEMBER,fe.FUNCTION_CALL],[fe.LOGICAL_NOT,fe.LOGICAL_NOT],[fe.LOGICAL_AND,fe.LOGICAL_AND],[fe.LOGICAL_OR,fe.LOGICAL_OR]],this.PASS="",this.isInitialized=!1;for(const xe in fe)ae=fe[xe],typeof ae!="string"&&(this["ORDER_"+xe]=ae);this.addReservedWords("False,None,True,and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,nonlocal,not,or,pass,print,raise,return,try,while,with,yield,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StandardError,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,ZeroDivisionError,_,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,all,any,apply,ascii,basestring,bin,bool,buffer,bytearray,bytes,callable,chr,classmethod,cmp,coerce,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,execfile,exit,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,license,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip")}init(ae){super.init(ae),this.PASS=this.INDENT+`pass
- `,this.nameDB_?this.nameDB_.reset():this.nameDB_=new i.Names$$module$build$src$core$names(this.RESERVED_WORDS_),this.nameDB_.setVariableMap(ae.getVariableMap()),this.nameDB_.populateVariables(ae),this.nameDB_.populateProcedures(ae);const xe=[];var H=i.allDeveloperVariables$$module$build$src$core$variables(ae);for(let j=0;j<H.length;j++)xe.push(this.nameDB_.getName(H[j],i.Names$$module$build$src$core$names.DEVELOPER_VARIABLE_TYPE)+" = None");for(ae=i.allUsedVarModels$$module$build$src$core$variables(ae),H=0;H<ae.length;H++)xe.push(this.getVariableName(ae[H].getId())+" = None");this.definitions_.variables=xe.join(`
- `),this.isInitialized=!0}finish(ae){const xe=[],H=[];for(let j in this.definitions_){const ue=this.definitions_[j];ue.match(/^(from\s+\S+\s+)?import\s+\S+/)?xe.push(ue):H.push(ue)}return ae=super.finish(ae),this.isInitialized=!1,this.nameDB_.reset(),(xe.join(`
- `)+`
- `+H.join(`
- `)).replace(/\n\n+/g,`
- `).replace(/\n*$/,`
- `)+ae}scrubNakedValue(ae){return ae+`
- `}quote_(ae){ae=ae.replace(/\\/g,"\\\\").replace(/\n/g,`\\
- `);let xe="'";return ae.indexOf("'")!==-1&&(ae.indexOf('"')===-1?xe='"':ae=ae.replace(/'/g,"\\'")),xe+ae+xe}multiline_quote_(ae){return ae.split(/\n/g).map(this.quote_).join(` + '\\n' +
- `)}scrub_(ae,xe,H=!1){let j="";if(!ae.outputConnection||!ae.outputConnection.targetConnection){var ue=ae.getCommentText();ue&&(ue=i.wrap$$module$build$src$core$utils$string(ue,this.COMMENT_WRAP-3),j+=this.prefixLines(ue+`
- `,"# "));for(let ie=0;ie<ae.inputList.length;ie++)ae.inputList[ie].type===i.inputTypes$$module$build$src$core$inputs$input_types.VALUE&&(ue=ae.inputList[ie].connection.targetBlock())&&(ue=this.allNestedComments(ue))&&(j+=this.prefixLines(ue,"# "))}return ae=ae.nextConnection&&ae.nextConnection.targetBlock(),H=H?"":this.blockToCode(ae),j+xe+H}getAdjustedInt(ae,xe,H=0,j=!1){ae.workspace.options.oneBasedIndex&&H--;const ue=ae.workspace.options.oneBasedIndex?"1":"0";return ae=this.valueToCode(ae,xe,H?fe.ADDITIVE:fe.NONE)||ue,i.isNumber$$module$build$src$core$utils$string(ae)?(ae=parseInt(ae,10)+H,j&&(ae=-ae)):(ae=0<H?"int("+ae+" + "+H+")":0>H?"int("+ae+" - "+-H+")":"int("+ae+")",j&&(ae="-"+ae)),ae}},le={};le.colour_blend=a,le.colour_picker=s,le.colour_random=o,le.colour_rgb=r;var Fe={};Fe.lists_create_empty=c,Fe.lists_create_with=u,Fe.lists_getIndex=_,Fe.lists_getSublist=C,Fe.lists_indexOf=p,Fe.lists_isEmpty=g,Fe.lists_length=f,Fe.lists_repeat=d,Fe.lists_reverse=I,Fe.lists_setIndex=v,Fe.lists_sort=y,Fe.lists_split=w;var pe={};pe.controls_if=L,pe.controls_ifelse=L,pe.logic_boolean=D,pe.logic_compare=O,pe.logic_negate=N,pe.logic_null=P,pe.logic_operation=A,pe.logic_ternary=F;var je={};je.controls_flow_statements=q,je.controls_for=Q,je.controls_forEach=de,je.controls_repeat=V,je.controls_repeat_ext=V,je.controls_whileUntil=U;var Ae={};Ae.math_arithmetic=re,Ae.math_atan2=we,Ae.math_change=ve,Ae.math_constant=J,Ae.math_constrain=Ne,Ae.math_modulo=Ee,Ae.math_number=K,Ae.math_number_property=ge,Ae.math_on_list=Le,Ae.math_random_float=Re,Ae.math_random_int=qe,Ae.math_round=Z,Ae.math_single=Z,Ae.math_trig=Z;var Et={};Et.procedures_callnoreturn=dt,Et.procedures_callreturn=Ge,Et.procedures_defnoreturn=Ve,Et.procedures_defreturn=Ve,Et.procedures_ifreturn=ze;var Tn=/^\s*'([^']|\\')*'\s*$/,Hn=function(ae){return Tn.test(ae)?[ae,fe.ATOMIC]:["str("+ae+")",fe.FUNCTION_CALL]},Xn={};Xn.text=ee,Xn.text_append=et,Xn.text_changeCase=it,Xn.text_charAt=Ie,Xn.text_count=ot,Xn.text_getSubstring=Xe,Xn.text_indexOf=Se,Xn.text_isEmpty=Ue,Xn.text_join=Me,Xn.text_length=at,Xn.text_multiline=ye,Xn.text_print=He,Xn.text_prompt=ke,Xn.text_prompt_ext=ke,Xn.text_replace=Ct,Xn.text_reverse=Gt,Xn.text_trim=Tt;var vs={};vs.variables_get=Ot,vs.variables_set=En;var Zn={};Zn.variables_get_dynamic=Ot,Zn.variables_set_dynamic=En;var Hi=new se;Hi.addReservedWords("math,random,Number");var ti=Object.assign({},le,Fe,pe,je,Ae,Et,Xn,vs,Zn);for(const ae in ti)Hi.forBlock[ae]=ti[ae];var Ps={};return Ps.Order=fe,Ps.PythonGenerator=se,Ps.pythonGenerator=Hi,Ps.__namespace__=i,Ps})}(nU)),nU.exports}var dxe=tU.exports,Mre;function hxe(){return Mre||(Mre=1,function(n,e){(function(t,i){n.exports=i(FZ(),uxe())})(dxe,function(t,i){/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */return i})}(tU)),tU.exports}var Sa=hxe();function fxe(n){let e=b.Xml.workspaceToDom(window.blockly).getElementsByTagName("block"),t=[];for(let i=0;i<e.length;i++)e[i].getAttribute("type")===n&&t.push(e[i]);return t}function gxe(n){let e=[];try{n.workspace.getAllBlocks()[0].workspace.variableMap.variableMap.get("").map(i=>{e.push(i.name)})}catch{return""}return e.join(",")}b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const pxe="#d42b03";b.Blocks.ai_v831_button_read_pressed={init:function(){this.appendDummyInput().appendField(b.Msg.ai_basic_button_when).appendField(new b.FieldDropdown([["A","A"],["B","B"],["C","C"],["D","D"]]),"button_type").appendField(b.Msg.ai_basic_pressed),this.setOutput(!0,null),this.setColour(pxe);var n=this;this.setTooltip(function(){var e=n.getFieldValue("button_type");console.log(e);var t={A:b.Msg.ai_k210_button_read_pressed_TOOLTIP.replace("%1","A"),B:b.Msg.ai_k210_button_read_pressed_TOOLTIP.replace("%1","B"),C:b.Msg.ai_k210_button_read_pressed_TOOLTIP.replace("%1","C"),D:b.Msg.ai_k210_button_read_pressed_TOOLTIP.replace("%1","D")};return t[e]}),this.setHelpUrl("")}};b.Python.ai_v831_button_read_pressed=function(n){var e=n.getFieldValue("button_type");b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_CocoPi_BUTTON="from CocoPi import BUTTON",b.Python.definitions_.import_define_x_button=`key_A = BUTTON(14)
- key_B = BUTTON(8)
- key_C = BUTTON(13)
- key_D = BUTTON(7)
- `;var t=`key_${e}.is_pressed()`;return[t,b.Python.ORDER_CONDITIONAL]};b.Blocks.ai_v831_button_read_released={init:function(){this.appendDummyInput().appendField(b.Msg.ai_basic_button_when).appendField(new b.FieldDropdown([["A","A"],["B","B"],["C","C"],["D","D"]]),"button_type_released").appendField(b.Msg.ai_basic_released),this.setOutput(!0,null),this.setColour("#d42b03");var n=this;this.setTooltip(function(){var e=n.getFieldValue("button_type_released"),t={A:b.Msg.ai_k210_button_read_released_TOOLTIP.replace("%1","A"),B:b.Msg.ai_k210_button_read_released_TOOLTIP.replace("%1","B"),C:b.Msg.ai_k210_button_read_released_TOOLTIP.replace("%1","C"),D:b.Msg.ai_k210_button_read_released_TOOLTIP.replace("%1","D")};return t[e]}),this.setHelpUrl("")}};b.Python.ai_v831_button_read_released=function(n){var e=n.getFieldValue("button_type_released");b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_CocoPi_BUTTON="from CocoPi import BUTTON",b.Python.definitions_.import_define_x_button=`key_A = BUTTON(14)
- key_B = BUTTON(8)
- key_C = BUTTON(13)
- key_D = BUTTON(7)
- `;var t=`key_${e}.is_pressed() == False`;return[t,b.Python.ORDER_CONDITIONAL]};b.Blocks.ai_v831_led_light_up={init:function(){this.appendDummyInput().appendField(b.Msg.ai_basic_led_set).appendField(new b.FieldDropdown([[b.Msg.ai_basic_led_blue,"blue"]]),"type").appendField(b.Msg.ai_basic_led_on),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour("#d42b03");var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={blue:b.Msg.ai_k210_led_light_up_TOOLTIP.replace("%1",b.Msg.ai_basic_led_blue),red:b.Msg.ai_k210_led_light_up_TOOLTIP.replace("%1",b.Msg.ai_basic_led_red)};return t[e]}),this.setHelpUrl("")}};b.Python.ai_v831_led_light_up=function(n){b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_time="import time",b.Python.definitions_.import_CocoPi_LED=`from CocoPi import LED
- LED = LED()
- `;var e=`LED.out(1)
- `;return e};b.Blocks.ai_v831_led_light_off={init:function(){this.appendDummyInput().appendField(b.Msg.ai_basic_led_set).appendField(new b.FieldDropdown([[b.Msg.ai_basic_led_blue,"blue"]]),"type").appendField(b.Msg.ai_basic_led_off),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour("#d42b03");var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={blue:b.Msg.ai_k210_led_light_off_TOOLTIP.replace("%1",b.Msg.ai_basic_led_blue),red:b.Msg.ai_k210_led_light_off_TOOLTIP.replace("%1",b.Msg.ai_basic_led_red)};return t[e]}),this.setHelpUrl("")}};b.Python.ai_v831_led_light_off=function(n){b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_time="import time",b.Python.definitions_.import_CocoPi_LED=`from CocoPi import LED
- LED = LED()
- `;var e=`LED.out(0)
- `;return e};b.Blocks.ai_v831_rgb_light_up={init:function(){this.appendDummyInput().appendField(b.Msg.ai_basic_rgb_set_on),this.appendValueInput("rgb_value").setCheck(null).appendField(""),this.appendDummyInput().appendField(b.Msg.LED_BRTN).appendField(new b.FieldNumber(50,0,255),"uart_bps"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour("#d42b03"),this.setTooltip(b.Msg.ai_basic_rgb_set_on),this.setHelpUrl("")}};b.Python.ai_v831_rgb_light_up=function(n){var e=b.Python.valueToCode(n,"rgb_value",b.Python.ORDER_ATOMIC),t=n.getFieldValue("uart_bps");console.log(e.slice(1,-1)),b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_time="import time",b.Python.definitions_.import_CocoPi_RGB=`from CocoPi import singleRgb
- singleRgb=singleRgb()`;var i=`singleRgb.setBrightness(${t})
- singleRgb.setColor(${e.slice(1,-1)})
- singleRgb.show()
- time.sleep(0.05)
- `;return i};b.Blocks.ai_v831_rgb_light_off={init:function(){this.appendDummyInput().appendField(b.Msg.ai_basic_rgb_set_off),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour("#d42b03"),this.setTooltip(b.Msg.ai_basic_rgb_set_off),this.setHelpUrl("")}};b.Python.ai_v831_rgb_light_off=function(n){b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_time="import time",b.Python.definitions_.import_CocoPi_RGB=`from CocoPi import singleRgb
- singleRgb=singleRgb()`;var e=`singleRgb.setColor(0,0,0)
- singleRgb.show()
- time.sleep(0.05)
- `;return e};b.Blocks.ai_lcd_rgb_value_input={init:function(){this.appendDummyInput().appendField(b.Msg.rgb_R),this.appendValueInput("rgb_value_r").setCheck(null).appendField(""),this.appendDummyInput().appendField(b.Msg.rgb_G),this.appendValueInput("rgb_value_g").setCheck(null).appendField(""),this.appendDummyInput().appendField(b.Msg.rgb_B),this.appendValueInput("rgb_value_b").setCheck(null).appendField(""),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour("#5bb2d6"),this.setTooltip(b.Msg.ai_lcd_rgb_value_input_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_rgb_value_input=function(n){var e=b.Python.valueToCode(n,"rgb_value_r",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"rgb_value_g",b.Python.ORDER_ATOMIC),i=b.Python.valueToCode(n,"rgb_value_b",b.Python.ORDER_ATOMIC),s=""+e+","+t+","+i;return[s,b.Python.ORDER_NONE]};const HP="#5fcd8e";b.Blocks.esp32_main_controller_get_light={init:function(){this.appendDummyInput().appendField(b.Msg.basic_light_get),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(HP),this.setTooltip(b.Msg.basic_light_get),this.setHelpUrl("")}};b.Python.esp32_main_controller_get_light=function(n){b.Python.definitions_.import_LIGHTINTENSITY=`class v83x_ADC():
- def __init__(self, addr=b"0x05070080") -> None:
- self.addr = addr
- self.path = "/sys/class/sunxi_dump/dump"
- self.file = open(self.path, "wb+")
- self.last = self.value()
- def __del__(self):
- try:
- if self.file:
- self.file.close()
- del self.file
- except Exception as e:
- pass
- def value(self):
- self.file.write(b"0x05070080")
- self.file.seek(0)
- return int(self.file.read()[:-1], 16)
- v831_adc0 = v83x_ADC()
- `;var e="v831_adc0.value()";return[e,b.Python.ORDER_CONDITIONAL]};b.Blocks.esp32_main_controller_get_environmental_value={init:function(){this.appendDummyInput().appendField(b.Msg.ESP32_ENV_GET_TEXT).appendField(new b.FieldDropdown([[b.Msg.basic_temperature,"temperature"],[b.Msg.basic_humidity,"humidity"]]),"env_get_type").appendField(b.Msg.basic_env_value),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(HP),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("env_get_type"),t={temperature:b.Msg.Esp32_Main_Controller_Get_Environmental_Value_TOOLTIP.replace("%1",b.Msg.basic_temperature),humidity:b.Msg.Esp32_Main_Controller_Get_Environmental_Value_TOOLTIP.replace("%1",b.Msg.basic_humidity)};return t[e]})}};b.Python.esp32_main_controller_get_environmental_value=function(n){var e=n.getFieldValue("env_get_type");b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_AHT20="from CocoPi import AHT20",b.Python.definitions_.import_AHT20_object="aht20 = AHT20(2)";let t="";return e=="temperature"?t="aht20.get_temperature()":e=="humidity"?t="aht20.get_humidity()":t=e,[t,b.Python.ORDER_CONDITIONAL]};b.Blocks.esp32_main_controller_motion_acceleration={init:function(){this.appendDummyInput().appendField(b.Msg.basic_motion_get_along).appendField(new b.FieldDropdown([["X","4"],["Y","3"],["Z","5"]]),"accel_type").appendField(b.Msg.basic_motion_accel),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(HP);var n=this;this.setTooltip(function(){var e=n.getFieldValue("accel_type"),t={4:b.Msg.Esp32_Main_Controller_Motion_Acceleration_TOOLTIP.replace("%1","X"),3:b.Msg.Esp32_Main_Controller_Motion_Acceleration_TOOLTIP.replace("%1","Y"),5:b.Msg.Esp32_Main_Controller_Motion_Acceleration_TOOLTIP.replace("%1","Z")};return t[e]}),this.setHelpUrl("")}};b.Python.esp32_main_controller_motion_acceleration=function(n){var e=n.getFieldValue("accel_type");b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_QMI8658="from CocoPi import QMI8658",b.Python.definitions_.QMI8658_import_path=`
- #初始化设置
- qmi8658=QMI8658()
- #校准
- qmi8658.calibrate()
- #标定初始方位
- initData={}
- initData["AcX"]=qmi8658.get_accel(10)["AcX"]
- initData["AcY"]=qmi8658.get_accel(10)["AcY"]
- initData["AcZ"]=qmi8658.get_accel(10)["AcZ"]
- initData["GyX"]=qmi8658.get_accel(10)["GyX"]
- initData["GyY"]=qmi8658.get_accel(10)["GyY"]
- initData["GyZ"]=qmi8658.get_accel(10)["GyZ"]
- `;var t=`round(qmi8658.getPitchYawRollGxGyGz(initData)[${e}],2)`;return[t,b.Python.ORDER_CONDITIONAL]};b.Blocks.esp32_main_controller_motion_rotation_measurement={init:function(){this.appendDummyInput().appendField(b.Msg.basic_motion_get_along).appendField(new b.FieldDropdown([["X","4"],["Y","3"],["Z","5"]]),"accel_type").appendField(b.Msg.basic_motion_rotation_measurement),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(HP);var n=this;this.setTooltip(function(){var e=n.getFieldValue("accel_type"),t={4:b.Msg.Esp32_Main_Controller_Motion_Rotation_Measurement_TOOLTIP.replace("%1","X"),3:b.Msg.Esp32_Main_Controller_Motion_Rotation_Measurement_TOOLTIP.replace("%1","Y"),5:b.Msg.Esp32_Main_Controller_Motion_Rotation_Measurement_TOOLTIP.replace("%1","Z")};return t[e]}),this.setHelpUrl("")}};b.Python.esp32_main_controller_motion_rotation_measurement=function(n){var e=n.getFieldValue("accel_type");b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_QMI8658="from CocoPi import QMI8658",b.Python.definitions_.QMI8658_import_path=`
- #初始化设置
- qmi8658=QMI8658()
- #校准
- qmi8658.calibrate()
- #标定初始方位
- initData={}
- initData["AcX"]=qmi8658.get_accel(10)["AcX"]
- initData["AcY"]=qmi8658.get_accel(10)["AcY"]
- initData["AcZ"]=qmi8658.get_accel(10)["AcZ"]
- initData["GyX"]=qmi8658.get_accel(10)["GyX"]
- initData["GyY"]=qmi8658.get_accel(10)["GyY"]
- initData["GyZ"]=qmi8658.get_accel(10)["GyZ"]
- `;var t=`round(qmi8658.getPitchYawRollGxGyGz(initData)[${e}],2)`;return[t,b.Python.ORDER_CONDITIONAL]};b.Blocks.esp32_main_controller_motion_tilt_angle={init:function(){this.appendDummyInput().appendField(b.Msg.basic_motion_get_along).appendField(new b.FieldDropdown([["X","1"],["Y","0"]]),"tilt_angle_type").appendField(b.Msg.basic_motion_angle),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(HP);var n=this;this.setTooltip(function(){var e=n.getFieldValue("tilt_angle_type"),t={1:b.Msg.Esp32_Main_Controller_Motion_Tilt_Angle_TOOLTIP.replace("%1","X"),0:b.Msg.Esp32_Main_Controller_Motion_Tilt_Angle_TOOLTIP.replace("%1","Y")};return t[e]}),this.setHelpUrl("")}};b.Python.esp32_main_controller_motion_tilt_angle=function(n){var e=n.getFieldValue("tilt_angle_type");b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_QMI8658="from CocoPi import QMI8658",b.Python.definitions_.QMI8658_import_path=`
- #初始化设置
- qmi8658=QMI8658()
- #校准
- qmi8658.calibrate()
- #标定初始方位
- initData={}
- initData["AcX"]=qmi8658.get_accel(10)["AcX"]
- initData["AcY"]=qmi8658.get_accel(10)["AcY"]
- initData["AcZ"]=qmi8658.get_accel(10)["AcZ"]
- initData["GyX"]=qmi8658.get_accel(10)["GyX"]
- initData["GyY"]=qmi8658.get_accel(10)["GyY"]
- initData["GyZ"]=qmi8658.get_accel(10)["GyZ"]
- `;var t=`round(qmi8658.getPitchYawRollGxGyGz(initData)[${e}],2)`;return[t,b.Python.ORDER_CONDITIONAL]};const F5="#386dc8";b.Blocks.extension_servo_setup_on_ai={init:function(){this.appendDummyInput().appendField(new b.FieldImage("/media/esp32_servo_setup.png",50,40,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.servo_setup_ai),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(F5),this.setTooltip(b.Msg.extension_servo_setup_on_ai_TOOLTIP),this.setHelpUrl("")}};b.Python.extension_servo_setup_on_ai=function(n){b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_time="import time",b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`,b.Python.definitions_.import_CocoPi_multiFuncGpio="from CocoPi import multiFuncGpio",b.Python.definitions_.import_CocoPi_multiFuncGpio="from CocoPi import multiFuncGpio";try{const t=fxe("extension_servo_write_on_ai");let i=t.length>0?t[0].textContent:"";if(i.indexOf("S1")!=-1){let s=0;for(let o=0;o<t.length;o++)if(t[o].textContent.indexOf("S1")==0){s=t[o].children[1].textContent;break}b.Python.definitions_.servo_initS1=`S1= multiFuncGpio(0,1)
- S1.servoCtrl(${isNaN(Number(s))?90:s})`}if(i.indexOf("S2")!=-1){let s=0;for(let o=0;o<t.length;o++)if(t[o].textContent.indexOf("S2")==0){s=t[o].children[1].textContent;break}b.Python.definitions_.servo_initS2=`S2= multiFuncGpio(1,1)
- S2.servoCtrl(${isNaN(Number(s))?90:s})`}}catch(t){console.log("error",t)}var e="";return e};b.Blocks.extension_servo_write_on_ai={init:function(){this.appendDummyInput().appendField(b.Msg.servo_set_gpio_ai).appendField(new b.FieldDropdown([["S1","S1"],["S2","S2"],["P0","P0"],["P1","P1"],["P2","P2"],["P3","P3"]]),"gpio"),this.appendValueInput("degree").setCheck(null).appendField(b.Msg.servo_rotate_to_ai),this.appendDummyInput().appendField(b.Msg.servo_degree_ai),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(F5),this.setTooltip(b.Msg.extension_servo_write_on_ai_TOOLTIP),this.setHelpUrl("")}};b.Python.extension_servo_write_on_ai=function(n){var e=b.Python.valueToCode(n,"degree",b.Python.ORDER_ATOMIC),t=n.getFieldValue("gpio");let i="";return t=="S1"||t=="S2"?i=`${t}.servoCtrl(${e})
- `:(b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_CocoPi_extServo=`
- class PCA9685(object):
- bus=smbus2.SMBus(2)
- def __init__(self,freq=400,min_us=460,max_us=2400,address=0x40,degrees=180):
- self.address=address
- self.period=1000000/freq
- self.min_duty = self._us2duty(min_us)
- self.max_duty = self._us2duty(max_us)
- self.freq(freq)
- self.reset()
- #for i in range(0,16):
- #self.duty(i,0)
- print("Pca9685 init")
-
- def write(self, addr, val):
- for i in range(0, 2):
- try:
- self.bus.write_byte_data(self.address, addr, val)
- #time.sleep(0.001) # 1ms
- # print(addr, val) # debug
- return True
- except Exception:
- time.sleep(0.001)
- continue
- return False
-
- def read(self,addr):
- for i in range(0, 3):
- try:
- tmp = self.bus.read_byte_data(self.address, addr)
- #time.sleep(0.001) # 1ms
- # print(addr, tmp) # debug
- return tmp
- except Exception:
- time.sleep(0.01)
- continue
- return None
-
- def reset(self):
- self.write(0x00,0x00) #初始化
-
- def freq(self,freq=None):
- if freq is None:
- return int(25000000.0/4096/(self.read(0xfe)-0.5))
- #设定频率freq,预分频prescale=int(25000000.0 / (4096.0 * freq) + 0.5)
- prescale=int(25000000.0/4096/freq+0.5)
- self.write(0x00,0x10) #设定pca9685为睡眠模式
- self.write(0xfe,prescale) #设定频率
- self.reset()
- time.sleep(0.01)
- self.write(0x00,0xa1) #设定pca9685为活跃模式
-
- def pwm(self,index,on=None,off=None): #on和off来调节PWM的占空比
- if not 0<= index <=15:
- raise ValueError("Pin ID out of range!")
- if on is None or off is None:
- data = self.bus.read_i2c_block_data(self.address,0x06+index*4,4)
- return data
- data= [0]*4
- data[0]=int(hex(on & 0xff),16)
- data[1]=int(hex((on >> 8) & 0xff),16)
- data[2]=int(hex(off & 0xff),16)
- data[3]=int(hex((off >> 8) & 0xff),16)
- # print(data)
- for i in range(0,4):
- self.write(0x06+i+index*4,data[i])
-
- def duty(self,index,value=None):
- if value == None:
- return self.pwm(index)
- elif not 0 <= value <=4095:
- raise ValueError("Out of range!")
- elif value==0:
- self.pwm(index,0,4096)
- elif value == 4095:
- self.pwm(index,4096,0)
- else:
- self.pwm(index,0,value)
- def _us2duty(self,value):
- return 4095*value/self.period
-
- def __del__(self):
- print("del pac9685")
- time.sleep(1)
- for i in range(0,16):
- self.duty(i,0)
- time.sleep(0.001)
-
- class extServo(PCA9685):
- def __init__(self,servoId):
- PCA9685.__init__(self)
- self.servoId=servoId
- self.servoPin=[14,15,1,0]
- self.degrees=180
- pass
-
- def position(self,degrees=None): #index:0,1,2,3
- if degrees == 180:
- self.max_duty = 3800
- span = self.max_duty - self.min_duty
- duty = self.min_duty + span * degrees / self.degrees
- duty = int(min(self.max_duty, max(self.min_duty, int(duty))))
- self.duty(self.servoPin[self.servoId], duty)
-
- def release(self):
- self.duty(self.servoPin[self.servoId],0)
-
- def __del__(self):
- self.duty(self.servoPin[self.servoId],0)
- `,b.Python.definitions_["servo_init_"+t]=`${t} = extServo(${t[1]})`,i=`${t}.position(${e})
- `),i};b.Blocks.ai_motor_setup={init:function(){this.appendDummyInput().appendField(new b.FieldImage("/media/motor_setup.png",50,40,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.x_motor_set_motor_ai),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(F5),this.setTooltip(b.Msg.ai_motor_setup_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_motor_setup=function(n){b.Python.definitions_.import_smbus2="import smbus2",b.Python.definitions_.import_time="import time",b.Python.definitions_.import_sys=`import sys
- sys.path.append("/root/")`;var e="";return e};b.Blocks.ai_motor_run={init:function(){this.appendDummyInput().appendField(b.Msg.x_motor_set_motor_turn_ai).appendField(new b.FieldDropdown([["M1","M1"],["M2","M2"],["M3","C"],["M4","D"],["M5","E"],["M6","F"]]),"motor_type").appendField(b.Msg.x_motor_set_motor_speed_ai),this.appendValueInput("speed").setCheck(null),this.appendDummyInput().appendField(b.Msg.x_motor_exec_ai).appendField(new b.FieldDropdown([[b.Msg.x_motor_cw_ai,"pos"],[b.Msg.x_motor_acw_ai,"neg"]]),"direction").appendField(b.Msg.x_motor_set_motor_turns_ai),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(F5),this.setTooltip(b.Msg.ai_motor_run_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_motor_run=function(n){var e=n.getFieldValue("motor_type"),t=b.Python.valueToCode(n,"speed",b.Python.ORDER_ATOMIC),i=n.getFieldValue("direction"),s="";return e==="M1"||e==="M2"?(b.Python.definitions_.import_CocoPi_stm8s_init=`from CocoPi import stm8s
- iic_slaver=stm8s()
- iic_slaver.clear()
- del iic_slaver`,b.Python.definitions_.import_CocoPi_stm8s="from CocoPi import dcMotor",b.Python.definitions_["dcMotorCtrlFun"+e]=`${e} = dcMotor(${e.slice(1,2)})`,i=="pos"?s=`${e}.dcMotorCtrl(1,${t})
- `:s=`${e}.dcMotorCtrl(0,${t})
- `):(b.Python.definitions_.import_CocoPi_extDcMotor="from CocoPi import extDcMotor",b.Python.definitions_["dcMotorCtrlFun"+e]=`${e} = extDcMotor("${e}")`,i=="pos"?s=`${e}.speedControl(${t})
- `:s=`${e}.speedControl(-${t})
- `),s};const eu="#5cb2d6";b.Blocks.ai_lcd_screeninit={init:function(){this.appendDummyInput().appendField(new b.FieldImage("/media/screen_init_header.png",45,45,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.image_process_lcd_init),this.appendDummyInput().appendField(b.Msg.image_process_lcd_direction).appendField(new b.FieldDropdown([[b.Msg.image_process_lcd_landscape_screen,"False"],[b.Msg.image_process_lcd_vertical_screen,"True"]]),"isScreen"),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_screeninit_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_screeninit=function(n){return n.getFieldValue("isScreen"),b.Python.definitions_.import_display="from maix import display",b.Python.definitions_.import_image="from maix import image",b.Python.definitions_.import_camera="from maix import camera",b.Python.definitions_.import_os="import os",_code};b.Blocks.ai_lcd_rgb_value_input={init:function(){this.appendDummyInput().appendField(b.Msg.rgb_R),this.appendValueInput("rgb_value_r").setCheck(null).appendField(""),this.appendDummyInput().appendField(b.Msg.rgb_G),this.appendValueInput("rgb_value_g").setCheck(null).appendField(""),this.appendDummyInput().appendField(b.Msg.rgb_B),this.appendValueInput("rgb_value_b").setCheck(null).appendField(""),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_rgb_value_input_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_rgb_value_input=function(n){var e=b.Python.valueToCode(n,"rgb_value_r",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"rgb_value_g",b.Python.ORDER_ATOMIC),i=b.Python.valueToCode(n,"rgb_value_b",b.Python.ORDER_ATOMIC),s=""+e+","+t+","+i;return[s,b.Python.ORDER_NONE]};b.Blocks.ai_lcd_XY={init:function(){var n=this.appendDummyInput();this.setHelpUrl(b.Msg.LOGIC_OPERATION_HELPURL),this.setTooltip(b.Msg.ai_lcd_XY_TOOLTIP),this.setColour(eu),this.setOutput(!0,"Boolean"),n.appendField(b.Msg.image_process_xy_x),this.appendValueInput("A").setCheck("Number"),n=this.appendDummyInput(),n.appendField(b.Msg.image_process_xy_y),this.appendValueInput("B").setCheck("Number"),this.setInputsInline(!0)}};b.Python.ai_lcd_XY=function(n){var e=b.Python.valueToCode(n,"A",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"B",b.Python.ORDER_ATOMIC),i=""+e+", "+t;return[i,b.Python.ORDER_ATOMIC]};b.Blocks.lcd_set_width_height={init:function(){this.appendValueInput("WIDTH").setCheck("Number").appendField(b.Msg.image_process_wh_width),this.appendValueInput("HEIGHT").setCheck("Number").appendField(b.Msg.image_process_wh_height),this.setOutput(!0,"String"),this.setInputsInline(!0),this.setColour(eu),this.setTooltip(""),this.setHelpUrl("")}};b.Python.lcd_set_width_height=function(n){var e=b.Python.valueToCode(n,"WIDTH",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"HEIGHT",b.Python.ORDER_ATOMIC),i=e+", "+t;return[i,b.Python.ORDER_ATOMIC]};b.Blocks.ai_lcd_font={init:function(){this.appendDummyInput().appendField(b.Msg.image_lcd_set_font),this.appendValueInput("save_path").setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.image_lcd_set_font),this.setHelpUrl("")}};b.Python.ai_lcd_font=function(n){var e=b.Python.valueToCode(n,"save_path",b.Python.ORDER_ATOMIC);b.Python.definitions_.ai_lcd_font=`image.load_freetype(${e})
- `;var t="";return t};b.Blocks.ai_lcd_createnonecarvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_create_blank_canvas),this.appendValueInput("wh").setCheck(null).appendField(b.Msg.image_process_text_size),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_createnonecarvas_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_createnonecarvas=function(n){var e=b.Python.valueToCode(n,"wh",b.Python.ORDER_ATOMIC),t="canvas = image.new(size = ("+e+`))
- `;return t};b.Blocks.ai_lcd_fill_screen_with_rgb={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_let_canvas_filled_with_color),this.appendValueInput("rgb_value").setCheck(null).appendField(""),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_fill_screen_with_rgb_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_fill_screen_with_rgb=function(n){var e=b.Python.valueToCode(n,"rgb_value",b.Python.ORDER_ATOMIC);if(e.charAt(0)=="#"){var t=0,i=0,s=0;try{e.length==7&&(t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16))}catch{}e="("+t+","+i+","+s+")"}var o="";return o};b.Blocks.ai_lcd_textcarvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_on_draw),this.appendValueInput("POSA").setCheck("String").appendField(b.Msg.image_process_text_start_coord),this.appendValueInput("CONTENT").setCheck("String").appendField(b.Msg.image_process_text_content),this.appendValueInput("COLOR").setCheck("String").appendField(b.Msg.image_process_text_color),this.appendValueInput("Scale").setCheck("Number").appendField(b.Msg.image_process_draw_text_font_size),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_textcarvas_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_textcarvas=function(n){var e=b.Python.valueToCode(n,"COLOR",b.Python.ORDER_ATOMIC),t="";if(e.charAt(0)=="#"){var i=0,s=0,o=0;try{e.length==7&&(i=parseInt(e.substring(1,3),16),s=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5,7),16))}catch{}var r=b.Python.valueToCode(n,"CONTENT",b.Python.ORDER_ATOMIC),a=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC),c=b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC);t="canvas.draw_string("+a+", "+r+", scale = "+c+", color = ("+i+","+s+","+o+`) , thickness = 1)
- `}else if(e.charAt(0)!="#"){var i=0,s=0,o=0;try{e.length==7&&(i=parseInt(e.substring(1,3),16),s=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5,7),16))}catch{}var r=b.Python.valueToCode(n,"CONTENT",b.Python.ORDER_ATOMIC),a=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC),c=b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC);t="canvas.draw_string("+a+", "+r+", scale = "+c+", color = "+e+`, thickness = 1)
- `}return t};b.Blocks.ai_lcd_linecarvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_draw_line),this.appendValueInput("POSA").setCheck("String").appendField(b.Msg.image_process_text_start_coord),this.appendValueInput("POSB").setCheck("String").appendField(b.Msg.image_process_text_end_coord),this.appendValueInput("COLOR").setCheck("String").appendField(b.Msg.image_process_text_color),this.appendValueInput("Scale").setCheck("Number").appendField(b.Msg.image_process_text_thick),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_linecarvas_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_linecarvas=function(n){var e=b.Python.valueToCode(n,"COLOR",b.Python.ORDER_ATOMIC);if(e.charAt(0)=="#"){var t=0,i=0,s=0;try{e.length==7&&(t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16))}catch{}var o=b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC),r=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC),a=b.Python.valueToCode(n,"POSB",b.Python.ORDER_ATOMIC),c="canvas.draw_line("+r+", "+a+", color=("+t+","+i+","+s+"), thickness="+o+`)
- `}else if(e.charAt(0)!="#"){var t=0,i=0,s=0;try{e.length==7&&(t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16))}catch{}var o=b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC),r=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC),a=b.Python.valueToCode(n,"POSB",b.Python.ORDER_ATOMIC),c="canvas.draw_line("+r+", "+a+", color="+e+", thickness="+o+`)
- `}return c};b.Blocks.ai_lcd_ractanglecarvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_on_draw).appendField(new b.FieldDropdown([[b.Msg.image_process_text_filled,"fillrect"],[b.Msg.image_process_text_stroked,"rect"]]),"rect_type").appendField(b.Msg.image_process_draw_rectangle_text),this.appendValueInput("POSA").setCheck("String").appendField(b.Msg.image_process_text_start_coord),this.appendValueInput("POSB").setCheck("String").appendField(b.Msg.image_process_text_end_coord),this.appendValueInput("COLOR").setCheck("String").appendField(b.Msg.image_process_text_color),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour("#5bb2d6");var n=this;this.setTooltip(function(){var e=n.getFieldValue("rect_type"),t={fillrect:b.Msg.ai_lcd_ractanglecarvas_TOOLTIP.replace("%1",b.Msg.image_process_text_filled),rect:b.Msg.ai_lcd_ractanglecarvas_TOOLTIP.replace("%1",b.Msg.image_process_text_stroked)};return t[e]}),this.setHelpUrl("")}};b.Python.ai_lcd_ractanglecarvas=function(n){var e=b.Python.valueToCode(n,"COLOR",b.Python.ORDER_ATOMIC),t=n.getFieldValue("rect_type")=="fillrect"?"-1":"1";b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC);var i=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC),s=b.Python.valueToCode(n,"POSB",b.Python.ORDER_ATOMIC),o="";if(e.charAt(0)=="#"){var r=0,a=0,c=0;try{e.length==7&&(r=parseInt(e.substring(1,3),16),a=parseInt(e.substring(3,5),16),c=parseInt(e.substring(5,7),16))}catch{}o=`canvas.draw_rectangle(${i},${s}, color=(${r},${a},${c}), thickness=${t})
- `}else e.charAt(0)!="#"&&(o=`canvas.draw_rectangle(${i},${s}, color=${e}, thickness=${t})
- `);return o};b.Blocks.lcd_set_position={init:function(){this.appendValueInput("POSX").setCheck("Number").appendField("X:"),this.appendValueInput("POSY").setCheck("Number").appendField("Y:"),this.setOutput(!0,"String"),this.setInputsInline(!0),this.setColour(eu),this.setTooltip(""),this.setHelpUrl("")}};b.Python.lcd_set_position=function(n){var e=b.Python.valueToCode(n,"POSX",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"POSY",b.Python.ORDER_ATOMIC),i=e+","+t;return[i,b.Python.ORDER_ATOMIC]};b.Blocks.lcd_set_color={init:function(){this.appendDummyInput().appendField(b.Msg.COLOR).appendField(new b.FieldColour("#ff0000"),"COLOR"),this.setOutput(!0,"String"),this.setColour("#5bb2d6"),this.setTooltip(""),this.setHelpUrl("")}};b.Python.lcd_set_color=function(n){var e=n.getFieldValue("COLOR");return[e,b.Python.ORDER_ATOMIC]};b.Blocks.ai_lcd_draw_rectangle={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_on_draw).appendField(new b.FieldDropdown([[b.Msg.image_process_text_filled,"fillrect"],[b.Msg.image_process_text_stroked,"rect"]]),"rect_type").appendField(b.Msg.image_process_draw_rectangle_text),this.appendValueInput("POSA").setCheck("String").appendField(b.Msg.image_process_text_start_coord),this.appendValueInput("POSB").setCheck("String").appendField(b.Msg.image_process_text_size),this.appendValueInput("COLOR").setCheck("String").appendField(b.Msg.image_process_text_color),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(eu);var n=this;this.setTooltip(function(){var e=n.getFieldValue("rect_type"),t={fillrect:b.Msg.ai_lcd_ractanglecarvas_TOOLTIP.replace("%1",b.Msg.image_process_text_filled),rect:b.Msg.ai_lcd_ractanglecarvas_TOOLTIP.replace("%1",b.Msg.image_process_text_stroked)};return t[e]}),this.setHelpUrl("")}};b.Python.ai_lcd_draw_rectangle=function(n){var e=b.Python.valueToCode(n,"COLOR",b.Python.ORDER_ATOMIC),t=n.getFieldValue("rect_type")=="fillrect"?"-1":"1",i=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC),s=b.Python.valueToCode(n,"POSB",b.Python.ORDER_ATOMIC);let o=i.split(","),r=s.split(",");Number(o[0])+Number(r[0]),Number(o[1])+Number(r[1]);var a="";if(e.charAt(0)=="#"){var c=0,u=0,d=0;try{e.length==7&&(c=parseInt(e.substring(1,3),16),u=parseInt(e.substring(3,5),16),d=parseInt(e.substring(5,7),16))}catch{}a=`canvas.draw_rectangle(${i}, ${o[0]}+${r[0]},${o[1]}+${r[1]}, color=(${c},${u},${d}), thickness=${t})
- `}else e.charAt(0)!="#"&&(a=`canvas.draw_rectangle(${i}, ${o[0]}+${r[0]},${o[1]}+${r[1]}, color=${e}, thickness=${t})
- `);return a};b.Blocks.ai_lcd_drawcirclecarvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_on_draw).appendField(new b.FieldDropdown([[b.Msg.image_process_text_filled,"fillrect"],[b.Msg.image_process_text_stroked,"rect"]]),"rect_type").appendField(b.Msg.image_process_draw_circle_text),this.appendValueInput("POSA").setCheck("String").appendField(b.Msg.image_process_draw_circle_text_start),this.appendValueInput("Scale").setCheck("Number").appendField(b.Msg.image_process_text_radius),this.appendValueInput("COLOR").setCheck("String").appendField(b.Msg.image_process_text_color),this.appendValueInput("Scale_0").setCheck("Number").appendField(b.Msg.image_process_text_thick),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(eu);var n=this;this.setTooltip(function(){var e=n.getFieldValue("rect_type"),t={fillrect:b.Msg.ai_lcd_drawcirclecarvas_TOOLTIP.replace("%1",b.Msg.image_process_text_filled),rect:b.Msg.ai_lcd_drawcirclecarvas_TOOLTIP.replace("%1",b.Msg.image_process_text_stroked)};return t[e]}),this.setHelpUrl("")}};b.Python.ai_lcd_drawcirclecarvas=function(n){var e=b.Python.valueToCode(n,"COLOR",b.Python.ORDER_ATOMIC);if(e.charAt(0)=="#"){var t=0,i=0,s=0;try{e.length==7&&(t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16))}catch{}var o=n.getFieldValue("rect_type")=="fillrect"?"-1":"1",r=b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC),a=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC);b.Python.valueToCode(n,"Scale_0",b.Python.ORDER_ATOMIC);var c="canvas.draw_circle("+a+", "+r+", color=("+t+", "+i+", "+s+"), thickness="+o+`)
- `}else if(e.charAt(0)!="#"){var t=0,i=0,s=0;try{e.length==7&&(t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16))}catch{}var o=n.getFieldValue("rect_type")=="fillrect"?"-1":"1",r=b.Python.valueToCode(n,"Scale",b.Python.ORDER_ATOMIC),a=b.Python.valueToCode(n,"POSA",b.Python.ORDER_ATOMIC);b.Python.valueToCode(n,"Scale_0",b.Python.ORDER_ATOMIC);var c="canvas.draw_circle("+a+", "+r+", color="+e+", thickness="+o+`)
- `}return c};b.Blocks.ai_lcd_draw_image_on_canvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_on_canvas).appendField(b.Msg.image_process_draw_image_title),this.appendValueInput("image_path").setCheck(null).appendField(b.Msg.image_process_draw_sensor_image_path),this.appendValueInput("scale_y").setCheck(null).appendField(b.Msg.OLCD_COORDINATE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_draw_image_on_canvas_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_draw_image_on_canvas=function(n){var e=b.Python.valueToCode(n,"image_path",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"scale_y",b.Python.ORDER_ATOMIC),i="canvas.draw_image("+e+","+t+`,alpha=1)
- `;return i};b.Blocks.ai_lcd_rotation={init:function(){this.appendDummyInput().appendField(b.Msg.LCD_CANVAS).appendField(b.Msg.image_process_set_lcd_rotation).appendField(new b.FieldDropdown([["0°","0"],["90°","90"],["180°","180"],["270°","270"]]),"DEGREE").appendField(b.Msg.CATEGORY_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_rotation_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_rotation=function(n){n.getFieldValue("DEGREE");var e=`
- `;return e};b.Blocks.ai_lcd_showcarvas_set_display={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_show_canvas),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_showcarvas_set_display_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_showcarvas_set_display=function(n){b.Python.definitions_.import_base64="import base64",b.Python.definitions_.import_time="import time";var e=`
- `;return e};b.Blocks.ai_lcd_clearcanvas={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_clear_canvas_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(eu),this.setTooltip(b.Msg.ai_lcd_clearcanvas_TOOLTIP),this.setHelpUrl("")}};b.Python.ai_lcd_clearcanvas=function(n){var e=`canvas.clear()
- `;return e};const Dt={Common:"328",System:"#22398e",onboard_RGB:"0",Event:"32",Show:"#5bb2d6",Music:"192",Audio:"#24c48e",AI:"#24c48e",Pin:"#ff8b2c",Radio:"328",Wifi:"#386dc8",IoT_OneNet:"64",IoT_TinyWebIO:"160",IoT_Blynk:"#24c48e",IoT_MQTT:"288",IoT_OneNet_WeChat:"64",Neopixel:"288",Bluebit:"#336699",General:"260",Sensor:"260",Weather:"192",Logic:"#4c97ff",Loop:"120",Math:"#5472ea",Text:"#33cc99",List:"#40bfe4",Variables:"330",Functions:"290",Tuple:"192",Dictionary:"32",Set:"160",File:"#22398e",Network:"#183895",UART:"260",Box:"#24c48e",Microbit:"160",Accelerometer:"0",Button:"32",Compass:"64",Image:"128",Light:"224",Radio2:"288",AI_LCD:"#BA2FBA",AI_camera:"#008CFF",AI_face:"#6533CB",AI_20classid:"#3B67CC",AI_number:"#068227",AI_color:"#7C658C",Procedures:"#ff6381"};b.Blocks.custom_text_block={init:function(){this.appendDummyInput().appendField(b.Msg.numpy_mnist_clear).appendField(new b.FieldTextInput("张三丰"),"TEXT_INPUT"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setHelpUrl(""),this.setStyle("custom_text_blocks")}};b.Blocks.CocoRobo_return={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_RETURN_TOOLTIP,message0:b.Msg.CocoRobo_RETURN_MESSAGE0,args0:[{type:"input_value",name:"VAR"}]})}};b.Blocks.CocoRobo_try_except={init:function(){this.jsonInit({message0:"",previousStatement:null,nextStatement:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_try_except_TOOLTIP,helpUrl:""}),this.appendStatementInput("TRY").appendField("try"),this.appendStatementInput("EXCEPT").appendField("except")}};b.Blocks.CocoRobo_try_except_finally={init:function(){this.jsonInit({message0:"",previousStatement:null,nextStatement:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_try_except_finally_TOOLTIP,helpUrl:""}),this.appendStatementInput("TRY").appendField("try"),this.appendStatementInput("EXCEPT").appendField("except"),this.appendStatementInput("FINALLY").appendField("finally")}};b.Blocks.CocoRobo_type={init:function(){this.jsonInit({message0:"值 %1 的类型",args0:[{type:"input_value",name:"VAR"}],output:null,colour:Dt.Logic,tooltip:"返回当前值的类型",helpUrl:""})}};b.Blocks.CocoRobo_type_is={init:function(){this.jsonInit({message0:"值 %1 的类型为 %2",args0:[{type:"input_value",name:"VAR"},{name:"TYPE",options:[["int","int"],["float","float"],["bool","bool"],["str","str"],["list","list"],["tuple","tuple"],["set","set"],["dict","dict"],["bytes","bytes"],["bytearray","bytearray"],["complex","complex"]],type:"field_dropdown"}],output:"Boolean",colour:Dt.Logic,helpUrl:b.Msg.CocoRobo_TYPE_IS_HELPURL});var n=this;this.setTooltip(function(){return b.Msg.CocoRobo_TYPE_IS_TOOLTIP.replace("%2",n.getFieldValue("TYPE"))})}};b.Blocks.CocoRobo_eval={init:function(){this.jsonInit({message0:"计算表达式 %1 的结果",args0:[{check:"String",type:"input_value",name:"VAR"}],output:null,colour:Dt.Logic,tooltip:"计算字符串表达式,并返回结果",helpUrl:""})}};const Iw="#9d64fd";b.Blocks.controls_repeat_forever={init:function(){this.jsonInit({message0:b.Msg.CONTROLS_REPEAT_FOREVER,previousStatement:null,nextStatement:null,colour:Iw,tooltip:b.Msg.CONTROLS_REPEAT_FOREVER_TOOLTIP,helpUrl:b.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO)}};b.Blocks.controls_repeat_ext={init:function(){this.jsonInit({message0:b.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES",check:"Number"}],previousStatement:null,nextStatement:null,colour:Iw,tooltip:b.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:b.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO)}};b.Blocks.controls_repeat={init:function(){this.jsonInit({message0:b.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],previousStatement:null,nextStatement:null,colour:Iw,tooltip:b.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:b.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO)}};b.Blocks.controls_whileUntil={init:function(){var n=[[b.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[b.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];this.setHelpUrl(b.Msg.CONTROLS_WHILEUNTIL_HELPURL),this.setColour(Iw),this.appendValueInput("BOOL").setCheck("Boolean").appendField(new b.FieldDropdown(n),"MODE"),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_WHILEUNTIL_INPUT_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return{WHILE:b.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:b.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]})}};b.Blocks.controls_for={init:function(){this.jsonInit({message0:b.Msg.CONTROLS_FOR_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:Iw,helpUrl:b.Msg.CONTROLS_FOR_HELPURL}),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_FOR_INPUT_DO);var n=this;this.setTooltip(function(){return b.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",n.getFieldValue("VAR"))})}};b.Blocks.controls_forEach={init:function(){this.jsonInit({message0:b.Msg.CONTROLS_FOREACH_TITLE,args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],previousStatement:null,nextStatement:null,colour:Iw,helpUrl:b.Msg.CONTROLS_FOREACH_HELPURL}),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_FOREACH_INPUT_DO);var n=this;this.setTooltip(function(){return b.Msg.CONTROLS_FOREACH_TOOLTIP.replace("%1",n.getFieldValue("VAR"))})},customContextMenu:b.Blocks.controls_for.customContextMenu};b.Blocks.controls_flow_statements={init:function(){var n=[[b.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[b.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];this.setHelpUrl(b.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL),this.setColour(Iw),this.appendDummyInput().appendField(new b.FieldDropdown(n),"FLOW"),this.setPreviousStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("FLOW");return{BREAK:b.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:b.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]})},onchange:function(n){if(!this.workspace.isDragging()){n=!1;var e=this;do{if(this.LOOP_TYPES.indexOf(e.type)!=-1){n=!0;break}e=e.getSurroundParent()}while(e);n?(this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(b.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setDisabled(!0))}},LOOP_TYPES:"controls_repeat_forever controls_repeat controls_repeat_ext controls_forEach controls_for controls_whileUntil tello_repeat_forever".split(" ")};const mxe=b.Blocks.controls_if;b.Blocks.controls_if={init:function(){mxe.init.call(this),this.setColour(Dt.Logic)}};b.Blocks.controls_if_elseif={init:function(){this.setColour(Dt.Logic),this.appendDummyInput().appendField(b.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}};b.Blocks.controls_if_else={init:function(){this.setColour(Dt.Logic),this.appendDummyInput().appendField(b.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(b.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}};b.Blocks.controls_if_if={init:function(){this.setColour(Dt.Logic),this.appendDummyInput().appendField(b.Msg.CONTROLS_IF_IF_TITLE_IF),this.setNextStatement(!0),this.setTooltip(b.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}};b.Blocks.logic_compare={init:function(){var n=[["==","EQ"],["!=","NEQ"],[">","LT"],[">=","LTE"],["<","GT"],["<=","GTE"]],e=[["==","EQ"],["!=","NEQ"],["<","LT"],["<=","LTE"],[">","GT"],[">=","GTE"]],t=this.RTL?n:e;this.setHelpUrl(b.Msg.LOGIC_COMPARE_HELPURL),this.setColour(Dt.Logic),this.setOutput(!0,"Boolean"),this.appendValueInput("A"),this.appendValueInput("B").appendField(new b.FieldDropdown(t),"OP"),this.setInputsInline(!0);var i=this;this.setTooltip(function(){var s=i.getFieldValue("OP"),o={EQ:b.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:b.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:b.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:b.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:b.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:b.Msg.LOGIC_COMPARE_TOOLTIP_GTE};return o[s]}),this.prevBlocks_=[null,null]},onchange:function(n){var e=this.getInputTargetBlock("A"),t=this.getInputTargetBlock("B");if(e&&t&&!e.outputConnection.checkType_(t.outputConnection)){b.Events.setGroup(n.group);for(var i=0;i<this.prevBlocks_.length;i++){var s=this.prevBlocks_[i];(s===e||s===t)&&(s.unplug(),s.bumpNeighbours_())}b.Events.setGroup(!1)}this.prevBlocks_[0]=e,this.prevBlocks_[1]=t}};b.Blocks.logic_operation={init:function(){var n=[[b.Msg.LOGIC_OPERATION_AND,"AND"],[b.Msg.LOGIC_OPERATION_OR,"OR"]];this.setHelpUrl(b.Msg.LOGIC_OPERATION_HELPURL),this.setColour(Dt.Logic),this.setOutput(!0,"Boolean"),this.appendValueInput("A").setCheck("Boolean"),this.appendValueInput("B").setCheck("Boolean").appendField(new b.FieldDropdown(n),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP"),i={AND:b.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:b.Msg.LOGIC_OPERATION_TOOLTIP_OR};return i[t]})}};b.Blocks.logic_negate={init:function(){this.jsonInit({message0:b.Msg.LOGIC_NEGATE_TITLE,args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",colour:Dt.Logic,tooltip:b.Msg.LOGIC_NEGATE_TOOLTIP,helpUrl:b.Msg.LOGIC_NEGATE_HELPURL})}};b.Blocks.logic_boolean={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[[b.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[b.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]]}],output:"Boolean",colour:Dt.Logic,tooltip:b.Msg.LOGIC_BOOLEAN_TOOLTIP,helpUrl:b.Msg.LOGIC_BOOLEAN_HELPURL})}};b.Blocks.logic_null={init:function(){this.jsonInit({message0:b.Msg.LOGIC_NULL,output:null,colour:Dt.Logic,tooltip:b.Msg.LOGIC_NULL_TOOLTIP,helpUrl:b.Msg.LOGIC_NULL_HELPURL})}};b.Blocks.logic_ternary={init:function(){this.setHelpUrl(b.Msg.LOGIC_TERNARY_HELPURL),this.setColour(Dt.Logic),this.appendValueInput("IF").setCheck("Boolean").appendField(b.Msg.LOGIC_TERNARY_CONDITION),this.appendValueInput("THEN").appendField(b.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("ELSE").appendField(b.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setTooltip(b.Msg.LOGIC_TERNARY_TOOLTIP),this.prevParentConnection_=null},onchange:function(n){var e=this.getInputTargetBlock("THEN"),t=this.getInputTargetBlock("ELSE"),i=this.outputConnection.targetConnection;if((e||t)&&i)for(var s=0;s<2;s++){var o=s==1?e:t;o&&!o.outputConnection.checkType_(i)&&(b.Events.setGroup(n.group),i===this.prevParentConnection_?(this.unplug(),i.getSourceBlock().bumpNeighbours_()):(o.unplug(),o.bumpNeighbours_()),b.Events.setGroup(!1))}this.prevParentConnection_=i}};b.Blocks.logic_isIn={init:function(){var n=[["is in","IN"],["is not in","NOTIN"]];this.setColour(Dt.Logic),this.setOutput(!0,"Boolean"),this.appendValueInput("ITEM"),this.appendValueInput("LIST").setCheck(["Array","String"]).appendField(new b.FieldDropdown(n),"OP"),this.setInputsInline(!0)}};b.Blocks.logic_none={init:function(){this.appendDummyInput().appendField("None"),this.setColour(Dt.Logic),this.setOutput(!0)}};b.Blocks.CocoRobo_return={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_RETURN_TOOLTIP,message0:b.Msg.CocoRobo_RETURN_MESSAGE0,args0:[{type:"input_value",name:"VAR"}]})}};b.Blocks.CocoRobo_try_except={init:function(){this.jsonInit({message0:"",previousStatement:null,nextStatement:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_try_except_TOOLTIP,helpUrl:""}),this.appendStatementInput("TRY").appendField("try"),this.appendStatementInput("EXCEPT").appendField("except")}};b.Blocks.CocoRobo_try_except_finally={init:function(){this.jsonInit({message0:"",previousStatement:null,nextStatement:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_try_except_finally_TOOLTIP,helpUrl:""}),this.appendStatementInput("TRY").appendField("try"),this.appendStatementInput("EXCEPT").appendField("except"),this.appendStatementInput("FINALLY").appendField("finally")}};b.Blocks.CocoRobo_type={init:function(){this.jsonInit({message0:b.Msg.CocoRobo_TYPE_MESSAGE0,args0:[{type:"input_value",name:"VAR"}],output:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_TYPE_TOOLTIP,helpUrl:b.Msg.CocoRobo_TYPE_HELPURL})}};b.Blocks.CocoRobo_type_is={init:function(){this.jsonInit({message0:b.Msg.CocoRobo_TYPE_IS_MESSAGE0,args0:[{type:"input_value",name:"VAR"},{name:"TYPE",options:[["int","int"],["float","float"],["bool","bool"],["str","str"],["list","list"],["tuple","tuple"],["set","set"],["dict","dict"],["bytes","bytes"],["bytearray","bytearray"],["complex","complex"]],type:"field_dropdown"}],output:"Boolean",colour:Dt.Logic,helpUrl:b.Msg.CocoRobo_TYPE_IS_HELPURL});var n=this;this.setTooltip(function(){return b.Msg.CocoRobo_TYPE_IS_TOOLTIP.replace("%2",n.getFieldValue("TYPE"))})}};b.Blocks.CocoRobo_eval={init:function(){this.jsonInit({message0:b.Msg.CocoRobo_EVAL_MESSAGE0,args0:[{check:"String",type:"input_value",name:"VAR"}],output:null,colour:Dt.Logic,tooltip:b.Msg.CocoRobo_EVAL_TOOLTIP,helpUrl:b.Msg.CocoRobo_EVAL_HELPURL})}};b.Blocks.math_degrad={init:function(){this.appendValueInput("convert").setCheck(null).appendField(new b.FieldDropdown([[b.Msg.math_degrad_rad,"radians"],[b.Msg.math_degrad_deg,"degrees"]]),"rad_deg"),this.setOutput(!0,null),this.setColour("#5472ea"),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("rad_deg"),t={radians:b.Msg.Math_Degrad_RAD_TOOLTIP,degrees:b.Msg.Math_Degrad_DEG_TOOLTIP};return t[e]})}};b.Blocks.math_angle={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:"",tooltip:"",message0:"%1",args0:[{name:"angle",type:"field_angle"}]})}};b.Blocks.math_keep_decimal={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:b.Msg.MATH_KEEP_DECIMAL_HELPURL,tooltip:b.Msg.MATH_KEEP_DECIMAL_TOOLTIP,message0:b.Msg.MATH_KEEP_DECIMAL_MESSAGE0,args0:[{check:"Number",type:"input_value",name:"NUM"},{check:"Number",type:"input_value",name:"PLACE"}]})}};b.Blocks.math_division_consult={init:function(){this.jsonInit({message0:b.Msg.MATH_DIVISION_CONSULT_TITLE,args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",colour:"#5472ea",tooltip:b.Msg.MATH_DIVISION_CONSULT_TOOLTIP,helpUrl:b.Msg.MATH_DIVISION_CONSULT_HELPURL})}};b.Blocks.labplus_mapping={init:function(){this.jsonInit({colour:230,args0:[{name:"inputNum",type:"input_value",check:"Number"},{name:"bMin",type:"input_value",check:"Number"},{name:"bMax",type:"input_value",check:"Number"},{name:"cMin",type:"input_value",check:"Number"},{name:"cMax",type:"input_value",check:"Number"}],output:"Number",message0:b.Msg.labplus_mapping_MESSAGE0,tooltip:b.Msg.labplus_mapping_TOOLTIP,helpUrl:b.Msg.labplus_mapping_HELPURL})}};b.Blocks.math_random_randrange={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:b.Msg.MATH_RANDOM_RANDRANGE_HELPURL,tooltip:b.Msg.MATH_RANDOM_RANDRANGE_TOOLTIP,message0:b.Msg.MATH_RANDOM_RANDRANGE_MESSAGE0,args0:[{check:"Number",type:"input_value",name:"start"},{check:"Number",type:"input_value",name:"stop"},{check:"Number",type:"input_value",name:"step"}]})}};b.Blocks.math_random_float={init:function(){this.jsonInit({message0:b.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM,output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_RANDOM_FLOAT_TOOLTIP,helpUrl:b.Msg.MATH_RANDOM_FLOAT_HELPURL})}};b.Blocks.math_convert={init:function(){this.jsonInit({message0:b.Msg.MATH_CONVERT_MESSAGE0,args0:[{type:"field_dropdown",options:[["int","int"],["float","float"]],name:"TYPE0"},{type:"input_value",name:"INPUT0",check:["Number","String"]}],output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_CONVERT_TOOLTIP,helpUrl:b.Msg.MATH_CONVERT_HELPURL})}};b.Blocks.math_number_bits_ops={init:function(){this.jsonInit({message0:b.Msg.MATH_NUMBER_BITS_OPS_MESSAGE0,args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",options:[["|"," | "],["&"," & "],["^"," ^ "],["<<"," << "],[">>"," >> "]],name:"OP"},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_NUMBER_BITS_OPS_TOOLTIP,helpUrl:b.Msg.MATH_NUMBER_BITS_OPS_HELPURL})}};b.Blocks.bit_inversion={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:b.Msg.BIT_INVERSION_HELPURL,tooltip:b.Msg.BIT_INVERSION_TOOLTIP,message0:b.Msg.BIT_INVERSION_MESSAGE0,args0:[{type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_ten_convert_to={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.Math,helpUrl:b.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL,message0:b.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0,args0:[{check:"Number",type:"input_value",name:"int_num"},{options:[[b.Msg.CocoRobo_BIN,"bin"],[b.Msg.CocoRobo_OCT,"oct"],[b.Msg.CocoRobo_HEX,"hex"]],type:"field_dropdown",name:"ten_convert_to"}]});var n=this;this.setTooltip(function(){return b.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP.replace("%2",n.getFieldValue("ten_convert_to"))})}};b.Blocks.CocoRobo_convert_to_ten={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:b.Msg.CocoRobo_CONVERT_TO_TEN_HELPURL,message0:b.Msg.CocoRobo_CONVERT_TO_TEN_MESSAGE0,args0:[{options:[[b.Msg.CocoRobo_BIN,"2"],[b.Msg.CocoRobo_OCT,"8"],[b.Msg.CocoRobo_HEX,"16"]],type:"field_dropdown",name:"convert_choice"},{check:"String",type:"input_value",name:"convert_str"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("convert_choice"),t={2:b.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP.replace("%2","bin"),8:b.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP.replace("%2","oct"),16:b.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP.replace("%2","hex")};return t[e]})}};b.Blocks.CocoRobo_high_low={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Pin,helpUrl:b.Msg.CocoRobo_HIGH_LOW_HELPURL,tooltip:b.Msg.CocoRobo_HIGH_LOW_TOOLTIP,message0:b.Msg.CocoRobo_HIGH_LOW_MESSAGE0,args0:[{options:[["HIGH","1"],["LOW","0"]],type:"field_dropdown",name:"high_low"}]})}};b.Blocks.CocoRobo_start_new_thread={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Event,helpUrl:b.Msg.CocoRobo_START_NEW_THREAD_HELPURL,tooltip:b.Msg.CocoRobo_START_NEW_THREAD_TOOLTIP,message0:b.Msg.CocoRobo_START_NEW_THREAD_MESSAGE0,args0:[{options:[["1","1"],["2","2"],["3","3"],["4","4"]],type:"field_dropdown",name:"thread_name"}]}),this.appendStatementInput("DO").appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO)}};b.Blocks.CocoRobo_lock_object_acquire_lock={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Event,helpUrl:b.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_HELPURL,tooltip:b.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_TOOLTIP,message0:b.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_MESSAGE0,args0:[{type:"field_input",name:"thread_lock_object",text:"lock"}]})}};b.Blocks.CocoRobo_ten_converted_to_bytes={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Math,helpUrl:b.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_HELPURL,message0:b.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_MESSAGE0,args0:[{options:[["2","'<H'"],["4","'<L'"]],type:"field_dropdown",name:"convert_choice"},{check:"Number",type:"input_value",name:"convert_num"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("convert_choice"),t={"'<HH'":b.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP.replace("%1","2"),"'<LL'":b.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP.replace("%1","4")};return t[e]})}};b.Blocks.CocoRobo_int_to_chr={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.Math,helpUrl:b.Msg.CocoRobo_INT_TO_CHR_HELPURL,tooltip:b.Msg.CocoRobo_INT_TO_CHR_TOOLTIP,message0:b.Msg.CocoRobo_INT_TO_CHR_MESSAGE0,args0:[{check:"Number",type:"input_value",name:"convert_num"}]})}};b.Blocks.CocoRobo_hcsr04_obj={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.General,helpUrl:b.Msg.CocoRobo_HCSR04_OBJ_HELPURL,tooltip:b.Msg.CocoRobo_HCSR04_OBJ_TOOLTIP,message0:b.Msg.CocoRobo_HCSR04_OBJ_MESSAGE0,args0:[{text:"hcsr04",type:"field_input",name:"hcsr04_name"},{check:"Number",type:"input_value",name:"trigger"},{check:"Number",type:"input_value",name:"echo"}]})}};b.Blocks.CocoRobo_hcsr04_distance={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.General,helpUrl:b.Msg.CocoRobo_HCSR04_DISTANCE_HELPURL,tooltip:b.Msg.CocoRobo_HCSR04_DISTANCE_TOOLTIP,message0:b.Msg.CocoRobo_HCSR04_DISTANCE_MESSAGE0,args0:[{text:"hcsr04",type:"field_input",name:"hcsr04_name"},{options:[["mm","mm"],["cm","cm"]],type:"field_dropdown",name:"unit"}]})}};b.Blocks.CocoRobo_hcsr04_distance_mm={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Pin,helpUrl:b.Msg.CocoRobo_HCSR04_DISTANCE_MM_HELPURL,tooltip:b.Msg.CocoRobo_HCSR04_DISTANCE_MM_TOOLTIP,message0:b.Msg.CocoRobo_HCSR04_DISTANCE_MM_MESSAGE0,args0:[{text:"hcsr04",type:"field_input",name:"hcsr04_name"}]})}};b.Blocks.CocoRobo_pm2_5_MIC={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.General,helpUrl:b.Msg.CocoRobo_PM2_5_MIC_HELPURL,tooltip:b.Msg.CocoRobo_PM2_5_MIC_TOOLTIP,message0:b.Msg.CocoRobo_PM2_5_MIC_MESSAGE0,args0:[{check:"Number",type:"input_value",name:"rx"},{options:[["PM1.0ug/m3","_pm_data[0]"],["PM2.5ug/m3","_pm_data[1]"],["PM10ug/m3","_pm_data[2]"]],type:"field_dropdown",name:"unit"}]})}};b.Blocks.CocoRobo_pm2_5_LitresAir={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.General,helpUrl:b.Msg.CocoRobo_PM2_5_LitresAir_HELPURL,tooltip:b.Msg.CocoRobo_PM2_5_LitresAir_TOOLTIP,message0:b.Msg.CocoRobo_PM2_5_LitresAir_MESSAGE0,args0:[{check:"Number",type:"input_value",name:"rx"},{options:[["0.3um","_pm_data[3]"],["0.5um","_pm_data[4]"],["1um","_pm_data[5]"],["2.5um","_pm_data[6]"],["5um","_pm_data[7]"],["10um","_pm_data[8]"]],type:"field_dropdown",name:"unit"}]})}};b.Blocks.CocoRobo_mac_address={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.System,helpUrl:b.Msg.CocoRobo_MAC_ADDRESS_HELPURL,tooltip:b.Msg.CocoRobo_MAC_ADDRESS_TOOLTIP,message0:b.Msg.CocoRobo_MAC_ADDRESS_MESSAGE0})}};b.Blocks.CocoRobo_ujson_loads={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Text,helpUrl:b.Msg.CocoRobo_UJSON_LOADS_HELPURL,tooltip:b.Msg.CocoRobo_UJSON_LOADS_TOOLTIP,message0:b.Msg.CocoRobo_UJSON_LOADS_MESSAGE0,args0:[{check:"String",type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_code_annotation={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Text,helpUrl:b.Msg.CocoRobo_code_annotation_HELPURL,tooltip:b.Msg.CocoRobo_code_annotation_TOOLTIP,message0:b.Msg.CocoRobo_code_annotation_MESSAGE0,args0:[{check:"String",type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_ujson_dumps={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.Text,helpUrl:b.Msg.CocoRobo_UJSON_DUMPS_HELPURL,tooltip:b.Msg.CocoRobo_UJSON_DUMPS_TOOLTIP,message0:b.Msg.CocoRobo_UJSON_DUMPS_MESSAGE0,args0:[{type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_base64_to_data={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Math,helpUrl:b.Msg.CocoRobo_BASE64_TO_DATA_HELPURL,tooltip:b.Msg.CocoRobo_BASE64_TO_DATA_TOOLTIP,message0:b.Msg.CocoRobo_BASE64_TO_DATA_MESSAGE0,args0:[{type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_data_to_base64={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Math,helpUrl:b.Msg.CocoRobo_DATA_TO_BASE64_HELPURL,tooltip:b.Msg.CocoRobo_DATA_TO_BASE64_TOOLTIP,message0:b.Msg.CocoRobo_DATA_TO_BASE64_MESSAGE0,args0:[{type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_hex_to_bin_str={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Math,helpUrl:b.Msg.CocoRobo_HEX_TO_BIN_STR_HELPURL,tooltip:b.Msg.CocoRobo_HEX_TO_BIN_STR_TOOLTIP,message0:b.Msg.CocoRobo_HEX_TO_BIN_STR_MESSAGE0,args0:[{check:"String",type:"input_value",name:"convert_chr"}]})}};b.Blocks.CocoRobo_str_to_hex={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Math,helpUrl:b.Msg.CocoRobo_STR_TO_HEX_HELPURL,tooltip:b.Msg.CocoRobo_STR_TO_HEX_TOOLTIP,message0:b.Msg.CocoRobo_STR_TO_HEX_MESSAGE0,args0:[{check:"String",type:"input_value",name:"convert_chr"}]})}};b.Blocks.CocoRobo_chr_to_int={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.Math,helpUrl:b.Msg.CocoRobo_CHR_TO_INT_HELPURL,tooltip:b.Msg.CocoRobo_CHR_TO_INT_TOOLTIP,message0:b.Msg.CocoRobo_CHR_TO_INT_MESSAGE0,args0:[{check:"String",type:"input_value",name:"convert_chr"}]})}};b.Blocks.math_single={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[b.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[b.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Dt.Math,helpUrl:b.Msg.MATH_SINGLE_HELPURL});var n=this;this.setTooltip(function(){var e=n.getFieldValue("OP"),t={ROOT:b.Msg.MATH_SINGLE_TOOLTIP_ROOT,ABS:b.Msg.MATH_SINGLE_TOOLTIP_ABS,NEG:b.Msg.MATH_SINGLE_TOOLTIP_NEG,LN:b.Msg.MATH_SINGLE_TOOLTIP_LN,LOG10:b.Msg.MATH_SINGLE_TOOLTIP_LOG10,EXP:b.Msg.MATH_SINGLE_TOOLTIP_EXP,POW10:b.Msg.MATH_SINGLE_TOOLTIP_POW10};return t[e]})}};b.Blocks.math_number={init:function(){this.setHelpUrl(b.Msg.MATH_NUMBER_HELPURL),this.setColour(Dt.Math),this.appendDummyInput().appendField(new b.FieldNumber("0"),"NUM"),this.setOutput(!0,"Number");var n=this;this.setTooltip(function(){var e=n.getParent();return e&&e.getInputsInline()&&e.tooltip||b.Msg.MATH_NUMBER_TOOLTIP})}};b.Blocks.math_arithmetic={init:function(){this.jsonInit({message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:["Number","String"]},{type:"field_dropdown",name:"OP",options:[[b.Msg.MATH_ADDITION_SYMBOL,"ADD"],[b.Msg.MATH_SUBTRACTION_SYMBOL,"MINUS"],[b.Msg.MATH_MULTIPLICATION_SYMBOL,"MULTIPLY"],[b.Msg.MATH_DIVISION_SYMBOL,"DIVIDE"],[b.Msg.MATH_POWER_SYMBOL,"POWER"]]},{type:"input_value",name:"B",check:["Number","String"]}],inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:b.Msg.MATH_ARITHMETIC_HELPURL});var n=this;this.setTooltip(function(){var e=n.getFieldValue("OP"),t={ADD:b.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:b.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:b.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:b.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:b.Msg.MATH_ARITHMETIC_TOOLTIP_POWER,MODULO:"Computes the remainder of division."};return t[e]})}};b.Blocks.math_trig={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[b.Msg.MATH_TRIG_SIN,"SIN"],[b.Msg.MATH_TRIG_COS,"COS"],[b.Msg.MATH_TRIG_TAN,"TAN"],[b.Msg.MATH_TRIG_ASIN,"ASIN"],[b.Msg.MATH_TRIG_ACOS,"ACOS"],[b.Msg.MATH_TRIG_ATAN,"ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Dt.Math,helpUrl:b.Msg.MATH_TRIG_HELPURL});var n=this;this.setTooltip(function(){var e=n.getFieldValue("OP"),t={SIN:b.Msg.MATH_TRIG_TOOLTIP_SIN,COS:b.Msg.MATH_TRIG_TOOLTIP_COS,TAN:b.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:b.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:b.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:b.Msg.MATH_TRIG_TOOLTIP_ATAN};return t[e]})}};b.Blocks.math_constant={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_CONSTANT_TOOLTIP,helpUrl:b.Msg.MATH_CONSTANT_HELPURL})}};b.Blocks.math_number_property={init:function(){var n=[[b.Msg.MATH_IS_EVEN,"EVEN"],[b.Msg.MATH_IS_ODD,"ODD"],[b.Msg.MATH_IS_PRIME,"PRIME"],[b.Msg.MATH_IS_WHOLE,"WHOLE"],[b.Msg.MATH_IS_POSITIVE,"POSITIVE"],[b.Msg.MATH_IS_NEGATIVE,"NEGATIVE"],[b.Msg.MATH_IS_DIVISIBLE_BY,"DIVISIBLE_BY"]];this.setColour(Dt.Math),this.appendValueInput("NUMBER_TO_CHECK").setCheck("Number");var e=new b.FieldDropdown(n,function(t){var i=t=="DIVISIBLE_BY";this.sourceBlock_.updateShape_(i)});this.appendDummyInput().appendField(e,"PROPERTY"),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip(b.Msg.MATH_IS_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation"),e=this.getFieldValue("PROPERTY")=="DIVISIBLE_BY";return n.setAttribute("divisor_input",e),n},domToMutation:function(n){var e=n.getAttribute("divisor_input")=="true";this.updateShape_(e)},updateShape_:function(n){var e=this.getInput("DIVISOR");n?e||this.appendValueInput("DIVISOR").setCheck("Number"):e&&this.removeInput("DIVISOR")}};b.Blocks.math_round={init:function(){this.jsonInit({message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[[b.Msg.MATH_ROUND_OPERATOR_ROUND,"ROUND"],[b.Msg.MATH_ROUND_OPERATOR_ROUNDUP,"ROUNDUP"],[b.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN,"ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_ROUND_TOOLTIP,helpUrl:b.Msg.MATH_ROUND_HELPURL})}};b.Blocks.math_on_list={init:function(){var n=[[b.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[b.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[b.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[b.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[b.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[b.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[b.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"],[b.Msg.MATH_ONLIST_OPERATOR_RANDOM,"RANDOM"]],e=this;this.setHelpUrl(b.Msg.MATH_ONLIST_HELPURL),this.setColour(Dt.Math),this.setOutput(!0,"Number");var t=new b.FieldDropdown(n,function(i){e.updateType_(i)});this.appendValueInput("LIST").setCheck("Array").appendField(t,"OP"),this.setTooltip(function(){var i=e.getFieldValue("OP"),s={SUM:b.Msg.MATH_ONLIST_TOOLTIP_SUM,MIN:b.Msg.MATH_ONLIST_TOOLTIP_MIN,MAX:b.Msg.MATH_ONLIST_TOOLTIP_MAX,AVERAGE:b.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:b.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:b.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:b.Msg.MATH_ONLIST_TOOLTIP_STD_DEV,RANDOM:b.Msg.MATH_ONLIST_TOOLTIP_RANDOM};return s[i]})},updateType_:function(n){n=="MODE"?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("op",this.getFieldValue("OP")),n},domToMutation:function(n){this.updateType_(n.getAttribute("op"))}};b.Blocks.math_modulo={init:function(){this.jsonInit({message0:b.Msg.MATH_MODULO_TITLE,args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_MODULO_TOOLTIP,helpUrl:b.Msg.MATH_MODULO_HELPURL})}};b.Blocks.math_constrain={init:function(){this.jsonInit({message0:b.Msg.MATH_CONSTRAIN_TITLE,args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_CONSTRAIN_TOOLTIP,helpUrl:b.Msg.MATH_CONSTRAIN_HELPURL})}};b.Blocks.labplus_mapping={init:function(){this.jsonInit({inputsInline:!0,colour:Dt.Math,args0:[{name:"inputNum",type:"input_value",check:"Number"},{name:"bMin",type:"input_value",check:"Number"},{name:"bMax",type:"input_value",check:"Number"},{name:"cMin",type:"input_value",check:"Number"},{name:"cMax",type:"input_value",check:"Number"}],output:"Number",message0:b.Msg.labplus_mapping_MESSAGE0,tooltip:b.Msg.labplus_mapping_TOOLTIP,helpUrl:b.Msg.labplus_mapping_HELPURL})}};b.Blocks.math_random_int={init:function(){this.jsonInit({message0:b.Msg.MATH_RANDOM_INT_TITLE,args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_RANDOM_INT_TOOLTIP,helpUrl:b.Msg.MATH_RANDOM_INT_HELPURL})}};b.Blocks.math_convert={init:function(){this.jsonInit({message0:b.Msg.MATH_CONVERT_MESSAGE0,args0:[{type:"field_dropdown",options:[["int","int"],["float","float"]],name:"TYPE0"},{type:"input_value",name:"INPUT0",check:["Number","String"]}],output:"Number",colour:Dt.Math,tooltip:b.Msg.MATH_CONVERT_TOOLTIP,helpUrl:b.Msg.MATH_CONVERT_HELPURL})}};const BZ="#ffab2f",_xe=b.Blocks.variables_get,vxe=b.Blocks.variables_set;b.Blocks.variables_get={init:function(){_xe.init.call(this),this.setColour(BZ)}};b.Blocks.variables_set={init:function(){vxe.init.call(this),this.setColour(BZ)}};b.Blocks.math_change={init:function(){this.jsonInit({message0:b.Msg.MATH_CHANGE_TITLE,args0:[{type:"field_variable",name:"VAR",variable:b.Msg.MATH_CHANGE_TITLE_ITEM},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,colour:BZ,helpUrl:b.Msg.MATH_CHANGE_HELPURL});var n=this;this.setTooltip(function(){return b.Msg.MATH_CHANGE_TOOLTIP.replace("%1",n.getField("VAR").variable.name)})}};b.Blocks.text={init:function(){this.setHelpUrl(b.Msg.TEXT_TEXT_HELPURL),this.setColour(Dt.Text),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new b.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String");var n=this;this.setTooltip(function(){var e=n.getParent();return e&&e.getInputsInline()&&e.tooltip||b.Msg.TEXT_TEXT_TOOLTIP})},newQuote_:function(n){if(n==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new b.FieldImage(e,12,12,'"')}};b.Blocks.text_join={init:function(){this.setHelpUrl(b.Msg.TEXT_JOIN_HELPURL),this.setColour(Dt.Text),this.itemCount_=2,this.updateShape_(),this.setOutput(!0,"String"),this.setMutator(new b.icons.MutatorIcon(["text_create_join_item"],this)),this.setTooltip(b.Msg.TEXT_JOIN_TOOLTIP)},mutationToDom:function(){var n=b.utils.xml.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("text_create_join_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("text_create_join_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){for(var e=n.getInputTargetBlock("STACK"),t=[];e&&!e.isInsertionMarker();)t.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(var i=0;i<this.itemCount_;i++){var s=this.getInput("ADD"+i).connection.targetConnection;s&&t.indexOf(s)==-1&&s.disconnect()}this.itemCount_=t.length,this.updateShape_();for(var i=0;i<this.itemCount_;i++)console.log("connections[i]---",xr,this),b.icons.MutatorIcon.reconnect(t[i],this,"ADD"+i)},saveConnections:function(n){for(var e=n.getInputTargetBlock("STACK"),t=0;e;){var i=this.getInput("ADD"+t);e.valueConnection_=i&&i.connection.targetConnection,t++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):!this.itemCount_&&!this.getInput("EMPTY")&&this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);n==0&&e.appendField(b.Msg.TEXT_JOIN_TITLE_CREATEWITH)}for(;this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++},newQuote_:b.Blocks.text.newQuote_};b.Blocks.text_create_join_item={init:function(){this.appendDummyInput().appendField(b.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP),this.contextMenu=!1,this.setColour(Dt.Text)}};b.Blocks.text_create_join_container={init:function(){this.appendDummyInput().appendField(b.Msg.TEXT_CREATE_JOIN_TITLE_JOIN),this.appendStatementInput("STACK"),this.setTooltip(b.Msg.TEXT_CREATE_JOIN_TOOLTIP),this.contextMenu=!1,this.setColour(Dt.Text)}};b.Blocks.text_split_string_by_delimiter={init:function(){this.appendValueInput("string_input").setCheck(null).appendField(b.Msg.text_additional_delimiter_string),this.appendDummyInput().appendField(b.Msg.text_additional_delimiter_deli).appendField(new b.FieldTextInput(","),"delimiter").appendField(b.Msg.text_additional_delimiter_end),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(Dt.Text),this.setTooltip(b.Msg.Text_Split_String_By_Delimiter_TOOLTIP),this.setHelpUrl("")}};b.Blocks.text_format={init:function(){this.jsonInit({inputsInline:!1,output:"String",colour:Dt.Text,helpUrl:b.Msg.TEXT_FORMAT_HELPURL,tooltip:b.Msg.TEXT_FORMAT_TOOLTIP,message0:b.Msg.TEXT_FORMAT_MESSAGE0,args0:[{type:"input_value",name:"FORMAT",check:"String"},{type:"input_value",name:"CONTENT"}]})}};b.Blocks.text_format2={init:function(){this.jsonInit({inputsInline:!1,output:"String",colour:Dt.Text,helpUrl:b.Msg.TEXT_FORMAT2_HELPURL,tooltip:b.Msg.TEXT_FORMAT2_TOOLTIP,message0:b.Msg.TEXT_FORMAT2_MESSAGE0,args0:[{type:"input_value",name:"FORMAT",check:"String"},{type:"input_value",name:"CONTENT"}]})}};b.Blocks.tuple_create_with_items_insert={init:function(){this.setHelpUrl(b.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_HELPURL),this.setColour(Dt.Text),this.itemCount_=3,this.updateShape_(),this.setOutput(!0),this.setMutator(new b.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(b.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("tuple_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("tuple_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){var e=n.getInputTargetBlock("STACK");for(n=[];e;)n.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(e=0;e<this.itemCount_;e++){var t=this.getInput("ADD"+e).connection.targetConnection;t&&n.indexOf(t)==-1&&t.disconnect()}for(this.itemCount_=n.length,this.updateShape_(),e=0;e<this.itemCount_;e++)b.icons.MutatorIcon.reconnect(n[e],this,"ADD"+e)},saveConnections:function(n){n=n.getInputTargetBlock("STACK");for(var e=0;n;){var t=this.getInput("ADD"+e);n.valueConnection_=t&&t.connection.targetConnection,e++,n=n.nextConnection&&n.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(b.Msg.TUPLE_CREATE_EMPTY_TITLE);for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);n==0&&e.appendField(b.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}for(;this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++}};b.Blocks.tuple_create_with_item={init:function(){this.setColour(Dt.Text),this.appendDummyInput().appendField(b.Msg.TUPLE_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};b.Blocks.tuple_create_with_container={init:function(){this.setColour(Dt.Text),this.appendDummyInput().appendField(b.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(b.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};b.Blocks.tuple_create_with={init:function(){this.jsonInit({colour:Dt.Text,args0:[{type:"input_value",name:"tuple_name"},{type:"input_value",name:"tuple_items"}],inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:b.Msg.tuple_create_with_HELPURL,tooltip:b.Msg.tuple_create_with_TOOLTIP,message0:b.Msg.tuple_create_with_MESSAGE0})}};b.Blocks.CocoRobo_text_ESC={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Text,helpUrl:b.Msg.CocoRobo_TEXT_ESC_HELPURL,tooltip:b.Msg.CocoRobo_TEXT_ESC_TOOLTIP,message0:b.Msg.CocoRobo_TEXT_ESC_MESSAGE0,args0:[{options:[["\\n","\\n"],["\\n\\n","\\n\\n"],["\\r","\\r"],["\\r\\n","\\r\\n"],["\\b","\\b"],["\\other","\\other"],["\\","\\"],["\\\\","\\\\"]],type:"field_dropdown",name:"mode"}]})}};b.Blocks.text_append_text={init:function(){this.jsonInit({colour:Dt.Text,args0:[{type:"input_value",name:"text_abc"},{type:"input_value",name:"append_text"}],output:"String",inputsInline:!0,helpUrl:b.Msg.TEXT_APPEND_TEXT_HELPURL,tooltip:b.Msg.TEXT_APPEND_TEXT_TOOLTIP,message0:b.Msg.TEXT_APPEND_TEXT_MESSAGE0})}};b.Blocks.text_is_number={init:function(){this.jsonInit({inputsInline:!0,output:"Boolean",colour:Dt.Text,helpUrl:b.Msg.TEXT_IS_NUMBER_HELPURL,message0:b.Msg.TEXT_IS_NUMBER_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"},{options:[[b.Msg.TEXT_IS_DIGIT,".isdigit()"],[b.Msg.TEXT_IS_ALPHA,".isalpha()"]],type:"field_dropdown",name:"TYPE"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("TYPE"),t={".isdigit()":b.Msg.TEXT_IS_NUMBER_TOOLTIP.replace("%1",b.Msg.TEXT_IS_DIGIT),".isalpha()":b.Msg.TEXT_IS_NUMBER_TOOLTIP.replace("%1",b.Msg.TEXT_IS_ALPHA)};return t[e]})}};b.Blocks.text_length={init:function(){this.jsonInit({message0:b.Msg.TEXT_LENGTH_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:Dt.Text,tooltip:b.Msg.TEXT_LENGTH_TOOLTIP,helpUrl:b.Msg.TEXT_LENGTH_HELPURL})}};b.Blocks.text_isEmpty={init:function(){this.jsonInit({message0:b.Msg.TEXT_ISEMPTY_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",colour:Dt.Text,tooltip:b.Msg.TEXT_ISEMPTY_TOOLTIP,helpUrl:b.Msg.TEXT_ISEMPTY_HELPURL})}};b.Blocks.text_indexOf={init:function(){var n=[[b.Msg.TEXT_INDEXOF_OPERATOR_FIRST,"FIRST"],[b.Msg.TEXT_INDEXOF_OPERATOR_LAST,"LAST"]];this.setHelpUrl(b.Msg.TEXT_INDEXOF_HELPURL),this.setColour(Dt.Text),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck("String").appendField(b.Msg.TEXT_INDEXOF_INPUT_INTEXT),this.appendValueInput("FIND").setCheck("String").appendField(new b.FieldDropdown(n),"END"),b.Msg.TEXT_INDEXOF_TAIL&&this.appendDummyInput().appendField(b.Msg.TEXT_INDEXOF_TAIL),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return b.Msg.TEXT_INDEXOF_TOOLTIP.replace("%1",e.workspace.options.oneBasedIndex?"0":"-1")})}};b.Blocks.text_charAt={init:function(){this.WHERE_OPTIONS=[[b.Msg.TEXT_CHARAT_FROM_START,"FROM_START"],[b.Msg.TEXT_CHARAT_FROM_END,"FROM_END"],[b.Msg.TEXT_CHARAT_FIRST,"FIRST"],[b.Msg.TEXT_CHARAT_LAST,"LAST"],[b.Msg.TEXT_CHARAT_RANDOM,"RANDOM"]],this.setHelpUrl(b.Msg.TEXT_CHARAT_HELPURL),this.setColour(Dt.Text),this.setOutput(!0,"String"),this.appendValueInput("VALUE").setCheck("String").appendField(b.Msg.TEXT_CHARAT_INPUT_INTEXT),this.appendDummyInput("AT"),this.setInputsInline(!0),this.updateAt_(!0);var n=this;this.setTooltip(function(){var e=n.getFieldValue("WHERE"),t=b.Msg.TEXT_CHARAT_TOOLTIP;if(e=="FROM_START"||e=="FROM_END"){var i=e=="FROM_START"?b.Msg.LISTS_INDEX_FROM_START_TOOLTIP:b.Msg.LISTS_INDEX_FROM_END_TOOLTIP;t+=" "+i.replace("%1",n.workspace.options.oneBasedIndex?"#1":"#0")}return t})},mutationToDom:function(){var n=document.createElement("mutation"),e=this.getInput("AT").type==b.INPUT_VALUE;return n.setAttribute("at",e),n},domToMutation:function(n){var e=n.getAttribute("at")!="false";this.updateAt_(e)},updateAt_:function(n){this.removeInput("AT"),this.removeInput("ORDINAL",!0),n?(this.appendValueInput("AT").setCheck("Number"),b.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(b.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"),b.Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(b.Msg.TEXT_CHARAT_TAIL));var e=new b.FieldDropdown(this.WHERE_OPTIONS,function(t){var i=t=="FROM_START"||t=="FROM_END";if(i!=n){var s=this.sourceBlock_;return s.updateAt_(i),s.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(e,"WHERE")}};b.Blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[b.Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[b.Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[b.Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[b.Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[b.Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[b.Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]],this.setHelpUrl(b.Msg.TEXT_GET_SUBSTRING_HELPURL),this.setColour(Dt.Text),this.appendValueInput("STRING").setCheck("String").appendField(b.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),b.Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(b.Msg.TEXT_GET_SUBSTRING_TAIL),this.setInputsInline(!0),this.setOutput(!0,"String"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(b.Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation"),e=this.getInput("AT1").type==b.INPUT_VALUE;n.setAttribute("at1",e);var t=this.getInput("AT2").type==b.INPUT_VALUE;return n.setAttribute("at2",t),n},domToMutation:function(n){var e=n.getAttribute("at1")=="true",t=n.getAttribute("at2")=="true";this.updateAt_(1,e),this.updateAt_(2,t)},updateAt_:function(n,e){this.removeInput("AT"+n),this.removeInput("ORDINAL"+n,!0),e?(this.appendValueInput("AT"+n).setCheck("Number"),b.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+n).appendField(b.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+n),n==2&&b.Msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(b.Msg.TEXT_GET_SUBSTRING_TAIL));var t=new b.FieldDropdown(this["WHERE_OPTIONS_"+n],function(i){var s=i=="FROM_START"||i=="FROM_END";if(s!=e){var o=this.sourceBlock_;return o.updateAt_(n,s),o.setFieldValue(i,"WHERE"+n),null}});this.getInput("AT"+n).appendField(t,"WHERE"+n),n==1&&this.moveInputBefore("AT1","AT2")}};b.Blocks.text_changeCase={init:function(){var n=[[b.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[b.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[b.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(b.Msg.TEXT_CHANGECASE_HELPURL),this.setColour(Dt.Text),this.appendValueInput("TEXT").setCheck("String").appendField(new b.FieldDropdown(n),"CASE"),this.setOutput(!0,"String"),this.setTooltip(b.Msg.TEXT_CHANGECASE_TOOLTIP)}};b.Blocks.text_trim={init:function(){var n=[[b.Msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[b.Msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[b.Msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(b.Msg.TEXT_TRIM_HELPURL),this.setColour(Dt.Text),this.appendValueInput("TEXT").setCheck("String").appendField(new b.FieldDropdown(n),"MODE"),this.setOutput(!0,"String"),this.setTooltip(b.Msg.TEXT_TRIM_TOOLTIP)}};b.Blocks.text_print={init:function(){this.jsonInit({message0:b.Msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,colour:Dt.Text,tooltip:b.Msg.TEXT_PRINT_TOOLTIP,helpUrl:b.Msg.TEXT_PRINT_HELPURL})}};b.Blocks.text_to_byte={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:"#33cc99",helpUrl:b.Msg.TEXT_TO_BYTE_HELPURL,tooltip:b.Msg.TEXT_TO_BYTE_TOOLTIP,message0:b.Msg.TEXT_TO_BYTE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}]})}};b.Blocks.other_to_byte={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Text,helpUrl:b.Msg.OTHER_TO_BYTE_HELPURL,tooltip:b.Msg.OTHER_TO_BYTE_TOOLTIP,message0:b.Msg.OTHER_TO_BYTE_MESSAGE0,args0:[{type:"input_value",name:"input_var"}]})}};b.Blocks.bit_inversion={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Math,helpUrl:b.Msg.BIT_INVERSION_HELPURL,tooltip:b.Msg.BIT_INVERSION_TOOLTIP,message0:b.Msg.BIT_INVERSION_MESSAGE0,args0:[{type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_bytes_decode={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.Text,helpUrl:b.Msg.CocoRobo_BYTES_DECODE_HELPURL,tooltip:b.Msg.CocoRobo_BYTES_DECODE_TOOLTIP,message0:b.Msg.CocoRobo_BYTES_DECODE_MESSAGE0,args0:[{type:"input_value",name:"bytes_decode"}]})}};b.Blocks.CocoRobo_ujson_dumps={init:function(){this.jsonInit({inputsInline:!0,output:"String",colour:Dt.Text,helpUrl:b.Msg.CocoRobo_UJSON_DUMPS_HELPURL,tooltip:b.Msg.CocoRobo_UJSON_DUMPS_TOOLTIP,message0:b.Msg.CocoRobo_UJSON_DUMPS_MESSAGE0,args0:[{type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_ujson_loads={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Text,helpUrl:b.Msg.CocoRobo_UJSON_LOADS_HELPURL,tooltip:b.Msg.CocoRobo_UJSON_LOADS_TOOLTIP,message0:b.Msg.CocoRobo_UJSON_LOADS_MESSAGE0,args0:[{check:"String",type:"input_value",name:"data"}]})}};b.Blocks.CocoRobo_code_annotation={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Text,helpUrl:b.Msg.CocoRobo_code_annotation_HELPURL,tooltip:b.Msg.CocoRobo_code_annotation_TOOLTIP,message0:b.Msg.CocoRobo_code_annotation_MESSAGE0,args0:[{check:"String",type:"input_value",name:"data"}]})}};b.Blocks.text_dict={init:function(){this.setHelpUrl(b.Msg.TEXT_TEXT_HELPURL),this.setColour(32),this.appendDummyInput().appendField(b.Msg.TEXT_DICT_START).appendField(new b.FieldTextInput(""),"TEXT").appendField(b.Msg.TEXT_DICT_END),this.setOutput(!0,"Array"),this.setTooltip(b.Msg.Text_Dict_TOOLTIP)}};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};b.Blocks.lists_create_with={init:function(){this.setHelpUrl(b.Msg.LISTS_CREATE_WITH_HELPURL),this.setColour(Dt.List),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new b.icons.MutatorIcon(["lists_create_with_item"],this)),this.setInputsInline(!0),this.setTooltip(b.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("lists_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("lists_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){for(var e=n.getInputTargetBlock("STACK"),t=[];e;)t.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(var i=0;i<this.itemCount_;i++){var s=this.getInput("ADD"+i).connection.targetConnection;s&&t.indexOf(s)==-1&&s.disconnect()}this.itemCount_=t.length,this.updateShape_();for(var i=0;i<this.itemCount_;i++)b.icons.MutatorIcon.reconnect(t[i],this,"ADD"+i)},saveConnections:function(n){for(var e=n.getInputTargetBlock("STACK"),t=0;e;){var i=this.getInput("ADD"+t);e.valueConnection_=i&&i.connection.targetConnection,t++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):!this.itemCount_&&!this.getInput("EMPTY")&&this.appendDummyInput("EMPTY").appendField(b.Msg.LISTS_CREATE_EMPTY_TITLE);for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);n==0&&e.appendField(b.Msg.LISTS_CREATE_WITH_INPUT_WITH)}for(this.itemCount_>3?this.setInputsInline(!1):this.setInputsInline(!0);this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++}};b.Blocks.lists_create_with_container={init:function(){this.setColour(Dt.List),this.appendDummyInput().appendField(b.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(b.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};b.Blocks.lists_create_with_item={init:function(){this.setColour(Dt.List),this.appendDummyInput().appendField(b.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};b.Blocks.text_list={init:function(){this.setHelpUrl(b.Msg.TEXT_TEXT_HELPURL),this.setColour("#40bfe4"),this.setTooltip(b.Msg.Text_List_TOOLTIP),this.appendDummyInput().appendField(b.Msg.TEXT_LIST_START).appendField(new b.FieldTextInput(""),"TEXT").appendField(b.Msg.TEXT_LIST_END),this.setOutput(!0,"Array")}};b.Blocks.CocoRobo_return_list={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{type:"input_value",name:"list_items"}],nextStatement:null,previousStatement:null,helpUrl:b.Msg.CocoRobo_HELPURL,tooltip:b.Msg.CocoRobo_return_list_TOOLTIP,message0:b.Msg.CocoRobo_return_list_MESSAGE0,inputsInline:!0})}};b.Python.quote_empty=function(n){return n};b.Blocks.list_order_item={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{options:[[b.Msg.CocoRobo_ORDER,"["],[b.Msg.CocoRobo_REVERSE_ORDER,"[-"]],type:"field_dropdown",name:"list_order"},{check:"Number",type:"input_value",name:"list_order_item"}],output:["Number","String","Boolean","Array"],inputsInline:!0,helpUrl:b.Msg.LIST_ORDER_ITEM_HELPURL,tooltip:b.Msg.LIST_ORDER_ITEM_TOOLTIP,message0:b.Msg.LIST_ORDER_ITEM_MESSAGE0})}};b.Blocks.lists_append={init:function(){this.jsonInit({message0:b.Msg.CocoRobo_lists_append_MESSAGE0,args0:[{check:"Array",type:"input_value",name:"list_name"},{type:"input_value",name:"last_item",check:["String","Number"]}],nextStatement:null,previousStatement:null,inputsInline:!0,colour:Dt.List,tooltip:b.Msg.CocoRobo_lists_append_TOOLTIP,helpUrl:b.Msg.CocoRobo_lists_append_HELPURL})}};b.Blocks.lists_extend={init:function(){this.jsonInit({message0:b.Msg.CocoRobo_lists_extend_MESSAGE0,args0:[{check:"Array",type:"input_value",name:"list_name"},{type:"input_value",name:"extend_list",check:"Array"}],nextStatement:null,previousStatement:null,inputsInline:!0,colour:Dt.List,tooltip:b.Msg.CocoRobo_lists_extend_TOOLTIP,helpUrl:b.Msg.CocoRobo_lists_extend_HELPURL})}};b.Blocks.CocoRobo_return_list={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{type:"input_value",name:"list_items"}],nextStatement:null,previousStatement:null,helpUrl:b.Msg.CocoRobo_HELPURL,tooltip:b.Msg.CocoRobo_return_list_TOOLTIP,message0:b.Msg.CocoRobo_return_list_MESSAGE0,inputsInline:!0})}};b.Blocks.list_item_exist={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{type:"input_value",name:"list_item"}],output:"Boolean",inputsInline:!0,helpUrl:b.Msg.LIST_ITEM_EXIST_HELPURL,tooltip:b.Msg.LIST_ITEM_EXIST_TOOLTIP,message0:b.Msg.LIST_ITEM_EXIST_MESSAGE0})}};b.Blocks.set_list_order_item={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{options:[[b.Msg.CocoRobo_ORDER,"["],[b.Msg.CocoRobo_REVERSE_ORDER,"[-"]],type:"field_dropdown",name:"list_order"},{check:"Number",type:"input_value",name:"list_order_item"},{type:"input_value",name:"set_value"}],inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:b.Msg.SET_LIST_ORDER_ITEM_HELPURL,tooltip:b.Msg.SET_LIST_ORDER_ITEM_TOOLTIP,message0:b.Msg.SET_LIST_ORDER_ITEM_MESSAGE0})}};b.Blocks.insert_list_order_item={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{options:[[b.Msg.CocoRobo_ORDER,"("],[b.Msg.CocoRobo_REVERSE_ORDER,"(-"]],type:"field_dropdown",name:"list_order"},{check:"Number",type:"input_value",name:"list_order_item"},{type:"input_value",name:"set_value"}],inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:b.Msg.INSERT_LIST_ORDER_ITEM_HELPURL,tooltip:b.Msg.INSERT_LIST_ORDER_ITEM_TOOLTIP,message0:b.Msg.INSERT_LIST_ORDER_ITEM_MESSAGE0})}};b.Blocks.list_order_item={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{options:[[b.Msg.CocoRobo_ORDER,"["],[b.Msg.CocoRobo_REVERSE_ORDER,"[-"]],type:"field_dropdown",name:"list_order"},{check:"Number",type:"input_value",name:"list_order_item"}],output:["Number","String","Boolean","Array"],inputsInline:!0,helpUrl:b.Msg.LIST_ORDER_ITEM_HELPURL,tooltip:b.Msg.LIST_ORDER_ITEM_TOOLTIP,message0:b.Msg.LIST_ORDER_ITEM_MESSAGE0})}};b.Blocks.parts_of_list={init:function(){this.jsonInit({colour:Dt.List,args0:[{type:"input_value",name:"list_name"},{options:[[b.Msg.CocoRobo_ORDER,"["],[b.Msg.CocoRobo_REVERSE_ORDER,"[-"]],type:"field_dropdown",name:"list_start_order"},{check:"Number",type:"input_value",name:"start_item"},{options:[[b.Msg.CocoRobo_ORDER,":"],[b.Msg.CocoRobo_REVERSE_ORDER,":-"]],type:"field_dropdown",name:"list_end_order"},{check:"Number",type:"input_value",name:"end_item"}],output:null,inputsInline:!0,helpUrl:b.Msg.PARTS_OF_LIST_HELPURL,tooltip:b.Msg.PARTS_OF_LIST_TOOLTIP,message0:b.Msg.PARTS_OF_LIST_MESSAGE0})}};b.Blocks.list_to_tuple={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{check:"Array",type:"input_value",name:"list_name"}],output:null,inputsInline:!0,helpUrl:b.Msg.LIST_TO_TUPLE_HELPURL,tooltip:b.Msg.LIST_TO_TUPLE_TOOLTIP,message0:b.Msg.LIST_TO_TUPLE_MESSAGE0})}};b.Blocks.lists_clear={init:function(){this.jsonInit({message0:b.Msg.CocoRobo_lists_clear_MESSAGE0,args0:[{check:"Array",type:"input_value",name:"list_name"}],nextStatement:null,previousStatement:null,inputsInline:!0,colour:Dt.List,tooltip:b.Msg.CocoRobo_lists_clear_TOOLTIP,helpUrl:b.Msg.CocoRobo_lists_clear_HELPURL})}};b.Blocks.lists_repeat={init:function(){this.jsonInit({message0:b.Msg.LISTS_REPEAT_TITLE,args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",colour:Dt.List,tooltip:b.Msg.LISTS_REPEAT_TOOLTIP,helpUrl:b.Msg.LISTS_REPEAT_HELPURL})}};b.Blocks.lists_length={init:function(){this.jsonInit({message0:b.Msg.LISTS_LENGTH_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",colour:Dt.List,tooltip:b.Msg.LISTS_LENGTH_TOOLTIP,helpUrl:b.Msg.LISTS_LENGTH_HELPURL})}};b.Blocks.lists_isEmpty={init:function(){this.jsonInit({message0:b.Msg.LISTS_ISEMPTY_TITLE,args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",colour:Dt.List,tooltip:b.Msg.LISTS_ISEMPTY_TOOLTIP,helpUrl:b.Msg.LISTS_ISEMPTY_HELPURL})}};b.Blocks.lists_indexOf={init:function(){var n=[[b.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[b.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(b.Msg.LISTS_INDEX_OF_HELPURL),this.setColour(Dt.List),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck(["Array","String"]).appendField(b.Msg.LISTS_INDEX_OF_INPUT_IN_LIST),this.appendValueInput("FIND").appendField(new b.FieldDropdown(n),"END"),this.setInputsInline(!0),this.setTooltip(function(){return b.Msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1")})}};b.Blocks.lists_index={init:function(){this.setHelpUrl(b.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Dt.List),this.appendValueInput("ITEM").setCheck("Number").appendField("get"),this.appendValueInput("LIST").setCheck(["Array","String"]).appendField("th item of"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("Get's the ith item from the list")}};b.Blocks.lists_getIndex={init:function(){var n=[[b.Msg.LISTS_GET_INDEX_GET,"GET"],[b.Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[b.Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[b.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[b.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[b.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[b.Msg.LISTS_GET_INDEX_LAST,"LAST"],[b.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(b.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Dt.List);var e=new b.FieldDropdown(n,function(i){var s=i=="REMOVE";this.sourceBlock_.updateStatement_(s)});this.appendValueInput("VALUE").setCheck("Array").appendField(b.Msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(e,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),b.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(b.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip(function(){var i=t.getFieldValue("MODE"),s=t.getFieldValue("WHERE"),o="";switch(i+" "+s){case"GET FROM_START":case"GET FROM_END":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":o=b.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM;break}if(s=="FROM_START"||s=="FROM_END"){var r=s=="FROM_START"?b.Msg.LISTS_INDEX_FROM_START_TOOLTIP:b.Msg.LISTS_INDEX_FROM_END_TOOLTIP;o+=" "+r.replace("%1",t.workspace.options.oneBasedIndex?"#1":"#0")}return o})},mutationToDom:function(){var n=document.createElement("mutation"),e=!this.outputConnection;n.setAttribute("statement",e);var t=this.getInput("AT").type==b.INPUT_VALUE;return n.setAttribute("at",t),n},domToMutation:function(n){var e=n.getAttribute("statement")=="true";this.updateStatement_(e);var t=n.getAttribute("at")!="false";this.updateAt_(t)},updateStatement_:function(n){var e=!this.outputConnection;n!=e&&(this.unplug(!0,!0),n?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(n){this.removeInput("AT"),this.removeInput("ORDINAL",!0),n?(this.appendValueInput("AT").setCheck("Number"),b.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(b.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var e=new b.FieldDropdown(this.WHERE_OPTIONS,function(t){var i=t=="FROM_START"||t=="FROM_END";if(i!=n){var s=this.sourceBlock_;return s.updateAt_(i),s.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(e,"WHERE"),b.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};b.Blocks.lists_setIndex={init:function(){var n=[[b.Msg.LISTS_SET_INDEX_SET,"SET"],[b.Msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[b.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[b.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[b.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[b.Msg.LISTS_GET_INDEX_LAST,"LAST"],[b.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(b.Msg.LISTS_SET_INDEX_HELPURL),this.setColour(Dt.List),this.appendValueInput("LIST").setCheck("Array").appendField(b.Msg.LISTS_SET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(new b.FieldDropdown(n),"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(b.Msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),i=e.getFieldValue("WHERE"),s="";switch(t+" "+i){case"SET FROM_START":case"SET FROM_END":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":s=b.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM;break}return(i=="FROM_START"||i=="FROM_END")&&(s+=" "+b.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",e.workspace.options.oneBasedIndex?"#1":"#0")),s})},mutationToDom:function(){var n=document.createElement("mutation"),e=this.getInput("AT").type==b.INPUT_VALUE;return n.setAttribute("at",e),n},domToMutation:function(n){var e=n.getAttribute("at")!="false";this.updateAt_(e)},updateAt_:function(n){this.removeInput("AT"),this.removeInput("ORDINAL",!0),n?(this.appendValueInput("AT").setCheck("Number"),b.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(b.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var e=new b.FieldDropdown(this.WHERE_OPTIONS,function(t){var i=t=="FROM_START"||t=="FROM_END";if(i!=n){var s=this.sourceBlock_;return s.updateAt_(i),s.setFieldValue(t,"WHERE"),null}});this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(e,"WHERE")}};b.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[b.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[b.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[b.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[b.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[b.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[b.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(b.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Dt.List),this.appendValueInput("LIST").setCheck(["Array","String"]).appendField(b.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),b.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(b.Msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(b.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation"),e=this.getInput("AT1").type==b.INPUT_VALUE;n.setAttribute("at1",e);var t=this.getInput("AT2").type==b.INPUT_VALUE;return n.setAttribute("at2",t),n},domToMutation:function(n){var e=n.getAttribute("at1")=="true",t=n.getAttribute("at2")=="true";this.updateAt_(1,e),this.updateAt_(2,t)},updateAt_:function(n,e){this.removeInput("AT"+n),this.removeInput("ORDINAL"+n,!0),e?(this.appendValueInput("AT"+n).setCheck("Number"),b.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+n).appendField(b.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+n);var t=new b.FieldDropdown(this["WHERE_OPTIONS_"+n],function(i){var s=i=="FROM_START"||i=="FROM_END";if(s!=e){var o=this.sourceBlock_;return o.updateAt_(n,s),o.setFieldValue(i,"WHERE"+n),null}});this.getInput("AT"+n).appendField(t,"WHERE"+n),n==1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),b.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};b.Blocks.lists_sort={init:function(){this.jsonInit({message0:b.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[b.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[b.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[b.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[b.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[b.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",colour:Dt.List,tooltip:b.Msg.LISTS_SORT_TOOLTIP,helpUrl:b.Msg.LISTS_SORT_HELPURL})}};b.Blocks.lists_split={init:function(){var n=this,e=new b.FieldDropdown([[b.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[b.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(t){n.updateType_(t)});this.setHelpUrl(b.Msg.LISTS_SPLIT_HELPURL),this.setColour(Dt.List),this.appendValueInput("INPUT").setCheck("String").appendField(e,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(b.Msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(function(){var t=n.getFieldValue("MODE");if(t=="SPLIT")return b.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(t=="JOIN")return b.Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw"Unknown mode: "+t})},updateType_:function(n){n=="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("mode",this.getFieldValue("MODE")),n},domToMutation:function(n){this.updateType_(n.getAttribute("mode"))}};b.Blocks.list_first_index={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.List,helpUrl:b.Msg.LIST_FIRST_INDEX_HELPURL,message0:b.Msg.LIST_FIRST_INDEX_MESSAGE0,args0:[{type:"input_value",name:"elem"},{check:"Array",type:"input_value",name:"my_list"},{options:[[b.Msg.FIRST,"first"],[b.Msg.LAST,"last"]],type:"field_dropdown",name:"last_or_first"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("last_or_first"),t={first:b.Msg.LIST_FIRST_INDEX_TOOLTIP.replace("%3",b.Msg.FIRST),last:b.Msg.LIST_FIRST_INDEX_TOOLTIP.replace("%3",b.Msg.LAST)};return t[e]})}};b.typeOf=function(n){var e=typeof n;if(e=="object")if(n){if(n instanceof Array)return"array";if(n instanceof Object)return e;var t=Object.prototype.toString.call(n);if(t=="[object Window]")return"object";if(t=="[object Array]"||typeof n.length=="number"&&typeof n.splice<"u"&&typeof n.propertyIsEnumerable<"u"&&!n.propertyIsEnumerable("splice"))return"array";if(t=="[object Function]"||typeof n.call<"u"&&typeof n.propertyIsEnumerable<"u"&&!n.propertyIsEnumerable("call"))return"function"}else return"null";else if(e=="function"&&typeof n.call>"u")return"object";return e};b.Blocks.dict_create_with_items_insert={init:function(){this.setColour(Dt.Dictionary),this.appendDummyInput("").appendField(new b.FieldLabel(b.Msg.DICT_CREATE_WITH_INPUT_WITH),"TIP"),this.itemCount_=3,this.setOutput(!0),this.setMutator(new b.icons.MutatorIcon(["dict_create_with_item"],this)),this.setTooltip(b.Msg.DICT_CREATE_WITH_INPUT_WITH)},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("dict_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("dict_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){n=n.getInputTargetBlock("STACK");for(var e=[],t=0;n;)e[t]=n.valueConnection_,n=n.nextConnection&&n.nextConnection.targetBlock(),t++;for(this.itemCount_=t,this.updateShape_(),t=0;t<this.itemCount_;t++)e[t]&&this.getInput("ADD"+t).connection.connect(e[t])},saveConnections:function(n){n=n.getInputTargetBlock("STACK");for(var e=0;n;){var t=this.getInput("ADD"+e);n.valueConnection_=t&&t.connection.targetConnection,e++,n=n.nextConnection&&n.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var n=[],e=0;this.getInput("ADD"+e);e++)n.push(this.getFieldValue("KEY"+e)),this.removeInput("ADD"+e);if(this.itemCount_===0)this.getField("TIP").setText(b.Msg.DICT_CREATE_EMPTY_TITLE);else for(this.getField("TIP").setText(b.Msg.DICT_CREATE_WITH_INPUT_WITH),e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setCheck(null).setAlign(b.ALIGN_RIGHT).appendField(new b.FieldTextInput(n.length>e?n[e]:e==0?"key_0":"key_"+e),"KEY"+e).appendField(":")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(n,e){b.Names.equals(n,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};b.Blocks.dict_create_with_item={init:function(){this.setColour(Dt.Dictionary),this.appendDummyInput().appendField(b.Msg.VARIABLES_DEFAULT_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};b.Blocks.dict_create_with_container={init:function(){this.setColour(Dt.Dictionary),this.appendDummyInput().appendField(b.Msg.DICT_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(b.Msg.DICT_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};b.Blocks.dict_create_with={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Dictionary,helpUrl:b.Msg.DICT_CREATE_WITH_HELPURL,tooltip:b.Msg.DICT_CREATE_WITH_TOOLTIP,message0:b.Msg.DICT_CREATE_WITH_MESSAGE0,args0:[{type:"input_value",name:"dict_name"},{type:"input_value",name:"dict_items"}]})}};b.Blocks.dict_key_value={init:function(){this.jsonInit({colour:Dt.Dictionary,args0:[{type:"input_value",name:"dict_name"},{type:"input_value",name:"dict_items"}],output:["String","Number","Boolean","Array"],inputsInline:!0,helpUrl:b.Msg.DICT_KEY_VALUE_HELPURL,tooltip:b.Msg.DICT_KEY_VALUE_TOOLTIP,message0:b.Msg.DICT_KEY_VALUE_MESSAGE0})}};b.Blocks.add_dict_key_value={init:function(){this.jsonInit({colour:Dt.Dictionary,args0:[{type:"input_value",name:"dict_name"},{type:"input_value",name:"dict_items"},{type:"input_value",name:"add_value"}],inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:b.Msg.ADD_DICT_KEY_VALUE_HELPURL,tooltip:b.Msg.ADD_DICT_KEY_VALUE_TOOLTIP,message0:b.Msg.ADD_DICT_KEY_VALUE_MESSAGE0})}};b.Blocks.dict_length={init:function(){this.jsonInit({colour:Dt.Dictionary,args0:[{type:"input_value",name:"dict_name"}],output:"Number",inputsInline:!0,helpUrl:b.Msg.DICT_LENGTH_HELPURL,tooltip:b.Msg.DICT_LENGTH_TOOLTIP,message0:b.Msg.DICT_LENGTH_MESSAGE0})}};b.Blocks.dict_key_exist={init:function(){this.jsonInit({colour:Dt.Dictionary,args0:[{type:"input_value",name:"dict_name"},{type:"input_value",name:"dict_items"}],output:"Boolean",inputsInline:!0,helpUrl:b.Msg.DICT_KEY_EXIST_HELPURL,tooltip:b.Msg.DICT_KEY_EXIST_TOOLTIP,message0:b.Msg.DICT_KEY_EXIST_MESSAGE0})}};b.Blocks.dict_key_or_val_list={init:function(){this.jsonInit({colour:Dt.Dictionary,args0:[{type:"input_value",name:"dict_name"},{options:[[b.Msg.DICT_KEYS,"keys"],[b.Msg.DICT_VALUES,"values"]],type:"field_dropdown",name:"key_or_val"}],output:"Array",inputsInline:!0,helpUrl:b.Msg.DICT_KEY_OR_VAL_LIST_HELPURL,message0:b.Msg.DICT_KEY_OR_VAL_LIST_MESSAGE0});var n=this;this.setTooltip(function(){var e=n.getFieldValue("key_or_val"),t={keys:b.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP.replace("%2",b.Msg.DICT_KEYS),values:b.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP.replace("%2",b.Msg.DICT_VALUES)};return t[e]})}};b.Blocks.tuple_create_with_items_insert={init:function(){this.setHelpUrl(b.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_HELPURL),this.setColour(Dt.Tuple),this.itemCount_=3,this.updateShape_(),this.setOutput(!0),this.setMutator(new b.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(b.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("tuple_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("tuple_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){var e=n.getInputTargetBlock("STACK");for(n=[];e;)n.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(e=0;e<this.itemCount_;e++){var t=this.getInput("ADD"+e).connection.targetConnection;t&&n.indexOf(t)==-1&&t.disconnect()}for(this.itemCount_=n.length,this.updateShape_(),e=0;e<this.itemCount_;e++)b.icons.MutatorIcon.reconnect(n[e],this,"ADD"+e)},saveConnections:function(n){n=n.getInputTargetBlock("STACK");for(var e=0;n;){var t=this.getInput("ADD"+e);n.valueConnection_=t&&t.connection.targetConnection,e++,n=n.nextConnection&&n.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(b.Msg.TUPLE_CREATE_EMPTY_TITLE);for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);n==0&&e.appendField(b.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}for(;this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++}};b.Blocks.tuple_create_with_item={init:function(){this.setColour(Dt.Tuple),this.appendDummyInput().appendField(b.Msg.TUPLE_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};b.Blocks.tuple_create_with_container={init:function(){this.setColour(Dt.Tuple),this.appendDummyInput().appendField(b.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(b.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};b.Blocks.text_tuple={init:function(){this.setHelpUrl(b.Msg.TEXT_TEXT_HELPURL),this.setColour(192),this.appendDummyInput().appendField(b.Msg.TEXT_TUPLE_START).appendField(new b.FieldTextInput(""),"TEXT").appendField(b.Msg.TEXT_TUPLE_END),this.setOutput(!0,"Array"),this.setTooltip(b.Msg.Text_Tuple_TOOLTIP)}};b.Blocks.tuple_create_with={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{type:"input_value",name:"tuple_name"},{type:"input_value",name:"tuple_items"}],inputsInline:!0,nextStatement:null,previousStatement:null,helpUrl:b.Msg.tuple_create_with_HELPURL,tooltip:b.Msg.tuple_create_with_TOOLTIP,message0:b.Msg.tuple_create_with_MESSAGE0})}};b.Blocks.tuple_order_item={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{type:"input_value",name:"tuple_name"},{options:[[b.Msg.CocoRobo_ORDER,"["],[b.Msg.CocoRobo_REVERSE_ORDER,"[-"]],type:"field_dropdown",name:"tuple_order"},{check:"Number",type:"input_value",name:"tuple_order_item"}],output:["Number","String","Boolean","Array"],inputsInline:!0,helpUrl:b.Msg.tuple_order_item_HELPURL,tooltip:b.Msg.tuple_order_item_TOOLTIP,message0:b.Msg.tuple_order_item_MESSAGE0})}};b.Blocks.tuple_min_max_len={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{type:"input_value",name:"tuple_name"},{options:[[b.Msg.CocoRobo_MIN,"min"],[b.Msg.CocoRobo_MAX,"max"],[b.Msg.CocoRobo_LENTH,"len"]],type:"field_dropdown",name:"tuple_min_max_len"}],output:["Number","String"],inputsInline:!0,helpUrl:b.Msg.TUPLE_MIN_MAX_LEN_HELPURL,message0:b.Msg.TUPLE_MIN_MAX_LEN_MESSAGE0});var n=this;this.setTooltip(function(){var e=n.getFieldValue("tuple_min_max_len"),t={min:b.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP.replace("%2",b.Msg.CocoRobo_MIN),max:b.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP.replace("%2",b.Msg.CocoRobo_MAX),len:b.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP.replace("%2",b.Msg.CocoRobo_LENTH)};return t[e]})}};b.Blocks.tuple_item_exist={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{type:"input_value",name:"tuple_name"},{type:"input_value",name:"tuple_item"}],output:"Boolean",inputsInline:!0,helpUrl:b.Msg.TUPLE_ITEM_EXIST_HELPURL,tooltip:b.Msg.TUPLE_ITEM_EXIST_TOOLTIP,message0:b.Msg.TUPLE_ITEM_EXIST_MESSAGE0})}};b.Blocks.parts_of_tuple={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{type:"input_value",name:"tuple_name"},{check:"Number",type:"input_value",name:"tuple_item"}],output:null,inputsInline:!0,helpUrl:b.Msg.PARTS_OF_TUPLE_HELPURL,tooltip:b.Msg.PARTS_OF_TUPLE_TOOLTIP,message0:b.Msg.PARTS_OF_TUPLE_MESSAGE0})}};b.Blocks.parts_of_tuple2={init:function(){this.jsonInit({colour:Dt.Tuple,args0:[{type:"input_value",name:"tuple_name"},{options:[[b.Msg.CocoRobo_ORDER,"["],[b.Msg.CocoRobo_REVERSE_ORDER,"[-"]],type:"field_dropdown",name:"tuple_start_order"},{check:"Number",type:"input_value",name:"start_item"},{options:[[b.Msg.CocoRobo_ORDER,":"],[b.Msg.CocoRobo_REVERSE_ORDER,":-"]],type:"field_dropdown",name:"tuple_end_order"},{check:"Number",type:"input_value",name:"end_item"}],output:null,inputsInline:!0,helpUrl:b.Msg.PARTS_OF_TUPLE2_HELPURL,tooltip:b.Msg.PARTS_OF_TUPLE2_TOOLTIP,message0:b.Msg.PARTS_OF_TUPLE2_MESSAGE0})}};b.Blocks.set_create_with_items_insert={init:function(){this.setHelpUrl(b.Msg.SET_CREATE_WITH_ITEMS_INSERT_HELPURL),this.setColour(Dt.Set),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new b.icons.MutatorIcon(["set_create_with_item"],this)),this.setTooltip(b.Msg.SET_CREATE_WITH_ITEMS_INSERT_TOOLTIP)},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("set_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("set_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){var e=n.getInputTargetBlock("STACK");for(n=[];e;)n.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(e=0;e<this.itemCount_;e++){var t=this.getInput("ADD"+e).connection.targetConnection;t&&n.indexOf(t)==-1&&t.disconnect()}for(this.itemCount_=n.length,this.updateShape_(),e=0;e<this.itemCount_;e++)b.icons.MutatorIcon.reconnect(n[e],this,"ADD"+e)},saveConnections:function(n){n=n.getInputTargetBlock("STACK");for(var e=0;n;){var t=this.getInput("ADD"+e);n.valueConnection_=t&&t.connection.targetConnection,e++,n=n.nextConnection&&n.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(b.Msg.SET_CREATE_EMPTY_TITLE);for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);n==0&&e.appendField(b.Msg.SET_CREATE_WITH_INPUT_WITH)}for(;this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++}};b.Blocks.set_create_with_item={init:function(){this.setColour(Dt.Set),this.appendDummyInput().appendField(b.Msg.SET_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(b.Msg.SET_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}};b.Blocks.set_create_with_container={init:function(){this.setColour(Dt.Set),this.appendDummyInput().appendField(b.Msg.SET_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(b.Msg.SET_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}};b.Blocks.text_set={init:function(){this.setHelpUrl(b.Msg.TEXT_SET_HELPURL),this.setColour(Dt.Set),this.appendDummyInput().appendField(b.Msg.TEXT_SET_START).appendField(new b.FieldTextInput(""),"TEXT").appendField(b.Msg.TEXT_SET_END),this.setOutput(!0,"Array"),this.setTooltip(b.Msg.Text_Set_TOOLTIP)}};b.Blocks.set_create_with={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Set,helpUrl:b.Msg.SET_CREATE_WITH_HELPURL,tooltip:b.Msg.SET_CREATE_WITH_TOOLTIP,message0:b.Msg.SET_CREATE_WITH_MESSAGE0,args0:[{type:"input_value",name:"set_name"},{type:"input_value",name:"set_items"}]})}};b.Blocks.sets_update_ways={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Set,helpUrl:b.Msg.SETS_UPDATE_WAYS_HELPURL,message0:b.Msg.SETS_UPDATE_WAYS_MESSAGE0,args0:[{type:"input_value",name:"set_name"},{type:"input_value",name:"set_1_name"},{options:[[b.Msg.CocoRobo_INTERSECTION,".intersection_update"],[b.Msg.CocoRobo_UNION,".update"],[b.Msg.CocoRobo_DIFFERENCE,".difference_update"]],type:"field_dropdown",name:"sets_update_ways"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("sets_update_ways"),t={".intersection_update":b.Msg.SETS_UPDATE_WAYS_TOOLTIP.replace("%3",b.Msg.CocoRobo_INTERSECTION),".update":b.Msg.SETS_UPDATE_WAYS_TOOLTIP.replace("%3",b.Msg.CocoRobo_UNION),".difference_update":b.Msg.SETS_UPDATE_WAYS_TOOLTIP.replace("%3",b.Msg.CocoRobo_DIFFERENCE)};return t[e]})}};b.Blocks.get_sets_pop={init:function(){this.jsonInit({inputsInline:!0,output:null,colour:Dt.Set,helpUrl:b.Msg.GET_SETS_POP_HELPURL,tooltip:b.Msg.GET_SETS_POP_TOOLTIP,message0:b.Msg.GET_SETS_POP_MESSAGE0,args0:[{type:"input_value",name:"set_name"}]})}};b.Blocks.len_of_sets={init:function(){this.jsonInit({inputsInline:!0,output:"Number",colour:Dt.Set,helpUrl:b.Msg.LEN_OF_SETS_HELPURL,tooltip:b.Msg.LEN_OF_SETS_TOOLTIP,message0:b.Msg.LEN_OF_SETS_MESSAGE0,args0:[{type:"input_value",name:"set_name"}]})}};b.Blocks.intersection_of_sets={init:function(){this.jsonInit({inputsInline:!0,output:"Array",colour:Dt.Set,helpUrl:b.Msg.INTERSECTION_OF_SETS_HELPURL,message0:b.Msg.INTERSECTION_OF_SETS_MESSAGE0,args0:[{options:[[b.Msg.CocoRobo_INTERSECTION," & "],[b.Msg.CocoRobo_UNION," | "],[b.Msg.CocoRobo_DIFFERENCE," - "]],type:"field_dropdown",name:"set_operation_type"},{type:"input_value",name:"set_name"},{type:"input_value",name:"set_1_name"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("set_operation_type"),t={" & ":b.Msg.INTERSECTION_OF_SETS_TOOLTIP.replace("%1",b.Msg.CocoRobo_INTERSECTION)," | ":b.Msg.INTERSECTION_OF_SETS_TOOLTIP.replace("%1",b.Msg.CocoRobo_UNION)," - ":b.Msg.INTERSECTION_OF_SETS_TOOLTIP.replace("%1",b.Msg.CocoRobo_DIFFERENCE)};return t[e]})}};b.Blocks.set_update_with={init:function(){this.jsonInit({inputsInline:!0,nextStatement:null,previousStatement:null,colour:Dt.Set,helpUrl:b.Msg.SET_UPDATE_WITH_HELPURL,tooltip:b.Msg.SET_UPDATE_WITH_TOOLTIP,message0:b.Msg.SET_UPDATE_WITH_MESSAGE0,args0:[{type:"input_value",name:"set_name"},{type:"input_value",name:"set_items"}]})}};b.Blocks.set_subset_superset={init:function(){this.jsonInit({inputsInline:!0,output:"Boolean",colour:Dt.Set,helpUrl:b.Msg.SUBSET_SUPERSET_HELPURL,message0:b.Msg.SUBSET_SUPERSET_MESSAGE0,args0:[{type:"input_value",name:"set_name"},{type:"input_value",name:"set_1_name"},{options:[[b.Msg.CocoRobo_SUBSET,".issubset"],[b.Msg.CocoRobo_SUPERSET,".issuperset"]],type:"field_dropdown",name:"subset_superset"}]});var n=this;this.setTooltip(function(){var e=n.getFieldValue("subset_superset"),t={".issubset":b.Msg.SUBSET_SUPERSET_TOOLTIP.replace("%3",b.Msg.CocoRobo_SUBSET),".issuperset":b.Msg.SUBSET_SUPERSET_TOOLTIP.replace("%3",b.Msg.CocoRobo_SUPERSET)};return t[e]})}};const wm={};wm.array={};wm.typeOf=function(n){var e=typeof n;if(e=="object")if(n){if(n instanceof Array)return"array";if(n instanceof Object)return e;var t=Object.prototype.toString.call(n);if(t=="[object Window]")return"object";if(t=="[object Array]"||typeof n.length=="number"&&typeof n.splice<"u"&&typeof n.propertyIsEnumerable<"u"&&!n.propertyIsEnumerable("splice"))return"array";if(t=="[object Function]"||typeof n.call<"u"&&typeof n.propertyIsEnumerable<"u"&&!n.propertyIsEnumerable("call"))return"function"}else return"null";else if(e=="function"&&typeof n.call>"u")return"object";return e};wm.isArrayLike=function(n){var e=wm.typeOf(n);return e=="array"||e=="object"&&typeof n.length=="number"};wm.array.equals=function(n,e,t){if(!wm.isArrayLike(n)||!wm.isArrayLike(e)||n.length!=e.length)return!1;var i=n.length;t=t||wm.array.defaultCompareEquality;for(var s=0;s<i;s++)if(!t(n[s],e[s]))return!1;return!0};wm.array.defaultCompareEquality=function(n,e){return n===e};b.Blocks.procedures_defnoreturn={init:function(){var n=new b.FieldTextInput(b.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,b.Procedures.rename);n.setSpellcheck(!1),this.setInputsInline(!0),this.appendDummyInput().appendField(b.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(n,"NAME").appendField("","PARAMS"),this.setMutator(new b.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&b.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(b.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setColour(Dt.Procedures),this.setTooltip(b.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(b.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(n){this.hasStatements_!==n&&(n?(this.appendStatementInput("STACK").appendField(b.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=n)},updateParams_:function(){for(var n=!1,e={},t=0;t<this.arguments_.length;t++){if(e["arg_"+this.arguments_[t].toLowerCase()]){n=!0;break}e["arg_"+this.arguments_[t].toLowerCase()]=!0}n?this.setWarningText(b.Msg.PROCEDURES_DEF_DUPLICATE_WARNING):this.setWarningText(null),n="",this.arguments_.length&&(n=b.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),b.Events.disable();try{this.setFieldValue(n,"PARAMS")}finally{b.Events.enable()}},mutationToDom:function(n){var e=document.createElement("mutation");n&&e.setAttribute("name",this.getFieldValue("NAME"));for(var t=0;t<this.arguments_.length;t++){var i=document.createElement("arg");i.setAttribute("name",this.arguments_[t]),n&&this.paramIds_&&i.setAttribute("paramId",this.paramIds_[t]),e.appendChild(i)}return this.hasStatements_||e.setAttribute("statements","false"),e},domToMutation:function(n){this.arguments_=[];for(var e=0,t;t=n.childNodes[e];e++)t.nodeName.toLowerCase()=="arg"&&this.arguments_.push(t.getAttribute("name"));this.updateParams_(),b.Procedures.mutateCallers(this),this.setStatements_(n.getAttribute("statements")!=="false")},decompose:function(n){var e=n.newBlock("procedures_mutatorcontainer");e.initSvg(),this.getInput("RETURN")?e.setFieldValue(this.hasStatements_?"TRUE":"FALSE","STATEMENTS"):e.getInput("STATEMENT_INPUT").setVisible(!1);for(var t=e.getInput("STACK").connection,i=0;i<this.arguments_.length;i++){var s=n.newBlock("procedures_mutatorarg");s.initSvg(),s.setFieldValue(this.arguments_[i],"NAME"),s.oldLocation=i,t.connect(s.previousConnection),t=s.nextConnection}return b.Procedures.mutateCallers(this),e},compose:function(n){this.arguments_=[],this.paramIds_=[];for(var e=n.getInputTargetBlock("STACK");e;)this.arguments_.push(e.getFieldValue("NAME")),this.paramIds_.push(e.id),e=e.nextConnection&&e.nextConnection.targetBlock();this.updateParams_(),b.Procedures.mutateCallers(this),n=n.getFieldValue("STATEMENTS"),n!==null&&(n=n=="TRUE",this.hasStatements_!=n)&&(n?(this.setStatements_(!0),b.icons.MutatorIcon.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null):(n=this.getInput("STACK").connection,(this.statementConnection_=n.targetConnection)&&(n=n.targetBlock(),n.unplug(),n.bumpNeighbours_()),this.setStatements_(!1)))},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},renameVar:function(n,e){for(var t=!1,i=0;i<this.arguments_.length;i++)b.Names.equals(n,this.arguments_[i])&&(this.arguments_[i]=e,t=!0);if(t&&(this.updateParams_(),this.mutator.isVisible())){t=this.mutator.workspace_.getAllBlocks(),i=0;for(var s;s=t[i];i++)s.type=="procedures_mutatorarg"&&b.Names.equals(n,s.getFieldValue("NAME"))&&s.setFieldValue(e,"NAME")}},customContextMenu:function(n){var e={enabled:!0},t=this.getFieldValue("NAME");e.text=b.Msg.PROCEDURES_CREATE_DO.replace("%1",t);var i=b.dom.createDom("mutation");i.setAttribute("name",t);for(var s=0;s<this.arguments_.length;s++)t=b.dom.createDom("arg"),t.setAttribute("name",this.arguments_[s]),i.appendChild(t);if(i=b.dom.createDom("block",null,i),i.setAttribute("type",this.callType_),e.callback=b.ContextMenu.callbackFactory(this,i),n.push(e),!this.isCollapsed())for(s=0;s<this.arguments_.length;s++)e={enabled:!0},t=this.arguments_[s],e.text=b.Msg.VARIABLES_SET_CREATE_GET.replace("%1",t),i=b.dom.createDom("field",null,t),i.setAttribute("name","VAR"),i=b.dom.createDom("block",null,i),i.setAttribute("type","variables_get"),e.callback=b.ContextMenu.callbackFactory(this,i),n.push(e)},callType_:"procedures_callnoreturn"};b.Blocks.procedures_defreturn={init:function(){var n=new b.FieldTextInput(b.Msg.PROCEDURES_DEFRETURN_PROCEDURE,b.Procedures.rename);n.setSpellcheck(!1),this.setInputsInline(!0),this.appendDummyInput().appendField(b.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(n,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(b.ALIGN_RIGHT).appendField(b.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new b.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&b.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(b.Msg.PROCEDURES_DEFRETURN_COMMENT),this.setColour(Dt.Procedures),this.setTooltip(b.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(b.Msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:b.Blocks.procedures_defnoreturn.setStatements_,updateParams_:b.Blocks.procedures_defnoreturn.updateParams_,mutationToDom:b.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:b.Blocks.procedures_defnoreturn.domToMutation,decompose:b.Blocks.procedures_defnoreturn.decompose,compose:b.Blocks.procedures_defnoreturn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:b.Blocks.procedures_defnoreturn.getVars,renameVar:b.Blocks.procedures_defnoreturn.renameVar,customContextMenu:b.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"};b.Blocks.procedures_mutatorcontainer={init:function(){this.appendDummyInput().appendField(b.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(b.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new b.FieldCheckbox("TRUE"),"STATEMENTS"),this.setColour(Dt.Procedures),this.setTooltip(b.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}};b.Blocks.procedures_mutatorarg={init:function(){var n=new b.FieldTextInput("x",this.validator_);this.appendDummyInput().appendField(b.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(n,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(Dt.Procedures),this.setTooltip(b.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,n.onFinishEditing_=this.createNewVar_,n.onFinishEditing_("x")},validator_:function(n){return(n=n.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""))||null},createNewVar_:function(n){var e=this.sourceBlock_;e&&e.workspace&&e.workspace.options&&e.workspace.options.parentWorkspace&&e.workspace.options.parentWorkspace.createVariable(n)}};b.Blocks.procedures_callnoreturn={init:function(){this.appendDummyInput("TOPROW").appendField(this.id,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(Dt.Procedures),this.setHelpUrl(b.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.quarkConnections_={},this.quarkIds_=null},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(n,e){b.Names.equals(n,this.getProcedureCall())&&(this.setFieldValue(e,"NAME"),this.setTooltip((this.outputConnection?b.Msg.PROCEDURES_CALLRETURN_TOOLTIP:b.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",e)))},setProcedureParameters_:function(n,e){var t=b.Procedures.getDefinition(this.getProcedureCall(),this.workspace),i=t&&t.mutator;if(i||(this.quarkConnections_={},this.quarkIds_=null),e)if(wm.array.equals(this.arguments_,n))this.quarkIds_=e;else{if(e.length!=n.length)throw"Error: paramNames and paramIds must be the same length.";this.setCollapsed(!1),this.quarkIds_||(this.quarkConnections_={},n.join(`
- `)==this.arguments_.join(`
- `)?this.quarkIds_=e:this.quarkIds_=[]),t=this.rendered,this.rendered=!1;for(var s=0;s<this.arguments_.length;s++){var o=this.getInput("ARG"+s);o&&(o=o.connection.targetConnection,this.quarkConnections_[this.quarkIds_[s]]=o,i&&o&&e.indexOf(this.quarkIds_[s])==-1&&(o.disconnect(),o.getSourceBlock().bumpNeighbours_()))}if(this.arguments_=[].concat(n),this.updateShape_(),this.quarkIds_=e)for(s=0;s<this.arguments_.length;s++)i=this.quarkIds_[s],i in this.quarkConnections_&&(o=this.quarkConnections_[i],b.icons.MutatorIcon.reconnect(o,this,"ARG"+s)||delete this.quarkConnections_[i]);(this.rendered=t)&&this.render()}},updateShape_:function(){for(var n=0;n<this.arguments_.length;n++){var e=this.getField("ARGNAME"+n);if(e){b.Events.disable();try{e.setValue(this.arguments_[n])}finally{b.Events.enable()}}else e=new b.FieldLabel(this.arguments_[n]),this.appendValueInput("ARG"+n).setAlign(b.ALIGN_RIGHT).appendField(e,"ARGNAME"+n).init()}for(;this.getInput("ARG"+n);)this.removeInput("ARG"+n),n++;(n=this.getInput("TOPROW"))&&(this.arguments_.length?this.getField("WITH")||(n.appendField(b.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),n.init()):this.getField("WITH")&&n.removeField("WITH"))},mutationToDom:function(){var n=document.createElement("mutation");n.setAttribute("name",this.getProcedureCall());for(var e=0;e<this.arguments_.length;e++){var t=document.createElement("arg");t.setAttribute("name",this.arguments_[e]),n.appendChild(t)}return n},domToMutation:function(n){var e=n.getAttribute("name");this.renameProcedure(this.getProcedureCall(),e),e=[];for(var t=[],i=0,s;s=n.childNodes[i];i++)s.nodeName.toLowerCase()=="arg"&&(e.push(s.getAttribute("name")),t.push(s.getAttribute("paramId")));this.setProcedureParameters_(e,t)},renameVar:function(n,e){for(var t=0;t<this.arguments_.length;t++)b.Names.equals(n,this.arguments_[t])&&(this.arguments_[t]=e,this.getField("ARGNAME"+t).setValue(e))},onchange:function(n){if(this.workspace&&!this.workspace.isFlyout)if(n.type==b.Events.CREATE&&n.ids.indexOf(this.id)!=-1){var e=this.getProcedureCall();if(e=b.Procedures.getDefinition(e,this.workspace),!e||e.type==this.defType_&&JSON.stringify(e.arguments_)==JSON.stringify(this.arguments_)||(e=null),!e){b.Events.setGroup(n.group),n=b.dom.createDom("xml"),e=b.dom.createDom("block"),e.setAttribute("type",this.defType_);var t=this.getRelativeToSurfaceXY(),i=t.y+2*b.SNAP_RADIUS;e.setAttribute("x",t.x+b.SNAP_RADIUS*(this.RTL?-1:1)),e.setAttribute("y",i),t=this.mutationToDom(),e.appendChild(t),t=b.dom.createDom("field"),t.setAttribute("name","NAME"),t.appendChild(document.createTextNode(this.getProcedureCall())),e.appendChild(t),n.appendChild(e),b.Xml.domToWorkspace(n,this.workspace),b.Events.setGroup(!1)}}else n.type==b.Events.DELETE&&(e=this.getProcedureCall(),e=b.Procedures.getDefinition(e,this.workspace),e||(b.Events.setGroup(n.group),this.dispose(!0,!1),b.Events.setGroup(!1)))},customContextMenu:function(n){var e={enabled:!0};e.text=b.Msg.PROCEDURES_HIGHLIGHT_DEF;var t=this.getProcedureCall(),i=this.workspace;e.callback=function(){var s=b.Procedures.getDefinition(t,i);s&&s.select()},n.push(e)},defType_:"procedures_defnoreturn"};b.Blocks.procedures_callreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setColour(Dt.Procedures),this.setHelpUrl(b.Msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.quarkConnections_={},this.quarkIds_=null},getProcedureCall:b.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:b.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters_:b.Blocks.procedures_callnoreturn.setProcedureParameters_,updateShape_:b.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:b.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:b.Blocks.procedures_callnoreturn.domToMutation,renameVar:b.Blocks.procedures_callnoreturn.renameVar,onchange:b.Blocks.procedures_callnoreturn.onchange,customContextMenu:b.Blocks.procedures_callnoreturn.customContextMenu,defType_:"procedures_defreturn"};b.Blocks.procedures_ifreturn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(b.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(b.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(Dt.Procedures),this.setTooltip(b.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(b.Msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("value",Number(this.hasReturnValue_)),n},domToMutation:function(n){this.hasReturnValue_=n.getAttribute("value")==1,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(b.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(n){if(!this.workspace.isDragging()){n=!1;var e=this;do{if(this.FUNCTION_TYPES.indexOf(e.type)!=-1){n=!0;break}e=e.getSurroundParent()}while(e);n?(e.type=="procedures_defnoreturn"&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(b.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):e.type!="procedures_defreturn"||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(b.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setDisabled(!1)):(this.setWarningText(b.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setDisabled(!0))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]};const B5="#ff8027";b.Blocks.esp32_main_controller_io_from_digital_pin={init:function(){this.appendDummyInput().appendField(b.Msg.digital_get),this.appendValueInput("digital_pin_input").setCheck(null),this.appendDummyInput().appendField(b.Msg.digital_get_value),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(B5),this.setHelpUrl(""),this.setTooltip(b.Msg.digital_get_value_title)}};b.Blocks.esp32_main_controller_io_set_digital_pin={init:function(){this.appendDummyInput().appendField("").appendField(b.Msg.digital_set),this.appendValueInput("digital_pin_input").setCheck(null),this.appendDummyInput().appendField(b.Msg.digital_set_as),this.appendValueInput("high_low").setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(B5),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("digital_set_type"),t={1:b.Msg.Esp32_Main_Controller_Io_Set_Digital_Pin_TOOLTIP.replace("%1",b.Msg.time_iot_module),2:b.Msg.Esp32_Main_Controller_Io_Set_Digital_Pin_TOOLTIP.replace("%1",b.Msg.time_ai_module)};return t[e]})}};b.Blocks.esp32_main_controller_io_high_low={init:function(){this.appendDummyInput().appendField(new b.FieldDropdown([[b.Msg.io_high,"1"],[b.Msg.io_low,"0"]]),"high_low"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(B5),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("high_low"),t={1:b.Msg.Esp32_Main_Controller_Io_High_Low_TOOLTIP.replace("%1",b.Msg.io_high),0:b.Msg.Esp32_Main_Controller_Io_High_Low_TOOLTIP.replace("%1",b.Msg.io_low)};return t[e]})}};b.Blocks.esp32_main_controller_io_from_analog_pin={init:function(){this.appendDummyInput().appendField(b.Msg.analog_get_moudule).appendField(new b.FieldDropdown([["34","34"],["35","35"],["36","36"]]),"gpio"),this.appendDummyInput().appendField(b.Msg.analog_get_value),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(B5),this.setTooltip(b.Msg.Esp32_Main_Controller_Io_From_Analog_Pin_TOOLTIP),this.setHelpUrl("")}};b.Blocks.iot_system_run={init:function(){this.appendDummyInput().appendField(b.Msg.SYSTEM_RUN),this.appendValueInput("PATH").setCheck(null).appendField(b.Msg.system_code_path),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(32),this.setTooltip(b.Msg.Iot_System_Run_TOOLTIP),this.setHelpUrl("")}};b.Blocks.iot_system_create_file={init:function(){this.appendDummyInput().appendField(b.Msg.SYSTEM_CREATE_FILE),this.appendValueInput("filename").setCheck(null).appendField(b.Msg.SYSTEM_CREATE_F),this.appendValueInput("PATH").setCheck(null).appendField(b.Msg.SYSTEM_CREATE_F_1),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(32),this.setTooltip(b.Msg.Iot_System_Create_File_TOOLTIP),this.setHelpUrl("")}};b.Blocks.iot_system_open_file={init:function(){this.appendDummyInput().appendField(b.Msg.SYSTEM_OPEN_FILE),this.appendValueInput("filename").setCheck(null).appendField(b.Msg.SYSTEM_WRITE_F),this.appendValueInput("PATH").setCheck(null).appendField(b.Msg.SYSTEM_CREATE_F_1),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(32),this.setHelpUrl(""),this.setTooltip(b.Msg.Iot_System_Open_File_TOOLTIP)}};b.Blocks.iot_system_write_file={init:function(){this.appendDummyInput().appendField(b.Msg.SYSTEM_WRITE_FILE),this.appendValueInput("WPATH").setCheck(null).appendField(b.Msg.SYSTEM_WRITE_W),this.appendDummyInput().appendField(b.Msg.SYSTEM_WRITE_S).appendField(new b.FieldDropdown([[b.Msg.SYSTEM_WRITE_S_N,"newline"],[b.Msg.SYSTEM_WRITE_S_C,"comma"],[b.Msg.SYSTEM_WRITE_S_S,"space"],[b.Msg.SYSTEM_WRITE_S_SE,"semicolon"]]),"separator"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(32),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("separator"),t={newline:b.Msg.Iot_System_Write_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_N),comma:b.Msg.Iot_System_Write_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_C),space:b.Msg.Iot_System_Write_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_S),semicolon:b.Msg.Iot_System_Write_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_SE)};return t[e]})}};b.Blocks.iot_system_close_file={init:function(){this.appendDummyInput().appendField(b.Msg.SYSTEM_CLOSE_FILE),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(32),this.setHelpUrl(""),this.setTooltip(b.Msg.SYSTEM_CLOSE_FILE)}};b.Blocks.iot_system_delete_file={init:function(){this.appendDummyInput().appendField(b.Msg.iot_system_delete),this.appendValueInput("PATH").setCheck(null).appendField(b.Msg.SYSTEM_CREATE_F_1),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(32),this.setTooltip(b.Msg.iot_system_delete_file_TOOLTIP),this.setHelpUrl("")}};b.Blocks.iot_system_input_file={init:function(){this.appendDummyInput().appendField(b.Msg.SYSTEM_INPUT_FILE),this.appendValueInput("filename").setCheck(null).appendField(b.Msg.SYSTEM_WRITE_F),this.appendValueInput("PATH").setCheck(null).appendField(b.Msg.SYSTEM_CREATE_F_1),this.appendDummyInput().appendField(b.Msg.SYSTEM_WRITE_S).appendField(new b.FieldDropdown([[b.Msg.SYSTEM_WRITE_S_N,"newline"],[b.Msg.SYSTEM_WRITE_S_C,"comma"],[b.Msg.SYSTEM_WRITE_S_S,"space"],[b.Msg.SYSTEM_WRITE_S_SE,"semicolon"]]),"separator"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(32),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("separator"),t={newline:b.Msg.Iot_System_Input_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_N),comma:b.Msg.Iot_System_Input_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_C),space:b.Msg.Iot_System_Input_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_S),semicolon:b.Msg.Iot_System_Input_File_TOOLTIP.replace("%1",b.Msg.SYSTEM_WRITE_S_SE)};return t[e]})}};const Oy="#fabe23";b.Blocks.time_delay={init:function(){this.appendValueInput("DELAY_TIME_MILI").setCheck("Number").appendField(b.Msg.ARD_TIME_DELAY),this.appendDummyInput().appendField(b.Msg.ARD_TIME_MS),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(b.Msg.ARD_TIME_DELAY_TIP),this.setColour(Oy)}};b.Blocks.time_delayseconds={init:function(){this.setHelpUrl(""),this.setColour(Oy),this.appendValueInput("DELAY_TIME_MICRO").appendField(b.Msg.ARD_TIME_DELAY),this.appendDummyInput().appendField(b.Msg.ARD_TIME_DELAY_seconds),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(b.Msg.ARD_TIME_DELAY_seconds_TIP)}};b.Blocks.esp32_get_current_date={init:function(){this.appendDummyInput().appendField(b.Msg.time_get_current_date_title).appendField(new b.FieldDropdown([[b.Msg.time_get_current_date_y,"Y"],[b.Msg.time_get_current_date_m,"m"],[b.Msg.time_get_current_date_d,"d"],[b.Msg.time_get_current_date_hour,"H"],[b.Msg.time_get_current_date_min,"M"],[b.Msg.time_get_current_date_sec,"S"]]),"type"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(Oy),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={0:b.Msg.Esp32_Get_Current_Date_TOOLTIP.replace("%1",b.Msg.time_get_current_date_y),1:b.Msg.Esp32_Get_Current_Date_TOOLTIP.replace("%1",b.Msg.time_get_current_date_m),2:b.Msg.Esp32_Get_Current_Date_TOOLTIP.replace("%1",b.Msg.time_get_current_date_d),3:b.Msg.Esp32_Get_Current_Date_TOOLTIP.replace("%1",b.Msg.time_get_current_date_hour),4:b.Msg.Esp32_Get_Current_Date_TOOLTIP.replace("%1",b.Msg.time_get_current_date_min),5:b.Msg.Esp32_Get_Current_Date_TOOLTIP.replace("%1",b.Msg.time_get_current_date_sec)};return t[e]})}};b.Blocks.esp32_main_controller_time_timer_init={init:function(){this.appendDummyInput().appendField(b.Msg.time_init_timer),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Oy);var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={on_esp32:b.Msg.Esp32_Main_Controller_Time_Timer_Init_TOOLTIP.replace("%1",b.Msg.time_iot_module),on_ai:b.Msg.Esp32_Main_Controller_Time_Timer_Init_TOOLTIP.replace("%1",b.Msg.time_ai_module)};return t[e]}),this.setHelpUrl("")}};b.Blocks.esp32_main_controller_time_timer_get_current={init:function(){this.appendDummyInput().appendField(b.Msg.time_timer_get_time),this.setOutput(!0,null),this.setColour(Oy);var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={on_esp32:b.Msg.Esp32_Main_Controller_Time_Timer_Get_Current_TOOLTIP.replace("%1",b.Msg.time_iot_module),on_ai:b.Msg.Esp32_Main_Controller_Time_Timer_Get_Current_TOOLTIP.replace("%1",b.Msg.time_ai_module)};return t[e]}),this.setHelpUrl("")}};b.Blocks.esp32_main_controller_time_timer_clear={init:function(){this.appendDummyInput().appendField(b.Msg.time_timer_clear),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Oy);var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={on_esp32:b.Msg.Esp32_Main_Controller_Time_Timer_Clear_TOOLTIP.replace("%1",b.Msg.time_iot_module),on_ai:b.Msg.Esp32_Main_Controller_Time_Timer_Clear_TOOLTIP.replace("%1",b.Msg.time_ai_module)};return t[e]}),this.setHelpUrl("")}};b.Blocks.esp32_main_controller_time_period_timer={init:function(){this.appendDummyInput().appendField(b.Msg.time_timer_periodically),this.appendDummyInput().appendField(b.Msg.time_timer_every).appendField(new b.FieldTextInput("500"),"period_timer_count").appendField(b.Msg.time_timer_ms),this.appendStatementInput("exec_period_timer").setCheck(null).appendField(b.Msg.time_execution),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Oy),this.setTooltip(b.Msg.Esp32_Main_Controller_Time_Period_Timer_TOOLTIP.replace("%1","CocoPi")),this.setHelpUrl("")}};b.Blocks.esp32_main_controller_time_period_timer_clear={init:function(){this.appendDummyInput().appendField(b.Msg.time_timer_periodically_clear),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Oy),this.setTooltip(b.Msg.Esp32_Main_Controller_Time_Period_Timer_Clear_TOOLTIP.replace("%1","CocoPi")),this.setHelpUrl("")}};const Ry="#22b845";b.Blocks.serial_print={init:function(){this.appendValueInput("serial_comm_input").setCheck("String").appendField(b.Msg.serialcomm_print),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Ry),this.setTooltip(b.Msg.serial_Comm_Print_TOOLTIP),this.setHelpUrl("")}};b.Blocks.serial_comm_print={init:function(){this.appendValueInput("serial_comm_input").setCheck("String").appendField(b.Msg.serialcomm_print),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Ry),this.setTooltip(b.Msg.serial_Comm_Print_TOOLTIP),this.setHelpUrl("")}};b.Blocks.serial_write_data_coco={init:function(){this.appendDummyInput().appendField(new b.FieldImage("./media/cocorobo.png",65,65,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.serialcomm_write_data_bps_title).appendField(new b.FieldNumber(115200,0,5e5,1),"uart_bps"),this.appendDummyInput().appendField(b.Msg.serial_send_data_on_send_data_cocorobo),this.itemCount_=1,this.updateShape_(),this.setMutator(new b.icons.MutatorIcon(["serial_write_data_create_with_item"],this)),this.setColour("#22b845"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(b.Msg.Serial_Write_Data_TOOLTIP),this.setHelpUrl("")},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("serial_write_data_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("serial_write_data_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){for(var e=n.getInputTargetBlock("STACK"),t=[];e;)t.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(var i=0;i<this.itemCount_;i++){var s=this.getInput("ADD"+i).connection.targetConnection;s&&t.indexOf(s)==-1&&s.disconnect()}this.itemCount_=t.length,this.updateShape_();for(var i=0;i<this.itemCount_;i++)b.icons.MutatorIcon.reconnect(t[i],this,"ADD"+i)},saveConnections:function(n){for(var e=n.getInputTargetBlock("STACK"),t=0;e;){var i=this.getInput("ADD"+t);e.valueConnection_=i&&i.connection.targetConnection,t++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);e.appendField(b.Msg.serialcomm_write_item_first+n+b.Msg.serialcomm_write_item_last)}for(;this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++}};b.Blocks.serial_write_data_create_with_item={init:function(){this.setColour(Ry),this.appendDummyInput().appendField(b.Msg.serialcomm_write_data),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}};b.Blocks.serial_write_data_create_with_container={init:function(){this.setColour(Ry),this.appendDummyInput().appendField(b.Msg.serialcomm_write_item),this.appendStatementInput("STACK"),this.setTooltip(""),this.contextMenu=!1}};b.Blocks.serial_write_data={init:function(){this.appendDummyInput().appendField(new b.FieldImage("./media/uart_serial_send_header.png",110,35,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.serialcomm_write_title_text),this.appendDummyInput().appendField(b.Msg.serialcomm_write_data_bps_title).appendField(new b.FieldNumber(115200,0,5e5,1),"uart_bps").appendField(b.Msg.serialcomm_write_data_bps_attrib),this.appendValueInput("ADD1").setCheck(null).appendField(b.Msg.serialcomm_write_data),this.itemCount_=1,this.setColour(Ry),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(b.Msg.Serial_Write_Data_TOOLTIP),this.setHelpUrl("")}};b.Blocks.serial_read_data_setup={init:function(){this.appendDummyInput().appendField(new b.FieldImage("./media/uart_serial_read_header.png",110,35,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.serialcomm_read_setup_title_text+b.Msg.serialcomm_read_setup_title_text_1),this.appendDummyInput().appendField(b.Msg.serialcomm_write_data_bps_title).appendField(new b.FieldNumber(115200,0,5e5,1),"uart_bps").appendField(b.Msg.serialcomm_write_data_bps_attrib),this.setColour(Ry),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null);var n=this;this.setTooltip(function(){var e=n.getFieldValue("type"),t={iot:b.Msg.Serial_Read_Data_Setup_TOOLTIP.replace("%1",b.Msg.serialcomm_write_on_iot),ai:b.Msg.Serial_Read_Data_Setup_TOOLTIP.replace("%1",b.Msg.serialcomm_write_on_ai)};return t[e]}),this.setHelpUrl("")}};b.Blocks.serial_read_data_all={init:function(){this.appendDummyInput().appendField(b.Msg.Serial_Read_Data_all),this.setOutput(!0,null),this.setColour("#22b845"),this.setTooltip(b.Msg.Serial_Read_Data_all),this.setHelpUrl("")}};b.Blocks.serial_read_data={init:function(){this.appendDummyInput().appendField(b.Msg.ARD_SERIAL_RECEIVE_DATASET_GET_TEXT).appendField(new b.FieldDropdown([["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"]]),"INDEX").appendField(b.Msg.ARD_SERIAL_RECEIVE_DATASET_TYPE_TEXT),this.setOutput(!0,null),this.setColour(Ry),this.setTooltip(b.Msg.Serial_Read_Data_TOOLTIP),this.setHelpUrl("")}};b.Blocks.serial_send_data_to_microbit={init:function(){this.appendDummyInput().appendField(new b.FieldImage("./media/microbit_data_send_header.png",90,70,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.serialcomm_write_data_bps_title).appendField("115200").appendField(b.Msg.serialcomm_write_data_bps_attrib),this.appendValueInput("NAME").appendField(b.Msg.serial_send_data_on_send_data),this.setInputsInline(!1),this.setColour(Ry),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setHelpUrl(""),this.setTooltip(b.Msg.serial_send_data_on_send_data)}};b.Blocks.serial_send_data_to_control_panel={init:function(){this.appendDummyInput().appendField(new b.FieldImage("./media/control.png",90,70,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.serialcomm_write_data_bps_title).appendField("9600").appendField(b.Msg.serialcomm_write_data_bps_attrib),this.appendValueInput("NAME").appendField(b.Msg.serial_send_data_on_send_data_control_panel),this.setInputsInline(!1),this.setColour("#22b845"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setHelpUrl(""),this.setTooltip(b.Msg.serial_send_data_on_send_data_control_panel)}};b.Blocks.serial_read_data_clear={init:function(){this.appendDummyInput().appendField(b.Msg.serial_clear_data),this.setColour("#22b845"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(b.Msg.serial_clear_data),this.setHelpUrl("")}};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const Lh="#f0983e";b.Blocks.ai_canvas_area_tuple={init:function(){this.appendDummyInput().appendField(b.Msg.ai_vision_canvas_area_tuple),this.appendValueInput("xy").setCheck(null).appendField(b.Msg.ai_vision_find_blobs_start_coord),this.appendValueInput("wh").setCheck(null).appendField(b.Msg.ai_vision_find_blobs_size),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour("#f0983e"),this.setTooltip(b.Msg.ai_vision_canvas_area_tuple),this.setHelpUrl("")}};b.Python.ai_canvas_area_tuple=function(n){var e=b.Python.valueToCode(n,"xy",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"wh",b.Python.ORDER_ATOMIC),i=e+","+t;return[i,b.Python.ORDER_NONE]};b.Blocks.image_save={init:function(){this.appendValueInput("save_path").setCheck(null).appendField(b.Msg.save_img_path_to),this.setOutput(!1,null),this.setColour(Lh),this.setTooltip(b.Msg.save_img_path_to),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setHelpUrl("")}};b.Python.image_save=function(n){var e=b.Python.valueToCode(n,"save_path",b.Python.ORDER_ATOMIC),t="canvas.save("+e+")";return t};b.Blocks.image_open={init:function(){this.appendValueInput("save_path").setCheck(null).appendField(b.Msg.read_img_path_to),this.setOutput(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.read_img_path_to),this.setHelpUrl("")}};b.Python.image_open=function(n){var e=b.Python.valueToCode(n,"save_path",b.Python.ORDER_ATOMIC);b.Python.definitions_.import_image="from maix import image";var t=`image.load(${e})`;return[t,b.Python.ORDER_ATOMIC]};b.Blocks.v831_lcd_invert={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_text_let_canvas).appendField(b.Msg.image_process_pixtovec_text_first).appendField(new b.FieldDropdown([[b.Msg.display_draw_vertical,"0"],[b.Msg.display_draw_horizontal,"1"]]),"invert").appendField(b.Msg.MAIXDUINO_DISPLAY_ORIENTATION_ROTATE),this.setOutput(!0,null),this.setColour(Lh);let n=this;this.setTooltip(function(){const e=n.getFieldValue("invert");return{0:b.Msg.MAIXDUINO_DISPLAY_ORIENTATION_ROTATE_title.replace("%1",b.Msg.display_draw_vertical),1:b.Msg.MAIXDUINO_DISPLAY_ORIENTATION_ROTATE_title.replace("%1",b.Msg.display_draw_horizontal)}[e]}),this.setHelpUrl("")}};b.Python.v831_lcd_invert=function(n){var t=`canvas.flip(${n.getFieldValue("invert")})`;return[t,b.Python.ORDER_NONE]};b.Blocks.image_rotating={init:function(){this.appendValueInput("route").setCheck(null).appendField(b.Msg.image_process_rotate),this.appendDummyInput().appendField(b.Msg.image_process_rotate_angle),this.setOutput(!1,null),this.setTooltip(b.Msg.image_process_rotate),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lh)}};b.Python.image_rotating=function(n){var e=b.Python.valueToCode(n,"route",b.Python.ORDER_ATOMIC),t=`canvas = canvas.rotate(${e})`;return[t,b.Python.ORDER_NONE]};b.Blocks.ai_lcd_XY_vision={init:function(){var n=this.appendDummyInput();this.setHelpUrl(b.Msg.LOGIC_OPERATION_HELPURL),this.setColour(Lh),this.setOutput(!0,"Boolean"),n.appendField(b.Msg.image_process_xy_x),this.appendValueInput("A").setCheck("Number"),n=this.appendDummyInput(),n.appendField(b.Msg.image_process_xy_y),this.appendValueInput("B").setCheck("Number"),this.setInputsInline(!0)}};b.Python.ai_lcd_XY_vision=function(n){var e=b.Python.valueToCode(n,"A",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"B",b.Python.ORDER_ATOMIC),i=""+e+", "+t;return[i,b.Python.ORDER_ATOMIC]};b.Blocks.image_crop={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_imgcut_cutting),this.appendValueInput("xy").setCheck(null).appendField(b.Msg.image_process_imgcut_start_coord),this.appendValueInput("wh").setCheck(null).appendField(b.Msg.image_process_imgcut_size),this.setOutput(!1,null),this.setTooltip(b.Msg.image_process_imgcut_cutting),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lh)}};b.Python.v831_lcd_img_cut=function(n){var e=b.Python.valueToCode(n,"xy",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"wh",b.Python.ORDER_ATOMIC),i=`canvas = canvas.crop(${e},${t})`;return i};b.Blocks.ai_lcd_WH_vision={init:function(){var n=this.appendDummyInput();this.setHelpUrl(b.Msg.LOGIC_OPERATION_HELPURL),this.setColour("#f0983e"),this.setOutput(!0,"Boolean"),n.appendField(b.Msg.image_process_wh_width),this.appendValueInput("A").setCheck("Number"),n=this.appendDummyInput(),n.appendField(b.Msg.image_process_wh_height),this.appendValueInput("B").setCheck("Number"),this.setInputsInline(!0)}};b.Python.ai_lcd_WH_vision=function(n){var e=b.Python.valueToCode(n,"A",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"B",b.Python.ORDER_ATOMIC),i=""+e+", "+t;return[i,b.Python.ORDER_ATOMIC]};b.Blocks.image_resize={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_img_resize),this.appendValueInput("wh").setCheck(null),this.setOutput(!1,null),this.setTooltip(b.Msg.image_process_img_resize),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lh),this.setInputsInline(!0)}};b.Python.image_resize=function(n){var e=b.Python.valueToCode(n,"wh",b.Python.ORDER_ATOMIC),t=`canvas = canvas.resize(${e})`;return t};b.Blocks.ai_vision_get_threshold_default={init:function(){this.appendDummyInput().appendField(b.Msg.ai_vision_detection_color_threshold_set).appendField(new b.FieldDropdown([[b.Msg.ai_vision_detection_color_threshold_set_black,"black"],[b.Msg.ai_vision_detection_color_threshold_set_white,"white"],[b.Msg.ai_vision_detection_color_threshold_set_red,"red"],[b.Msg.ai_vision_detection_color_threshold_set_green,"green"],[b.Msg.ai_vision_detection_color_threshold_set_blue,"blue"],[b.Msg.ai_vision_detection_color_threshold_set_orange,"orange"]]),"color"),this.setOutput(!0,null),this.setColour("#f0983e");var n=this;this.setTooltip(function(){var e=n.getFieldValue("color"),t={black:b.Msg.ai_vision_get_threshold_default_TOOLTIP.replace("%1",b.Msg.ai_vision_detection_color_threshold_set_black),white:b.Msg.ai_vision_get_threshold_default_TOOLTIP.replace("%1",b.Msg.ai_vision_detection_color_threshold_set_white),red:b.Msg.ai_vision_get_threshold_default_TOOLTIP.replace("%1",b.Msg.ai_vision_detection_color_threshold_set_red),green:b.Msg.ai_vision_get_threshold_default_TOOLTIP.replace("%1",b.Msg.ai_vision_detection_color_threshold_set_green),blue:b.Msg.ai_vision_get_threshold_default_TOOLTIP.replace("%1",b.Msg.ai_vision_detection_color_threshold_set_blue),orange:b.Msg.ai_vision_get_threshold_default_TOOLTIP.replace("%1",b.Msg.ai_vision_detection_color_threshold_set_orange)};return t[e]}),this.setHelpUrl("")}};b.Python.ai_vision_get_threshold_default=function(n){var e=n.getFieldValue("color");if(e=="black")var t="[[0,40]]";else if(e=="white")var t="[[64,100]]";else if(e=="red")var t="[[0, 80, 40, 80, 10, 80]]";else if(e=="green")var t="[[0, 80, -120, -10, 0, 30]]";else if(e=="blue")var t="[0, 80, 30, 100, -120, -60]";else if(e=="orange")var t="[[77, 55, 19, 61, 14, 108]]";return[t,b.Python.ORDER_NONE]};b.Blocks.image_find_blobs={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_find_blobs),this.appendValueInput("color").setCheck(null).appendField(b.Msg.ai_vision_lane_tracking_setup_threshold),this.appendValueInput("xy").setCheck(null).appendField(b.Msg.ai_vision_find_blobs_start_coord),this.appendValueInput("wh").setCheck(null).appendField(b.Msg.ai_vision_find_blobs_size),this.setOutput(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.image_process_find_blobs),this.setHelpUrl("")}};b.Python.image_find_blobs=function(n){var e=b.Python.valueToCode(n,"color",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"xy",b.Python.ORDER_ATOMIC),i=b.Python.valueToCode(n,"wh",b.Python.ORDER_ATOMIC);return[`img.find_blobs(color = ${e},roi=[${t} , ${i}],pixels_threshold=500)`,b.Python.ORDER_NONE]};b.Blocks.ai_vision_get_blobs={init:function(){this.appendDummyInput().appendField(b.Msg.serial_read_data).appendField(new b.FieldVariable("i"),"varitem").appendField(b.Msg.image_get_find_blobs_result).appendField(new b.FieldDropdown([[b.Msg.image_start_X,"0"],[b.Msg.image_start_Y,"1"],[b.Msg.image_start_W,"2"],[b.Msg.image_start_H,"3"],[b.Msg.image_start_CX,"cx"],[b.Msg.image_start_CY,"cy"]]),"blob_type"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour("#f0983e"),this.setTooltip(b.Msg.image_get_find_blobs_result),this.setHelpUrl("https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html?highlight=find_circles")}};b.Python.ai_vision_get_blobs=function(n){var e=n.getFieldValue("varitem"),t=n.getFieldValue("blob_type"),i=`${e}["${t}"]`;return t=="cx"?i=`int((${e}[0] + ${e}[2])/2)`:t=="cy"&&(i=`int((${e}[1] + ${e}[3])/2)`),[i,b.Python.ORDER_NONE]};b.Blocks.image_find_lines={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_find_lines),this.appendValueInput("color").setCheck(null).appendField(b.Msg.ai_vision_lane_tracking_setup_threshold),this.appendValueInput("xy").setCheck(null).appendField(b.Msg.ai_vision_find_blobs_start_coord),this.appendValueInput("wh").setCheck(null).appendField(b.Msg.ai_vision_find_blobs_size),this.setOutput(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.image_process_find_lines),this.setHelpUrl("")}};b.Python.image_find_lines=function(n){var e=b.Python.valueToCode(n,"color",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"xy",b.Python.ORDER_ATOMIC)||"0,0",i=b.Python.valueToCode(n,"wh",b.Python.ORDER_ATOMIC)||"0,0";return[`img.get_regression(color=${e},roi=[${t} , ${i}],area_threshold =1000)`,b.Python.ORDER_NONE]};b.Blocks.image_get_lines_result={init:function(){this.appendDummyInput().appendField(b.Msg.serial_read_data).appendField(new b.FieldVariable("i"),"varitem").appendField(b.Msg.image_get_find_blobs_result).appendField(new b.FieldDropdown([[b.Msg.image_start_X,"0"],[b.Msg.image_start_Y,"1"],[b.Msg.image_start_W,"2"],[b.Msg.image_start_H,"3"],[b.Msg.image_start_CX,"cx"],[b.Msg.image_start_CY,"cy"]]),"blob_type"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour("#f0983e"),this.setTooltip(b.Msg.image_get_find_blobs_result),this.setHelpUrl("")}};b.Blocks.ai_lane_tracking_setup={init:function(){this.appendDummyInput().appendField(b.Msg.ai_vision_lane_tracking_setup),this.appendValueInput("color").setCheck(null).appendField(b.Msg.ai_vision_lane_tracking_setup_threshold),this.appendValueInput("lsize").setCheck(null).appendField(b.Msg.ai_vision_lane_tracking_setup_left),this.appendValueInput("rsize").setCheck(null).appendField(b.Msg.ai_vision_lane_tracking_setup_right),this.appendValueInput("axis").setCheck(null).appendField(b.Msg.ai_vision_lane_tracking_setup_axis),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.ai_vision_lane_tracking_setup),this.setHelpUrl("")}};b.Python.ai_lane_tracking_setup=function(n){return""};b.Blocks.image_find_qrcodes={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_find_qrcodes),this.setOutput(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.image_process_find_qrcodes),this.setHelpUrl("")}};b.Python.image_find_qrcodes=function(n){var e="canvas.find_qrcodes()";return[e,b.Python.ORDER_NONE]};b.Blocks.image_get_qrcodes_result={init:function(){this.appendDummyInput().appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(b.Msg.image_process_get_qrcodes_result).appendField(new b.FieldDropdown([[b.Msg.ai_vision_pattern_detection_content,"payload"],[b.Msg.ai_vision_pattern_detection_x,"x"],[b.Msg.ai_vision_pattern_detection_y,"y"],[b.Msg.ai_vision_pattern_detection_w,"w1"],[b.Msg.ai_vision_pattern_detection_h,"h2"]]),"get_info"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour("#f0983e");var n=this;this.setTooltip(function(){var e=n.getFieldValue("get_info"),t={payload:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_content),data_type:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_type),x:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_x),y:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_y),w:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_X_Destination),h:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_Y_Destination),w1:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_w),h1:b.Msg.ai_vision_qrcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_h)};return t[e]}),this.setHelpUrl("")}};b.Python.image_get_qrcodes_result=function(n){var e=n.getFieldValue("varitem"),t=n.getFieldValue("get_info"),i=`${e}["${t}"]`;return t=="w"?i=`${e}["${t}"] + ${e}["x"]`:t=="h"?i=`${e}["${t}"] + ${e}["y"]`:t=="w1"?i=`${e}["w"]`:t=="h2"&&(i=`${e}["h"]`),[i,b.Python.ORDER_NONE]};b.Blocks.image_find_barcodes={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_find_barcodes),this.setOutput(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.image_process_find_barcodes),this.setHelpUrl("")}};b.Python.image_find_barcodes=function(n){var e="canvas.find_barcodes()";return[e,b.Python.ORDER_NONE]};b.Blocks.image_get_barcodes_result={init:function(){this.appendDummyInput().appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(b.Msg.image_process_get_barcodes_result).appendField(new b.FieldDropdown([[b.Msg.ai_vision_pattern_detection_content,"payload"],[b.Msg.ai_vision_pattern_detection_x,"x"],[b.Msg.ai_vision_pattern_detection_y,"y"],[b.Msg.ai_vision_pattern_detection_w,"w1"],[b.Msg.ai_vision_pattern_detection_h,"h2"]]),"get_info"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour("#f0983e");var n=this;this.setTooltip(function(){var e=n.getFieldValue("get_info"),t={payload:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_content),x:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_x),y:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_y),w:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_X_Destination),h:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_Y_Destination),w1:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_w),h1:b.Msg.ai_vision_barcode_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_h)};return t[e]}),this.setHelpUrl("")}};b.Python.image_get_barcodes_result=function(n){var e=n.getFieldValue("varitem"),t=n.getFieldValue("get_info"),i=`${e}["${t}"]`;return t=="w"?i=`${e}["${t}"] + ${e}["x"]`:t=="h"?i=`${e}["${t}"] + ${e}["y"]`:t=="w1"?i=`${e}["w"]`:t=="h2"&&(i=`${e}["h"]`),[i,b.Python.ORDER_NONE]};b.Blocks.image_find_apriltag={init:function(){this.appendDummyInput().appendField(b.Msg.image_process_find_apriltag),this.setOutput(!0,null),this.setColour(Lh),this.setTooltip(b.Msg.image_process_find_apriltag),this.setHelpUrl("")}};b.Python.image_find_apriltag=function(n){var e="canvas.find_barcodes()";return[e,b.Python.ORDER_NONE]};b.Blocks.image_get_apriltag_result={init:function(){this.appendDummyInput().appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(b.Msg.ai_vision_apriltag_get_info).appendField(new b.FieldDropdown([[b.Msg.ai_vision_pattern_detection_content,"payload"],[b.Msg.ai_vision_pattern_detection_x,"x"],[b.Msg.ai_vision_pattern_detection_y,"y"],[b.Msg.ai_vision_pattern_detection_w,"w1"],[b.Msg.ai_vision_pattern_detection_h,"h2"]]),"get_info"),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour("#f0983e");var n=this;this.setTooltip(function(){var e=n.getFieldValue("get_info"),t={payload:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_content),x:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_x),y:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_y),w:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_X_Destination),h:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_Y_Destination),w1:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_w),h1:b.Msg.ai_vision_apriltag_get_info_TOOLTIP.replace("%1",b.Msg.ai_vision_pattern_detection_h)};return t[e]}),this.setHelpUrl("")}};b.Python.image_get_apriltag_result=function(n){var e=n.getFieldValue("varitem"),t=n.getFieldValue("get_info"),i=`${e}["${t}"]`;return t=="w"?i=`${e}["${t}"] + ${e}["x"]`:t=="h"?i=`${e}["${t}"] + ${e}["y"]`:t=="w1"?i=`${e}["w"]`:t=="h2"&&(i=`${e}["h"]`),[i,b.Python.ORDER_NONE]};const Hve="#4d9994";b.Blocks.record_video={init:function(){this.appendDummyInput().appendField("视频录制设置"),this.appendValueInput("time").setCheck(null).appendField("录制时长"),this.appendValueInput("save_path").setCheck(null).appendField("保存路径"),this.setNextStatement(!0,null),this.setPreviousStatement(!0,null),this.setColour(Hve),this.setTooltip("设置视频录制参数")}};b.Python.record_video=function(n){return""};b.Blocks.play_video={init:function(){this.appendDummyInput().appendField("播放视频"),this.appendValueInput("video_path").setCheck(null).appendField("视频路径"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hve)}};b.Python.play_video=function(n){return`播放视频
- `};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const VP="#60c1bb";b.Blocks.ai_camera_init={init:function(){this.appendDummyInput().appendField("摄像头初始化"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(VP),this.setTooltip("初始化摄像头"),this.setHelpUrl("")}};b.Python.ai_camera_init=function(n){var e=`camera.init()
- `;return e};b.Blocks.ai_camera_windows={init:function(){this.appendDummyInput().appendField("获取相机图像"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(VP),this.setTooltip("获取相机图像"),this.setHelpUrl("")}};b.Python.ai_camera_windows=function(n){var e=`camera.windows()
- `;return e};b.Blocks.ai_camera_image_property_change={init:function(){this.appendDummyInput().appendField("摄像头窗口"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(VP),this.setTooltip("打开摄像头窗口"),this.setHelpUrl("")}};b.Python.ai_camera_image_property_change=function(n){var e=`display.show(image)
- `;return e};b.Blocks.ai_camera_snapshot={init:function(){this.appendDummyInput().appendField("摄像头拍照"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(VP),this.setTooltip("拍摄一张照片"),this.setHelpUrl("")}};b.Python.ai_camera_snapshot=function(n){var e=`camera.snapshot()
- `;return e};b.Blocks.v831_camera_graph_transmission={init:function(){this.appendDummyInput().appendField("V831摄像头图像传输"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(VP),this.setTooltip("V831摄像头图像传输"),this.setHelpUrl("")}};b.Python.v831_camera_graph_transmission=function(n){var e=`V831摄像头图像传输()
- `;return e};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const Lw="#5fcd8e";b.Blocks.ai_mphone_record_init={init:function(){this.appendDummyInput().appendField("Microphone Init"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("Initialize the microphone"),this.setHelpUrl("")}};b.Python.ai_mphone_record_init=function(n){var e=`microphone.init()
- `;return e};b.Blocks.ai_mphone_record_setting={init:function(){this.appendDummyInput().appendField("Microphone Start"),this.appendValueInput("PATH").setCheck(null).appendField("音频文件路径"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("Start recording"),this.setHelpUrl("")}};b.Python.ai_mphone_record_setting=function(n){var t=b.Python.valueToCode(n,"PATH",b.Python.ORDER_ATOMIC)+`
- `;return t};b.Blocks.ai_mphone_Record_audio_start={init:function(){this.appendDummyInput().appendField("Microphone Stop"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("Stop recording"),this.setHelpUrl("")}};b.Python.ai_mphone_Record_audio_start=function(n){var e=`microphone.stop()
- `;return e};b.Blocks.ai_mphone_Record_audio_sound_loudness_analysis={init:function(){this.appendDummyInput().appendField("停止录音"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("停止录音"),this.setHelpUrl("")}};b.Python.ai_mphone_Record_audio_sound_loudness_analysis=function(n){var e=`microphone.start()
- `;return e};b.Blocks.mphone_audio_spectrum_init={init:function(){this.appendDummyInput().appendField("录音"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("录音"),this.setHelpUrl("")}};b.Python.mphone_audio_spectrum_init=function(n){var e=`录音
- `;return e};b.Blocks.mphone_audio_spectrum_setting={init:function(){this.appendDummyInput().appendField("录音设置"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("设置录音参数"),this.setHelpUrl("")}};b.Python.mphone_audio_spectrum_setting=function(n){var e=`设置录音参数
- `;return e};b.Blocks.ai_mphone_read_sound_sensitivity={init:function(){this.appendDummyInput().appendField("开始录音"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Lw),this.setTooltip("开始录音"),this.setHelpUrl("")}};b.Python.ai_mphone_read_sound_sensitivity=function(n){var e=`开始录音
- `;return e};const Vve="#603ea0";b.Blocks.ai_speaker_play_wav={init:function(){this.appendDummyInput().appendField("播放音频文件"),this.appendValueInput("PATH").setCheck(null).appendField("音频文件路径"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setColour(Vve),this.setTooltip("初始化扬声器"),this.setHelpUrl("")}};b.Python.ai_speaker_play_wav=function(n){var e=b.Python.valueToCode(n,"PATH",b.Python.ORDER_ATOMIC),t=e+`
- `;return t};b.Blocks.set_volume={init:function(){this.appendDummyInput().appendField("设置音量").appendField(new b.FieldNumber(50,0,100),"VOLUME"),this.setNextStatement(!0,null),this.setColour(Vve),this.setPreviousStatement(!0,null)}};b.Python.set_volume=function(n){var e=n.getFieldValue("VOLUME"),t="speaker.set_volume("+e+`)
- `;return t};Bve();b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const UP="#22398e";b.Blocks.system_poweroff={init:function(){this.appendDummyInput().appendField(b.Msg.system_poweroff),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(UP)}};b.Python.system_poweroff=function(n){return`os.system("poweroff")
- `};b.Blocks.system_reboot={init:function(){this.appendDummyInput().appendField(b.Msg.system_restart),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(UP)}};b.Python.system_reboot=function(n){return`os.system("reboot")
- `};b.Blocks.system_get_cpu_temperature={init:function(){this.appendDummyInput().appendField("系统重启"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(UP)}};b.Python.system_get_cpu_temperature=function(n){return`os.system("reboot")
- `};b.Blocks.system_set_thread1={init:function(){this.appendDummyInput().appendField("设置线程").appendField(new b.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]]),"THREAD_COUNT"),this.appendStatementInput("input").setCheck(null).appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(UP)}};b.Python.system_set_thread1=function(n){var e=n.getFieldValue("THREAD_COUNT"),t=b.Python.statementToCode(n,"input");b.Python.definitions_.import_threading="import threading";let i=n.workspace.getAllBlocks(),s="";try{s=i[0].workspace.variableList.toString()}catch(r){console.log(r)}b.Python.definitions_["system_set_thread"+e]=`def system_set_thread${e}():
- global ${s}
- ${t}
- Thread${e} = threading.Thread(target=system_set_thread${e})
- `;var o="";return o};b.Blocks.system_start_thread={init:function(){this.appendDummyInput().appendField("启动线程").appendField(new b.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]]),"THREAD_COUNT"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(UP)}};b.Python.system_start_thread=function(n){var e=n.getFieldValue("THREAD_COUNT");b.Python.definitions_.import_threading="import threading";var t=`Thread${e}.start()
- `;return t};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const to="#ee783a";b.Blocks.ai_set_object_classification={init:function(){this.appendDummyInput().appendField("开始物体分类识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("开始物体分类识别")}};b.Python.ai_set_object_classification=function(n){var e=`ai.set_object_classification()
- `;return e};b.Blocks.ai_get_object_classification_result={init:function(){this.appendDummyInput().appendField("获取物体分类的").appendField(new b.FieldDropdown([[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取物体分类结果")}};b.Python.ai_get_object_classification_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_classification_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_object_detection_is_result={init:function(){this.appendDummyInput().appendField(b.Msg.ai_model_digital_new_text),this.appendStatementInput("input").setCheck(null).appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO),this.itemCount_=0,this.updateShape_(),this.setMutator(new b.icons.MutatorIcon(["ai_model_false_create_with_item"],this)),this.setColour(to),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setHelpUrl("")},mutationToDom:function(){if(!this.itemCount_)return null;var n=document.createElement("mutation");return this.itemCount_&&n.setAttribute("aielse",1),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("aielse"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("ai_model_false_create_with_container");e.initSvg();var t=e.nextConnection;return this.itemCount_&&(n=n.newBlock("ai_model_false_create_with_item"),n.initSvg(),t.connect(n.previousConnection)),console.log("this.elseCount_",n),e},compose:function(n){var e=n.nextConnection.targetBlock();this.itemCount_=0;var t=null;e&&e.type==="ai_model_false_create_with_item"&&(this.itemCount_++,t=e.statementConnection_,e=e.nextConnection&&e.nextConnection.targetBlock()),this.updateShape_(),b.icons.MutatorIcon.reconnect(t,this,"AIELSE")},saveConnections:function(n){n=n.nextConnection.targetBlock();var e="";n&&n.type==="ai_model_false_create_with_item"&&(e=this.getInput("AIELSE"),n.statementConnection_=e&&e.connection.targetConnection,n=n.nextConnection&&n.nextConnection.targetBlock())},updateShape_:function(){this.getInput("AIELSE")&&this.removeInput("AIELSE"),this.itemCount_&&this.appendStatementInput("AIELSE").appendField(b.Msg.CONTROLS_IF_MSG_ELSE)}};b.Blocks.ai_model_false_create_with_container={init:function(){this.setColour(to),this.appendDummyInput().appendField(b.Msg.CONTROLS_REPEAT_INPUT_DO),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}};b.Blocks.ai_model_false_create_with_item={init:function(){this.setColour(to),this.appendDummyInput().appendField(b.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(b.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}};b.Python.ai_get_object_detection_is_result=function(n){var e=b.Python.statementToCode(n,"input"),t=b.Python.statementToCode(n,"AIELSE");let i=gxe(n);b.Python.definitions_.objectStatements=`def objectStatements(BOXESI):
- ${i!=""?`global ${i}`:""}
- ${e}
- `;var s=`if (len(BOXES)):
- for BOXESI in BOXES:
- digitalStatements(BOXESI)
- else:
- ${t!=""?t:" pass"}
- `;return s};b.Blocks.ai_set_object_detection={init:function(){this.appendDummyInput().appendField("开始物体检测"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("开始物体检测")}};b.Python.ai_set_object_detection=function(n){var e=`ai.set_object_detection()
- `;return e};b.Blocks.ai_get_object_detection_result={init:function(){this.appendDummyInput().appendField("获取物体检测结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取物体检测结果")}};b.Python.ai_get_object_detection_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_face_and_keypoint_detection={init:function(){this.appendDummyInput().appendField("开始人脸关键点检测"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_face_and_keypoint_detection=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_face_and_keypoint_detection_result={init:function(){this.appendDummyInput().appendField("获取人脸检测结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取人脸检测结果")}};b.Python.ai_get_face_and_keypoint_detection_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_facial_Keypoint_detection={init:function(){this.appendDummyInput().appendField("开始人脸多关键点检测"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_facial_Keypoint_detection=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_facial_Keypoint_detection_result={init:function(){this.appendDummyInput().appendField("获取人脸多关键点检测结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取人脸多关键点检测结果")}};b.Python.ai_get_facial_Keypoint_detection_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_face_recognition={init:function(){this.appendDummyInput().appendField("开始人脸识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_face_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_face_recognition_result={init:function(){this.appendDummyInput().appendField("获取人脸识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取人脸识别结果")}};b.Python.ai_get_face_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_facial_expression_recognition={init:function(){this.appendDummyInput().appendField("开始情绪识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_facial_expression_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_facial_expression_recognition_result={init:function(){this.appendDummyInput().appendField("获取情绪识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取情绪识别结果")}};b.Python.ai_get_facial_expression_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_human_keypoint_detection={init:function(){this.appendDummyInput().appendField("开始人体检测"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_human_keypoint_detection=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_human_keypoint_detection_result={init:function(){this.appendDummyInput().appendField("获取人体检测结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取人体检测结果")}};b.Python.ai_get_human_keypoint_detection_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_self_learning_classifier_init={init:function(){this.appendDummyInput().appendField("自学分类器初始化"),this.appendValueInput("class_input").setCheck(null).appendField("设置识别的名字"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip(b.Msg.ai_model_self_learning_load),this.setHelpUrl("")}};b.Python.ai_set_self_learning_classifier_init=function(n){var e=b.Python.valueToCode(n,"class_input",b.Python.ORDER_ATOMIC),t=e+`.init()
- `;return t};b.Blocks.ai_set_self_learning_classifier_add_train_data={init:function(){this.appendDummyInput().appendField("添加训练数据"),this.setColour(to),this.setTooltip("添加训练数据"),this.setHelpUrl(""),this.setNextStatement(!0),this.setPreviousStatement(!0)}};b.Python.ai_set_self_learning_classifier_add_train_data=function(n){var e=`.train()
- `;return e};b.Blocks.ai_set_self_learning_classifier_save_model={init:function(){this.appendDummyInput().appendField("保存模型"),this.setNextStatement(!0),this.setColour(to),this.setTooltip("保存模型"),this.setPreviousStatement(!0)}};b.Python.ai_set_self_learning_classifier_save_model=function(n){return""};b.Blocks.ai_set_self_learning_classifier_load_model={init:function(){this.appendDummyInput().appendField("加载保存模型"),this.setNextStatement(!0),this.setColour(to),this.setTooltip("加载保存模型"),this.setPreviousStatement(!0)}};b.Python.ai_set_self_learning_classifier_load_model=function(n){return""};b.Blocks.ai_set_self_learning_classifier_result={init:function(){this.appendDummyInput().appendField("自学习识别结果").appendField(new b.FieldDropdown([["名称","name"],["置信度","confidence"]]),"TYPE"),this.setNextStatement(!0),this.setColour(to),this.setTooltip("加载保存模型"),this.setPreviousStatement(!0)}};b.Python.ai_set_self_learning_classifier_result=function(n){return""};b.Blocks.ai_set_object_trajectory_tracking_and_counting={init:function(){this.appendDummyInput().appendField("开始物体轨迹识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_object_trajectory_tracking_and_counting=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_object_trajectory_tracking_and_counting_result={init:function(){this.appendDummyInput().appendField("获取物体轨迹结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取物体轨迹结果")}};b.Python.ai_set_object_trajectory_tracking_and_counting_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_ocr_text_recognition={init:function(){this.appendDummyInput().appendField("开始文字识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_ocr_text_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_ocr_text_recognition_result={init:function(){this.appendDummyInput().appendField("获取文字识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取文字识别结果")}};b.Python.ai_get_ocr_text_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_gesture_recognition={init:function(){this.appendDummyInput().appendField("开始手势识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_gesture_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_gesture_recognition_result={init:function(){this.appendDummyInput().appendField("获取手势识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取手势识别结果")}};b.Python.ai_set_gesture_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_pose_recognition={init:function(){this.appendDummyInput().appendField("开始姿态识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_pose_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_pose_recognition_result={init:function(){this.appendDummyInput().appendField("获取姿态识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取姿态识别结果")}};b.Python.ai_set_pose_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_real_time_speech_recognition={init:function(){this.appendDummyInput().appendField("开始语音识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_real_time_speech_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_real_time_speech_recognition_result={init:function(){this.appendDummyInput().appendField("获取语音识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取语音识别结果")}};b.Python.ai_get_real_time_speech_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_set_keyword_recognition={init:function(){this.appendDummyInput().appendField("开始关键词识别"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(to),this.setTooltip("")}};b.Python.ai_set_keyword_recognition=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};b.Blocks.ai_get_keyword_recognition_result={init:function(){this.appendDummyInput().appendField("获取关键词识别结果").appendField(b.Msg.ai_vision_from).appendField(new b.FieldVariable("i"),"varitem").appendField(new b.FieldDropdown([[b.Msg.image_start_X,"x"],[b.Msg.image_start_Y,"y"],[b.Msg.image_start_W,"w"],[b.Msg.image_start_H,"h"],[b.Msg.image_start_result,"result"],[b.Msg.image_start_confidence,"confidence"]]),"from"),this.setColour(to),this.setOutput(!0,null),this.setTooltip("获取关键词识别结果")}};b.Python.ai_get_keyword_recognition_result=function(n){var e=n.getFieldValue("from"),t='ai.get_object_detection_result("'+e+'")';return[t,b.Python.ORDER_NONE]};const H5="#0000FF";b.Blocks.Initialize_the_AIGC_large_model={init:function(){this.appendDummyInput().appendField("初始化AIGC大模型").appendField(new b.FieldDropdown([["Qwen","Qwen"],["DeepSeek","DeepSeek"],["InternVl","InternVl"]]),"selectModel"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(H5),this.setTooltip("")}};b.Python.Initialize_the_AIGC_large_model=function(n){n.getFieldValue("selectModel");var e="ai.initialize_the_AIGC_large_model()";return e};b.Blocks.ai_set_aigc_image_generation={init:function(){this.appendDummyInput().appendField("设置提问的问题"),this.appendValueInput("generation").setCheck(null),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(H5),this.setTooltip(""),this.setInputsInline(!0)}};b.Python.ai_set_aigc_image_generation=function(n){var e=b.Python.valueToCode(n,"generation",b.Python.ORDER_ATOMIC),t="ai.set_aigc_image_generation("+e+`)
- `;return t};b.Blocks.ai_get_aigc_image_generation_result={init:function(){this.appendDummyInput().appendField("获取AIGC大模型生成结果"),this.setColour(H5),this.setOutput(!0,null),this.setTooltip("获取AIGC大模型生成结果")}};b.Python.ai_get_aigc_image_generation_result=function(n){var e="ai.get_aigc_image_generation_result()";return[e,b.Python.ORDER_NONE]};b.Blocks.ai_set_ai_agent={init:function(){this.appendValueInput("NAME").setCheck(null).appendField(b.Msg.ChatGpt_ai_agent_chat_set_appID),this.appendValueInput("NAME1").setCheck(null).appendField(b.Msg.ChatGpt_set_problem_content),this.appendDummyInput().appendField(b.Msg.ChatGpt_ai_agent_chat_result),this.setOutput(!0,null),this.setInputsInline(!1),this.setColour(H5),this.setTooltip(b.Msg.ai_set_ai_agent_title),this.setHelpUrl("")}};b.Python.ai_set_ai_agent=function(n){var e=b.Python.valueToCode(n,"NAME",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"NAME1",b.Python.ORDER_ATOMIC),i="ai.set_ai_agent("+e+","+t+")";return i};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};const WP="#7e3cca";b.Blocks.wifi_connect={init:function(){this.appendDummyInput().appendField("WIFI连接").appendField(new b.FieldTextInput("wifi_name"),"wifi_name").appendField("密码").appendField(new b.FieldTextInput("wifi_password"),"wifi_password"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(WP),this.setTooltip("WiFi连接")}};b.Python.wifi_connect=function(n){var e=n.getFieldValue("wifi_name"),t=n.getFieldValue("wifi_password"),i=`wifi.connect("${e}", "${t}")`;return i};b.Blocks.wifi_disconnect={init:function(){this.appendDummyInput().appendField("WIFI断开连接"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(WP),this.setTooltip("WiFi断开连接")}};b.Python.wifi_disconnect=function(n){var e="wifi.disconnect()";return e};b.Blocks.wifi_is_connected={init:function(){this.appendDummyInput().appendField("WIFI是否连接"),this.setOutput(!0,null),this.setColour(WP),this.setTooltip("WIFI是否连接")}};b.Python.wifi_is_connected=function(n){var e="wifi.status()";return[e,b.Python.ORDER_NONE]};b.Blocks.wifi_get_ip={init:function(){this.appendDummyInput().appendField("获取WIFI IP"),this.setOutput(!0,null),this.setColour(WP),this.setTooltip("获取WIFI IP")}};b.Python.wifi_get_ip=function(n){var e="wifi.get_ip()";return[e,b.Python.ORDER_NONE]};b.Blocks.network_time={init:function(){this.appendDummyInput().appendField("获取网络时间"),this.setNextStatement(!0,null),this.setPreviousStatement(!0,null),this.setColour(WP),this.setTooltip("获取网络时间")}};const Hu="#3062c1";b.Blocks.set_network_weather={init:function(){this.appendDummyInput().appendField(b.Msg.set_weather_city).appendField(new b.FieldDropdown([[b.Msg.beijing,"101010100"],[b.Msg.shanghai,"101020100"],[b.Msg.guangzhou,"101280101"],[b.Msg.shenzhen,"101280601"],[b.Msg.HongKong,"101320101"]]),"get_city"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.set_weather_city)}};b.Python.set_network_weather=function(n){var e=n.getFieldValue("get_city");b.Python.definitions_.import_requests="import requests",b.Python.definitions_.hefengGetWeather=`def hefengGetWeather(city,lang):
- getWeatherUrl = f"https://devapi.qweather.com/v7/weather/now?location={city}&key=d8d1d01bac3246ee8c34640681c1c9b6&lang={lang}"
- weatherResult = ""
- try:
- responseResult = requests.get(getWeatherUrl)
- if responseResult.status_code == 200:
- weatherResult = responseResult.json()
- except:
- pass
- return weatherResult
- `;let t=localStorage.getItem("lang")==2?"zh-hans":localStorage.getItem("lang")==0?"en":"zh-hant";var i=`getWeatherResult = hefengGetWeather("${e}","${t}")`;return i};b.Blocks.get_network_weather={init:function(){this.appendDummyInput().appendField(b.Msg.ESP32_ENV_GET_TEXT).appendField(new b.FieldDropdown([[b.Msg.weather_resulet,"result"],[b.Msg.image_process_temperature,"temp"],[b.Msg.weather_condition,"text"],[b.Msg.windDir,"windDir"],[b.Msg.windScale,"windScale"],[b.Msg.windSpeed,"windSpeed"],[b.Msg.image_process_humidity,"humidity"]]),"get_weather"),this.setOutput(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.get_weather_city)}};b.Python.get_network_weather=function(n){var e=n.getFieldValue("get_weather"),t="";return e=="result"?t="getWeatherResult":t=`getWeatherResult["now"]["${e}"]`,[t,b.Python.ORDER_NONE]};b.Blocks.esp32_main_controller_ifttt_send_data={init:function(){this.appendDummyInput().appendField(b.Msg.iotservice_ifttt_send_title),this.appendDummyInput().appendField(b.Msg.iotservice_ifttt_send_webhook).appendField(new b.FieldTextInput("ENTER_YOUR_API_KEY"),"ifttt_api_key"),this.appendDummyInput().appendField(b.Msg.iotservice_ifttt_send_eventname).appendField(new b.FieldTextInput("ENTER_YOUR_EVENT_NAME"),"ifttt_event"),this.appendValueInput("ifttt_data_1").setCheck(null).appendField(b.Msg.iotservice_ifttt_send_1),this.appendValueInput("ifttt_data_2").setCheck(null).appendField(b.Msg.iotservice_ifttt_send_2),this.appendValueInput("ifttt_data_3").setCheck(null).appendField(b.Msg.iotservice_ifttt_send_3),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Esp32_Main_Controller_Ifttt_Send_Data_TOOLTIP),this.setHelpUrl("")}};b.Python.esp32_main_controller_ifttt_send_data=function(n){var e=n.getFieldValue("ifttt_api_key"),t=n.getFieldValue("ifttt_event"),i=b.Python.valueToCode(n,"ifttt_data_1",b.Python.ORDER_ATOMIC),s=b.Python.valueToCode(n,"ifttt_data_2",b.Python.ORDER_ATOMIC),o=b.Python.valueToCode(n,"ifttt_data_3",b.Python.ORDER_ATOMIC);b.Python.definitions_.v831_import_requests="import requests",b.Python.definitions_.v831_import_json="import json";var r='_IFTTT_POST_API_KEY = "'+e+`"
- _IFTTT_POST_EVENT_NAME = "`+t+`"
- _IFTTT_POST_ENDPOINT = "http://maker.ifttt.com/trigger/"+ _IFTTT_POST_EVENT_NAME + "/with/key/" + _IFTTT_POST_API_KEY
- _IFTTT_POST_DATA = '{"value1":"'+ str(`+i+`) +'","value2":"'+ str(`+s+`) +'","value3":"'+ str(`+o+`) +'"}'
- _IFTTT_POST_REQUEST = requests.post(_IFTTT_POST_ENDPOINT, data = _IFTTT_POST_DATA , headers = { "Content-type": "application/json" }, timeout=60)
- `;return r};b.Blocks.esp32_main_controller_ifttt_touched={init:function(){this.appendDummyInput().appendField(b.Msg.iotservice_ifttt_trigger_title),this.appendDummyInput().appendField(b.Msg.iotservice_ifttt_trigger_webhook).appendField(new b.FieldTextInput("ENTER_YOUR_API_KEY"),"key"),this.appendDummyInput().appendField(b.Msg.iotservice_ifttt_trigger_eventname).appendField(new b.FieldTextInput("ENTER_YOUR_EVENT_NAME"),"timename"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Esp32_Main_Controller_Ifttt_Touched_TOOLTIP),this.setHelpUrl("")}};b.Python.esp32_main_controller_ifttt_touched=function(n){var e=n.getFieldValue("key"),t=n.getFieldValue("timename");b.Python.definitions_.v831_import_requests="import requests",b.Python.definitions_.v831_import_json="import json";var i='_IFTTT_TRIGGER_EVENT_NAME = "'+t+`"
- `;i+='_IFTTT_TRIGGER_API_KEY = "'+e+`"
- `,i+=`_IFTTT_TRIGGER_ENDPOINT = "https://maker.ifttt.com/trigger/" + _IFTTT_TRIGGER_EVENT_NAME + "/with/key/" + _IFTTT_TRIGGER_API_KEY
- `;var i=`_IFTTT_GET_REQUEST = requests.get(_IFTTT_TRIGGER_ENDPOINT, timeout=60)
- `;return i};b.Blocks.iot_service_thingspeak={init:function(){this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_send_title),this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_send_api).appendField(new b.FieldTextInput("ENTER_YOUR_CHANNEL_WRITE_API_KEY"),"t_api"),this.itemCount_=1,this.updateShape_(),this.setMutator(new b.icons.MutatorIcon(["iot_service_thingspeak_create_with_item"],this)),this.setColour(Hu),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(b.Msg.Iot_Service_Thingspeak_TOOLTIP),this.setHelpUrl("")},mutationToDom:function(){var n=document.createElement("mutation");return n.setAttribute("items",this.itemCount_),n},domToMutation:function(n){this.itemCount_=parseInt(n.getAttribute("items"),10),this.updateShape_()},decompose:function(n){var e=n.newBlock("iot_service_thingspeak_create_with_container");e.initSvg();for(var t=e.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var s=n.newBlock("iot_service_thingspeak_create_with_item");s.initSvg(),t.connect(s.previousConnection),t=s.nextConnection}return e},compose:function(n){for(var e=n.getInputTargetBlock("STACK"),t=[];e;)t.push(e.valueConnection_),e=e.nextConnection&&e.nextConnection.targetBlock();for(var i=0;i<this.itemCount_;i++){var s=this.getInput("ADD"+i).connection.targetConnection;s&&t.indexOf(s)==-1&&s.disconnect()}this.itemCount_=t.length,this.updateShape_();for(var i=0;i<this.itemCount_;i++)b.icons.MutatorIcon.reconnect(t[i],this,"ADD"+i)},saveConnections:function(n){for(var e=n.getInputTargetBlock("STACK"),t=0;e;){var i=this.getInput("ADD"+t);e.valueConnection_=i&&i.connection.targetConnection,t++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){for(var n=0;n<this.itemCount_;n++)if(!this.getInput("ADD"+n)){var e=this.appendValueInput("ADD"+n);e.appendField("Field "+(n+1)+":")}for(;this.getInput("ADD"+n);)this.removeInput("ADD"+n),n++}};b.Blocks.iot_service_thingspeak_create_with_container={init:function(){this.setColour(Hu),this.appendDummyInput().appendField("Items"),this.appendStatementInput("STACK"),this.setTooltip(""),this.contextMenu=!1}};b.Blocks.iot_service_thingspeak_create_with_item={init:function(){this.setColour(Hu),this.appendDummyInput().appendField("Field"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}};b.Python.iot_service_thingspeak=function(n){b.Python.valueToCode(n,"first_input",b.Python.ORDER_ATOMIC);var e=n.getFieldValue("t_api");b.Python.definitions_.v831_import_requests="import requests",b.Python.definitions_.v831_import_json="import json";for(var t="",i="",s="http://api.thingspeak.com/update?api_key="+e,o=0;o<this.itemCount_;o++)t="field"+(o+1),i=b.Python.valueToCode(this,"ADD"+o,b.Python.ORDER_NONE)||"",s+="&"+t+'="+str('+i+')+"';var r='_THINGSPEAK_ENDPOINT = "'+s+`"
- _THINGSPEAK_REQUEST = requests.get(_THINGSPEAK_ENDPOINT,timeout=60)
- `;return r};b.Blocks.iot_service_thingspeak_read={init:function(){this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_query_title),this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_query_api).appendField(new b.FieldTextInput("ENTER_YOUR_CHANNEL_READ_API_KEY"),"api_key"),this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_channel_id).appendField(new b.FieldTextInput("ENTER_YOUR_CHANNEL_ID"),"id"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Iot_Service_Thingspeak_Read_TOOLTIP),this.setHelpUrl("")}};b.Python.iot_service_thingspeak_read=function(n){var e=n.getFieldValue("api_key"),t=n.getFieldValue("id");b.Python.definitions_.v831_import_requests="import requests",b.Python.definitions_.v831_import_json="import json",b.Python.addVariable("_THINGSPEAK_READ_REQUEST","",!0);var i='_THINGSPEAK_READ_REQUEST = requests.get("https://api.thingspeak.com/channels/" + "'+t+'" + "/feeds.json?api_key=" + "'+e+`",timeout=60)
- `;return i};b.Blocks.iot_service_thingspeak_read_total={init:function(){this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_read_total),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Iot_Service_Thingspeak_Read_Total_TOOLTIP),this.setHelpUrl("")}};b.Python.iot_service_thingspeak_read_total=function(n){var e="_THINGSPEAK_READ_REQUEST.json()['channel']['last_entry_id']";return[e,b.Python.ORDER_NONE]};b.Blocks.iot_service_thingspeak_read_specific={init:function(){this.appendDummyInput().appendField(b.Msg.iotservice_thingspeak_get_title),this.appendValueInput("entry").setCheck(null),this.appendDummyInput().appendField(b.Msg.iotservice_thingspeaK_get_field),this.appendValueInput("field").setCheck(null),this.appendDummyInput().appendField(b.Msg.iotservice_thingspeaK_get_value),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Iot_Service_Thingspeak_Read_Specific_TOOLTIP),this.setHelpUrl("")}};b.Python.iot_service_thingspeak_read_specific=function(n){var e=b.Python.valueToCode(n,"entry",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"field",b.Python.ORDER_ATOMIC),i="_THINGSPEAK_READ_REQUEST.json()['feeds']["+e+"]['field"+t+"']";return[i,b.Python.ORDER_NONE]};b.Blocks.cocopi_email_send={init:function(){this.appendDummyInput().appendField(b.Msg.send_email_title),this.appendValueInput("email").setCheck(null).appendField(b.Msg.send_email_to),this.appendValueInput("email_content").setCheck(null).appendField(b.Msg.send_email_content),this.setOutput(!0),this.setColour(Hu),this.setTooltip(b.Msg.send_email_title_title),this.setHelpUrl("")}};b.Python.cocopi_email_send=function(n){var e=b.Python.valueToCode(n,"email",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"email_content",b.Python.ORDER_ATOMIC);b.Python.definitions_.import_requests="import requests",b.Python.definitions_.import_json="import json",b.Python.definitions_.send_email=`def send_email(email,content):
- params = {
- "email": email,
- "content": content,
- "subject":"训练平台",
- "content_type":'plain'
- }
- emailURL = "https://traininguser-api.cocorobo.cn/sendEmail"
- try:
- r = requests.post(emailURL,json=params)
- print(json.loads(r.text))
- if json.loads(r.text)["FunctionResponse"] == "发送成功":
- return True
- else:
- return False
- except Exception as e:
- print(e)
- return False
- `;var i=`send_email(${e},${t})`;return[i,b.Python.ORDER_NONE]};const Ow="#5C8EFF";b.Blocks.socket_TCP_server_init={init:function(){this.appendDummyInput().appendField("TCP服务端初始化"),this.setNextStatement(!0,null),this.setColour(Ow),this.setTooltip("TCP服务端初始化"),this.setPreviousStatement(!0,null)}};b.Python.socket_TCP_server_init=function(n){b.Python.definitions_.import_socket="import socket",b.Python.definitions_.socket_TCP_server_init=`def socket_TCP_server_init():
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind(('', 8888))
- s.listen(5)
- return s
- `;var e="socket_TCP_server_init()";return e};b.Blocks.socket_TCP_server_send={init:function(){this.appendValueInput("data").setCheck(null).appendField("服务端发送数据"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Ow),this.setTooltip("服务端发送数据")}};b.Python.socket_TCP_server_send=function(n){return b.Python.definitions_.socket_TCP_server_send=`def socket_TCP_server_send(s,data):
- s.send(data.encode())
- `,"socket_TCP_server_send(s)"};b.Blocks.socket_TCP_server_receive={init:function(){this.appendDummyInput().appendField("服务端接收数据"),this.setOutput(!0,null),this.setColour(Ow),this.setTooltip("服务端接收数据")}};b.Python.socket_TCP_server_receive=function(n){b.Python.definitions_.socket_TCP_server_receive=`def socket_TCP_server_receive(s):
- data = s.recv(1024)
- return data.decode()
- `;var e="socket_TCP_server_receive(s)";return e};b.Blocks.socket_TCP_client_init={init:function(){this.appendDummyInput().appendField("客户端初始化"),this.setPreviousStatement(!0,null),this.setColour(Ow),this.setTooltip("客户端初始化")}};b.Python.socket_TCP_client_init=function(n){return b.Python.definitions_.import_socket="import socket",b.Python.definitions_.socket_TCP_client_init=`def socket_TCP_client_init():
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.connect(('192.168.1.100', 888))`,"socket_TCP_client_init()"};b.Blocks.socket_TCP_client_send={init:function(){this.appendValueInput("data").setCheck(null).appendField("客户端发送数据"),this.setNextStatement(!0,null),this.setPreviousStatement(!0,null),this.setColour(Ow),this.setTooltip("客户端发送数据")}};b.Python.socket_TCP_client_send=function(n){return b.Python.definitions_.socket_TCP_client_send=`def socket_TCP_client_send(s,data):
- s.send(data.encode())
- `,"socket_TCP_client_send(s)"};b.Blocks.socket_TCP_client_receive={init:function(){this.appendDummyInput().appendField("客户端接收数据"),this.setOutput(!0,null),this.setColour(Ow),this.setTooltip("客户端接收数据")}};b.Python.socket_TCP_client_receive=function(n){b.Python.definitions_.socket_TCP_client_receive=`def socket_TCP_client_receive(s):
- data = s.recv(1024)
- return data.decode()
- `;var e="socket_TCP_client_receive(s)";return e};b.Blocks.socket_TCP_client_close={init:function(){this.appendDummyInput().appendField("客户端关闭连接"),this.setPreviousStatement(!0,null),this.setColour(Ow),this.setTooltip("客户端关闭连接")}};b.Python.socket_TCP_client_close=function(n){b.Python.definitions_.socket_TCP_client_close=`def socket_TCP_client_close(s):
- s.close()
- `;var e="socket_TCP_client_close(s)";return e};const GP="#e8795b";b.Blocks.MQTT_connected={init:function(){this.appendDummyInput().appendField("MQTT连接"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(GP),this.setTooltip("MQTT连接")}};b.Python.MQTT_connected=function(n){b.Python.definitions_.import_paho="import paho.mqtt.client as mqtt",b.Python.definitions_.mqtt_connect=`def mqtt_connect():
- client = mqtt.Client()
- client.connect("mqtt.eclipse.org", 1883, 60)
- return client
- `;var e="mqtt_connect()";return e};b.Blocks.MQTT_is_connected={init:function(){this.appendDummyInput().appendField("MQTT是否连接"),this.setOutput(!0,null),this.setColour(GP),this.setTooltip("MQTT是否连接"),this.setHelpUrl("")}};b.Python.MQTT_is_connected=function(n){b.Python.definitions_.MQTT_is_connected=`def MQTT_is_connected(client):
- return client.is_connected()
- `;var e="MQTT_is_connected(client)";return[e,b.Python.ORDER_NONE]};b.Blocks.mqtt_subscribe={init:function(){this.appendValueInput("content").setCheck(null).appendField("发送"),this.appendValueInput("topic").setCheck(null).appendField("内容到主题"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(GP),this.setTooltip("MQTT订阅主题"),this.setInputsInline(!0)}};b.Python.mqtt_subscribe=function(n){var e=b.Python.valueToCode(n,"topic",b.Python.ORDER_ATOMIC);b.Python.definitions_.mqtt_subscribe=`def mqtt_subscribe(client, topic):
- client.subscribe(topic)
- `;var t=`mqtt_subscribe(client, ${e})`;return t};b.Blocks.mqtt_received={init:function(){this.appendValueInput("topic").setCheck(null).appendField("当从主题"),this.appendDummyInput().appendField("收到消息时"),this.appendStatementInput("exec").setCheck(null).appendField(b.Msg.wifi_web_http_server_route_setting_do),this.setColour(GP),this.setTooltip("当从主题收到消息时"),this.setHelpUrl(""),this.setNextStatement(!0,null),this.setPreviousStatement(!0,null)}};b.Python.mqtt_received=function(n){return n.getFieldValue("path"),b.Python.statementToCode(n,"exec"),b.Python.definitions_.mqtt_on_message=`def on_message(client, userdata, msg):
- topic = msg.topic
- message = msg.payload.decode()
- print("Received message: " + message + " from topic: " + topic)
- `,""};b.Blocks.mqtt_accept_data={init:function(){this.appendDummyInput().appendField("接收MQTT数据"),this.setOutput(!0,null),this.setColour(GP),this.setTooltip("接收MQTT数据")}};b.Python.mqtt_accept_data=function(n){b.Python.definitions_.mqtt_accept_data=`def mqtt_accept_data(client
- ):
- client.loop_start()
- return client`;var e="mqtt_accept_data(client)";return[e,b.Python.ORDER_NONE]};const Rw="#5C81A6";b.Blocks.websocket_server_init={init:function(){this.appendDummyInput().appendField("websocket服务端初始化"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Rw),this.setTooltip("websocket服务端初始化")}};b.Python.websocket_server_init=function(n){b.Python.definitions_.import_websocket="import websocket",b.Python.definitions_.websocket_server_init=`def websocket_server_init():
- ws = websocket.WebSocketServer('192.168.1.100', 8080)
- return ws`;var e="websocket_server_init()";return e};b.Blocks.websocket_server_receive={init:function(){this.appendDummyInput().appendField("websocket服务端接收数据"),this.setOutput(!0,null),this.setColour(Rw),this.setTooltip("websocket服务端接收数据")}};b.Python.websocket_server_receive=function(n){b.Python.definitions_.websocket_server_receive=`def websocket_server_receive(ws):
- data = ws.recv()
- return data`;var e="websocket_server_receive(ws)";return[e,b.Python.ORDER_NONE]};b.Blocks.websocket_server_send={init:function(){this.appendValueInput("data").setCheck(null).appendField("websocket服务端发送数据"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Rw),this.setTooltip("websocket服务端发送数据")}};b.Python.websocket_server_send=function(n){var e=b.Python.valueToCode(n,"data",b.Python.ORDER_ATOMIC);b.Python.definitions_.websocket_server_send=`def websocket_server_send(ws, data):
- ws.send(data)`;var t=`websocket_server_send(ws, ${e})`;return t};b.Blocks.websocket_client_init={init:function(){this.appendDummyInput().appendField("websocket客户端初始化"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Rw),this.setTooltip("websocket客户端初始化")}};b.Python.websocket_client_init=function(n){b.Python.definitions_.import_websocket="import websocket",b.Python.definitions_.websocket_client_init=`def websocket_client_init():
- ws = websocket.WebSocket()
- ws.connect('ws://192.168.1.100:8080')
- return ws`;var e="websocket_client_init()";return e};b.Blocks.websocket_client_receive={init:function(){this.appendDummyInput().appendField("websocket客户端接收数据"),this.setOutput(!0,null),this.setColour(Rw),this.setTooltip("websocket客户端接收数据")}};b.Python.websocket_client_receive=function(n){b.Python.definitions_.websocket_client_receive=`def websocket_client_receive(ws):
- data = ws.recv()
- return data`;var e="websocket_client_receive(ws)";return[e,b.Python.ORDER_NONE]};b.Blocks.websocket_client_send={init:function(){this.appendValueInput("data").setCheck(null).appendField("websocket客户端发送数据"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Rw),this.setTooltip("websocket客户端发送数据")}};b.Python.websocket_client_send=function(n){var e=b.Python.valueToCode(n,"data",b.Python.ORDER_ATOMIC);b.Python.definitions_.websocket_client_send=`def websocket_client_send(ws, data):
- ws.send(data)`;var t=`websocket_client_send(ws, ${e})`;return t};b.Blocks.websocket_client_close={init:function(){this.appendDummyInput().appendField("websocket客户端关闭"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Rw),this.setTooltip("websocket客户端关闭")}};b.Python.websocket_client_close=function(n){b.Python.definitions_.websocket_client_close=`def websocket_client_close(ws):
- ws.close()`;var e="websocket_client_close(ws)";return e};b.Blocks.websocket_server_set_request={init:function(){this.appendDummyInput().appendField(b.Msg.wifi_web_http_server_route_setting_title),this.appendDummyInput().appendField(b.Msg.wifi_web_http_server_route_setting_path).appendField(new b.FieldTextInput("/"),"path").appendField(b.Msg.wifi_web_http_server_route_setting_being_requested),this.appendDummyInput().appendField(b.Msg.wifi_web_http_server_route_setting_property).appendField(new b.FieldDropdown([[b.Msg.wifi_web_http_server_route_setting_get,"get"],[b.Msg.wifi_web_http_server_route_setting_post,"post"]]),"response_type"),this.appendStatementInput("exec").setCheck(null).appendField(b.Msg.wifi_web_http_server_route_setting_do),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("response_type"),t={get:b.Msg.Esp32_Network_Http_Server_Route_TOOLTIP.replace("%1",b.Msg.wifi_web_http_server_route_setting_get),post:b.Msg.Esp32_Network_Http_Server_Route_TOOLTIP.replace("%1",b.Msg.wifi_web_http_server_route_setting_post)};return t[e]})}};b.Python.websocket_server_set_request=function(){block.getFieldValue("response_type"),block.getFieldValue("path"),b.Python.statementToCode(block,"exec");var n="";return n};b.Blocks.network_http_get={init:function(){this.appendDummyInput().appendField(b.Msg.internet_http_get_title),this.appendValueInput("http_get_url").setCheck(null).appendField(b.Msg.internet_http_get_url),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Esp32_Network_Http_Get_TOOLTIP),this.setHelpUrl("")}};b.Python.network_http_get=function(n){var e=b.Python.valueToCode(n,"http_get_url",b.Python.ORDER_ATOMIC);b.Python.definitions_.v831_import_requests="import requests",b.Python.definitions_.v831_import_json="import json",b.Python.definitions_.v831_import_SEND_HTTP=`_SEND_HTTP_GET_ENDPOINT = ${e}`;var t=`_SEND_HTTP_REQUEST = requests.get(_SEND_HTTP_GET_ENDPOINT)
- `;return t};b.Blocks.network_http_post={init:function(){this.appendDummyInput().appendField(new b.FieldImage("blockly/media/http_header_post.png",180,50,{alt:"*",flipRtl:"FALSE"})),this.appendDummyInput().appendField(b.Msg.internet_http_post_title),this.appendValueInput("http_post_url").setCheck(null).appendField(b.Msg.internet_http_post_url),this.appendValueInput("data").setCheck(null).appendField(b.Msg.internet_http_post_json),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Hu),this.setTooltip(b.Msg.Esp32_Network_Http_Post_TOOLTIP),this.setHelpUrl("")}};b.Python.network_http_post=function(n){var e=b.Python.valueToCode(n,"http_post_url",b.Python.ORDER_ATOMIC),t=b.Python.valueToCode(n,"data",b.Python.ORDER_ATOMIC);b.Python.addVariable("_SEND_HTTP_POST_ENDPOINT","",!0),b.Python.addVariable("_SEND_HTTP_REQUEST","",!0),b.Python.definitions_["831_import_requests"]="import requests",b.Python.definitions_["831_import_json"]="import json",b.Python.definitions_.import_urequests="_SEND_HTTP_POST_ENDPOINT = "+e+`
- `;var i=`_SEND_HTTP_POST_DATA = ${t}
- _SEND_HTTP_REQUEST = requests.post(_SEND_HTTP_POST_ENDPOINT, json = _SEND_HTTP_POST_DATA , headers = { "Content-type": "application/json" })
- `;return i};b.Blocks.CocoRobo_get={init:function(){this.appendDummyInput().appendField(b.Msg.internet_response_http_content_title).appendField(new b.FieldDropdown([[b.Msg.internet_response_text,"text"],[b.Msg.internet_response_content,"content"],[b.Msg.internet_response_status,"state"],[b.Msg.internet_response_json,"json"],[b.Msg.internet_response_encode,"code"],[b.Msg.internet_response_reason,"reason"]]),"op"),this.setOutput(!0,null),this.setColour(Hu),this.setHelpUrl("");var n=this;this.setTooltip(function(){var e=n.getFieldValue("op"),t={text:b.Msg.CocoRobo_get_TOOLTIP.replace("%1",b.Msg.internet_response_text),content:b.Msg.CocoRobo_get_TOOLTIP.replace("%1",b.Msg.internet_response_content),state:b.Msg.CocoRobo_get_TOOLTIP.replace("%1",b.Msg.internet_response_status),json:b.Msg.CocoRobo_get_TOOLTIP.replace("%1",b.Msg.internet_response_json),code:b.Msg.CocoRobo_get_TOOLTIP.replace("%1",b.Msg.internet_response_encode),reason:b.Msg.CocoRobo_get_TOOLTIP.replace("%1",b.Msg.internet_response_reason)};return t[e]})}};b.Python.CocoRobo_get=function(n){var e=n.getFieldValue("op"),t="_SEND_HTTP_REQUEST.text";return e=="text"?t="_SEND_HTTP_REQUEST.text":e=="content"?t="_SEND_HTTP_REQUEST.content":e=="state"?t="_SEND_HTTP_REQUEST.status_code":e=="json"?t="_SEND_HTTP_REQUEST.json()":e=="code"?t="_SEND_HTTP_REQUEST.encoding":e=="reason"&&(t="_SEND_HTTP_REQUEST.reason"),[t,b.Python.ORDER_CONDITIONAL]};const bxe={...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr,...xr},Mt={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};Mt.Python.forBlock.math_degrad=function(n){var e=n.getFieldValue("rad_deg"),t=Mt.Python.valueToCode(n,"convert",Mt.Python.ORDER_ATOMIC);Mt.Python.definitions_.import_math=`import math
- `;var i="math."+e+"("+t+")";return[i,Mt.Python.ORDER_NONE]};Mt.Python.forBlock.math_angle=function(n){return[n.getFieldValue("angle"),Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.math_keep_decimal=function(n){var e=Mt.Python.valueToCode(n,"NUM",Mt.Python.ORDER_ATOMIC);return n=Mt.Python.valueToCode(n,"PLACE",Mt.Python.ORDER_ATOMIC),["round("+e+", "+n+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.math_division_consult=function(n){var e=Mt.Python.valueToCode(n,"DIVIDEND",Mt.Python.ORDER_MULTIPLICATIVE)||"0";return n=Mt.Python.valueToCode(n,"DIVISOR",Mt.Python.ORDER_MULTIPLICATIVE)||"0",[e+" // "+n,Mt.Python.ORDER_MULTIPLICATIVE]};Mt.Python.forBlock.labplus_mapping=function(n){Mt.Python.definitions_.import_microbit="from microbit import *";var e=Mt.Python.valueToCode(n,"inputNum",Mt.Python.ORDER_ATOMIC);Mt.Python.valueToCode(n,"outputNum",Mt.Python.ORDER_ATOMIC);var t=Mt.Python.valueToCode(n,"bMin",Mt.Python.ORDER_ATOMIC),i=Mt.Python.valueToCode(n,"bMax",Mt.Python.ORDER_ATOMIC),s=Mt.Python.valueToCode(n,"cMin",Mt.Python.ORDER_ATOMIC);return n=Mt.Python.valueToCode(n,"cMax",Mt.Python.ORDER_ATOMIC),Mt.Python.definitions_.labplus_mapping=`def numberMap(inputNum,bMin,bMax,cMin,cMax):
- outputNum = 0
- outputNum =((cMax - cMin) / (bMax - bMin))*(inputNum - bMin)+cMin
- return outputNum
- `,["numberMap("+e+","+t+","+i+","+s+","+n+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.math_random_randrange=function(n){Mt.Python.definitions_.import_time="import time",Mt.Python.definitions_.import_random="import random";var e=Mt.Python.valueToCode(n,"start",Mt.Python.ORDER_ATOMIC),t=Mt.Python.valueToCode(n,"stop",Mt.Python.ORDER_ATOMIC);return n=Mt.Python.valueToCode(n,"step",Mt.Python.ORDER_ATOMIC),["random.randrange("+e+", "+t+", "+n+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.bit_inversion=function(n){return["~"+Mt.Python.valueToCode(n,"data",Mt.Python.ORDER_ATOMIC),Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_ten_convert_to=function(n){var e=Mt.Python.valueToCode(n,"int_num",Mt.Python.ORDER_ATOMIC);return[n.getFieldValue("ten_convert_to")+"("+e+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_convert_to_ten=function(n){var e=Mt.Python.valueToCode(n,"convert_str",Mt.Python.ORDER_ATOMIC);return n=n.getFieldValue("convert_choice"),["int("+e+", "+n+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_ten_convert_to=function(n){var e=Mt.Python.valueToCode(n,"int_num",Mt.Python.ORDER_ATOMIC);return[n.getFieldValue("ten_convert_to")+"("+e+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_high_low=function(n){return[n.getFieldValue("high_low"),Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_baudrate=function(n){return[n.getFieldValue("baudrate"),Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_start_new_thread=function(n){Mt.Python.definitions_.import_thread="import _thread";var e=n.getFieldValue("thread_name"),t=Mt.Python.statementToCode(n,"DO"),t=Mt.Python.addLoopTrap(t,n.id)||Mt.Python.PASS;return Mt.Python.codeFunctions_["thread_"+e]="def thread_"+e+`():
- `+t,"_thread.start_new_thread(thread_"+e+`, ())
- `};Mt.Python.forBlock.CocoRobo_ten_converted_to_bytes=function(n){Mt.Python.definitions_.import_struct="import struct";var e=Mt.Python.valueToCode(n,"convert_num",Mt.Python.ORDER_ATOMIC);return["struct.pack("+n.getFieldValue("convert_choice")+", "+e+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_int_to_chr=function(n){return["chr("+Mt.Python.valueToCode(n,"convert_num",Mt.Python.ORDER_ATOMIC)+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_hcsr04_obj=function(n){Mt.Python.definitions_.from_hcsr04_import_HCSR04="from hcsr04 import HCSR04";var e=n.getFieldValue("hcsr04_name"),t=Mt.Python.valueToCode(n,"trigger",Mt.Python.ORDER_ATOMIC);return n=Mt.Python.valueToCode(n,"echo",Mt.Python.ORDER_ATOMIC),Mt.Python.definitions_["CocoRobo_hcsr04_object"+e]=e+" = HCSR04(trigger_pin=Pin.P"+t+", echo_pin=Pin.P"+n+")",`
- `};Mt.Python.forBlock.CocoRobo_hcsr04_distance=function(n){Mt.Python.definitions_.from_hcsr04_import_HCSR04="from hcsr04 import HCSR04";var e=n.getFieldValue("hcsr04_name");return n=n.getFieldValue("unit"),[e+".distance_"+n+"()",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_hcsr04_distance_mm=function(n){return Mt.Python.definitions_.from_hcsr04_import_HCSR04="from hcsr04 import HCSR04",[n.getFieldValue("hcsr04_name")+".distance_mm()",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_pm2_5_MIC=function(n){Mt.Python.definitions_.machine_Timer="from machine import Timer";var e=Mt.Python.valueToCode(n,"rx",Mt.Python.ORDER_ATOMIC);return Mt.Python.codeFunctions_.CocoRobo_pm2_5="uart=UART(1, baudrate=9600, rx=Pin.P"+e+`, timeout=200)
- _pm_data = [None, None, None, None, None, None, None, None, None]
- def timer13_tick(_):
- global _pm_data
- try:
- if uart.any():
- d = uart.read(0x42)
- if d[0] == 0x42 and d[1] == 0x4d:
- _pm_data = [d[5], d[7], d[9], d[17], d[19], d[21], d[23], d[25], d[27]]
- except: pass
- tim13 = Timer(13)
- tim13.init(period=1000, mode=Timer.PERIODIC, callback=timer13_tick)`,[n.getFieldValue("unit"),Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_pm2_5_LitresAir=function(n){Mt.Python.definitions_.machine_Timer="from machine import Timer";var e=Mt.Python.valueToCode(n,"rx",Mt.Python.ORDER_ATOMIC);return Mt.Python.codeFunctions_.CocoRobo_pm2_5="uart=UART(1, baudrate=9600, rx=Pin.P"+e+`, timeout=200)
- _pm_data = [None, None, None, None, None, None, None, None, None]
- def timer13_tick(_):
- global _pm_data
- try:
- if uart.any():
- d = uart.read(0x42)
- if d[0] == 0x42 and d[1] == 0x4d:
- _pm_data = [d[5], d[7], d[9], d[17], d[19], d[21], d[23], d[25], d[27]]
- except: pass
- tim13 = Timer(13)
- tim13.init(period=1000, mode=Timer.PERIODIC, callback=timer13_tick)`,[n.getFieldValue("unit"),Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_mac_address=function(n){return Mt.Python.definitions_.import_machine="import machine",Mt.Python.definitions_.import_ubinascii="import ubinascii",["ubinascii.hexlify(machine.unique_id()).decode().upper()",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_ujson_loads=function(n){return Mt.Python.definitions_.import_ujson="import json",["json.loads("+Mt.Python.valueToCode(n,"data",Mt.Python.ORDER_ATOMIC)+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_code_annotation=function(n){var e=Mt.Python.valueToCode(n,"data",Mt.Python.ORDER_ATOMIC);return"# "+e.replace('"',"").replace('"',"")+`
- `};Mt.Python.forBlock.CocoRobo_ujson_dumps=function(n){return Mt.Python.definitions_.import_ujson="import json",["json.dumps("+Mt.Python.valueToCode(n,"data",Mt.Python.ORDER_ATOMIC)+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_base64_to_data=function(n){return Mt.Python.definitions_.v831_import_base64="import base64",["base64.b64decode("+Mt.Python.valueToCode(n,"data",Mt.Python.ORDER_ATOMIC)+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_data_to_base64=function(n){return Mt.Python.definitions_.v831_import_base64="import base64",["base64.b64encode("+Mt.Python.valueToCode(n,"data",Mt.Python.ORDER_ATOMIC)+".encode('utf-8'))",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_hex_to_bin_str=function(n){return["bytes.fromhex("+Mt.Python.valueToCode(n,"convert_chr",Mt.Python.ORDER_ATOMIC)+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_str_to_hex=function(n){return[Mt.Python.valueToCode(n,"convert_chr",Mt.Python.ORDER_ATOMIC)+".encode().hex()",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.CocoRobo_chr_to_int=function(n){return["ord("+Mt.Python.valueToCode(n,"convert_chr",Mt.Python.ORDER_ATOMIC)+")",Mt.Python.ORDER_ATOMIC]};Mt.Python.forBlock.math_convert=function(n){var e=n.getFieldValue("TYPE0");return n=Mt.Python.valueToCode(n,"INPUT0",Mt.Python.ORDER_ATOMIC),[e+"("+n+")",Mt.Python.ORDER_FUNCTION_CALL]};Mt.Python.forBlock.math_number_bits_ops=function(n){var e={" | ":[" | ",Mt.Python.ORDER_BITWISE_OR]," & ":[" & ",Mt.Python.ORDER_BITWISE_AND]," ^ ":[" ^ ",Mt.Python.ORDER_BITWISE_XOR]," >> ":[" >> ",Mt.Python.ORDER_BITWISE_SHIFT]," << ":[" << ",Mt.Python.ORDER_BITWISE_SHIFT]}[n.getFieldValue("OP")],t=e[0];e=e[1];var i=Mt.Python.valueToCode(n,"A",e)||"0";return n=Mt.Python.valueToCode(n,"B",e)||"0",[i+t+n,e]};Mt.Python.forBlock.controls_repeat_forever=function(n){var e=Mt.Python.statementToCode(n,"DO");return e=Mt.Python.addLoopTrap(e,n.id)||Mt.Python.PASS,`while True:
- `+e};const zo={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};zo.Python.CocoRobo_type=function(n){return["type("+(zo.Python.valueToCode(n,"VAR",zo.Python.ORDER_ATOMIC)||"None")+")",zo.Python.ORDER_ATOMIC]};zo.Python.CocoRobo_type_is=function(n){var e=zo.Python.valueToCode(n,"VAR",zo.Python.ORDER_ATOMIC)||"None";return n=n.getFieldValue("TYPE"),["type("+e+") == "+n,zo.Python.ORDER_ATOMIC]};zo.Python.CocoRobo_eval=function(n){return["eval("+(zo.Python.valueToCode(n,"VAR",zo.Python.ORDER_ATOMIC)||"None")+")",zo.Python.ORDER_ATOMIC]};zo.Python.CocoRobo_return=function(n){return"return "+(zo.Python.valueToCode(n,"VAR",zo.Python.ORDER_ATOMIC)||"None")+`
- `};zo.Python.CocoRobo_try_except=function(n){var e=zo.Python.statementToCode(n,"TRY")||zo.Python.PASS;return n=zo.Python.statementToCode(n,"EXCEPT")||zo.Python.PASS,`try:
- `+e+`except:
- `+n};zo.Python.CocoRobo_try_except_finally=function(n){var e=zo.Python.statementToCode(n,"TRY")||zo.Python.PASS,t=zo.Python.statementToCode(n,"EXCEPT")||zo.Python.PASS;return n=zo.Python.statementToCode(n,"FINALLY")||zo.Python.PASS,`try:
- `+e+`except:
- `+t+`finally:
- `+n};const jn={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};jn.Python.text_join=function(n){var e;if(n.itemCount_==0)return["''",jn.Dart.ORDER_ATOMIC];if(n.itemCount_==1){var t=jn.Dart.valueToCode(n,"ADD0",jn.Dart.ORDER_UNARY_POSTFIX)||"''";return e=t+".toString()",[e,jn.Dart.ORDER_UNARY_POSTFIX]}else{e=new Array(n.itemCount_);for(var i=0;i<n.itemCount_;i++)e[i]=jn.Dart.valueToCode(n,"ADD"+i,jn.Dart.ORDER_NONE)||"''";return e="["+e.join(",")+"].join()",[e,jn.Dart.ORDER_UNARY_POSTFIX]}};jn.Python.text_split_string_by_delimiter=function(n){var e=jn.Python.valueToCode(n,"string_input",jn.Python.ORDER_ATOMIC),t=n.getFieldValue("delimiter"),i=e+'.split("'+t+'")';return[i,jn.Python.ORDER_NONE]};jn.Python.text_format=function(n){var e=jn.Python.valueToCode(n,"FORMAT",jn.Python.ORDER_ATOMIC);let t=jn.Python.valueToCode(n,"CONTENT",jn.Python.ORDER_ATOMIC);return[e+" % "+t,jn.Python.ORDER_ATOMIC]};jn.Python.tuple_create_with_items_insert=function(n){for(var e=Array(n.itemCount_),t=0;t<n.itemCount_;t++)e[t]=jn.Python.valueToCode(n,"ADD"+t,jn.Python.ORDER_NONE)||"None";return[n.itemCount_==1?"("+e[0]+",)":"("+e.join(", ")+")",jn.Python.ORDER_ATOMIC]};jn.Python.text_format2=function(n){var e=jn.Python.valueToCode(n,"FORMAT",jn.Python.ORDER_ATOMIC);return n=jn.Python.valueToCode(n,"CONTENT",jn.Python.ORDER_ATOMIC),[e+".format"+n,jn.Python.ORDER_ATOMIC]};jn.Python.CocoRobo_text_ESC=function(n){return['"'+n.getFieldValue("mode")+'"',jn.Python.ORDER_ATOMIC]};jn.Python.text_append_text=function(n){var e=jn.Python.valueToCode(n,"text_abc",jn.Python.ORDER_ATOMIC);return n=jn.Python.valueToCode(n,"append_text",jn.Python.ORDER_ATOMIC),["str("+e+") + str("+n+")",jn.Python.ORDER_ATOMIC]};jn.Python.text_is_number=function(n){var e=jn.Python.valueToCode(n,"TEXT",jn.Python.ORDER_ATOMIC);return n=n.getFieldValue("TYPE"),[e+n,jn.Python.ORDER_ATOMIC]};jn.Python.text_to_byte=function(n){return["bytes("+jn.Python.valueToCode(n,"TEXT",jn.Python.ORDER_ATOMIC)+", 'utf-8')",jn.Python.ORDER_ATOMIC]};jn.Python.other_to_byte=function(n){return["bytes("+jn.Python.valueToCode(n,"input_var",jn.Python.ORDER_ATOMIC)+")",jn.Python.ORDER_ATOMIC]};jn.Python.bit_inversion=function(n){return["~"+jn.Python.valueToCode(n,"data",jn.Python.ORDER_ATOMIC),jn.Python.ORDER_ATOMIC]};jn.Python.CocoRobo_bytes_decode=function(n){return[jn.Python.valueToCode(n,"bytes_decode",jn.Python.ORDER_ATOMIC)+".decode('UTF-8','ignore')",jn.Python.ORDER_ATOMIC]};jn.Python.CocoRobo_ujson_dumps=function(n){return jn.Python.definitions_.import_ujson="import json",["json.dumps("+jn.Python.valueToCode(n,"data",jn.Python.ORDER_ATOMIC)+")",jn.Python.ORDER_ATOMIC]};jn.Python.CocoRobo_ujson_loads=function(n){return jn.Python.definitions_.import_ujson="import json",["json.loads("+jn.Python.valueToCode(n,"data",jn.Python.ORDER_ATOMIC)+")",jn.Python.ORDER_ATOMIC]};jn.Python.CocoRobo_code_annotation=function(n){var e=jn.Python.valueToCode(n,"data",jn.Python.ORDER_ATOMIC);return"# "+e.replace("'","").replace("'","")+`
- `};jn.Python.text_dict=function(n){return["{"+jn.Python.quote_empty(n.getFieldValue("TEXT"))+"}",jn.Python.ORDER_ATOMIC]};const St={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};St.Python.lists_create_with=function(n){for(var e=Array(n.itemCount_),t=0;t<n.itemCount_;t++)e[t]=St.Python.valueToCode(n,"ADD"+t,St.Python.ORDER_NONE)||"None";return["["+e.join(", ")+"]",St.Python.ORDER_ATOMIC]};St.Python.text_list=function(n){return["["+St.Python.quote_empty(n.getFieldValue("TEXT"))+"]",St.Python.ORDER_ATOMIC]};St.Python.lists_create_with_object=function(n){for(var e=Array(n.itemCount_),t=0;t<n.itemCount_;t++)e[t]=St.Python.valueToCode(n,"ADD"+t,St.Python.ORDER_NONE)||"None";return["["+e.join(", ")+"]",St.Python.ORDER_ATOMIC]};St.Python.CocoRobo_return_list=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC);return n=St.Python.valueToCode(n,"list_items",St.Python.ORDER_ATOMIC),e+" = "+n+`
- `};St.Python.lists_append=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC);return n=St.Python.valueToCode(n,"last_item",St.Python.ORDER_ATOMIC),e+".append("+n+`)
- `};St.Python.lists_extend=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC);return n=St.Python.valueToCode(n,"extend_list",St.Python.ORDER_ATOMIC),e+".extend("+n+`)
- `};St.Python.lists_clear=function(n){return St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC)+`.clear()
- `};St.Python.list_order_item=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC),t=n.getFieldValue("list_order");return n=St.Python.valueToCode(n,"list_order_item",St.Python.ORDER_ATOMIC),[e+t+n+"]",St.Python.ORDER_ATOMIC]};St.Python.lists_clear=function(n){return St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC)+`.clear()
- `};St.Python.parts_of_list=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC),t=n.getFieldValue("list_start_order"),i=n.getFieldValue("list_end_order"),s=St.Python.valueToCode(n,"start_item",St.Python.ORDER_ATOMIC);switch(n=St.Python.valueToCode(n,"end_item",St.Python.ORDER_ATOMIC),i){case":":var o=parseInt(n)+1;break;case":-":o=n-1}return[e+t+s+i+o+"]",St.Python.ORDER_ATOMIC]};St.Python.list_to_tuple=function(n){return["tuple("+St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC)+")",St.Python.ORDER_ATOMIC]};St.Python.list_order_item=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC),t=n.getFieldValue("list_order");return n=St.Python.valueToCode(n,"list_order_item",St.Python.ORDER_ATOMIC),[e+t+n+"]",St.Python.ORDER_ATOMIC]};St.Python.set_list_order_item=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC),t=n.getFieldValue("list_order"),i=St.Python.valueToCode(n,"list_order_item",St.Python.ORDER_ATOMIC);return n=St.Python.valueToCode(n,"set_value",St.Python.ORDER_ATOMIC),e+t+i+"] = "+n+`
- `};St.Python.insert_list_order_item=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC),t=n.getFieldValue("list_order"),i=St.Python.valueToCode(n,"list_order_item",St.Python.ORDER_ATOMIC);return n=St.Python.valueToCode(n,"set_value",St.Python.ORDER_ATOMIC),e+".insert"+t+i+", "+n+`)
- `};St.Python.list_item_exist=function(n){var e=St.Python.valueToCode(n,"list_name",St.Python.ORDER_ATOMIC);return[St.Python.valueToCode(n,"list_item",St.Python.ORDER_ATOMIC)+" in "+e,St.Python.ORDER_ATOMIC]};St.Python.lists_repeat=function(n){var e=St.Python.valueToCode(n,"ITEM",St.Python.ORDER_NONE)||"None";return n=St.Python.valueToCode(n,"NUM",St.Python.ORDER_MULTIPLICATIVE)||"0",["["+e+"] * "+n,St.Python.ORDER_MULTIPLICATIVE]};St.Python.lists_length=function(n){return["len("+(St.Python.valueToCode(n,"VALUE",St.Python.ORDER_NONE)||"[]")+")",St.Python.ORDER_FUNCTION_CALL]};St.Python.lists_isEmpty=function(n){return["not len("+(St.Python.valueToCode(n,"VALUE",St.Python.ORDER_NONE)||"[]")+")",St.Python.ORDER_LOGICAL_NOT]};St.Python.lists_indexOf=function(n){var e=St.Python.valueToCode(n,"FIND",St.Python.ORDER_NONE)||"[]",t=St.Python.valueToCode(n,"VALUE",St.Python.ORDER_NONE)||"''";if(n.workspace.options.oneBasedIndex)var i=" 0",s=" + 1",o="";else i=" -1",s="",o=" - 1";return n.getFieldValue("END")=="FIRST"?(n=St.Python.provideFunction_("first_index",["def "+St.Python.FUNCTION_NAME_PLACEHOLDER_+"(my_list, elem):"," try: index = my_list.index(elem)"+s," except: index ="+i," return index"]),[n+"("+t+", "+e+")",St.Python.ORDER_FUNCTION_CALL]):(n=St.Python.provideFunction_("last_index",["def "+St.Python.FUNCTION_NAME_PLACEHOLDER_+"(my_list, elem):"," try: index = len(my_list) - my_list[::-1].index(elem)"+o," except: index ="+i," return index"]),[n+"("+t+", "+e+")",St.Python.ORDER_FUNCTION_CALL])};St.Python.lists_getIndex=function(n){var e=n.getFieldValue("MODE")||"GET",t=n.getFieldValue("WHERE")||"FROM_START",i=St.Python.valueToCode(n,"VALUE",t=="RANDOM"?St.Python.ORDER_NONE:St.Python.ORDER_MEMBER)||"[]";switch(t){case"FIRST":if(e=="GET")return[i+"[0]",St.Python.ORDER_MEMBER];if(e=="GET_REMOVE")return[i+".pop(0)",St.Python.ORDER_FUNCTION_CALL];if(e=="REMOVE")return i+`.pop(0)
- `;break;case"LAST":if(e=="GET")return[i+"[-1]",St.Python.ORDER_MEMBER];if(e=="GET_REMOVE")return[i+".pop()",St.Python.ORDER_FUNCTION_CALL];if(e=="REMOVE")return i+`.pop()
- `;break;case"FROM_START":if(n=St.Python.valueToCode(n,"AT",St.Python.ORDER_ATOMIC),e=="GET")return[i+"["+n+"]",St.Python.ORDER_MEMBER];if(e=="GET_REMOVE")return[i+".pop("+n+")",St.Python.ORDER_FUNCTION_CALL];if(e=="REMOVE")return i+".pop("+n+`)
- `;break;case"FROM_END":if(n=St.Python.getAdjustedInt(n,"AT",1,!0),e=="GET")return[i+"["+n+"]",St.Python.ORDER_MEMBER];if(e=="GET_REMOVE")return[i+".pop("+n+")",St.Python.ORDER_FUNCTION_CALL];if(e=="REMOVE")return i+".pop("+n+`)
- `;break;case"RANDOM":if(St.Python.definitions_.import_random="import random",e=="GET")return["random.choice("+i+")",St.Python.ORDER_FUNCTION_CALL];if(i=St.Python.provideFunction_("lists_remove_random_item",["def "+St.Python.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," x = int(random.random() * len(myList))"," return myList.pop(x)"])+"("+i+")",e=="GET_REMOVE")return[i,St.Python.ORDER_FUNCTION_CALL];if(e=="REMOVE")return i+`
- `}throw"Unhandled combination (lists_getIndex)."};St.Python.lists_setIndex=function(n){var e=St.Python.valueToCode(n,"LIST",St.Python.ORDER_MEMBER)||"[]",t=n.getFieldValue("MODE")||"GET",i=n.getFieldValue("WHERE")||"FROM_START",s=St.Python.valueToCode(n,"TO",St.Python.ORDER_NONE)||"None";switch(i){case"FIRST":if(t=="SET")return e+"[0] = "+s+`
- `;if(t=="INSERT")return e+".insert(0, "+s+`)
- `;break;case"LAST":if(t=="SET")return e+"[-1] = "+s+`
- `;if(t=="INSERT")return e+".append("+s+`)
- `;break;case"FROM_START":if(n=St.Python.getAdjustedInt(n,"AT"),t=="SET")return e+"["+n+"] = "+s+`
- `;if(t=="INSERT")return e+".insert("+n+", "+s+`)
- `;break;case"FROM_END":if(n=St.Python.getAdjustedInt(n,"AT",1,!0),t=="SET")return e+"["+n+"] = "+s+`
- `;if(t=="INSERT")return e+".insert("+n+", "+s+`)
- `;break;case"RANDOM":if(St.Python.definitions_.import_random="import random",e.match(/^\w+$/)?n="":(n=St.Python.variableDB_.getDistinctName("tmp_list",St.Variables.NAME_TYPE),i=n+" = "+e+`
- `,e=n,n=i),i=St.Python.variableDB_.getDistinctName("tmp_x",St.Variables.NAME_TYPE),n+=i+" = int(random.random() * len("+e+`))
- `,t=="SET")return n+(e+"["+i+"] = "+s+`
- `);if(t=="INSERT")return n+(e+".insert("+i+", "+s+`)
- `)}throw"Unhandled combination (lists_setIndex)."};St.Python.lists_getSublist=function(n){var e=St.Python.valueToCode(n,"LIST",St.Python.ORDER_MEMBER)||"[]",t=n.getFieldValue("WHERE1"),i=n.getFieldValue("WHERE2");switch(t){case"FROM_START":t=St.Python.getAdjustedInt(n,"AT1"),t=="0"&&(t="");break;case"FROM_END":t=St.Python.getAdjustedInt(n,"AT1",1,!0);break;case"FIRST":t="";break;default:throw"Unhandled option (lists_getSublist)"}switch(i){case"FROM_START":n=St.Python.getAdjustedInt(n,"AT2",1);break;case"FROM_END":n=St.Python.getAdjustedInt(n,"AT2",0,!0),St.isNumber(String(n))?n=="0"&&(n=""):(St.Python.definitions_.import_sys="import sys",n+=" or sys.maxsize");break;case"LAST":n="";break;default:throw"Unhandled option (lists_getSublist)"}return[e+"["+t+" : "+n+"]",St.Python.ORDER_MEMBER]};St.Python.lists_sort=function(n){var e=St.Python.valueToCode(n,"LIST",St.Python.ORDER_NONE)||"[]",t=n.getFieldValue("TYPE");return n=n.getFieldValue("DIRECTION")==="1"?"False":"True",[St.Python.provideFunction_("lists_sort",["def "+St.Python.FUNCTION_NAME_PLACEHOLDER_+"(my_list, type, reverse):"," def try_float(s):"," try:"," return float(s)"," except:"," return 0"," key_funcs = {",' "NUMERIC": try_float,',' "TEXT": str,',' "IGNORE_CASE": lambda s: str(s).lower()'," }"," key_func = key_funcs[type]"," list_cpy = list(my_list)"," return sorted(list_cpy, key=key_func, reverse=reverse)"])+"("+e+', "'+t+'", '+n+")",St.Python.ORDER_FUNCTION_CALL]};St.Python.lists_split=function(n){var e=n.getFieldValue("MODE");if(e=="SPLIT")e=St.Python.valueToCode(n,"INPUT",St.Python.ORDER_MEMBER)||"''",n=St.Python.valueToCode(n,"DELIM",St.Python.ORDER_NONE),n=e+".split("+n+")";else if(e=="JOIN")e=St.Python.valueToCode(n,"INPUT",St.Python.ORDER_NONE)||"[]",n=St.Python.valueToCode(n,"DELIM",St.Python.ORDER_MEMBER)||"''",n=n+".join("+e+")";else throw"Unknown mode: "+e;return[n,St.Python.ORDER_FUNCTION_CALL]};St.Python.list_first_index=function(n){var e=St.Python.valueToCode(n,"elem",St.Python.ORDER_ATOMIC),t=St.Python.valueToCode(n,"my_list",St.Python.ORDER_ATOMIC);return n=n.getFieldValue("last_or_first"),St.Python.codeFunctions_.list_first_index=`def first_index(my_list, elem):
- try: index = my_list.index(elem)
- except: index = 0
- return index`,St.Python.codeFunctions_.list_last_index=`def last_index(my_list, elem):
- try: index = len(my_list) - my_list[::-1].index(elem) - 1
- except: index = 0
- return index`,[n+"_index("+t+", "+e+")",St.Python.ORDER_ATOMIC]};const Zi={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};Zi.Python.text_dict=function(n){return["{"+Zi.Python.quote_empty(n.getFieldValue("TEXT"))+"}",Zi.Python.ORDER_ATOMIC]};Zi.Python.dict_create_with=function(n){var e=Zi.Python.valueToCode(n,"dict_name",Zi.Python.ORDER_ATOMIC);return n=Zi.Python.valueToCode(n,"dict_items",Zi.Python.ORDER_ATOMIC),e+" = "+n+`
- `};Zi.Python.dict_key_value=function(n){var e=Zi.Python.valueToCode(n,"dict_name",Zi.Python.ORDER_ATOMIC);return n=Zi.Python.valueToCode(n,"dict_items",Zi.Python.ORDER_ATOMIC),[e+".get("+n+")",Zi.Python.ORDER_ATOMIC]};Zi.Python.add_dict_key_value=function(n){var e=Zi.Python.valueToCode(n,"dict_name",Zi.Python.ORDER_ATOMIC),t=Zi.Python.valueToCode(n,"dict_items",Zi.Python.ORDER_ATOMIC);return n=Zi.Python.valueToCode(n,"add_value",Zi.Python.ORDER_ATOMIC),e+"["+t+"] = "+n+`
- `};Zi.Python.dict_length=function(n){return["len("+Zi.Python.valueToCode(n,"dict_name",Zi.Python.ORDER_ATOMIC)+")",Zi.Python.ORDER_ATOMIC]};Zi.Python.dict_key_exist=function(n){var e=Zi.Python.valueToCode(n,"dict_name",Zi.Python.ORDER_ATOMIC);return[Zi.Python.valueToCode(n,"dict_items",Zi.Python.ORDER_ATOMIC)+" in "+e,Zi.Python.ORDER_ATOMIC]};Zi.Python.dict_key_or_val_list=function(n){var e=Zi.Python.valueToCode(n,"dict_name",Zi.Python.ORDER_ATOMIC);return n=n.getFieldValue("key_or_val"),["list("+e+"."+n+"())",Zi.Python.ORDER_ATOMIC]};Zi.Python.dict_create_with_items_insert=function(){for(var n=Array(this.itemCount_),e=0;e<this.itemCount_;e++){var t=this.getFieldValue("KEY"+e);n[e]='"'+t+'":'+(Zi.Python.valueToCode(this,"ADD"+e,Zi.Python.ORDER_NONE)||"0")}return n="{"+n.join(", ")+"}",[n,Zi.Python.ORDER_ATOMIC]};Zi.Python.pinyin_dict_create_with_items_insert=function(){for(var n=Array(this.itemCount_),e=0;e<this.itemCount_;e++){var t=this.getFieldValue("KEY"+e);n[e]='"'+t+'":'+(Zi.Python.valueToCode(this,"ADD"+e,Zi.Python.ORDER_NONE)||"0")}return n="{"+n.join(", ")+"}",[n,Zi.Python.ORDER_ATOMIC]};const Mi={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};Mi.Python.text_tuple=function(n){return["("+Mi.Python.quote_empty(n.getFieldValue("TEXT"))+")",Mi.Python.ORDER_ATOMIC]};Mi.Python.set_tuple_order_item=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC),t=n.getFieldValue("tuple_order"),i=Mi.Python.valueToCode(n,"tuple_order_item",Mi.Python.ORDER_ATOMIC);return n=Mi.Python.valueToCode(n,"set_value",Mi.Python.ORDER_ATOMIC),e+t+i+"] = "+n+`
- `};Mi.Python.tuple_create_with_items_insert=function(n){for(var e=Array(n.itemCount_),t=0;t<n.itemCount_;t++)e[t]=Mi.Python.valueToCode(n,"ADD"+t,Mi.Python.ORDER_NONE)||"None";return[n.itemCount_==1?"("+e[0]+",)":"("+e.join(", ")+")",Mi.Python.ORDER_ATOMIC]};Mi.Python.tuple_create_with=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC);return n=Mi.Python.valueToCode(n,"tuple_items",Mi.Python.ORDER_ATOMIC),e+" = "+n+`
- `};Mi.Python.tuple_order_item=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC),t=n.getFieldValue("tuple_order");return n=Mi.Python.valueToCode(n,"tuple_order_item",Mi.Python.ORDER_ATOMIC),[e+t+n+"]",Mi.Python.ORDER_ATOMIC]};Mi.Python.tuple_min_max_len=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC);return[n.getFieldValue("tuple_min_max_len")+"("+e+")",Mi.Python.ORDER_ATOMIC]};Mi.Python.tuple_item_exist=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC);return[Mi.Python.valueToCode(n,"tuple_item",Mi.Python.ORDER_ATOMIC)+" in "+e,Mi.Python.ORDER_ATOMIC]};Mi.Python.parts_of_tuple=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC);return n=Mi.Python.valueToCode(n,"tuple_item",Mi.Python.ORDER_ATOMIC),[e+"["+n+":]",Mi.Python.ORDER_ATOMIC]};Mi.Python.parts_of_tuple2=function(n){var e=Mi.Python.valueToCode(n,"tuple_name",Mi.Python.ORDER_ATOMIC),t=n.getFieldValue("tuple_start_order"),i=n.getFieldValue("tuple_end_order"),s=Mi.Python.valueToCode(n,"start_item",Mi.Python.ORDER_ATOMIC);switch(n=Mi.Python.valueToCode(n,"end_item",Mi.Python.ORDER_ATOMIC),i){case":":var o=parseInt(n)+1;break;case":-":o=n-1}return[e+t+s+i+o+"]",Mi.Python.ORDER_ATOMIC]};const is={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};is.Python.set_create_with_items_insert=function(n){var e=Array(n.itemCount_);if(n.itemCount_==0)n="set()";else{for(var t=0;t<n.itemCount_;t++)e[t]=is.Python.valueToCode(n,"ADD"+t,is.Python.ORDER_NONE)||"None";n="{"+e.join(", ")+"}"}return[n,is.Python.ORDER_ATOMIC]};is.Python.text_set=function(n){return["{"+is.Python.quote_empty(n.getFieldValue("TEXT"))+"}",is.Python.ORDER_ATOMIC]};is.Python.set_create_with=function(n){var e=is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC);return n=is.Python.valueToCode(n,"set_items",is.Python.ORDER_ATOMIC),e+" = "+n+`
- `};is.Python.sets_update_ways=function(n){var e=n.getFieldValue("sets_update_ways"),t=is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC);return n=is.Python.valueToCode(n,"set_1_name",is.Python.ORDER_ATOMIC),t+e+"("+n+`)
- `};is.Python.get_sets_pop=function(n){return[is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC)+".pop()",is.Python.ORDER_ATOMIC]};is.Python.len_of_sets=function(n){return["len("+is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC)+")",is.Python.ORDER_ATOMIC]};is.Python.intersection_of_sets=function(n){var e=n.getFieldValue("set_operation_type"),t=is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC);return n=is.Python.valueToCode(n,"set_1_name",is.Python.ORDER_ATOMIC),[t+e+n,is.Python.ORDER_ATOMIC]};is.Python.set_update_with=function(n){var e=is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC);return n=is.Python.valueToCode(n,"set_items",is.Python.ORDER_ATOMIC),e+".update("+n+`)
- `};is.Python.set_subset_superset=function(n){var e=n.getFieldValue("subset_superset"),t=is.Python.valueToCode(n,"set_name",is.Python.ORDER_ATOMIC);return n=is.Python.valueToCode(n,"set_1_name",is.Python.ORDER_ATOMIC),[t+e+"("+n+")",is.Python.ORDER_ATOMIC]};const xl={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};xl.Python.esp32_main_controller_io_from_digital_pin=function(n){var e=xl.Python.valueToCode(n,"digital_pin_input",xl.Python.ORDER_ATOMIC),t="";return xl.Python.definitions_.import_from_digital_pin_setup=`from machine import Pin
- `,xl.Python.definitions_["import_from_digital_pin_"+e]=`
- _PIN_IN_${e} = Pin(${e}, Pin.IN)
- `,t="_PIN_IN_"+e+".value()",[t,xl.Python.ORDER_CONDITIONAL]};xl.Python.esp32_main_controller_io_set_digital_pin=function(n){var e=xl.Python.valueToCode(n,"high_low",xl.Python.ORDER_ATOMIC).slice(1,2),t=xl.Python.valueToCode(n,"digital_pin_input",xl.Python.ORDER_ATOMIC);return xl.Python.definitions_.import_from_digital_pin_setup=`from machine import Pin
- `,xl.Python.definitions_["import_from_digital_pin_"+t]=`
- _PIN_OUT_${t} = Pin(${t}, Pin.OUT)
- `,`_PIN_OUT_${t}.value(${e})
- `};xl.Python.esp32_main_controller_io_high_low=function(n){var e=n.getFieldValue("high_low"),t=e;return[t,xl.Python.ORDER_NONE]};xl.Python.esp32_main_controller_io_from_analog_pin=function(n){var e=n.getFieldValue("gpio");xl.Python.definitions_.import_setup=`import machine
- from machine import Pin, ADC
- `,xl.Python.definitions_["import_"+e+"_setup"]="_PWM_PIN_IN_"+e+" = ADC(Pin("+e+`))
- _PWM_PIN_IN_`+e+`.atten(ADC.ATTN_11DB)
- _PWM_PIN_IN_`+e+`.width(ADC.WIDTH_10BIT)
- `;var t="_PWM_PIN_IN_"+e+".read()";return[t,xl.Python.ORDER_CONDITIONAL]};const So={Python:Sa.pythonGenerator||{Msg:Object.create(null)}};So.Python.iot_system_run=function(n){var e=So.Python.valueToCode(n,"PATH",So.Python.ORDER_ATOMIC),t="exec(open("+e+`).read())
- `;return t};So.Python.iot_system_create_file=function(n){var e=So.Python.valueToCode(n,"filename",So.Python.ORDER_ATOMIC).replace('"',"").replace('"',""),t=So.Python.valueToCode(n,"PATH",So.Python.ORDER_ATOMIC).replace('"',"").replace('"',""),i=`def _CREATE_TEXT_FILE(_path):
- `;return i+=` f = open(_path, 'w')
- `,i+=` f.close()
- `,So.Python.addFunction("_CREATE_TEXT_FILE",i),i='_CREATE_TEXT_FILE("'+t+e+`")
- `,i};So.Python.iot_system_open_file=function(n){var e=So.Python.valueToCode(n,"filename",So.Python.ORDER_ATOMIC).replace('"',"").replace('"',""),t=So.Python.valueToCode(n,"PATH",So.Python.ORDER_ATOMIC).replace('"',"").replace('"',""),i='f = open("'+t+e+`", 'a')
- `;return i};So.Python.iot_system_write_file=function(n){var e=So.Python.valueToCode(n,"WPATH",So.Python.ORDER_ATOMIC),t=n.getFieldValue("separator"),i="";return t=="newline"?i="f.write("+e+` + '\\r\\n')
- `:t=="comma"?i="f.write("+e+` + ',')
- `:t=="space"?i="f.write("+e+` + ' ')
- `:t=="semicolon"&&(i="f.write("+e+` + ';')
- `),i};So.Python.iot_system_close_file=function(n){var e=`f.close()
- `;return e};So.Python.iot_system_delete_file=function(n){var e=So.Python.valueToCode(n,"PATH",So.Python.ORDER_ATOMIC);So.Python.definitions_["import os"]="import os";var t="os.remove("+e+`)
- `;return t};So.Python.iot_system_input_file=function(n){var e=So.Python.valueToCode(n,"filename",So.Python.ORDER_ATOMIC).replace('"',"").replace('"',""),t=So.Python.valueToCode(n,"PATH",So.Python.ORDER_ATOMIC).replace('"',"").replace('"',""),i=n.getFieldValue("separator");So.Python.definitions_._GET_LIST_FROM_FILE=`def _GET_LIST_FROM_FILE(_path, _sep):
- f = open(_path, 'r')
- result = f.read().split(_sep)
- f.close()
- return result
- `;let s='_GET_LIST_FROM_FILE("'+t+e+`", '\\r\\n')`;return i=="newline"?s='_GET_LIST_FROM_FILE("'+t+e+`", '\\r\\n')`:i=="comma"?s='_GET_LIST_FROM_FILE("'+t+e+`", ',')`:i=="space"?s='_GET_LIST_FROM_FILE("'+t+e+`", ' ')`:i=="semicolon"&&(s='_GET_LIST_FROM_FILE("'+t+e+`", ';')`),[s,So.Python.ORDER_NONE]};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};b.Python.time_delay=function(n){b.Python.definitions_.import_time="import time";var e=b.Python.valueToCode(n,"DELAY_TIME_MILI",b.Python.ORDER_ATOMIC)||"0",t="time.sleep("+e+`/1000);
- `;return t};b.Python.time_delayseconds=function(n){b.Python.definitions_.import_time="import time";var e=b.Python.valueToCode(n,"DELAY_TIME_MICRO",b.Python.ORDER_ATOMIC)||"0",t="time.sleep("+e+`)
- `;return t};b.Python.esp32_get_current_date=function(n){var e=n.getFieldValue("type");b.Python.definitions_.import_datetime_datetime="from datetime import datetime",b.Python.definitions_.get_current_date=`def getCurrent_data(type):
- now = datetime.now()
- return now.strftime("%"+type+"")
- `;var t=`getCurrent_data("${e}")`;return[t,b.Python.ORDER_NONE]};b.Python.esp32_main_controller_time_timer_init=function(n){n.getFieldValue("type"),b.Python.definitions_.import_time="import time",b.Python.definitions_.counter_start_variable=`counter_start = 0
- def counter_start_fun():
- global counter_start
- counter_start = time.perf_counter()
- `;var e=`counter_start_fun()
- `;return e};b.Python.esp32_main_controller_time_timer_get_current=function(n){b.Python.definitions_.counter_end=`def getcounterEndStart(newDate):
- global counter_start
- return newDate - counter_start
- `;var e="getcounterEndStart(time.perf_counter())";return[e,b.Python.ORDER_CONDITIONAL]};b.Python.esp32_main_controller_time_timer_clear=function(n){var e=`del counter_start
- `;return e};b.Python.esp32_main_controller_time_period_timer=function(n){var e=n.getFieldValue("period_timer_count")*.001,t=b.Python.statementToCode(n,"exec_period_timer");b.Python.addVariable("STOPTHREAD","STOPTHREAD = False",!0),b.Python.definitions_.import_threading="import threading",b.Python.definitions_.import_time="import time";let i="";try{i=b.getMainWorkspace().variableMap.getAllVariableNames().join()}catch(o){console.log(o)}b.Python.definitions_.v831_import_thread_calsss=`def period_timer_count(n: int):
- global STOPTHREAD
- while True:
- if STOPTHREAD:
- break
- time.sleep(${e})
- thread_calsss_fun_timer()
- `,b.Python.definitions_.v831_import_thread_calsss_fun=`def thread_calsss_fun_timer():
- global ${i}
- ${t}
- `;var s=`CocoPiThread = threading.Thread(target=period_timer_count, args=(1,))
- CocoPiThread.start()
- `;return s};b.Python.esp32_main_controller_time_period_timer_clear=function(n){var e=`STOPTHREAD = True
- `;return e};b.Python.addVariable=function(n,e,t){var i=!1;if(t||b.Python.variableDB_.dbReverse_[n]===void 0){if(b.Python.definitions_[n]=e,xr&&b.Variables&&b.getMainWorkspace){const s=b.getMainWorkspace();s&&!s.getVariable(n)&&s.createVariable(n)}i=!0}return i};b.Python=Sa.pythonGenerator||{Msg:Object.create(null)};b.Python.serial_comm_print=function(n){var e=b.Python.valueToCode(n,"serial_comm_input",b.Python.ORDER_ATOMIC),t="print("+e+`)
- `;return t};b.Python.serial_write_data=function(n){var e=n.getFieldValue("uart_bps"),t=b.Python.valueToCode(this,"ADD1",b.Python.ORDER_NONE);b.Python.definitions_.v831_import_serial=`import serial
- SERIAL = serial.Serial("/dev/ttyS1",${e})
- `;var i=`uart_data = bytes(str(${t})+"\\n","utf-8")
- SERIAL.write(uart_data)
- `;return i};b.Python.serial_write_data_coco=function(n){for(var e=n.getFieldValue("uart_bps"),t="",i="",s=0;s<this.itemCount_;s++)t=b.Python.valueToCode(this,"ADD"+s,b.Python.ORDER_NONE)||"",i+="str("+t+') + "|" + ';var o=i+"";b.Python.definitions_.v831_import_serial=`import serial
- SERIAL = serial.Serial("/dev/ttyS1",${e})
- `;var r=`uart_data = bytes("SOF|"+${o.slice(0,-8)}+"|\\r\\n","utf-8")
- SERIAL.write(uart_data)
- `;return r};b.Python.serial_read_data_setup=function(n){var e=n.getFieldValue("uart_bps");b.Python.definitions_.v831_import_serial=`import serial
- SERIAL = serial.Serial("/dev/ttyS1",${e})
- `,b.Python.definitions_._read_serial_data=`def _read_serial_data(read_data,split, index):
- if read_data != None:
- read_str = ""
- try:
- read_str = str(read_data.decode("utf-8")).split(split)[index]
- except:
- read_str = str(read_data).split(split)[index]
- return read_str
- `;var t="";return t};b.Python.serial_read_data_all=function(n){var e='SERIAL.readline().decode("UTF-8","ignore").strip()';return[e,b.Python.ORDER_NONE]};b.Python.serial_read_data=function(n){var e=parseInt(n.getFieldValue("INDEX"))+1;b.Python.definitions_._read_serial_data=`def _read_serial_data(read_data,split, index):
- if read_data != None:
- read_str = ""
- try:
- read_str = str(read_data.decode("utf-8")).split(split)[index]
- except:
- read_str = str(read_data).split(split)[index]
- return read_str
- `;var t=`_read_serial_data(SERIAL.readline().decode("UTF-8","ignore").strip(),"|",${e})`;return[t,b.Python.ORDER_NONE]};b.Python.serial_send_data_to_microbit=function(n){var e=b.Python.valueToCode(n,"NAME",b.Python.ORDER_ATOMIC)||"";b.Python.definitions_["831_import_serial"]=`import serial
- SERIAL = serial.Serial("/dev/ttyS1",115200)`;var t=`uart_data = bytes(${e}+"\\n","utf-8")
- SERIAL.write(uart_data)
- `;return t};b.Python.serial_send_data_to_arduino=function(n){var e=n.getFieldValue("uart_bps"),t=b.Python.valueToCode(n,"NAME",b.Python.ORDER_ATOMIC)||"";b.Python.definitions_.v831_import_os="import os",b.Python.definitions_.v831_import_serial_ardino_read=`import serial
- SERIALPATH = "/dev/ttyUSB0" if os.path.exists("/dev/ttyUSB0") else "/dev/ttyACM0"
- SERIAL = serial.Serial(SERIALPATH,${e})`;var i=`uart_data = bytes(${t}+"\\n","utf-8")
- SERIAL.write(uart_data)
- `;return i};b.Python.serial_send_data_to_control_panel=function(n){var e=b.Python.valueToCode(n,"NAME",b.Python.ORDER_ATOMIC)||"";b.Python.definitions_["831_import_serial"]=`import serial
- SERIAL = serial.Serial("/dev/ttyS1",9600)`;var t=`uart_data = bytes(${e}+"\\n","utf-8")
- SERIAL.write(uart_data)
- `;return t};b.Python.serial_read_data_clear=function(n){var e=`SERIAL.flushInput()
- `;return e};const Txe={...Mt,...zo,...jn,...St,...Zi,...Mi,...is,...xl,...So,...xr,...xr},Cxe=ra.Theme.defineTheme("CUSTOM_THEME",{base:ra.Themes.Classic,categoryStyles:{custom_category:{colour:"#5ba5a5"}},blockStyles:{custom_text_blocks:{colourPrimary:"#5ba5a5",colourSecondary:"#5ba5a5",colourTertiary:"#C5EAFF"}},componentStyles:{workspaceBackgroundColour:"#fff",toolboxBackgroundColour:"rgba(236, 241, 247, 0.8)",toolboxForegroundColour:"#000",flyoutBackgroundColour:"#d0f0ffbf",flyoutForegroundColour:"#333",flyoutOpacity:1,scrollbarColour:"#aaa",scrollbarOpacity:.4,insertionMarkerColour:"#f5f5f5",insertionMarkerOpacity:.3,cursorColour:"#f5f5f5"}});let jK=[],Uve=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?Uve:jK).push(t=t+n[e])})();function yxe(n){if(n<768)return!1;for(let e=0,t=jK.length;;){let i=e+t>>1;if(n<jK[i])t=i;else if(n>=Uve[i])e=i+1;else return!0;if(e==t)return!1}}function kre(n){return n>=127462&&n<=127487}const Are=8205;function Exe(n,e,t=!0,i=!0){return(t?Wve:Sxe)(n,e,i)}function Wve(n,e,t){if(e==n.length)return e;e&&Gve(n.charCodeAt(e))&&zve(n.charCodeAt(e-1))&&e--;let i=hz(n,e);for(e+=Nre(i);e<n.length;){let s=hz(n,e);if(i==Are||s==Are||t&&yxe(s))e+=Nre(s),i=s;else if(kre(s)){let o=0,r=e-2;for(;r>=0&&kre(hz(n,r));)o++,r-=2;if(o%2==0)break;e+=2}else break}return e}function Sxe(n,e,t){for(;e>0;){let i=Wve(n,e-2,t);if(i<e)return i;e--}return 0}function hz(n,e){let t=n.charCodeAt(e);if(!zve(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Gve(i)?(t-55296<<10)+(i-56320)+65536:t}function Gve(n){return n>=56320&&n<57344}function zve(n){return n>=55296&&n<56320}function Nre(n){return n<65536?1:2}let Lo=class Kve{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=xO(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),mm.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=xO(this,e,t);let i=[];return this.decompose(e,t,i,0),mm.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new RD(this),o=new RD(e);for(let r=t,a=t;;){if(s.next(r),o.next(r),r=0,s.lineBreak!=o.lineBreak||s.done!=o.done||s.value!=o.value)return!1;if(a+=s.value.length,s.done||a>=i)return!0}}iter(e=1){return new RD(this,e)}iterRange(e,t=this.length){return new jve(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Xve(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Kve.empty:e.length<=32?new bl(e):mm.from(bl.split(e,[]))}};class bl extends Lo{constructor(e,t=wxe(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let o=0;;o++){let r=this.text[o],a=s+r.length;if((t?i:a)>=e)return new Ixe(s,a,i,r);s=a+1,i++}}decompose(e,t,i,s){let o=e<=0&&t>=this.length?this:new bl(Dre(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let r=i.pop(),a=iU(o.text,r.text.slice(),0,o.length);if(a.length<=32)i.push(new bl(a,r.length+o.length));else{let c=a.length>>1;i.push(new bl(a.slice(0,c)),new bl(a.slice(c)))}}else i.push(o)}replace(e,t,i){if(!(i instanceof bl))return super.replace(e,t,i);[e,t]=xO(this,e,t);let s=iU(this.text,iU(i.text,Dre(this.text,0,e)),t),o=this.length+i.length-(t-e);return s.length<=32?new bl(s,o):mm.from(bl.split(s,[]),o)}sliceString(e,t=this.length,i=`
- `){[e,t]=xO(this,e,t);let s="";for(let o=0,r=0;o<=t&&r<this.text.length;r++){let a=this.text[r],c=o+a.length;o>e&&r&&(s+=i),e<c&&t>o&&(s+=a.slice(Math.max(0,e-o),t-o)),o=c+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let o of e)i.push(o),s+=o.length+1,i.length==32&&(t.push(new bl(i,s)),i=[],s=-1);return s>-1&&t.push(new bl(i,s)),t}}class mm extends Lo{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let o=0;;o++){let r=this.children[o],a=s+r.length,c=i+r.lines-1;if((t?c:a)>=e)return r.lineInner(e,t,i,s);s=a+1,i=c+1}}decompose(e,t,i,s){for(let o=0,r=0;r<=t&&o<this.children.length;o++){let a=this.children[o],c=r+a.length;if(e<=c&&t>=r){let u=s&((r<=e?1:0)|(c>=t?2:0));r>=e&&c<=t&&!u?i.push(a):a.decompose(e-r,t-r,i,u)}r=c+1}}replace(e,t,i){if([e,t]=xO(this,e,t),i.lines<this.lines)for(let s=0,o=0;s<this.children.length;s++){let r=this.children[s],a=o+r.length;if(e>=o&&t<=a){let c=r.replace(e-o,t-o,i),u=this.lines-r.lines+c.lines;if(c.lines<u>>4&&c.lines>u>>6){let d=this.children.slice();return d[s]=c,new mm(d,this.length-(t-e)+i.length)}return super.replace(o,a,c)}o=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
- `){[e,t]=xO(this,e,t);let s="";for(let o=0,r=0;o<this.children.length&&r<=t;o++){let a=this.children[o],c=r+a.length;r>e&&o&&(s+=i),e<c&&t>r&&(s+=a.sliceString(e-r,t-r,i)),r=c+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof mm))return 0;let i=0,[s,o,r,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,o+=t){if(s==r||o==a)return i;let c=this.children[s],u=e.children[o];if(c!=u)return i+c.scanIdentical(u,t);i+=c.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let p of e)i+=p.lines;if(i<32){let p=[];for(let _ of e)_.flatten(p);return new bl(p,t)}let s=Math.max(32,i>>5),o=s<<1,r=s>>1,a=[],c=0,u=-1,d=[];function f(p){let _;if(p.lines>o&&p instanceof mm)for(let v of p.children)f(v);else p.lines>r&&(c>r||!c)?(g(),a.push(p)):p instanceof bl&&c&&(_=d[d.length-1])instanceof bl&&p.lines+_.lines<=32?(c+=p.lines,u+=p.length+1,d[d.length-1]=new bl(_.text.concat(p.text),_.length+1+p.length)):(c+p.lines>s&&g(),c+=p.lines,u+=p.length+1,d.push(p))}function g(){c!=0&&(a.push(d.length==1?d[0]:mm.from(d,u)),u=-1,c=d.length=0)}for(let p of e)f(p);return g(),a.length==1?a[0]:new mm(a,t)}}Lo.empty=new bl([""],0);function wxe(n){let e=-1;for(let t of n)e+=t.length+1;return e}function iU(n,e,t=0,i=1e9){for(let s=0,o=0,r=!0;o<n.length&&s<=i;o++){let a=n[o],c=s+a.length;c>=t&&(c>i&&(a=a.slice(0,i-s)),s<t&&(a=a.slice(t-s)),r?(e[e.length-1]+=a,r=!1):e.push(a)),s=c+1}return e}function Dre(n,e,t){return iU(n,[""],e,t)}class RD{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof bl?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],o=this.offsets[i],r=o>>1,a=s instanceof bl?s.text.length:s.children.length;if(r==(t>0?a:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
- `,this;e--}else if(s instanceof bl){let c=s.text[r+(t<0?-1:0)];if(this.offsets[i]+=t,c.length>Math.max(0,e))return this.value=e==0?c:t>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[r+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof bl?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class jve{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new RD(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Xve{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Lo.prototype[Symbol.iterator]=function(){return this.iter()},RD.prototype[Symbol.iterator]=jve.prototype[Symbol.iterator]=Xve.prototype[Symbol.iterator]=function(){return this});class Ixe{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function xO(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function sc(n,e,t=!0,i=!0){return Exe(n,e,t,i)}function Lxe(n){return n>=56320&&n<57344}function Oxe(n){return n>=55296&&n<56320}function dd(n,e){let t=n.charCodeAt(e);if(!Oxe(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Lxe(i)?(t-55296<<10)+(i-56320)+65536:t}function HZ(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function _m(n){return n<65536?1:2}const XK=/\r\n?|\n/;var wu=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(wu||(wu={}));class Dm{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let o=this.sections[t++],r=this.sections[t++];r<0?(e(i,s,o),s+=o):s+=r,i+=o}}iterChangedRanges(e,t=!1){YK(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new Dm(e)}composeDesc(e){return this.empty?e:e.empty?this:Yve(this,e)}mapDesc(e,t=!1){return e.empty?this:qK(this,e,t)}mapPos(e,t=-1,i=wu.Simple){let s=0,o=0;for(let r=0;r<this.sections.length;){let a=this.sections[r++],c=this.sections[r++],u=s+a;if(c<0){if(u>e)return o+(e-s);o+=a}else{if(i!=wu.Simple&&u>=e&&(i==wu.TrackDel&&s<e&&u>e||i==wu.TrackBefore&&s<e||i==wu.TrackAfter&&u>e))return null;if(u>e||u==e&&t<0&&!a)return e==s||t<0?o:o+c;o+=c}s=u}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return o}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let o=this.sections[i++],r=this.sections[i++],a=s+o;if(r>=0&&s<=t&&a>=e)return s<e&&a>t?"cover":!0;s=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Dm(e)}static create(e){return new Dm(e)}}class da extends Dm{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return YK(this,(t,i,s,o,r)=>e=e.replace(s,s+(i-t),r),!1),e}mapDesc(e,t=!1){return qK(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,o=0;s<t.length;s+=2){let r=t[s],a=t[s+1];if(a>=0){t[s]=a,t[s+1]=r;let c=s>>1;for(;i.length<c;)i.push(Lo.empty);i.push(r?e.slice(o,o+r):Lo.empty)}o+=r}return new da(t,i)}compose(e){return this.empty?e:e.empty?this:Yve(this,e,!0)}map(e,t=!1){return e.empty?this:qK(this,e,t,!0)}iterChanges(e,t=!1){YK(this,e,t)}get desc(){return Dm.create(this.sections)}filter(e){let t=[],i=[],s=[],o=new A$(this);e:for(let r=0,a=0;;){let c=r==e.length?1e9:e[r++];for(;a<c||a==c&&o.len==0;){if(o.done)break e;let d=Math.min(o.len,c-a);Pc(s,d,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;Pc(t,d,f),f>0&&hC(i,t,o.text),o.forward(d),a+=d}let u=e[r++];for(;a<u;){if(o.done)break e;let d=Math.min(o.len,u-a);Pc(t,d,-1),Pc(s,d,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(d),a+=d}}return{changes:new da(t,i),filtered:Dm.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],o=[],r=0,a=null;function c(d=!1){if(!d&&!s.length)return;r<t&&Pc(s,t-r,-1);let f=new da(s,o);a=a?a.compose(f.map(a)):f,s=[],o=[],r=0}function u(d){if(Array.isArray(d))for(let f of d)u(f);else if(d instanceof da){if(d.length!=t)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${t})`);c(),a=a?a.compose(d.map(a)):d}else{let{from:f,to:g=f,insert:p}=d;if(f>g||f<0||g>t)throw new RangeError(`Invalid change range ${f} to ${g} (in doc of length ${t})`);let _=p?typeof p=="string"?Lo.of(p.split(i||XK)):p:Lo.empty,v=_.length;if(f==g&&v==0)return;f<r&&c(),f>r&&Pc(s,f-r,-1),Pc(s,g-f,v),hC(o,s,_),r=g}}return u(e),c(!a),a}static empty(e){return new da(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let o=e[s];if(typeof o=="number")t.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((r,a)=>a&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;i.length<s;)i.push(Lo.empty);i[s]=Lo.of(o.slice(1)),t.push(o[0],i[s].length)}}}return new da(t,i)}static createSet(e,t){return new da(e,t)}}function Pc(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function hC(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Lo.empty);n.push(t)}}function YK(n,e,t){let i=n.inserted;for(let s=0,o=0,r=0;r<n.sections.length;){let a=n.sections[r++],c=n.sections[r++];if(c<0)s+=a,o+=a;else{let u=s,d=o,f=Lo.empty;for(;u+=a,d+=c,c&&i&&(f=f.append(i[r-2>>1])),!(t||r==n.sections.length||n.sections[r+1]<0);)a=n.sections[r++],c=n.sections[r++];e(s,u,o,d,f),s=u,o=d}}}function qK(n,e,t,i=!1){let s=[],o=i?[]:null,r=new A$(n),a=new A$(e);for(let c=-1;;){if(r.done&&a.len||a.done&&r.len)throw new Error("Mismatched change set lengths");if(r.ins==-1&&a.ins==-1){let u=Math.min(r.len,a.len);Pc(s,u,-1),r.forward(u),a.forward(u)}else if(a.ins>=0&&(r.ins<0||c==r.i||r.off==0&&(a.len<r.len||a.len==r.len&&!t))){let u=a.len;for(Pc(s,a.ins,-1);u;){let d=Math.min(r.len,u);r.ins>=0&&c<r.i&&r.len<=d&&(Pc(s,0,r.ins),o&&hC(o,s,r.text),c=r.i),r.forward(d),u-=d}a.next()}else if(r.ins>=0){let u=0,d=r.len;for(;d;)if(a.ins==-1){let f=Math.min(d,a.len);u+=f,d-=f,a.forward(f)}else if(a.ins==0&&a.len<d)d-=a.len,a.next();else break;Pc(s,u,c<r.i?r.ins:0),o&&c<r.i&&hC(o,s,r.text),c=r.i,r.forward(r.len-d)}else{if(r.done&&a.done)return o?da.createSet(s,o):Dm.create(s);throw new Error("Mismatched change set lengths")}}}function Yve(n,e,t=!1){let i=[],s=t?[]:null,o=new A$(n),r=new A$(e);for(let a=!1;;){if(o.done&&r.done)return s?da.createSet(i,s):Dm.create(i);if(o.ins==0)Pc(i,o.len,0,a),o.next();else if(r.len==0&&!r.done)Pc(i,0,r.ins,a),s&&hC(s,i,r.text),r.next();else{if(o.done||r.done)throw new Error("Mismatched change set lengths");{let c=Math.min(o.len2,r.len),u=i.length;if(o.ins==-1){let d=r.ins==-1?-1:r.off?0:r.ins;Pc(i,c,d,a),s&&d&&hC(s,i,r.text)}else r.ins==-1?(Pc(i,o.off?0:o.len,c,a),s&&hC(s,i,o.textBit(c))):(Pc(i,o.off?0:o.len,r.off?0:r.ins,a),s&&!r.off&&hC(s,i,r.text));a=(o.ins>c||r.ins>=0&&r.len>c)&&(a||i.length>u),o.forward2(c),r.forward(c)}}}}class A${constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Lo.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Lo.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class FS{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new FS(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return rn.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return rn.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return rn.range(e.anchor,e.head)}static create(e,t,i){return new FS(e,t,i)}}class rn{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:rn.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new rn([this.main],0)}addRange(e,t=!0){return rn.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,rn.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new rn(e.ranges.map(t=>FS.fromJSON(t)),e.main)}static single(e,t=e){return new rn([rn.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let o=e[s];if(o.empty?o.from<=i:o.from<i)return rn.normalized(e.slice(),t);i=o.to}return new rn(e,t)}static cursor(e,t=0,i,s){return FS.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(e,t,i,s){let o=(i??16777215)<<6|(s==null?7:Math.min(6,s));return t<e?FS.create(t,e,48|o):FS.create(e,t,(t>e?8:0)|o)}static normalized(e,t=0){let i=e[t];e.sort((s,o)=>s.from-o.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let o=e[s],r=e[s-1];if(o.empty?o.from<=r.to:o.from<r.to){let a=r.from,c=Math.max(o.to,r.to);s<=t&&t--,e.splice(--s,2,o.anchor>o.head?rn.range(c,a):rn.range(a,c))}}return new rn(e,t)}}function qve(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let VZ=0;class oi{constructor(e,t,i,s,o){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=VZ++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new oi(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:UZ),!!e.static,e.enables)}of(e){return new sU([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new sU(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new sU(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function UZ(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class sU{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=VZ++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,o=this.id,r=e[o]>>1,a=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||d.push(e[f.id]);return{create(f){return f.values[r]=i(f),1},update(f,g){if(c&&g.docChanged||u&&(g.docChanged||g.selection)||JK(f,d)){let p=i(f);if(a?!$re(p,f.values[r],s):!s(p,f.values[r]))return f.values[r]=p,1}return 0},reconfigure:(f,g)=>{let p,_=g.config.address[o];if(_!=null){let v=H4(g,_);if(this.dependencies.every(C=>C instanceof oi?g.facet(C)===f.facet(C):C instanceof hc?g.field(C,!1)==f.field(C,!1):!0)||(a?$re(p=i(f),v,s):s(p=i(f),v)))return f.values[r]=v,0}else p=i(f);return f.values[r]=p,1}}}}function $re(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function JK(n,e){let t=!1;for(let i of e)MD(n,i)&1&&(t=!0);return t}function Rxe(n,e,t){let i=t.map(c=>n[c.id]),s=t.map(c=>c.type),o=i.filter(c=>!(c&1)),r=n[e.id]>>1;function a(c){let u=[];for(let d=0;d<i.length;d++){let f=H4(c,i[d]);if(s[d]==2)for(let g of f)u.push(g);else u.push(f)}return e.combine(u)}return{create(c){for(let u of i)MD(c,u);return c.values[r]=a(c),1},update(c,u){if(!JK(c,o))return 0;let d=a(c);return e.compare(d,c.values[r])?0:(c.values[r]=d,1)},reconfigure(c,u){let d=JK(c,i),f=u.config.facets[e.id],g=u.facet(e);if(f&&!d&&UZ(t,f))return c.values[r]=g,0;let p=a(c);return e.compare(p,g)?(c.values[r]=g,0):(c.values[r]=p,1)}}}const xre=oi.define({static:!0});class hc{constructor(e,t,i,s,o){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=o,this.provides=void 0}static define(e){let t=new hc(VZ++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(xre).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let o=i.values[t],r=this.updateF(o,s);return this.compareF(o,r)?0:(i.values[t]=r,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,xre.of({field:this,create:e})]}get extension(){return this}}const yS={lowest:4,low:3,default:2,high:1,highest:0};function _N(n){return e=>new Jve(e,n)}const Mw={highest:_N(yS.highest),high:_N(yS.high),default:_N(yS.default),low:_N(yS.low),lowest:_N(yS.lowest)};class Jve{constructor(e,t){this.inner=e,this.prec=t}}class zP{of(e){return new QK(this,e)}reconfigure(e){return zP.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class QK{constructor(e,t){this.compartment=e,this.inner=t}}let Pre=class Qve{constructor(e,t,i,s,o,r){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=o,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],o=Object.create(null),r=new Map;for(let g of Mxe(e,t,r))g instanceof hc?s.push(g):(o[g.facet.id]||(o[g.facet.id]=[])).push(g);let a=Object.create(null),c=[],u=[];for(let g of s)a[g.id]=u.length<<1,u.push(p=>g.slot(p));let d=i==null?void 0:i.config.facets;for(let g in o){let p=o[g],_=p[0].facet,v=d&&d[g]||[];if(p.every(C=>C.type==0))if(a[_.id]=c.length<<1|1,UZ(v,p))c.push(i.facet(_));else{let C=_.combine(p.map(y=>y.value));c.push(i&&_.compare(C,i.facet(_))?i.facet(_):C)}else{for(let C of p)C.type==0?(a[C.id]=c.length<<1|1,c.push(C.value)):(a[C.id]=u.length<<1,u.push(y=>C.dynamicSlot(y)));a[_.id]=u.length<<1,u.push(C=>Rxe(C,_,p))}}let f=u.map(g=>g(a));return new Qve(e,r,f,a,c,o)}};function Mxe(n,e,t){let i=[[],[],[],[],[]],s=new Map;function o(r,a){let c=s.get(r);if(c!=null){if(c<=a)return;let u=i[c].indexOf(r);u>-1&&i[c].splice(u,1),r instanceof QK&&t.delete(r.compartment)}if(s.set(r,a),Array.isArray(r))for(let u of r)o(u,a);else if(r instanceof QK){if(t.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(r.compartment)||r.inner;t.set(r.compartment,u),o(u,a)}else if(r instanceof Jve)o(r.inner,r.prec);else if(r instanceof hc)i[a].push(r),r.provides&&o(r.provides,a);else if(r instanceof sU)i[a].push(r),r.facet.extensions&&o(r.facet.extensions,yS.default);else{let u=r.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(u,a)}}return o(n,yS.default),i.reduce((r,a)=>r.concat(a))}function MD(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function H4(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Zve=oi.define(),ZK=oi.define({combine:n=>n.some(e=>e),static:!0}),ebe=oi.define({combine:n=>n.length?n[0]:void 0,static:!0}),tbe=oi.define(),nbe=oi.define(),ibe=oi.define(),sbe=oi.define({combine:n=>n.length?n[0]:!1});class yb{constructor(e,t){this.type=e,this.value=t}static define(){return new kxe}}class kxe{of(e){return new yb(this,e)}}class Axe{constructor(e){this.map=e}of(e){return new ls(this,e)}}class ls{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new ls(this.type,t)}is(e){return this.type==e}static define(e={}){return new Axe(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let o=s.map(t);o&&i.push(o)}return i}}ls.reconfigure=ls.define();ls.appendConfig=ls.define();class pa{constructor(e,t,i,s,o,r){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=o,this.scrollIntoView=r,this._doc=null,this._state=null,i&&qve(i,t.newLength),o.some(a=>a.type==pa.time)||(this.annotations=o.concat(pa.time.of(Date.now())))}static create(e,t,i,s,o,r){return new pa(e,t,i,s,o,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(pa.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}pa.time=yb.define();pa.userEvent=yb.define();pa.addToHistory=yb.define();pa.remote=yb.define();function Nxe(n,e){let t=[];for(let i=0,s=0;;){let o,r;if(i<n.length&&(s==e.length||e[s]>=n[i]))o=n[i++],r=n[i++];else if(s<e.length)o=e[s++],r=e[s++];else return t;!t.length||t[t.length-1]<o?t.push(o,r):t[t.length-1]<r&&(t[t.length-1]=r)}}function obe(n,e,t){var i;let s,o,r;return t?(s=e.changes,o=da.empty(e.changes.length),r=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),o=n.changes.mapDesc(e.changes,!0),r=n.changes.compose(s)),{changes:r,selection:e.selection?e.selection.map(o):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:ls.mapEffects(n.effects,s).concat(ls.mapEffects(e.effects,o)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ej(n,e,t){let i=e.selection,s=iO(e.annotations);return e.userEvent&&(s=s.concat(pa.userEvent.of(e.userEvent))),{changes:e.changes instanceof da?e.changes:da.of(e.changes||[],t,n.facet(ebe)),selection:i&&(i instanceof rn?i:rn.single(i.anchor,i.head)),effects:iO(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function rbe(n,e,t){let i=ej(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(t=!1);let r=!!e[o].sequential;i=obe(i,ej(n,e[o],r?i.changes.newLength:n.doc.length),r)}let s=pa.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return $xe(t?Dxe(s):s)}function Dxe(n){let e=n.startState,t=!0;for(let s of e.facet(tbe)){let o=s(n);if(o===!1){t=!1;break}Array.isArray(o)&&(t=t===!0?o:Nxe(t,o))}if(t!==!0){let s,o;if(t===!1)o=n.changes.invertedDesc,s=da.empty(e.doc.length);else{let r=n.changes.filter(t);s=r.changes,o=r.filtered.mapDesc(r.changes).invertedDesc}n=pa.create(e,s,n.selection&&n.selection.map(o),ls.mapEffects(n.effects,o),n.annotations,n.scrollIntoView)}let i=e.facet(nbe);for(let s=i.length-1;s>=0;s--){let o=i[s](n);o instanceof pa?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof pa?n=o[0]:n=rbe(e,iO(o),!1)}return n}function $xe(n){let e=n.startState,t=e.facet(ibe),i=n;for(let s=t.length-1;s>=0;s--){let o=t[s](n);o&&Object.keys(o).length&&(i=obe(i,ej(e,o,n.changes.newLength),!0))}return i==n?n:pa.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const xxe=[];function iO(n){return n==null?xxe:Array.isArray(n)?n:[n]}var Pr=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Pr||(Pr={}));const Pxe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let tj;try{tj=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Fxe(n){if(tj)return tj.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Pxe.test(t)))return!0}return!1}function Bxe(n){return e=>{if(!/\S/.test(e))return Pr.Space;if(Fxe(e))return Pr.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Pr.Word;return Pr.Other}}let Rr=class Tg{constructor(e,t,i,s,o,r){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=o,r&&(r._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)MD(this,a<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return MD(this,i),H4(this,i)}update(...e){return rbe(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let a of e.effects)a.is(zP.reconfigure)?(t&&(s=new Map,t.compartments.forEach((c,u)=>s.set(u,c)),t=null),s.set(a.value.compartment,a.value.extension)):a.is(ls.reconfigure)?(t=null,i=a.value):a.is(ls.appendConfig)&&(t=null,i=iO(i).concat(a.value));let o;t?o=e.startState.values.slice():(t=Pre.resolve(i,s,this),o=new Tg(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let r=e.startState.facet(ZK)?e.newSelection:e.newSelection.asSingle();new Tg(t,e.newDoc,r,o,(a,c)=>c.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:rn.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),o=[i.range],r=iO(i.effects);for(let a=1;a<t.ranges.length;a++){let c=e(t.ranges[a]),u=this.changes(c.changes),d=u.map(s);for(let g=0;g<a;g++)o[g]=o[g].map(d);let f=s.mapDesc(u,!0);o.push(c.range.map(f)),s=s.compose(d),r=ls.mapEffects(r,d).concat(ls.mapEffects(iO(c.effects),f))}return{changes:s,selection:rn.create(o,t.mainIndex),effects:r}}changes(e=[]){return e instanceof da?e:da.of(e,this.doc.length,this.facet(Tg.lineSeparator))}toText(e){return Lo.of(e.split(this.facet(Tg.lineSeparator)||XK))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(MD(this,t),H4(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof hc&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(e,o)){let r=i[o],a=e[o];s.push(r.init(c=>r.spec.fromJSON(a,c)))}}return Tg.create({doc:e.doc,selection:rn.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Pre.resolve(e.extensions||[],new Map),i=e.doc instanceof Lo?e.doc:Lo.of((e.doc||"").split(t.staticFacet(Tg.lineSeparator)||XK)),s=e.selection?e.selection instanceof rn?e.selection:rn.single(e.selection.anchor,e.selection.head):rn.single(0);return qve(s,i.length),t.staticFacet(ZK)||(s=s.asSingle()),new Tg(t,i,s,t.dynamicSlots.map(()=>null),(o,r)=>r.create(o),null)}get tabSize(){return this.facet(Tg.tabSize)}get lineBreak(){return this.facet(Tg.lineSeparator)||`
- `}get readOnly(){return this.facet(sbe)}phrase(e,...t){for(let i of this.facet(Tg.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let o=+(s||1);return!o||o>t.length?i:t[o-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let o of this.facet(Zve))for(let r of o(this,t,i))Object.prototype.hasOwnProperty.call(r,e)&&s.push(r[e]);return s}charCategorizer(e){return Bxe(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),o=this.charCategorizer(e),r=e-i,a=e-i;for(;r>0;){let c=sc(t,r,!1);if(o(t.slice(c,r))!=Pr.Word)break;r=c}for(;a<s;){let c=sc(t,a);if(o(t.slice(a,c))!=Pr.Word)break;a=c}return r==a?null:rn.range(r+i,a+i)}};Rr.allowMultipleSelections=ZK;Rr.tabSize=oi.define({combine:n=>n.length?n[0]:4});Rr.lineSeparator=ebe;Rr.readOnly=sbe;Rr.phrases=oi.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});Rr.languageData=Zve;Rr.changeFilter=tbe;Rr.transactionFilter=nbe;Rr.transactionExtender=ibe;zP.reconfigure=ls.define();function o_(n,e,t={}){let i={};for(let s of n)for(let o of Object.keys(s)){let r=s[o],a=i[o];if(a===void 0)i[o]=r;else if(!(a===r||r===void 0))if(Object.hasOwnProperty.call(t,o))i[o]=t[o](a,r);else throw new Error("Config merge conflict for field "+o)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class k0{eq(e){return this==e}range(e,t=e){return nj.create(e,t,this)}}k0.prototype.startSide=k0.prototype.endSide=0;k0.prototype.point=!1;k0.prototype.mapMode=wu.TrackDel;let nj=class lbe{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new lbe(e,t,i)}};function ij(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class WZ{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let o=i?this.to:this.from;for(let r=s,a=o.length;;){if(r==a)return r;let c=r+a>>1,u=o[c]-e||(i?this.value[c].endSide:this.value[c].startSide)-t;if(c==r)return u>=0?r:a;u>=0?a=c:r=c+1}}between(e,t,i,s){for(let o=this.findIndex(t,-1e9,!0),r=this.findIndex(i,1e9,!1,o);o<r;o++)if(s(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,t){let i=[],s=[],o=[],r=-1,a=-1;for(let c=0;c<this.value.length;c++){let u=this.value[c],d=this.from[c]+e,f=this.to[c]+e,g,p;if(d==f){let _=t.mapPos(d,u.startSide,u.mapMode);if(_==null||(g=p=_,u.startSide!=u.endSide&&(p=t.mapPos(d,u.endSide),p<g)))continue}else if(g=t.mapPos(d,u.startSide),p=t.mapPos(f,u.endSide),g>p||g==p&&u.startSide>0&&u.endSide<=0)continue;(p-g||u.endSide-u.startSide)<0||(r<0&&(r=g),u.point&&(a=Math.max(a,p-g)),i.push(u),s.push(g-r),o.push(p-r))}return{mapped:i.length?new WZ(s,o,i,a):null,pos:r}}}class oo{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new oo(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:o=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(i&&(t=t.slice().sort(ij)),this.isEmpty)return t.length?oo.of(t):this;let a=new abe(this,null,-1).goto(0),c=0,u=[],d=new sb;for(;a.value||c<t.length;)if(c<t.length&&(a.from-t[c].from||a.startSide-t[c].value.startSide)>=0){let f=t[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(c==t.length||this.chunkEnd(a.chunkIndex)<t[c].from)&&(!r||s>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&d.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!r||s>a.to||o<a.from||r(a.from,a.to,a.value))&&(d.addInner(a.from,a.to,a.value)||u.push(nj.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!u.length?oo.empty:this.nextLayer.update({add:u,filter:r,filterFrom:s,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let r=0;r<this.chunk.length;r++){let a=this.chunkPos[r],c=this.chunk[r],u=e.touchesRange(a,a+c.length);if(u===!1)s=Math.max(s,c.maxPoint),t.push(c),i.push(e.mapPos(a));else if(u===!0){let{mapped:d,pos:f}=c.map(a,e);d&&(s=Math.max(s,d.maxPoint),t.push(d),i.push(f))}}let o=this.nextLayer.map(e);return t.length==0?o:new oo(i,t,o||oo.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let o=this.chunkPos[s],r=this.chunk[s];if(t>=o&&e<=o+r.length&&r.between(o,e-o,t-o,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return N$.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return N$.from(e).goto(t)}static compare(e,t,i,s,o=-1){let r=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),c=Fre(r,a,i),u=new vN(r,c,o),d=new vN(a,c,o);i.iterGaps((f,g,p)=>Bre(u,f,d,g,p,s)),i.empty&&i.length==0&&Bre(u,0,d,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=999999999);let o=e.filter(d=>!d.isEmpty&&t.indexOf(d)<0),r=t.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(o.length!=r.length)return!1;if(!o.length)return!0;let a=Fre(o,r),c=new vN(o,a,0).goto(i),u=new vN(r,a,0).goto(i);for(;;){if(c.to!=u.to||!sj(c.active,u.active)||c.point&&(!u.point||!c.point.eq(u.point)))return!1;if(c.to>s)return!0;c.next(),u.next()}}static spans(e,t,i,s,o=-1){let r=new vN(e,null,o).goto(t),a=t,c=r.openStart;for(;;){let u=Math.min(r.to,i);if(r.point){let d=r.activeForPoint(r.to),f=r.pointFrom<t?d.length+1:r.point.startSide<0?d.length:Math.min(d.length,c);s.point(a,u,r.point,d,f,r.pointRank),c=Math.min(r.openEnd(u),d.length)}else u>a&&(s.span(a,u,r.active,c),c=r.openEnd(u));if(r.to>i)return c+(r.point&&r.to>i?1:0);a=r.to,r.next()}}static of(e,t=!1){let i=new sb;for(let s of e instanceof nj?[e]:t?Hxe(e):e)i.add(s.from,s.to,s.value);return i.finish()}static join(e){if(!e.length)return oo.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let s=e[i];s!=oo.empty;s=s.nextLayer)t=new oo(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}oo.empty=new oo([],[],null,-1);function Hxe(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(ij(e,i)>0)return n.slice().sort(ij);e=i}return n}oo.empty.nextLayer=oo.empty;class sb{finishChunk(e){this.chunks.push(new WZ(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new sb)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(oo.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=oo.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Fre(n,e,t){let i=new Map;for(let o of n)for(let r=0;r<o.chunk.length;r++)o.chunk[r].maxPoint<=0&&i.set(o.chunk[r],o.chunkPos[r]);let s=new Set;for(let o of e)for(let r=0;r<o.chunk.length;r++){let a=i.get(o.chunk[r]);a!=null&&(t?t.mapPos(a):a)==o.chunkPos[r]&&!(t!=null&&t.touchesRange(a,a+o.chunk[r].length))&&s.add(o.chunk[r])}return s}class abe{constructor(e,t,i,s=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class N${constructor(e){this.heap=e}static from(e,t=null,i=-1){let s=[];for(let o=0;o<e.length;o++)for(let r=e[o];!r.isEmpty;r=r.nextLayer)r.maxPoint>=i&&s.push(new abe(r,t,i,o));return s.length==1?s[0]:new N$(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)fz(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)fz(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),fz(this.heap,0)}}}function fz(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1<n.length&&s.compare(n[i+1])>=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class vN{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=N$.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){XB(this.active,e),XB(this.activeTo,e),XB(this.activeRank,e),this.minActive=Hre(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||s-this.activeTo[t])>0;)t++;YB(this.active,t,i),YB(this.activeTo,t,s),YB(this.activeRank,t,o),e&&YB(e,t,this.cursor.from),this.minActive=Hre(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&XB(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let s=i.length-1;s>=0&&i[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Bre(n,e,t,i,s,o){n.goto(e),t.goto(i);let r=i+s,a=i,c=i-e;for(;;){let u=n.to+c-t.to,d=u||n.endSide-t.endSide,f=d<0?n.to+c:t.to,g=Math.min(f,r);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&sj(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(a,g,n.point,t.point):g>a&&!sj(n.active,t.active)&&o.compareRange(a,g,n.active,t.active),f>r)break;(u||n.openEnd!=t.openEnd)&&o.boundChange&&o.boundChange(f),a=f,d<=0&&n.next(),d>=0&&t.next()}}function sj(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function XB(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function YB(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function Hre(n,e){let t=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||n[s].endSide-n[t].endSide)<0&&(t=s,i=e[s]);return t}function YR(n,e,t=n.length){let i=0;for(let s=0;s<t;)n.charCodeAt(s)==9?(i+=e-i%e,s++):(i++,s=sc(n,s));return i}function oj(n,e,t,i){for(let s=0,o=0;;){if(o>=e)return s;if(s==n.length)break;o+=n.charCodeAt(s)==9?t-o%t:1,s=sc(n,s)}return i===!0?-1:n.length}const rj="ͼ",Vre=typeof Symbol>"u"?"__"+rj:Symbol.for(rj),lj=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ure=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class zC{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(r){return/^@/.test(r)?[r]:r.split(/,\s*/)}function o(r,a,c,u){let d=[],f=/^@(\w+)\b/.exec(r[0]),g=f&&f[1]=="keyframes";if(f&&a==null)return c.push(r[0]+";");for(let p in a){let _=a[p];if(/&/.test(p))o(p.split(/,\s*/).map(v=>r.map(C=>v.replace(/&/,C))).reduce((v,C)=>v.concat(C)),_,c);else if(_&&typeof _=="object"){if(!f)throw new RangeError("The value of a property ("+p+") should be a primitive value.");o(s(p),_,d,g)}else _!=null&&d.push(p.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+_+";")}(d.length||g)&&c.push((i&&!f&&!u?r.map(i):r).join(", ")+" {"+d.join(" ")+"}")}for(let r in e)o(s(r),e[r],this.rules)}getRules(){return this.rules.join(`
- `)}static newName(){let e=Ure[Vre]||1;return Ure[Vre]=e+1,rj+e.toString(36)}static mount(e,t,i){let s=e[lj],o=i&&i.nonce;s?o&&s.setNonce(o):s=new Vxe(e,o),s.mount(Array.isArray(t)?t:[t],e)}}let Wre=new Map;class Vxe{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let o=Wre.get(i);if(o)return e[lj]=o;this.sheet=new s.CSSStyleSheet,Wre.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[lj]=this}mount(e,t){let i=this.sheet,s=0,o=0;for(let r=0;r<e.length;r++){let a=e[r],c=this.modules.indexOf(a);if(c<o&&c>-1&&(this.modules.splice(c,1),o--,c=-1),c==-1){if(this.modules.splice(o++,0,a),i)for(let u=0;u<a.rules.length;u++)i.insertRule(a.rules[u],s++)}else{for(;o<c;)s+=this.modules[o++].rules.length;s+=a.rules.length,o++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let r="";for(let c=0;c<this.modules.length;c++)r+=this.modules[c].getRules()+`
- `;this.styleTag.textContent=r;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var KC={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},D$={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Uxe=typeof navigator<"u"&&/Mac/.test(navigator.platform),Wxe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var nc=0;nc<10;nc++)KC[48+nc]=KC[96+nc]=String(nc);for(var nc=1;nc<=24;nc++)KC[nc+111]="F"+nc;for(var nc=65;nc<=90;nc++)KC[nc]=String.fromCharCode(nc+32),D$[nc]=String.fromCharCode(nc);for(var gz in KC)D$.hasOwnProperty(gz)||(D$[gz]=KC[gz]);function Gxe(n){var e=Uxe&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Wxe&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?D$:KC)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function $$(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function aj(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function oU(n,e){if(!e.anchorNode)return!1;try{return aj(n,e.anchorNode)}catch{return!1}}function PO(n){return n.nodeType==3?N0(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function kD(n,e,t,i){return t?Gre(n,e,t,i,-1)||Gre(n,e,t,i,1):!1}function A0(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function V4(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function Gre(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Um(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=A0(n)+(s<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?Um(n):0}else return!1}}function Um(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function KP(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function zxe(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function cbe(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Kxe(n,e,t,i,s,o,r,a){let c=n.ownerDocument,u=c.defaultView||window;for(let d=n,f=!1;d&&!f;)if(d.nodeType==1){let g,p=d==c.body,_=1,v=1;if(p)g=zxe(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:_,scaleY:v}=cbe(d,w)),g={left:w.left,right:w.left+d.clientWidth*_,top:w.top,bottom:w.top+d.clientHeight*v}}let C=0,y=0;if(s=="nearest")e.top<g.top?(y=-(g.top-e.top+r),t>0&&e.bottom>g.bottom+y&&(y=e.bottom-g.bottom+y+r)):e.bottom>g.bottom&&(y=e.bottom-g.bottom+r,t<0&&e.top-y<g.top&&(y=-(g.top+y-e.top+r)));else{let w=e.bottom-e.top,I=g.bottom-g.top;y=(s=="center"&&w<=I?e.top+w/2-I/2:s=="start"||s=="center"&&t<0?e.top-r:e.bottom-I+r)-g.top}if(i=="nearest"?e.left<g.left?(C=-(g.left-e.left+o),t>0&&e.right>g.right+C&&(C=e.right-g.right+C+o)):e.right>g.right&&(C=e.right-g.right+o,t<0&&e.left<g.left+C&&(C=-(g.left+C-e.left+o))):C=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==a?e.left-o:e.right-(g.right-g.left)+o)-g.left,C||y)if(p)u.scrollBy(C,y);else{let w=0,I=0;if(y){let L=d.scrollTop;d.scrollTop+=y/v,I=(d.scrollTop-L)*v}if(C){let L=d.scrollLeft;d.scrollLeft+=C/_,w=(d.scrollLeft-L)*_}e={left:e.left-w,top:e.top-I,right:e.right-w,bottom:e.bottom-I},w&&Math.abs(w-C)<1&&(i="nearest"),I&&Math.abs(I-y)<1&&(s="nearest")}if(p)break;d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function jxe(n){let e=n.ownerDocument,t,i;for(let s=n.parentNode;s&&!(s==e.body||t&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:i}}class Xxe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Um(t):0),i,Math.min(e.focusOffset,i?Um(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let GL=null;function ube(n){if(n.setActive)return n.setActive();if(GL)return n.focus(GL);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(GL==null?{get preventScroll(){return GL={preventScroll:!0},!0}}:void 0),!GL){GL=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],o=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=o&&(i.scrollLeft=o)}}}let zre;function N0(n,e,t=e){let i=zre||(zre=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function sO(n,e,t,i){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let o=new KeyboardEvent("keydown",s);o.synthetic=!0,n.dispatchEvent(o);let r=new KeyboardEvent("keyup",s);return r.synthetic=!0,n.dispatchEvent(r),o.defaultPrevented||r.defaultPrevented}function Yxe(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function dbe(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function qxe(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Um(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=Um(t))}else{if(t==n)return!0;i=A0(t),t=t.parentNode}}function hbe(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function fbe(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=Um(t)}else if(t.parentNode&&!V4(t))i=A0(t),t=t.parentNode;else return null}}function gbe(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!V4(t))i=A0(t)+1,t=t.parentNode;else return null}}class Uc{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Uc(e.parentNode,A0(e),t)}static after(e,t){return new Uc(e.parentNode,A0(e)+1,t)}}const GZ=[];class or{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,o;for(let r of this.children){if(r.flags&7){if(!r.dom&&(o=s?s.nextSibling:i.firstChild)){let a=or.get(o);(!a||!a.parent&&a.canReuseDOM(r))&&r.reuseDOM(o)}r.sync(e,t),r.flags&=-8}if(o=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&o!=r.dom&&(t.written=!0),r.dom.parentNode==i)for(;o&&o!=r.dom;)o=Kre(o);else i.insertBefore(r.dom,o);s=r.dom}for(o=s?s.nextSibling:i.firstChild,o&&t&&t.node==i&&(t.written=!0);o;)o=Kre(o)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=Um(e)==0?0:t==0?-1:1;for(;;){let o=e.parentNode;if(o==this.dom)break;s==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?s=-1:s=1),e=o}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!or.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,o=0;;s++){let r=this.children[s];if(r.dom==i)return o;o+=r.length+r.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,o=-1,r=-1,a=-1;for(let c=0,u=i,d=i;c<this.children.length;c++){let f=this.children[c],g=u+f.length;if(u<e&&g>t)return f.domBoundsAround(e,t,u);if(g>=e&&s==-1&&(s=c,o=u),u>t&&f.dom.parentNode==this.dom){r=c,a=d;break}d=g,u=g+f.breakAfter}return{from:o,to:a<0?i+this.length:a,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:r<this.children.length&&r>=0?this.children[r].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=GZ){this.markDirty();for(let s=e;s<t;s++){let o=this.children[s];o.parent==this&&i.indexOf(o)<0&&o.destroy()}i.length<250?this.children.splice(e,t-e,...i):this.children=[].concat(this.children.slice(0,e),i,this.children.slice(t));for(let s=0;s<i.length;s++)i[s].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new pbe(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,i,s,o,r){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}or.prototype.breakAfter=0;function Kre(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class pbe{constructor(e,t,i){this.children=e,this.pos=t,this.i=i,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function mbe(n,e,t,i,s,o,r,a,c){let{children:u}=n,d=u.length?u[e]:null,f=o.length?o[o.length-1]:null,g=f?f.breakAfter:r;if(!(e==i&&d&&!r&&!g&&o.length<2&&d.merge(t,s,o.length?f:null,t==0,a,c))){if(i<u.length){let p=u[i];p&&(s<p.length||p.breakAfter&&(f!=null&&f.breakAfter))?(e==i&&(p=p.split(s),s=0),!g&&f&&p.merge(0,s,f,!0,0,c)?o[o.length-1]=p:((s||p.children.length&&!p.children[0].length)&&p.merge(0,s,null,!1,0,c),o.push(p))):p!=null&&p.breakAfter&&(f?f.breakAfter=1:r=1),i++}for(d&&(d.breakAfter=r,t>0&&(!r&&o.length&&d.merge(t,d.length,o[0],!1,a,0)?d.breakAfter=o.shift().breakAfter:(t<d.length||d.children.length&&d.children[d.children.length-1].length==0)&&d.merge(t,d.length,null,!1,a,0),e++));e<i&&o.length;)if(u[i-1].become(o[o.length-1]))i--,o.pop(),c=o.length?0:a;else if(u[e].become(o[0]))e++,o.shift(),a=o.length?0:c;else break;!o.length&&e&&i<u.length&&!u[e-1].breakAfter&&u[i].merge(0,0,u[e-1],!1,a,c)&&e--,(e<i||o.length)&&n.replaceChildren(e,i,o)}}function _be(n,e,t,i,s,o){let r=n.childCursor(),{i:a,off:c}=r.findPos(t,1),{i:u,off:d}=r.findPos(e,-1),f=e-t;for(let g of i)f+=g.length;n.length+=f,mbe(n,u,d,a,c,i,0,s,o)}let hd=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},cj=typeof document<"u"?document:{documentElement:{style:{}}};const uj=/Edge\/(\d+)/.exec(hd.userAgent),vbe=/MSIE \d/.test(hd.userAgent),dj=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hd.userAgent),V5=!!(vbe||dj||uj),jre=!V5&&/gecko\/(\d+)/i.test(hd.userAgent),pz=!V5&&/Chrome\/(\d+)/.exec(hd.userAgent),Xre="webkitFontSmoothing"in cj.documentElement.style,bbe=!V5&&/Apple Computer/.test(hd.vendor),Yre=bbe&&(/Mobile\/\w+/.test(hd.userAgent)||hd.maxTouchPoints>2);var ii={mac:Yre||/Mac/.test(hd.platform),windows:/Win/.test(hd.platform),linux:/Linux|X11/.test(hd.platform),ie:V5,ie_version:vbe?cj.documentMode||6:dj?+dj[1]:uj?+uj[1]:0,gecko:jre,gecko_version:jre?+(/Firefox\/(\d+)/.exec(hd.userAgent)||[0,0])[1]:0,chrome:!!pz,chrome_version:pz?+pz[1]:0,ios:Yre,android:/Android\b/.test(hd.userAgent),webkit:Xre,safari:bbe,webkit_version:Xre?+(/\bAppleWebKit\/(\d+)/.exec(hd.userAgent)||[0,0])[1]:0,tabSize:cj.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Jxe=256;class Jg extends or{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Jg)||this.length-(t-e)+i.length>Jxe||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Jg(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Uc(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Qxe(this.dom,e,t)}}class ob extends or{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(dbe(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,o,r){return i&&(!(i instanceof ob&&i.mark.eq(this.mark))||e&&o<=0||t<this.length&&r<=0)?!1:(_be(this,e,t,i?i.children.slice():[],o-1,r-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,o=0;for(let a of this.children){let c=i+a.length;c>e&&t.push(i<e?a.split(e-i):a),s<0&&i>=e&&(s=o),i=c,o++}let r=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new ob(this.mark,t,r)}domAtPos(e){return Tbe(this,e)}coordsAt(e,t){return ybe(this,e,t)}}function Qxe(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,o=e,r=0;e==0&&t<0||e==i&&t>=0?ii.chrome||ii.gecko||(e?(s--,r=1):o<i&&(o++,r=-1)):t<0?s--:o<i&&o++;let a=N0(n,s,o).getClientRects();if(!a.length)return null;let c=a[(r?r<0:t>=0)?0:a.length-1];return ii.safari&&!r&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),r?KP(c,r<0):c||null}class fC extends or{static create(e,t,i){return new fC(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=fC.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,s,o,r){return i&&(!(i instanceof fC)||!this.widget.compare(i.widget)||e>0&&o<=0||t<this.length&&r<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof fC&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Lo.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,i=t&&t.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):Lo.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Uc.before(this.dom):Uc.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let r=this.side?this.side<0:e>0;for(let a=r?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=r?-1:1);return KP(o,!r)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class FO extends or{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof FO&&e.side==this.side}split(){return new FO(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Uc.before(this.dom):Uc.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Lo.empty}get isHidden(){return!0}}Jg.prototype.children=fC.prototype.children=FO.prototype.children=GZ;function Tbe(n,e){let t=n.dom,{children:i}=n,s=0;for(let o=0;s<i.length;s++){let r=i[s],a=o+r.length;if(!(a==o&&r.getSide()<=0)){if(e>o&&e<a&&r.dom.parentNode==t)return r.domAtPos(e-o);if(e<=o)break;o=a}}for(let o=s;o>0;o--){let r=i[o-1];if(r.dom.parentNode==t)return r.domAtPos(r.length)}for(let o=s;o<i.length;o++){let r=i[o];if(r.dom.parentNode==t)return r.domAtPos(0)}return new Uc(t,0)}function Cbe(n,e,t){let i,{children:s}=n;t>0&&e instanceof ob&&s.length&&(i=s[s.length-1])instanceof ob&&i.mark.eq(e.mark)?Cbe(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function ybe(n,e,t){let i=null,s=-1,o=null,r=-1;function a(u,d){for(let f=0,g=0;f<u.children.length&&g<=d;f++){let p=u.children[f],_=g+p.length;_>=d&&(p.children.length?a(p,d-g):(!o||o.isHidden&&t>0)&&(_>d||g==_&&p.getSide()>0)?(o=p,r=d-g):(g<d||g==_&&p.getSide()<0&&!p.isHidden)&&(i=p,s=d-g)),g=_}}a(n,e);let c=(t<0?i:o)||i||o;return c?c.coordsAt(Math.max(0,c==i?s:r),t):Zxe(n)}function Zxe(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=PO(e);return t[t.length-1]||null}function hj(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const qre=Object.create(null);function U4(n,e,t){if(n==e)return!0;n||(n=qre),e||(e=qre);let i=Object.keys(n),s=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let o of i)if(o!=t&&(s.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function fj(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function ePe(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class Eb{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Mu=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Mu||(Mu={}));class yi extends k0{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new jP(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new jC(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:o,end:r}=Sbe(e,t);i=(o?t?-3e8:-1:5e8)-1,s=(r?t?2e8:1:-6e8)+1}return new jC(e,i,s,t,e.widget||null,!0)}static line(e){return new zZ(e)}static set(e,t=!1){return oo.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}yi.none=oo.empty;class jP extends yi{constructor(e){let{start:t,end:i}=Sbe(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof jP&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&U4(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}jP.prototype.point=!1;let zZ=class Ebe extends yi{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ebe&&this.spec.class==e.spec.class&&U4(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};zZ.prototype.mapMode=wu.TrackBefore;zZ.prototype.point=!0;class jC extends yi{constructor(e,t,i,s,o,r){super(t,i,o,e),this.block=s,this.isReplace=r,this.mapMode=s?t<=0?wu.TrackBefore:wu.TrackAfter:wu.TrackDel}get type(){return this.startSide!=this.endSide?Mu.WidgetRange:this.startSide<=0?Mu.WidgetBefore:Mu.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof jC&&tPe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}jC.prototype.point=!0;function Sbe(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function tPe(n,e){return n==e||!!(n&&e&&n.compare(e))}function rU(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class Nl extends or{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,o,r){if(i){if(!(i instanceof Nl))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),_be(this,e,t,i?i.children.slice():[],o,r),!0}split(e){let t=new Nl;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let o=i;o<this.children.length;o++)t.append(this.children[o],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){U4(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Cbe(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=hj(t,this.attrs||{})),i&&(this.attrs=hj({class:i},this.attrs||{}))}domAtPos(e){return Tbe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(dbe(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(fj(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&or.get(s)instanceof ob;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=or.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!ii.ios||!this.children.some(o=>o instanceof Jg))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Jg)||/[^ -~]/.test(i.text))return null;let s=PO(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=ybe(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,o=i.bottom-i.top;if(Math.abs(o-s.lineHeight)<2&&s.textHeight<o){let r=(o-s.textHeight)/2;return{top:i.top+r,bottom:i.bottom-r,left:i.left,right:i.left}}}return i}become(e){return e instanceof Nl&&this.children.length==0&&e.children.length==0&&U4(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let i=0,s=0;i<e.children.length;i++){let o=e.children[i],r=s+o.length;if(r>=t){if(o instanceof Nl)return o;if(r>t)break}s=r+o.breakAfter}return null}}class Xv extends or{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,o,r){return i&&(!(i instanceof Xv)||!this.widget.compare(i.widget)||e>0&&o<=0||t<this.length&&r<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Uc.before(this.dom):Uc.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new Xv(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return GZ}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Lo.empty}domBoundsAround(){return null}become(e){return e instanceof Xv&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);return i||(this.widget instanceof gj?null:KP(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:i}=this.deco;return t==i?!1:e<0?t<0:i>0}}class gj extends Eb{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class AD{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Xv&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Nl),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(qB(new FO(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Xv)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:r,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(r){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(qB(new Jg(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,o,r){if(this.disallowBlockEffectsFor[r]&&i instanceof jC){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(i instanceof jC)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Xv(i.widget||BO.block,a,i));else{let c=fC.create(i.widget||BO.inline,a,a?0:i.startSide),u=this.atCursorPos&&!c.isEditable&&o<=s.length&&(e<t||i.startSide>0),d=!c.isEditable&&(e<t||o>s.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!u&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),u&&(f.append(qB(new FO(1),s),o),o=s.length+Math.max(0,o-s.length)),f.append(qB(c,s),o),this.atCursorPos=d,this.pendingBuffer=d?e<t||o>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,i,s,o){let r=new AD(e,t,i,o);return r.openEnd=oo.spans(s,t,i,r),r.openStart<0&&(r.openStart=r.openEnd),r.finish(r.openEnd),r}}function qB(n,e){for(let t of e)n=new ob(t,[n],n.length);return n}class BO extends Eb{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}BO.inline=new BO("span");BO.block=new BO("div");var Or=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Or||(Or={}));const D0=Or.LTR,KZ=Or.RTL;function wbe(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const nPe=wbe("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),iPe=wbe("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),pj=Object.create(null),Kp=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);pj[e]=t,pj[t]=-e}function Ibe(n){return n<=247?nPe[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?iPe[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const sPe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class gC{get dir(){return this.level%2?KZ:D0}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,s){let o=-1;for(let r=0;r<e.length;r++){let a=e[r];if(a.from<=t&&a.to>=t){if(a.level==i)return r;(o<0||(s!=0?s<0?a.from<t:a.to>t:e[o].level>a.level))&&(o=r)}}if(o<0)throw new RangeError("Index out of range");return o}}function Lbe(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],s=e[t];if(i.from!=s.from||i.to!=s.to||i.direction!=s.direction||!Lbe(i.inner,s.inner))return!1}return!0}const er=[];function oPe(n,e,t,i,s){for(let o=0;o<=i.length;o++){let r=o?i[o-1].to:e,a=o<i.length?i[o].from:t,c=o?256:s;for(let u=r,d=c,f=c;u<a;u++){let g=Ibe(n.charCodeAt(u));g==512?g=d:g==8&&f==4&&(g=16),er[u]=g==4?2:g,g&7&&(f=g),d=g}for(let u=r,d=c,f=c;u<a;u++){let g=er[u];if(g==128)u<a-1&&d==er[u+1]&&d&24?g=er[u]=d:er[u]=256;else if(g==64){let p=u+1;for(;p<a&&er[p]==64;)p++;let _=u&&d==8||p<t&&er[p]==8?f==1?1:8:256;for(let v=u;v<p;v++)er[v]=_;u=p-1}else g==8&&f==1&&(er[u]=1);d=g,g&7&&(f=g)}}}function rPe(n,e,t,i,s){let o=s==1?2:1;for(let r=0,a=0,c=0;r<=i.length;r++){let u=r?i[r-1].to:e,d=r<i.length?i[r].from:t;for(let f=u,g,p,_;f<d;f++)if(p=pj[g=n.charCodeAt(f)])if(p<0){for(let v=a-3;v>=0;v-=3)if(Kp[v+1]==-p){let C=Kp[v+2],y=C&2?s:C&4?C&1?o:s:0;y&&(er[f]=er[Kp[v]]=y),a=v;break}}else{if(Kp.length==189)break;Kp[a++]=f,Kp[a++]=g,Kp[a++]=c}else if((_=er[f])==2||_==1){let v=_==s;c=v?0:1;for(let C=a-3;C>=0;C-=3){let y=Kp[C+2];if(y&2)break;if(v)Kp[C+2]|=2;else{if(y&4)break;Kp[C+2]|=4}}}}}function lPe(n,e,t,i){for(let s=0,o=i;s<=t.length;s++){let r=s?t[s-1].to:n,a=s<t.length?t[s].from:e;for(let c=r;c<a;){let u=er[c];if(u==256){let d=c+1;for(;;)if(d==a){if(s==t.length)break;d=t[s++].to,a=s<t.length?t[s].from:e}else if(er[d]==256)d++;else break;let f=o==1,g=(d<e?er[d]:i)==1,p=f==g?f?1:2:i;for(let _=d,v=s,C=v?t[v-1].to:n;_>c;)_==C&&(_=t[--v].from,C=v?t[v-1].to:n),er[--_]=p;c=d}else o=u,c++}}}function mj(n,e,t,i,s,o,r){let a=i%2?2:1;if(i%2==s%2)for(let c=e,u=0;c<t;){let d=!0,f=!1;if(u==o.length||c<o[u].from){let v=er[c];v!=a&&(d=!1,f=v==16)}let g=!d&&a==1?[]:null,p=d?i:i+1,_=c;e:for(;;)if(u<o.length&&_==o[u].from){if(f)break e;let v=o[u];if(!d)for(let C=v.to,y=u+1;;){if(C==t)break e;if(y<o.length&&o[y].from==C)C=o[y++].to;else{if(er[C]==a)break e;break}}if(u++,g)g.push(v);else{v.from>c&&r.push(new gC(c,v.from,p));let C=v.direction==D0!=!(p%2);_j(n,C?i+1:i,s,v.inner,v.from,v.to,r),c=v.to}_=v.to}else{if(_==t||(d?er[_]!=a:er[_]==a))break;_++}g?mj(n,c,_,i+1,s,g,r):c<_&&r.push(new gC(c,_,p)),c=_}else for(let c=t,u=o.length;c>e;){let d=!0,f=!1;if(!u||c>o[u-1].to){let v=er[c-1];v!=a&&(d=!1,f=v==16)}let g=!d&&a==1?[]:null,p=d?i:i+1,_=c;e:for(;;)if(u&&_==o[u-1].to){if(f)break e;let v=o[--u];if(!d)for(let C=v.from,y=u;;){if(C==e)break e;if(y&&o[y-1].to==C)C=o[--y].from;else{if(er[C-1]==a)break e;break}}if(g)g.push(v);else{v.to<c&&r.push(new gC(v.to,c,p));let C=v.direction==D0!=!(p%2);_j(n,C?i+1:i,s,v.inner,v.from,v.to,r),c=v.from}_=v.from}else{if(_==e||(d?er[_-1]!=a:er[_-1]==a))break;_--}g?mj(n,_,c,i+1,s,g,r):_<c&&r.push(new gC(_,c,p)),c=_}}function _j(n,e,t,i,s,o,r){let a=e%2?2:1;oPe(n,s,o,i,a),rPe(n,s,o,i,a),lPe(s,o,i,a),mj(n,s,o,e,t,i,r)}function aPe(n,e,t){if(!n)return[new gC(0,0,e==KZ?1:0)];if(e==D0&&!t.length&&!sPe.test(n))return Obe(n.length);if(t.length)for(;n.length>er.length;)er[er.length]=256;let i=[],s=e==D0?0:1;return _j(n,s,s,t,0,n.length,i),i}function Obe(n){return[new gC(0,n,0)]}let Rbe="";function cPe(n,e,t,i,s){var o;let r=i.head-n.from,a=gC.find(e,r,(o=i.bidiLevel)!==null&&o!==void 0?o:-1,i.assoc),c=e[a],u=c.side(s,t);if(r==u){let g=a+=s?1:-1;if(g<0||g>=e.length)return null;c=e[a=g],r=c.side(!s,t),u=c.side(s,t)}let d=sc(n.text,r,c.forward(s,t));(d<c.from||d>c.to)&&(d=u),Rbe=n.text.slice(Math.min(r,d),Math.max(r,d));let f=a==(s?e.length-1:0)?null:e[a+(s?1:-1)];return f&&d==u&&f.level+(s?0:1)<c.level?rn.cursor(f.side(!s,t)+n.from,f.forward(s,t)?1:-1,f.level):rn.cursor(d+n.from,c.forward(s,t)?-1:1,c.level)}function uPe(n,e,t){for(let i=e;i<t;i++){let s=Ibe(n.charCodeAt(i));if(s==1)return D0;if(s==2||s==4)return KZ}return D0}const Mbe=oi.define(),kbe=oi.define(),Abe=oi.define(),Nbe=oi.define(),vj=oi.define(),Dbe=oi.define(),$be=oi.define(),jZ=oi.define(),XZ=oi.define(),xbe=oi.define({combine:n=>n.some(e=>e)}),Pbe=oi.define({combine:n=>n.some(e=>e)}),Fbe=oi.define();class oO{constructor(e,t="nearest",i="nearest",s=5,o=5,r=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=o,this.isSnapshot=r}map(e){return e.empty?this:new oO(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new oO(rn.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const JB=ls.define({map:(n,e)=>n.map(e)}),Bbe=ls.define();function vd(n,e,t){let i=n.facet(Nbe);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Dv=oi.define({combine:n=>n.length?n[0]:!0});let dPe=0;const QN=oi.define();class Il{constructor(e,t,i,s,o){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=o(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:o,decorations:r}=t||{};return new Il(dPe++,e,i,s,a=>{let c=[QN.of(a)];return r&&c.push(x$.of(u=>{let d=u.plugin(a);return d?r(d):yi.none})),o&&c.push(o(a)),c})}static fromClass(e,t){return Il.define(i=>new e(i),t)}}class mz{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(vd(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){vd(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){vd(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Hbe=oi.define(),YZ=oi.define(),x$=oi.define(),Vbe=oi.define(),qZ=oi.define(),Ube=oi.define();function Jre(n,e){let t=n.state.facet(Ube);if(!t.length)return t;let i=t.map(o=>o instanceof Function?o(n):o),s=[];return oo.spans(i,e.from,e.to,{point(){},span(o,r,a,c){let u=o-e.from,d=r-e.from,f=s;for(let g=a.length-1;g>=0;g--,c--){let p=a[g].spec.bidiIsolate,_;if(p==null&&(p=uPe(e.text,u,d)),c>0&&f.length&&(_=f[f.length-1]).to==u&&_.direction==p)_.to=d,f=_.inner;else{let v={from:u,to:d,direction:p,inner:[]};f.push(v),f=v.inner}}}}),s}const Wbe=oi.define();function JZ(n){let e=0,t=0,i=0,s=0;for(let o of n.state.facet(Wbe)){let r=o(n);r&&(r.left!=null&&(e=Math.max(e,r.left)),r.right!=null&&(t=Math.max(t,r.right)),r.top!=null&&(i=Math.max(i,r.top)),r.bottom!=null&&(s=Math.max(s,r.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ZN=oi.define();class Df{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Df(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let s=0,o=0,r=0,a=0;;s++){let c=s==e.length?null:e[s],u=r-a,d=c?c.fromB:1e9;for(;o<t.length&&t[o]<d;){let f=t[o],g=t[o+1],p=Math.max(a,f),_=Math.min(d,g);if(p<=_&&new Df(p+u,_+u,p,_).addToSet(i),g>d)break;o+=2}if(!c)return i;new Df(c.fromA,c.toA,c.fromB,c.toB).addToSet(i),r=c.toA,a=c.toB}}}class W4{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=da.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,r,a,c)=>s.push(new Df(o,r,a,c))),this.changedRanges=s}static create(e,t,i){return new W4(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Qre extends or{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=yi.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Nl],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Df(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:d})=>d<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!vPe(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let o=s>-1?fPe(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:d}=this.hasComposition;i=new Df(u,d,e.changes.mapPos(u,-1),e.changes.mapPos(d,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ii.ie||ii.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let r=this.decorations,a=this.updateDeco(),c=mPe(r,a,e.changes);return i=Df.extendWithRanges(i,c),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=ii.chrome||ii.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,r),this.flags&=-8,r&&(r.written||s.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(r=>r.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let r of this.children)r instanceof Xv&&r.widget instanceof gj&&o.push(r.dom);s.updateGaps(o)}updateChildren(e,t,i){let s=i?i.range.addToSet(e.slice()):e,o=this.childCursor(t);for(let r=s.length-1;;r--){let a=r>=0?s[r]:null;if(!a)break;let{fromA:c,toA:u,fromB:d,toB:f}=a,g,p,_,v;if(i&&i.range.fromB<f&&i.range.toB>d){let L=AD.build(this.view.state.doc,d,i.range.fromB,this.decorations,this.dynamicDecorationMap),O=AD.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);p=L.breakAtStart,_=L.openStart,v=O.openEnd;let A=this.compositionView(i);O.breakAtStart?A.breakAfter=1:O.content.length&&A.merge(A.length,A.length,O.content[0],!1,O.openStart,0)&&(A.breakAfter=O.content[0].breakAfter,O.content.shift()),L.content.length&&A.merge(0,0,L.content[L.content.length-1],!0,0,L.openEnd)&&L.content.pop(),g=L.content.concat(A).concat(O.content)}else({content:g,breakAtStart:p,openStart:_,openEnd:v}=AD.build(this.view.state.doc,d,f,this.decorations,this.dynamicDecorationMap));let{i:C,off:y}=o.findPos(u,1),{i:w,off:I}=o.findPos(c,-1);mbe(this,w,I,C,y,g,p,_,v)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(Bbe)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new Jg(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new ob(s,[t],t.length);let i=new Nl;return i.append(t,0),i}fixCompositionDOM(e){let t=(o,r)=>{r.flags|=8|(r.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(r);let a=or.get(o);a&&a!=r&&(a.dom=null),r.setDOM(o)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let o=e.marks.length-1;o>=-1;o--)i=s.childPos(i.off,1),s=s.children[i.i],t(o>=0?e.marks[o].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,o=!s&&!(this.view.state.facet(Dv)||this.dom.tabIndex>-1)&&oU(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||o))return;let r=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(a.anchor)),u=a.empty?c:this.moveToLine(this.domAtPos(a.head));if(ii.gecko&&a.empty&&!this.hasComposition&&hPe(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new Uc(f,0),r=!0}let d=this.view.observer.selectionRange;(r||!d.focusNode||(!kD(c.node,c.offset,d.anchorNode,d.anchorOffset)||!kD(u.node,u.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,a))&&(this.view.observer.ignore(()=>{ii.android&&ii.chrome&&this.dom.contains(d.focusNode)&&_Pe(d.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=$$(this.view.root);if(f)if(a.empty){if(ii.gecko){let g=gPe(c.node,c.offset);if(g&&g!=3){let p=(g==1?fbe:gbe)(c.node,c.offset);p&&(c=new Uc(p.node,p.offset))}}f.collapse(c.node,c.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(u.node,u.offset)}catch{}}else{let g=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),g.setEnd(u.node,u.offset),g.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(g)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new Uc(d.anchorNode,d.anchorOffset),this.impreciseHead=u.precise?null:new Uc(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&kD(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=$$(e.root),{anchorNode:s,anchorOffset:o}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let r=Nl.find(this,t.head);if(!r)return;let a=r.posAtStart;if(t.head==a||t.head==a+r.length)return;let c=this.coordsAt(t.head,-1),u=this.coordsAt(t.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(t.head+t.assoc);i.collapse(d.node,d.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,o)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s<t.childNodes.length;s++){let o=or.get(t.childNodes[s]);o instanceof Nl&&(i=o.domAtPos(0))}for(let s=e.offset-1;!i&&s>=0;s--){let o=or.get(t.childNodes[s]);o instanceof Nl&&(i=o.domAtPos(o.length))}return i?new Uc(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=or.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let s=this.children[t];if(i<s.length||s instanceof Nl)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,s=0;for(let o=this.length,r=this.children.length-1;r>=0;r--){let a=this.children[r],c=o-a.breakAfter,u=c-a.length;if(c<e)break;if(u<=e&&(u<e||a.covers(-1))&&(c>e||a.covers(1))&&(!i||a instanceof Nl&&!(i instanceof Nl&&t>=0)))i=a,s=u;else if(i&&u==e&&c==e&&a instanceof Xv&&Math.abs(t)<2){if(a.deco.startSide<0)break;r&&(i=null)}o=u}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof Nl))return null;for(;s.children.length;){let{i:a,off:c}=s.childPos(i,1);for(;;a++){if(a==s.children.length)return null;if((s=s.children[a]).length)break}i=c}if(!(s instanceof Jg))return null;let o=sc(s.text,i);if(o==i)return null;let r=N0(s.dom,i,o).getClientRects();for(let a=0;a<r.length;a++){let c=r[a];if(a==r.length-1||c.top<c.bottom&&c.left<c.right)return c}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,o=this.view.contentDOM.clientWidth,r=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,c=this.view.textDirection==Or.LTR;for(let u=0,d=0;d<this.children.length;d++){let f=this.children[d],g=u+f.length;if(g>s)break;if(u>=i){let p=f.dom.getBoundingClientRect();if(t.push(p.height),r){let _=f.dom.lastChild,v=_?PO(_):[];if(v.length){let C=v[v.length-1],y=c?C.right-p.left:p.right-C.left;y>a&&(a=y,this.minWidth=o,this.minWidthFrom=u,this.minWidthTo=g)}}}u=g+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Or.RTL:Or.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Nl){let r=o.measureTextSize();if(r)return r}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=PO(e.firstChild)[0];t=e.getBoundingClientRect().height,i=o?o.width/27:7,s=o?o.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new pbe(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let o=s==t.viewports.length?null:t.viewports[s],r=o?o.from-1:this.length;if(r>i){let a=(t.lineBlockAt(r).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(yi.replace({widget:new gj(a),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!o)break;i=o.to+1}return yi.set(e)}updateDeco(){let e=1,t=this.view.state.facet(x$).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),i=!1,s=this.view.state.facet(Vbe).map((o,r)=>{let a=typeof o=="function";return a&&(i=!0),a?o(this.view):o});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(oo.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(Fbe))try{if(u(this.view,e.range,e))return!0}catch(d){vd(this.view.state,d,"scroll handler")}let{range:t}=e,i=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=JZ(this.view),r={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:a,offsetHeight:c}=this.view.scrollDOM;Kxe(this.view.scrollDOM,r,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==Or.LTR)}}function hPe(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function Gbe(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=fbe(t.focusNode,t.focusOffset),s=gbe(t.focusNode,t.focusOffset),o=i||s;if(s&&i&&s.node!=i.node){let a=or.get(s.node);if(!a||a instanceof Jg&&a.text!=s.node.nodeValue)o=s;else if(n.docView.lastCompositionAfterCursor){let c=or.get(i.node);!c||c instanceof Jg&&c.text!=i.node.nodeValue||(o=s)}}if(n.docView.lastCompositionAfterCursor=o!=i,!o)return null;let r=e-o.offset;return{from:r,to:r+o.node.nodeValue.length,node:o.node}}function fPe(n,e,t){let i=Gbe(n,t);if(!i)return null;let{node:s,from:o,to:r}=i,a=s.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(i.from,i.to)!=a)return null;let c=e.invertedDesc,u=new Df(c.mapPos(o),c.mapPos(r),o,r),d=[];for(let f=s.parentNode;;f=f.parentNode){let g=or.get(f);if(g instanceof ob)d.push({node:f,deco:g.mark});else{if(g instanceof Nl||f.nodeName=="DIV"&&f.parentNode==n.contentDOM)return{range:u,text:s,marks:d,line:f};if(f!=n.contentDOM)d.push({node:f,deco:new jP({inclusive:!0,attributes:ePe(f),tagName:f.tagName.toLowerCase()})});else return null}}}function gPe(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let pPe=class{constructor(){this.changes=[]}compareRange(e,t){rU(e,t,this.changes)}comparePoint(e,t){rU(e,t,this.changes)}boundChange(e){rU(e,e,this.changes)}};function mPe(n,e,t){let i=new pPe;return oo.compare(n,e,t,i),i.changes}function _Pe(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function vPe(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}function bPe(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),o=e-s.from;if(s.length==0)return rn.cursor(e);o==0?t=1:o==s.length&&(t=-1);let r=o,a=o;t<0?r=sc(s.text,o,!1):a=sc(s.text,o);let c=i(s.text.slice(r,a));for(;r>0;){let u=sc(s.text,r,!1);if(i(s.text.slice(u,r))!=c)break;r=u}for(;a<s.length;){let u=sc(s.text,a);if(i(s.text.slice(a,u))!=c)break;a=u}return rn.range(r+s.from,a+s.from)}function TPe(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function CPe(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function _z(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function Zre(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function ele(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function bj(n,e,t){let i,s,o,r,a=!1,c,u,d,f;for(let _=n.firstChild;_;_=_.nextSibling){let v=PO(_);for(let C=0;C<v.length;C++){let y=v[C];s&&_z(s,y)&&(y=Zre(ele(y,s.bottom),s.top));let w=TPe(e,y),I=CPe(t,y);if(w==0&&I==0)return _.nodeType==3?tle(_,e,t):bj(_,e,t);if(!i||r>I||r==I&&o>w){i=_,s=y,o=w,r=I;let L=I?t<y.top?-1:1:w?e<y.left?-1:1:0;a=!L||(L>0?C<v.length-1:C>0)}w==0?t>y.bottom&&(!d||d.bottom<y.bottom)?(c=_,d=y):t<y.top&&(!f||f.top>y.top)&&(u=_,f=y):d&&_z(d,y)?d=ele(d,y.bottom):f&&_z(f,y)&&(f=Zre(f,y.top))}}if(d&&d.bottom>=t?(i=c,s=d):f&&f.top<=t&&(i=u,s=f),!i)return{node:n,offset:0};let g=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return tle(i,g,t);if(a&&i.contentEditable!="false")return bj(i,g,t);let p=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:p}}function tle(n,e,t){let i=n.nodeValue.length,s=-1,o=1e9,r=0;for(let a=0;a<i;a++){let c=N0(n,a,a+1).getClientRects();for(let u=0;u<c.length;u++){let d=c[u];if(d.top==d.bottom)continue;r||(r=e-d.left);let f=(d.top>t?d.top-t:t-d.bottom)-1;if(d.left-1<=e&&d.right+1>=e&&f<o){let g=e>=(d.left+d.right)/2,p=g;if((ii.chrome||ii.gecko)&&N0(n,a).getBoundingClientRect().left==d.right&&(p=!g),f<=0)return{node:n,offset:a+(p?1:0)};s=a+(p?1:0),o=f}}}return{node:n,offset:s>-1?s:r>0?n.nodeValue.length:0}}function zbe(n,e,t,i=-1){var s,o;let r=n.contentDOM.getBoundingClientRect(),a=r.top+n.viewState.paddingTop,c,{docHeight:u}=n.viewState,{x:d,y:f}=e,g=f-a;if(g<0)return 0;if(g>u)return n.state.doc.length;for(let L=n.viewState.heightOracle.textHeight/2,O=!1;c=n.elementAtHeight(g),c.type!=Mu.Text;)for(;g=i>0?c.bottom+L:c.top-L,!(g>=0&&g<=u);){if(O)return t?null:0;O=!0,i=-i}f=a+g;let p=c.from;if(p<n.viewport.from)return n.viewport.from==0?0:t?null:nle(n,r,c,d,f);if(p>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:nle(n,r,c,d,f);let _=n.dom.ownerDocument,v=n.root.elementFromPoint?n.root:_,C=v.elementFromPoint(d,f);C&&!n.contentDOM.contains(C)&&(C=null),C||(d=Math.max(r.left+1,Math.min(r.right-1,d)),C=v.elementFromPoint(d,f),C&&!n.contentDOM.contains(C)&&(C=null));let y,w=-1;if(C&&((s=n.docView.nearest(C))===null||s===void 0?void 0:s.isEditable)!=!1){if(_.caretPositionFromPoint){let L=_.caretPositionFromPoint(d,f);L&&({offsetNode:y,offset:w}=L)}else if(_.caretRangeFromPoint){let L=_.caretRangeFromPoint(d,f);L&&({startContainer:y,startOffset:w}=L,(!n.contentDOM.contains(y)||ii.safari&&yPe(y,w,d)||ii.chrome&&EPe(y,w,d))&&(y=void 0))}y&&(w=Math.min(Um(y),w))}if(!y||!n.docView.dom.contains(y)){let L=Nl.find(n.docView,p);if(!L)return g>c.top+c.height/2?c.to:c.from;({node:y,offset:w}=bj(L.dom,d,f))}let I=n.docView.nearest(y);if(!I)return null;if(I.isWidget&&((o=I.dom)===null||o===void 0?void 0:o.nodeType)==1){let L=I.dom.getBoundingClientRect();return e.y<L.top||e.y<=L.bottom&&e.x<=(L.left+L.right)/2?I.posAtStart:I.posAtEnd}else return I.localPosFromDOM(y,w)+I.posAtStart}function nle(n,e,t,i,s){let o=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,c=Math.floor((s-t.top-(n.defaultLineHeight-a)*.5)/a);o+=c*n.viewState.heightOracle.lineLength}let r=n.state.sliceDoc(t.from,t.to);return t.from+oj(r,o,n.state.tabSize)}function yPe(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return N0(n,i-1,i).getBoundingClientRect().left>t}function EPe(n,e,t){if(e!=0)return!1;for(let s=n;;){let o=s.parentNode;if(!o||o.nodeType!=1||o.firstChild!=s)return!1;if(o.classList.contains("cm-line"))break;s=o}let i=n.nodeType==1?n.getBoundingClientRect():N0(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Tj(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==Mu.Text))return i}return t}function SPe(n,e,t,i){let s=Tj(n,e.head),o=!i||s.type!=Mu.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(o){let r=n.dom.getBoundingClientRect(),a=n.textDirectionAt(s.from),c=n.posAtCoords({x:t==(a==Or.LTR)?r.right-1:r.left+1,y:(o.top+o.bottom)/2});if(c!=null)return rn.cursor(c,t?-1:1)}return rn.cursor(t?s.to:s.from,t?-1:1)}function ile(n,e,t,i){let s=n.state.doc.lineAt(e.head),o=n.bidiSpans(s),r=n.textDirectionAt(s.from);for(let a=e,c=null;;){let u=cPe(s,o,r,a,t),d=Rbe;if(!u){if(s.number==(t?n.state.doc.lines:1))return a;d=`
- `,s=n.state.doc.line(s.number+(t?1:-1)),o=n.bidiSpans(s),u=n.visualLineSide(s,!t)}if(c){if(!c(d))return a}else{if(!i)return u;c=i(d)}a=u}}function wPe(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return o=>{let r=i(o);return s==Pr.Space&&(s=r),s==r}}function IPe(n,e,t,i){let s=e.head,o=t?1:-1;if(s==(t?n.state.doc.length:0))return rn.cursor(s,e.assoc);let r=e.goalColumn,a,c=n.contentDOM.getBoundingClientRect(),u=n.coordsAtPos(s,e.assoc||-1),d=n.documentTop;if(u)r==null&&(r=u.left-c.left),a=o<0?u.top:u.bottom;else{let p=n.viewState.lineBlockAt(s);r==null&&(r=Math.min(c.right-c.left,n.defaultCharacterWidth*(s-p.from))),a=(o<0?p.top:p.bottom)+d}let f=c.left+r,g=i??n.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let _=a+(g+p)*o,v=zbe(n,{x:f,y:_},!1,o);if(_<c.top||_>c.bottom||(o<0?v<s:v>s)){let C=n.docView.coordsForChar(v),y=!C||_<C.top?-1:1;return rn.cursor(v,y,void 0,r)}}}function lU(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(o,r,a)=>{if(e>o&&e<r){let c=i||t||(e-o<r-e?-1:1);e=c<0?o:r,i=c}});if(!i)return e}}function vz(n,e,t){let i=lU(n.state.facet(qZ).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:rn.cursor(i,i<t.from?1:-1)}const eD="";class LPe{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Rr.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=eD}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let o=this.text.length;this.readNode(s);let r=s.nextSibling;if(r==t)break;let a=or.get(s),c=or.get(r);(a&&c?a.breakAfter:(a?a.breakAfter:V4(s))||V4(r)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>o)&&this.lineBreak(),s=r}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,r=1,a;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,i),r=this.lineSeparator.length):(a=s.exec(t))&&(o=a.index,r=a[0].length),this.append(t.slice(i,o<0?t.length:o)),o<0)break;if(this.lineBreak(),r>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=r-1);i=o+r}}readNode(e){if(e.cmIgnore)return;let t=or.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(OPe(e,i.node,i.offset)?t:0))}}function OPe(n,e,t){for(;;){if(!e||t<Um(e))return!1;if(e==n)return!0;t=A0(e)+1,e=e.parentNode}}class sle{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class RPe{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:r}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let a=o||r?[]:APe(e),c=new LPe(a,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=NPe(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!aj(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=r&&r.node==a.anchorNode&&r.offset==a.anchorOffset||!aj(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),d=e.viewport;if((ii.ios||ii.chrome)&&e.state.selection.main.empty&&c!=u&&(d.from>0||d.to<e.state.doc.length)){let f=Math.min(c,u),g=Math.max(c,u),p=d.from-f,_=d.to-g;(p==0||p==1||f==0)&&(_==0||_==-1||g==e.state.doc.length)&&(c=0,u=e.state.doc.length)}this.newSel=rn.single(u,c)}}}function Kbe(n,e){let t,{newSel:i}=e,s=n.state.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:r,to:a}=e.bounds,c=s.from,u=null;(o===8||ii.android&&e.text.length<a-r)&&(c=s.to,u="end");let d=kPe(n.state.doc.sliceString(r,a,eD),e.text,c-r,u);d&&(ii.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==eD+eD&&d.toB--,t={from:r+d.from,to:r+d.toA,insert:Lo.of(e.text.slice(d.from,d.toB).split(eD))})}else i&&(!n.hasFocus&&n.state.facet(Dv)||i.main.eq(s))&&(i=null);if(!t&&!i)return!1;if(!t&&e.typeOver&&!s.empty&&i&&i.main.empty?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:t&&t.from>=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(ii.mac||ii.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=rn.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Lo.of([" "])}):ii.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
- `&&n.lineWrapping&&(i&&(i=rn.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Lo.of([" "])}),t)return QZ(n,t,i,o);if(i&&!i.main.eq(s)){let r=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(r=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:r,userEvent:a}),!0}else return!1}function QZ(n,e,t,i=-1){if(ii.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(ii.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&sO(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&sO(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&sO(n.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let r,a=()=>r||(r=MPe(n,e,t));return n.state.facet(Dbe).some(c=>c(n,e.from,e.to,o,a))||n.dispatch(a()),!0}function MPe(n,e,t){let i,s=n.state,o=s.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=o.from<e.from?s.sliceDoc(o.from,e.from):"",c=o.to>e.to?s.sliceDoc(e.to,o.to):"";i=s.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let a=s.changes(e),c=t&&t.main.to<=a.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let u=n.state.sliceDoc(e.from,e.to),d,f=t&&Gbe(n,t.main.head);if(f){let _=e.insert.length-(e.to-e.from);d={from:f.from,to:f.to-_}}else d=n.state.doc.lineAt(o.head);let g=o.to-e.to,p=o.to-o.from;i=s.changeByRange(_=>{if(_.from==o.from&&_.to==o.to)return{changes:a,range:c||_.map(a)};let v=_.to-g,C=v-u.length;if(_.to-_.from!=p||n.state.sliceDoc(C,v)!=u||_.to>=d.from&&_.from<=d.to)return{range:_};let y=s.changes({from:C,to:v,insert:e.insert}),w=_.to-o.to;return{changes:y,range:c?rn.range(Math.max(0,c.anchor+w),Math.max(0,c.head+w)):_.map(y)}})}else i={changes:a,selection:c&&s.selection.replaceRange(c)}}let r="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,r+=".compose",n.inputState.compositionFirstChange&&(r+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:r,scrollIntoView:!0})}function kPe(n,e,t,i){let s=Math.min(n.length,e.length),o=0;for(;o<s&&n.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==s&&n.length==e.length)return null;let r=n.length,a=e.length;for(;r>0&&a>0&&n.charCodeAt(r-1)==e.charCodeAt(a-1);)r--,a--;if(i=="end"){let c=Math.max(0,o-Math.min(r,a));t-=r+c-o}if(r<o&&n.length<e.length){let c=t<=o&&t>=r?o-t:0;o-=c,a=o+(a-r),r=o}else if(a<o){let c=t<=o&&t>=a?o-t:0;o-=c,r=o+(r-a),a=o}return{from:o,toA:r,toB:a}}function APe(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new sle(t,i)),(s!=t||o!=i)&&e.push(new sle(s,o))),e}function NPe(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?rn.single(t+e,i+e):null}class DPe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ii.safari&&e.contentDOM.addEventListener("input",()=>null),ii.gecko&&qPe(e.contentDOM.ownerDocument)}handleEvent(e){!UPe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=$Pe(e),i=this.handlers,s=this.view.contentDOM;for(let o in t)if(o!="scroll"){let r=!t[o].handlers.length,a=i[o];a&&r!=!a.handlers.length&&(s.removeEventListener(o,this.handleEvent),a=null),a||s.addEventListener(o,this.handleEvent,{passive:r})}for(let o in i)o!="scroll"&&!t[o]&&s.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Xbe.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ii.android&&ii.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return ii.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=jbe.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||xPe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,sO(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:ii.safari&&!ii.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ole(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){vd(t.state,s)}}}function $Pe(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let o in s.domEventHandlers){let r=s.domEventHandlers[o];r&&t(o).handlers.push(ole(i.value,r))}if(s&&s.domEventObservers)for(let o in s.domEventObservers){let r=s.domEventObservers[o];r&&t(o).observers.push(ole(i.value,r))}}for(let i in Qg)t(i).handlers.push(Qg[i]);for(let i in Vf)t(i).observers.push(Vf[i]);return e}const jbe=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],xPe="dthko",Xbe=[16,17,18,20,91,92,224,225],QB=6;function ZB(n){return Math.max(0,n)*.7+8}function PPe(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class FPe{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=jxe(e.contentDOM),this.atoms=e.state.facet(qZ).map(r=>r(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Rr.allowMultipleSelections)&&BPe(e,t),this.dragging=VPe(e,t)&&Jbe(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&PPe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,o=0,r=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:r}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let c=JZ(this.view);e.clientX-c.left<=s+QB?t=-ZB(s-e.clientX):e.clientX+c.right>=r-QB&&(t=ZB(e.clientX-r)),e.clientY-c.top<=o+QB?i=-ZB(o-e.clientY):e.clientY+c.bottom>=a-QB&&(i=ZB(e.clientY-a)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;i<e.ranges.length;i++){let s=e.ranges[i],o=null;if(s.empty){let r=lU(this.atoms,s.from,0);r!=s.from&&(o=rn.cursor(r,-1))}else{let r=lU(this.atoms,s.from,-1),a=lU(this.atoms,s.to,1);(r!=s.from||a!=s.to)&&(o=rn.range(s.from==s.anchor?r:a,s.from==s.head?r:a))}o&&(t||(t=e.ranges.slice()),t[i]=o)}return t?rn.create(t,e.mainIndex):e}select(e){let{view:t}=this,i=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function BPe(n,e){let t=n.state.facet(Mbe);return t.length?t[0](e):ii.mac?e.metaKey:e.ctrlKey}function HPe(n,e){let t=n.state.facet(kbe);return t.length?t[0](e):ii.mac?!e.altKey:!e.ctrlKey}function VPe(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=$$(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let o=0;o<s.length;o++){let r=s[o];if(r.left<=e.clientX&&r.right>=e.clientX&&r.top<=e.clientY&&r.bottom>=e.clientY)return!0}return!1}function UPe(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=or.get(t))&&i.ignoreEvent(e))return!1;return!0}const Qg=Object.create(null),Vf=Object.create(null),Ybe=ii.ie&&ii.ie_version<15||ii.ios&&ii.webkit_version<604;function WPe(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),qbe(n,t.value)},50)}function U5(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function qbe(n,e){e=U5(n.state,jZ,e);let{state:t}=n,i,s=1,o=t.toText(e),r=o.lines==t.selection.ranges.length;if(Cj!=null&&t.selection.ranges.every(c=>c.empty)&&Cj==o.toString()){let c=-1;i=t.changeByRange(u=>{let d=t.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=t.toText((r?o.line(s++).text:e)+t.lineBreak);return{changes:{from:d.from,insert:f},range:rn.cursor(u.from+f.length)}})}else r?i=t.changeByRange(c=>{let u=o.line(s++);return{changes:{from:c.from,to:c.to,insert:u.text},range:rn.cursor(c.from+u.length)}}):i=t.replaceSelection(o);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Vf.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Qg.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Vf.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Vf.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Qg.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(Abe))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=KPe(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new FPe(n,e,t,i)),i&&n.observer.ignore(()=>{ube(n.contentDOM);let o=n.root.activeElement;o&&!o.contains(n.contentDOM)&&o.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function rle(n,e,t,i){if(i==1)return rn.cursor(e,t);if(i==2)return bPe(n.state,e,t);{let s=Nl.find(n.docView,e),o=n.state.doc.lineAt(s?s.posAtEnd:e),r=s?s.posAtStart:o.from,a=s?s.posAtEnd:o.to;return a<n.state.doc.length&&a==o.to&&a++,rn.range(r,a)}}let lle=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function GPe(n,e,t,i){let s=Nl.find(n.docView,e);if(!s)return 1;let o=e-s.posAtStart;if(o==0)return 1;if(o==s.length)return-1;let r=s.coordsAt(o,-1);if(r&&lle(t,i,r))return-1;let a=s.coordsAt(o,1);return a&&lle(t,i,a)?1:r&&r.bottom>=i?-1:1}function ale(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:GPe(n,t,e.clientX,e.clientY)}}const zPe=ii.ie&&ii.ie_version<=11;let cle=null,ule=0,dle=0;function Jbe(n){if(!zPe)return n.detail;let e=cle,t=dle;return cle=n,dle=Date.now(),ule=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(ule+1)%3:1}function KPe(n,e){let t=ale(n,e),i=Jbe(e),s=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),s=s.map(o.changes))},get(o,r,a){let c=ale(n,o),u,d=rle(n,c.pos,c.bias,i);if(t.pos!=c.pos&&!r){let f=rle(n,t.pos,t.bias,i),g=Math.min(f.from,d.from),p=Math.max(f.to,d.to);d=g<d.from?rn.range(g,p):rn.range(p,g)}return r?s.replaceRange(s.main.extend(d.from,d.to)):a&&i==1&&s.ranges.length>1&&(u=jPe(s,c.pos))?u:a?s.addRange(d):rn.create([d])}}}function jPe(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:s}=n.ranges[t];if(i<=e&&s>=e)return rn.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Qg.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.nearest(e.target);if(s&&s.isWidget){let o=s.posAtStart,r=o+s.length;(o>=t.to||r<=t.from)&&(t=rn.range(o,r))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",U5(n.state,XZ,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Qg.dragend=n=>(n.inputState.draggedContent=null,!1);function hle(n,e,t,i){if(t=U5(n.state,jZ,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,r=i&&o&&HPe(n,e)?{from:o.from,to:o.to}:null,a={from:s,insert:t},c=n.state.changes(r?[r,a]:a);n.focus(),n.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:r?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Qg.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,o=()=>{++s==t.length&&hle(n,e,i.filter(r=>r!=null).join(n.state.lineBreak),!1)};for(let r=0;r<t.length;r++){let a=new FileReader;a.onerror=o,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(i[r]=a.result),o()},a.readAsText(t[r])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return hle(n,e,i,!0),!0}return!1};Qg.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Ybe?null:e.clipboardData;return t?(qbe(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(WPe(n),!1)};function XPe(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function YPe(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:o}of n.selection.ranges){let r=n.doc.lineAt(o);r.number>s&&(e.push(r.text),t.push({from:r.from,to:Math.min(n.doc.length,r.to+1)})),s=r.number}i=!0}return{text:U5(n,XZ,e.join(n.lineBreak)),ranges:t,linewise:i}}let Cj=null;Qg.copy=Qg.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=YPe(n.state);if(!t&&!s)return!1;Cj=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=Ybe?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(XPe(n,t),!1)};const Qbe=yb.define();function Zbe(n,e){let t=[];for(let i of n.facet($be)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:Qbe.of(!0)}):null}function eTe(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Zbe(n.state,e);t?n.dispatch(t):n.update([])}},10)}Vf.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),eTe(n)};Vf.blur=n=>{n.observer.clearSelectionRange(),eTe(n)};Vf.compositionstart=Vf.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Vf.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,ii.chrome&&ii.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Vf.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Qg.beforeinput=(n,e)=>{var t,i;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let o=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),r=e.getTargetRanges();if(o&&r.length){let a=r[0],c=n.posAtDOM(a.startContainer,a.startOffset),u=n.posAtDOM(a.endContainer,a.endOffset);return QZ(n,{from:c,to:u,insert:n.state.toText(o)},null),!0}}let s;if(ii.chrome&&ii.android&&(s=jbe.find(o=>o.inputType==e.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let o=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>o+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return ii.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),ii.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Vf.compositionend(n,e),20),!1};const fle=new Set;function qPe(n){fle.has(n)||(fle.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const gle=["pre-wrap","normal","pre-line","break-spaces"];let HO=!1;function ple(){HO=!1}class JPe{constructor(e){this.lineWrapping=e,this.doc=Lo.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return gle.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let s=e[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(t=!0,this.heightSamples[Math.floor(s*10)]=!0)}return t}refresh(e,t,i,s,o,r){let a=gle.indexOf(e)>-1,c=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=o,c){this.heightSamples={};for(let u=0;u<r.length;u++){let d=r[u];d<0?u++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class QPe{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class vm{constructor(e,t,i,s,o){this.from=e,this.length=t,this.top=i,this.height=s,this._content=o}get type(){return typeof this._content=="number"?Mu.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof jC?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new vm(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var wr=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(wr||(wr={}));const aU=.001;class ku{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>aU&&(HO=!0),this.height=e)}replace(e,t,i){return ku.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let o=this,r=i.doc;for(let a=s.length-1;a>=0;a--){let{fromA:c,toA:u,fromB:d,toB:f}=s[a],g=o.lineAt(c,wr.ByPosNoHeight,i.setDoc(t),0,0),p=g.to>=u?g:o.lineAt(u,wr.ByPosNoHeight,i,0,0);for(f+=p.to-u,u=p.to;a>0&&g.from<=s[a-1].toA;)c=s[a-1].fromA,d=s[a-1].fromB,a--,c<g.from&&(g=o.lineAt(c,wr.ByPosNoHeight,i,0,0));d+=g.from-c,c=g.from;let _=ZZ.build(i.setDoc(r),e,d,f);o=G4(o,o.replace(c,u,_))}return o.updateHeight(i,0)}static empty(){return new ih(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,o=0;for(;;)if(t==i)if(s>o*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),i+=1+a.break,s-=a.size}else if(o>s*2){let a=e[i];a.break?e.splice(i,1,a.left,null,a.right):e.splice(i,1,a.left,a.right),i+=2+a.break,o-=a.size}else break;else if(s<o){let a=e[t++];a&&(s+=a.size)}else{let a=e[--i];a&&(o+=a.size)}let r=0;return e[t-1]==null?(r=1,t--):e[t]==null&&(r=1,i++),new ZPe(ku.of(e.slice(0,t)),r,ku.of(e.slice(i)))}}function G4(n,e){return n==e?n:(n.constructor!=e.constructor&&(HO=!0),e)}ku.prototype.size=1;class tTe extends ku{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,s){return new vm(s,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,s,o){return this.blockAt(0,i,s,o)}forEachLine(e,t,i,s,o,r){e<=o+this.length&&t>=o&&r(this.blockAt(0,i,s,o))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ih extends tTe{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new vm(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof ih||s instanceof tc&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof tc?s=new ih(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ku.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class tc extends ku{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,o=s-i+1,r,a=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*o);r=c/o,this.length>o+1&&(a=(this.height-c)/(this.length-o-1))}else r=this.height/o;return{firstLine:i,lastLine:s,perLine:r,perChar:a}}blockAt(e,t,i,s){let{firstLine:o,lastLine:r,perLine:a,perChar:c}=this.heightMetrics(t,s);if(t.lineWrapping){let u=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),d=t.doc.lineAt(u),f=a+d.length*c,g=Math.max(i,e-f/2);return new vm(d.from,d.length,g,f,0)}else{let u=Math.max(0,Math.min(r-o,Math.floor((e-i)/a))),{from:d,length:f}=t.doc.line(o+u);return new vm(d,f,i+a*u,a,0)}}lineAt(e,t,i,s,o){if(t==wr.ByHeight)return this.blockAt(e,i,s,o);if(t==wr.ByPosNoHeight){let{from:p,to:_}=i.doc.lineAt(e);return new vm(p,_-p,0,0,0)}let{firstLine:r,perLine:a,perChar:c}=this.heightMetrics(i,o),u=i.doc.lineAt(e),d=a+u.length*c,f=u.number-r,g=s+a*f+c*(u.from-o-f);return new vm(u.from,u.length,Math.max(s,Math.min(g,s+this.height-d)),d,0)}forEachLine(e,t,i,s,o,r){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:a,perLine:c,perChar:u}=this.heightMetrics(i,o);for(let d=e,f=s;d<=t;){let g=i.doc.lineAt(d);if(d==e){let _=g.number-a;f+=c*_+u*(e-o-_)}let p=c+u*g.length;r(new vm(g.from,g.length,f,p,0)),f+=p,d=g.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let o=i[i.length-1];o instanceof tc?i[i.length-1]=new tc(o.length+s):i.push(null,new tc(s-1))}if(e>0){let o=i[0];o instanceof tc?i[0]=new tc(e+o.length):i.unshift(new tc(e-1),null)}return ku.of(i)}decomposeLeft(e,t){t.push(new tc(e-1),null)}decomposeRight(e,t){t.push(null,new tc(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let o=t+this.length;if(s&&s.from<=t+this.length&&s.more){let r=[],a=Math.max(t,s.from),c=-1;for(s.from>t&&r.push(new tc(s.from-t-1).updateHeight(e,t));a<=o&&s.more;){let d=e.doc.lineAt(a).length;r.length&&r.push(null);let f=s.heights[s.index++];c==-1?c=f:Math.abs(f-c)>=aU&&(c=-2);let g=new ih(d,f);g.outdated=!1,r.push(g),a+=d+1}a<=o&&r.push(null,new tc(o-a).updateHeight(e,a));let u=ku.of(r);return(c<0||Math.abs(u.height-this.height)>=aU||Math.abs(c-this.heightMetrics(e,t).perLine)>=aU)&&(HO=!0),G4(this,u)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ZPe extends ku{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let o=i+this.left.height;return e<o?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,o,s+this.left.length+this.break)}lineAt(e,t,i,s,o){let r=s+this.left.height,a=o+this.left.length+this.break,c=t==wr.ByHeight?e<r:e<a,u=c?this.left.lineAt(e,t,i,s,o):this.right.lineAt(e,t,i,r,a);if(this.break||(c?u.to<a:u.from>a))return u;let d=t==wr.ByPosNoHeight?wr.ByPosNoHeight:wr.ByPos;return c?u.join(this.right.lineAt(a,d,i,r,a)):this.left.lineAt(a,d,i,s,o).join(u)}forEachLine(e,t,i,s,o,r){let a=s+this.left.height,c=o+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,t,i,s,o,r),t>=c&&this.right.forEachLine(e,t,i,a,c,r);else{let u=this.lineAt(c,wr.ByPos,i,s,o);e<u.from&&this.left.forEachLine(e,u.from-1,i,s,o,r),u.to>=e&&u.from<=t&&r(u),t>u.to&&this.right.forEachLine(u.to+1,t,i,a,c,r)}}replace(e,t,i){let s=this.left.length+this.break;if(t<s)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let o=[];e>0&&this.decomposeLeft(e,o);let r=o.length;for(let a of i)o.push(a);if(e>0&&mle(o,r-1),t<this.length){let a=o.length;this.decomposeRight(t,o),mle(o,a)}return ku.of(o)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<s&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ku.of(this.break?[e,null,t]:[e,t]):(this.left=G4(this.left,e),this.right=G4(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:o,right:r}=this,a=t+o.length+this.break,c=null;return s&&s.from<=t+o.length&&s.more?c=o=o.updateHeight(e,t,i,s):o.updateHeight(e,t,i),s&&s.from<=a+r.length&&s.more?c=r=r.updateHeight(e,a,i,s):r.updateHeight(e,a,i),c?this.balanced(o,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mle(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof tc&&(i=n[e+1])instanceof tc&&n.splice(e-1,3,new tc(t.length+1+i.length))}const eFe=5;class ZZ{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof ih?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ih(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let r=t-e;i.block?this.addBlock(new tTe(r,s,i)):(r||o||s>=eFe)&&this.addLineDeco(s,o,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ih(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new tc(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ih)return e;let t=new ih(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ih)&&!this.isCovered?this.nodes.push(new ih(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let s of this.nodes)s instanceof ih&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let o=new ZZ(i,e);return oo.spans(t,i,s,o,0),o.finish(i)}}function tFe(n,e,t){let i=new nFe;return oo.compare(n,e,t,i,0),i.changes}class nFe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&rU(e,t,this.changes,5)}}function iFe(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,o=Math.max(0,t.left),r=Math.min(s.innerWidth,t.right),a=Math.max(0,t.top),c=Math.min(s.innerHeight,t.bottom);for(let u=n.parentNode;u&&u!=i.body;)if(u.nodeType==1){let d=u,f=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let g=d.getBoundingClientRect();o=Math.max(o,g.left),r=Math.min(r,g.right),a=Math.max(a,g.top),c=Math.min(u==n.parentNode?s.innerHeight:c,g.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:o-t.left,right:Math.max(o,r)-t.left,top:a-(t.top+e),bottom:Math.max(a,c)-(t.top+e)}}function sFe(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class bz{constructor(e,t,i,s){this.from=e,this.to=t,this.size=i,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],o=t[i];if(s.from!=o.from||s.to!=o.to||s.size!=o.size)return!1}return!0}draw(e,t){return yi.replace({widget:new oFe(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class oFe extends Eb{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class _le{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=vle,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Or.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(YZ).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new JPe(t),this.stateDeco=e.facet(x$).filter(i=>typeof i!="function"),this.heightMap=ku.empty().applyChanges(this.stateDeco,Lo.empty,this.heightOracle.setDoc(e.doc),[new Df(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=yi.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:o,to:r})=>s>=o&&s<=r)){let{from:o,to:r}=this.lineBlockAt(s);e.push(new eH(o,r))}}return this.viewports=e.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?vle:new eee(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(tD(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(x$).filter(d=>typeof d!="function");let s=e.changedRanges,o=Df.extendWithRanges(s,tFe(i,this.stateDeco,e?e.changes:da.empty(this.state.doc.length))),r=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);ple(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=r||HO)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let c=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Pbe)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Or.RTL:Or.LTR;let r=this.heightOracle.mustRefreshForWrapping(o),a=t.getBoundingClientRect(),c=r||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,d=0;if(a.width&&a.height){let{scaleX:L,scaleY:O}=cbe(t,a);(L>.005&&Math.abs(this.scaleX-L)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=L,this.scaleY=O,u|=16,r=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=g)&&(this.paddingTop=f,this.paddingBottom=g,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=hbe(e.scrollDOM);let _=(this.printing?sFe:iFe)(t,this.paddingTop),v=_.top-this.pixelViewport.top,C=_.bottom-this.pixelViewport.bottom;this.pixelViewport=_;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(c=!0)),!this.inView&&!this.scrollTarget)return 0;let w=a.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),c){let L=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(L)&&(r=!0),r||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:O,charWidth:A,textHeight:N}=e.docView.measureTextSize();r=O>0&&s.refresh(o,O,A,N,w/A,L),r&&(e.docView.minWidth=0,u|=16)}v>0&&C>0?d=Math.max(v,C):v<0&&C<0&&(d=Math.min(v,C)),ple();for(let O of this.viewports){let A=O.from==this.viewport.from?L:e.docView.measureVisibleLineHeights(O);this.heightMap=(r?ku.empty().applyChanges(this.stateDeco,Lo.empty,this.heightOracle,[new Df(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,r,new QPe(O.from,A))}HO&&(u|=2)}let I=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return I&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||I)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,o=this.heightOracle,{visibleTop:r,visibleBottom:a}=this,c=new eH(s.lineAt(r-i*1e3,wr.ByHeight,o,0,0).from,s.lineAt(a+(1-i)*1e3,wr.ByHeight,o,0,0).to);if(t){let{head:u}=t.range;if(u<c.from||u>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(u,wr.ByPos,o,0,0),g;t.y=="center"?g=(f.top+f.bottom)/2-d/2:t.y=="start"||t.y=="nearest"&&u<c.from?g=f.top:g=f.bottom-d,c=new eH(s.lineAt(g-1e3/2,wr.ByHeight,o,0,0).from,s.lineAt(g+d+1e3/2,wr.ByHeight,o,0,0).to)}}return c}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new eH(this.heightMap.lineAt(i,wr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,wr.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,wr.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,wr.ByPos,this.heightOracle,0,0),{visibleTop:r,visibleBottom:a}=this;return(e==0||s<=r-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||o>=a+Math.max(10,Math.min(i,250)))&&s>r-2*1e3&&o<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let s of e)t.touchesRange(s.from,s.to)||i.push(new bz(t.mapPos(s.from),t.mapPos(s.to),s.size,s.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,o=s>>1,r=s<<1;if(this.defaultTextDirection!=Or.LTR&&!i)return[];let a=[],c=(d,f,g,p)=>{if(f-d<o)return;let _=this.state.selection.main,v=[_.from];_.empty||v.push(_.to);for(let y of v)if(y>d&&y<f){c(d,y-10,g,p),c(y+10,f,g,p);return}let C=lFe(e,y=>y.from>=g.from&&y.to<=g.to&&Math.abs(y.from-d)<o&&Math.abs(y.to-f)<o&&!v.some(w=>y.from<w&&y.to>w));if(!C){if(f<g.to&&t&&i&&t.visibleRanges.some(I=>I.from<=f&&I.to>=f)){let I=t.moveToLineBoundary(rn.cursor(f),!1,!0).head;I>d&&(f=I)}let y=this.gapSize(g,d,f,p),w=i||y<2e6?y:2e6;C=new bz(d,f,y,w)}a.push(C)},u=d=>{if(d.length<r||d.type!=Mu.Text)return;let f=rFe(d.from,d.to,this.stateDeco);if(f.total<r)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,p,_;if(i){let v=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,C,y;if(g!=null){let w=nH(f,g),I=((this.visibleBottom-this.visibleTop)/2+v)/d.height;C=w-I,y=w+I}else C=(this.visibleTop-d.top-v)/d.height,y=(this.visibleBottom-d.top+v)/d.height;p=tH(f,C),_=tH(f,y)}else{let v=f.total*this.heightOracle.charWidth,C=s*this.heightOracle.charWidth,y=0;if(v>2e6)for(let A of e)A.from>=d.from&&A.from<d.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=A.size-A.displaySize);let w=this.pixelViewport.left+y,I=this.pixelViewport.right+y,L,O;if(g!=null){let A=nH(f,g),N=((I-w)/2+C)/v;L=A-N,O=A+N}else L=(w-C)/v,O=(I+C)/v;p=tH(f,L),_=tH(f,O)}p>d.from&&c(d.from,p,d,f),_<d.to&&c(_,d.to,d,f)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(u):u(d);return a}gapSize(e,t,i,s){let o=nH(s,i)-nH(s,t);return this.heightOracle.lineWrapping?e.height*o:s.total*this.heightOracle.charWidth*o}updateLineGaps(e){bz.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=yi.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];oo.spans(t,this.viewport.from,this.viewport.to,{span(o,r){i.push({from:o,to:r})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let o=0;o<i.length&&!(s&8);o++){let r=this.visibleRanges[o],a=i[o];(r.from!=a.from||r.to!=a.to)&&(s|=4,e&&e.mapPos(r.from,-1)==a.from&&e.mapPos(r.to,1)==a.to||(s|=8))}return this.visibleRanges=i,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||tD(this.heightMap.lineAt(e,wr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||tD(this.heightMap.lineAt(this.scaler.fromDOM(e),wr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return tD(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let eH=class{constructor(e,t){this.from=e,this.to=t}};function rFe(n,e,t){let i=[],s=n,o=0;return oo.spans(t,n,e,{span(){},point(r,a){r>s&&(i.push({from:s,to:r}),o+=r-s),s=a}},20),s<e&&(i.push({from:s,to:e}),o+=e-s),{total:o,ranges:i}}function tH({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:o,to:r}=e[s],a=r-o;if(i<=a)return o+i;i-=a}}function nH(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function lFe(n,e){for(let t of n)if(e(t))return t}const vle={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class eee{constructor(e,t,i){let s=0,o=0,r=0;this.viewports=i.map(({from:a,to:c})=>{let u=t.lineAt(a,wr.ByPos,e,0,0).top,d=t.lineAt(c,wr.ByPos,e,0,0).bottom;return s+=d-u,{from:a,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let a of this.viewports)a.domTop=r+(a.top-o)*this.scale,r=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return s+(e-i)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);i=o.bottom,s=o.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return i+(e-s)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);i=o.bottom,s=o.domBottom}}eq(e){return e instanceof eee?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function tD(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new vm(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>tD(s,e)):n._content)}const iH=oi.define({combine:n=>n.join(" ")}),yj=oi.define({combine:n=>n.indexOf(!0)>-1}),Ej=zC.newName(),nTe=zC.newName(),iTe=zC.newName(),sTe={"&light":"."+nTe,"&dark":"."+iTe};function Sj(n,e,t){return new zC(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const aFe=Sj("."+Ej,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},sTe),cFe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Tz=ii.ie&&ii.ie_version<=11;class uFe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Xxe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(ii.ie&&ii.ie_version<=11||ii.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(ii.chrome&&ii.chrome_version<126)&&(this.editContext=new hFe(e),e.state.facet(Dv)&&(e.contentDOM.editContext=this.editContext.editContext)),Tz&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Dv)?i.root.activeElement!=this.dom:!oU(this.dom,s))return;let o=s.anchorNode&&i.docView.nearest(s.anchorNode);if(o&&o.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ii.ie&&ii.ie_version<=11||ii.android&&ii.chrome)&&!i.state.selection.main.empty&&s.focusNode&&kD(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=$$(e.root);if(!t)return!1;let i=ii.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&dFe(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=oU(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&qxe(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,cFe),Tz&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Tz&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let s=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&sO(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let o of e){let r=this.readMutation(o);r&&(r.typeOver&&(s=!0),t==-1?{from:t,to:i}=r:(t=Math.min(r.from,t),i=Math.max(r.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&oU(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new RPe(this.view,e,t,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,s=Kbe(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=ble(t,e.previousSibling||e.target.previousSibling,-1),s=ble(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Dv)!=e.state.facet(Dv)&&(e.view.contentDOM.editContext=e.state.facet(Dv)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ble(n,e,t){for(;e;){let i=or.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Tle(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,o=e.endOffset,r=n.docView.domAtPos(n.state.selection.main.anchor);return kD(r.node,r.offset,s,o)&&([t,i,s,o]=[s,o,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:o}}function dFe(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return Tle(n,s)}let t=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?Tle(n,t):null}class hFe{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:s}=e.state.selection.main,o=this.toEditorPos(i.updateRangeStart),r=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:o,drifted:!1});let a={from:o,to:r,insert:Lo.of(i.text.split(`
- `))};if(a.from==this.from&&s<this.from?a.from=s:a.to==this.to&&s>this.to&&(a.to=s),!(a.from==a.to&&!a.insert.length)){if(this.pendingContextChange=a,!e.state.readOnly){let c=this.to-this.from+(a.to-a.from+a.insert.length);QZ(e,a,rn.single(this.toEditorPos(i.selectionStart,c),this.toEditorPos(i.selectionEnd,c)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))}},this.handlers.characterboundsupdate=i=>{let s=[],o=null;for(let r=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);r<a;r++){let c=e.coordsForChar(r);o=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||o||new DOMRect,s.push(o)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let o of i.getTextFormats()){let r=o.underlineStyle,a=o.underlineThickness;if(r!="None"&&a!="None"){let c=this.toEditorPos(o.rangeStart),u=this.toEditorPos(o.rangeEnd);if(c<u){let d=`text-decoration: underline ${r=="Dashed"?"dashed ":r=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;s.push(yi.mark({attributes:{style:d}}).range(c,u))}}}e.dispatch({effects:Bbe.of(yi.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=$$(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((o,r,a,c,u)=>{if(i)return;let d=u.length-(r-o);if(s&&r>=s.to)if(s.from==o&&s.to==r&&s.insert.eq(u)){s=this.pendingContextChange=null,t+=d,this.to+=d;return}else s=null,this.revertPending(e.state);if(o+=t,r+=t,r<=this.from)this.from+=d,this.to+=d;else if(o<this.to){if(o<this.from||r>this.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(r),u.toString()),this.to+=d}t+=d}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;this.composing&&(this.composing.drifted||e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ni{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(s=>s.forEach(o=>i(o,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Yxe(e.parent)||document,this.viewState=new _le(e.state||Rr.create(e)),e.scrollTo&&e.scrollTo.is(JB)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(QN).map(s=>new mz(s));for(let s of this.plugins)s.update(this);this.observer=new uFe(this),this.inputState=new DPe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Qre(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof pa?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,o=this.state;for(let g of e){if(g.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=g.state}if(this.destroyed){this.viewState.state=o;return}let r=this.hasFocus,a=0,c=null;e.some(g=>g.annotation(Qbe))?(this.inputState.notifiedFocused=r,a=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,c=Zbe(o,r),c||(a=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(d=null)):this.observer.clear(),o.facet(Rr.phrases)!=this.state.facet(Rr.phrases))return this.setState(o);s=W4.create(this,o,e),s.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(f&&(f=f.map(g.changes)),g.scrollIntoView){let{main:p}=g.state.selection;f=new oO(p.empty?p:rn.cursor(p.head,p.head>p.anchor?-1:1))}for(let p of g.effects)p.is(JB)&&(f=p.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=z4.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ZN)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(iH)!=s.state.facet(iH)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(vj))try{g(s)}catch(p){vd(this.state,p,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!Kbe(this,d)&&u.force&&sO(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new _le(e),this.plugins=e.facet(QN).map(i=>new mz(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Qre(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(QN),i=e.state.facet(QN);if(t!=i){let s=[];for(let o of i){let r=t.indexOf(o);if(r<0)s.push(new mz(o));else{let a=this.plugins[r];a.mustUpdate=e,s.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){vd(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:r}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(r<0)if(hbe(i))o=-1,r=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(s);o=p.from,r=p.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(p=>{try{return p.read(this)}catch(_){return vd(this.state,_),Cle}}),f=W4.create(this,this.state,[]),g=!1;f.flags|=c,t?t.flags|=c:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),g=this.docView.update(f),g&&this.docViewUpdate());for(let p=0;p<u.length;p++)if(d[p]!=Cle)try{let _=u[p];_.write&&_.write(d[p],this)}catch(_){vd(this.state,_)}if(g&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,r=-1;continue}else{let _=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-r;if(_>1||_<-1){s=s+_,i.scrollTop=s/this.scaleY,r=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(vj))a(t)}get themeClasses(){return Ej+" "+(this.state.facet(yj)?iTe:nTe)+" "+this.state.facet(iH)}updateAttrs(){let e=yle(this,Hbe,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Dv)?"true":"false",class:"cm-content",style:`${ii.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),yle(this,YZ,t);let i=this.observer.ignore(()=>{let s=fj(this.contentDOM,this.contentAttrs,t),o=fj(this.dom,this.editorAttrs,e);return s||o});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(ni.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ZN);let e=this.state.facet(ni.cspNonce);zC.mount(this.root,this.styleModules.concat(aFe).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return vz(this,e,ile(this,e,t,i))}moveByGroup(e,t){return vz(this,e,ile(this,e,t,i=>wPe(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),o=i[t?i.length-1:0];return rn.cursor(o.side(t,s)+e.from,o.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return SPe(this,e,t,i)}moveVertically(e,t,i){return vz(this,e,IPe(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),zbe(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),o=this.bidiSpans(s),r=o[gC.find(o,e-s.from,-1,t)];return KP(i,r.dir==Or.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(xbe)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>fFe)return Obe(e.length);let t=this.textDirectionAt(e.from),i;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||Lbe(o.isolates,i=Jre(this,e))))return o.order;i||(i=Jre(this,e));let s=aPe(e.text,t,i);return this.bidiCache.push(new z4(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ii.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ube(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return JB.of(new oO(typeof e=="number"?rn.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return JB.of(new oO(rn.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Il.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Il.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=zC.newName(),s=[iH.of(i),ZN.of(Sj(`.${i}`,e))];return t&&t.dark&&s.push(yj.of(!0)),s}static baseTheme(e){return Mw.lowest(ZN.of(Sj("."+Ej,e,sTe)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&or.get(i)||or.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}ni.styleModule=ZN;ni.inputHandler=Dbe;ni.clipboardInputFilter=jZ;ni.clipboardOutputFilter=XZ;ni.scrollHandler=Fbe;ni.focusChangeEffect=$be;ni.perLineTextDirection=xbe;ni.exceptionSink=Nbe;ni.updateListener=vj;ni.editable=Dv;ni.mouseSelectionStyle=Abe;ni.dragMovesSelection=kbe;ni.clickAddsSelectionRange=Mbe;ni.decorations=x$;ni.outerDecorations=Vbe;ni.atomicRanges=qZ;ni.bidiIsolatedRanges=Ube;ni.scrollMargins=Wbe;ni.darkTheme=yj;ni.cspNonce=oi.define({combine:n=>n.length?n[0]:""});ni.contentAttributes=YZ;ni.editorAttributes=Hbe;ni.lineWrapping=ni.contentAttributes.of({class:"cm-lineWrapping"});ni.announce=ls.define();const fFe=4096,Cle={};class z4{constructor(e,t,i,s,o,r){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=o,this.order=r}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:Or.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let r=e[o];r.dir==s&&!t.touchesRange(r.from,r.to)&&i.push(new z4(t.mapPos(r.from,1),t.mapPos(r.to,-1),r.dir,r.isolates,!1,r.order))}return i}}function yle(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let o=i[s],r=typeof o=="function"?o(n):o;r&&hj(r,t)}return t}const gFe=ii.mac?"mac":ii.windows?"win":ii.linux?"linux":"key";function pFe(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,o,r,a;for(let c=0;c<t.length-1;++c){const u=t[c];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))s=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))r=!0;else if(/^mod$/i.test(u))e=="mac"?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return s&&(i="Alt-"+i),o&&(i="Ctrl-"+i),a&&(i="Meta-"+i),r&&(i="Shift-"+i),i}function sH(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const mFe=Mw.default(ni.domEventHandlers({keydown(n,e){return rTe(oTe(e.state),n,e,"editor")}})),W5=oi.define({enables:mFe}),Ele=new WeakMap;function oTe(n){let e=n.facet(W5),t=Ele.get(e);return t||Ele.set(e,t=bFe(e.reduce((i,s)=>i.concat(s),[]))),t}function _Fe(n,e,t){return rTe(oTe(n.state),e,n,t)}let rC=null;const vFe=4e3;function bFe(n,e=gFe){let t=Object.create(null),i=Object.create(null),s=(r,a)=>{let c=i[r];if(c==null)i[r]=a;else if(c!=a)throw new Error("Key binding "+r+" is used both as a regular binding and as a multi-stroke prefix")},o=(r,a,c,u,d)=>{var f,g;let p=t[r]||(t[r]=Object.create(null)),_=a.split(/ (?!$)/).map(y=>pFe(y,e));for(let y=1;y<_.length;y++){let w=_.slice(0,y).join(" ");s(w,!0),p[w]||(p[w]={preventDefault:!0,stopPropagation:!1,run:[I=>{let L=rC={view:I,prefix:w,scope:r};return setTimeout(()=>{rC==L&&(rC=null)},vFe),!0}]})}let v=_.join(" ");s(v,!1);let C=p[v]||(p[v]={preventDefault:!1,stopPropagation:!1,run:((g=(f=p._any)===null||f===void 0?void 0:f.run)===null||g===void 0?void 0:g.slice())||[]});c&&C.run.push(c),u&&(C.preventDefault=!0),d&&(C.stopPropagation=!0)};for(let r of n){let a=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let u of a){let d=t[u]||(t[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=r;for(let g in d)d[g].run.push(p=>f(p,wj))}let c=r[e]||r.key;if(c)for(let u of a)o(u,c,r.run,r.preventDefault,r.stopPropagation),r.shift&&o(u,"Shift-"+c,r.shift,r.preventDefault,r.stopPropagation)}return t}let wj=null;function rTe(n,e,t,i){wj=e;let s=Gxe(e),o=dd(s,0),r=_m(o)==s.length&&s!=" ",a="",c=!1,u=!1,d=!1;rC&&rC.view==t&&rC.scope==i&&(a=rC.prefix+" ",Xbe.indexOf(e.keyCode)<0&&(u=!0,rC=null));let f=new Set,g=C=>{if(C){for(let y of C.run)if(!f.has(y)&&(f.add(y),y(t)))return C.stopPropagation&&(d=!0),!0;C.preventDefault&&(C.stopPropagation&&(d=!0),u=!0)}return!1},p=n[i],_,v;return p&&(g(p[a+sH(s,e,!r)])?c=!0:r&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ii.windows&&e.ctrlKey&&e.altKey)&&(_=KC[e.keyCode])&&_!=s?(g(p[a+sH(_,e,!0)])||e.shiftKey&&(v=D$[e.keyCode])!=s&&v!=_&&g(p[a+sH(v,e,!1)]))&&(c=!0):r&&e.shiftKey&&g(p[a+sH(s,e,!0)])&&(c=!0),!c&&g(p._any)&&(c=!0)),u&&(c=!0),c&&d&&e.stopPropagation(),wj=null,c}class XP{constructor(e,t,i,s,o){this.className=e,this.left=t,this.top=i,this.width=s,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let o=lTe(e);return[new XP(t,s.left-o.left,s.top-o.top,null,s.bottom-s.top)]}else return TFe(e,t,i)}}function lTe(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Or.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Sle(n,e,t,i){let s=n.coordsAtPos(e,t*2);if(!s)return i;let o=n.dom.getBoundingClientRect(),r=(s.top+s.bottom)/2,a=n.posAtCoords({x:o.left+1,y:r}),c=n.posAtCoords({x:o.right-1,y:r});return a==null||c==null?i:{from:Math.max(i.from,Math.min(a,c)),to:Math.min(i.to,Math.max(a,c))}}function TFe(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),o=n.textDirection==Or.LTR,r=n.contentDOM,a=r.getBoundingClientRect(),c=lTe(n),u=r.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=a.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=a.right-(d?parseInt(d.paddingRight):0),p=Tj(n,i),_=Tj(n,s),v=p.type==Mu.Text?p:null,C=_.type==Mu.Text?_:null;if(v&&(n.lineWrapping||p.widgetLineBreaks)&&(v=Sle(n,i,1,v)),C&&(n.lineWrapping||_.widgetLineBreaks)&&(C=Sle(n,s,-1,C)),v&&C&&v.from==C.from&&v.to==C.to)return w(I(t.from,t.to,v));{let O=v?I(t.from,null,v):L(p,!1),A=C?I(null,t.to,C):L(_,!0),N=[];return(v||p).to<(C||_).from-(v&&C?1:0)||p.widgetLineBreaks>1&&O.bottom+n.defaultLineHeight/2<A.top?N.push(y(f,O.bottom,g,A.top)):O.bottom<A.top&&n.elementAtHeight((O.bottom+A.top)/2).type==Mu.Text&&(O.bottom=A.top=(O.bottom+A.top)/2),w(O).concat(N).concat(w(A))}function y(O,A,N,D){return new XP(e,O-c.left,A-c.top,N-O,D-A)}function w({top:O,bottom:A,horizontal:N}){let D=[];for(let P=0;P<N.length;P+=2)D.push(y(N[P],O,N[P+1],A));return D}function I(O,A,N){let D=1e9,P=-1e9,F=[];function V(de,q,K,re,Z){let J=n.coordsAtPos(de,de==N.to?-2:2),ge=n.coordsAtPos(K,K==N.from?2:-2);!J||!ge||(D=Math.min(J.top,ge.top,D),P=Math.max(J.bottom,ge.bottom,P),Z==Or.LTR?F.push(o&&q?f:J.left,o&&re?g:ge.right):F.push(!o&&re?f:ge.left,!o&&q?g:J.right))}let U=O??N.from,Q=A??N.to;for(let de of n.visibleRanges)if(de.to>U&&de.from<Q)for(let q=Math.max(de.from,U),K=Math.min(de.to,Q);;){let re=n.state.doc.lineAt(q);for(let Z of n.bidiSpans(re)){let J=Z.from+re.from,ge=Z.to+re.from;if(J>=K)break;ge>q&&V(Math.max(J,q),O==null&&J<=U,Math.min(ge,K),A==null&&ge>=Q,Z.dir)}if(q=re.to+1,q>=K)break}return F.length==0&&V(U,O==null,Q,A==null,n.textDirection),{top:D,bottom:P,horizontal:F}}function L(O,A){let N=a.top+(A?O.top:O.bottom);return{top:N,bottom:N,horizontal:[]}}}function CFe(n,e){return n.constructor==e.constructor&&n.eq(e)}class yFe{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(cU)!=e.state.facet(cU)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(cU);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!CFe(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const cU=oi.define();function aTe(n){return[Il.define(e=>new yFe(e,n)),cU.of(n)]}const cTe=!(ii.ios&&ii.webkit&&ii.webkit_version<534),P$=oi.define({combine(n){return o_(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function EFe(n={}){return[P$.of(n),SFe,wFe,IFe,Pbe.of(!0)]}function uTe(n){return n.startState.facet(P$)!=n.state.facet(P$)}const SFe=aTe({above:!0,markers(n){let{state:e}=n,t=e.facet(P$),i=[];for(let s of e.selection.ranges){let o=s==e.selection.main;if(s.empty?!o||cTe:t.drawRangeCursor){let r=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=s.empty?s:rn.cursor(s.head,s.head>s.anchor?-1:1);for(let c of XP.forRange(n,r,a))i.push(c)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=uTe(n);return t&&wle(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){wle(e.state,n)},class:"cm-cursorLayer"});function wle(n,e){e.style.animationDuration=n.facet(P$).cursorBlinkRate+"ms"}const wFe=aTe({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:XP.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||uTe(n)},class:"cm-selectionLayer"}),Ij={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};cTe&&(Ij[".cm-line"].caretColor=Ij[".cm-content"].caretColor="transparent !important");const IFe=Mw.highest(ni.theme(Ij)),dTe=ls.define({map(n,e){return n==null?null:e.mapPos(n)}}),nD=hc.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(dTe)?i.value:t,n)}}),LFe=Il.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(nD);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(nD)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(nD),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(nD)!=n&&this.view.dispatch({effects:dTe.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function OFe(){return[nD,LFe]}function Ile(n,e,t,i,s){e.lastIndex=0;for(let o=n.iterRange(t,i),r=t,a;!o.next().done;r+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)s(r+a.index,a)}function RFe(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:o}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),o=Math.min(n.state.doc.lineAt(o).to,o+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=o:i.push({from:s,to:o});return i}class MFe{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:o,maxLength:r=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(a,c,u,d)=>s(d,u,u+a[0].length,a,c);else if(typeof i=="function")this.addMatch=(a,c,u,d)=>{let f=i(a,c,u);f&&d(u,u+a[0].length,f)};else if(i)this.addMatch=(a,c,u,d)=>d(u,u+a[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=r}createDeco(e){let t=new sb,i=t.add.bind(t);for(let{from:s,to:o}of RFe(e,this.maxLength))Ile(e.state.doc,this.regexp,s,o,(r,a)=>this.addMatch(a,e,r,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((o,r,a,c)=>{c>=e.view.viewport.from&&a<=e.view.viewport.to&&(i=Math.min(a,i),s=Math.max(c,s))}),e.viewportMoved||s-i>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let o of e.visibleRanges){let r=Math.max(o.from,i),a=Math.min(o.to,s);if(a>r){let c=e.state.doc.lineAt(r),u=c.to<a?e.state.doc.lineAt(a):c,d=Math.max(o.from,c.from),f=Math.min(o.to,u.to);if(this.boundary){for(;r>c.from;r--)if(this.boundary.test(c.text[r-1-c.from])){d=r;break}for(;a<u.to;a++)if(this.boundary.test(u.text[a-u.from])){f=a;break}}let g=[],p,_=(v,C,y)=>g.push(y.range(v,C));if(c==u)for(this.regexp.lastIndex=d-c.from;(p=this.regexp.exec(c.text))&&p.index<f-c.from;)this.addMatch(p,e,p.index+c.from,_);else Ile(e.state.doc,this.regexp,d,f,(v,C)=>this.addMatch(C,e,v,_));t=t.update({filterFrom:d,filterTo:f,filter:(v,C)=>v<d||C>f,add:g})}}return t}}const Lj=/x/.unicode!=null?"gu":"g",kFe=new RegExp(`[\0-\b
- --\u2028\u2029\uFEFF-]`,Lj),AFe={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Cz=null;function NFe(){var n;if(Cz==null&&typeof document<"u"&&document.body){let e=document.body.style;Cz=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Cz||!1}const uU=oi.define({combine(n){let e=o_(n,{render:null,specialChars:kFe,addSpecialChars:null});return(e.replaceTabs=!NFe())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Lj)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Lj)),e}});function DFe(n={}){return[uU.of(n),$Fe()]}let Lle=null;function $Fe(){return Lle||(Lle=Il.fromClass(class{constructor(n){this.view=n,this.decorations=yi.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(uU)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new MFe({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,o=dd(e[0],0);if(o==9){let r=s.lineAt(i),a=t.state.tabSize,c=YR(r.text,a,i-r.from);return yi.replace({widget:new BFe((a-c%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=yi.replace({widget:new FFe(n,o)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(uU);n.startState.facet(uU)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const xFe="•";function PFe(n){return n>=32?xFe:n==10?"":String.fromCharCode(9216+n)}class FFe extends Eb{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=PFe(this.code),i=e.state.phrase("Control character")+" "+(AFe[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let o=document.createElement("span");return o.textContent=t,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class BFe extends Eb{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function HFe(){return UFe}const VFe=yi.line({class:"cm-activeLine"}),UFe=Il.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(VFe.range(s.from)),e=s.from)}return yi.set(t)}},{decorations:n=>n.decorations});let WFe=class extends Eb{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?PO(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=KP(t[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return s.bottom-s.top>o*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+o}:s}ignoreEvent(){return!1}};function GFe(n){return Il.fromClass(class{constructor(e){this.view=e,this.placeholder=n?yi.set([yi.widget({widget:new WFe(n),side:1}).range(0)]):yi.none}get decorations(){return this.view.state.doc.length?yi.none:this.placeholder}},{decorations:e=>e.decorations})}const Oj=2e3;function zFe(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),o=[];if(e.off>Oj||t.off>Oj||e.col<0||t.col<0){let r=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let c=i;c<=s;c++){let u=n.doc.line(c);u.length<=a&&o.push(rn.range(u.from+r,u.to+a))}}else{let r=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let c=i;c<=s;c++){let u=n.doc.line(c),d=oj(u.text,r,n.tabSize,!0);if(d<0)o.push(rn.cursor(u.to));else{let f=oj(u.text,a,n.tabSize);o.push(rn.range(u.from+d,u.from+f))}}}return o}function KFe(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Ole(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,o=s>Oj?-1:s==i.length?KFe(n,e.clientX):YR(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:o,off:s}}function jFe(n,e){let t=Ole(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let o=s.changes.mapPos(s.startState.doc.line(t.line).from),r=s.state.doc.lineAt(o);t={line:r.number,col:t.col,off:Math.min(t.off,r.length)},i=i.map(s.changes)}},get(s,o,r){let a=Ole(n,s);if(!a)return i;let c=zFe(n.state,t,a);return c.length?r?rn.create(c.concat(i.ranges)):rn.create(c):i}}:null}function XFe(n){let e=t=>t.altKey&&t.button==0;return ni.mouseSelectionStyle.of((t,i)=>e(i)?jFe(t,i):null)}const YFe={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},qFe={style:"cursor: crosshair"};function JFe(n={}){let[e,t]=YFe[n.key||"Alt"],i=Il.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,ni.contentAttributes.of(s=>{var o;return!((o=s.plugin(i))===null||o===void 0)&&o.isDown?qFe:null})]}const bN="-10000px";class hTe{constructor(e,t,i,s){this.facet=t,this.createTooltipView=i,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(r=>r);let o=null;this.tooltipViews=this.tooltips.map(r=>o=i(r,o))}update(e,t){var i;let s=e.state.facet(this.facet),o=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let r=[],a=t?[]:null;for(let c=0;c<o.length;c++){let u=o[c],d=-1;if(u){for(let f=0;f<this.tooltips.length;f++){let g=this.tooltips[f];g&&g.create==u.create&&(d=f)}if(d<0)r[c]=this.createTooltipView(u,c?r[c-1]:null),a&&(a[c]=!!u.above);else{let f=r[c]=this.tooltipViews[d];a&&(a[c]=t[d]),f.update&&f.update(e)}}}for(let c of this.tooltipViews)r.indexOf(c)<0&&(this.removeTooltipView(c),(i=c.destroy)===null||i===void 0||i.call(c));return t&&(a.forEach((c,u)=>t[u]=c),t.length=a.length),this.input=s,this.tooltips=o,this.tooltipViews=r,!0}}function QFe(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const yz=oi.define({combine:n=>{var e,t,i;return{position:ii.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||QFe}}}),Rle=new WeakMap,tee=Il.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(yz);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new hTe(n,nee,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(yz);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=bN,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(ii.gecko)t=o.offsetParent!=this.container.ownerDocument.body;else if(o.style.top==bN&&o.style.left=="0px"){let r=o.getBoundingClientRect();t=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(t||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(n=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=JZ(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,r)=>{let a=this.manager.tooltipViews[r];return a.getCoords?a.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(yz).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:i,scaleX:s,scaleY:o}=n,r=[];for(let a=0;a<this.manager.tooltips.length;a++){let c=this.manager.tooltips[a],u=this.manager.tooltipViews[a],{dom:d}=u,f=n.pos[a],g=n.size[a];if(!f||c.clip!==!1&&(f.bottom<=Math.max(t.top,i.top)||f.top>=Math.min(t.bottom,i.bottom)||f.right<Math.max(t.left,i.left)-.1||f.left>Math.min(t.right,i.right)+.1)){d.style.top=bN;continue}let p=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,_=p?7:0,v=g.right-g.left,C=(e=Rle.get(u))!==null&&e!==void 0?e:g.bottom-g.top,y=u.offset||e2e,w=this.view.textDirection==Or.LTR,I=g.width>i.right-i.left?w?i.left:i.right-g.width:w?Math.max(i.left,Math.min(f.left-(p?14:0)+y.x,i.right-v)):Math.min(Math.max(i.left,f.left-v+(p?14:0)-y.x),i.right-v),L=this.above[a];!c.strictSide&&(L?f.top-C-_-y.y<i.top:f.bottom+C+_+y.y>i.bottom)&&L==i.bottom-f.bottom>f.top-i.top&&(L=this.above[a]=!L);let O=(L?f.top-i.top:i.bottom-f.bottom)-_;if(O<C&&u.resize!==!1){if(O<this.view.defaultLineHeight){d.style.top=bN;continue}Rle.set(u,C),d.style.height=(C=O)/o+"px"}else d.style.height&&(d.style.height="");let A=L?f.top-C-_-y.y:f.bottom+_+y.y,N=I+v;if(u.overlap!==!0)for(let D of r)D.left<N&&D.right>I&&D.top<A+C&&D.bottom>A&&(A=L?D.top-C-2-_:D.bottom+_+2);if(this.position=="absolute"?(d.style.top=(A-n.parent.top)/o+"px",Mle(d,(I-n.parent.left)/s)):(d.style.top=A/o+"px",Mle(d,I/s)),p){let D=f.left+(w?y.x:-y.x)-(I+14-7);p.style.left=D/s+"px"}u.overlap!==!0&&r.push({left:I,top:A,right:N,bottom:A+C}),d.classList.toggle("cm-tooltip-above",L),d.classList.toggle("cm-tooltip-below",!L),u.positioned&&u.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=bN}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Mle(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const ZFe=ni.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),e2e={x:0,y:0},nee=oi.define({enables:[tee,ZFe]}),K4=oi.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class G5{static create(e){return new G5(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new hTe(e,K4,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let s=i[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const t2e=nee.compute([K4],n=>{let e=n.facet(K4);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:G5.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class n2e{constructor(e,t,i,s,o){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.nearest(t.target);if(!i)return;let s,o=1;if(i instanceof fC)s=i.posAtStart;else{if(s=e.posAtCoords(t),s==null)return;let a=e.coordsAtPos(s);if(!a||t.y<a.top||t.y>a.bottom||t.x<a.left-e.defaultCharacterWidth||t.x>a.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(d=>d.from<=s&&d.to>=s),u=c&&c.dir==Or.RTL?-1:1;o=t.x<a.left?-u:u}let r=this.source(e,s,o);if(r!=null&&r.then){let a=this.pending={pos:s};r.then(c=>{this.pending==a&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>vd(e.state,c,"hover tooltip"))}else r&&!(Array.isArray(r)&&!r.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(r)?r:[r])})}get tooltip(){let e=this.view.plugin(tee),t=e?e.manager.tooltips.findIndex(i=>i.create==G5.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:o}=this;if(s.length&&o&&!i2e(o.dom,e)||this.pending){let{pos:r}=s[0]||this.pending,a=(i=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:r;(r==a?this.view.posAtCoords(this.lastMove)!=r:!s2e(this.view,r,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const oH=4;function i2e(n,e){let{left:t,right:i,top:s,bottom:o}=n.getBoundingClientRect(),r;if(r=n.querySelector(".cm-tooltip-arrow")){let a=r.getBoundingClientRect();s=Math.min(a.top,s),o=Math.max(a.bottom,o)}return e.clientX>=t-oH&&e.clientX<=i+oH&&e.clientY>=s-oH&&e.clientY<=o+oH}function s2e(n,e,t,i,s,o){let r=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(r.left>i||r.right<i||r.top>s||Math.min(r.bottom,a)<s)return!1;let c=n.posAtCoords({x:i,y:s},!1);return c>=e&&c<=t}function o2e(n,e={}){let t=ls.define(),i=hc.define({create(){return[]},update(s,o){if(s.length&&(e.hideOnChange&&(o.docChanged||o.selection)?s=[]:e.hideOn&&(s=s.filter(r=>!e.hideOn(o,r))),o.docChanged)){let r=[];for(let a of s){let c=o.changes.mapPos(a.pos,-1,wu.TrackDel);if(c!=null){let u=Object.assign(Object.create(null),a);u.pos=c,u.end!=null&&(u.end=o.changes.mapPos(u.end)),r.push(u)}}s=r}for(let r of o.effects)r.is(t)&&(s=r.value),r.is(r2e)&&(s=[]);return s},provide:s=>K4.from(s)});return{active:i,extension:[i,Il.define(s=>new n2e(s,n,i,t,e.hoverTime||300)),t2e]}}function fTe(n,e){let t=n.plugin(tee);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const r2e=ls.define(),kle=oi.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function F$(n,e){let t=n.plugin(gTe),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const gTe=Il.fromClass(class{constructor(n){this.input=n.state.facet(B$),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(kle);this.top=new rH(n,!0,e.topContainer),this.bottom=new rH(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(kle);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new rH(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new rH(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(B$);if(t!=this.input){let i=t.filter(c=>c),s=[],o=[],r=[],a=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(n.view),a.push(d)):(d=this.panels[u],d.update&&d.update(n)),s.push(d),(d.top?o:r).push(d)}this.specs=i,this.panels=s,this.top.sync(o),this.bottom.sync(r);for(let c of a)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>ni.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class rH{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Ale(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Ale(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Ale(n){let e=n.nextSibling;return n.remove(),e}const B$=oi.define({enables:gTe});class rb extends k0{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}rb.prototype.elementClass="";rb.prototype.toDOM=void 0;rb.prototype.mapMode=wu.TrackBefore;rb.prototype.startSide=rb.prototype.endSide=-1;rb.prototype.point=!0;const dU=oi.define(),l2e=oi.define(),a2e={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>oo.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ND=oi.define();function c2e(n){return[pTe(),ND.of(Object.assign(Object.assign({},a2e),n))]}const Nle=oi.define({combine:n=>n.some(e=>e)});function pTe(n){return[u2e]}const u2e=Il.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(ND).map(e=>new $le(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Nle),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Nle)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=oo.iter(this.view.state.facet(dU),this.view.viewport.from),i=[],s=this.gutters.map(o=>new d2e(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(o.type)){let r=!0;for(let a of o.type)if(a.type==Mu.Text&&r){Rj(t,i,a.from);for(let c of s)c.line(this.view,a,i);r=!1}else if(a.widget)for(let c of s)c.widget(this.view,a)}else if(o.type==Mu.Text){Rj(t,i,o.from);for(let r of s)r.line(this.view,o,i)}else if(o.widget)for(let r of s)r.widget(this.view,o);for(let o of s)o.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(ND),t=n.state.facet(ND),i=n.docChanged||n.heightChanged||n.viewportChanged||!oo.eq(n.startState.facet(dU),n.state.facet(dU),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let o of t){let r=e.indexOf(o);r<0?s.push(new $le(this.view,o)):(this.gutters[r].update(n),s.push(this.gutters[r]))}for(let o of this.gutters)o.dom.remove(),s.indexOf(o)<0&&o.destroy();for(let o of s)this.dom.appendChild(o.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>ni.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Or.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Dle(n){return Array.isArray(n)?n:[n]}function Rj(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class d2e{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=oo.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,o=(t.top-this.height)/e.scaleY,r=t.height/e.scaleY;if(this.i==s.elements.length){let a=new mTe(e,r,o,i);s.elements.push(a),s.dom.appendChild(a.dom)}else s.elements[this.i].update(e,r,o,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];Rj(this.cursor,s,t.from),i.length&&(s=s.concat(i));let o=this.gutter.config.lineMarker(e,t,s);o&&s.unshift(o);let r=this.gutter;s.length==0&&!r.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),s=i?[i]:null;for(let o of e.state.facet(l2e)){let r=o(e,t.widget,t);r&&(s||(s=[])).push(r)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class $le{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let o=s.target,r;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let c=o.getBoundingClientRect();r=(c.top+c.bottom)/2}else r=s.clientY;let a=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[i](e,a,s)&&s.preventDefault()});this.markers=Dle(t.markers(e)),t.initialSpacer&&(this.spacer=new mTe(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Dle(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!oo.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class mTe{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),h2e(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let o=0,r=0;;){let a=r,c=o<t.length?t[o++]:null,u=!1;if(c){let d=c.elementClass;d&&(i+=" "+d);for(let f=r;f<this.markers.length;f++)if(this.markers[f].compare(c)){a=f,u=!0;break}}else a=this.markers.length;for(;r<a;){let d=this.markers[r++];if(d.toDOM){d.destroy(s);let f=s.nextSibling;s.remove(),s=f}}if(!c)break;c.toDOM&&(u?s=s.nextSibling:this.dom.insertBefore(c.toDOM(e),s)),u&&r++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function h2e(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const f2e=oi.define(),g2e=oi.define(),D1=oi.define({combine(n){return o_(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let s in t){let o=i[s],r=t[s];i[s]=o?(a,c,u)=>o(a,c,u)||r(a,c,u):r}return i}})}});class Ez extends rb{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Sz(n,e){return n.state.facet(D1).formatNumber(e,n.state)}const p2e=ND.compute([D1],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(f2e)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new Ez(Sz(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let s of e.state.facet(g2e)){let o=s(e,t,i);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(D1)!=e.state.facet(D1),initialSpacer(e){return new Ez(Sz(e,xle(e.state.doc.lines)))},updateSpacer(e,t){let i=Sz(t.view,xle(t.view.state.doc.lines));return i==e.number?e:new Ez(i)},domEventHandlers:n.facet(D1).domEventHandlers}));function m2e(n={}){return[D1.of(n),pTe(),p2e]}function xle(n){let e=9;for(;e<n;)e=e*10+9;return e}const _2e=new class extends rb{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},v2e=dU.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(_2e.range(s)))}return oo.of(e)});function b2e(){return v2e}const T2e=1024;let C2e=0,wz=class{constructor(e,t){this.from=e,this.to=t}};class Ys{constructor(e={}){this.id=C2e++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Uf.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}Ys.closedBy=new Ys({deserialize:n=>n.split(" ")});Ys.openedBy=new Ys({deserialize:n=>n.split(" ")});Ys.group=new Ys({deserialize:n=>n.split(" ")});Ys.isolate=new Ys({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Ys.contextHash=new Ys({perNode:!0});Ys.lookAhead=new Ys({perNode:!0});Ys.mounted=new Ys({perNode:!0});class j4{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[Ys.mounted.id]}}const y2e=Object.create(null);class Uf{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):y2e,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new Uf(e.name||"",t,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(s)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Ys.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(Ys.group),o=-1;o<(s?s.length:0);o++){let r=t[o<0?i.name:s[o]];if(r)return r}}}}Uf.none=new Uf("",Object.create(null),0,8);const lH=new WeakMap,Ple=new WeakMap;var ic;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(ic||(ic={}));let uh=class Mj{constructor(e,t,i,s,o){if(this.type=e,this.children=t,this.positions=i,this.length=s,this.props=null,o&&o.length){this.props=Object.create(null);for(let[r,a]of o)this.props[typeof r=="number"?r:r.id]=a}}toString(){let e=j4.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let s=i.toString();s&&(t&&(t+=","),t+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Aj(this.topNode,e)}cursorAt(e,t=0,i=0){let s=lH.get(this)||this.topNode,o=new Aj(s);return o.moveTo(e,t),lH.set(this,o._tree),o}get topNode(){return new YC(this,0,0,null)}resolve(e,t=0){let i=H$(lH.get(this)||this.topNode,e,t,!1);return lH.set(this,i),i}resolveInner(e,t=0){let i=H$(Ple.get(this)||this.topNode,e,t,!0);return Ple.set(this,i),i}resolveStack(e,t=0){return w2e(this,e,t)}iterate(e){let{enter:t,leave:i,from:s=0,to:o=this.length}=e,r=e.mode||0,a=(r&ic.IncludeAnonymous)>0;for(let c=this.cursor(r|ic.IncludeAnonymous);;){let u=!1;if(c.from<=o&&c.to>=s&&(!a&&c.type.isAnonymous||t(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(a||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:oee(Uf.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new Mj(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new Mj(Uf.none,t,i,s)))}static build(e){return I2e(e)}};uh.empty=new uh(Uf.none,[],[],0);class iee{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new iee(this.buffer,this.index)}}class XC{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Uf.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],s=this.set.types[t],o=s.name;if(/\W/.test(o)&&!s.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let r=[];for(;e<i;)r.push(this.childString(e)),e=this.buffer[e+3];return o+"("+r.join(",")+")"}findChild(e,t,i,s,o){let{buffer:r}=this,a=-1;for(let c=e;c!=t&&!(_Te(o,s,r[c+1],r[c+2])&&(a=c,i>0));c=r[c+3]);return a}slice(e,t,i){let s=this.buffer,o=new Uint16Array(t-e),r=0;for(let a=e,c=0;a<t;){o[c++]=s[a++],o[c++]=s[a++]-i;let u=o[c++]=s[a++]-i;o[c++]=s[a++]-e,r=Math.max(r,u)}return new XC(o,r,this.set)}}function _Te(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function H$(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let r=!i&&n instanceof YC&&n.index<0?null:n.parent;if(!r)return n;n=r}let o=i?0:ic.IgnoreOverlays;if(i)for(let r=n,a=r.parent;a;r=a,a=r.parent)r instanceof YC&&r.index<0&&((s=a.enter(e,t,o))===null||s===void 0?void 0:s.from)!=r.from&&(n=a);for(;;){let r=n.enter(e,t,o);if(!r)return n;n=r}}class vTe{cursor(e=0){return new Aj(this,e)}getChild(e,t=null,i=null){let s=Fle(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return Fle(this,e,t,i)}resolve(e,t=0){return H$(this,e,t,!1)}resolveInner(e,t=0){return H$(this,e,t,!0)}matchContext(e){return kj(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let s=t.lastChild;if(!s||s.to!=t.to)break;s.type.isError&&s.from==s.to?(i=t,t=s.prevSibling):t=s}return i}get node(){return this}get next(){return this.parent}}let YC=class hU extends vTe{constructor(e,t,i,s){super(),this._tree=e,this.from=t,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,s,o=0){for(let r=this;;){for(let{children:a,positions:c}=r._tree,u=t>0?a.length:-1;e!=u;e+=t){let d=a[e],f=c[e]+r.from;if(_Te(s,i,f,f+d.length)){if(d instanceof XC){if(o&ic.ExcludeBuffers)continue;let g=d.findChild(0,d.buffer.length,t,i-f,s);if(g>-1)return new pC(new E2e(r,d,e,f),null,g)}else if(o&ic.IncludeAnonymous||!d.type.isAnonymous||see(d)){let g;if(!(o&ic.IgnoreMounts)&&(g=j4.get(d))&&!g.overlay)return new hU(g.tree,f,e,r);let p=new hU(d,f,e,r);return o&ic.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?d.children.length-1:0,t,i,s)}}}if(o&ic.IncludeAnonymous||!r.type.isAnonymous||(r.index>=0?e=r.index+t:e=t<0?-1:r._parent._tree.children.length,r=r._parent,!r))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&ic.IgnoreOverlays)&&(s=j4.get(this._tree))&&s.overlay){let o=e-this.from;for(let{from:r,to:a}of s.overlay)if((t>0?r<=o:r<o)&&(t<0?a>=o:a>o))return new hU(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Fle(n,e,t,i){let s=n.cursor(),o=[];if(!s.firstChild())return o;if(t!=null){for(let r=!1;!r;)if(r=s.type.is(t),!s.nextSibling())return o}for(;;){if(i!=null&&s.type.is(i))return o;if(s.type.is(e)&&o.push(s.node),!s.nextSibling())return i==null?o:[]}}function kj(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class E2e{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class pC extends vTe{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,o=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return o<0?null:new pC(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&ic.ExcludeBuffers)return null;let{buffer:s}=this.context,o=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new pC(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new pC(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new pC(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,o=i.buffer[this.index+3];if(o>s){let r=i.buffer[this.index+1];e.push(i.slice(s,o,r)),t.push(0)}return new uh(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function bTe(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;o<n.length;o++){let r=n[o];(r.from>t.from||r.to<t.to)&&(t=r,e=o)}let i=t instanceof YC&&t.index<0?null:t.parent,s=n.slice();return i?s[e]=i:s.splice(e,1),new S2e(s,t)}class S2e{constructor(e,t){this.heads=e,this.node=t}get next(){return bTe(this.heads)}}function w2e(n,e,t){let i=n.resolveInner(e,t),s=null;for(let o=i instanceof YC?i:i.context.parent;o;o=o.parent)if(o.index<0){let r=o.parent;(s||(s=[i])).push(r.resolve(e,t)),o=r}else{let r=j4.get(o.tree);if(r&&r.overlay&&r.overlay[0].from<=e&&r.overlay[r.overlay.length-1].to>=e){let a=new YC(r.tree,r.overlay[0].from+o.from,-1,o);(s||(s=[i])).push(H$(a,e,t,!1))}}return s?bTe(s):i}class Aj{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof YC)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof YC?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,o=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&ic.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ic.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ic.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(s.buffer.buffer[o+3]<this.index)return!1;({index:t,parent:i}=s)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let o=t+e,r=e<0?-1:i._tree.children.length;o!=r;o+=e){let a=i._tree.children[o];if(this.mode&ic.IncludeAnonymous||a instanceof XC||!a.type.isAnonymous||see(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let s=this.index,o=this.stack.length;o>=0;){for(let r=e;r;r=r._parent)if(r.index==s){if(s==this.index)return r;t=r,i=o+1;break e}s=this.stack[--o]}for(let s=i;s<this.stack.length;s++)t=new pC(this.buffer,t,this.stack[s]);return this.bufferNode=new pC(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&t&&t(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return kj(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let s=e.length-1,o=this.stack.length-1;s>=0;o--){if(o<0)return kj(this._tree,e,s);let r=i[t.buffer[this.stack[o]]];if(!r.isAnonymous){if(e[s]&&e[s]!=r.name)return!1;s--}}return!0}}function see(n){return n.children.some(e=>e instanceof XC||!e.type.isAnonymous||see(e))}function I2e(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=T2e,reused:o=[],minRepeatType:r=i.types.length}=n,a=Array.isArray(t)?new iee(t,t.length):t,c=i.types,u=0,d=0;function f(O,A,N,D,P,F){let{id:V,start:U,end:Q,size:de}=a,q=d,K=u;for(;de<0;)if(a.next(),de==-1){let ve=o[V];N.push(ve),D.push(U-O);return}else if(de==-3){u=V;return}else if(de==-4){d=V;return}else throw new RangeError(`Unrecognized record size: ${de}`);let re=c[V],Z,J,ge=U-O;if(Q-U<=s&&(J=C(a.pos-A,P))){let ve=new Uint16Array(J.size-J.skip),Le=a.pos-J.size,Ee=ve.length;for(;a.pos>Le;)Ee=y(J.start,ve,Ee);Z=new XC(ve,Q-J.start,i),ge=J.start-O}else{let ve=a.pos-de;a.next();let Le=[],Ee=[],Ne=V>=r?V:-1,qe=0,Re=Q;for(;a.pos>ve;)Ne>=0&&a.id==Ne&&a.size>=0?(a.end<=Re-s&&(_(Le,Ee,U,qe,a.end,Re,Ne,q,K),qe=Le.length,Re=a.end),a.next()):F>2500?g(U,ve,Le,Ee):f(U,ve,Le,Ee,Ne,F+1);if(Ne>=0&&qe>0&&qe<Le.length&&_(Le,Ee,U,qe,U,Re,Ne,q,K),Le.reverse(),Ee.reverse(),Ne>-1&&qe>0){let we=p(re,K);Z=oee(re,Le,Ee,0,Le.length,0,Q-U,we,we)}else Z=v(re,Le,Ee,Q-U,q-Q,K)}N.push(Z),D.push(ge)}function g(O,A,N,D){let P=[],F=0,V=-1;for(;a.pos>A;){let{id:U,start:Q,end:de,size:q}=a;if(q>4)a.next();else{if(V>-1&&Q<V)break;V<0&&(V=de-s),P.push(U,Q,de),F++,a.next()}}if(F){let U=new Uint16Array(F*4),Q=P[P.length-2];for(let de=P.length-3,q=0;de>=0;de-=3)U[q++]=P[de],U[q++]=P[de+1]-Q,U[q++]=P[de+2]-Q,U[q++]=q;N.push(new XC(U,P[2]-Q,i)),D.push(Q-O)}}function p(O,A){return(N,D,P)=>{let F=0,V=N.length-1,U,Q;if(V>=0&&(U=N[V])instanceof uh){if(!V&&U.type==O&&U.length==P)return U;(Q=U.prop(Ys.lookAhead))&&(F=D[V]+U.length+Q)}return v(O,N,D,P,F,A)}}function _(O,A,N,D,P,F,V,U,Q){let de=[],q=[];for(;O.length>D;)de.push(O.pop()),q.push(A.pop()+N-P);O.push(v(i.types[V],de,q,F-P,U-F,Q)),A.push(P-N)}function v(O,A,N,D,P,F,V){if(F){let U=[Ys.contextHash,F];V=V?[U].concat(V):[U]}if(P>25){let U=[Ys.lookAhead,P];V=V?[U].concat(V):[U]}return new uh(O,A,N,D,V)}function C(O,A){let N=a.fork(),D=0,P=0,F=0,V=N.end-s,U={size:0,start:0,skip:0};e:for(let Q=N.pos-O;N.pos>Q;){let de=N.size;if(N.id==A&&de>=0){U.size=D,U.start=P,U.skip=F,F+=4,D+=4,N.next();continue}let q=N.pos-de;if(de<0||q<Q||N.start<V)break;let K=N.id>=r?4:0,re=N.start;for(N.next();N.pos>q;){if(N.size<0)if(N.size==-3)K+=4;else break e;else N.id>=r&&(K+=4);N.next()}P=re,D+=de,F+=K}return(A<0||D==O)&&(U.size=D,U.start=P,U.skip=F),U.size>4?U:void 0}function y(O,A,N){let{id:D,start:P,end:F,size:V}=a;if(a.next(),V>=0&&D<r){let U=N;if(V>4){let Q=a.pos-(V-4);for(;a.pos>Q;)N=y(O,A,N)}A[--N]=U,A[--N]=F-O,A[--N]=P-O,A[--N]=D}else V==-3?u=D:V==-4&&(d=D);return N}let w=[],I=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,w,I,-1,0);let L=(e=n.length)!==null&&e!==void 0?e:w.length?I[0]+w[0].length:0;return new uh(c[n.topID],w.reverse(),I.reverse(),L)}const Ble=new WeakMap;function fU(n,e){if(!n.isAnonymous||e instanceof XC||e.type!=n)return 1;let t=Ble.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof uh)){t=1;break}t+=fU(n,i)}Ble.set(e,t)}return t}function oee(n,e,t,i,s,o,r,a,c){let u=0;for(let _=i;_<s;_++)u+=fU(n,e[_]);let d=Math.ceil(u*1.5/8),f=[],g=[];function p(_,v,C,y,w){for(let I=C;I<y;){let L=I,O=v[I],A=fU(n,_[I]);for(I++;I<y;I++){let N=fU(n,_[I]);if(A+N>=d)break;A+=N}if(I==L+1){if(A>d){let N=_[L];p(N.children,N.positions,0,N.children.length,v[L]+w);continue}f.push(_[L])}else{let N=v[I-1]+_[I-1].length-O;f.push(oee(n,_,v,L,I,O,N,null,c))}g.push(O+w-o)}}return p(e,t,i,s,0),(a||c)(f,g,r)}class s0{constructor(e,t,i,s,o=!1,r=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(o?1:0)|(r?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new s0(0,e.length,e,0,!1,i)];for(let o of t)o.to>e.length&&s.push(o);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],o=1,r=e.length?e[0]:null;for(let a=0,c=0,u=0;;a++){let d=a<t.length?t[a]:null,f=d?d.fromA:1e9;if(f-c>=i)for(;r&&r.from<f;){let g=r;if(c>=g.from||f<=g.to||u){let p=Math.max(g.from,c)-u,_=Math.min(g.to,f)-u;g=p>=_?null:new s0(p,_,g.tree,g.offset+u,a>0,!!d)}if(g&&s.push(g),r.to>f)break;r=o<e.length?e[o++]:null}if(!d)break;c=d.toA,u=d.toA-d.toB}return s}}let L2e=class{startParse(e,t,i){return typeof e=="string"&&(e=new O2e(e)),i=i?i.length?i.map(s=>new wz(s.from,s.to)):[new wz(0,0)]:[new wz(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let o=s.advance();if(o)return o}}};class O2e{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Ys({perNode:!0});let R2e=0,Ev=class Nj{constructor(e,t,i,s){this.name=e,this.set=t,this.base=i,this.modified=s,this.id=R2e++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Nj&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let s=new Nj(i,[],null,[]);if(s.set.push(s),t)for(let o of t.set)s.set.push(o);return s}static defineModifier(e){let t=new X4(e);return i=>i.modified.indexOf(t)>-1?i:X4.get(i.base||i,i.modified.concat(t).sort((s,o)=>s.id-o.id))}},M2e=0;class X4{constructor(e){this.name=e,this.instances=[],this.id=M2e++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(a=>a.base==e&&k2e(t,a.modified));if(i)return i;let s=[],o=new Ev(e.name,s,e,t);for(let a of t)a.instances.push(o);let r=A2e(t);for(let a of e.set)if(!a.modified.length)for(let c of r)s.push(X4.get(a,c));return o}}function k2e(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function A2e(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,s=e.length;i<s;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function N2e(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let o=[],r=2,a=s;for(let f=0;;){if(a=="..."&&f>0&&f+3==s.length){r=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!g)throw new RangeError("Invalid path: "+s);if(o.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),f+=g[0].length,f==s.length)break;let p=s[f++];if(f==s.length&&p=="!"){r=0;break}if(p!="/")throw new RangeError("Invalid path: "+s);a=s.slice(f)}let c=o.length-1,u=o[c];if(!u)throw new RangeError("Invalid path: "+s);let d=new Y4(i,r,c>0?o.slice(0,c):null);e[u]=d.sort(e[u])}}return TTe.add(e)}const TTe=new Ys;let Y4=class{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Y4.empty=new Y4([],2,null);function CTe(n,e){let t=Object.create(null);for(let o of n)if(!Array.isArray(o.tag))t[o.tag.id]=o.class;else for(let r of o.tag)t[r.id]=o.class;let{scope:i,all:s=null}=e||{};return{style:o=>{let r=s;for(let a of o)for(let c of a.set){let u=t[c.id];if(u){r=r?r+" "+u:u;break}}return r},scope:i}}function D2e(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function $2e(n,e,t,i=0,s=n.length){let o=new x2e(i,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),i,s,"",o.highlighters),o.flush(s)}class x2e{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,o){let{type:r,from:a,to:c}=e;if(a>=i||c<=t)return;r.isTop&&(o=this.highlighters.filter(p=>!p.scope||p.scope(r)));let u=s,d=P2e(e)||Y4.empty,f=D2e(o,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,a),u),d.opaque)return;let g=e.tree&&e.tree.prop(Ys.mounted);if(g&&g.overlay){let p=e.node.enter(g.overlay[0].from+a,1),_=this.highlighters.filter(C=>!C.scope||C.scope(g.tree.type)),v=e.firstChild();for(let C=0,y=a;;C++){let w=C<g.overlay.length?g.overlay[C]:null,I=w?w.from+a:c,L=Math.max(t,y),O=Math.min(i,I);if(L<O&&v)for(;e.from<O&&(this.highlightRange(e,L,O,s,o),this.startSpan(Math.min(O,e.to),u),!(e.to>=I||!e.nextSibling())););if(!w||I>i)break;y=w.to+a,y>t&&(this.highlightRange(p.cursor(),Math.max(t,w.from+a),Math.min(i,y),"",_),this.startSpan(Math.min(i,y),u))}v&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,o),this.startSpan(Math.min(i,e.to),u)}while(e.nextSibling());e.parent()}}}function P2e(n){let e=n.type.prop(TTe);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Dn=Ev.define,aH=Dn(),eC=Dn(),Hle=Dn(eC),Vle=Dn(eC),tC=Dn(),cH=Dn(tC),Iz=Dn(tC),im=Dn(),rS=Dn(im),jp=Dn(),Xp=Dn(),Dj=Dn(),TN=Dn(Dj),uH=Dn(),Gn={comment:aH,lineComment:Dn(aH),blockComment:Dn(aH),docComment:Dn(aH),name:eC,variableName:Dn(eC),typeName:Hle,tagName:Dn(Hle),propertyName:Vle,attributeName:Dn(Vle),className:Dn(eC),labelName:Dn(eC),namespace:Dn(eC),macroName:Dn(eC),literal:tC,string:cH,docString:Dn(cH),character:Dn(cH),attributeValue:Dn(cH),number:Iz,integer:Dn(Iz),float:Dn(Iz),bool:Dn(tC),regexp:Dn(tC),escape:Dn(tC),color:Dn(tC),url:Dn(tC),keyword:jp,self:Dn(jp),null:Dn(jp),atom:Dn(jp),unit:Dn(jp),modifier:Dn(jp),operatorKeyword:Dn(jp),controlKeyword:Dn(jp),definitionKeyword:Dn(jp),moduleKeyword:Dn(jp),operator:Xp,derefOperator:Dn(Xp),arithmeticOperator:Dn(Xp),logicOperator:Dn(Xp),bitwiseOperator:Dn(Xp),compareOperator:Dn(Xp),updateOperator:Dn(Xp),definitionOperator:Dn(Xp),typeOperator:Dn(Xp),controlOperator:Dn(Xp),punctuation:Dj,separator:Dn(Dj),bracket:TN,angleBracket:Dn(TN),squareBracket:Dn(TN),paren:Dn(TN),brace:Dn(TN),content:im,heading:rS,heading1:Dn(rS),heading2:Dn(rS),heading3:Dn(rS),heading4:Dn(rS),heading5:Dn(rS),heading6:Dn(rS),contentSeparator:Dn(im),list:Dn(im),quote:Dn(im),emphasis:Dn(im),strong:Dn(im),link:Dn(im),monospace:Dn(im),strikethrough:Dn(im),inserted:Dn(),deleted:Dn(),changed:Dn(),invalid:Dn(),meta:uH,documentMeta:Dn(uH),annotation:Dn(uH),processingInstruction:Dn(uH),definition:Ev.defineModifier("definition"),constant:Ev.defineModifier("constant"),function:Ev.defineModifier("function"),standard:Ev.defineModifier("standard"),local:Ev.defineModifier("local"),special:Ev.defineModifier("special")};for(let n in Gn){let e=Gn[n];e instanceof Ev&&(e.name=n)}CTe([{tag:Gn.link,class:"tok-link"},{tag:Gn.heading,class:"tok-heading"},{tag:Gn.emphasis,class:"tok-emphasis"},{tag:Gn.strong,class:"tok-strong"},{tag:Gn.keyword,class:"tok-keyword"},{tag:Gn.atom,class:"tok-atom"},{tag:Gn.bool,class:"tok-bool"},{tag:Gn.url,class:"tok-url"},{tag:Gn.labelName,class:"tok-labelName"},{tag:Gn.inserted,class:"tok-inserted"},{tag:Gn.deleted,class:"tok-deleted"},{tag:Gn.literal,class:"tok-literal"},{tag:Gn.string,class:"tok-string"},{tag:Gn.number,class:"tok-number"},{tag:[Gn.regexp,Gn.escape,Gn.special(Gn.string)],class:"tok-string2"},{tag:Gn.variableName,class:"tok-variableName"},{tag:Gn.local(Gn.variableName),class:"tok-variableName tok-local"},{tag:Gn.definition(Gn.variableName),class:"tok-variableName tok-definition"},{tag:Gn.special(Gn.variableName),class:"tok-variableName2"},{tag:Gn.definition(Gn.propertyName),class:"tok-propertyName tok-definition"},{tag:Gn.typeName,class:"tok-typeName"},{tag:Gn.namespace,class:"tok-namespace"},{tag:Gn.className,class:"tok-className"},{tag:Gn.macroName,class:"tok-macroName"},{tag:Gn.propertyName,class:"tok-propertyName"},{tag:Gn.operator,class:"tok-operator"},{tag:Gn.comment,class:"tok-comment"},{tag:Gn.meta,class:"tok-meta"},{tag:Gn.invalid,class:"tok-invalid"},{tag:Gn.punctuation,class:"tok-punctuation"}]);var Lz;const iD=new Ys,F2e=new Ys;class Im{constructor(e,t,i=[],s=""){this.data=e,this.name=s,Rr.prototype.hasOwnProperty("tree")||Object.defineProperty(Rr.prototype,"tree",{get(){return Jc(this)}}),this.parser=t,this.extension=[qC.of(this),Rr.languageData.of((o,r,a)=>{let c=Ule(o,r,a),u=c.type.prop(iD);if(!u)return[];let d=o.facet(u),f=c.type.prop(F2e);if(f){let g=c.resolve(r-c.from,a);for(let p of f)if(p.test(g,o)){let _=o.facet(p.facet);return p.type=="replace"?_:_.concat(d)}}return d})].concat(i)}isActiveAt(e,t,i=-1){return Ule(e,t,i).type.prop(iD)==this.data}findRegions(e){let t=e.facet(qC);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(o,r)=>{if(o.prop(iD)==this.data){i.push({from:r,to:r+o.length});return}let a=o.prop(Ys.mounted);if(a){if(a.tree.prop(iD)==this.data){if(a.overlay)for(let c of a.overlay)i.push({from:c.from+r,to:c.to+r});else i.push({from:r,to:r+o.length});return}else if(a.overlay){let c=i.length;if(s(a.tree,a.overlay[0].from+r),i.length>c)return}}for(let c=0;c<o.children.length;c++){let u=o.children[c];u instanceof uh&&s(u,o.positions[c]+r)}};return s(Jc(e),0),i}get allowsNesting(){return!0}}Im.setState=ls.define();function Ule(n,e,t){let i=n.facet(qC),s=Jc(n).topNode;if(!i||i.allowsNesting)for(let o=s;o;o=o.enter(e,t,ic.ExcludeBuffers))o.type.isTop&&(s=o);return s}function Jc(n){let e=n.field(Im.state,!1);return e?e.tree:uh.empty}class B2e{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let CN=null;class q4{constructor(e,t,i=[],s,o,r,a,c){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=o,this.viewport=r,this.skipped=a,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new q4(e,t,[],uh.empty,0,i,[],null)}startParse(){return this.parser.startParse(new B2e(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=uh.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(s0.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(s0.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=CN;CN=this;try{return e()}finally{CN=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Wle(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:o,viewport:r,skipped:a}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((u,d,f,g)=>c.push({fromA:u,toA:d,fromB:f,toB:g})),i=s0.applyChanges(i,c),s=uh.empty,o=0,r={from:e.mapPos(r.from,-1),to:e.mapPos(r.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let d=e.mapPos(u.from,1),f=e.mapPos(u.to,-1);d<f&&a.push({from:d,to:f})}}}return new q4(this.parser,t,i,s,o,r,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:o}=this.skipped[i];s<e.to&&o>e.from&&(this.fragments=Wle(this.fragments,s,o),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends L2e{createParse(t,i,s){let o=s[0].from,r=s[s.length-1].to;return{parsedPos:o,advance(){let c=CN;if(c){for(let u of s)c.tempSkipped.push(u);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=r,new uh(Uf.none,[],[],r-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return CN}}function Wle(n,e,t){return s0.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class VO{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new VO(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=q4.create(e.facet(qC).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new VO(i)}}Im.state=hc.define({create:VO.init,update(n,e){for(let t of e.effects)if(t.is(Im.setState))return t.value;return e.startState.facet(qC)!=e.state.facet(qC)?VO.init(e.state):n.apply(e)}});let yTe=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(yTe=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Oz=typeof navigator<"u"&&(!((Lz=navigator.scheduling)===null||Lz===void 0)&&Lz.isInputPending)?()=>navigator.scheduling.isInputPending():null,H2e=Il.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Im.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Im.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=yTe(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,o=i.field(Im.state);if(o.tree==o.context.tree&&o.context.isDone(s+1e5))return;let r=Date.now()+Math.min(this.chunkBudget,100,e&&!Oz?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<s&&i.doc.length>s+1e3,c=o.context.work(()=>Oz&&Oz()||Date.now()>r,s+(a?0:1e5));this.chunkBudget-=Date.now()-t,(c||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Im.setState.of(new VO(o.context))})),this.chunkBudget>0&&!(c&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>vd(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),qC=oi.define({combine(n){return n.length?n[0]:null},enables:n=>[Im.state,H2e,ni.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]}),V2e=oi.define(),z5=oi.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function J4(n){let e=n.facet(z5);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function V$(n,e){let t="",i=n.tabSize,s=n.facet(z5)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let o=0;o<e;o++)t+=s;return t}function ree(n,e){n instanceof Rr&&(n=new K5(n));for(let i of n.state.facet(V2e)){let s=i(n,e);if(s!==void 0)return s}let t=Jc(n.state);return t.length>=e?W2e(n,t,e):null}class K5{constructor(e,t={}){this.state=e,this.options=t,this.unit=J4(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:o}=this.options;return s!=null&&s>=i.from&&s<=i.to?o&&s==e?{text:"",from:e}:(t<0?s<e:s<=e)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(e,t);return i.slice(e-s,Math.min(i.length,e+100-s))}column(e,t=1){let{text:i,from:s}=this.lineAt(e,t),o=this.countColumn(i,e-s),r=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return r>-1&&(o+=r-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,t=e.length){return YR(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let r=o(s);if(r>-1)return r}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const U2e=new Ys;function W2e(n,e,t){let i=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=i.node){let o=[];for(let r=s;r&&!(r.from==i.node.from&&r.type==i.node.type);r=r.parent)o.push(r);for(let r=o.length-1;r>=0;r--)i={node:o[r],next:i}}return ETe(i,n,t)}function ETe(n,e,t){for(let i=n;i;i=i.next){let s=z2e(i.node);if(s)return s(lee.create(e,t,i))}return 0}function G2e(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function z2e(n){let e=n.type.prop(U2e);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(Ys.closedBy))){let s=n.lastChild,o=s&&i.indexOf(s.name)>-1;return r=>Y2e(r,!0,1,void 0,o&&!G2e(r)?s.from:void 0)}return n.parent==null?K2e:null}function K2e(){return 0}class lee extends K5{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new lee(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(j2e(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return ETe(this.context.next,this.base,this.pos)}}function j2e(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function X2e(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),r=s==null||s<=o.from?o.to:Math.min(o.to,s);for(let a=t.to;;){let c=e.childAfter(a);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=r)return null;let u=/^ */.exec(o.text.slice(t.to-o.from))[0].length;return{from:t.from,to:t.to+u}}a=c.to}}function Y2e(n,e,t,i,s){let o=n.textAfter,r=o.match(/^\s*/)[0].length,a=s==n.pos+r,c=X2e(n);return c?a?n.column(c.from):n.column(c.to):n.baseIndent+(a?0:n.unit*t)}const q2e=200;function J2e(){return Rr.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+q2e)return n;let o=t.sliceString(s.from,i);if(!e.some(u=>u.test(o)))return n;let{state:r}=n,a=-1,c=[];for(let{head:u}of r.selection.ranges){let d=r.doc.lineAt(u);if(d.from==a)continue;a=d.from;let f=ree(r,d.from);if(f==null)continue;let g=/^\s*/.exec(d.text)[0],p=V$(r,f);g!=p&&c.push({from:d.from,to:d.from+g.length,insert:p})}return c.length?[n,{changes:c,sequential:!0}]:n})}const Q2e=oi.define(),Z2e=new Ys;function eBe(n,e,t){let i=Jc(n);if(i.length<t)return null;let s=i.resolveStack(t,1),o=null;for(let r=s;r;r=r.next){let a=r.node;if(a.to<=t||a.from>t)continue;if(o&&a.from<e)break;let c=a.type.prop(Z2e);if(c&&(a.to<i.length-50||i.length==n.doc.length||!tBe(a))){let u=c(a,n);u&&u.from<=t&&u.from>=e&&u.to>t&&(o=u)}}return o}function tBe(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Q4(n,e,t){for(let i of n.facet(Q2e)){let s=i(n,e,t);if(s)return s}return eBe(n,e,t)}function STe(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const j5=ls.define({map:STe}),YP=ls.define({map:STe});function wTe(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const $0=hc.define({create(){return yi.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(j5)&&!nBe(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(OTe),s=i?yi.replace({widget:new cBe(i(e.state,t.value))}):Gle;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(YP)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(s,o)=>{s<i&&o>i&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(s,o)=>o<=i||s>=i}))}return n},provide:n=>ni.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],s=n[t++];if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(Gle.range(i,s))}return yi.set(e,!0)}});function Z4(n,e,t){var i;let s=null;return(i=n.field($0,!1))===null||i===void 0||i.between(e,t,(o,r)=>{(!s||s.from>o)&&(s={from:o,to:r})}),s}function nBe(n,e,t){let i=!1;return n.between(e,e,(s,o)=>{s==e&&o==t&&(i=!0)}),i}function ITe(n,e){return n.field($0,!1)?e:e.concat(ls.appendConfig.of(RTe()))}const iBe=n=>{for(let e of wTe(n)){let t=Q4(n.state,e.from,e.to);if(t)return n.dispatch({effects:ITe(n.state,[j5.of(t),LTe(n,t)])}),!0}return!1},sBe=n=>{if(!n.state.field($0,!1))return!1;let e=[];for(let t of wTe(n)){let i=Z4(n.state,t.from,t.to);i&&e.push(YP.of(i),LTe(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function LTe(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return ni.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const oBe=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let s=n.lineBlockAt(i),o=Q4(e,s.from,s.to);o&&t.push(j5.of(o)),i=(o?n.lineBlockAt(o.to):s).to+1}return t.length&&n.dispatch({effects:ITe(n.state,t)}),!!t.length},rBe=n=>{let e=n.state.field($0,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(YP.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},lBe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:iBe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:sBe},{key:"Ctrl-Alt-[",run:oBe},{key:"Ctrl-Alt-]",run:rBe}],aBe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},OTe=oi.define({combine(n){return o_(n,aBe)}});function RTe(n){return[$0,hBe]}function MTe(n,e){let{state:t}=n,i=t.facet(OTe),s=r=>{let a=n.lineBlockAt(n.posAtDOM(r.target)),c=Z4(n.state,a.from,a.to);c&&n.dispatch({effects:YP.of(c)}),r.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",t.phrase("folded code")),o.title=t.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=s,o}const Gle=yi.replace({widget:new class extends Eb{toDOM(n){return MTe(n,null)}}});class cBe extends Eb{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return MTe(e,this.value)}}const uBe={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Rz extends rb{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function dBe(n={}){let e=Object.assign(Object.assign({},uBe),n),t=new Rz(e,!0),i=new Rz(e,!1),s=Il.fromClass(class{constructor(r){this.from=r.viewport.from,this.markers=this.buildMarkers(r)}update(r){(r.docChanged||r.viewportChanged||r.startState.facet(qC)!=r.state.facet(qC)||r.startState.field($0,!1)!=r.state.field($0,!1)||Jc(r.startState)!=Jc(r.state)||e.foldingChanged(r))&&(this.markers=this.buildMarkers(r.view))}buildMarkers(r){let a=new sb;for(let c of r.viewportLineBlocks){let u=Z4(r.state,c.from,c.to)?i:Q4(r.state,c.from,c.to)?t:null;u&&a.add(c.from,c.from,u)}return a.finish()}}),{domEventHandlers:o}=e;return[s,c2e({class:"cm-foldGutter",markers(r){var a;return((a=r.plugin(s))===null||a===void 0?void 0:a.markers)||oo.empty},initialSpacer(){return new Rz(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(r,a,c)=>{if(o.click&&o.click(r,a,c))return!0;let u=Z4(r.state,a.from,a.to);if(u)return r.dispatch({effects:YP.of(u)}),!0;let d=Q4(r.state,a.from,a.to);return d?(r.dispatch({effects:j5.of(d)}),!0):!1}})}),RTe()]}const hBe=ni.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class X5{constructor(e,t){this.specs=e;let i;function s(a){let c=zC.newName();return(i||(i=Object.create(null)))["."+c]=a,c}const o=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,r=t.scope;this.scope=r instanceof Im?a=>a.prop(iD)==r.data:r?a=>a==r:void 0,this.style=CTe(e.map(a=>({tag:a.tag,class:a.class||s(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=i?new zC(i):null,this.themeType=t.themeType}static define(e,t){return new X5(e,t||{})}}const $j=oi.define(),kTe=oi.define({combine(n){return n.length?[n[0]]:null}});function Mz(n){let e=n.facet($j);return e.length?e:n.facet(kTe)}function fBe(n,e){let t=[pBe],i;return n instanceof X5&&(n.module&&t.push(ni.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(kTe.of(n)):i?t.push($j.computeN([ni.darkTheme],s=>s.facet(ni.darkTheme)==(i=="dark")?[n]:[])):t.push($j.of(n)),t}class gBe{constructor(e){this.markCache=Object.create(null),this.tree=Jc(e.state),this.decorations=this.buildDeco(e,Mz(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Jc(e.state),i=Mz(e.state),s=i!=Mz(e.startState),{viewport:o}=e.view,r=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!s&&t.type==this.tree.type&&r>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=r):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return yi.none;let i=new sb;for(let{from:s,to:o}of e.visibleRanges)$2e(this.tree,t,(r,a,c)=>{i.add(r,a,this.markCache[c]||(this.markCache[c]=yi.mark({class:c})))},s,o);return i.finish()}}const pBe=Mw.high(Il.fromClass(gBe,{decorations:n=>n.decorations})),mBe=X5.define([{tag:Gn.meta,color:"#404740"},{tag:Gn.link,textDecoration:"underline"},{tag:Gn.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Gn.emphasis,fontStyle:"italic"},{tag:Gn.strong,fontWeight:"bold"},{tag:Gn.strikethrough,textDecoration:"line-through"},{tag:Gn.keyword,color:"#708"},{tag:[Gn.atom,Gn.bool,Gn.url,Gn.contentSeparator,Gn.labelName],color:"#219"},{tag:[Gn.literal,Gn.inserted],color:"#164"},{tag:[Gn.string,Gn.deleted],color:"#a11"},{tag:[Gn.regexp,Gn.escape,Gn.special(Gn.string)],color:"#e40"},{tag:Gn.definition(Gn.variableName),color:"#00f"},{tag:Gn.local(Gn.variableName),color:"#30a"},{tag:[Gn.typeName,Gn.namespace],color:"#085"},{tag:Gn.className,color:"#167"},{tag:[Gn.special(Gn.variableName),Gn.macroName],color:"#256"},{tag:Gn.definition(Gn.propertyName),color:"#00c"},{tag:Gn.comment,color:"#940"},{tag:Gn.invalid,color:"#f00"}]),_Be=ni.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ATe=1e4,NTe="()[]{}",DTe=oi.define({combine(n){return o_(n,{afterCursor:!0,brackets:NTe,maxScanDistance:ATe,renderMatch:TBe})}}),vBe=yi.mark({class:"cm-matchingBracket"}),bBe=yi.mark({class:"cm-nonmatchingBracket"});function TBe(n){let e=[],t=n.matched?vBe:bBe;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const CBe=hc.define({create(){return yi.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(DTe);for(let s of e.state.selection.ranges){if(!s.empty)continue;let o=Lm(e.state,s.head,-1,i)||s.head>0&&Lm(e.state,s.head-1,1,i)||i.afterCursor&&(Lm(e.state,s.head,1,i)||s.head<e.state.doc.length&&Lm(e.state,s.head+1,-1,i));o&&(t=t.concat(i.renderMatch(o,e.state)))}return yi.set(t,!0)},provide:n=>ni.decorations.from(n)}),yBe=[CBe,_Be];function EBe(n={}){return[DTe.of(n),yBe]}const SBe=new Ys;function xj(n,e,t){let i=n.prop(e<0?Ys.openedBy:Ys.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Pj(n){let e=n.type.prop(SBe);return e?e(n.node):n}function Lm(n,e,t,i={}){let s=i.maxScanDistance||ATe,o=i.brackets||NTe,r=Jc(n),a=r.resolveInner(e,t);for(let c=a;c;c=c.parent){let u=xj(c.type,t,o);if(u&&c.from<c.to){let d=Pj(c);if(d&&(t>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return wBe(n,e,t,c,d,u,o)}}return IBe(n,e,t,r,a.type,s,o)}function wBe(n,e,t,i,s,o,r){let a=i.parent,c={from:s.from,to:s.to},u=0,d=a==null?void 0:a.cursor();if(d&&(t<0?d.childBefore(i.from):d.childAfter(i.to)))do if(t<0?d.to<=i.from:d.from>=i.to){if(u==0&&o.indexOf(d.type.name)>-1&&d.from<d.to){let f=Pj(d);return{start:c,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(xj(d.type,t,r))u++;else if(xj(d.type,-t,r)){if(u==0){let f=Pj(d);return{start:c,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}u--}}while(t<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function IBe(n,e,t,i,s,o,r){let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),c=r.indexOf(a);if(c<0||c%2==0!=t>0)return null;let u={from:t<0?e-1:e,to:t>0?e+1:e},d=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let g=0;!d.next().done&&g<=o;){let p=d.value;t<0&&(g+=p.length);let _=e+g*t;for(let v=t>0?0:p.length-1,C=t>0?p.length:-1;v!=C;v+=t){let y=r.indexOf(p[v]);if(!(y<0||i.resolveInner(_+v,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:u,end:{from:_+v,to:_+v+1},matched:y>>1==c>>1};f--}}t>0&&(g+=p.length)}return d.done?{start:u,matched:!1}:null}const LBe=Object.create(null),zle=[Uf.none],Kle=[],jle=Object.create(null),OBe=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])OBe[n]=RBe(LBe,e);function kz(n,e){Kle.indexOf(n)>-1||(Kle.push(n),console.warn(e))}function RBe(n,e){let t=[];for(let a of e.split(" ")){let c=[];for(let u of a.split(".")){let d=n[u]||Gn[u];d?typeof d=="function"?c.length?c=c.map(d):kz(u,`Modifier ${u} used at start of tag`):c.length?kz(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:kz(u,`Unknown highlighting tag ${u}`)}for(let u of c)t.push(u)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(a=>a.id),o=jle[s];if(o)return o.id;let r=jle[s]=Uf.define({id:zle.length,name:i,props:[N2e({[i]:t})]});return zle.push(r),r.id}Or.RTL,Or.LTR;const MBe=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=cee(n.state,t.from);return i.line?kBe(n):i.block?NBe(n):!1};function aee(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const kBe=aee(xBe,0),ABe=aee($Te,0),NBe=aee((n,e)=>$Te(n,e,$Be(e)),0);function cee(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const yN=50;function DBe(n,{open:e,close:t},i,s){let o=n.sliceDoc(i-yN,i),r=n.sliceDoc(s,s+yN),a=/\s*$/.exec(o)[0].length,c=/^\s*/.exec(r)[0].length,u=o.length-a;if(o.slice(u-e.length,u)==e&&r.slice(c,c+t.length)==t)return{open:{pos:i-a,margin:a&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-i<=2*yN?d=f=n.sliceDoc(i,s):(d=n.sliceDoc(i,i+yN),f=n.sliceDoc(s-yN,s));let g=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,_=f.length-p-t.length;return d.slice(g,g+e.length)==e&&f.slice(_,_+t.length)==t?{open:{pos:i+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:s-p-t.length,margin:/\s/.test(f.charAt(_-1))?1:0}}:null}function $Be(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to);s.from>i.from&&s.from==t.to&&(s=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function $Te(n,e,t=e.selection.ranges){let i=t.map(o=>cee(e,o.from).block);if(!i.every(o=>o))return null;let s=t.map((o,r)=>DBe(e,i[r],o.from,o.to));if(n!=2&&!s.every(o=>o))return{changes:e.changes(t.map((o,r)=>s[r]?[]:[{from:o.from,insert:i[r].open+" "},{from:o.to,insert:" "+i[r].close}]))};if(n!=1&&s.some(o=>o)){let o=[];for(let r=0,a;r<s.length;r++)if(a=s[r]){let c=i[r],{open:u,close:d}=a;o.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:o}}return null}function xBe(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:o,to:r}of t){let a=i.length,c=1e9,u=cee(e,o).line;if(u){for(let d=o;d<=r;){let f=e.doc.lineAt(d);if(f.from>s&&(o==r||r>f.from)){s=f.from;let g=/^\s*/.exec(f.text)[0].length,p=g==f.length,_=f.text.slice(g,g+u.length)==u?g:-1;g<f.text.length&&g<c&&(c=g),i.push({line:f,comment:_,token:u,indent:g,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=a;d<i.length;d++)i[d].indent<i[d].line.text.length&&(i[d].indent=c);i.length==a+1&&(i[a].single=!0)}}if(n!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&o.push({from:a.from+u,insert:c+" "});let r=e.changes(o);return{changes:r,selection:e.selection.map(r,1)}}else if(n!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:r,comment:a,token:c}of i)if(a>=0){let u=r.from+a,d=u+c.length;r.text[d-r.from]==" "&&d++,o.push({from:u,to:d})}return{changes:o}}return null}const Fj=yb.define(),PBe=yb.define(),FBe=oi.define(),xTe=oi.define({combine(n){return o_(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}}),PTe=hc.define({create(){return Om.empty},update(n,e){let t=e.state.facet(xTe),i=e.annotation(Fj);if(i){let c=bd.fromTransaction(e,i.selection),u=i.side,d=u==0?n.undone:n.done;return c?d=eW(d,d.length,t.minDepth,c):d=HTe(d,e.startState.selection),new Om(u==0?i.rest:d,u==0?d:i.rest)}let s=e.annotation(PBe);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(pa.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let o=bd.fromTransaction(e),r=e.annotation(pa.time),a=e.annotation(pa.userEvent);return o?n=n.addChanges(o,r,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,r,a,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Om(n.done.map(bd.fromJSON),n.undone.map(bd.fromJSON))}});function BBe(n={}){return[PTe,xTe.of(n),ni.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?FTe:e.inputType=="historyRedo"?Bj:null;return i?(e.preventDefault(),i(t)):!1}})]}function Y5(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(PTe,!1);if(!s)return!1;let o=s.pop(n,t,e);return o?(i(o),!0):!1}}const FTe=Y5(0,!1),Bj=Y5(1,!1),HBe=Y5(0,!0),VBe=Y5(1,!0);class bd{constructor(e,t,i,s,o){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=o}setSelAfter(e){return new bd(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new bd(e.changes&&da.fromJSON(e.changes),[],e.mapped&&Dm.fromJSON(e.mapped),e.startSelection&&rn.fromJSON(e.startSelection),e.selectionsAfter.map(rn.fromJSON))}static fromTransaction(e,t){let i=If;for(let s of e.startState.facet(FBe)){let o=s(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new bd(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,If)}static selection(e){return new bd(void 0,If,void 0,void 0,e)}}function eW(n,e,t,i){let s=e+1>t+20?e-t-1:0,o=n.slice(s,e);return o.push(i),o}function UBe(n,e){let t=[],i=!1;return n.iterChangedRanges((s,o)=>t.push(s,o)),e.iterChangedRanges((s,o,r,a)=>{for(let c=0;c<t.length;){let u=t[c++],d=t[c++];a>=u&&r<=d&&(i=!0)}}),i}function WBe(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function BTe(n,e){return n.length?e.length?n.concat(e):n:e}const If=[],GBe=200;function HTe(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-GBe));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),eW(n,n.length-1,1e9,t.setSelAfter(i)))}else return[bd.selection([e])]}function zBe(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Az(n,e){if(!n.length)return n;let t=n.length,i=If;for(;t;){let s=KBe(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let o=n.slice(0,t);return o[t-1]=s,o}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[bd.selection(i)]:If}function KBe(n,e,t){let i=BTe(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):If,t);if(!n.changes)return bd.selection(i);let s=n.changes.map(e),o=e.mapDesc(n.changes,!0),r=n.mapped?n.mapped.composeDesc(o):o;return new bd(s,ls.mapEffects(n.effects,e),r,n.startSelection.map(o),i)}const jBe=/^(input\.type|delete)($|\.)/;class Om{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Om(this.done,this.undone):this}addChanges(e,t,i,s,o){let r=this.done,a=r[r.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!i||jBe.test(i))&&(!a.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(o,UBe(a.changes,e.changes))||i=="input.type.compose")?r=eW(r,r.length-1,s.minDepth,new bd(e.changes.compose(a.changes),BTe(ls.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,If)):r=eW(r,r.length,s.minDepth,e),new Om(r,If,t,i)}addSelection(e,t,i,s){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:If;return o.length>0&&t-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&WBe(o[o.length-1],e)?this:new Om(HTe(this.done,e),this.undone,t,i)}addMapping(e){return new Om(Az(this.done,e),Az(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let s=e==0?this.done:this.undone;if(s.length==0)return null;let o=s[s.length-1],r=o.selectionsAfter[0]||t.selection;if(i&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Fj.of({side:e,rest:zBe(s),selection:r}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=s.length==1?If:s.slice(0,s.length-1);return o.mapped&&(a=Az(a,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Fj.of({side:e,rest:a,selection:r}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Om.empty=new Om(If,If);const XBe=[{key:"Mod-z",run:FTe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Bj,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Bj,preventDefault:!0},{key:"Mod-u",run:HBe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:VBe,preventDefault:!0}];function qR(n,e){return rn.create(n.ranges.map(e),n.mainIndex)}function r_(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function up({state:n,dispatch:e},t){let i=qR(n.selection,t);return i.eq(n.selection,!0)?!1:(e(r_(n,i)),!0)}function q5(n,e){return rn.cursor(e?n.to:n.from)}function VTe(n,e){return up(n,t=>t.empty?n.moveByChar(t,e):q5(t,e))}function tu(n){return n.textDirectionAt(n.state.selection.main.head)==Or.LTR}const UTe=n=>VTe(n,!tu(n)),WTe=n=>VTe(n,tu(n));function GTe(n,e){return up(n,t=>t.empty?n.moveByGroup(t,e):q5(t,e))}const YBe=n=>GTe(n,!tu(n)),qBe=n=>GTe(n,tu(n));function JBe(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function J5(n,e,t){let i=Jc(n).resolveInner(e.head),s=t?Ys.closedBy:Ys.openedBy;for(let c=e.head;;){let u=t?i.childAfter(c):i.childBefore(c);if(!u)break;JBe(n,u,s)?i=u:c=t?u.to:u.from}let o=i.type.prop(s),r,a;return o&&(r=t?Lm(n,i.from,1):Lm(n,i.to,-1))&&r.matched?a=t?r.end.to:r.end.from:a=t?i.to:i.from,rn.cursor(a,t?-1:1)}const QBe=n=>up(n,e=>J5(n.state,e,!tu(n))),ZBe=n=>up(n,e=>J5(n.state,e,tu(n)));function zTe(n,e){return up(n,t=>{if(!t.empty)return q5(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const KTe=n=>zTe(n,!1),jTe=n=>zTe(n,!0);function XTe(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,s;if(e){for(let o of n.state.facet(ni.scrollMargins)){let r=o(n);r!=null&&r.top&&(t=Math.max(r==null?void 0:r.top,t)),r!=null&&r.bottom&&(i=Math.max(r==null?void 0:r.bottom,i))}s=n.scrollDOM.clientHeight-t-i}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,s-5)}}function YTe(n,e){let t=XTe(n),{state:i}=n,s=qR(i.selection,r=>r.empty?n.moveVertically(r,e,t.height):q5(r,e));if(s.eq(i.selection))return!1;let o;if(t.selfScroll){let r=n.coordsAtPos(i.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),c=a.top+t.marginTop,u=a.bottom-t.marginBottom;r&&r.top>c&&r.bottom<u&&(o=ni.scrollIntoView(s.main.head,{y:"start",yMargin:r.top-c}))}return n.dispatch(r_(i,s),{effects:o}),!0}const Xle=n=>YTe(n,!1),Hj=n=>YTe(n,!0);function My(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let o=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(s=rn.cursor(i.from+o))}return s}const eHe=n=>up(n,e=>My(n,e,!0)),tHe=n=>up(n,e=>My(n,e,!1)),nHe=n=>up(n,e=>My(n,e,!tu(n))),iHe=n=>up(n,e=>My(n,e,tu(n))),sHe=n=>up(n,e=>rn.cursor(n.lineBlockAt(e.head).from,1)),oHe=n=>up(n,e=>rn.cursor(n.lineBlockAt(e.head).to,-1));function rHe(n,e,t){let i=!1,s=qR(n.selection,o=>{let r=Lm(n,o.head,-1)||Lm(n,o.head,1)||o.head>0&&Lm(n,o.head-1,1)||o.head<n.doc.length&&Lm(n,o.head+1,-1);if(!r||!r.end)return o;i=!0;let a=r.start.from==o.head?r.end.to:r.end.from;return rn.cursor(a)});return i?(e(r_(n,s)),!0):!1}const lHe=({state:n,dispatch:e})=>rHe(n,e);function qf(n,e){let t=qR(n.state.selection,i=>{let s=e(i);return rn.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(r_(n.state,t)),!0)}function qTe(n,e){return qf(n,t=>n.moveByChar(t,e))}const JTe=n=>qTe(n,!tu(n)),QTe=n=>qTe(n,tu(n));function ZTe(n,e){return qf(n,t=>n.moveByGroup(t,e))}const aHe=n=>ZTe(n,!tu(n)),cHe=n=>ZTe(n,tu(n)),uHe=n=>qf(n,e=>J5(n.state,e,!tu(n))),dHe=n=>qf(n,e=>J5(n.state,e,tu(n)));function eCe(n,e){return qf(n,t=>n.moveVertically(t,e))}const tCe=n=>eCe(n,!1),nCe=n=>eCe(n,!0);function iCe(n,e){return qf(n,t=>n.moveVertically(t,e,XTe(n).height))}const Yle=n=>iCe(n,!1),qle=n=>iCe(n,!0),hHe=n=>qf(n,e=>My(n,e,!0)),fHe=n=>qf(n,e=>My(n,e,!1)),gHe=n=>qf(n,e=>My(n,e,!tu(n))),pHe=n=>qf(n,e=>My(n,e,tu(n))),mHe=n=>qf(n,e=>rn.cursor(n.lineBlockAt(e.head).from)),_He=n=>qf(n,e=>rn.cursor(n.lineBlockAt(e.head).to)),Jle=({state:n,dispatch:e})=>(e(r_(n,{anchor:0})),!0),Qle=({state:n,dispatch:e})=>(e(r_(n,{anchor:n.doc.length})),!0),Zle=({state:n,dispatch:e})=>(e(r_(n,{anchor:n.selection.main.anchor,head:0})),!0),eae=({state:n,dispatch:e})=>(e(r_(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),vHe=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),bHe=({state:n,dispatch:e})=>{let t=Q5(n).map(({from:i,to:s})=>rn.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:rn.create(t),userEvent:"select"})),!0},THe=({state:n,dispatch:e})=>{let t=qR(n.selection,i=>{let s=Jc(n),o=s.resolveStack(i.from,1);if(i.empty){let r=s.resolveStack(i.from,-1);r.node.from>=o.node.from&&r.node.to<=o.node.to&&(o=r)}for(let r=o;r;r=r.next){let{node:a}=r;if((a.from<i.from&&a.to>=i.to||a.to>i.to&&a.from<=i.from)&&r.next)return rn.range(a.to,a.from)}return i});return t.eq(n.selection)?!1:(e(r_(n,t)),!0)},CHe=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=rn.create([t.main]):t.main.empty||(i=rn.create([rn.cursor(t.main.head)])),i?(e(r_(n,i)),!0):!1};function qP(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(o=>{let{from:r,to:a}=o;if(r==a){let c=e(o);c<r?(t="delete.backward",c=dH(n,c,!1)):c>r&&(t="delete.forward",c=dH(n,c,!0)),r=Math.min(r,c),a=Math.max(a,c)}else r=dH(n,r,!1),a=dH(n,a,!0);return r==a?{range:o}:{changes:{from:r,to:a},range:rn.cursor(r,r<o.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?ni.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function dH(n,e,t){if(n instanceof ni)for(let i of n.state.facet(ni.atomicRanges).map(s=>s(n)))i.between(e,e,(s,o)=>{s<e&&o>e&&(e=t?o:s)});return e}const sCe=(n,e,t)=>qP(n,i=>{let s=i.from,{state:o}=n,r=o.doc.lineAt(s),a,c;if(t&&!e&&s>r.from&&s<r.from+200&&!/[^ \t]/.test(a=r.text.slice(0,s-r.from))){if(a[a.length-1]==" ")return s-1;let u=YR(a,o.tabSize),d=u%J4(o)||J4(o);for(let f=0;f<d&&a[a.length-1-f]==" ";f++)s--;c=s}else c=sc(r.text,s-r.from,e,e)+r.from,c==s&&r.number!=(e?o.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(r.text.slice(c-r.from,s-r.from))&&(c=sc(r.text,c-r.from,!1,!1)+r.from);return c}),Vj=n=>sCe(n,!1,!0),oCe=n=>sCe(n,!0,!1),rCe=(n,e)=>qP(n,t=>{let i=t.head,{state:s}=n,o=s.doc.lineAt(i),r=s.charCategorizer(i);for(let a=null;;){if(i==(e?o.to:o.from)){i==t.head&&o.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let c=sc(o.text,i-o.from,e)+o.from,u=o.text.slice(Math.min(i,c)-o.from,Math.max(i,c)-o.from),d=r(u);if(a!=null&&d!=a)break;(u!=" "||i!=t.head)&&(a=d),i=c}return i}),lCe=n=>rCe(n,!1),yHe=n=>rCe(n,!0),EHe=n=>qP(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),SHe=n=>qP(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),wHe=n=>qP(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),IHe=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Lo.of(["",""])},range:rn.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},LHe=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,o=n.doc.lineAt(s),r=s==o.from?s-1:sc(o.text,s-o.from,!1)+o.from,a=s==o.to?s+1:sc(o.text,s-o.from,!0)+o.from;return{changes:{from:r,to:a,insert:n.doc.slice(s,a).append(n.doc.slice(r,s))},range:rn.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Q5(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),o=n.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=n.doc.lineAt(i.to-1)),t>=s.number){let r=e[e.length-1];r.to=o.to,r.ranges.push(i)}else e.push({from:s.from,to:o.to,ranges:[i]});t=o.number+1}return e}function aCe(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let o of Q5(n)){if(t?o.to==n.doc.length:o.from==0)continue;let r=n.doc.lineAt(t?o.to+1:o.from-1),a=r.length+1;if(t){i.push({from:o.to,to:r.to},{from:o.from,insert:r.text+n.lineBreak});for(let c of o.ranges)s.push(rn.range(Math.min(n.doc.length,c.anchor+a),Math.min(n.doc.length,c.head+a)))}else{i.push({from:r.from,to:o.from},{from:o.to,insert:n.lineBreak+r.text});for(let c of o.ranges)s.push(rn.range(c.anchor-a,c.head-a))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:rn.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const OHe=({state:n,dispatch:e})=>aCe(n,e,!1),RHe=({state:n,dispatch:e})=>aCe(n,e,!0);function cCe(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Q5(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const MHe=({state:n,dispatch:e})=>cCe(n,e,!1),kHe=({state:n,dispatch:e})=>cCe(n,e,!0),AHe=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Q5(e).map(({from:s,to:o})=>(s>0?s--:o<e.doc.length&&o++,{from:s,to:o}))),i=qR(e.selection,s=>{let o;if(n.lineWrapping){let r=n.lineBlockAt(s.head),a=n.coordsAtPos(s.head,s.assoc||1);a&&(o=r.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,o)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function NHe(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Jc(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),o;return i&&s&&i.to<=e&&s.from>=e&&(o=i.type.prop(Ys.closedBy))&&o.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const tae=uCe(!1),DHe=uCe(!0);function uCe(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:o,to:r}=s,a=e.doc.lineAt(o),c=!n&&o==r&&NHe(e,o);n&&(o=r=(r<=a.to?a:e.doc.lineAt(r)).to);let u=new K5(e,{simulateBreak:o,simulateDoubleBreak:!!c}),d=ree(u,o);for(d==null&&(d=YR(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));r<a.to&&/\s/.test(a.text[r-a.from]);)r++;c?{from:o,to:r}=c:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let f=["",V$(e,d)];return c&&f.push(V$(e,u.lineIndent(a.from,-1))),{changes:{from:o,to:r,insert:Lo.of(f)},range:rn.cursor(o+1+f[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function uee(n,e){let t=-1;return n.changeByRange(i=>{let s=[];for(let r=i.from;r<=i.to;){let a=n.doc.lineAt(r);a.number>t&&(i.empty||i.to>a.from)&&(e(a,s,i),t=a.number),r=a.to+1}let o=n.changes(s);return{changes:s,range:rn.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const $He=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new K5(n,{overrideIndentation:o=>{let r=t[o];return r??-1}}),s=uee(n,(o,r,a)=>{let c=ree(i,o.from);if(c==null)return;/\S/.test(o.text)||(c=0);let u=/^\s*/.exec(o.text)[0],d=V$(n,c);(u!=d||a.from<o.from+u.length)&&(t[o.from]=c,r.push({from:o.from,to:o.from+u.length,insert:d}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},dCe=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(uee(n,(t,i)=>{i.push({from:t.from,insert:n.facet(z5)})}),{userEvent:"input.indent"})),!0),hCe=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(uee(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let o=YR(s,n.tabSize),r=0,a=V$(n,Math.max(0,o-J4(n)));for(;r<s.length&&r<a.length&&s.charCodeAt(r)==a.charCodeAt(r);)r++;i.push({from:t.from+r,to:t.from+s.length,insert:a.slice(r)})}),{userEvent:"delete.dedent"})),!0),xHe=n=>(n.setTabFocusMode(),!0),PHe=[{key:"Ctrl-b",run:UTe,shift:JTe,preventDefault:!0},{key:"Ctrl-f",run:WTe,shift:QTe},{key:"Ctrl-p",run:KTe,shift:tCe},{key:"Ctrl-n",run:jTe,shift:nCe},{key:"Ctrl-a",run:sHe,shift:mHe},{key:"Ctrl-e",run:oHe,shift:_He},{key:"Ctrl-d",run:oCe},{key:"Ctrl-h",run:Vj},{key:"Ctrl-k",run:EHe},{key:"Ctrl-Alt-h",run:lCe},{key:"Ctrl-o",run:IHe},{key:"Ctrl-t",run:LHe},{key:"Ctrl-v",run:Hj}],FHe=[{key:"ArrowLeft",run:UTe,shift:JTe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:YBe,shift:aHe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:nHe,shift:gHe,preventDefault:!0},{key:"ArrowRight",run:WTe,shift:QTe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:qBe,shift:cHe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:iHe,shift:pHe,preventDefault:!0},{key:"ArrowUp",run:KTe,shift:tCe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Jle,shift:Zle},{mac:"Ctrl-ArrowUp",run:Xle,shift:Yle},{key:"ArrowDown",run:jTe,shift:nCe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Qle,shift:eae},{mac:"Ctrl-ArrowDown",run:Hj,shift:qle},{key:"PageUp",run:Xle,shift:Yle},{key:"PageDown",run:Hj,shift:qle},{key:"Home",run:tHe,shift:fHe,preventDefault:!0},{key:"Mod-Home",run:Jle,shift:Zle},{key:"End",run:eHe,shift:hHe,preventDefault:!0},{key:"Mod-End",run:Qle,shift:eae},{key:"Enter",run:tae,shift:tae},{key:"Mod-a",run:vHe},{key:"Backspace",run:Vj,shift:Vj},{key:"Delete",run:oCe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lCe},{key:"Mod-Delete",mac:"Alt-Delete",run:yHe},{mac:"Mod-Backspace",run:SHe},{mac:"Mod-Delete",run:wHe}].concat(PHe.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),BHe=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:QBe,shift:uHe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:ZBe,shift:dHe},{key:"Alt-ArrowUp",run:OHe},{key:"Shift-Alt-ArrowUp",run:MHe},{key:"Alt-ArrowDown",run:RHe},{key:"Shift-Alt-ArrowDown",run:kHe},{key:"Escape",run:CHe},{key:"Mod-Enter",run:DHe},{key:"Alt-l",mac:"Ctrl-l",run:bHe},{key:"Mod-i",run:THe,preventDefault:!0},{key:"Mod-[",run:hCe},{key:"Mod-]",run:dCe},{key:"Mod-Alt-\\",run:$He},{key:"Shift-Mod-k",run:AHe},{key:"Shift-Mod-\\",run:lHe},{key:"Mod-/",run:MBe},{key:"Alt-A",run:ABe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:xHe}].concat(FHe),HHe={key:"Tab",run:dCe,shift:hCe};function fr(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;e<arguments.length;e++)fCe(n,arguments[e]);return n}function fCe(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)fCe(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const nae=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class UO{constructor(e,t,i=0,s=e.length,o,r){this.test=r,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=o?a=>o(nae(a)):nae,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return dd(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=HZ(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=_m(e);let s=this.normalize(t);if(s.length)for(let o=0,r=i;;o++){let a=s.charCodeAt(o),c=this.match(a,r,this.bufferPos+this.bufferStart);if(o==s.length-1){if(c)return this.value=c,this;break}r==i&&o<t.length&&t.charCodeAt(o)==a&&r++}}}match(e,t,i){let s=null;for(let o=0;o<this.matches.length;o+=2){let r=this.matches[o],a=!1;this.query.charCodeAt(r)==e&&(r==this.query.length-1?s={from:this.matches[o+1],to:i}:(this.matches[o]++,a=!0)),a||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:t,to:i}:this.matches.push(1,t)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(UO.prototype[Symbol.iterator]=function(){return this});const gCe={from:-1,to:-1,match:/.*/.exec("")},dee="gm"+(/x/.unicode==null?"":"u");class pCe{constructor(e,t,i,s=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=gCe,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new mCe(e,t,i,s,o);this.re=new RegExp(t,dee+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=e.iter();let r=e.lineAt(s);this.curLineStart=r.from,this.matchPos=tW(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=tW(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<s||i>this.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Nz=new WeakMap;class rO{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let s=Nz.get(e);if(!s||s.from>=i||s.to<=t){let a=new rO(t,e.sliceString(t,i));return Nz.set(e,a),a}if(s.from==t&&s.to==i)return s;let{text:o,from:r}=s;return r>t&&(o=e.sliceString(t,r)+o,r=t),s.to<i&&(o+=e.sliceString(s.to,i)),Nz.set(e,new rO(r,o)),new rO(t,o.slice(t-r,i-r))}}class mCe{constructor(e,t,i,s,o){this.text=e,this.to=o,this.done=!1,this.value=gCe,this.matchPos=tW(e,s),this.re=new RegExp(t,dee+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=rO.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=tW(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=rO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(pCe.prototype[Symbol.iterator]=mCe.prototype[Symbol.iterator]=function(){return this});function VHe(n){try{return new RegExp(n,dee),!0}catch{return!1}}function tW(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}function Uj(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=fr("input",{class:"cm-textfield",name:"line",value:e}),i=fr("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),n.dispatch({effects:nW.of(!1)}),n.focus()):o.keyCode==13&&(o.preventDefault(),s())},onsubmit:o=>{o.preventDefault(),s()}},fr("label",n.state.phrase("Go to line"),": ",t)," ",fr("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!o)return;let{state:r}=n,a=r.doc.lineAt(r.selection.main.head),[,c,u,d,f]=o,g=d?+d.slice(1):0,p=u?+u:a.number;if(u&&f){let C=p/100;c&&(C=C*(c=="-"?-1:1)+a.number/r.doc.lines),p=Math.round(r.doc.lines*C)}else u&&c&&(p=p*(c=="-"?-1:1)+a.number);let _=r.doc.line(Math.max(1,Math.min(r.doc.lines,p))),v=rn.cursor(_.from+Math.max(0,Math.min(g,_.length)));n.dispatch({effects:[nW.of(!1),ni.scrollIntoView(v.from,{y:"center"})],selection:v}),n.focus()}return{dom:i}}const nW=ls.define(),iae=hc.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(nW)&&(n=t.value);return n},provide:n=>B$.from(n,e=>e?Uj:null)}),UHe=n=>{let e=F$(n,Uj);if(!e){let t=[nW.of(!0)];n.state.field(iae,!1)==null&&t.push(ls.appendConfig.of([iae,WHe])),n.dispatch({effects:t}),e=F$(n,Uj)}return e&&e.dom.querySelector("input").select(),!0},WHe=ni.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),GHe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zHe=oi.define({combine(n){return o_(n,GHe,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function KHe(n){return[JHe,qHe]}const jHe=yi.mark({class:"cm-selectionMatch"}),XHe=yi.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function sae(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=Pr.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=Pr.Word)}function YHe(n,e,t,i){return n(e.sliceDoc(t,t+1))==Pr.Word&&n(e.sliceDoc(i-1,i))==Pr.Word}const qHe=Il.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(zHe),{state:t}=n,i=t.selection;if(i.ranges.length>1)return yi.none;let s=i.main,o,r=null;if(s.empty){if(!e.highlightWordAroundCursor)return yi.none;let c=t.wordAt(s.head);if(!c)return yi.none;r=t.charCategorizer(s.head),o=t.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<e.minSelectionLength||c>200)return yi.none;if(e.wholeWords){if(o=t.sliceDoc(s.from,s.to),r=t.charCategorizer(s.head),!(sae(r,t,s.from,s.to)&&YHe(r,t,s.from,s.to)))return yi.none}else if(o=t.sliceDoc(s.from,s.to),!o)return yi.none}let a=[];for(let c of n.visibleRanges){let u=new UO(t.doc,o,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!r||sae(r,t,d,f))&&(s.empty&&d<=s.from&&f>=s.to?a.push(XHe.range(d,f)):(d>=s.to||f<=s.from)&&a.push(jHe.range(d,f)),a.length>e.maxMatches))return yi.none}}return yi.set(a)}},{decorations:n=>n.decorations}),JHe=ni.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),QHe=({state:n,dispatch:e})=>{let{selection:t}=n,i=rn.create(t.ranges.map(s=>n.wordAt(s.head)||rn.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function ZHe(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),o=s&&s.from==t.from&&s.to==t.to;for(let r=!1,a=new UO(n.doc,e,i[i.length-1].to);;)if(a.next(),a.done){if(r)return null;a=new UO(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),r=!0}else{if(r&&i.some(c=>c.from==a.value.from))continue;if(o){let c=n.wordAt(a.value.from);if(!c||c.from!=a.value.from||c.to!=a.value.to)continue}return a.value}}const eVe=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(o=>o.from===o.to))return QHe({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(o=>n.sliceDoc(o.from,o.to)!=i))return!1;let s=ZHe(n,i);return s?(e(n.update({selection:n.selection.addRange(rn.range(s.from,s.to),!1),effects:ni.scrollIntoView(s.to)})),!0):!1},JR=oi.define({combine(n){return o_(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new hVe(e),scrollToMatch:e=>ni.scrollIntoView(e)})}});class _Ce{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||VHe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
- `:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new sVe(this):new nVe(this)}getCursor(e,t=0,i){let s=e.doc?e:Rr.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?T1(this,s,t,i):b1(this,s,t,i)}}class vCe{constructor(e){this.spec=e}}function b1(n,e,t,i){return new UO(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?tVe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function tVe(n,e){return(t,i,s,o)=>((o>t||o+s.length<i)&&(o=Math.max(0,t-2),s=n.sliceString(o,Math.min(n.length,i+2))),(e(iW(s,t-o))!=Pr.Word||e(sW(s,t-o))!=Pr.Word)&&(e(sW(s,i-o))!=Pr.Word||e(iW(s,i-o))!=Pr.Word))}class nVe extends vCe{constructor(e){super(e)}nextMatch(e,t,i){let s=b1(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let o=Math.min(e.doc.length,t+this.spec.unquoted.length);s=b1(this.spec,e,0,o).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let o=Math.max(t,s-1e4-this.spec.unquoted.length),r=b1(this.spec,e,o,s),a=null;for(;!r.nextOverlapping().done;)a=r.value;if(a)return a;if(o==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=b1(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let o=b1(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)s(o.value.from,o.value.to)}}function T1(n,e,t,i){return new pCe(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?iVe(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function iW(n,e){return n.slice(sc(n,e,!1),e)}function sW(n,e){return n.slice(e,sc(n,e))}function iVe(n){return(e,t,i)=>!i[0].length||(n(iW(i.input,i.index))!=Pr.Word||n(sW(i.input,i.index))!=Pr.Word)&&(n(sW(i.input,i.index+i[0].length))!=Pr.Word||n(iW(i.input,i.index+i[0].length))!=Pr.Word)}class sVe extends vCe{nextMatch(e,t,i){let s=T1(this.spec,e,i,e.doc.length).next();return s.done&&(s=T1(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let o=Math.max(t,i-s*1e4),r=T1(this.spec,e,o,i),a=null;for(;!r.next().done;)a=r.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=T1(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let o=T1(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!o.next().done;)s(o.value.from,o.value.to)}}const U$=ls.define(),hee=ls.define(),OC=hc.define({create(n){return new Dz(Wj(n).create(),null)},update(n,e){for(let t of e.effects)t.is(U$)?n=new Dz(t.value.create(),n.panel):t.is(hee)&&(n=new Dz(n.query,t.value?fee:null));return n},provide:n=>B$.from(n,e=>e.panel)});class Dz{constructor(e,t){this.query=e,this.panel=t}}const oVe=yi.mark({class:"cm-searchMatch"}),rVe=yi.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lVe=Il.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(OC))}update(n){let e=n.state.field(OC);(e!=n.startState.field(OC)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return yi.none;let{view:t}=this,i=new sb;for(let s=0,o=t.visibleRanges,r=o.length;s<r;s++){let{from:a,to:c}=o[s];for(;s<r-1&&c>o[s+1].from-2*250;)c=o[++s].to;n.highlight(t.state,a,c,(u,d)=>{let f=t.state.selection.ranges.some(g=>g.from==u&&g.to==d);i.add(u,d,f?rVe:oVe)})}return i.finish()}},{decorations:n=>n.decorations});function JP(n){return e=>{let t=e.state.field(OC,!1);return t&&t.query.spec.valid?n(e,t):CCe(e)}}const oW=JP((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=rn.single(i.from,i.to),o=n.state.facet(JR);return n.dispatch({selection:s,effects:[gee(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),TCe(n),!0}),rW=JP((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let o=rn.single(s.from,s.to),r=n.state.facet(JR);return n.dispatch({selection:o,effects:[gee(n,s),r.scrollToMatch(o.main,n)],userEvent:"select.search"}),TCe(n),!0}),aVe=JP((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:rn.create(t.map(i=>rn.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),cVe=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,o=[],r=0;for(let a=new UO(n.doc,n.sliceDoc(i,s));!a.next().done;){if(o.length>1e3)return!1;a.value.from==i&&(r=o.length),o.push(rn.range(a.value.from,a.value.to))}return e(n.update({selection:rn.create(o,r),userEvent:"select.search.matches"})),!0},oae=JP((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let o=e.nextMatch(t,i,i);if(!o)return!1;let r=o,a=[],c,u,d=[];if(r.from==i&&r.to==s&&(u=t.toText(e.getReplacement(r)),a.push({from:r.from,to:r.to,insert:u}),r=e.nextMatch(t,r.from,r.to),d.push(ni.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let f=a.length==0||a[0].from>=o.to?0:o.to-o.from-u.length;c=rn.single(r.from-f,r.to-f),d.push(gee(n,r)),d.push(t.facet(JR).scrollToMatch(c.main,n))}return n.dispatch({changes:a,selection:c,effects:d,userEvent:"input.replace"}),!0}),uVe=JP((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:o,to:r}=s;return{from:o,to:r,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:ni.announce.of(i),userEvent:"input.replace.all"}),!0});function fee(n){return n.state.facet(JR).createPanel(n)}function Wj(n,e){var t,i,s,o,r;let a=n.selection.main,c=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!c)return e;let u=n.facet(JR);return new _Ce({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:u.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(r=e==null?void 0:e.wholeWord)!==null&&r!==void 0?r:u.wholeWord})}function bCe(n){let e=F$(n,fee);return e&&e.dom.querySelector("[main-field]")}function TCe(n){let e=bCe(n);e&&e==n.root.activeElement&&e.select()}const CCe=n=>{let e=n.state.field(OC,!1);if(e&&e.panel){let t=bCe(n);if(t&&t!=n.root.activeElement){let i=Wj(n.state,e.query.spec);i.valid&&n.dispatch({effects:U$.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[hee.of(!0),e?U$.of(Wj(n.state,e.query.spec)):ls.appendConfig.of(gVe)]});return!0},yCe=n=>{let e=n.state.field(OC,!1);if(!e||!e.panel)return!1;let t=F$(n,fee);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:hee.of(!1)}),!0},dVe=[{key:"Mod-f",run:CCe,scope:"editor search-panel"},{key:"F3",run:oW,shift:rW,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:oW,shift:rW,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yCe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:cVe},{key:"Mod-Alt-g",run:UHe},{key:"Mod-d",run:eVe,preventDefault:!0}];class hVe{constructor(e){this.view=e;let t=this.query=e.state.field(OC).query.spec;this.commit=this.commit.bind(this),this.searchField=fr("input",{value:t.search,placeholder:Zd(e,"Find"),"aria-label":Zd(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=fr("input",{value:t.replace,placeholder:Zd(e,"Replace"),"aria-label":Zd(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=fr("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=fr("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=fr("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,o,r){return fr("button",{class:"cm-button",name:s,onclick:o,type:"button"},r)}this.dom=fr("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>oW(e),[Zd(e,"next")]),i("prev",()=>rW(e),[Zd(e,"previous")]),i("select",()=>aVe(e),[Zd(e,"all")]),fr("label",null,[this.caseField,Zd(e,"match case")]),fr("label",null,[this.reField,Zd(e,"regexp")]),fr("label",null,[this.wordField,Zd(e,"by word")]),...e.state.readOnly?[]:[fr("br"),this.replaceField,i("replace",()=>oae(e),[Zd(e,"replace")]),i("replaceAll",()=>uVe(e),[Zd(e,"replace all")])],fr("button",{name:"close",onclick:()=>yCe(e),"aria-label":Zd(e,"close"),type:"button"},["×"])])}commit(){let e=new _Ce({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:U$.of(e)}))}keydown(e){_Fe(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?rW:oW)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),oae(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(U$)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(JR).top}}function Zd(n,e){return n.state.phrase(e)}const hH=30,fH=/[\s\.,:;?!]/;function gee(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,o=Math.max(i.from,e-hH),r=Math.min(s,t+hH),a=n.state.sliceDoc(o,r);if(o!=i.from){for(let c=0;c<hH;c++)if(!fH.test(a[c+1])&&fH.test(a[c])){a=a.slice(c);break}}if(r!=s){for(let c=a.length-1;c>a.length-hH;c--)if(!fH.test(a[c-1])&&fH.test(a[c])){a=a.slice(0,c);break}}return ni.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${i.number}.`)}const fVe=ni.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),gVe=[OC,Mw.low(lVe),fVe];class ECe{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Jc(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),o=s.search(SCe(e,!1));return o<0?null:{from:i+o,to:this.pos,text:s.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function rae(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function pVe(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let o=1;o<s.length;o++)t[s[o]]=!0}let i=rae(e)+rae(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function mVe(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:pVe(e);return s=>{let o=s.matchBefore(i);return o||s.explicit?{from:o?o.from:s.pos,options:e,validFor:t}:null}}let lae=class{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}};function o0(n){return n.selection.main.from}function SCe(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",o=i[i.length-1]!="$";return!s&&!o?n:new RegExp(`${s?"^":""}(?:${i})${o?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const wCe=yb.define();function _Ve(n,e,t,i){let{main:s}=n.selection,o=t-s.from,r=i-s.from;return Object.assign(Object.assign({},n.changeByRange(a=>{if(a!=s&&t!=i&&n.sliceDoc(a.from+o,a.from+r)!=n.sliceDoc(t,i))return{range:a};let c=n.toText(e);return{changes:{from:a.from+o,to:i==s.from?a.to:a.from+r,insert:c},range:rn.cursor(a.from+o+c.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const aae=new WeakMap;function vVe(n){if(!Array.isArray(n))return n;let e=aae.get(n);return e||aae.set(n,e=mVe(n)),e}const lW=ls.define(),W$=ls.define();class bVe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=dd(e,t),s=_m(i);this.chars.push(i);let o=e.slice(t,t+s),r=o.toUpperCase();this.folded.push(dd(r==o?o.toLowerCase():r,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:s,precise:o,byWord:r}=this;if(t.length==1){let w=dd(e,0),I=_m(w),L=I==e.length?0:-100;if(w!=t[0])if(w==i[0])L+=-200;else return null;return this.ret(L,[0,I])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,u=0;if(a<0){for(let w=0,I=Math.min(e.length,200);w<I&&u<c;){let L=dd(e,w);(L==t[u]||L==i[u])&&(s[u++]=w),w+=_m(L)}if(u<c)return null}let d=0,f=0,g=!1,p=0,_=-1,v=-1,C=/[a-z]/.test(e),y=!0;for(let w=0,I=Math.min(e.length,200),L=0;w<I&&f<c;){let O=dd(e,w);a<0&&(d<c&&O==t[d]&&(o[d++]=w),p<c&&(O==t[p]||O==i[p]?(p==0&&(_=w),v=w+1,p++):p=0));let A,N=O<255?O>=48&&O<=57||O>=97&&O<=122?2:O>=65&&O<=90?1:0:(A=HZ(O))!=A.toLowerCase()?1:A!=A.toUpperCase()?2:0;(!w||N==1&&C||L==0&&N!=0)&&(t[f]==O||i[f]==O&&(g=!0)?r[f++]=w:r.length&&(y=!1)),L=N,w+=_m(O)}return f==c&&r[0]==0&&y?this.result(-100+(g?-200:0),r,e):p==c&&_==0?this.ret(-200-e.length+(v==e.length?0:-100),[0,v]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==c?this.ret(-900-e.length,[_,v]):f==c?this.result(-100+(g?-200:0)+-700+(y?0:-1100),r,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],o=0;for(let r of t){let a=r+(this.astral?_m(dd(i,r)):1);o&&s[o-1]==r?s[o-1]=a:(s[o++]=r,s[o++]=a)}return this.ret(e-i.length,s)}}class TVe{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const Pa=oi.define({combine(n){return o_(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:CVe,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>cae(e(i),t(i)),optionClass:(e,t)=>i=>cae(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function cae(n,e){return n?e?n+" "+e:n:e}function CVe(n,e,t,i,s,o){let r=n.textDirection==Or.RTL,a=r,c=!1,u="top",d,f,g=e.left-s.left,p=s.right-e.right,_=i.right-i.left,v=i.bottom-i.top;if(a&&g<Math.min(_,p)?a=!1:!a&&p<Math.min(_,g)&&(a=!0),_<=(a?g:p))d=Math.max(s.top,Math.min(t.top,s.bottom-v))-e.top,f=Math.min(400,a?g:p);else{c=!0,f=Math.min(400,(r?e.right:s.right-e.left)-30);let w=s.bottom-e.bottom;w>=v||w>e.top?d=t.bottom-e.top:(u="bottom",d=e.bottom-t.top)}let C=(e.bottom-e.top)/o.offsetHeight,y=(e.right-e.left)/o.offsetWidth;return{style:`${u}: ${d/C}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?r?"left-narrow":"right-narrow":a?"left":"right")}}function yVe(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,o){let r=document.createElement("span");r.className="cm-completionLabel";let a=t.displayLabel||t.label,c=0;for(let u=0;u<o.length;){let d=o[u++],f=o[u++];d>c&&r.appendChild(document.createTextNode(a.slice(c,d)));let g=r.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(a.slice(d,f))),g.className="cm-completionMatchedText",c=f}return c<a.length&&r.appendChild(document.createTextNode(a.slice(c))),r},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function $z(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class EVe{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:o,selected:r}=s.open,a=e.state.facet(Pa);this.optionContent=yVe(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=$z(o.length,r,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=e.state.field(t).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]<u.length){this.applyCompletion(e,u[+f[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Pa).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:W$.of(null)})}),this.showOptions(o,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:o,selected:r,disabled:a}=i.open;(!s.open||s.open.options!=o)&&(this.range=$z(o.length,r,e.state.facet(Pa).maxRenderedOptions),this.showOptions(o,i.id)),this.updateSel(),a!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=$z(t.options.length,t.selected,this.view.state.facet(Pa).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(i);if(!o)return;"then"in o?o.then(r=>{r&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(r,i)}).catch(r=>vd(this.view.state,r,"completion info")):this.addInfoPane(o,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:o}=e;i.appendChild(s),this.infoDestroy=o||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&wVe(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),o=this.space;if(!o){let r=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:r.innerWidth,bottom:r.innerHeight}}return s.top>Math.min(o.bottom,t.bottom)-10||s.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(Pa).positionInfo(this.view,t,s,i,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let r=i.from;r<i.to;r++){let{completion:a,match:c}=e[r],{section:u}=a;if(u){let g=typeof u=="string"?u:u.name;if(g!=o&&(r>i.from||i.from==0))if(o=g,typeof u!="string"&&u.header)s.appendChild(u.header(u));else{let p=s.appendChild(document.createElement("completion-section"));p.textContent=g}}const d=s.appendChild(document.createElement("li"));d.id=t+"-"+r,d.setAttribute("role","option");let f=this.optionClass(a);f&&(d.className=f);for(let g of this.optionContent){let p=g(a,this.view.state,this.view,c);p&&d.appendChild(p)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function SVe(n,e){return t=>new EVe(t,n,e)}function wVe(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/s:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function uae(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function IVe(n,e){let t=[],i=null,s=u=>{t.push(u);let{section:d}=u.completion;if(d){i||(i=[]);let f=typeof d=="string"?d:d.name;i.some(g=>g.name==f)||i.push(typeof d=="string"?{name:f}:d)}},o=e.facet(Pa);for(let u of n)if(u.hasResult()){let d=u.result.getMatch;if(u.result.filter===!1)for(let f of u.result.options)s(new lae(f,u.source,d?d(f):[],1e9-t.length));else{let f=e.sliceDoc(u.from,u.to),g,p=o.filterStrict?new TVe(f):new bVe(f);for(let _ of u.result.options)if(g=p.match(_.label)){let v=_.displayLabel?d?d(_,g.matched):[]:g.matched;s(new lae(_,u.source,v,g.score+(_.boost||0)))}}}if(i){let u=Object.create(null),d=0,f=(g,p)=>{var _,v;return((_=g.rank)!==null&&_!==void 0?_:1e9)-((v=p.rank)!==null&&v!==void 0?v:1e9)||(g.name<p.name?-1:1)};for(let g of i.sort(f))d-=1e5,u[g.name]=d;for(let g of t){let{section:p}=g.completion;p&&(g.score+=u[typeof p=="string"?p:p.name])}}let r=[],a=null,c=o.compareCompletions;for(let u of t.sort((d,f)=>f.score-d.score||c(d.completion,f.completion))){let d=u.completion;!a||a.label!=d.label||a.detail!=d.detail||a.type!=null&&d.type!=null&&a.type!=d.type||a.apply!=d.apply||a.boost!=d.boost?r.push(u):uae(u.completion)>uae(a)&&(r[r.length-1]=u),a=u.completion}return r}class $1{constructor(e,t,i,s,o,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=o,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new $1(this.options,dae(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,o,r){if(s&&!r&&e.some(u=>u.isPending))return s.setDisabled();let a=IVe(e,t);if(!a.length)return s&&e.some(u=>u.isPending)?s.setDisabled():null;let c=t.facet(Pa).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let u=s.options[s.selected].completion;for(let d=0;d<a.length;d++)if(a[d].completion==u){c=d;break}}return new $1(a,dae(i,c),{pos:e.reduce((u,d)=>d.hasResult()?Math.min(u,d.from):u,1e8),create:AVe,above:o.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new $1(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new $1(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class aW{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new aW(MVe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Pa),o=(i.override||t.languageDataAt("autocomplete",o0(t)).map(vVe)).map(c=>(this.active.find(d=>d.source==c)||new Lf(c,this.active.some(d=>d.state!=0)?1:0)).update(e,i));o.length==this.active.length&&o.every((c,u)=>c==this.active[u])&&(o=this.active);let r=this.open,a=e.effects.some(c=>c.is(pee));r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!LVe(o,this.active)||a?r=$1.build(o,t,this.id,r,i,a):r&&r.disabled&&!o.some(c=>c.isPending)&&(r=null),!r&&o.every(c=>!c.isPending)&&o.some(c=>c.hasResult())&&(o=o.map(c=>c.hasResult()?new Lf(c.source,0):c));for(let c of e.effects)c.is(LCe)&&(r=r&&r.setSelected(c.value,this.id));return o==this.active&&r==this.open?this:new aW(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?OVe:RVe}}function LVe(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let s=t==n.length,o=i==e.length;if(s||o)return s==o;if(n[t++].result!=e[i++].result)return!1}}const OVe={"aria-autocomplete":"list"},RVe={};function dae(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const MVe=[];function ICe(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(wCe);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Lf{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=ICe(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new Lf(s.source,0)),i&4&&s.state==0&&(s=new Lf(this.source,1)),s=s.updateFor(e,i);for(let o of e.effects)if(o.is(lW))s=new Lf(s.source,1,o.value);else if(o.is(W$))s=new Lf(s.source,0);else if(o.is(pee))for(let r of o.value)r.source==s.source&&(s=r);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(o0(e.state))}}class lO extends Lf{constructor(e,t,i,s,o,r){super(e,3,t),this.limit=i,this.result=s,this.from=o,this.to=r}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let o=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),a=o0(e.state);if(a>r||!s||t&2&&(o0(e.startState)==this.from||a<this.limit))return new Lf(this.source,t&4?1:0);let c=e.changes.mapPos(this.limit);return kVe(s.validFor,e.state,o,r)?new lO(this.source,this.explicit,c,s,o,r):s.update&&(s=s.update(s,o,r,new ECe(e.state,a,!1)))?new lO(this.source,this.explicit,c,s,s.from,(i=s.to)!==null&&i!==void 0?i:o0(e.state)):new Lf(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new lO(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Lf(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function kVe(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):SCe(n,!0).test(s)}const pee=ls.define({map(n,e){return n.map(t=>t.map(e))}}),LCe=ls.define(),fd=hc.define({create(){return aW.start()},update(n,e){return n.update(e)},provide:n=>[nee.from(n,e=>e.tooltip),ni.contentAttributes.from(n,e=>e.attrs)]});function mee(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(fd).active.find(s=>s.source==e.source);return i instanceof lO?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},_Ve(n.state,t,i.from,i.to)),{annotations:wCe.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const AVe=SVe(fd,mee);function gH(n,e="option"){return t=>{let i=t.state.field(fd,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(Pa).interactionDelay)return!1;let s=1,o;e=="page"&&(o=fTe(t,i.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:r}=i.open.options,a=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:r-1;return a<0?a=e=="page"?0:r-1:a>=r&&(a=e=="page"?r-1:0),t.dispatch({effects:LCe.of(a)}),!0}}const NVe=n=>{let e=n.state.field(fd,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Pa).interactionDelay?!1:mee(n,e.open.options[e.open.selected])},hae=n=>n.state.field(fd,!1)?(n.dispatch({effects:lW.of(!0)}),!0):!1,DVe=n=>{let e=n.state.field(fd,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:W$.of(null)}),!0)};class $Ve{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const xVe=50,PVe=1e3,FVe=Il.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(fd).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(fd),t=n.state.facet(Pa);if(!n.selectionSet&&!n.docChanged&&n.startState.field(fd)==e)return;let i=n.transactions.some(o=>{let r=ICe(o,t);return r&8||(o.selection||o.docChanged)&&!(r&3)});for(let o=0;o<this.running.length;o++){let r=this.running[o];if(i||r.context.abortOnDocChange&&n.docChanged||r.updates.length+n.transactions.length>xVe&&Date.now()-r.time>PVe){for(let a of r.context.abortListeners)try{a()}catch(c){vd(this.view.state,c)}r.context.abortListeners=null,this.running.splice(o--,1)}else r.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(o=>o.effects.some(r=>r.is(lW)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.isPending&&!this.running.some(r=>r.active.source==o.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let o of n.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(fd);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Pa).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=o0(e),i=new ECe(e,t,n.explicit,this.view),s=new $Ve(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(o=>{s.context.aborted||(s.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:W$.of(null)}),vd(this.view.state,o)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Pa).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Pa),i=this.view.state.field(fd);for(let s=0;s<this.running.length;s++){let o=this.running[s];if(o.done===void 0)continue;if(this.running.splice(s--,1),o.done){let a=o0(o.updates.length?o.updates[0].startState:this.view.state),c=Math.min(a,o.done.from+(o.active.explicit?0:1)),u=new lO(o.active.source,o.active.explicit,c,o.done,o.done.from,(n=o.done.to)!==null&&n!==void 0?n:a);for(let d of o.updates)u=u.update(d,t);if(u.hasResult()){e.push(u);continue}}let r=i.active.find(a=>a.source==o.active.source);if(r&&r.isPending)if(o.done==null){let a=new Lf(o.active.source,0);for(let c of o.updates)a=a.update(c,t);a.isPending||e.push(a)}else this.startQuery(r)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:pee.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(fd,!1);if(e&&e.tooltip&&this.view.state.facet(Pa).closeOnBlur){let t=e.open&&fTe(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:W$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:lW.of(!1)}),20),this.composing=0}}}),BVe=typeof navigator=="object"&&/Win/.test(navigator.platform),HVe=Mw.highest(ni.domEventHandlers({keydown(n,e){let t=e.state.field(fd,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(BVe&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(r=>r.source==i.source),o=i.completion.commitCharacters||s.result.commitCharacters;return o&&o.indexOf(n.key)>-1&&mee(e,i),!1}})),VVe=ni.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),G$={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},BS=ls.define({map(n,e){let t=e.mapPos(n,-1,wu.TrackAfter);return t??void 0}}),_ee=new class extends k0{};_ee.startSide=1;_ee.endSide=-1;const OCe=hc.define({create(){return oo.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(BS)&&(n=n.update({add:[_ee.range(t.value,t.value+1)]}));return n}});function UVe(){return[GVe,OCe]}const xz="()[]{}<>";function RCe(n){for(let e=0;e<xz.length;e+=2)if(xz.charCodeAt(e)==n)return xz.charAt(e+1);return HZ(n<128?n:n+1)}function MCe(n,e){return n.languageDataAt("closeBrackets",e)[0]||G$}const WVe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),GVe=ni.inputHandler.of((n,e,t,i)=>{if((WVe?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&_m(dd(i,0))==1||e!=s.from||t!=s.to)return!1;let o=jVe(n.state,i);return o?(n.dispatch(o),!0):!1}),zVe=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=MCe(n,n.selection.main.head).brackets||G$.brackets,s=null,o=n.changeByRange(r=>{if(r.empty){let a=XVe(n.doc,r.head);for(let c of i)if(c==a&&Z5(n.doc,r.head)==RCe(dd(c,0)))return{changes:{from:r.head-c.length,to:r.head+c.length},range:rn.cursor(r.head-c.length)}}return{range:s=r}});return s||e(n.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},KVe=[{key:"Backspace",run:zVe}];function jVe(n,e){let t=MCe(n,n.selection.main.head),i=t.brackets||G$.brackets;for(let s of i){let o=RCe(dd(s,0));if(e==s)return o==s?JVe(n,s,i.indexOf(s+s+s)>-1,t):YVe(n,s,o,t.before||G$.before);if(e==o&&kCe(n,n.selection.main.from))return qVe(n,s,o)}return null}function kCe(n,e){let t=!1;return n.field(OCe).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Z5(n,e){let t=n.sliceString(e,e+2);return t.slice(0,_m(dd(t,0)))}function XVe(n,e){let t=n.sliceString(e-2,e);return _m(dd(t,0))==t.length?t:t.slice(1)}function YVe(n,e,t,i){let s=null,o=n.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:t,from:r.to}],effects:BS.of(r.to+e.length),range:rn.range(r.anchor+e.length,r.head+e.length)};let a=Z5(n.doc,r.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:e+t,from:r.head},effects:BS.of(r.head+e.length),range:rn.cursor(r.head+e.length)}:{range:s=r}});return s?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function qVe(n,e,t){let i=null,s=n.changeByRange(o=>o.empty&&Z5(n.doc,o.head)==t?{changes:{from:o.head,to:o.head+t.length,insert:t},range:rn.cursor(o.head+t.length)}:i={range:o});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function JVe(n,e,t,i){let s=i.stringPrefixes||G$.stringPrefixes,o=null,r=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:BS.of(a.to+e.length),range:rn.range(a.anchor+e.length,a.head+e.length)};let c=a.head,u=Z5(n.doc,c),d;if(u==e){if(fae(n,c))return{changes:{insert:e+e,from:c},effects:BS.of(c+e.length),range:rn.cursor(c+e.length)};if(kCe(n,c)){let g=t&&n.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:rn.cursor(c+g.length)}}}else{if(t&&n.sliceDoc(c-2*e.length,c)==e+e&&(d=gae(n,c-2*e.length,s))>-1&&fae(n,d))return{changes:{insert:e+e+e+e,from:c},effects:BS.of(c+e.length),range:rn.cursor(c+e.length)};if(n.charCategorizer(c)(u)!=Pr.Word&&gae(n,c,s)>-1&&!QVe(n,c,e,s))return{changes:{insert:e+e,from:c},effects:BS.of(c+e.length),range:rn.cursor(c+e.length)}}return{range:o=a}});return o?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function fae(n,e){let t=Jc(n).resolveInner(e+1);return t.parent&&t.from==e}function QVe(n,e,t,i){let s=Jc(n).resolveInner(e,-1),o=i.reduce((r,a)=>Math.max(r,a.length),0);for(let r=0;r<5;r++){let a=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+o)),c=a.indexOf(t);if(!c||c>-1&&i.indexOf(a.slice(0,c))>-1){let d=s.firstChild;for(;d&&d.from==s.from&&d.to-d.from>t.length+c;){if(n.sliceDoc(d.to-t.length,d.to)==t)return!1;d=d.firstChild}return!0}let u=s.to==e&&s.parent;if(!u)break;s=u}return!1}function gae(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Pr.Word)return e;for(let s of t){let o=e-s.length;if(n.sliceDoc(o,e)==s&&i(n.sliceDoc(o-1,o))!=Pr.Word)return o}return-1}function ZVe(n={}){return[HVe,fd,Pa.of(n),FVe,eUe,VVe]}const ACe=[{key:"Ctrl-Space",run:hae},{mac:"Alt-`",run:hae},{key:"Escape",run:DVe},{key:"ArrowDown",run:gH(!0)},{key:"ArrowUp",run:gH(!1)},{key:"PageDown",run:gH(!0,"page")},{key:"PageUp",run:gH(!1,"page")},{key:"Enter",run:NVe}],eUe=Mw.highest(W5.computeN([Pa],n=>n.facet(Pa).defaultKeymap?[ACe]:[]));class pae{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class ES{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=e,o=i.facet(z$).markerFilter;o&&(s=o(s,i));let r=e.slice().sort((f,g)=>f.from-g.from||f.to-g.to),a=new sb,c=[],u=0;for(let f=0;;){let g=f==r.length?null:r[f];if(!g&&!c.length)break;let p,_;for(c.length?(p=u,_=c.reduce((C,y)=>Math.min(C,y.to),g&&g.from>p?g.from:1e8)):(p=g.from,_=g.to,c.push(g),f++);f<r.length;){let C=r[f];if(C.from==p&&(C.to>C.from||C.to==p))c.push(C),f++,_=Math.min(C.to,_);else{_=Math.min(C.from,_);break}}let v=fUe(c);if(c.some(C=>C.from==C.to||C.from==C.to-1&&i.doc.lineAt(C.from).to==C.from))a.add(p,p,yi.widget({widget:new cUe(v),diagnostics:c.slice()}));else{let C=c.reduce((y,w)=>w.markClass?y+" "+w.markClass:y,"");a.add(p,_,yi.mark({class:"cm-lintRange cm-lintRange-"+v+C,diagnostics:c.slice(),inclusiveEnd:c.some(y=>y.to>_)}))}u=_;for(let C=0;C<c.length;C++)c[C].to<=u&&c.splice(C--,1)}let d=a.finish();return new ES(d,t,WO(d))}}function WO(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,o,{spec:r})=>{if(!(e&&r.diagnostics.indexOf(e)<0))if(!i)i=new pae(s,o,e||r.diagnostics[0]);else{if(r.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new pae(i.from,o,i.diagnostic)}}),i}function tUe(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(z$).hideOn(n,t,i);if(s!=null)return s;let o=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(r=>r.is(NCe))||n.changes.touchesRange(o.from,Math.max(o.to,i)))}function nUe(n,e){return n.field(dh,!1)?e:e.concat(ls.appendConfig.of(gUe))}const NCe=ls.define(),vee=ls.define(),DCe=ls.define(),dh=hc.define({create(){return new ES(yi.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let o=e.changes.mapPos(n.selected.from,1);i=WO(t,n.selected.diagnostic,o)||WO(t,null,o)}!t.size&&s&&e.state.facet(z$).autoPanel&&(s=null),n=new ES(t,s,i)}for(let t of e.effects)if(t.is(NCe)){let i=e.state.facet(z$).autoPanel?t.value.length?K$.open:null:n.panel;n=ES.init(t.value,i,e.state)}else t.is(vee)?n=new ES(n.diagnostics,t.value?K$.open:null,n.selected):t.is(DCe)&&(n=new ES(n.diagnostics,n.panel,t.value));return n},provide:n=>[B$.from(n,e=>e.panel),ni.decorations.from(n,e=>e.diagnostics)]}),iUe=yi.mark({class:"cm-lintRange cm-lintRange-active"});function sUe(n,e,t){let{diagnostics:i}=n.state.field(dh),s,o=-1,r=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(c,u,{spec:d})=>{if(e>=c&&e<=u&&(c==u||(e>c||t>0)&&(e<u||t<0)))return s=d.diagnostics,o=c,r=u,!1});let a=n.state.facet(z$).tooltipFilter;return s&&a&&(s=a(s,n.state)),s?{pos:o,end:r,above:n.state.doc.lineAt(o).to<r,create(){return{dom:oUe(n,s)}}}:null}function oUe(n,e){return fr("ul",{class:"cm-tooltip-lint"},e.map(t=>xCe(n,t,!1)))}const rUe=n=>{let e=n.state.field(dh,!1);(!e||!e.panel)&&n.dispatch({effects:nUe(n.state,[vee.of(!0)])});let t=F$(n,K$.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},mae=n=>{let e=n.state.field(dh,!1);return!e||!e.panel?!1:(n.dispatch({effects:vee.of(!1)}),!0)},lUe=n=>{let e=n.state.field(dh,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},aUe=[{key:"Mod-Shift-m",run:rUe,preventDefault:!0},{key:"F8",run:lUe}],z$=oi.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},o_(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function $Ce(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let s=t[i];if(/[a-zA-Z]/.test(s)&&!e.some(o=>o.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function xCe(n,e,t){var i;let s=t?$Ce(e.actions):[];return fr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},fr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((o,r)=>{let a=!1,c=g=>{if(g.preventDefault(),a)return;a=!0;let p=WO(n.state.field(dh).diagnostics,e);p&&o.apply(n,p.from,p.to)},{name:u}=o,d=s[r]?u.indexOf(s[r]):-1,f=d<0?u:[u.slice(0,d),fr("u",u.slice(d,d+1)),u.slice(d+1)];return fr("button",{type:"button",class:"cm-diagnosticAction",onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[r]})"`}.`},f)}),e.source&&fr("div",{class:"cm-diagnosticSource"},e.source))}class cUe extends Eb{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return fr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class _ae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=xCe(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class K${constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)mae(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],r=$Ce(o.actions);for(let a=0;a<r.length;a++)if(r[a].toUpperCase().charCodeAt(0)==s.keyCode){let c=WO(this.view.state.field(dh).diagnostics,o);c&&o.actions[a].apply(e,c.from,c.to)}}else return;s.preventDefault()},i=s=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(s.target)&&this.moveSelection(o)};this.list=fr("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=fr("div",{class:"cm-panel-lint"},this.list,fr("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>mae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(dh).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(dh),i=0,s=!1,o=null,r=new Set;for(e.between(0,this.view.state.doc.length,(a,c,{spec:u})=>{for(let d of u.diagnostics){if(r.has(d))continue;r.add(d);let f=-1,g;for(let p=i;p<this.items.length;p++)if(this.items[p].diagnostic==d){f=p;break}f<0?(g=new _ae(this.view,d),this.items.splice(i,0,g),s=!0):(g=this.items[f],f>i&&(this.items.splice(i,f-i),s=!0)),t&&g.diagnostic==t.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),o=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new _ae(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:c})=>{let u=c.height/this.list.offsetHeight;a.top<c.top?this.list.scrollTop-=(c.top-a.top)/u:a.bottom>c.bottom&&(this.list.scrollTop+=(a.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(dh),i=WO(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:DCe.of(i)})}static open(e){return new K$(e)}}function uUe(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function pH(n){return uUe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const dUe=ni.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:pH("#d11")},".cm-lintRange-warning":{backgroundImage:pH("orange")},".cm-lintRange-info":{backgroundImage:pH("#999")},".cm-lintRange-hint":{backgroundImage:pH("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function hUe(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function fUe(n){let e="hint",t=1;for(let i of n){let s=hUe(i.severity);s>t&&(t=s,e=i.severity)}return e}const gUe=[dh,ni.decorations.compute([dh],n=>{let{selected:e,panel:t}=n.field(dh);return!e||!t||e.from==e.to?yi.none:yi.set([iUe.range(e.from,e.to)])}),o2e(sUe,{hideOn:tUe}),dUe],pUe=[m2e(),b2e(),DFe(),BBe(),dBe(),EFe(),OFe(),Rr.allowMultipleSelections.of(!0),J2e(),fBe(mBe,{fallback:!0}),EBe(),UVe(),ZVe(),XFe(),JFe(),HFe(),KHe(),W5.of([...KVe,...BHe,...dVe,...XBe,...lBe,...ACe,...aUe])];/*!
- * VueCodemirror v6.1.1
- * Copyright (c) Surmon. All rights reserved.
- * Released under the MIT License.
- * Surmon
- */var mUe=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[pUe]}),_Ue=Symbol("vue-codemirror-global-config"),Eu,vUe=function(n){var e=n.onUpdate,t=n.onChange,i=n.onFocus,s=n.onBlur,o=function(r,a){var c={};for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&a.indexOf(u)<0&&(c[u]=r[u]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var d=0;for(u=Object.getOwnPropertySymbols(r);d<u.length;d++)a.indexOf(u[d])<0&&Object.prototype.propertyIsEnumerable.call(r,u[d])&&(c[u[d]]=r[u[d]])}return c}(n,["onUpdate","onChange","onFocus","onBlur"]);return Rr.create({doc:o.doc,selection:o.selection,extensions:(Array.isArray(o.extensions)?o.extensions:[o.extensions]).concat([ni.updateListener.of(function(r){e(r),r.docChanged&&t(r.state.doc.toString(),r),r.focusChanged&&(r.view.hasFocus?i(r):s(r))})])})},C1=function(n){var e=new zP;return{compartment:e,run:function(t){e.get(n.state)?n.dispatch({effects:e.reconfigure(t)}):n.dispatch({effects:ls.appendConfig.of(e.of(t))})}}},vae=function(n,e){var t=C1(n),i=t.compartment,s=t.run;return function(o){var r=i.get(n.state);s(o??r!==e?e:[])}},mH={type:Boolean,default:void 0},bUe={autofocus:mH,disabled:mH,indentWithTab:mH,tabSize:Number,placeholder:String,style:Object,autoDestroy:mH,phrases:Object,root:Object,extensions:Array,selection:Object},TUe={modelValue:{type:String,default:""}},CUe=Object.assign(Object.assign({},bUe),TUe);(function(n){n.Change="change",n.Update="update",n.Focus="focus",n.Blur="blur",n.Ready="ready",n.ModelUpdate="update:modelValue"})(Eu||(Eu={}));var SS={};SS[Eu.Change]=function(n,e){return!0},SS[Eu.Update]=function(n){return!0},SS[Eu.Focus]=function(n){return!0},SS[Eu.Blur]=function(n){return!0},SS[Eu.Ready]=function(n){return!0};var PCe={};PCe[Eu.ModelUpdate]=SS[Eu.Change];var yUe=Object.assign(Object.assign({},SS),PCe);Object.assign({},CUe),Object.assign({},yUe);var EUe=!1;/*!
- * pinia v2.3.0
- * (c) 2024 Eduardo San Martin Morote
- * @license MIT
- */let FCe;const e8=n=>FCe=n,BCe=Symbol();function Gj(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var DD;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(DD||(DD={}));function SUe(){const n=I5(!0),e=n.run(()=>te({}));let t=[],i=[];const s=Nm({install(o){e8(s),s._a=o,o.provide(BCe,s),o.config.globalProperties.$pinia=s,i.forEach(r=>t.push(r)),i=[]},use(o){return!this._a&&!EUe?i.push(o):t.push(o),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const HCe=()=>{};function bae(n,e,t,i=HCe){n.push(e);const s=()=>{const o=n.indexOf(e);o>-1&&(n.splice(o,1),i())};return!t&&TZ()&&CZ(s),s}function zL(n,...e){n.slice().forEach(t=>{t(...e)})}const wUe=n=>n(),Tae=Symbol(),Pz=Symbol();function zj(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Gj(s)&&Gj(i)&&n.hasOwnProperty(t)&&!Ss(i)&&!LC(i)?n[t]=zj(s,i):n[t]=i}return n}const IUe=Symbol();function LUe(n){return!Gj(n)||!n.hasOwnProperty(IUe)}const{assign:UT}=Object;function OUe(n){return!!(Ss(n)&&n.effect)}function RUe(n,e,t,i){const{state:s,actions:o,getters:r}=e,a=t.state.value[n];let c;function u(){a||(t.state.value[n]=s?s():{});const d=Gl(t.state.value[n]);return UT(d,o,Object.keys(r||{}).reduce((f,g)=>(f[g]=Nm(W(()=>{e8(t);const p=t._s.get(n);return r[g].call(p,p)})),f),{}))}return c=VCe(n,u,e,t,i,!0),c}function VCe(n,e,t={},i,s,o){let r;const a=UT({actions:{}},t),c={deep:!0};let u,d,f=[],g=[],p;const _=i.state.value[n];!o&&!_&&(i.state.value[n]={}),te({});let v;function C(D){let P;u=d=!1,typeof D=="function"?(D(i.state.value[n]),P={type:DD.patchFunction,storeId:n,events:p}):(zj(i.state.value[n],D),P={type:DD.patchObject,payload:D,storeId:n,events:p});const F=v=Symbol();cn().then(()=>{v===F&&(u=!0)}),d=!0,zL(f,P,i.state.value[n])}const y=o?function(){const{state:P}=t,F=P?P():{};this.$patch(V=>{UT(V,F)})}:HCe;function w(){r.stop(),f=[],g=[],i._s.delete(n)}const I=(D,P="")=>{if(Tae in D)return D[Pz]=P,D;const F=function(){e8(i);const V=Array.from(arguments),U=[],Q=[];function de(re){U.push(re)}function q(re){Q.push(re)}zL(g,{args:V,name:F[Pz],store:O,after:de,onError:q});let K;try{K=D.apply(this&&this.$id===n?this:O,V)}catch(re){throw zL(Q,re),re}return K instanceof Promise?K.then(re=>(zL(U,re),re)).catch(re=>(zL(Q,re),Promise.reject(re))):(zL(U,K),K)};return F[Tae]=!0,F[Pz]=P,F},L={_p:i,$id:n,$onAction:bae.bind(null,g),$patch:C,$reset:y,$subscribe(D,P={}){const F=bae(f,D,P.detached,()=>V()),V=r.run(()=>ht(()=>i.state.value[n],U=>{(P.flush==="sync"?d:u)&&D({storeId:n,type:DD.direct,events:p},U)},UT({},c,P)));return F},$dispose:w},O=Ki(L);i._s.set(n,O);const N=(i._a&&i._a.runWithContext||wUe)(()=>i._e.run(()=>(r=I5()).run(()=>e({action:I}))));for(const D in N){const P=N[D];if(Ss(P)&&!OUe(P)||LC(P))o||(_&&LUe(P)&&(Ss(P)?P.value=_[D]:zj(P,_[D])),i.state.value[n][D]=P);else if(typeof P=="function"){const F=I(P,D);N[D]=F,a.actions[D]=P}}return UT(O,N),UT(Cs(O),N),Object.defineProperty(O,"$state",{get:()=>i.state.value[n],set:D=>{C(P=>{UT(P,D)})}}),i._p.forEach(D=>{UT(O,r.run(()=>D({store:O,app:i._a,pinia:i,options:a})))}),_&&o&&t.hydrate&&t.hydrate(O.$state,_),u=!0,d=!0,O}/*! #__NO_SIDE_EFFECTS__ */function Sb(n,e,t){let i,s;const o=typeof e=="function";typeof n=="string"?(i=n,s=o?t:e):(s=n,i=n.id);function r(a,c){const u=MDe();return a=a||(u?Kt(BCe,null):null),a&&e8(a),a=FCe,a._s.has(i)||(o?VCe(i,e,s,a):RUe(i,s,a)),a._s.get(i)}return r.$id=i,r}const MUe=Sb("Xml",()=>{const n=te(""),e=W(()=>n);function t(){}return{xmlStr:n,doubleCount:e,increment:t}}),kUe=Sb("code",()=>{const n=te(""),e=W(()=>n);function t(){}return{pythonCode:n,doubleCount:e,increment:t}}),AUe=Sb("fileName",()=>{const n=te(""),e=W(()=>n);function t(){}return{fileName:n,doubleCount:e,increment:t}}),NUe=Sb("workspace",()=>{const n=te(""),e=W(()=>n);function t(){}return{workspace:n,doubleCount:e,increment:t}}),DUe=Sb("status",()=>{const n=te(!1),e=W(()=>n);function t(){}return{status:n,doubleCount:e,increment:t}}),Yc={useyXmlStore:MUe,useyPythonCodeStore:kUe,useImportFileNameStore:AUe,useWorkspaceStore:NUe,useLoadBlocklyStatus:DUe},Oh=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},$Ue=Sb("device",()=>{const n=te({id:"",status:!1,type:"",device:{}}),e=i=>{n.value=i},t=W(()=>n.value);return{devices:n,setDevice:e,getDevice:t}}),xUe=Sb("uploader",()=>{const n=te({id:"",status:!1,version:""}),e=i=>{n.value=i},t=W(()=>n.value);return{uploaders:n,setUploader:e,getUploader:t}}),PUe=Sb("print",()=>({data:te([])})),gU={useDeveics:$Ue,useUploaders:xUe,usePrintData:PUe},FUe="/assets/uploader_connect-sVrKA9OK.png",BUe="/assets/uploader_disconnect-DxZCseJL.png",HUe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABYCAYAAABxlTA0AAADK0lEQVR4nO2dS2sVMRiGX1tBvGtdiC4Et6K1KG7cFMGFS8G1CKIuRbRLBQWxFfFS/B+CC1dVOCLqRhBEFBdabztRRC1VtCqBDAzTM8lkki8nM/M+kNVkki/PySRpTjoHhBBCCCGtZCWAdwC+GdKRlBu+NIEYTAwB2GLJs3qwIZoZSjk4AP8AfLHk+RkpllqkLrjxULAwFCwMBQtDwcJQsDAULAwFC0PBwlCwMBQsDAULQ8HCULAwFCwMBQtDwcJQsDAULAwFC0PBwlCwMBQsDAULQ8HCULAwFCwMBQsTW/Du6C1czBiAdbEqiyl4AsATAFMR6yyyDcBTAI8GGIMIp/RR1CxdqFjJKgCfC/cW07GKZW0HMJ+7935CfrwoynWRHErwmD4hX7z3wQC9BOGkRc45SyUhBO8E8N1wfyN78jCA0xYxWTprKMdX8A59At4WQw/ARgEPYhyoKDdLkyWB+AhWPfePQwy3miRYLYNuBpBcV/CuwoRmS7MARiN4Cc4VR8kXCwHUEbwHwJxDna8BjDRRbsY1R8n51cWaCoKP5/KrnvurS3IzrteUrP6P76sl7wmdVz3iC45yNwxWS1hcJZ/RtX+w5FNr3OWOE5oac9e2RWyeq46S1UT53HD9L4BpS55+ctenoyQ8rhNfyPSmLWOuDdeJL0Rq3Zhr40bkntspuRkxJL+Nuf+bIlOCcl+2fUKryiUBua/0Cz2IJqTkF5TbnxCSZwAsS7FxqeAjeabr8qpyuYbce81oWjpMOsjtdV1WXaoMF5Triakn3009+CWW6+cN137rv8TmAsfUjwk9LucPyqjv0A5FqFtxUG+LlqEOs9yuU7Dt8dwUtBlmtgI4DOAogP0R64WeQE0eSp8knzf/zetN7ljM6jQI3lvqLL3O05XCULAwFCwMBQvjI1jNnp8a0Up/ai9FfVYR6oDf3gqvn20Dm+u2wUew2hJ82EqdAeEYLAwFC0PBYSjd06HgMJS+qJ+Cw/C4rJRhS/HqAxhPsEEp8UwfAl/oF5NNcE8faB7l1+CLUCc77wDYZ9pVtG24Z6yo8IMhXeMHgI9dl0AIIYQQ0kQA/AemkXIYwdr1wAAAAABJRU5ErkJggg==",VUe="/assets/firmware-BqDdm6y3.png",UUe="/assets/device-detect-DaNVZ8Tx.svg";var sD={exports:{}};/*!
- * Platform.js v1.3.6
- * Copyright 2014-2020 Benjamin Tan
- * Copyright 2011-2013 John-David Dalton
- * Available under MIT license
- */var WUe=sD.exports,Cae;function GUe(){return Cae||(Cae=1,function(n,e){(function(){var t={function:!0,object:!0},i=t[typeof window]&&window||this,s=e,o=!n.nodeType&&n,r=s&&o&&typeof dC=="object"&&dC;r&&(r.global===r||r.window===r||r.self===r)&&(i=r);var a=Math.pow(2,53)-1,c=/\bOpera/,u=Object.prototype,d=u.hasOwnProperty,f=u.toString;function g(D){return D=String(D),D.charAt(0).toUpperCase()+D.slice(1)}function p(D,P,F){var V={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return P&&F&&/^Win/i.test(D)&&!/^Windows Phone /i.test(D)&&(V=V[/[\d.]+$/.exec(D)])&&(D="Windows "+V),D=String(D),P&&F&&(D=D.replace(RegExp(P,"i"),F)),D=v(D.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),D}function _(D,P){var F=-1,V=D?D.length:0;if(typeof V=="number"&&V>-1&&V<=a)for(;++F<V;)P(D[F],F,D);else C(D,P)}function v(D){return D=O(D),/^(?:webOS|i(?:OS|P))/.test(D)?D:g(D)}function C(D,P){for(var F in D)d.call(D,F)&&P(D[F],F,D)}function y(D){return D==null?g(D):f.call(D).slice(8,-1)}function w(D,P){var F=D!=null?typeof D[P]:"number";return!/^(?:boolean|number|string|undefined)$/.test(F)&&(F=="object"?!!D[P]:!0)}function I(D){return String(D).replace(/([ -])(?!$)/g,"$1?")}function L(D,P){var F=null;return _(D,function(V,U){F=P(F,V,U,D)}),F}function O(D){return String(D).replace(/^ +| +$/g,"")}function A(D){var P=i,F=D&&typeof D=="object"&&y(D)!="String";F&&(P=D,D=null);var V=P.navigator||{},U=V.userAgent||"";D||(D=U);var Q=F?!!V.likeChrome:/\bChrome\b/.test(D)&&!/internal|\n/i.test(f.toString()),de="Object",q=F?de:"ScriptBridgingProxyObject",K=F?de:"Environment",re=F&&P.java?"JavaPackage":y(P.java),Z=F?de:"RuntimeObject",J=/\bJava/.test(re)&&P.java,ge=J&&y(P.environment)==K,ve=J?"a":"α",Le=J?"b":"β",Ee=P.document||{},Ne=P.operamini||P.opera,qe=c.test(qe=F&&Ne?Ne["[[Class]]"]:y(Ne))?qe:Ne=null,Re,we=D,Ve=[],Ge=null,dt=D==U,ze=dt&&Ne&&typeof Ne.version=="function"&&Ne.version(),ee,ye=Se([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),Me=Xe(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),et=Tt([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),at=Ie({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),Ue=it(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Se(Ct){return L(Ct,function(Gt,Ot){return Gt||RegExp("\\b"+(Ot.pattern||I(Ot))+"\\b","i").exec(D)&&(Ot.label||Ot)})}function Ie(Ct){return L(Ct,function(Gt,Ot,En){return Gt||(Ot[et]||Ot[/^[a-z]+(?: +[a-z]+\b)*/i.exec(et)]||RegExp("\\b"+I(En)+"(?:\\b|\\w*\\d)","i").exec(D))&&En})}function Xe(Ct){return L(Ct,function(Gt,Ot){return Gt||RegExp("\\b"+(Ot.pattern||I(Ot))+"\\b","i").exec(D)&&(Ot.label||Ot)})}function it(Ct){return L(Ct,function(Gt,Ot){var En=Ot.pattern||I(Ot);return!Gt&&(Gt=RegExp("\\b"+En+"(?:/[\\d.]+|[ \\w.]*)","i").exec(D))&&(Gt=p(Gt,En,Ot.label||Ot)),Gt})}function Tt(Ct){return L(Ct,function(Gt,Ot){var En=Ot.pattern||I(Ot);return!Gt&&(Gt=RegExp("\\b"+En+" *\\d+[.\\w_]*","i").exec(D)||RegExp("\\b"+En+" *\\w+-[\\w]*","i").exec(D)||RegExp("\\b"+En+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(D))&&((Gt=String(Ot.label&&!RegExp(En,"i").test(Ot.label)?Ot.label:Gt).split("/"))[1]&&!/[\d.]+/.test(Gt[0])&&(Gt[0]+=" "+Gt[1]),Ot=Ot.label||Ot,Gt=v(Gt[0].replace(RegExp(En,"i"),Ot).replace(RegExp("; *(?:"+Ot+"[_-])?","i")," ").replace(RegExp("("+Ot+")[-_.]?(\\w)","i"),"$1 $2"))),Gt})}function He(Ct){return L(Ct,function(Gt,Ot){return Gt||(RegExp(Ot+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(D)||0)[1]||null})}function ke(){return this.description||""}if(ye&&(ye=[ye]),/\bAndroid\b/.test(Ue)&&!et&&(Re=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(D))&&(et=O(Re[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),at&&!et?et=Tt([at]):at&&et&&(et=et.replace(RegExp("^("+I(at)+")[-_.\\s]","i"),at+" ").replace(RegExp("^("+I(at)+")[-_.]?(\\w)","i"),at+" $2")),(Re=/\bGoogle TV\b/.exec(et))&&(et=Re[0]),/\bSimulator\b/i.test(D)&&(et=(et?et+" ":"")+"Simulator"),Me=="Opera Mini"&&/\bOPiOS\b/.test(D)&&Ve.push("running in Turbo/Uncompressed mode"),Me=="IE"&&/\blike iPhone OS\b/.test(D)?(Re=A(D.replace(/like iPhone OS/,"")),at=Re.manufacturer,et=Re.product):/^iP/.test(et)?(Me||(Me="Safari"),Ue="iOS"+((Re=/ OS ([\d_]+)/i.exec(D))?" "+Re[1].replace(/_/g,"."):"")):Me=="Konqueror"&&/^Linux\b/i.test(Ue)?Ue="Kubuntu":at&&at!="Google"&&(/Chrome/.test(Me)&&!/\bMobile Safari\b/i.test(D)||/\bVita\b/.test(et))||/\bAndroid\b/.test(Ue)&&/^Chrome/.test(Me)&&/\bVersion\//i.test(D)?(Me="Android Browser",Ue=/\bAndroid\b/.test(Ue)?Ue:"Android"):Me=="Silk"?(/\bMobi/i.test(D)||(Ue="Android",Ve.unshift("desktop mode")),/Accelerated *= *true/i.test(D)&&Ve.unshift("accelerated")):Me=="UC Browser"&&/\bUCWEB\b/.test(D)?Ve.push("speed mode"):Me=="PaleMoon"&&(Re=/\bFirefox\/([\d.]+)\b/.exec(D))?Ve.push("identifying as Firefox "+Re[1]):Me=="Firefox"&&(Re=/\b(Mobile|Tablet|TV)\b/i.exec(D))?(Ue||(Ue="Firefox OS"),et||(et=Re[1])):!Me||(Re=!/\bMinefield\b/i.test(D)&&/\b(?:Firefox|Safari)\b/.exec(Me))?(Me&&!et&&/[\/,]|^[^(]+?\)/.test(D.slice(D.indexOf(Re+"/")+8))&&(Me=null),(Re=et||at||Ue)&&(et||at||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(Ue))&&(Me=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(Ue)?Ue:Re)+" Browser")):Me=="Electron"&&(Re=(/\bChrome\/([\d.]+)\b/.exec(D)||0)[1])&&Ve.push("Chromium "+Re),ze||(ze=He(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",I(Me),"(?:Firefox|Minefield|NetFront)"])),(Re=ye=="iCab"&&parseFloat(ze)>3&&"WebKit"||/\bOpera\b/.test(Me)&&(/\bOPR\b/.test(D)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(D)&&!/^(?:Trident|EdgeHTML)$/.test(ye)&&"WebKit"||!ye&&/\bMSIE\b/i.test(D)&&(Ue=="Mac OS"?"Tasman":"Trident")||ye=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Me)&&"NetFront")&&(ye=[Re]),Me=="IE"&&(Re=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(D)||0)[1])?(Me+=" Mobile",Ue="Windows Phone "+(/\+$/.test(Re)?Re:Re+".x"),Ve.unshift("desktop mode")):/\bWPDesktop\b/i.test(D)?(Me="IE Mobile",Ue="Windows Phone 8.x",Ve.unshift("desktop mode"),ze||(ze=(/\brv:([\d.]+)/.exec(D)||0)[1])):Me!="IE"&&ye=="Trident"&&(Re=/\brv:([\d.]+)/.exec(D))&&(Me&&Ve.push("identifying as "+Me+(ze?" "+ze:"")),Me="IE",ze=Re[1]),dt){if(w(P,"global"))if(J&&(Re=J.lang.System,we=Re.getProperty("os.arch"),Ue=Ue||Re.getProperty("os.name")+" "+Re.getProperty("os.version")),ge){try{ze=P.require("ringo/engine").version.join("."),Me="RingoJS"}catch{(Re=P.system)&&Re.global.system==P.system&&(Me="Narwhal",Ue||(Ue=Re[0].os||null))}Me||(Me="Rhino")}else typeof P.process=="object"&&!P.process.browser&&(Re=P.process)&&(typeof Re.versions=="object"&&(typeof Re.versions.electron=="string"?(Ve.push("Node "+Re.versions.node),Me="Electron",ze=Re.versions.electron):typeof Re.versions.nw=="string"&&(Ve.push("Chromium "+ze,"Node "+Re.versions.node),Me="NW.js",ze=Re.versions.nw)),Me||(Me="Node.js",we=Re.arch,Ue=Re.platform,ze=/[\d.]+/.exec(Re.version),ze=ze?ze[0]:null));else y(Re=P.runtime)==q?(Me="Adobe AIR",Ue=Re.flash.system.Capabilities.os):y(Re=P.phantom)==Z?(Me="PhantomJS",ze=(Re=Re.version||null)&&Re.major+"."+Re.minor+"."+Re.patch):typeof Ee.documentMode=="number"&&(Re=/\bTrident\/(\d+)/i.exec(D))?(ze=[ze,Ee.documentMode],(Re=+Re[1]+4)!=ze[1]&&(Ve.push("IE "+ze[1]+" mode"),ye&&(ye[1]=""),ze[1]=Re),ze=Me=="IE"?String(ze[1].toFixed(1)):ze[0]):typeof Ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Me)&&(Ve.push("masking as "+Me+" "+ze),Me="IE",ze="11.0",ye=["Trident"],Ue="Windows");Ue=Ue&&v(Ue)}if(ze&&(Re=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(ze)||/(?:alpha|beta)(?: ?\d)?/i.exec(D+";"+(dt&&V.appMinorVersion))||/\bMinefield\b/i.test(D)&&"a")&&(Ge=/b/i.test(Re)?"beta":"alpha",ze=ze.replace(RegExp(Re+"\\+?$"),"")+(Ge=="beta"?Le:ve)+(/\d+\+?/.exec(Re)||"")),Me=="Fennec"||Me=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(Ue))Me="Firefox Mobile";else if(Me=="Maxthon"&&ze)ze=ze.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(et))et=="Xbox 360"&&(Ue=null),et=="Xbox 360"&&/\bIEMobile\b/.test(D)&&Ve.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(Me)||Me&&!et&&!/Browser|Mobi/.test(Me))&&(Ue=="Windows CE"||/Mobi/i.test(D)))Me+=" Mobile";else if(Me=="IE"&&dt)try{P.external===null&&Ve.unshift("platform preview")}catch{Ve.unshift("embedded")}else(/\bBlackBerry\b/.test(et)||/\bBB10\b/.test(D))&&(Re=(RegExp(et.replace(/ +/g," *")+"/([.\\d]+)","i").exec(D)||0)[1]||ze)?(Re=[Re,/BB10/.test(D)],Ue=(Re[1]?(et=null,at="BlackBerry"):"Device Software")+" "+Re[0],ze=null):this!=C&&et!="Wii"&&(dt&&Ne||/Opera/.test(Me)&&/\b(?:MSIE|Firefox)\b/i.test(D)||Me=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(Ue)||Me=="IE"&&(Ue&&!/^Win/.test(Ue)&&ze>5.5||/\bWindows XP\b/.test(Ue)&&ze>8||ze==8&&!/\bTrident\b/.test(D)))&&!c.test(Re=A.call(C,D.replace(c,"")+";"))&&Re.name&&(Re="ing as "+Re.name+((Re=Re.version)?" "+Re:""),c.test(Me)?(/\bIE\b/.test(Re)&&Ue=="Mac OS"&&(Ue=null),Re="identify"+Re):(Re="mask"+Re,qe?Me=v(qe.replace(/([a-z])([A-Z])/g,"$1 $2")):Me="Opera",/\bIE\b/.test(Re)&&(Ue=null),dt||(ze=null)),ye=["Presto"],Ve.push(Re));(Re=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(D)||0)[1])&&(Re=[parseFloat(Re.replace(/\.(\d)$/,".0$1")),Re],Me=="Safari"&&Re[1].slice(-1)=="+"?(Me="WebKit Nightly",Ge="alpha",ze=Re[1].slice(0,-1)):(ze==Re[1]||ze==(Re[2]=(/\bSafari\/([\d.]+\+?)/i.exec(D)||0)[1]))&&(ze=null),Re[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(D)||0)[1],Re[0]==537.36&&Re[2]==537.36&&parseFloat(Re[1])>=28&&ye=="WebKit"&&(ye=["Blink"]),!dt||!Q&&!Re[1]?(ye&&(ye[1]="like Safari"),Re=(Re=Re[0],Re<400?1:Re<500?2:Re<526?3:Re<533?4:Re<534?"4+":Re<535?5:Re<537?6:Re<538?7:Re<601?8:Re<602?9:Re<604?10:Re<606?11:Re<608?12:"12")):(ye&&(ye[1]="like Chrome"),Re=Re[1]||(Re=Re[0],Re<530?1:Re<532?2:Re<532.05?3:Re<533?4:Re<534.03?5:Re<534.07?6:Re<534.1?7:Re<534.13?8:Re<534.16?9:Re<534.24?10:Re<534.3?11:Re<535.01?12:Re<535.02?"13+":Re<535.07?15:Re<535.11?16:Re<535.19?17:Re<536.05?18:Re<536.1?19:Re<537.01?20:Re<537.11?"21+":Re<537.13?23:Re<537.18?24:Re<537.24?25:Re<537.36?26:ye!="Blink"?"27":"28")),ye&&(ye[1]+=" "+(Re+=typeof Re=="number"?".x":/[.+]/.test(Re)?"":"+")),Me=="Safari"&&(!ze||parseInt(ze)>45)?ze=Re:Me=="Chrome"&&/\bHeadlessChrome/i.test(D)&&Ve.unshift("headless")),Me=="Opera"&&(Re=/\bzbov|zvav$/.exec(Ue))?(Me+=" ",Ve.unshift("desktop mode"),Re=="zvav"?(Me+="Mini",ze=null):Me+="Mobile",Ue=Ue.replace(RegExp(" *"+Re+"$"),"")):Me=="Safari"&&/\bChrome\b/.exec(ye&&ye[1])?(Ve.unshift("desktop mode"),Me="Chrome Mobile",ze=null,/\bOS X\b/.test(Ue)?(at="Apple",Ue="iOS 4.3+"):Ue=null):/\bSRWare Iron\b/.test(Me)&&!ze&&(ze=He("Chrome")),ze&&ze.indexOf(Re=/[\d.]+$/.exec(Ue))==0&&D.indexOf("/"+Re+"-")>-1&&(Ue=O(Ue.replace(Re,""))),Ue&&Ue.indexOf(Me)!=-1&&!RegExp(Me+" OS").test(Ue)&&(Ue=Ue.replace(RegExp(" *"+I(Me)+" *"),"")),ye&&!/\b(?:Avant|Nook)\b/.test(Me)&&(/Browser|Lunascape|Maxthon/.test(Me)||Me!="Safari"&&/^iOS/.test(Ue)&&/\bSafari\b/.test(ye[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(Me)&&ye[1])&&(Re=ye[ye.length-1])&&Ve.push(Re),Ve.length&&(Ve=["("+Ve.join("; ")+")"]),at&&et&&et.indexOf(at)<0&&Ve.push("on "+at),et&&Ve.push((/^on /.test(Ve[Ve.length-1])?"":"on ")+et),Ue&&(Re=/ ([\d.+]+)$/.exec(Ue),ee=Re&&Ue.charAt(Ue.length-Re[0].length-1)=="/",Ue={architecture:32,family:Re&&!ee?Ue.replace(Re[0],""):Ue,version:Re?Re[1]:null,toString:function(){var Ct=this.version;return this.family+(Ct&&!ee?" "+Ct:"")+(this.architecture==64?" 64-bit":"")}}),(Re=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(we))&&!/\bi686\b/i.test(we)?(Ue&&(Ue.architecture=64,Ue.family=Ue.family.replace(RegExp(" *"+Re),"")),Me&&(/\bWOW64\b/i.test(D)||dt&&/\w(?:86|32)$/.test(V.cpuClass||V.platform)&&!/\bWin64; x64\b/i.test(D))&&Ve.unshift("32-bit")):Ue&&/^OS X/.test(Ue.family)&&Me=="Chrome"&&parseFloat(ze)>=39&&(Ue.architecture=64),D||(D=null);var ot={};return ot.description=D,ot.layout=ye&&ye[0],ot.manufacturer=at,ot.name=Me,ot.prerelease=Ge,ot.product=et,ot.ua=D,ot.version=Me&&ze,ot.os=Ue||{architecture:null,family:null,version:null,toString:function(){return"null"}},ot.parse=A,ot.toString=ke,ot.version&&Ve.unshift(ze),ot.name&&Ve.unshift(Me),Ue&&Me&&!(Ue==String(Ue).split(" ")[0]&&(Ue==Me.split(" ")[0]||et))&&Ve.push(et?"("+Ue+")":"on "+Ue),Ve.length&&(ot.description=Ve.join(" ")),ot}var N=A();s&&o?C(N,function(D,P){s[P]=D}):i.platform=N}).call(WUe)}(sD,sD.exports)),sD.exports}var zUe=GUe();const lf=cp(zUe),Kj={host:"https://api.cocorobo.cn/",uploader:"1.1.0"};/*!
- * shared v11.0.0-rc.1
- * (c) 2024 kazuya kawaguchi
- * Released under the MIT License.
- */const cW=typeof window<"u",ky=(n,e=!1)=>e?Symbol.for(n):Symbol(n),KUe=(n,e,t)=>jUe({l:n,k:e,s:t}),jUe=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Pl=n=>typeof n=="number"&&isFinite(n),XUe=n=>bee(n)==="[object Date]",GO=n=>bee(n)==="[object RegExp]",t8=n=>$s(n)&&Object.keys(n).length===0,ma=Object.assign,YUe=Object.create,jo=(n=null)=>YUe(n);let yae;const HS=()=>yae||(yae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:jo());function Eae(n){return n.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const qUe=Object.prototype.hasOwnProperty;function Dg(n,e){return qUe.call(n,e)}const Fl=Array.isArray,Ir=n=>typeof n=="function",ri=n=>typeof n=="string",uo=n=>typeof n=="boolean",_o=n=>n!==null&&typeof n=="object",JUe=n=>_o(n)&&Ir(n.then)&&Ir(n.catch),UCe=Object.prototype.toString,bee=n=>UCe.call(n),$s=n=>bee(n)==="[object Object]",QUe=n=>n==null?"":Fl(n)||$s(n)&&n.toString===UCe?JSON.stringify(n,null,2):String(n);function Tee(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function ZUe(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const _H=n=>!_o(n)||Fl(n);function pU(n,e){if(_H(n)||_H(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(o=>{o!=="__proto__"&&(_o(i[o])&&!_o(s[o])&&(s[o]=Array.isArray(i[o])?[]:jo()),_H(s[o])||_H(i[o])?s[o]=i[o]:t.push({src:i[o],des:s[o]}))})}}/*!
- * message-compiler v11.0.0-rc.1
- * (c) 2024 kazuya kawaguchi
- * Released under the MIT License.
- */function e4e(n,e,t){return{line:n,column:e,offset:t}}function jj(n,e,t){return{start:n,end:e}}const Do={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},t4e=17;function n8(n,e,t={}){const{domain:i,messages:s,args:o}=t,r=n,a=new SyntaxError(String(r));return a.code=n,e&&(a.location=e),a.domain=i,a}function n4e(n){throw n}const rv=" ",i4e="\r",mu=`
- `,s4e="\u2028",o4e="\u2029";function r4e(n){const e=n;let t=0,i=1,s=1,o=0;const r=N=>e[N]===i4e&&e[N+1]===mu,a=N=>e[N]===mu,c=N=>e[N]===o4e,u=N=>e[N]===s4e,d=N=>r(N)||a(N)||c(N)||u(N),f=()=>t,g=()=>i,p=()=>s,_=()=>o,v=N=>r(N)||c(N)||u(N)?mu:e[N],C=()=>v(t),y=()=>v(t+o);function w(){return o=0,d(t)&&(i++,s=0),r(t)&&t++,t++,s++,e[t]}function I(){return r(t+o)&&o++,o++,e[t+o]}function L(){t=0,i=1,s=1,o=0}function O(N=0){o=N}function A(){const N=t+o;for(;N!==t;)w();o=0}return{index:f,line:g,column:p,peekOffset:_,charAt:v,currentChar:C,currentPeek:y,next:w,peek:I,reset:L,resetPeek:O,skipToPeek:A}}const AT=void 0,l4e=".",Sae="'",a4e="tokenizer";function c4e(n,e={}){const t=e.location!==!1,i=r4e(n),s=()=>i.index(),o=()=>e4e(i.line(),i.column(),i.index()),r=o(),a=s(),c={currentType:13,offset:a,startLoc:r,endLoc:r,lastType:13,lastOffset:a,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},u=()=>c,{onError:d}=e;function f(Se,Ie,Xe,...it){const Tt=u();if(Ie.column+=Xe,Ie.offset+=Xe,d){const He=t?jj(Tt.startLoc,Ie):null,ke=n8(Se,He,{domain:a4e,args:it});d(ke)}}function g(Se,Ie,Xe){Se.endLoc=o(),Se.currentType=Ie;const it={type:Ie};return t&&(it.loc=jj(Se.startLoc,Se.endLoc)),Xe!=null&&(it.value=Xe),it}const p=Se=>g(Se,13);function _(Se,Ie){return Se.currentChar()===Ie?(Se.next(),Ie):(f(Do.EXPECTED_TOKEN,o(),0,Ie),"")}function v(Se){let Ie="";for(;Se.currentPeek()===rv||Se.currentPeek()===mu;)Ie+=Se.currentPeek(),Se.peek();return Ie}function C(Se){const Ie=v(Se);return Se.skipToPeek(),Ie}function y(Se){if(Se===AT)return!1;const Ie=Se.charCodeAt(0);return Ie>=97&&Ie<=122||Ie>=65&&Ie<=90||Ie===95}function w(Se){if(Se===AT)return!1;const Ie=Se.charCodeAt(0);return Ie>=48&&Ie<=57}function I(Se,Ie){const{currentType:Xe}=Ie;if(Xe!==2)return!1;v(Se);const it=y(Se.currentPeek());return Se.resetPeek(),it}function L(Se,Ie){const{currentType:Xe}=Ie;if(Xe!==2)return!1;v(Se);const it=Se.currentPeek()==="-"?Se.peek():Se.currentPeek(),Tt=w(it);return Se.resetPeek(),Tt}function O(Se,Ie){const{currentType:Xe}=Ie;if(Xe!==2)return!1;v(Se);const it=Se.currentPeek()===Sae;return Se.resetPeek(),it}function A(Se,Ie){const{currentType:Xe}=Ie;if(Xe!==7)return!1;v(Se);const it=Se.currentPeek()===".";return Se.resetPeek(),it}function N(Se,Ie){const{currentType:Xe}=Ie;if(Xe!==8)return!1;v(Se);const it=y(Se.currentPeek());return Se.resetPeek(),it}function D(Se,Ie){const{currentType:Xe}=Ie;if(!(Xe===7||Xe===11))return!1;v(Se);const it=Se.currentPeek()===":";return Se.resetPeek(),it}function P(Se,Ie){const{currentType:Xe}=Ie;if(Xe!==9)return!1;const it=()=>{const He=Se.currentPeek();return He==="{"?y(Se.peek()):He==="@"||He==="|"||He===":"||He==="."||He===rv||!He?!1:He===mu?(Se.peek(),it()):V(Se,!1)},Tt=it();return Se.resetPeek(),Tt}function F(Se){v(Se);const Ie=Se.currentPeek()==="|";return Se.resetPeek(),Ie}function V(Se,Ie=!0){const Xe=(Tt=!1,He="")=>{const ke=Se.currentPeek();return ke==="{"||ke==="@"||!ke?Tt:ke==="|"?!(He===rv||He===mu):ke===rv?(Se.peek(),Xe(!0,rv)):ke===mu?(Se.peek(),Xe(!0,mu)):!0},it=Xe();return Ie&&Se.resetPeek(),it}function U(Se,Ie){const Xe=Se.currentChar();return Xe===AT?AT:Ie(Xe)?(Se.next(),Xe):null}function Q(Se){const Ie=Se.charCodeAt(0);return Ie>=97&&Ie<=122||Ie>=65&&Ie<=90||Ie>=48&&Ie<=57||Ie===95||Ie===36}function de(Se){return U(Se,Q)}function q(Se){const Ie=Se.charCodeAt(0);return Ie>=97&&Ie<=122||Ie>=65&&Ie<=90||Ie>=48&&Ie<=57||Ie===95||Ie===36||Ie===45}function K(Se){return U(Se,q)}function re(Se){const Ie=Se.charCodeAt(0);return Ie>=48&&Ie<=57}function Z(Se){return U(Se,re)}function J(Se){const Ie=Se.charCodeAt(0);return Ie>=48&&Ie<=57||Ie>=65&&Ie<=70||Ie>=97&&Ie<=102}function ge(Se){return U(Se,J)}function ve(Se){let Ie="",Xe="";for(;Ie=Z(Se);)Xe+=Ie;return Xe}function Le(Se){let Ie="";for(;;){const Xe=Se.currentChar();if(Xe==="{"||Xe==="}"||Xe==="@"||Xe==="|"||!Xe)break;if(Xe===rv||Xe===mu)if(V(Se))Ie+=Xe,Se.next();else{if(F(Se))break;Ie+=Xe,Se.next()}else Ie+=Xe,Se.next()}return Ie}function Ee(Se){C(Se);let Ie="",Xe="";for(;Ie=K(Se);)Xe+=Ie;return Se.currentChar()===AT&&f(Do.UNTERMINATED_CLOSING_BRACE,o(),0),Xe}function Ne(Se){C(Se);let Ie="";return Se.currentChar()==="-"?(Se.next(),Ie+=`-${ve(Se)}`):Ie+=ve(Se),Se.currentChar()===AT&&f(Do.UNTERMINATED_CLOSING_BRACE,o(),0),Ie}function qe(Se){return Se!==Sae&&Se!==mu}function Re(Se){C(Se),_(Se,"'");let Ie="",Xe="";for(;Ie=U(Se,qe);)Ie==="\\"?Xe+=we(Se):Xe+=Ie;const it=Se.currentChar();return it===mu||it===AT?(f(Do.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),it===mu&&(Se.next(),_(Se,"'")),Xe):(_(Se,"'"),Xe)}function we(Se){const Ie=Se.currentChar();switch(Ie){case"\\":case"'":return Se.next(),`\\${Ie}`;case"u":return Ve(Se,Ie,4);case"U":return Ve(Se,Ie,6);default:return f(Do.UNKNOWN_ESCAPE_SEQUENCE,o(),0,Ie),""}}function Ve(Se,Ie,Xe){_(Se,Ie);let it="";for(let Tt=0;Tt<Xe;Tt++){const He=ge(Se);if(!He){f(Do.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${Ie}${it}${Se.currentChar()}`);break}it+=He}return`\\${Ie}${it}`}function Ge(Se){return Se!=="{"&&Se!=="}"&&Se!==rv&&Se!==mu}function dt(Se){C(Se);let Ie="",Xe="";for(;Ie=U(Se,Ge);)Xe+=Ie;return Xe}function ze(Se){let Ie="",Xe="";for(;Ie=de(Se);)Xe+=Ie;return Xe}function ee(Se){const Ie=Xe=>{const it=Se.currentChar();return it==="{"||it==="@"||it==="|"||it==="("||it===")"||!it||it===rv?Xe:(Xe+=it,Se.next(),Ie(Xe))};return Ie("")}function ye(Se){C(Se);const Ie=_(Se,"|");return C(Se),Ie}function Me(Se,Ie){let Xe=null;switch(Se.currentChar()){case"{":return Ie.braceNest>=1&&f(Do.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),Se.next(),Xe=g(Ie,2,"{"),C(Se),Ie.braceNest++,Xe;case"}":return Ie.braceNest>0&&Ie.currentType===2&&f(Do.EMPTY_PLACEHOLDER,o(),0),Se.next(),Xe=g(Ie,3,"}"),Ie.braceNest--,Ie.braceNest>0&&C(Se),Ie.inLinked&&Ie.braceNest===0&&(Ie.inLinked=!1),Xe;case"@":return Ie.braceNest>0&&f(Do.UNTERMINATED_CLOSING_BRACE,o(),0),Xe=et(Se,Ie)||p(Ie),Ie.braceNest=0,Xe;default:{let Tt=!0,He=!0,ke=!0;if(F(Se))return Ie.braceNest>0&&f(Do.UNTERMINATED_CLOSING_BRACE,o(),0),Xe=g(Ie,1,ye(Se)),Ie.braceNest=0,Ie.inLinked=!1,Xe;if(Ie.braceNest>0&&(Ie.currentType===4||Ie.currentType===5||Ie.currentType===6))return f(Do.UNTERMINATED_CLOSING_BRACE,o(),0),Ie.braceNest=0,at(Se,Ie);if(Tt=I(Se,Ie))return Xe=g(Ie,4,Ee(Se)),C(Se),Xe;if(He=L(Se,Ie))return Xe=g(Ie,5,Ne(Se)),C(Se),Xe;if(ke=O(Se,Ie))return Xe=g(Ie,6,Re(Se)),C(Se),Xe;if(!Tt&&!He&&!ke)return Xe=g(Ie,12,dt(Se)),f(Do.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,Xe.value),C(Se),Xe;break}}return Xe}function et(Se,Ie){const{currentType:Xe}=Ie;let it=null;const Tt=Se.currentChar();switch((Xe===7||Xe===8||Xe===11||Xe===9)&&(Tt===mu||Tt===rv)&&f(Do.INVALID_LINKED_FORMAT,o(),0),Tt){case"@":return Se.next(),it=g(Ie,7,"@"),Ie.inLinked=!0,it;case".":return C(Se),Se.next(),g(Ie,8,".");case":":return C(Se),Se.next(),g(Ie,9,":");default:return F(Se)?(it=g(Ie,1,ye(Se)),Ie.braceNest=0,Ie.inLinked=!1,it):A(Se,Ie)||D(Se,Ie)?(C(Se),et(Se,Ie)):N(Se,Ie)?(C(Se),g(Ie,11,ze(Se))):P(Se,Ie)?(C(Se),Tt==="{"?Me(Se,Ie)||it:g(Ie,10,ee(Se))):(Xe===7&&f(Do.INVALID_LINKED_FORMAT,o(),0),Ie.braceNest=0,Ie.inLinked=!1,at(Se,Ie))}}function at(Se,Ie){let Xe={type:13};if(Ie.braceNest>0)return Me(Se,Ie)||p(Ie);if(Ie.inLinked)return et(Se,Ie)||p(Ie);switch(Se.currentChar()){case"{":return Me(Se,Ie)||p(Ie);case"}":return f(Do.UNBALANCED_CLOSING_BRACE,o(),0),Se.next(),g(Ie,3,"}");case"@":return et(Se,Ie)||p(Ie);default:{if(F(Se))return Xe=g(Ie,1,ye(Se)),Ie.braceNest=0,Ie.inLinked=!1,Xe;if(V(Se))return g(Ie,0,Le(Se));break}}return Xe}function Ue(){const{currentType:Se,offset:Ie,startLoc:Xe,endLoc:it}=c;return c.lastType=Se,c.lastOffset=Ie,c.lastStartLoc=Xe,c.lastEndLoc=it,c.offset=s(),c.startLoc=o(),i.currentChar()===AT?g(c,13):at(i,c)}return{nextToken:Ue,currentOffset:s,currentPosition:o,context:u}}const u4e="parser",d4e=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function h4e(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function f4e(n={}){const e=n.location!==!1,{onError:t}=n;function i(y,w,I,L,...O){const A=y.currentPosition();if(A.offset+=L,A.column+=L,t){const N=e?jj(I,A):null,D=n8(w,N,{domain:u4e,args:O});t(D)}}function s(y,w,I){const L={type:y};return e&&(L.start=w,L.end=w,L.loc={start:I,end:I}),L}function o(y,w,I,L){e&&(y.end=w,y.loc&&(y.loc.end=I))}function r(y,w){const I=y.context(),L=s(3,I.offset,I.startLoc);return L.value=w,o(L,y.currentOffset(),y.currentPosition()),L}function a(y,w){const I=y.context(),{lastOffset:L,lastStartLoc:O}=I,A=s(5,L,O);return A.index=parseInt(w,10),y.nextToken(),o(A,y.currentOffset(),y.currentPosition()),A}function c(y,w){const I=y.context(),{lastOffset:L,lastStartLoc:O}=I,A=s(4,L,O);return A.key=w,y.nextToken(),o(A,y.currentOffset(),y.currentPosition()),A}function u(y,w){const I=y.context(),{lastOffset:L,lastStartLoc:O}=I,A=s(9,L,O);return A.value=w.replace(d4e,h4e),y.nextToken(),o(A,y.currentOffset(),y.currentPosition()),A}function d(y){const w=y.nextToken(),I=y.context(),{lastOffset:L,lastStartLoc:O}=I,A=s(8,L,O);return w.type!==11?(i(y,Do.UNEXPECTED_EMPTY_LINKED_MODIFIER,I.lastStartLoc,0),A.value="",o(A,L,O),{nextConsumeToken:w,node:A}):(w.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,I.lastStartLoc,0,Yp(w)),A.value=w.value||"",o(A,y.currentOffset(),y.currentPosition()),{node:A})}function f(y,w){const I=y.context(),L=s(7,I.offset,I.startLoc);return L.value=w,o(L,y.currentOffset(),y.currentPosition()),L}function g(y){const w=y.context(),I=s(6,w.offset,w.startLoc);let L=y.nextToken();if(L.type===8){const O=d(y);I.modifier=O.node,L=O.nextConsumeToken||y.nextToken()}switch(L.type!==9&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(L)),L=y.nextToken(),L.type===2&&(L=y.nextToken()),L.type){case 10:L.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(L)),I.key=f(y,L.value||"");break;case 4:L.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(L)),I.key=c(y,L.value||"");break;case 5:L.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(L)),I.key=a(y,L.value||"");break;case 6:L.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(L)),I.key=u(y,L.value||"");break;default:{i(y,Do.UNEXPECTED_EMPTY_LINKED_KEY,w.lastStartLoc,0);const O=y.context(),A=s(7,O.offset,O.startLoc);return A.value="",o(A,O.offset,O.startLoc),I.key=A,o(I,O.offset,O.startLoc),{nextConsumeToken:L,node:I}}}return o(I,y.currentOffset(),y.currentPosition()),{node:I}}function p(y){const w=y.context(),I=w.currentType===1?y.currentOffset():w.offset,L=w.currentType===1?w.endLoc:w.startLoc,O=s(2,I,L);O.items=[];let A=null;do{const P=A||y.nextToken();switch(A=null,P.type){case 0:P.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(P)),O.items.push(r(y,P.value||""));break;case 5:P.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(P)),O.items.push(a(y,P.value||""));break;case 4:P.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(P)),O.items.push(c(y,P.value||""));break;case 6:P.value==null&&i(y,Do.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Yp(P)),O.items.push(u(y,P.value||""));break;case 7:{const F=g(y);O.items.push(F.node),A=F.nextConsumeToken||null;break}}}while(w.currentType!==13&&w.currentType!==1);const N=w.currentType===1?w.lastOffset:y.currentOffset(),D=w.currentType===1?w.lastEndLoc:y.currentPosition();return o(O,N,D),O}function _(y,w,I,L){const O=y.context();let A=L.items.length===0;const N=s(1,w,I);N.cases=[],N.cases.push(L);do{const D=p(y);A||(A=D.items.length===0),N.cases.push(D)}while(O.currentType!==13);return A&&i(y,Do.MUST_HAVE_MESSAGES_IN_PLURAL,I,0),o(N,y.currentOffset(),y.currentPosition()),N}function v(y){const w=y.context(),{offset:I,startLoc:L}=w,O=p(y);return w.currentType===13?O:_(y,I,L,O)}function C(y){const w=c4e(y,ma({},n)),I=w.context(),L=s(0,I.offset,I.startLoc);return e&&L.loc&&(L.loc.source=y),L.body=v(w),n.onCacheKey&&(L.cacheKey=n.onCacheKey(y)),I.currentType!==13&&i(w,Do.UNEXPECTED_LEXICAL_ANALYSIS,I.lastStartLoc,0,y[I.offset]||""),o(L,w.currentOffset(),w.currentPosition()),L}return{parse:C}}function Yp(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function g4e(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:o=>(t.helpers.add(o),o)}}function wae(n,e){for(let t=0;t<n.length;t++)Cee(n[t],e)}function Cee(n,e){switch(n.type){case 1:wae(n.cases,e),e.helper("plural");break;case 2:wae(n.items,e);break;case 6:{Cee(n.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function p4e(n,e={}){const t=g4e(n);t.helper("normalize"),n.body&&Cee(n.body,t);const i=t.context();n.helpers=Array.from(i.helpers)}function m4e(n){const e=n.body;return e.type===2?Iae(e):e.cases.forEach(t=>Iae(t)),n}function Iae(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;t<n.items.length;t++){const i=n.items[t];if(!(i.type===3||i.type===9)||i.value==null)break;e.push(i.value)}if(e.length===n.items.length){n.static=Tee(e);for(let t=0;t<n.items.length;t++){const i=n.items[t];(i.type===3||i.type===9)&&delete i.value}}}}function y1(n){switch(n.t=n.type,n.type){case 0:{const e=n;y1(e.body),e.b=e.body,delete e.body;break}case 1:{const e=n,t=e.cases;for(let i=0;i<t.length;i++)y1(t[i]);e.c=t,delete e.cases;break}case 2:{const e=n,t=e.items;for(let i=0;i<t.length;i++)y1(t[i]);e.i=t,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=n;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=n;y1(e.key),e.k=e.key,delete e.key,e.modifier&&(y1(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=n;e.i=e.index,delete e.index;break}case 4:{const e=n;e.k=e.key,delete e.key;break}}delete n.type}function _4e(n,e){const{sourceMap:t,filename:i,breakLineCode:s,needIndent:o}=e,r=e.location!==!1,a={filename:i,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};r&&n.loc&&(a.source=n.loc.source);const c=()=>a;function u(C,y){a.code+=C}function d(C,y=!0){const w=y?s:"";u(o?w+" ".repeat(C):w)}function f(C=!0){const y=++a.indentLevel;C&&d(y)}function g(C=!0){const y=--a.indentLevel;C&&d(y)}function p(){d(a.indentLevel)}return{context:c,push:u,indent:f,deindent:g,newline:p,helper:C=>`_${C}`,needIndent:()=>a.needIndent}}function v4e(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),zO(n,e.key),e.modifier?(n.push(", "),zO(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function b4e(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let o=0;o<s&&(zO(n,e.items[o]),o!==s-1);o++)n.push(", ");n.deindent(i()),n.push("])")}function T4e(n,e){const{helper:t,needIndent:i}=n;if(e.cases.length>1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let o=0;o<s&&(zO(n,e.cases[o]),o!==s-1);o++)n.push(", ");n.deindent(i()),n.push("])")}}function C4e(n,e){e.body?zO(n,e.body):n.push("null")}function zO(n,e){const{helper:t}=n;switch(e.type){case 0:C4e(n,e);break;case 1:T4e(n,e);break;case 2:b4e(n,e);break;case 6:v4e(n,e);break;case 8:n.push(JSON.stringify(e.value),e);break;case 7:n.push(JSON.stringify(e.value),e);break;case 5:n.push(`${t("interpolate")}(${t("list")}(${e.index}))`,e);break;case 4:n.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:n.push(JSON.stringify(e.value),e);break;case 3:n.push(JSON.stringify(e.value),e);break}}const y4e=(n,e={})=>{const t=ri(e.mode)?e.mode:"normal",i=ri(e.filename)?e.filename:"message.intl",s=!!e.sourceMap,o=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":`
- `,r=e.needIndent?e.needIndent:t!=="arrow",a=n.helpers||[],c=_4e(n,{mode:t,filename:i,sourceMap:s,breakLineCode:o,needIndent:r});c.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(r),a.length>0&&(c.push(`const { ${Tee(a.map(f=>`${f}: _${f}`),", ")} } = ctx`),c.newline()),c.push("return "),zO(c,n),c.deindent(r),c.push("}"),delete n.helpers;const{code:u,map:d}=c.context();return{ast:n,code:u,map:d?d.toJSON():void 0}};function E4e(n,e={}){const t=ma({},e),i=!!t.jit,s=!!t.minify,o=t.optimize==null?!0:t.optimize,a=f4e(t).parse(n);return i?(o&&m4e(a),s&&y1(a),{ast:a,code:""}):(p4e(a,t),y4e(a,t))}/*!
- * core-base v11.0.0-rc.1
- * (c) 2024 kazuya kawaguchi
- * Released under the MIT License.
- */function S4e(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(HS().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(HS().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Fz(n){return t=>w4e(t,n)}function w4e(n,e){const t=L4e(e);if(t==null)throw j$(0);if(yee(t)===1){const o=R4e(t);return n.plural(o.reduce((r,a)=>[...r,Lae(n,a)],[]))}else return Lae(n,t)}const I4e=["b","body"];function L4e(n){return Ay(n,I4e)}const O4e=["c","cases"];function R4e(n){return Ay(n,O4e,[])}function Lae(n,e){const t=k4e(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=N4e(e).reduce((s,o)=>[...s,Xj(n,o)],[]);return n.normalize(i)}}const M4e=["s","static"];function k4e(n){return Ay(n,M4e)}const A4e=["i","items"];function N4e(n){return Ay(n,A4e,[])}function Xj(n,e){const t=yee(e);switch(t){case 3:return vH(e,t);case 9:return vH(e,t);case 4:{const i=e;if(Dg(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Dg(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw j$(t)}case 5:{const i=e;if(Dg(i,"i")&&Pl(i.i))return n.interpolate(n.list(i.i));if(Dg(i,"index")&&Pl(i.index))return n.interpolate(n.list(i.index));throw j$(t)}case 6:{const i=e,s=P4e(i),o=B4e(i);return n.linked(Xj(n,o),s?Xj(n,s):void 0,n.type)}case 7:return vH(e,t);case 8:return vH(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const D4e=["t","type"];function yee(n){return Ay(n,D4e)}const $4e=["v","value"];function vH(n,e){const t=Ay(n,$4e);if(t)return t;throw j$(e)}const x4e=["m","modifier"];function P4e(n){return Ay(n,x4e)}const F4e=["k","key"];function B4e(n){const e=Ay(n,F4e);if(e)return e;throw j$(6)}function Ay(n,e,t){for(let i=0;i<e.length;i++){const s=e[i];if(Dg(n,s)&&n[s]!=null)return n[s]}return t}function j$(n){return new Error(`unhandled node type: ${n}`)}const H4e=n=>n;let bH=jo();function KO(n){return _o(n)&&yee(n)===0&&(Dg(n,"b")||Dg(n,"body"))}function V4e(n,e={}){let t=!1;const i=e.onError||n4e;return e.onError=s=>{t=!0,i(s)},{...E4e(n,e),detectError:t}}function U4e(n,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&ri(n)){uo(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||H4e)(n),s=bH[i];if(s)return s;const{ast:o,detectError:r}=V4e(n,{...e,location:!1,jit:!0}),a=Fz(o);return r?a:bH[i]=a}else{const t=n.cacheKey;if(t){const i=bH[t];return i||(bH[t]=Fz(n))}else return Fz(n)}}let X$=null;function W4e(n){X$=n}function G4e(n,e,t){X$&&X$.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const z4e=K4e("function:translate");function K4e(n){return e=>X$&&X$.emit(n,e)}const Vv={INVALID_ARGUMENT:t4e,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},j4e=24;function Uv(n){return n8(n,null,void 0)}function Eee(n,e){return e.locale!=null?Oae(e.locale):Oae(n.locale)}let Bz;function Oae(n){if(ri(n))return n;if(Ir(n)){if(n.resolvedOnce&&Bz!=null)return Bz;if(n.constructor.name==="Function"){const e=n();if(JUe(e))throw Uv(Vv.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Bz=e}else throw Uv(Vv.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Uv(Vv.NOT_SUPPORT_LOCALE_TYPE)}function X4e(n,e,t){return[...new Set([t,...Fl(e)?e:_o(e)?Object.keys(e):ri(e)?[e]:[t]])]}function WCe(n,e,t){const i=ri(t)?t:Y$,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let o=s.__localeChainCache.get(i);if(!o){o=[];let r=[t];for(;Fl(r);)r=Rae(o,r,e);const a=Fl(e)||!$s(e)?e:e.default?e.default:null;r=ri(a)?[a]:a,Fl(r)&&Rae(o,r,!1),s.__localeChainCache.set(i,o)}return o}function Rae(n,e,t){let i=!0;for(let s=0;s<e.length&&uo(i);s++){const o=e[s];ri(o)&&(i=Y4e(n,e[s],t))}return i}function Y4e(n,e,t){let i;const s=e.split("-");do{const o=s.join("-");i=q4e(n,o,t),s.splice(-1,1)}while(s.length&&i===!0);return i}function q4e(n,e,t){let i=!1;if(!n.includes(e)&&(i=!0,e)){i=e[e.length-1]!=="!";const s=e.replace(/!/g,"");n.push(s),(Fl(t)||$s(t))&&t[s]&&(i=t[s])}return i}const Ny=[];Ny[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ny[1]={w:[1],".":[2],"[":[4],o:[7]};Ny[2]={w:[2],i:[3,0],0:[3,0]};Ny[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ny[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ny[5]={"'":[4,0],o:8,l:[5,0]};Ny[6]={'"':[4,0],o:8,l:[6,0]};const J4e=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Q4e(n){return J4e.test(n)}function Z4e(n){const e=n.charCodeAt(0),t=n.charCodeAt(n.length-1);return e===t&&(e===34||e===39)?n.slice(1,-1):n}function eWe(n){if(n==null)return"o";switch(n.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return n;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function tWe(n){const e=n.trim();return n.charAt(0)==="0"&&isNaN(parseInt(n))?!1:Q4e(e)?Z4e(e):"*"+e}function nWe(n){const e=[];let t=-1,i=0,s=0,o,r,a,c,u,d,f;const g=[];g[0]=()=>{r===void 0?r=a:r+=a},g[1]=()=>{r!==void 0&&(e.push(r),r=void 0)},g[2]=()=>{g[0](),s++},g[3]=()=>{if(s>0)s--,i=4,g[0]();else{if(s=0,r===void 0||(r=tWe(r),r===!1))return!1;g[1]()}};function p(){const _=n[t+1];if(i===5&&_==="'"||i===6&&_==='"')return t++,a="\\"+_,g[0](),!0}for(;i!==null;)if(t++,o=n[t],!(o==="\\"&&p())){if(c=eWe(o),f=Ny[i],u=f[c]||f.l||8,u===8||(i=u[0],u[1]!==void 0&&(d=g[u[1]],d&&(a=o,d()===!1))))return;if(i===7)return e}}const Mae=new Map;function iWe(n,e){return _o(n)?n[e]:null}function sWe(n,e){if(!_o(n))return null;let t=Mae.get(e);if(t||(t=nWe(e),t&&Mae.set(e,t)),!t)return null;const i=t.length;let s=n,o=0;for(;o<i;){const r=s[t[o]];if(r===void 0||Ir(s))return null;s=r,o++}return s}const oWe="11.0.0-rc.1",i8=-1,Y$="en-US",kae="",Aae=n=>`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function rWe(){return{upper:(n,e)=>e==="text"&&ri(n)?n.toUpperCase():e==="vnode"&&_o(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&ri(n)?n.toLowerCase():e==="vnode"&&_o(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&ri(n)?Aae(n):e==="vnode"&&_o(n)&&"__v_isVNode"in n?Aae(n.children):n}}let GCe;function lWe(n){GCe=n}let zCe;function aWe(n){zCe=n}let KCe;function cWe(n){KCe=n}let jCe=null;const uWe=n=>{jCe=n},dWe=()=>jCe;let XCe=null;const Nae=n=>{XCe=n},hWe=()=>XCe;let Dae=0;function fWe(n={}){const e=Ir(n.onWarn)?n.onWarn:ZUe,t=ri(n.version)?n.version:oWe,i=ri(n.locale)||Ir(n.locale)?n.locale:Y$,s=Ir(i)?Y$:i,o=Fl(n.fallbackLocale)||$s(n.fallbackLocale)||ri(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,r=$s(n.messages)?n.messages:Hz(s),a=$s(n.datetimeFormats)?n.datetimeFormats:Hz(s),c=$s(n.numberFormats)?n.numberFormats:Hz(s),u=ma(jo(),n.modifiers,rWe()),d=n.pluralRules||jo(),f=Ir(n.missing)?n.missing:null,g=uo(n.missingWarn)||GO(n.missingWarn)?n.missingWarn:!0,p=uo(n.fallbackWarn)||GO(n.fallbackWarn)?n.fallbackWarn:!0,_=!!n.fallbackFormat,v=!!n.unresolving,C=Ir(n.postTranslation)?n.postTranslation:null,y=$s(n.processor)?n.processor:null,w=uo(n.warnHtmlMessage)?n.warnHtmlMessage:!0,I=!!n.escapeParameter,L=Ir(n.messageCompiler)?n.messageCompiler:GCe,O=Ir(n.messageResolver)?n.messageResolver:zCe||iWe,A=Ir(n.localeFallbacker)?n.localeFallbacker:KCe||X4e,N=_o(n.fallbackContext)?n.fallbackContext:void 0,D=n,P=_o(D.__datetimeFormatters)?D.__datetimeFormatters:new Map,F=_o(D.__numberFormatters)?D.__numberFormatters:new Map,V=_o(D.__meta)?D.__meta:{};Dae++;const U={version:t,cid:Dae,locale:i,fallbackLocale:o,messages:r,modifiers:u,pluralRules:d,missing:f,missingWarn:g,fallbackWarn:p,fallbackFormat:_,unresolving:v,postTranslation:C,processor:y,warnHtmlMessage:w,escapeParameter:I,messageCompiler:L,messageResolver:O,localeFallbacker:A,fallbackContext:N,onWarn:e,__meta:V};return U.datetimeFormats=a,U.numberFormats=c,U.__datetimeFormatters=P,U.__numberFormatters=F,__INTLIFY_PROD_DEVTOOLS__&&G4e(U,t,V),U}const Hz=n=>({[n]:jo()});function See(n,e,t,i,s){const{missing:o,onWarn:r}=n;if(o!==null){const a=o(n,t,e,s);return ri(a)?a:e}else return e}function EN(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function gWe(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function pWe(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i<e.length;i++)if(gWe(n,e[i]))return!0;return!1}function $ae(n,...e){const{datetimeFormats:t,unresolving:i,fallbackLocale:s,onWarn:o,localeFallbacker:r}=n,{__datetimeFormatters:a}=n,[c,u,d,f]=Yj(...e),g=uo(d.missingWarn)?d.missingWarn:n.missingWarn;uo(d.fallbackWarn)?d.fallbackWarn:n.fallbackWarn;const p=!!d.part,_=Eee(n,d),v=r(n,s,_);if(!ri(c)||c==="")return new Intl.DateTimeFormat(_,f).format(u);let C={},y,w=null;const I="datetime format";for(let A=0;A<v.length&&(y=v[A],C=t[y]||{},w=C[c],!$s(w));A++)See(n,c,y,g,I);if(!$s(w)||!ri(y))return i?i8:c;let L=`${y}__${c}`;t8(f)||(L=`${L}__${JSON.stringify(f)}`);let O=a.get(L);return O||(O=new Intl.DateTimeFormat(y,ma({},w,f)),a.set(L,O)),p?O.formatToParts(u):O.format(u)}const YCe=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Yj(...n){const[e,t,i,s]=n,o=jo();let r=jo(),a;if(ri(e)){const c=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw Uv(Vv.INVALID_ISO_DATE_ARGUMENT);const u=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();a=new Date(u);try{a.toISOString()}catch{throw Uv(Vv.INVALID_ISO_DATE_ARGUMENT)}}else if(XUe(e)){if(isNaN(e.getTime()))throw Uv(Vv.INVALID_DATE_ARGUMENT);a=e}else if(Pl(e))a=e;else throw Uv(Vv.INVALID_ARGUMENT);return ri(t)?o.key=t:$s(t)&&Object.keys(t).forEach(c=>{YCe.includes(c)?r[c]=t[c]:o[c]=t[c]}),ri(i)?o.locale=i:$s(i)&&(r=i),$s(s)&&(r=s),[o.key||"",a,o,r]}function xae(n,e,t){const i=n;for(const s in t){const o=`${e}__${s}`;i.__datetimeFormatters.has(o)&&i.__datetimeFormatters.delete(o)}}function Pae(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:o,localeFallbacker:r}=n,{__numberFormatters:a}=n,[c,u,d,f]=qj(...e),g=uo(d.missingWarn)?d.missingWarn:n.missingWarn;uo(d.fallbackWarn)?d.fallbackWarn:n.fallbackWarn;const p=!!d.part,_=Eee(n,d),v=r(n,s,_);if(!ri(c)||c==="")return new Intl.NumberFormat(_,f).format(u);let C={},y,w=null;const I="number format";for(let A=0;A<v.length&&(y=v[A],C=t[y]||{},w=C[c],!$s(w));A++)See(n,c,y,g,I);if(!$s(w)||!ri(y))return i?i8:c;let L=`${y}__${c}`;t8(f)||(L=`${L}__${JSON.stringify(f)}`);let O=a.get(L);return O||(O=new Intl.NumberFormat(y,ma({},w,f)),a.set(L,O)),p?O.formatToParts(u):O.format(u)}const qCe=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function qj(...n){const[e,t,i,s]=n,o=jo();let r=jo();if(!Pl(e))throw Uv(Vv.INVALID_ARGUMENT);const a=e;return ri(t)?o.key=t:$s(t)&&Object.keys(t).forEach(c=>{qCe.includes(c)?r[c]=t[c]:o[c]=t[c]}),ri(i)?o.locale=i:$s(i)&&(r=i),$s(s)&&(r=s),[o.key||"",a,o,r]}function Fae(n,e,t){const i=n;for(const s in t){const o=`${e}__${s}`;i.__numberFormatters.has(o)&&i.__numberFormatters.delete(o)}}const mWe=n=>n,_We=n=>"",vWe="text",bWe=n=>n.length===0?"":Tee(n),TWe=QUe;function Bae(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function CWe(n){const e=Pl(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Pl(n.named.count)||Pl(n.named.n))?Pl(n.named.count)?n.named.count:Pl(n.named.n)?n.named.n:e:e}function yWe(n,e){e.count||(e.count=n),e.n||(e.n=n)}function EWe(n={}){const e=n.locale,t=CWe(n),i=_o(n.pluralRules)&&ri(e)&&Ir(n.pluralRules[e])?n.pluralRules[e]:Bae,s=_o(n.pluralRules)&&ri(e)&&Ir(n.pluralRules[e])?Bae:void 0,o=y=>y[i(t,y.length,s)],r=n.list||[],a=y=>r[y],c=n.named||jo();Pl(n.pluralIndex)&&yWe(t,c);const u=y=>c[y];function d(y,w){const I=Ir(n.messages)?n.messages(y,!!w):_o(n.messages)?n.messages[y]:!1;return I||(n.parent?n.parent.message(y):_We)}const f=y=>n.modifiers?n.modifiers[y]:mWe,g=$s(n.processor)&&Ir(n.processor.normalize)?n.processor.normalize:bWe,p=$s(n.processor)&&Ir(n.processor.interpolate)?n.processor.interpolate:TWe,_=$s(n.processor)&&ri(n.processor.type)?n.processor.type:vWe,C={list:a,named:u,plural:o,linked:(y,...w)=>{const[I,L]=w;let O="text",A="";w.length===1?_o(I)?(A=I.modifier||A,O=I.type||O):ri(I)&&(A=I||A):w.length===2&&(ri(I)&&(A=I||A),ri(L)&&(O=L||O));const N=d(y,!0)(C),D=O==="vnode"&&Fl(N)&&A?N[0]:N;return A?f(A)(D,O):D},message:d,type:_,interpolate:p,normalize:g,values:ma(jo(),r,c)};return C}const Hae=()=>"",vf=n=>Ir(n);function Vae(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:o,fallbackLocale:r,messages:a}=n,[c,u]=Jj(...e),d=uo(u.missingWarn)?u.missingWarn:n.missingWarn,f=uo(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn,g=uo(u.escapeParameter)?u.escapeParameter:n.escapeParameter,p=!!u.resolvedMessage,_=ri(u.default)||uo(u.default)?uo(u.default)?o?c:()=>c:u.default:t?o?c:()=>c:null,v=t||_!=null&&(ri(_)||Ir(_)),C=Eee(n,u);g&&SWe(u);let[y,w,I]=p?[c,C,a[C]||jo()]:JCe(n,c,C,r,f,d),L=y,O=c;if(!p&&!(ri(L)||KO(L)||vf(L))&&v&&(L=_,O=L),!p&&(!(ri(L)||KO(L)||vf(L))||!ri(w)))return s?i8:c;let A=!1;const N=()=>{A=!0},D=vf(L)?L:QCe(n,c,w,L,O,N);if(A)return L;const P=LWe(n,w,I,u),F=EWe(P),V=wWe(n,D,F),U=i?i(V,c):V;if(__INTLIFY_PROD_DEVTOOLS__){const Q={timestamp:Date.now(),key:ri(c)?c:vf(L)?L.key:"",locale:w||(vf(L)?L.locale:""),format:ri(L)?L:vf(L)?L.source:"",message:U};Q.meta=ma({},n.__meta,dWe()||{}),z4e(Q)}return U}function SWe(n){Fl(n.list)?n.list=n.list.map(e=>ri(e)?Eae(e):e):_o(n.named)&&Object.keys(n.named).forEach(e=>{ri(n.named[e])&&(n.named[e]=Eae(n.named[e]))})}function JCe(n,e,t,i,s,o){const{messages:r,onWarn:a,messageResolver:c,localeFallbacker:u}=n,d=u(n,i,t);let f=jo(),g,p=null;const _="translate";for(let v=0;v<d.length&&(g=d[v],f=r[g]||jo(),(p=c(f,e))===null&&(p=f[e]),!(ri(p)||KO(p)||vf(p)));v++)if(!pWe(g,d)){const C=See(n,e,g,o,_);C!==e&&(p=C)}return[p,g,f]}function QCe(n,e,t,i,s,o){const{messageCompiler:r,warnHtmlMessage:a}=n;if(vf(i)){const u=i;return u.locale=u.locale||t,u.key=u.key||e,u}if(r==null){const u=()=>i;return u.locale=t,u.key=e,u}const c=r(i,IWe(n,t,s,i,a,o));return c.locale=t,c.key=e,c.source=i,c}function wWe(n,e,t){return e(t)}function Jj(...n){const[e,t,i]=n,s=jo();if(!ri(e)&&!Pl(e)&&!vf(e)&&!KO(e))throw Uv(Vv.INVALID_ARGUMENT);const o=Pl(e)?String(e):(vf(e),e);return Pl(t)?s.plural=t:ri(t)?s.default=t:$s(t)&&!t8(t)?s.named=t:Fl(t)&&(s.list=t),Pl(i)?s.plural=i:ri(i)?s.default=i:$s(i)&&ma(s,i),[o,s]}function IWe(n,e,t,i,s,o){return{locale:e,key:t,warnHtmlMessage:s,onError:r=>{throw o&&o(r),r},onCacheKey:r=>KUe(e,t,r)}}function LWe(n,e,t,i){const{modifiers:s,pluralRules:o,messageResolver:r,fallbackLocale:a,fallbackWarn:c,missingWarn:u,fallbackContext:d}=n,g={locale:e,modifiers:s,pluralRules:o,messages:(p,_)=>{let v=r(t,p);if(v==null&&(d||_)){const[,,C]=JCe(d||n,p,e,a,c,u);v=r(C,p)}if(ri(v)||KO(v)){let C=!1;const w=QCe(n,p,e,v,p,()=>{C=!0});return C?Hae:w}else return vf(v)?v:Hae}};return n.processor&&(g.processor=n.processor),i.list&&(g.list=i.list),i.named&&(g.named=i.named),Pl(i.plural)&&(g.pluralIndex=i.plural),g}S4e();/*!
- * vue-i18n v11.0.0-rc.1
- * (c) 2024 kazuya kawaguchi
- * Released under the MIT License.
- */const OWe="11.0.0-rc.1";function RWe(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(HS().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(HS().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(HS().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(HS().__INTLIFY_PROD_DEVTOOLS__=!1)}const Rd={UNEXPECTED_RETURN_TYPE:j4e,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Sh(n,...e){return n8(n,null,void 0)}const Qj=ky("__translateVNode"),Zj=ky("__datetimeParts"),eX=ky("__numberParts"),ZCe=ky("__setPluralRules"),eye=ky("__injectWithOption"),tX=ky("__dispose");function q$(n){if(!_o(n))return n;for(const e in n)if(Dg(n,e))if(!e.includes("."))_o(n[e])&&q$(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,o=!1;for(let r=0;r<i;r++){if(t[r]in s||(s[t[r]]=jo()),!_o(s[t[r]])){o=!0;break}s=s[t[r]]}o||(s[t[i]]=n[e],delete n[e]),_o(s[t[i]])&&q$(s[t[i]])}return n}function wee(n,e){const{messages:t,__i18n:i,messageResolver:s,flatJson:o}=e,r=$s(t)?t:Fl(i)?jo():{[n]:jo()};if(Fl(i)&&i.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:c,resource:u}=a;c?(r[c]=r[c]||jo(),pU(u,r[c])):pU(u,r)}else ri(a)&&pU(JSON.parse(a),r)}),s==null&&o)for(const a in r)Dg(r,a)&&q$(r[a]);return r}function tye(n){return n.type}function nye(n,e,t){let i=_o(e.messages)?e.messages:jo();"__i18nGlobal"in t&&(i=wee(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(o=>{n.mergeLocaleMessage(o,i[o])});{if(_o(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(r=>{n.mergeDateTimeFormat(r,e.datetimeFormats[r])})}if(_o(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(r=>{n.mergeNumberFormat(r,e.numberFormats[r])})}}}function Uae(n){return ce(ww,null,n,0)}const Wae="__INTLIFY_META__",Gae=()=>[],MWe=()=>!1;let zae=0;function Kae(n){return(e,t,i,s)=>n(t,i,Qn()||void 0,s)}const kWe=()=>{const n=Qn();let e=null;return n&&(e=tye(n)[Wae])?{[Wae]:e}:null};function Iee(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,o=cW?te:us;let r=uo(n.inheritLocale)?n.inheritLocale:!0;const a=o(e&&r?e.locale.value:ri(n.locale)?n.locale:Y$),c=o(e&&r?e.fallbackLocale.value:ri(n.fallbackLocale)||Fl(n.fallbackLocale)||$s(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),u=o(wee(a.value,n)),d=o($s(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=o($s(n.numberFormats)?n.numberFormats:{[a.value]:{}});let g=e?e.missingWarn:uo(n.missingWarn)||GO(n.missingWarn)?n.missingWarn:!0,p=e?e.fallbackWarn:uo(n.fallbackWarn)||GO(n.fallbackWarn)?n.fallbackWarn:!0,_=e?e.fallbackRoot:uo(n.fallbackRoot)?n.fallbackRoot:!0,v=!!n.fallbackFormat,C=Ir(n.missing)?n.missing:null,y=Ir(n.missing)?Kae(n.missing):null,w=Ir(n.postTranslation)?n.postTranslation:null,I=e?e.warnHtmlMessage:uo(n.warnHtmlMessage)?n.warnHtmlMessage:!0,L=!!n.escapeParameter;const O=e?e.modifiers:$s(n.modifiers)?n.modifiers:{};let A=n.pluralRules||e&&e.pluralRules,N;N=(()=>{i&&Nae(null);const ke={version:OWe,locale:a.value,fallbackLocale:c.value,messages:u.value,modifiers:O,pluralRules:A,missing:y===null?void 0:y,missingWarn:g,fallbackWarn:p,fallbackFormat:v,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:I,escapeParameter:L,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};ke.datetimeFormats=d.value,ke.numberFormats=f.value,ke.__datetimeFormatters=$s(N)?N.__datetimeFormatters:void 0,ke.__numberFormatters=$s(N)?N.__numberFormatters:void 0;const ot=fWe(ke);return i&&Nae(ot),ot})(),EN(N,a.value,c.value);function P(){return[a.value,c.value,u.value,d.value,f.value]}const F=W({get:()=>a.value,set:ke=>{a.value=ke,N.locale=a.value}}),V=W({get:()=>c.value,set:ke=>{c.value=ke,N.fallbackLocale=c.value,EN(N,a.value,ke)}}),U=W(()=>u.value),Q=W(()=>d.value),de=W(()=>f.value);function q(){return Ir(w)?w:null}function K(ke){w=ke,N.postTranslation=ke}function re(){return C}function Z(ke){ke!==null&&(y=Kae(ke)),C=ke,N.missing=y}const J=(ke,ot,Ct,Gt,Ot,En)=>{P();let fe;try{__INTLIFY_PROD_DEVTOOLS__,i||(N.fallbackContext=e?hWe():void 0),fe=ke(N)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(N.fallbackContext=void 0)}if(Ct!=="translate exists"&&Pl(fe)&&fe===i8||Ct==="translate exists"&&!fe){const[se,le]=ot();return e&&_?Gt(e):Ot(se)}else{if(En(fe))return fe;throw Sh(Rd.UNEXPECTED_RETURN_TYPE)}};function ge(...ke){return J(ot=>Reflect.apply(Vae,null,[ot,...ke]),()=>Jj(...ke),"translate",ot=>Reflect.apply(ot.t,ot,[...ke]),ot=>ot,ot=>ri(ot))}function ve(...ke){const[ot,Ct,Gt]=ke;if(Gt&&!_o(Gt))throw Sh(Rd.INVALID_ARGUMENT);return ge(ot,Ct,ma({resolvedMessage:!0},Gt||{}))}function Le(...ke){return J(ot=>Reflect.apply($ae,null,[ot,...ke]),()=>Yj(...ke),"datetime format",ot=>Reflect.apply(ot.d,ot,[...ke]),()=>kae,ot=>ri(ot))}function Ee(...ke){return J(ot=>Reflect.apply(Pae,null,[ot,...ke]),()=>qj(...ke),"number format",ot=>Reflect.apply(ot.n,ot,[...ke]),()=>kae,ot=>ri(ot))}function Ne(ke){return ke.map(ot=>ri(ot)||Pl(ot)||uo(ot)?Uae(String(ot)):ot)}const Re={normalize:Ne,interpolate:ke=>ke,type:"vnode"};function we(...ke){return J(ot=>{let Ct;const Gt=ot;try{Gt.processor=Re,Ct=Reflect.apply(Vae,null,[Gt,...ke])}finally{Gt.processor=null}return Ct},()=>Jj(...ke),"translate",ot=>ot[Qj](...ke),ot=>[Uae(ot)],ot=>Fl(ot))}function Ve(...ke){return J(ot=>Reflect.apply(Pae,null,[ot,...ke]),()=>qj(...ke),"number format",ot=>ot[eX](...ke),Gae,ot=>ri(ot)||Fl(ot))}function Ge(...ke){return J(ot=>Reflect.apply($ae,null,[ot,...ke]),()=>Yj(...ke),"datetime format",ot=>ot[Zj](...ke),Gae,ot=>ri(ot)||Fl(ot))}function dt(ke){A=ke,N.pluralRules=A}function ze(ke,ot){return J(()=>{if(!ke)return!1;const Ct=ri(ot)?ot:a.value,Gt=Me(Ct),Ot=N.messageResolver(Gt,ke);return KO(Ot)||vf(Ot)||ri(Ot)},()=>[ke],"translate exists",Ct=>Reflect.apply(Ct.te,Ct,[ke,ot]),MWe,Ct=>uo(Ct))}function ee(ke){let ot=null;const Ct=WCe(N,c.value,a.value);for(let Gt=0;Gt<Ct.length;Gt++){const Ot=u.value[Ct[Gt]]||{},En=N.messageResolver(Ot,ke);if(En!=null){ot=En;break}}return ot}function ye(ke){const ot=ee(ke);return ot??(e?e.tm(ke)||{}:{})}function Me(ke){return u.value[ke]||{}}function et(ke,ot){if(s){const Ct={[ke]:ot};for(const Gt in Ct)Dg(Ct,Gt)&&q$(Ct[Gt]);ot=Ct[ke]}u.value[ke]=ot,N.messages=u.value}function at(ke,ot){u.value[ke]=u.value[ke]||{};const Ct={[ke]:ot};if(s)for(const Gt in Ct)Dg(Ct,Gt)&&q$(Ct[Gt]);ot=Ct[ke],pU(ot,u.value[ke]),N.messages=u.value}function Ue(ke){return d.value[ke]||{}}function Se(ke,ot){d.value[ke]=ot,N.datetimeFormats=d.value,xae(N,ke,ot)}function Ie(ke,ot){d.value[ke]=ma(d.value[ke]||{},ot),N.datetimeFormats=d.value,xae(N,ke,ot)}function Xe(ke){return f.value[ke]||{}}function it(ke,ot){f.value[ke]=ot,N.numberFormats=f.value,Fae(N,ke,ot)}function Tt(ke,ot){f.value[ke]=ma(f.value[ke]||{},ot),N.numberFormats=f.value,Fae(N,ke,ot)}zae++,e&&cW&&(ht(e.locale,ke=>{r&&(a.value=ke,N.locale=ke,EN(N,a.value,c.value))}),ht(e.fallbackLocale,ke=>{r&&(c.value=ke,N.fallbackLocale=ke,EN(N,a.value,c.value))}));const He={id:zae,locale:F,fallbackLocale:V,get inheritLocale(){return r},set inheritLocale(ke){r=ke,ke&&e&&(a.value=e.locale.value,c.value=e.fallbackLocale.value,EN(N,a.value,c.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:U,get modifiers(){return O},get pluralRules(){return A||{}},get isGlobal(){return i},get missingWarn(){return g},set missingWarn(ke){g=ke,N.missingWarn=g},get fallbackWarn(){return p},set fallbackWarn(ke){p=ke,N.fallbackWarn=p},get fallbackRoot(){return _},set fallbackRoot(ke){_=ke},get fallbackFormat(){return v},set fallbackFormat(ke){v=ke,N.fallbackFormat=v},get warnHtmlMessage(){return I},set warnHtmlMessage(ke){I=ke,N.warnHtmlMessage=ke},get escapeParameter(){return L},set escapeParameter(ke){L=ke,N.escapeParameter=ke},t:ge,getLocaleMessage:Me,setLocaleMessage:et,mergeLocaleMessage:at,getPostTranslationHandler:q,setPostTranslationHandler:K,getMissingHandler:re,setMissingHandler:Z,[ZCe]:dt};return He.datetimeFormats=Q,He.numberFormats=de,He.rt=ve,He.te=ze,He.tm=ye,He.d=Le,He.n=Ee,He.getDateTimeFormat=Ue,He.setDateTimeFormat=Se,He.mergeDateTimeFormat=Ie,He.getNumberFormat=Xe,He.setNumberFormat=it,He.mergeNumberFormat=Tt,He[eye]=t,He[Qj]=we,He[Zj]=Ge,He[eX]=Ve,He}function AWe(n){const e=ri(n.locale)?n.locale:Y$,t=ri(n.fallbackLocale)||Fl(n.fallbackLocale)||$s(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:e,i=Ir(n.missing)?n.missing:void 0,s=uo(n.silentTranslationWarn)||GO(n.silentTranslationWarn)?!n.silentTranslationWarn:!0,o=uo(n.silentFallbackWarn)||GO(n.silentFallbackWarn)?!n.silentFallbackWarn:!0,r=uo(n.fallbackRoot)?n.fallbackRoot:!0,a=!!n.formatFallbackMessages,c=$s(n.modifiers)?n.modifiers:{},u=n.pluralizationRules,d=Ir(n.postTranslation)?n.postTranslation:void 0,f=ri(n.warnHtmlInMessage)?n.warnHtmlInMessage!=="off":!0,g=!!n.escapeParameterHtml,p=uo(n.sync)?n.sync:!0;let _=n.messages;if($s(n.sharedMessages)){const O=n.sharedMessages;_=Object.keys(O).reduce((N,D)=>{const P=N[D]||(N[D]={});return ma(P,O[D]),N},_||{})}const{__i18n:v,__root:C,__injectWithOption:y}=n,w=n.datetimeFormats,I=n.numberFormats,L=n.flatJson;return{locale:e,fallbackLocale:t,messages:_,flatJson:L,datetimeFormats:w,numberFormats:I,missing:i,missingWarn:s,fallbackWarn:o,fallbackRoot:r,fallbackFormat:a,modifiers:c,pluralRules:u,postTranslation:d,warnHtmlMessage:f,escapeParameter:g,messageResolver:n.messageResolver,inheritLocale:p,__i18n:v,__root:C,__injectWithOption:y}}function nX(n={}){const e=Iee(AWe(n)),{__extender:t}=n,i={id:e.id,get locale(){return e.locale.value},set locale(s){e.locale.value=s},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(s){e.fallbackLocale.value=s},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(s){e.setMissingHandler(s)},get silentTranslationWarn(){return uo(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(s){e.missingWarn=uo(s)?!s:s},get silentFallbackWarn(){return uo(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(s){e.fallbackWarn=uo(s)?!s:s},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(s){e.fallbackFormat=s},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(s){e.setPostTranslationHandler(s)},get sync(){return e.inheritLocale},set sync(s){e.inheritLocale=s},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){e.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(s){e.escapeParameter=s},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...s){return Reflect.apply(e.t,e,[...s])},rt(...s){return Reflect.apply(e.rt,e,[...s])},te(s,o){return e.te(s,o)},tm(s){return e.tm(s)},getLocaleMessage(s){return e.getLocaleMessage(s)},setLocaleMessage(s,o){e.setLocaleMessage(s,o)},mergeLocaleMessage(s,o){e.mergeLocaleMessage(s,o)},d(...s){return Reflect.apply(e.d,e,[...s])},getDateTimeFormat(s){return e.getDateTimeFormat(s)},setDateTimeFormat(s,o){e.setDateTimeFormat(s,o)},mergeDateTimeFormat(s,o){e.mergeDateTimeFormat(s,o)},n(...s){return Reflect.apply(e.n,e,[...s])},getNumberFormat(s){return e.getNumberFormat(s)},setNumberFormat(s,o){e.setNumberFormat(s,o)},mergeNumberFormat(s,o){e.mergeNumberFormat(s,o)}};return i.__extender=t,i}function NWe(n,e,t){return{beforeCreate(){const i=Qn();if(!i)throw Sh(Rd.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const o=s.i18n;if(s.__i18n&&(o.__i18n=s.__i18n),o.__root=e,this===this.$root)this.$i18n=jae(n,o);else{o.__injectWithOption=!0,o.__extender=t.__vueI18nExtend,this.$i18n=nX(o);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=jae(n,s);else{this.$i18n=nX({__i18n:s.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=n;s.__i18nGlobal&&nye(e,s,s),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$te=(o,r)=>this.$i18n.te(o,r),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),t.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=Qn();if(!i)throw Sh(Rd.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),t.__deleteInstance(i),delete this.$i18n}}}function jae(n,e){n.locale=e.locale||n.locale,n.fallbackLocale=e.fallbackLocale||n.fallbackLocale,n.missing=e.missing||n.missing,n.silentTranslationWarn=e.silentTranslationWarn||n.silentFallbackWarn,n.silentFallbackWarn=e.silentFallbackWarn||n.silentFallbackWarn,n.formatFallbackMessages=e.formatFallbackMessages||n.formatFallbackMessages,n.postTranslation=e.postTranslation||n.postTranslation,n.warnHtmlInMessage=e.warnHtmlInMessage||n.warnHtmlInMessage,n.escapeParameterHtml=e.escapeParameterHtml||n.escapeParameterHtml,n.sync=e.sync||n.sync,n.__composer[ZCe](e.pluralizationRules||n.pluralizationRules);const t=wee(n.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(i=>n.mergeLocaleMessage(i,t[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>n.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>n.mergeNumberFormat(i,e.numberFormats[i])),n}const Lee={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function DWe({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===Qt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},jo())}function iye(){return Qt}const $We=$e({name:"i18n-t",props:ma({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Pl(n)||!isNaN(n)}},Lee),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||Jf({useScope:n.scope,__useComponent:!0});return()=>{const o=Object.keys(t).filter(f=>f!=="_"),r=jo();n.locale&&(r.locale=n.locale),n.plural!==void 0&&(r.plural=ri(n.plural)?+n.plural:n.plural);const a=DWe(e,o),c=s[Qj](n.keypath,a,r),u=ma(jo(),i),d=ri(n.tag)||_o(n.tag)?n.tag:iye();return hn(d,u,c)}}}),Xae=$We;function xWe(n){return Fl(n)&&!ri(n[0])}function sye(n,e,t,i){const{slots:s,attrs:o}=e;return()=>{const r={part:!0};let a=jo();n.locale&&(r.locale=n.locale),ri(n.format)?r.key=n.format:_o(n.format)&&(ri(n.format.key)&&(r.key=n.format.key),a=Object.keys(n.format).reduce((g,p)=>t.includes(p)?ma(jo(),g,{[p]:n.format[p]}):g,jo()));const c=i(n.value,r,a);let u=[r.key];Fl(c)?u=c.map((g,p)=>{const _=s[g.type],v=_?_({[g.type]:g.value,index:p,parts:c}):[g.value];return xWe(v)&&(v[0].key=`${g.type}-${p}`),v}):ri(c)&&(u=[c]);const d=ma(jo(),o),f=ri(n.tag)||_o(n.tag)?n.tag:iye();return hn(f,d,u)}}const PWe=$e({name:"i18n-n",props:ma({value:{type:Number,required:!0},format:{type:[String,Object]}},Lee),setup(n,e){const t=n.i18n||Jf({useScope:n.scope,__useComponent:!0});return sye(n,e,qCe,(...i)=>t[eX](...i))}}),Yae=PWe;function FWe(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function BWe(n){const e=r=>{const{instance:a,value:c}=r;if(!a||!a.$)throw Sh(Rd.UNEXPECTED_ERROR);const u=FWe(n,a.$),d=qae(c);return[Reflect.apply(u.t,u,[...Jae(d)]),u]};return{created:(r,a)=>{const[c,u]=e(a);cW&&n.global===u&&(r.__i18nWatcher=ht(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),r.__composer=u,r.textContent=c},unmounted:r=>{cW&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:a})=>{if(r.__composer){const c=r.__composer,u=qae(a);r.textContent=Reflect.apply(c.t,c,[...Jae(u)])}},getSSRProps:r=>{const[a]=e(r);return{textContent:a}}}}function qae(n){if(ri(n))return{path:n};if($s(n)){if(!("path"in n))throw Sh(Rd.REQUIRED_VALUE,"path");return n}else throw Sh(Rd.INVALID_VALUE)}function Jae(n){const{path:e,locale:t,args:i,choice:s,plural:o}=n,r={},a=i||{};return ri(t)&&(r.locale=t),Pl(s)&&(r.plural=s),Pl(o)&&(r.plural=o),[e,a,r]}function HWe(n,e,...t){const i=$s(t[0])?t[0]:{};(uo(i.globalInstall)?i.globalInstall:!0)&&([Xae.name,"I18nT"].forEach(o=>n.component(o,Xae)),[Yae.name,"I18nN"].forEach(o=>n.component(o,Yae)),[Zae.name,"I18nD"].forEach(o=>n.component(o,Zae))),n.directive("t",BWe(e))}const VWe=ky("global-vue-i18n");function UWe(n={}){const e=__VUE_I18N_LEGACY_API__&&uo(n.legacy)?n.legacy:__VUE_I18N_LEGACY_API__,t=uo(n.globalInjection)?n.globalInjection:!0,i=new Map,[s,o]=WWe(n,e),r=ky("");function a(f){return i.get(f)||null}function c(f,g){i.set(f,g)}function u(f){i.delete(f)}const d={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(f,...g){if(f.__VUE_I18N_SYMBOL__=r,f.provide(f.__VUE_I18N_SYMBOL__,d),$s(g[0])){const v=g[0];d.__composerExtend=v.__composerExtend,d.__vueI18nExtend=v.__vueI18nExtend}let p=null;!e&&t&&(p=JWe(f,d.global)),__VUE_I18N_FULL_INSTALL__&&HWe(f,d,...g),__VUE_I18N_LEGACY_API__&&e&&f.mixin(NWe(o,o.__composer,d));const _=f.unmount;f.unmount=()=>{p&&p(),d.dispose(),_()}},get global(){return o},dispose(){s.stop()},__instances:i,__getInstance:a,__setInstance:c,__deleteInstance:u};return d}function Jf(n={}){const e=Qn();if(e==null)throw Sh(Rd.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Sh(Rd.NOT_INSTALLED);const t=GWe(e),i=KWe(t),s=tye(e),o=zWe(n,s);if(o==="global")return nye(i,n,s),i;if(o==="parent"){let c=jWe(t,e,n.__useComponent);return c==null&&(c=i),c}const r=t;let a=r.__getInstance(e);if(a==null){const c=ma({},n);"__i18n"in s&&(c.__i18n=s.__i18n),i&&(c.__root=i),a=Iee(c),r.__composerExtend&&(a[tX]=r.__composerExtend(a)),YWe(r,e,a),r.__setInstance(e,a)}return a}function WWe(n,e){const t=I5(),i=__VUE_I18N_LEGACY_API__&&e?t.run(()=>nX(n)):t.run(()=>Iee(n));if(i==null)throw Sh(Rd.UNEXPECTED_ERROR);return[t,i]}function GWe(n){const e=Kt(n.isCE?VWe:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Sh(n.isCE?Rd.NOT_INSTALLED_WITH_PROVIDE:Rd.UNEXPECTED_ERROR);return e}function zWe(n,e){return t8(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function KWe(n){return n.mode==="composition"?n.global:n.global.__composer}function jWe(n,e,t=!1){let i=null;const s=e.root;let o=XWe(e,t);for(;o!=null;){const r=n;if(n.mode==="composition")i=r.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const a=r.__getInstance(o);a!=null&&(i=a.__composer,t&&i&&!i[eye]&&(i=null))}if(i!=null||s===o)break;o=o.parent}return i}function XWe(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function YWe(n,e,t){$n(()=>{},e),Cb(()=>{const i=t;n.__deleteInstance(e);const s=i[tX];s&&(s(),delete i[tX])},e)}const qWe=["locale","fallbackLocale","availableLocales"],Qae=["t","rt","d","n","tm","te"];function JWe(n,e){const t=Object.create(null);return qWe.forEach(s=>{const o=Object.getOwnPropertyDescriptor(e,s);if(!o)throw Sh(Rd.UNEXPECTED_ERROR);const r=Ss(o.value)?{get(){return o.value.value},set(a){o.value.value=a}}:{get(){return o.get&&o.get()}};Object.defineProperty(t,s,r)}),n.config.globalProperties.$i18n=t,Qae.forEach(s=>{const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!o.value)throw Sh(Rd.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,o)}),()=>{delete n.config.globalProperties.$i18n,Qae.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const QWe=$e({name:"i18n-d",props:ma({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Lee),setup(n,e){const t=n.i18n||Jf({useScope:n.scope,__useComponent:!0});return sye(n,e,YCe,(...i)=>t[Zj](...i))}}),Zae=QWe;RWe();lWe(U4e);aWe(sWe);cWe(WCe);if(__INTLIFY_PROD_DEVTOOLS__){const n=HS();n.__INTLIFY__=!0,W4e(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const ZWe={class:"device-header"},e3e={class:"device-header-title"},t3e={key:0,class:"device-detect"},n3e={key:1,class:"device-detect"},i3e=["href"],s3e={class:"device-detect-btn"},o3e={__name:"deviceHeader",setup(n){const{t:e}=Jf(),t=te(e("message.wired_connection")),i=gU.useUploaders(),s=te(!1),o=te(!0),r=te(`${lf.name} ${lf.version}`),a=te(lf.os.toString()),c=te(""),u=te(!1),d=te(!1),f=te(!1),g=te(""),p=te("");$n(()=>{v(lf.os.family,lf.os.version),C(lf.name,lf.version),p.value=lf.os.toString().indexOf("64-bit")!=-1?"//cocorobo.cn/downloads/Windows6.1-KB2999226-x64.msu":"//cocorobo.cn/downloads/Windows6.1-KB2999226-x86.msu",y()});const _=()=>{o.value=!1,v(lf.os.family,lf.os.version),C(lf.name,lf.version),y()},v=(I,L)=>{let O={int:10,float:9},A={10:10,"10 Technical Preview":6.4,"8.1":6.3,8:6.2,7:6.1,Vista:6,"XP 64-bit":5.2,XP:5.1,"2000 SP1":5.01,2e3:5,NT:4,ME:4.9},N=!1;if(I.toLowerCase().indexOf("windows")>-1)A[L]>=5.1&&(N=!0);else if(I.toLowerCase().indexOf("os x")>-1){const D=L.split(".");(D[0]>O.int||parseInt(D[0])===O.int&&D[1]>=O.float)&&(N=!0)}u.value=N},C=(I,L)=>{let O=!1;const A=(N,D)=>L.split(N)[0]>D;I==="Chrome"||I==="Firefox"?O=A(".",50):I==="Opera"?O=A(".",43):I==="Safari"?O=A(".",10):I==="Maxthon"&&(O=A(".",4)),d.value=O},y=()=>{let I=i.uploaders.version;if(!I)return c.value="",f.value=!1,!1;if(I==Kj.uploader)f.value=!0;else{const L=w(I,Kj.uploader)>0;f.value=L,g.value=L?"":"版本不是最新,建议更新"}},w=(I,L)=>{const O=I.split(".").map(Number),A=L.split(".").map(Number);for(let N=0;N<Math.max(O.length,A.length);N++){const D=O[N]||0,P=A[N]||0;if(D>P)return 1;if(D<P)return-1}return 0};return Sl(()=>{c.value=i.uploaders.version}),(I,L)=>{const O=Bt("el-option"),A=Bt("el-select"),N=Bt("el-tooltip"),D=Bt("el-col"),P=Bt("el-row"),F=Bt("el-button"),V=Bt("el-dialog");return G(),he(Qt,null,[oe("div",ZWe,[oe("span",e3e,st(I.$t("message.device")),1),ce(A,{modelValue:t.value,"onUpdate:modelValue":L[0]||(L[0]=U=>t.value=U),style:{width:"100px","margin-left":"10px"}},{default:_e(()=>[ce(O,{value:I.$t("message.wired_connection")},{default:_e(()=>[mn(st(I.$t("message.wired_connection")),1)]),_:1},8,["value"]),ce(O,{value:I.$t("message.wireless_connection")},{default:_e(()=>[mn(st(I.$t("message.wireless_connection")),1)]),_:1},8,["value"])]),_:1},8,["modelValue"]),T(i).uploaders.status?(G(),nt(N,{key:0,content:I.$t("message.uploader_connection")},{default:_e(()=>L[3]||(L[3]=[oe("img",{src:FUe,alt:""},null,-1)])),_:1},8,["content"])):(G(),nt(N,{key:1,content:I.$t("message.not_uploader_connection")},{default:_e(()=>[oe("img",{src:BUe,alt:"",onClick:L[1]||(L[1]=U=>s.value=!0)})]),_:1},8,["content"])),L[4]||(L[4]=oe("img",{class:"device-header-img-right",src:HUe,alt:""},null,-1)),L[5]||(L[5]=oe("img",{class:"device-header-img-right",src:VUe,alt:""},null,-1))]),ce(V,{modelValue:s.value,"onUpdate:modelValue":L[2]||(L[2]=U=>s.value=U)},{default:_e(()=>[L[17]||(L[17]=oe("div",{slot:"header"},[oe("h1",null,"环境检测")],-1)),o.value?(G(),he("div",t3e,L[6]||(L[6]=[oe("img",{src:UUe,alt:""},null,-1)]))):(G(),he("div",n3e,[ce(P,{class:"device-detect-table"},{default:_e(()=>[ce(D,{span:5},{default:_e(()=>L[7]||(L[7]=[mn("设备")])),_:1}),ce(D,{span:5},{default:_e(()=>L[8]||(L[8]=[mn("结果")])),_:1}),ce(D,{span:5},{default:_e(()=>L[9]||(L[9]=[mn("支持")])),_:1}),ce(D,{span:9},{default:_e(()=>L[10]||(L[10]=[mn("建议")])),_:1})]),_:1}),ce(P,{class:"device-detect-table-title"},{default:_e(()=>[ce(D,{span:5},{default:_e(()=>L[11]||(L[11]=[mn("系统")])),_:1}),ce(D,{span:5},{default:_e(()=>[mn(st(a.value),1)]),_:1}),ce(D,{span:5},{default:_e(()=>[oe("i",{class:"material-icons small",style:on(u.value?"color:#00cf00;":"color:#ffcf00;")},st(u.value?"check":"priority_high"),5)]),_:1}),ce(D,{span:9},{default:_e(()=>[mn(st(u.value?"支持":"不支持"),1)]),_:1})]),_:1}),ce(P,{class:"device-detect-table-title"},{default:_e(()=>[ce(D,{span:5},{default:_e(()=>L[12]||(L[12]=[mn("浏览器")])),_:1}),ce(D,{span:5},{default:_e(()=>[mn(st(r.value),1)]),_:1}),ce(D,{span:5},{default:_e(()=>[oe("i",{class:"material-icons small",style:on(u.value?"color:#00cf00;":"color:#ffcf00;")},st(u.value?"check":"priority_high"),5)]),_:1}),ce(D,{span:9},{default:_e(()=>[mn(st(u.value?"支持":"不支持"),1)]),_:1})]),_:1}),ce(P,{class:"device-detect-table-title"},{default:_e(()=>[ce(D,{span:5},{default:_e(()=>L[13]||(L[13]=[mn("Uploader")])),_:1}),ce(D,{span:5},{default:_e(()=>[mn(st(c.value||"没有打开"),1)]),_:1}),ce(D,{span:5},{default:_e(()=>[oe("i",{class:"material-icons small",style:on(f.value?"color:#00cf00;":"color:#ffcf00;")},st(f.value?"check":"priority_high"),5)]),_:1}),ce(D,{span:9},{default:_e(()=>[mn(st(c.value?"uploader已连接":"Uploader 未连接"),1),L[14]||(L[14]=oe("br",null,null,-1)),mn(" "+st(g.value),1)]),_:1})]),_:1}),ce(P,{class:"device-detect-table-title"},{default:_e(()=>[ce(D,{span:5},{default:_e(()=>L[15]||(L[15]=[mn("补丁")])),_:1}),ce(D,{span:5},{default:_e(()=>[oe("a",{href:p.value,target:"_blank",download:"kb2999226 64-bit",style:{color:"#039be5"}},"kb2999226 64-bit",8,i3e)]),_:1})]),_:1})])),oe("div",s3e,[ce(F,{type:"primary",onClick:_},{default:_e(()=>L[16]||(L[16]=[mn("开始检测")])),_:1})])]),_:1},8,["modelValue"])],64)}}},r3e=Oh(o3e,[["__scopeId","data-v-53ab4d91"]]);function oye(n,e){return function(){return n.apply(e,arguments)}}const{toString:l3e}=Object.prototype,{getPrototypeOf:Oee}=Object,s8=(n=>e=>{const t=l3e.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),dp=n=>(n=n.toLowerCase(),e=>s8(e)===n),o8=n=>e=>typeof e===n,{isArray:QR}=Array,J$=o8("undefined");function a3e(n){return n!==null&&!J$(n)&&n.constructor!==null&&!J$(n.constructor)&&ph(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const rye=dp("ArrayBuffer");function c3e(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&rye(n.buffer),e}const u3e=o8("string"),ph=o8("function"),lye=o8("number"),r8=n=>n!==null&&typeof n=="object",d3e=n=>n===!0||n===!1,mU=n=>{if(s8(n)!=="object")return!1;const e=Oee(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},h3e=dp("Date"),f3e=dp("File"),g3e=dp("Blob"),p3e=dp("FileList"),m3e=n=>r8(n)&&ph(n.pipe),_3e=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||ph(n.append)&&((e=s8(n))==="formdata"||e==="object"&&ph(n.toString)&&n.toString()==="[object FormData]"))},v3e=dp("URLSearchParams"),[b3e,T3e,C3e,y3e]=["ReadableStream","Request","Response","Headers"].map(dp),E3e=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function QP(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,s;if(typeof n!="object"&&(n=[n]),QR(n))for(i=0,s=n.length;i<s;i++)e.call(null,n[i],i,n);else{const o=t?Object.getOwnPropertyNames(n):Object.keys(n),r=o.length;let a;for(i=0;i<r;i++)a=o[i],e.call(null,n[a],a,n)}}function aye(n,e){e=e.toLowerCase();const t=Object.keys(n);let i=t.length,s;for(;i-- >0;)if(s=t[i],e===s.toLowerCase())return s;return null}const VS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,cye=n=>!J$(n)&&n!==VS;function iX(){const{caseless:n}=cye(this)&&this||{},e={},t=(i,s)=>{const o=n&&aye(e,s)||s;mU(e[o])&&mU(i)?e[o]=iX(e[o],i):mU(i)?e[o]=iX({},i):QR(i)?e[o]=i.slice():e[o]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&QP(arguments[i],t);return e}const S3e=(n,e,t,{allOwnKeys:i}={})=>(QP(e,(s,o)=>{t&&ph(s)?n[o]=oye(s,t):n[o]=s},{allOwnKeys:i}),n),w3e=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),I3e=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},L3e=(n,e,t,i)=>{let s,o,r;const a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),o=s.length;o-- >0;)r=s[o],(!i||i(r,n,e))&&!a[r]&&(e[r]=n[r],a[r]=!0);n=t!==!1&&Oee(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},O3e=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},R3e=n=>{if(!n)return null;if(QR(n))return n;let e=n.length;if(!lye(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},M3e=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Oee(Uint8Array)),k3e=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let s;for(;(s=i.next())&&!s.done;){const o=s.value;e.call(n,o[0],o[1])}},A3e=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},N3e=dp("HTMLFormElement"),D3e=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,s){return i.toUpperCase()+s}),ece=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),$3e=dp("RegExp"),uye=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};QP(t,(s,o)=>{let r;(r=e(s,o,n))!==!1&&(i[o]=r||s)}),Object.defineProperties(n,i)},x3e=n=>{uye(n,(e,t)=>{if(ph(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(ph(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},P3e=(n,e)=>{const t={},i=s=>{s.forEach(o=>{t[o]=!0})};return QR(n)?i(n):i(String(n).split(e)),t},F3e=()=>{},B3e=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,Vz="abcdefghijklmnopqrstuvwxyz",tce="0123456789",dye={DIGIT:tce,ALPHA:Vz,ALPHA_DIGIT:Vz+Vz.toUpperCase()+tce},H3e=(n=16,e=dye.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function V3e(n){return!!(n&&ph(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const U3e=n=>{const e=new Array(10),t=(i,s)=>{if(r8(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const o=QR(i)?[]:{};return QP(i,(r,a)=>{const c=t(r,s+1);!J$(c)&&(o[a]=c)}),e[s]=void 0,o}}return i};return t(n,0)},W3e=dp("AsyncFunction"),G3e=n=>n&&(r8(n)||ph(n))&&ph(n.then)&&ph(n.catch),hye=((n,e)=>n?setImmediate:e?((t,i)=>(VS.addEventListener("message",({source:s,data:o})=>{s===VS&&o===t&&i.length&&i.shift()()},!1),s=>{i.push(s),VS.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",ph(VS.postMessage)),z3e=typeof queueMicrotask<"u"?queueMicrotask.bind(VS):typeof process<"u"&&process.nextTick||hye,Ut={isArray:QR,isArrayBuffer:rye,isBuffer:a3e,isFormData:_3e,isArrayBufferView:c3e,isString:u3e,isNumber:lye,isBoolean:d3e,isObject:r8,isPlainObject:mU,isReadableStream:b3e,isRequest:T3e,isResponse:C3e,isHeaders:y3e,isUndefined:J$,isDate:h3e,isFile:f3e,isBlob:g3e,isRegExp:$3e,isFunction:ph,isStream:m3e,isURLSearchParams:v3e,isTypedArray:M3e,isFileList:p3e,forEach:QP,merge:iX,extend:S3e,trim:E3e,stripBOM:w3e,inherits:I3e,toFlatObject:L3e,kindOf:s8,kindOfTest:dp,endsWith:O3e,toArray:R3e,forEachEntry:k3e,matchAll:A3e,isHTMLForm:N3e,hasOwnProperty:ece,hasOwnProp:ece,reduceDescriptors:uye,freezeMethods:x3e,toObjectSet:P3e,toCamelCase:D3e,noop:F3e,toFiniteNumber:B3e,findKey:aye,global:VS,isContextDefined:cye,ALPHABET:dye,generateString:H3e,isSpecCompliantForm:V3e,toJSONObject:U3e,isAsyncFn:W3e,isThenable:G3e,setImmediate:hye,asap:z3e};function rs(n,e,t,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}Ut.inherits(rs,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ut.toJSONObject(this.config),code:this.code,status:this.status}}});const fye=rs.prototype,gye={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{gye[n]={value:n}});Object.defineProperties(rs,gye);Object.defineProperty(fye,"isAxiosError",{value:!0});rs.from=(n,e,t,i,s,o)=>{const r=Object.create(fye);return Ut.toFlatObject(n,r,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),rs.call(r,n.message,e,t,i,s),r.cause=n,r.name=n.name,o&&Object.assign(r,o),r};const K3e=null;function sX(n){return Ut.isPlainObject(n)||Ut.isArray(n)}function pye(n){return Ut.endsWith(n,"[]")?n.slice(0,-2):n}function nce(n,e,t){return n?n.concat(e).map(function(s,o){return s=pye(s),!t&&o?"["+s+"]":s}).join(t?".":""):e}function j3e(n){return Ut.isArray(n)&&!n.some(sX)}const X3e=Ut.toFlatObject(Ut,{},null,function(e){return/^is[A-Z]/.test(e)});function l8(n,e,t){if(!Ut.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=Ut.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,C){return!Ut.isUndefined(C[v])});const i=t.metaTokens,s=t.visitor||d,o=t.dots,r=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&Ut.isSpecCompliantForm(e);if(!Ut.isFunction(s))throw new TypeError("visitor must be a function");function u(_){if(_===null)return"";if(Ut.isDate(_))return _.toISOString();if(!c&&Ut.isBlob(_))throw new rs("Blob is not supported. Use a Buffer instead.");return Ut.isArrayBuffer(_)||Ut.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function d(_,v,C){let y=_;if(_&&!C&&typeof _=="object"){if(Ut.endsWith(v,"{}"))v=i?v:v.slice(0,-2),_=JSON.stringify(_);else if(Ut.isArray(_)&&j3e(_)||(Ut.isFileList(_)||Ut.endsWith(v,"[]"))&&(y=Ut.toArray(_)))return v=pye(v),y.forEach(function(I,L){!(Ut.isUndefined(I)||I===null)&&e.append(r===!0?nce([v],L,o):r===null?v:v+"[]",u(I))}),!1}return sX(_)?!0:(e.append(nce(C,v,o),u(_)),!1)}const f=[],g=Object.assign(X3e,{defaultVisitor:d,convertValue:u,isVisitable:sX});function p(_,v){if(!Ut.isUndefined(_)){if(f.indexOf(_)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(_),Ut.forEach(_,function(y,w){(!(Ut.isUndefined(y)||y===null)&&s.call(e,y,Ut.isString(w)?w.trim():w,v,g))===!0&&p(y,v?v.concat(w):[w])}),f.pop()}}if(!Ut.isObject(n))throw new TypeError("data must be an object");return p(n),e}function ice(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Ree(n,e){this._pairs=[],n&&l8(n,this,e)}const mye=Ree.prototype;mye.append=function(e,t){this._pairs.push([e,t])};mye.toString=function(e){const t=e?function(i){return e.call(this,i,ice)}:ice;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function Y3e(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _ye(n,e,t){if(!e)return n;const i=t&&t.encode||Y3e;Ut.isFunction(t)&&(t={serialize:t});const s=t&&t.serialize;let o;if(s?o=s(e,t):o=Ut.isURLSearchParams(e)?e.toString():new Ree(e,t).toString(i),o){const r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+o}return n}class sce{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ut.forEach(this.handlers,function(i){i!==null&&e(i)})}}const vye={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},q3e=typeof URLSearchParams<"u"?URLSearchParams:Ree,J3e=typeof FormData<"u"?FormData:null,Q3e=typeof Blob<"u"?Blob:null,Z3e={isBrowser:!0,classes:{URLSearchParams:q3e,FormData:J3e,Blob:Q3e},protocols:["http","https","file","blob","url","data"]},Mee=typeof window<"u"&&typeof document<"u",oX=typeof navigator=="object"&&navigator||void 0,e5e=Mee&&(!oX||["ReactNative","NativeScript","NS"].indexOf(oX.product)<0),t5e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",n5e=Mee&&window.location.href||"http://localhost",i5e=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Mee,hasStandardBrowserEnv:e5e,hasStandardBrowserWebWorkerEnv:t5e,navigator:oX,origin:n5e},Symbol.toStringTag,{value:"Module"})),Wc={...i5e,...Z3e};function s5e(n,e){return l8(n,new Wc.classes.URLSearchParams,Object.assign({visitor:function(t,i,s,o){return Wc.isNode&&Ut.isBuffer(t)?(this.append(i,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function o5e(n){return Ut.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function r5e(n){const e={},t=Object.keys(n);let i;const s=t.length;let o;for(i=0;i<s;i++)o=t[i],e[o]=n[o];return e}function bye(n){function e(t,i,s,o){let r=t[o++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),c=o>=t.length;return r=!r&&Ut.isArray(s)?s.length:r,c?(Ut.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!a):((!s[r]||!Ut.isObject(s[r]))&&(s[r]=[]),e(t,i,s[r],o)&&Ut.isArray(s[r])&&(s[r]=r5e(s[r])),!a)}if(Ut.isFormData(n)&&Ut.isFunction(n.entries)){const t={};return Ut.forEachEntry(n,(i,s)=>{e(o5e(i),s,t,0)}),t}return null}function l5e(n,e,t){if(Ut.isString(n))try{return(e||JSON.parse)(n),Ut.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(n)}const ZP={transitional:vye,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",s=i.indexOf("application/json")>-1,o=Ut.isObject(e);if(o&&Ut.isHTMLForm(e)&&(e=new FormData(e)),Ut.isFormData(e))return s?JSON.stringify(bye(e)):e;if(Ut.isArrayBuffer(e)||Ut.isBuffer(e)||Ut.isStream(e)||Ut.isFile(e)||Ut.isBlob(e)||Ut.isReadableStream(e))return e;if(Ut.isArrayBufferView(e))return e.buffer;if(Ut.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return s5e(e,this.formSerializer).toString();if((a=Ut.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return l8(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return o||s?(t.setContentType("application/json",!1),l5e(e)):e}],transformResponse:[function(e){const t=this.transitional||ZP.transitional,i=t&&t.forcedJSONParsing,s=this.responseType==="json";if(Ut.isResponse(e)||Ut.isReadableStream(e))return e;if(e&&Ut.isString(e)&&(i&&!this.responseType||s)){const r=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(r)throw a.name==="SyntaxError"?rs.from(a,rs.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wc.classes.FormData,Blob:Wc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ut.forEach(["delete","get","head","post","put","patch"],n=>{ZP.headers[n]={}});const a5e=Ut.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),c5e=n=>{const e={};let t,i,s;return n&&n.split(`
- `).forEach(function(r){s=r.indexOf(":"),t=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!t||e[t]&&a5e[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},oce=Symbol("internals");function SN(n){return n&&String(n).trim().toLowerCase()}function _U(n){return n===!1||n==null?n:Ut.isArray(n)?n.map(_U):String(n)}function u5e(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const d5e=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Uz(n,e,t,i,s){if(Ut.isFunction(i))return i.call(this,e,t);if(s&&(e=t),!!Ut.isString(e)){if(Ut.isString(i))return e.indexOf(i)!==-1;if(Ut.isRegExp(i))return i.test(e)}}function h5e(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function f5e(n,e){const t=Ut.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(s,o,r){return this[i].call(this,e,s,o,r)},configurable:!0})})}class wd{constructor(e){e&&this.set(e)}set(e,t,i){const s=this;function o(a,c,u){const d=SN(c);if(!d)throw new Error("header name must be a non-empty string");const f=Ut.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=_U(a))}const r=(a,c)=>Ut.forEach(a,(u,d)=>o(u,d,c));if(Ut.isPlainObject(e)||e instanceof this.constructor)r(e,t);else if(Ut.isString(e)&&(e=e.trim())&&!d5e(e))r(c5e(e),t);else if(Ut.isHeaders(e))for(const[a,c]of e.entries())o(c,a,i);else e!=null&&o(t,e,i);return this}get(e,t){if(e=SN(e),e){const i=Ut.findKey(this,e);if(i){const s=this[i];if(!t)return s;if(t===!0)return u5e(s);if(Ut.isFunction(t))return t.call(this,s,i);if(Ut.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=SN(e),e){const i=Ut.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||Uz(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let s=!1;function o(r){if(r=SN(r),r){const a=Ut.findKey(i,r);a&&(!t||Uz(i,i[a],a,t))&&(delete i[a],s=!0)}}return Ut.isArray(e)?e.forEach(o):o(e),s}clear(e){const t=Object.keys(this);let i=t.length,s=!1;for(;i--;){const o=t[i];(!e||Uz(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const t=this,i={};return Ut.forEach(this,(s,o)=>{const r=Ut.findKey(i,o);if(r){t[r]=_U(s),delete t[o];return}const a=e?h5e(o):String(o).trim();a!==o&&delete t[o],t[a]=_U(s),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ut.forEach(this,(i,s)=>{i!=null&&i!==!1&&(t[s]=e&&Ut.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[oce]=this[oce]={accessors:{}}).accessors,s=this.prototype;function o(r){const a=SN(r);i[a]||(f5e(s,r),i[a]=!0)}return Ut.isArray(e)?e.forEach(o):o(e),this}}wd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ut.reduceDescriptors(wd.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});Ut.freezeMethods(wd);function Wz(n,e){const t=this||ZP,i=e||t,s=wd.from(i.headers);let o=i.data;return Ut.forEach(n,function(a){o=a.call(t,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function Tye(n){return!!(n&&n.__CANCEL__)}function ZR(n,e,t){rs.call(this,n??"canceled",rs.ERR_CANCELED,e,t),this.name="CanceledError"}Ut.inherits(ZR,rs,{__CANCEL__:!0});function Cye(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new rs("Request failed with status code "+t.status,[rs.ERR_BAD_REQUEST,rs.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function g5e(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function p5e(n,e){n=n||10;const t=new Array(n),i=new Array(n);let s=0,o=0,r;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=i[o];r||(r=u),t[s]=c,i[s]=u;let f=o,g=0;for(;f!==s;)g+=t[f++],f=f%n;if(s=(s+1)%n,s===o&&(o=(o+1)%n),u-r<e)return;const p=d&&u-d;return p?Math.round(g*1e3/p):void 0}}function m5e(n,e){let t=0,i=1e3/e,s,o;const r=(u,d=Date.now())=>{t=d,s=null,o&&(clearTimeout(o),o=null),n.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-t;f>=i?r(u,d):(s=u,o||(o=setTimeout(()=>{o=null,r(s)},i-f)))},()=>s&&r(s)]}const uW=(n,e,t=3)=>{let i=0;const s=p5e(50,250);return m5e(o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,c=r-i,u=s(c),d=r<=a;i=r;const f={loaded:r,total:a,progress:a?r/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-r)/u:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(f)},t)},rce=(n,e)=>{const t=n!=null;return[i=>e[0]({lengthComputable:t,total:n,loaded:i}),e[1]]},lce=n=>(...e)=>Ut.asap(()=>n(...e)),_5e=Wc.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,Wc.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(Wc.origin),Wc.navigator&&/(msie|trident)/i.test(Wc.navigator.userAgent)):()=>!0,v5e=Wc.hasStandardBrowserEnv?{write(n,e,t,i,s,o){const r=[n+"="+encodeURIComponent(e)];Ut.isNumber(t)&&r.push("expires="+new Date(t).toGMTString()),Ut.isString(i)&&r.push("path="+i),Ut.isString(s)&&r.push("domain="+s),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function b5e(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function T5e(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function yye(n,e){return n&&!b5e(e)?T5e(n,e):e}const ace=n=>n instanceof wd?{...n}:n;function x0(n,e){e=e||{};const t={};function i(u,d,f,g){return Ut.isPlainObject(u)&&Ut.isPlainObject(d)?Ut.merge.call({caseless:g},u,d):Ut.isPlainObject(d)?Ut.merge({},d):Ut.isArray(d)?d.slice():d}function s(u,d,f,g){if(Ut.isUndefined(d)){if(!Ut.isUndefined(u))return i(void 0,u,f,g)}else return i(u,d,f,g)}function o(u,d){if(!Ut.isUndefined(d))return i(void 0,d)}function r(u,d){if(Ut.isUndefined(d)){if(!Ut.isUndefined(u))return i(void 0,u)}else return i(void 0,d)}function a(u,d,f){if(f in e)return i(u,d);if(f in n)return i(void 0,u)}const c={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(u,d,f)=>s(ace(u),ace(d),f,!0)};return Ut.forEach(Object.keys(Object.assign({},n,e)),function(d){const f=c[d]||s,g=f(n[d],e[d],d);Ut.isUndefined(g)&&f!==a||(t[d]=g)}),t}const Eye=n=>{const e=x0({},n);let{data:t,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:r,auth:a}=e;e.headers=r=wd.from(r),e.url=_ye(yye(e.baseURL,e.url),n.params,n.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(Ut.isFormData(t)){if(Wc.hasStandardBrowserEnv||Wc.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((c=r.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];r.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Wc.hasStandardBrowserEnv&&(i&&Ut.isFunction(i)&&(i=i(e)),i||i!==!1&&_5e(e.url))){const u=s&&o&&v5e.read(o);u&&r.set(s,u)}return e},C5e=typeof XMLHttpRequest<"u",y5e=C5e&&function(n){return new Promise(function(t,i){const s=Eye(n);let o=s.data;const r=wd.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,d,f,g,p,_;function v(){p&&p(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(s.method.toUpperCase(),s.url,!0),C.timeout=s.timeout;function y(){if(!C)return;const I=wd.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),O={data:!a||a==="text"||a==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:I,config:n,request:C};Cye(function(N){t(N),v()},function(N){i(N),v()},O),C=null}"onloadend"in C?C.onloadend=y:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(y)},C.onabort=function(){C&&(i(new rs("Request aborted",rs.ECONNABORTED,n,C)),C=null)},C.onerror=function(){i(new rs("Network Error",rs.ERR_NETWORK,n,C)),C=null},C.ontimeout=function(){let L=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||vye;s.timeoutErrorMessage&&(L=s.timeoutErrorMessage),i(new rs(L,O.clarifyTimeoutError?rs.ETIMEDOUT:rs.ECONNABORTED,n,C)),C=null},o===void 0&&r.setContentType(null),"setRequestHeader"in C&&Ut.forEach(r.toJSON(),function(L,O){C.setRequestHeader(O,L)}),Ut.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),a&&a!=="json"&&(C.responseType=s.responseType),u&&([g,_]=uW(u,!0),C.addEventListener("progress",g)),c&&C.upload&&([f,p]=uW(c),C.upload.addEventListener("progress",f),C.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=I=>{C&&(i(!I||I.type?new ZR(null,n,C):I),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const w=g5e(s.url);if(w&&Wc.protocols.indexOf(w)===-1){i(new rs("Unsupported protocol "+w+":",rs.ERR_BAD_REQUEST,n));return}C.send(o||null)})},E5e=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let i=new AbortController,s;const o=function(u){if(!s){s=!0,a();const d=u instanceof Error?u:this.reason;i.abort(d instanceof rs?d:new ZR(d instanceof Error?d.message:d))}};let r=e&&setTimeout(()=>{r=null,o(new rs(`timeout ${e} of ms exceeded`,rs.ETIMEDOUT))},e);const a=()=>{n&&(r&&clearTimeout(r),r=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),n=null)};n.forEach(u=>u.addEventListener("abort",o));const{signal:c}=i;return c.unsubscribe=()=>Ut.asap(a),c}},S5e=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let i=0,s;for(;i<t;)s=i+e,yield n.slice(i,s),i=s},w5e=async function*(n,e){for await(const t of I5e(n))yield*S5e(t,e)},I5e=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}},cce=(n,e,t,i)=>{const s=w5e(n,e);let o=0,r,a=c=>{r||(r=!0,i&&i(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){a(),c.close();return}let f=d.byteLength;if(t){let g=o+=f;t(g)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},a8=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Sye=a8&&typeof ReadableStream=="function",L5e=a8&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),wye=(n,...e)=>{try{return!!n(...e)}catch{return!1}},O5e=Sye&&wye(()=>{let n=!1;const e=new Request(Wc.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),uce=64*1024,rX=Sye&&wye(()=>Ut.isReadableStream(new Response("").body)),dW={stream:rX&&(n=>n.body)};a8&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!dW[e]&&(dW[e]=Ut.isFunction(n[e])?t=>t[e]():(t,i)=>{throw new rs(`Response type '${e}' is not supported`,rs.ERR_NOT_SUPPORT,i)})})})(new Response);const R5e=async n=>{if(n==null)return 0;if(Ut.isBlob(n))return n.size;if(Ut.isSpecCompliantForm(n))return(await new Request(Wc.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(Ut.isArrayBufferView(n)||Ut.isArrayBuffer(n))return n.byteLength;if(Ut.isURLSearchParams(n)&&(n=n+""),Ut.isString(n))return(await L5e(n)).byteLength},M5e=async(n,e)=>{const t=Ut.toFiniteNumber(n.getContentLength());return t??R5e(e)},k5e=a8&&(async n=>{let{url:e,method:t,data:i,signal:s,cancelToken:o,timeout:r,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:g}=Eye(n);u=u?(u+"").toLowerCase():"text";let p=E5e([s,o&&o.toAbortSignal()],r),_;const v=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let C;try{if(c&&O5e&&t!=="get"&&t!=="head"&&(C=await M5e(d,i))!==0){let O=new Request(e,{method:"POST",body:i,duplex:"half"}),A;if(Ut.isFormData(i)&&(A=O.headers.get("content-type"))&&d.setContentType(A),O.body){const[N,D]=rce(C,uW(lce(c)));i=cce(O.body,uce,N,D)}}Ut.isString(f)||(f=f?"include":"omit");const y="credentials"in Request.prototype;_=new Request(e,{...g,signal:p,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:i,duplex:"half",credentials:y?f:void 0});let w=await fetch(_);const I=rX&&(u==="stream"||u==="response");if(rX&&(a||I&&v)){const O={};["status","statusText","headers"].forEach(P=>{O[P]=w[P]});const A=Ut.toFiniteNumber(w.headers.get("content-length")),[N,D]=a&&rce(A,uW(lce(a),!0))||[];w=new Response(cce(w.body,uce,N,()=>{D&&D(),v&&v()}),O)}u=u||"text";let L=await dW[Ut.findKey(dW,u)||"text"](w,n);return!I&&v&&v(),await new Promise((O,A)=>{Cye(O,A,{data:L,headers:wd.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:_})})}catch(y){throw v&&v(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new rs("Network Error",rs.ERR_NETWORK,n,_),{cause:y.cause||y}):rs.from(y,y&&y.code,n,_)}}),lX={http:K3e,xhr:y5e,fetch:k5e};Ut.forEach(lX,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const dce=n=>`- ${n}`,A5e=n=>Ut.isFunction(n)||n===null||n===!1,Iye={getAdapter:n=>{n=Ut.isArray(n)?n:[n];const{length:e}=n;let t,i;const s={};for(let o=0;o<e;o++){t=n[o];let r;if(i=t,!A5e(t)&&(i=lX[(r=String(t)).toLowerCase()],i===void 0))throw new rs(`Unknown adapter '${r}'`);if(i)break;s[r||"#"+o]=i}if(!i){const o=Object.entries(s).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?`since :
- `+o.map(dce).join(`
- `):" "+dce(o[0]):"as no adapter specified";throw new rs("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:lX};function Gz(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new ZR(null,n)}function hce(n){return Gz(n),n.headers=wd.from(n.headers),n.data=Wz.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Iye.getAdapter(n.adapter||ZP.adapter)(n).then(function(i){return Gz(n),i.data=Wz.call(n,n.transformResponse,i),i.headers=wd.from(i.headers),i},function(i){return Tye(i)||(Gz(n),i&&i.response&&(i.response.data=Wz.call(n,n.transformResponse,i.response),i.response.headers=wd.from(i.response.headers))),Promise.reject(i)})}const Lye="1.7.9",c8={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{c8[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const fce={};c8.transitional=function(e,t,i){function s(o,r){return"[Axios v"+Lye+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(e===!1)throw new rs(s(r," has been removed"+(t?" in "+t:"")),rs.ERR_DEPRECATED);return t&&!fce[r]&&(fce[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,r,a):!0}};c8.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function N5e(n,e,t){if(typeof n!="object")throw new rs("options must be an object",rs.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let s=i.length;for(;s-- >0;){const o=i[s],r=e[o];if(r){const a=n[o],c=a===void 0||r(a,o,n);if(c!==!0)throw new rs("option "+o+" must be "+c,rs.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new rs("Unknown option "+o,rs.ERR_BAD_OPTION)}}const vU={assertOptions:N5e,validators:c8},qp=vU.validators;class r0{constructor(e){this.defaults=e,this.interceptors={request:new sce,response:new sce}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
- `+o):i.stack=o}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=x0(this.defaults,t);const{transitional:i,paramsSerializer:s,headers:o}=t;i!==void 0&&vU.assertOptions(i,{silentJSONParsing:qp.transitional(qp.boolean),forcedJSONParsing:qp.transitional(qp.boolean),clarifyTimeoutError:qp.transitional(qp.boolean)},!1),s!=null&&(Ut.isFunction(s)?t.paramsSerializer={serialize:s}:vU.assertOptions(s,{encode:qp.function,serialize:qp.function},!0)),vU.assertOptions(t,{baseUrl:qp.spelling("baseURL"),withXsrfToken:qp.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&Ut.merge(o.common,o[t.method]);o&&Ut.forEach(["delete","get","head","post","put","patch","common"],_=>{delete o[_]}),t.headers=wd.concat(r,o);const a=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(t)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let d,f=0,g;if(!c){const _=[hce.bind(this),void 0];for(_.unshift.apply(_,a),_.push.apply(_,u),g=_.length,d=Promise.resolve(t);f<g;)d=d.then(_[f++],_[f++]);return d}g=a.length;let p=t;for(f=0;f<g;){const _=a[f++],v=a[f++];try{p=_(p)}catch(C){v.call(this,C);break}}try{d=hce.call(this,p)}catch(_){return Promise.reject(_)}for(f=0,g=u.length;f<g;)d=d.then(u[f++],u[f++]);return d}getUri(e){e=x0(this.defaults,e);const t=yye(e.baseURL,e.url);return _ye(t,e.params,e.paramsSerializer)}}Ut.forEach(["delete","get","head","options"],function(e){r0.prototype[e]=function(t,i){return this.request(x0(i||{},{method:e,url:t,data:(i||{}).data}))}});Ut.forEach(["post","put","patch"],function(e){function t(i){return function(o,r,a){return this.request(x0(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}r0.prototype[e]=t(),r0.prototype[e+"Form"]=t(!0)});class kee{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const i=this;this.promise.then(s=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(s);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,a){i.reason||(i.reason=new ZR(o,r,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new kee(function(s){e=s}),cancel:e}}}function D5e(n){return function(t){return n.apply(null,t)}}function $5e(n){return Ut.isObject(n)&&n.isAxiosError===!0}const aX={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aX).forEach(([n,e])=>{aX[e]=n});function Oye(n){const e=new r0(n),t=oye(r0.prototype.request,e);return Ut.extend(t,r0.prototype,e,{allOwnKeys:!0}),Ut.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return Oye(x0(n,s))},t}const Os=Oye(ZP);Os.Axios=r0;Os.CanceledError=ZR;Os.CancelToken=kee;Os.isCancel=Tye;Os.VERSION=Lye;Os.toFormData=l8;Os.AxiosError=rs;Os.Cancel=Os.CanceledError;Os.all=function(e){return Promise.all(e)};Os.spread=D5e;Os.isAxiosError=$5e;Os.mergeConfig=x0;Os.AxiosHeaders=wd;Os.formToJSON=n=>bye(Ut.isHTMLForm(n)?new FormData(n):n);Os.getAdapter=Iye.getAdapter;Os.HttpStatusCode=aX;Os.default=Os;const x5e="2.9.1",gce=Symbol("INSTALLED_KEY"),Rye=Symbol(),$D="el",P5e="is-",lS=(n,e,t,i,s)=>{let o=`${n}-${e}`;return t&&(o+=`-${t}`),i&&(o+=`__${i}`),s&&(o+=`--${s}`),o},Mye=Symbol("namespaceContextKey"),Aee=n=>{const e=n||(Qn()?Kt(Mye,te($D)):te($D));return W(()=>T(e)||$D)},vt=(n,e)=>{const t=Aee(e);return{namespace:t,b:(v="")=>lS(t.value,n,v,"",""),e:v=>v?lS(t.value,n,"",v,""):"",m:v=>v?lS(t.value,n,"","",v):"",be:(v,C)=>v&&C?lS(t.value,n,v,C,""):"",em:(v,C)=>v&&C?lS(t.value,n,"",v,C):"",bm:(v,C)=>v&&C?lS(t.value,n,v,"",C):"",bem:(v,C,y)=>v&&C&&y?lS(t.value,n,v,C,y):"",is:(v,...C)=>{const y=C.length>=1?C[0]:!0;return v&&y?`${P5e}${v}`:""},cssVar:v=>{const C={};for(const y in v)v[y]&&(C[`--${t.value}-${y}`]=v[y]);return C},cssVarName:v=>`--${t.value}-${v}`,cssVarBlock:v=>{const C={};for(const y in v)v[y]&&(C[`--${t.value}-${n}-${y}`]=v[y]);return C},cssVarBlockName:v=>`--${t.value}-${n}-${v}`}};var kye=typeof global=="object"&&global&&global.Object===Object&&global,F5e=typeof self=="object"&&self&&self.Object===Object&&self,hp=kye||F5e||Function("return this")(),Wf=hp.Symbol,Aye=Object.prototype,B5e=Aye.hasOwnProperty,H5e=Aye.toString,wN=Wf?Wf.toStringTag:void 0;function V5e(n){var e=B5e.call(n,wN),t=n[wN];try{n[wN]=void 0;var i=!0}catch{}var s=H5e.call(n);return i&&(e?n[wN]=t:delete n[wN]),s}var U5e=Object.prototype,W5e=U5e.toString;function G5e(n){return W5e.call(n)}var z5e="[object Null]",K5e="[object Undefined]",pce=Wf?Wf.toStringTag:void 0;function kw(n){return n==null?n===void 0?K5e:z5e:pce&&pce in Object(n)?V5e(n):G5e(n)}function Wm(n){return n!=null&&typeof n=="object"}var j5e="[object Symbol]";function u8(n){return typeof n=="symbol"||Wm(n)&&kw(n)==j5e}function Nee(n,e){for(var t=-1,i=n==null?0:n.length,s=Array(i);++t<i;)s[t]=e(n[t],t,n);return s}var xu=Array.isArray,X5e=1/0,mce=Wf?Wf.prototype:void 0,_ce=mce?mce.toString:void 0;function Nye(n){if(typeof n=="string")return n;if(xu(n))return Nee(n,Nye)+"";if(u8(n))return _ce?_ce.call(n):"";var e=n+"";return e=="0"&&1/n==-X5e?"-0":e}var Y5e=/\s/;function q5e(n){for(var e=n.length;e--&&Y5e.test(n.charAt(e)););return e}var J5e=/^\s+/;function Q5e(n){return n&&n.slice(0,q5e(n)+1).replace(J5e,"")}function Pu(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var vce=NaN,Z5e=/^[-+]0x[0-9a-f]+$/i,e8e=/^0b[01]+$/i,t8e=/^0o[0-7]+$/i,n8e=parseInt;function bce(n){if(typeof n=="number")return n;if(u8(n))return vce;if(Pu(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Pu(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Q5e(n);var t=e8e.test(n);return t||t8e.test(n)?n8e(n.slice(2),t?2:8):Z5e.test(n)?vce:+n}function Dee(n){return n}var i8e="[object AsyncFunction]",s8e="[object Function]",o8e="[object GeneratorFunction]",r8e="[object Proxy]";function $ee(n){if(!Pu(n))return!1;var e=kw(n);return e==s8e||e==o8e||e==i8e||e==r8e}var zz=hp["__core-js_shared__"],Tce=function(){var n=/[^.]+$/.exec(zz&&zz.keys&&zz.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function l8e(n){return!!Tce&&Tce in n}var a8e=Function.prototype,c8e=a8e.toString;function Aw(n){if(n!=null){try{return c8e.call(n)}catch{}try{return n+""}catch{}}return""}var u8e=/[\\^$.*+?()[\]{}|]/g,d8e=/^\[object .+?Constructor\]$/,h8e=Function.prototype,f8e=Object.prototype,g8e=h8e.toString,p8e=f8e.hasOwnProperty,m8e=RegExp("^"+g8e.call(p8e).replace(u8e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _8e(n){if(!Pu(n)||l8e(n))return!1;var e=$ee(n)?m8e:d8e;return e.test(Aw(n))}function v8e(n,e){return n==null?void 0:n[e]}function Nw(n,e){var t=v8e(n,e);return _8e(t)?t:void 0}var cX=Nw(hp,"WeakMap"),Cce=Object.create,b8e=function(){function n(){}return function(e){if(!Pu(e))return{};if(Cce)return Cce(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function T8e(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function C8e(){}function Dye(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}var y8e=800,E8e=16,S8e=Date.now;function w8e(n){var e=0,t=0;return function(){var i=S8e(),s=E8e-(i-t);if(t=i,s>0){if(++e>=y8e)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function I8e(n){return function(){return n}}var hW=function(){try{var n=Nw(Object,"defineProperty");return n({},"",{}),n}catch{}}(),L8e=hW?function(n,e){return hW(n,"toString",{configurable:!0,enumerable:!1,value:I8e(e),writable:!0})}:Dee,$ye=w8e(L8e);function O8e(n,e){for(var t=-1,i=n==null?0:n.length;++t<i&&e(n[t],t,n)!==!1;);return n}function xye(n,e,t,i){for(var s=n.length,o=t+(i?1:-1);i?o--:++o<s;)if(e(n[o],o,n))return o;return-1}function R8e(n){return n!==n}function M8e(n,e,t){for(var i=t-1,s=n.length;++i<s;)if(n[i]===e)return i;return-1}function k8e(n,e,t){return e===e?M8e(n,e,t):xye(n,R8e,t)}function A8e(n,e){var t=n==null?0:n.length;return!!t&&k8e(n,e,0)>-1}var N8e=9007199254740991,D8e=/^(?:0|[1-9]\d*)$/;function d8(n,e){var t=typeof n;return e=e??N8e,!!e&&(t=="number"||t!="symbol"&&D8e.test(n))&&n>-1&&n%1==0&&n<e}function xee(n,e,t){e=="__proto__"&&hW?hW(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function eF(n,e){return n===e||n!==n&&e!==e}var $8e=Object.prototype,x8e=$8e.hasOwnProperty;function Pee(n,e,t){var i=n[e];(!(x8e.call(n,e)&&eF(i,t))||t===void 0&&!(e in n))&&xee(n,e,t)}function eM(n,e,t,i){var s=!t;t||(t={});for(var o=-1,r=e.length;++o<r;){var a=e[o],c=void 0;c===void 0&&(c=n[a]),s?xee(t,a,c):Pee(t,a,c)}return t}var yce=Math.max;function Pye(n,e,t){return e=yce(e===void 0?n.length-1:e,0),function(){for(var i=arguments,s=-1,o=yce(i.length-e,0),r=Array(o);++s<o;)r[s]=i[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=i[s];return a[e]=t(r),T8e(n,this,a)}}function Fye(n,e){return $ye(Pye(n,e,Dee),n+"")}var P8e=9007199254740991;function Fee(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=P8e}function tM(n){return n!=null&&Fee(n.length)&&!$ee(n)}function F8e(n,e,t){if(!Pu(t))return!1;var i=typeof e;return(i=="number"?tM(t)&&d8(e,t.length):i=="string"&&e in t)?eF(t[e],n):!1}function B8e(n){return Fye(function(e,t){var i=-1,s=t.length,o=s>1?t[s-1]:void 0,r=s>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(s--,o):void 0,r&&F8e(t[0],t[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++i<s;){var a=t[i];a&&n(e,a,i,o)}return e})}var H8e=Object.prototype;function Bee(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||H8e;return n===t}function V8e(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var U8e="[object Arguments]";function Ece(n){return Wm(n)&&kw(n)==U8e}var Bye=Object.prototype,W8e=Bye.hasOwnProperty,G8e=Bye.propertyIsEnumerable,Q$=Ece(function(){return arguments}())?Ece:function(n){return Wm(n)&&W8e.call(n,"callee")&&!G8e.call(n,"callee")};function z8e(){return!1}var Hye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sce=Hye&&typeof module=="object"&&module&&!module.nodeType&&module,K8e=Sce&&Sce.exports===Hye,wce=K8e?hp.Buffer:void 0,j8e=wce?wce.isBuffer:void 0,Z$=j8e||z8e,X8e="[object Arguments]",Y8e="[object Array]",q8e="[object Boolean]",J8e="[object Date]",Q8e="[object Error]",Z8e="[object Function]",e6e="[object Map]",t6e="[object Number]",n6e="[object Object]",i6e="[object RegExp]",s6e="[object Set]",o6e="[object String]",r6e="[object WeakMap]",l6e="[object ArrayBuffer]",a6e="[object DataView]",c6e="[object Float32Array]",u6e="[object Float64Array]",d6e="[object Int8Array]",h6e="[object Int16Array]",f6e="[object Int32Array]",g6e="[object Uint8Array]",p6e="[object Uint8ClampedArray]",m6e="[object Uint16Array]",_6e="[object Uint32Array]",Sr={};Sr[c6e]=Sr[u6e]=Sr[d6e]=Sr[h6e]=Sr[f6e]=Sr[g6e]=Sr[p6e]=Sr[m6e]=Sr[_6e]=!0;Sr[X8e]=Sr[Y8e]=Sr[l6e]=Sr[q8e]=Sr[a6e]=Sr[J8e]=Sr[Q8e]=Sr[Z8e]=Sr[e6e]=Sr[t6e]=Sr[n6e]=Sr[i6e]=Sr[s6e]=Sr[o6e]=Sr[r6e]=!1;function v6e(n){return Wm(n)&&Fee(n.length)&&!!Sr[kw(n)]}function Hee(n){return function(e){return n(e)}}var Vye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xD=Vye&&typeof module=="object"&&module&&!module.nodeType&&module,b6e=xD&&xD.exports===Vye,Kz=b6e&&kye.process,jO=function(){try{var n=xD&&xD.require&&xD.require("util").types;return n||Kz&&Kz.binding&&Kz.binding("util")}catch{}}(),Ice=jO&&jO.isTypedArray,Vee=Ice?Hee(Ice):v6e,T6e=Object.prototype,C6e=T6e.hasOwnProperty;function Uye(n,e){var t=xu(n),i=!t&&Q$(n),s=!t&&!i&&Z$(n),o=!t&&!i&&!s&&Vee(n),r=t||i||s||o,a=r?V8e(n.length,String):[],c=a.length;for(var u in n)(e||C6e.call(n,u))&&!(r&&(u=="length"||s&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||d8(u,c)))&&a.push(u);return a}function Wye(n,e){return function(t){return n(e(t))}}var y6e=Wye(Object.keys,Object),E6e=Object.prototype,S6e=E6e.hasOwnProperty;function w6e(n){if(!Bee(n))return y6e(n);var e=[];for(var t in Object(n))S6e.call(n,t)&&t!="constructor"&&e.push(t);return e}function tF(n){return tM(n)?Uye(n):w6e(n)}function I6e(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var L6e=Object.prototype,O6e=L6e.hasOwnProperty;function R6e(n){if(!Pu(n))return I6e(n);var e=Bee(n),t=[];for(var i in n)i=="constructor"&&(e||!O6e.call(n,i))||t.push(i);return t}function nF(n){return tM(n)?Uye(n,!0):R6e(n)}var M6e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k6e=/^\w*$/;function Uee(n,e){if(xu(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||u8(n)?!0:k6e.test(n)||!M6e.test(n)||e!=null&&n in Object(e)}var ex=Nw(Object,"create");function A6e(){this.__data__=ex?ex(null):{},this.size=0}function N6e(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var D6e="__lodash_hash_undefined__",$6e=Object.prototype,x6e=$6e.hasOwnProperty;function P6e(n){var e=this.__data__;if(ex){var t=e[n];return t===D6e?void 0:t}return x6e.call(e,n)?e[n]:void 0}var F6e=Object.prototype,B6e=F6e.hasOwnProperty;function H6e(n){var e=this.__data__;return ex?e[n]!==void 0:B6e.call(e,n)}var V6e="__lodash_hash_undefined__";function U6e(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=ex&&e===void 0?V6e:e,this}function P0(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}P0.prototype.clear=A6e;P0.prototype.delete=N6e;P0.prototype.get=P6e;P0.prototype.has=H6e;P0.prototype.set=U6e;function W6e(){this.__data__=[],this.size=0}function h8(n,e){for(var t=n.length;t--;)if(eF(n[t][0],e))return t;return-1}var G6e=Array.prototype,z6e=G6e.splice;function K6e(n){var e=this.__data__,t=h8(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():z6e.call(e,t,1),--this.size,!0}function j6e(n){var e=this.__data__,t=h8(e,n);return t<0?void 0:e[t][1]}function X6e(n){return h8(this.__data__,n)>-1}function Y6e(n,e){var t=this.__data__,i=h8(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function wb(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}wb.prototype.clear=W6e;wb.prototype.delete=K6e;wb.prototype.get=j6e;wb.prototype.has=X6e;wb.prototype.set=Y6e;var tx=Nw(hp,"Map");function q6e(){this.size=0,this.__data__={hash:new P0,map:new(tx||wb),string:new P0}}function J6e(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function f8(n,e){var t=n.__data__;return J6e(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Q6e(n){var e=f8(this,n).delete(n);return this.size-=e?1:0,e}function Z6e(n){return f8(this,n).get(n)}function eGe(n){return f8(this,n).has(n)}function tGe(n,e){var t=f8(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function Ib(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}Ib.prototype.clear=q6e;Ib.prototype.delete=Q6e;Ib.prototype.get=Z6e;Ib.prototype.has=eGe;Ib.prototype.set=tGe;var nGe="Expected a function";function g8(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(nGe);var t=function(){var i=arguments,s=e?e.apply(this,i):i[0],o=t.cache;if(o.has(s))return o.get(s);var r=n.apply(this,i);return t.cache=o.set(s,r)||o,r};return t.cache=new(g8.Cache||Ib),t}g8.Cache=Ib;var iGe=500;function sGe(n){var e=g8(n,function(i){return t.size===iGe&&t.clear(),i}),t=e.cache;return e}var oGe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rGe=/\\(\\)?/g,lGe=sGe(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(oGe,function(t,i,s,o){e.push(s?o.replace(rGe,"$1"):i||t)}),e});function aGe(n){return n==null?"":Nye(n)}function nM(n,e){return xu(n)?n:Uee(n,e)?[n]:lGe(aGe(n))}var cGe=1/0;function iM(n){if(typeof n=="string"||u8(n))return n;var e=n+"";return e=="0"&&1/n==-cGe?"-0":e}function p8(n,e){e=nM(e,n);for(var t=0,i=e.length;n!=null&&t<i;)n=n[iM(e[t++])];return t&&t==i?n:void 0}function Fr(n,e,t){var i=n==null?void 0:p8(n,e);return i===void 0?t:i}function Wee(n,e){for(var t=-1,i=e.length,s=n.length;++t<i;)n[s+t]=e[t];return n}var Lce=Wf?Wf.isConcatSpreadable:void 0;function uGe(n){return xu(n)||Q$(n)||!!(Lce&&n&&n[Lce])}function iF(n,e,t,i,s){var o=-1,r=n.length;for(t||(t=uGe),s||(s=[]);++o<r;){var a=n[o];e>0&&t(a)?e>1?iF(a,e-1,t,i,s):Wee(s,a):i||(s[s.length]=a)}return s}function Gye(n){var e=n==null?0:n.length;return e?iF(n,1):[]}function zye(n){return $ye(Pye(n,void 0,Gye),n+"")}var Gee=Wye(Object.getPrototypeOf,Object),dGe="[object Object]",hGe=Function.prototype,fGe=Object.prototype,Kye=hGe.toString,gGe=fGe.hasOwnProperty,pGe=Kye.call(Object);function jye(n){if(!Wm(n)||kw(n)!=dGe)return!1;var e=Gee(n);if(e===null)return!0;var t=gGe.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Kye.call(t)==pGe}function mGe(n,e,t){var i=-1,s=n.length;e<0&&(e=-e>s?0:s+e),t=t>s?s:t,t<0&&(t+=s),s=e>t?0:t-e>>>0,e>>>=0;for(var o=Array(s);++i<s;)o[i]=n[i+e];return o}function Gc(){if(!arguments.length)return[];var n=arguments[0];return xu(n)?n:[n]}function _Ge(){this.__data__=new wb,this.size=0}function vGe(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function bGe(n){return this.__data__.get(n)}function TGe(n){return this.__data__.has(n)}var CGe=200;function yGe(n,e){var t=this.__data__;if(t instanceof wb){var i=t.__data__;if(!tx||i.length<CGe-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new Ib(i)}return t.set(n,e),this.size=t.size,this}function Vg(n){var e=this.__data__=new wb(n);this.size=e.size}Vg.prototype.clear=_Ge;Vg.prototype.delete=vGe;Vg.prototype.get=bGe;Vg.prototype.has=TGe;Vg.prototype.set=yGe;function EGe(n,e){return n&&eM(e,tF(e),n)}function SGe(n,e){return n&&eM(e,nF(e),n)}var Xye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oce=Xye&&typeof module=="object"&&module&&!module.nodeType&&module,wGe=Oce&&Oce.exports===Xye,Rce=wGe?hp.Buffer:void 0,Mce=Rce?Rce.allocUnsafe:void 0;function Yye(n,e){if(e)return n.slice();var t=n.length,i=Mce?Mce(t):new n.constructor(t);return n.copy(i),i}function IGe(n,e){for(var t=-1,i=n==null?0:n.length,s=0,o=[];++t<i;){var r=n[t];e(r,t,n)&&(o[s++]=r)}return o}function qye(){return[]}var LGe=Object.prototype,OGe=LGe.propertyIsEnumerable,kce=Object.getOwnPropertySymbols,zee=kce?function(n){return n==null?[]:(n=Object(n),IGe(kce(n),function(e){return OGe.call(n,e)}))}:qye;function RGe(n,e){return eM(n,zee(n),e)}var MGe=Object.getOwnPropertySymbols,Jye=MGe?function(n){for(var e=[];n;)Wee(e,zee(n)),n=Gee(n);return e}:qye;function kGe(n,e){return eM(n,Jye(n),e)}function Qye(n,e,t){var i=e(n);return xu(n)?i:Wee(i,t(n))}function uX(n){return Qye(n,tF,zee)}function Zye(n){return Qye(n,nF,Jye)}var dX=Nw(hp,"DataView"),hX=Nw(hp,"Promise"),aO=Nw(hp,"Set"),Ace="[object Map]",AGe="[object Object]",Nce="[object Promise]",Dce="[object Set]",$ce="[object WeakMap]",xce="[object DataView]",NGe=Aw(dX),DGe=Aw(tx),$Ge=Aw(hX),xGe=Aw(aO),PGe=Aw(cX),Rg=kw;(dX&&Rg(new dX(new ArrayBuffer(1)))!=xce||tx&&Rg(new tx)!=Ace||hX&&Rg(hX.resolve())!=Nce||aO&&Rg(new aO)!=Dce||cX&&Rg(new cX)!=$ce)&&(Rg=function(n){var e=kw(n),t=e==AGe?n.constructor:void 0,i=t?Aw(t):"";if(i)switch(i){case NGe:return xce;case DGe:return Ace;case $Ge:return Nce;case xGe:return Dce;case PGe:return $ce}return e});var FGe=Object.prototype,BGe=FGe.hasOwnProperty;function HGe(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&BGe.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var fW=hp.Uint8Array;function Kee(n){var e=new n.constructor(n.byteLength);return new fW(e).set(new fW(n)),e}function VGe(n,e){var t=e?Kee(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var UGe=/\w*$/;function WGe(n){var e=new n.constructor(n.source,UGe.exec(n));return e.lastIndex=n.lastIndex,e}var Pce=Wf?Wf.prototype:void 0,Fce=Pce?Pce.valueOf:void 0;function GGe(n){return Fce?Object(Fce.call(n)):{}}function eEe(n,e){var t=e?Kee(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var zGe="[object Boolean]",KGe="[object Date]",jGe="[object Map]",XGe="[object Number]",YGe="[object RegExp]",qGe="[object Set]",JGe="[object String]",QGe="[object Symbol]",ZGe="[object ArrayBuffer]",eze="[object DataView]",tze="[object Float32Array]",nze="[object Float64Array]",ize="[object Int8Array]",sze="[object Int16Array]",oze="[object Int32Array]",rze="[object Uint8Array]",lze="[object Uint8ClampedArray]",aze="[object Uint16Array]",cze="[object Uint32Array]";function uze(n,e,t){var i=n.constructor;switch(e){case ZGe:return Kee(n);case zGe:case KGe:return new i(+n);case eze:return VGe(n,t);case tze:case nze:case ize:case sze:case oze:case rze:case lze:case aze:case cze:return eEe(n,t);case jGe:return new i;case XGe:case JGe:return new i(n);case YGe:return WGe(n);case qGe:return new i;case QGe:return GGe(n)}}function tEe(n){return typeof n.constructor=="function"&&!Bee(n)?b8e(Gee(n)):{}}var dze="[object Map]";function hze(n){return Wm(n)&&Rg(n)==dze}var Bce=jO&&jO.isMap,fze=Bce?Hee(Bce):hze,gze="[object Set]";function pze(n){return Wm(n)&&Rg(n)==gze}var Hce=jO&&jO.isSet,mze=Hce?Hee(Hce):pze,_ze=1,vze=2,bze=4,nEe="[object Arguments]",Tze="[object Array]",Cze="[object Boolean]",yze="[object Date]",Eze="[object Error]",iEe="[object Function]",Sze="[object GeneratorFunction]",wze="[object Map]",Ize="[object Number]",sEe="[object Object]",Lze="[object RegExp]",Oze="[object Set]",Rze="[object String]",Mze="[object Symbol]",kze="[object WeakMap]",Aze="[object ArrayBuffer]",Nze="[object DataView]",Dze="[object Float32Array]",$ze="[object Float64Array]",xze="[object Int8Array]",Pze="[object Int16Array]",Fze="[object Int32Array]",Bze="[object Uint8Array]",Hze="[object Uint8ClampedArray]",Vze="[object Uint16Array]",Uze="[object Uint32Array]",ur={};ur[nEe]=ur[Tze]=ur[Aze]=ur[Nze]=ur[Cze]=ur[yze]=ur[Dze]=ur[$ze]=ur[xze]=ur[Pze]=ur[Fze]=ur[wze]=ur[Ize]=ur[sEe]=ur[Lze]=ur[Oze]=ur[Rze]=ur[Mze]=ur[Bze]=ur[Hze]=ur[Vze]=ur[Uze]=!0;ur[Eze]=ur[iEe]=ur[kze]=!1;function cO(n,e,t,i,s,o){var r,a=e&_ze,c=e&vze,u=e&bze;if(t&&(r=s?t(n,i,s,o):t(n)),r!==void 0)return r;if(!Pu(n))return n;var d=xu(n);if(d){if(r=HGe(n),!a)return Dye(n,r)}else{var f=Rg(n),g=f==iEe||f==Sze;if(Z$(n))return Yye(n,a);if(f==sEe||f==nEe||g&&!s){if(r=c||g?{}:tEe(n),!a)return c?kGe(n,SGe(r,n)):RGe(n,EGe(r,n))}else{if(!ur[f])return s?n:{};r=uze(n,f,a)}}o||(o=new Vg);var p=o.get(n);if(p)return p;o.set(n,r),mze(n)?n.forEach(function(C){r.add(cO(C,e,t,C,n,o))}):fze(n)&&n.forEach(function(C,y){r.set(y,cO(C,e,t,y,n,o))});var _=u?c?Zye:uX:c?nF:tF,v=d?void 0:_(n);return O8e(v||n,function(C,y){v&&(y=C,C=n[y]),Pee(r,y,cO(C,e,t,y,n,o))}),r}var Wze=4;function Vce(n){return cO(n,Wze)}var Gze=1,zze=4;function gW(n){return cO(n,Gze|zze)}var Kze="__lodash_hash_undefined__";function jze(n){return this.__data__.set(n,Kze),this}function Xze(n){return this.__data__.has(n)}function nx(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Ib;++e<t;)this.add(n[e])}nx.prototype.add=nx.prototype.push=jze;nx.prototype.has=Xze;function Yze(n,e){for(var t=-1,i=n==null?0:n.length;++t<i;)if(e(n[t],t,n))return!0;return!1}function oEe(n,e){return n.has(e)}var qze=1,Jze=2;function rEe(n,e,t,i,s,o){var r=t&qze,a=n.length,c=e.length;if(a!=c&&!(r&&c>a))return!1;var u=o.get(n),d=o.get(e);if(u&&d)return u==e&&d==n;var f=-1,g=!0,p=t&Jze?new nx:void 0;for(o.set(n,e),o.set(e,n);++f<a;){var _=n[f],v=e[f];if(i)var C=r?i(v,_,f,e,n,o):i(_,v,f,n,e,o);if(C!==void 0){if(C)continue;g=!1;break}if(p){if(!Yze(e,function(y,w){if(!oEe(p,w)&&(_===y||s(_,y,t,i,o)))return p.push(w)})){g=!1;break}}else if(!(_===v||s(_,v,t,i,o))){g=!1;break}}return o.delete(n),o.delete(e),g}function Qze(n){var e=-1,t=Array(n.size);return n.forEach(function(i,s){t[++e]=[s,i]}),t}function jee(n){var e=-1,t=Array(n.size);return n.forEach(function(i){t[++e]=i}),t}var Zze=1,e9e=2,t9e="[object Boolean]",n9e="[object Date]",i9e="[object Error]",s9e="[object Map]",o9e="[object Number]",r9e="[object RegExp]",l9e="[object Set]",a9e="[object String]",c9e="[object Symbol]",u9e="[object ArrayBuffer]",d9e="[object DataView]",Uce=Wf?Wf.prototype:void 0,jz=Uce?Uce.valueOf:void 0;function h9e(n,e,t,i,s,o,r){switch(t){case d9e:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case u9e:return!(n.byteLength!=e.byteLength||!o(new fW(n),new fW(e)));case t9e:case n9e:case o9e:return eF(+n,+e);case i9e:return n.name==e.name&&n.message==e.message;case r9e:case a9e:return n==e+"";case s9e:var a=Qze;case l9e:var c=i&Zze;if(a||(a=jee),n.size!=e.size&&!c)return!1;var u=r.get(n);if(u)return u==e;i|=e9e,r.set(n,e);var d=rEe(a(n),a(e),i,s,o,r);return r.delete(n),d;case c9e:if(jz)return jz.call(n)==jz.call(e)}return!1}var f9e=1,g9e=Object.prototype,p9e=g9e.hasOwnProperty;function m9e(n,e,t,i,s,o){var r=t&f9e,a=uX(n),c=a.length,u=uX(e),d=u.length;if(c!=d&&!r)return!1;for(var f=c;f--;){var g=a[f];if(!(r?g in e:p9e.call(e,g)))return!1}var p=o.get(n),_=o.get(e);if(p&&_)return p==e&&_==n;var v=!0;o.set(n,e),o.set(e,n);for(var C=r;++f<c;){g=a[f];var y=n[g],w=e[g];if(i)var I=r?i(w,y,g,e,n,o):i(y,w,g,n,e,o);if(!(I===void 0?y===w||s(y,w,t,i,o):I)){v=!1;break}C||(C=g=="constructor")}if(v&&!C){var L=n.constructor,O=e.constructor;L!=O&&"constructor"in n&&"constructor"in e&&!(typeof L=="function"&&L instanceof L&&typeof O=="function"&&O instanceof O)&&(v=!1)}return o.delete(n),o.delete(e),v}var _9e=1,Wce="[object Arguments]",Gce="[object Array]",TH="[object Object]",v9e=Object.prototype,zce=v9e.hasOwnProperty;function b9e(n,e,t,i,s,o){var r=xu(n),a=xu(e),c=r?Gce:Rg(n),u=a?Gce:Rg(e);c=c==Wce?TH:c,u=u==Wce?TH:u;var d=c==TH,f=u==TH,g=c==u;if(g&&Z$(n)){if(!Z$(e))return!1;r=!0,d=!1}if(g&&!d)return o||(o=new Vg),r||Vee(n)?rEe(n,e,t,i,s,o):h9e(n,e,c,t,i,s,o);if(!(t&_9e)){var p=d&&zce.call(n,"__wrapped__"),_=f&&zce.call(e,"__wrapped__");if(p||_){var v=p?n.value():n,C=_?e.value():e;return o||(o=new Vg),s(v,C,t,i,o)}}return g?(o||(o=new Vg),m9e(n,e,t,i,s,o)):!1}function m8(n,e,t,i,s){return n===e?!0:n==null||e==null||!Wm(n)&&!Wm(e)?n!==n&&e!==e:b9e(n,e,t,i,m8,s)}var T9e=1,C9e=2;function y9e(n,e,t,i){var s=t.length,o=s;if(n==null)return!o;for(n=Object(n);s--;){var r=t[s];if(r[2]?r[1]!==n[r[0]]:!(r[0]in n))return!1}for(;++s<o;){r=t[s];var a=r[0],c=n[a],u=r[1];if(r[2]){if(c===void 0&&!(a in n))return!1}else{var d=new Vg,f;if(!(f===void 0?m8(u,c,T9e|C9e,i,d):f))return!1}}return!0}function lEe(n){return n===n&&!Pu(n)}function E9e(n){for(var e=tF(n),t=e.length;t--;){var i=e[t],s=n[i];e[t]=[i,s,lEe(s)]}return e}function aEe(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function S9e(n){var e=E9e(n);return e.length==1&&e[0][2]?aEe(e[0][0],e[0][1]):function(t){return t===n||y9e(t,n,e)}}function w9e(n,e){return n!=null&&e in Object(n)}function I9e(n,e,t){e=nM(e,n);for(var i=-1,s=e.length,o=!1;++i<s;){var r=iM(e[i]);if(!(o=n!=null&&t(n,r)))break;n=n[r]}return o||++i!=s?o:(s=n==null?0:n.length,!!s&&Fee(s)&&d8(r,s)&&(xu(n)||Q$(n)))}function cEe(n,e){return n!=null&&I9e(n,e,w9e)}var L9e=1,O9e=2;function R9e(n,e){return Uee(n)&&lEe(e)?aEe(iM(n),e):function(t){var i=Fr(t,n);return i===void 0&&i===e?cEe(t,n):m8(e,i,L9e|O9e)}}function M9e(n){return function(e){return e==null?void 0:e[n]}}function k9e(n){return function(e){return p8(e,n)}}function A9e(n){return Uee(n)?M9e(iM(n)):k9e(n)}function uEe(n){return typeof n=="function"?n:n==null?Dee:typeof n=="object"?xu(n)?R9e(n[0],n[1]):S9e(n):A9e(n)}function N9e(n){return function(e,t,i){for(var s=-1,o=Object(e),r=i(e),a=r.length;a--;){var c=r[++s];if(t(o[c],c,o)===!1)break}return e}}var dEe=N9e();function D9e(n,e){return n&&dEe(n,e,tF)}function $9e(n,e){return function(t,i){if(t==null)return t;if(!tM(t))return n(t,i);for(var s=t.length,o=-1,r=Object(t);++o<s&&i(r[o],o,r)!==!1;);return t}}var x9e=$9e(D9e),Xz=function(){return hp.Date.now()},P9e="Expected a function",F9e=Math.max,B9e=Math.min;function Md(n,e,t){var i,s,o,r,a,c,u=0,d=!1,f=!1,g=!0;if(typeof n!="function")throw new TypeError(P9e);e=bce(e)||0,Pu(t)&&(d=!!t.leading,f="maxWait"in t,o=f?F9e(bce(t.maxWait)||0,e):o,g="trailing"in t?!!t.trailing:g);function p(A){var N=i,D=s;return i=s=void 0,u=A,r=n.apply(D,N),r}function _(A){return u=A,a=setTimeout(y,e),d?p(A):r}function v(A){var N=A-c,D=A-u,P=e-N;return f?B9e(P,o-D):P}function C(A){var N=A-c,D=A-u;return c===void 0||N>=e||N<0||f&&D>=o}function y(){var A=Xz();if(C(A))return w(A);a=setTimeout(y,v(A))}function w(A){return a=void 0,g&&i?p(A):(i=s=void 0,r)}function I(){a!==void 0&&clearTimeout(a),u=0,i=c=s=a=void 0}function L(){return a===void 0?r:w(Xz())}function O(){var A=Xz(),N=C(A);if(i=arguments,s=this,c=A,N){if(a===void 0)return _(c);if(f)return clearTimeout(a),a=setTimeout(y,e),p(c)}return a===void 0&&(a=setTimeout(y,e)),r}return O.cancel=I,O.flush=L,O}function fX(n,e,t){(t!==void 0&&!eF(n[e],t)||t===void 0&&!(e in n))&&xee(n,e,t)}function hEe(n){return Wm(n)&&tM(n)}function gX(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function H9e(n){return eM(n,nF(n))}function V9e(n,e,t,i,s,o,r){var a=gX(n,t),c=gX(e,t),u=r.get(c);if(u){fX(n,t,u);return}var d=o?o(a,c,t+"",n,e,r):void 0,f=d===void 0;if(f){var g=xu(c),p=!g&&Z$(c),_=!g&&!p&&Vee(c);d=c,g||p||_?xu(a)?d=a:hEe(a)?d=Dye(a):p?(f=!1,d=Yye(c,!0)):_?(f=!1,d=eEe(c,!0)):d=[]:jye(c)||Q$(c)?(d=a,Q$(a)?d=H9e(a):(!Pu(a)||$ee(a))&&(d=tEe(c))):f=!1}f&&(r.set(c,d),s(d,c,i,o,r),r.delete(c)),fX(n,t,d)}function fEe(n,e,t,i,s){n!==e&&dEe(e,function(o,r){if(s||(s=new Vg),Pu(o))V9e(n,e,r,t,fEe,i,s);else{var a=i?i(gX(n,r),o,r+"",n,e,s):void 0;a===void 0&&(a=o),fX(n,r,a)}},nF)}function U9e(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}function gEe(n,e,t){var i=n==null?0:n.length;if(!i)return-1;var s=i-1;return xye(n,uEe(e),s,!0)}function W9e(n,e){var t=-1,i=tM(n)?Array(n.length):[];return x9e(n,function(s,o,r){i[++t]=e(s,o,r)}),i}function G9e(n,e){var t=xu(n)?Nee:W9e;return t(n,uEe(e))}function z9e(n,e){return iF(G9e(n,e),1)}var K9e=1/0;function j9e(n){var e=n==null?0:n.length;return e?iF(n,K9e):[]}function ix(n){for(var e=-1,t=n==null?0:n.length,i={};++e<t;){var s=n[e];i[s[0]]=s[1]}return i}function X9e(n,e){return e.length<2?n:p8(n,mGe(e,0,-1))}function Ha(n,e){return m8(n,e)}function Ul(n){return n==null}function pEe(n){return n===void 0}var mEe=B8e(function(n,e,t){fEe(n,e,t)});function Y9e(n,e){return e=nM(e,n),n=X9e(n,e),n==null||delete n[iM(U9e(e))]}function q9e(n){return jye(n)?void 0:n}var J9e=1,Q9e=2,Z9e=4,e7e=zye(function(n,e){var t={};if(n==null)return t;var i=!1;e=Nee(e,function(o){return o=nM(o,n),i||(i=o.length>1),o}),eM(n,Zye(n),t),i&&(t=cO(t,J9e|Q9e|Z9e,q9e));for(var s=e.length;s--;)Y9e(t,e[s]);return t});function _Ee(n,e,t,i){if(!Pu(n))return n;e=nM(e,n);for(var s=-1,o=e.length,r=o-1,a=n;a!=null&&++s<o;){var c=iM(e[s]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(s!=r){var d=a[c];u=void 0,u===void 0&&(u=Pu(d)?d:d8(e[s+1])?[]:{})}Pee(a,c,u),a=a[c]}return n}function t7e(n,e,t){for(var i=-1,s=e.length,o={};++i<s;){var r=e[i],a=p8(n,r);t(a,r)&&_Ee(o,nM(r,n),a)}return o}function n7e(n,e){return t7e(n,e,function(t,i){return cEe(n,i)})}var $g=zye(function(n,e){return n==null?{}:n7e(n,e)});function i7e(n,e,t){return n==null?n:_Ee(n,e,t)}var s7e="Expected a function";function l0(n,e,t){var i=!0,s=!0;if(typeof n!="function")throw new TypeError(s7e);return Pu(t)&&(i="leading"in t?!!t.leading:i,s="trailing"in t?!!t.trailing:s),Md(n,e,{leading:i,maxWait:e,trailing:s})}var o7e=1/0,r7e=aO&&1/jee(new aO([,-0]))[1]==o7e?function(n){return new aO(n)}:C8e,l7e=200;function a7e(n,e,t){var i=-1,s=A8e,o=n.length,r=!0,a=[],c=a;if(o>=l7e){var u=r7e(n);if(u)return jee(u);r=!1,s=oEe,c=new nx}else c=a;e:for(;++i<o;){var d=n[i],f=d;if(d=d!==0?d:0,r&&f===f){for(var g=c.length;g--;)if(c[g]===f)continue e;a.push(d)}else s(c,f,t)||(c!==a&&c.push(f),a.push(d))}return a}var Yz=Fye(function(n){return a7e(iF(n,1,hEe,!0))});const ys=n=>n===void 0,Us=n=>typeof n=="boolean",gn=n=>typeof n=="number",oh=n=>!n&&n!==0||yt(n)&&n.length===0||si(n)&&!Object.keys(n).length,mh=n=>typeof Element>"u"?!1:n instanceof Element,F0=n=>Ul(n),c7e=n=>sn(n)?!Number.isNaN(Number(n)):!1,_8=n=>n===window;var u7e=Object.defineProperty,d7e=Object.defineProperties,h7e=Object.getOwnPropertyDescriptors,Kce=Object.getOwnPropertySymbols,f7e=Object.prototype.hasOwnProperty,g7e=Object.prototype.propertyIsEnumerable,jce=(n,e,t)=>e in n?u7e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,p7e=(n,e)=>{for(var t in e||(e={}))f7e.call(e,t)&&jce(n,t,e[t]);if(Kce)for(var t of Kce(e))g7e.call(e,t)&&jce(n,t,e[t]);return n},m7e=(n,e)=>d7e(n,h7e(e));function pX(n,e){var t;const i=us();return Sl(()=>{i.value=n()},m7e(p7e({},e),{flush:(t=void 0)!=null?t:"sync"})),XR(i)}var Xce;const Si=typeof window<"u",_7e=n=>typeof n<"u",mX=n=>typeof n=="function",v7e=n=>typeof n=="string",XO=()=>{},_X=Si&&((Xce=window==null?void 0:window.navigator)==null?void 0:Xce.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function JC(n){return typeof n=="function"?n():T(n)}function vEe(n,e){function t(...i){return new Promise((s,o)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(o)})}return t}function b7e(n,e={}){let t,i,s=XO;const o=a=>{clearTimeout(a),s(),s=XO};return a=>{const c=JC(n),u=JC(e.maxWait);return t&&o(t),c<=0||u!==void 0&&u<=0?(i&&(o(i),i=null),Promise.resolve(a())):new Promise((d,f)=>{s=e.rejectOnCancel?f:d,u&&!i&&(i=setTimeout(()=>{t&&o(t),i=null,d(a())},u)),t=setTimeout(()=>{i&&o(i),i=null,d(a())},c)})}}function T7e(n,e=!0,t=!0,i=!1){let s=0,o,r=!0,a=XO,c;const u=()=>{o&&(clearTimeout(o),o=void 0,a(),a=XO)};return f=>{const g=JC(n),p=Date.now()-s,_=()=>c=f();return u(),g<=0?(s=Date.now(),_()):(p>g&&(t||!r)?(s=Date.now(),_()):e&&(c=new Promise((v,C)=>{a=i?C:v,o=setTimeout(()=>{s=Date.now(),r=!0,v(_()),u()},Math.max(0,g-p))})),!t&&!o&&(o=setTimeout(()=>r=!0,g)),r=!1,c)}}function C7e(n){return n}function y7e(n,e){let t,i,s;const o=te(!0),r=()=>{o.value=!0,s()};ht(n,r,{flush:"sync"});const a=mX(e)?e:e.get,c=mX(e)?void 0:e.set,u=tDe((d,f)=>(i=d,s=f,{get(){return o.value&&(t=a(),o.value=!1),i(),t},set(g){c==null||c(g)}}));return Object.isExtensible(u)&&(u.trigger=r),u}function sF(n){return TZ()?(CZ(n),!0):!1}function E7e(n,e=200,t={}){return vEe(b7e(e,t),n)}function S7e(n,e=200,t={}){const i=te(n.value),s=E7e(()=>{i.value=n.value},e,t);return ht(n,()=>s()),i}function bEe(n,e=200,t=!1,i=!0,s=!1){return vEe(T7e(e,t,i,s),n)}function Xee(n,e=!0){Qn()?$n(n):e?n():cn(n)}function B0(n,e,t={}){const{immediate:i=!0}=t,s=te(!1);let o=null;function r(){o&&(clearTimeout(o),o=null)}function a(){s.value=!1,r()}function c(...u){r(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=null,n(...u)},JC(e))}return i&&(s.value=!0,Si&&c()),sF(a),{isPending:XR(s),start:c,stop:a}}function Ou(n){var e;const t=JC(n);return(e=t==null?void 0:t.$el)!=null?e:t}const Dy=Si?window:void 0,w7e=Si?window.document:void 0;function Es(...n){let e,t,i,s;if(v7e(n[0])||Array.isArray(n[0])?([t,i,s]=n,e=Dy):[e,t,i,s]=n,!e)return XO;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const o=[],r=()=>{o.forEach(d=>d()),o.length=0},a=(d,f,g,p)=>(d.addEventListener(f,g,p),()=>d.removeEventListener(f,g,p)),c=ht(()=>[Ou(e),JC(s)],([d,f])=>{r(),d&&o.push(...t.flatMap(g=>i.map(p=>a(d,g,p,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),r()};return sF(u),u}let Yce=!1;function Yee(n,e,t={}){const{window:i=Dy,ignore:s=[],capture:o=!0,detectIframe:r=!1}=t;if(!i)return;_X&&!Yce&&(Yce=!0,Array.from(i.document.body.children).forEach(g=>g.addEventListener("click",XO)));let a=!0;const c=g=>s.some(p=>{if(typeof p=="string")return Array.from(i.document.querySelectorAll(p)).some(_=>_===g.target||g.composedPath().includes(_));{const _=Ou(p);return _&&(g.target===_||g.composedPath().includes(_))}}),d=[Es(i,"click",g=>{const p=Ou(n);if(!(!p||p===g.target||g.composedPath().includes(p))){if(g.detail===0&&(a=!c(g)),!a){a=!0;return}e(g)}},{passive:!0,capture:o}),Es(i,"pointerdown",g=>{const p=Ou(n);p&&(a=!g.composedPath().includes(p)&&!c(g))},{passive:!0}),r&&Es(i,"blur",g=>{var p;const _=Ou(n);((p=i.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(_!=null&&_.contains(i.document.activeElement))&&e(g)})].filter(Boolean);return()=>d.forEach(g=>g())}function I7e(n={}){var e;const{window:t=Dy}=n,i=(e=n.document)!=null?e:t==null?void 0:t.document,s=y7e(()=>null,()=>i==null?void 0:i.activeElement);return t&&(Es(t,"blur",o=>{o.relatedTarget===null&&s.trigger()},!0),Es(t,"focus",s.trigger,!0)),s}function TEe(n,e=!1){const t=te(),i=()=>t.value=!!n();return i(),Xee(i,e),t}function L7e(n){return JSON.parse(JSON.stringify(n))}const qce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Jce="__vueuse_ssr_handlers__";qce[Jce]=qce[Jce]||{};function O7e(n,e,{window:t=Dy,initialValue:i=""}={}){const s=te(i),o=W(()=>{var r;return Ou(e)||((r=t==null?void 0:t.document)==null?void 0:r.documentElement)});return ht([o,()=>JC(n)],([r,a])=>{var c;if(r&&t){const u=(c=t.getComputedStyle(r).getPropertyValue(a))==null?void 0:c.trim();s.value=u||i}},{immediate:!0}),ht(s,r=>{var a;(a=o.value)!=null&&a.style&&o.value.style.setProperty(JC(n),r)}),s}function R7e({document:n=w7e}={}){if(!n)return te("visible");const e=te(n.visibilityState);return Es(n,"visibilitychange",()=>{e.value=n.visibilityState}),e}var Qce=Object.getOwnPropertySymbols,M7e=Object.prototype.hasOwnProperty,k7e=Object.prototype.propertyIsEnumerable,A7e=(n,e)=>{var t={};for(var i in n)M7e.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&Qce)for(var i of Qce(n))e.indexOf(i)<0&&k7e.call(n,i)&&(t[i]=n[i]);return t};function wo(n,e,t={}){const i=t,{window:s=Dy}=i,o=A7e(i,["window"]);let r;const a=TEe(()=>s&&"ResizeObserver"in s),c=()=>{r&&(r.disconnect(),r=void 0)},u=ht(()=>Ou(n),f=>{c(),a.value&&s&&f&&(r=new ResizeObserver(e),r.observe(f,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return sF(d),{isSupported:a,stop:d}}function Zce(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0}=e,r=te(0),a=te(0),c=te(0),u=te(0),d=te(0),f=te(0),g=te(0),p=te(0);function _(){const v=Ou(n);if(!v){t&&(r.value=0,a.value=0,c.value=0,u.value=0,d.value=0,f.value=0,g.value=0,p.value=0);return}const C=v.getBoundingClientRect();r.value=C.height,a.value=C.bottom,c.value=C.left,u.value=C.right,d.value=C.top,f.value=C.width,g.value=C.x,p.value=C.y}return wo(n,_),ht(()=>Ou(n),v=>!v&&_()),s&&Es("scroll",_,{capture:!0,passive:!0}),i&&Es("resize",_,{passive:!0}),Xee(()=>{o&&_()}),{height:r,bottom:a,left:c,right:u,top:d,width:f,x:g,y:p,update:_}}var eue=Object.getOwnPropertySymbols,N7e=Object.prototype.hasOwnProperty,D7e=Object.prototype.propertyIsEnumerable,$7e=(n,e)=>{var t={};for(var i in n)N7e.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&eue)for(var i of eue(n))e.indexOf(i)<0&&D7e.call(n,i)&&(t[i]=n[i]);return t};function CEe(n,e,t={}){const i=t,{window:s=Dy}=i,o=$7e(i,["window"]);let r;const a=TEe(()=>s&&"MutationObserver"in s),c=()=>{r&&(r.disconnect(),r=void 0)},u=ht(()=>Ou(n),f=>{c(),a.value&&s&&f&&(r=new MutationObserver(e),r.observe(f,o))},{immediate:!0}),d=()=>{c(),u()};return sF(d),{isSupported:a,stop:d}}var tue;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(tue||(tue={}));var x7e=Object.defineProperty,nue=Object.getOwnPropertySymbols,P7e=Object.prototype.hasOwnProperty,F7e=Object.prototype.propertyIsEnumerable,iue=(n,e,t)=>e in n?x7e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,B7e=(n,e)=>{for(var t in e)P7e.call(e,t)&&iue(n,t,e[t]);if(nue)for(var t of nue(e))F7e.call(e,t)&&iue(n,t,e[t]);return n};const H7e={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};B7e({linear:C7e},H7e);function yEe(n,e,t,i={}){var s,o,r;const{clone:a=!1,passive:c=!1,eventName:u,deep:d=!1,defaultValue:f}=i,g=Qn(),p=t||(g==null?void 0:g.emit)||((s=g==null?void 0:g.$emit)==null?void 0:s.bind(g))||((r=(o=g==null?void 0:g.proxy)==null?void 0:o.$emit)==null?void 0:r.bind(g==null?void 0:g.proxy));let _=u;e||(e="modelValue"),_=u||_||`update:${e.toString()}`;const v=y=>a?mX(a)?a(y):L7e(y):y,C=()=>_7e(n[e])?v(n[e]):f;if(c){const y=C(),w=te(y);return ht(()=>n[e],I=>w.value=v(I)),ht(w,I=>{(I!==n[e]||d)&&p(_,I)},{deep:d}),w}else return W({get(){return C()},set(y){p(_,y)}})}function V7e({window:n=Dy}={}){if(!n)return te(!1);const e=te(n.document.hasFocus());return Es(n,"blur",()=>{e.value=!1}),Es(n,"focus",()=>{e.value=!0}),e}function U7e(n={}){const{window:e=Dy,initialWidth:t=1/0,initialHeight:i=1/0,listenOrientation:s=!0,includeScrollbar:o=!0}=n,r=te(t),a=te(i),c=()=>{e&&(o?(r.value=e.innerWidth,a.value=e.innerHeight):(r.value=e.document.documentElement.clientWidth,a.value=e.document.documentElement.clientHeight))};return c(),Xee(c),Es("resize",c,{passive:!0}),s&&Es("orientationchange",c,{passive:!0}),{width:r,height:a}}class W7e extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function Ll(n,e){throw new W7e(`[${n}] ${e}`)}const sue={current:0},oue=te(0),EEe=2e3,rue=Symbol("elZIndexContextKey"),SEe=Symbol("zIndexContextKey"),sM=n=>{const e=Qn()?Kt(rue,sue):sue,t=n||(Qn()?Kt(SEe,void 0):void 0),i=W(()=>{const r=T(t);return gn(r)?r:EEe}),s=W(()=>i.value+oue.value),o=()=>(e.current++,oue.value=e.current,s.value);return!Si&&Kt(rue),{initialZIndex:i,currentZIndex:s,nextZIndex:o}};var G7e={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const z7e=n=>(e,t)=>K7e(e,t,T(n)),K7e=(n,e,t)=>Fr(t,n,n).replace(/\{(\w+)\}/g,(i,s)=>{var o;return`${(o=e==null?void 0:e[s])!=null?o:`{${s}}`}`}),j7e=n=>{const e=W(()=>T(n).name),t=Ss(n)?n:te(n);return{lang:e,locale:t,t:z7e(n)}},wEe=Symbol("localeContextKey"),wi=n=>{const e=n||Kt(wEe,te());return j7e(W(()=>e.value||G7e))},IEe="__epPropKey",Ke=n=>n,X7e=n=>si(n)&&!!n[IEe],fp=(n,e)=>{if(!si(n)||X7e(n))return n;const{values:t,required:i,default:s,type:o,validator:r}=n,c={type:o,required:!!i,validator:t||r?u=>{let d=!1,f=[];if(t&&(f=Array.from(t),Wi(n,"default")&&f.push(s),d||(d=f.includes(u))),r&&(d||(d=r(u))),!d&&f.length>0){const g=[...new Set(f)].map(p=>JSON.stringify(p)).join(", ");a$e(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${g}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[IEe]:!0};return Wi(n,"default")&&(c.default=s),c},Lt=n=>ix(Object.entries(n).map(([e,t])=>[e,fp(t,e)])),l_=["","default","small","large"],cl=fp({type:String,values:l_,required:!1}),LEe=Symbol("size"),OEe=()=>{const n=Kt(LEe,{});return W(()=>T(n.size)||"")},REe=Symbol("emptyValuesContextKey"),Y7e=["",void 0,null],q7e=void 0,oM=Lt({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>ln(n)?!n():!n}}),v8=(n,e)=>{const t=Qn()?Kt(REe,te({})):te({}),i=W(()=>n.emptyValues||t.value.emptyValues||Y7e),s=W(()=>ln(n.valueOnClear)?n.valueOnClear():n.valueOnClear!==void 0?n.valueOnClear:ln(t.value.valueOnClear)?t.value.valueOnClear():t.value.valueOnClear!==void 0?t.value.valueOnClear:e!==void 0?e:q7e),o=r=>i.value.includes(r);return i.value.includes(s.value),{emptyValues:i,valueOnClear:s,isEmptyValue:o}},YO=n=>Object.keys(n),MEe=n=>Object.entries(n),bU=(n,e,t)=>({get value(){return Fr(n,e,t)},set value(i){i7e(n,e,i)}}),pW=te();function b8(n,e=void 0){const t=Qn()?Kt(Rye,pW):pW;return n?W(()=>{var i,s;return(s=(i=t.value)==null?void 0:i[n])!=null?s:e}):t}function T8(n,e){const t=b8(),i=vt(n,W(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||$D})),s=wi(W(()=>{var a;return(a=t.value)==null?void 0:a.locale})),o=sM(W(()=>{var a;return((a=t.value)==null?void 0:a.zIndex)||EEe})),r=W(()=>{var a;return T(e)||((a=t.value)==null?void 0:a.size)||""});return qee(W(()=>T(t)||{})),{ns:i,locale:s,zIndex:o,size:r}}const qee=(n,e,t=!1)=>{var i;const s=!!Qn(),o=s?b8():void 0,r=(i=e==null?void 0:e.provide)!=null?i:s?pi:void 0;if(!r)return;const a=W(()=>{const c=T(n);return o!=null&&o.value?J7e(o.value,c):c});return r(Rye,a),r(wEe,W(()=>a.value.locale)),r(Mye,W(()=>a.value.namespace)),r(SEe,W(()=>a.value.zIndex)),r(LEe,{size:W(()=>a.value.size||"")}),r(REe,W(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!pW.value)&&(pW.value=a.value),a},J7e=(n,e)=>{const t=[...new Set([...YO(n),...YO(e)])],i={};for(const s of t)i[s]=e[s]!==void 0?e[s]:n[s];return i},Q7e=(n=[])=>({version:x5e,install:(t,i)=>{t[gce]||(t[gce]=!0,n.forEach(s=>t.use(s)),i&&qee(i,t,!0))}}),Kn="update:modelValue",Ms="change",rc="input",Z7e=Lt({zIndex:{type:Ke([Number,String]),default:100},target:{type:String,default:""},offset:{type:Number,default:0},position:{type:String,values:["top","bottom"],default:"top"}}),eKe={scroll:({scrollTop:n,fixed:e})=>gn(n)&&Us(e),[Ms]:n=>Us(n)};var Rt=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};function tKe(n,e,t,i){const s=t-e;return n/=i/2,n<1?s/2*n*n*n+e:s/2*((n-=2)*n*n+2)+e}const QC=n=>Si?window.requestAnimationFrame(n):setTimeout(n,16),H0=n=>Si?window.cancelAnimationFrame(n):clearTimeout(n),kEe=(n="")=>n.split(" ").filter(e=>!!e.trim()),Td=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},Of=(n,e)=>{!n||!e.trim()||n.classList.add(...kEe(e))},qc=(n,e)=>{!n||!e.trim()||n.classList.remove(...kEe(e))},$v=(n,e)=>{var t;if(!Si||!n||!e)return"";let i=$u(e);i==="float"&&(i="cssFloat");try{const s=n.style[i];if(s)return s;const o=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return o?o[i]:""}catch{return n.style[i]}},AEe=(n,e,t)=>{if(!(!n||!e))if(si(e))MEe(e).forEach(([i,s])=>AEe(n,i,s));else{const i=$u(e);n.style[i]=t}};function mr(n,e="px"){if(!n)return"";if(gn(n)||c7e(n))return`${n}${e}`;if(sn(n))return n}const nKe=(n,e)=>{if(!Si)return!1;const t={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(e)],i=$v(n,t);return["scroll","auto","overlay"].some(s=>i.includes(s))},Jee=(n,e)=>{if(!Si)return;let t=n;for(;t;){if([window,document,document.documentElement].includes(t))return window;if(nKe(t,e))return t;t=t.parentNode}return t};let CH;const NEe=n=>{var e;if(!Si)return 0;if(CH!==void 0)return CH;const t=document.createElement("div");t.className=`${n}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const i=t.offsetWidth;t.style.overflow="scroll";const s=document.createElement("div");s.style.width="100%",t.appendChild(s);const o=s.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),CH=i-o,CH};function Qee(n,e){if(!Si)return;if(!e){n.scrollTop=0;return}const t=[];let i=e.offsetParent;for(;i!==null&&n!==i&&n.contains(i);)t.push(i),i=i.offsetParent;const s=e.offsetTop+t.reduce((c,u)=>c+u.offsetTop,0),o=s+e.offsetHeight,r=n.scrollTop,a=r+n.clientHeight;s<r?n.scrollTop=s:o>a&&(n.scrollTop=o-n.clientHeight)}function iKe(n,e,t,i,s){const o=Date.now();let r;const a=()=>{const u=Date.now()-o,d=tKe(u>i?i:u,e,t,i);_8(n)?n.scrollTo(window.pageXOffset,d):n.scrollTop=d,u<i?r=QC(a):ln(s)&&s()};return a(),()=>{r&&H0(r)}}const lue=(n,e)=>_8(e)?n.ownerDocument.documentElement:e,aue=n=>_8(n)?window.scrollY:n.scrollTop,DEe="ElAffix",sKe=$e({name:DEe}),oKe=$e({...sKe,props:Z7e,emits:eKe,setup(n,{expose:e,emit:t}){const i=n,s=vt("affix"),o=us(),r=us(),a=us(),{height:c}=U7e(),{height:u,width:d,top:f,bottom:g,update:p}=Zce(r,{windowScroll:!1}),_=Zce(o),v=te(!1),C=te(0),y=te(0),w=W(()=>({height:v.value?`${u.value}px`:"",width:v.value?`${d.value}px`:""})),I=W(()=>{if(!v.value)return{};const A=i.offset?mr(i.offset):0;return{height:`${u.value}px`,width:`${d.value}px`,top:i.position==="top"?A:"",bottom:i.position==="bottom"?A:"",transform:y.value?`translateY(${y.value}px)`:"",zIndex:i.zIndex}}),L=()=>{if(!a.value)return;C.value=a.value instanceof Window?document.documentElement.scrollTop:a.value.scrollTop||0;const{position:A,target:N,offset:D}=i,P=D+u.value;if(A==="top")if(N){const F=_.bottom.value-P;v.value=D>f.value&&_.bottom.value>0,y.value=F<0?F:0}else v.value=D>f.value;else if(N){const F=c.value-_.top.value-P;v.value=c.value-D<g.value&&c.value>_.top.value,y.value=F<0?-F:0}else v.value=c.value-D<g.value},O=()=>{p(),t("scroll",{scrollTop:C.value,fixed:v.value})};return ht(v,A=>t("change",A)),$n(()=>{var A;i.target?(o.value=(A=document.querySelector(i.target))!=null?A:void 0,o.value||Ll(DEe,`Target does not exist: ${i.target}`)):o.value=document.documentElement,a.value=Jee(r.value,!0),p()}),Es(a,"scroll",O),Sl(L),e({update:L,updateRoot:p}),(A,N)=>(G(),he("div",{ref_key:"root",ref:r,class:Y(T(s).b()),style:on(T(w))},[oe("div",{class:Y({[T(s).m("fixed")]:v.value}),style:on(T(I))},[Ye(A.$slots,"default")],6)],6))}});var rKe=Rt(oKe,[["__file","affix.vue"]]);const Nn=(n,e)=>{if(n.install=t=>{for(const i of[n,...Object.values(e??{})])t.component(i.name,i)},e)for(const[t,i]of Object.entries(e))n[t]=i;return n},$Ee=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),lKe=(n,e)=>(n.install=t=>{t.directive(e,n)},n),Xo=n=>(n.install=ps,n),aKe=Nn(rKe),cKe=Lt({size:{type:Ke([Number,String])},color:{type:String}}),uKe=$e({name:"ElIcon",inheritAttrs:!1}),dKe=$e({...uKe,props:cKe,setup(n){const e=n,t=vt("icon"),i=W(()=>{const{size:s,color:o}=e;return!s&&!o?{}:{fontSize:ys(s)?void 0:mr(s),"--color":o}});return(s,o)=>(G(),he("i",hi({class:T(t).b(),style:T(i)},s.$attrs),[Ye(s.$slots,"default")],16))}});var hKe=Rt(dKe,[["__file","icon.vue"]]);const tn=Nn(hKe);/*! Element Plus Icons Vue v2.3.1 */var fKe=$e({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Lb=fKe,gKe=$e({name:"ArrowLeft",__name:"arrow-left",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),ZC=gKe,pKe=$e({name:"ArrowRight",__name:"arrow-right",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Au=pKe,mKe=$e({name:"ArrowUp",__name:"arrow-up",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Zee=mKe,_Ke=$e({name:"Back",__name:"back",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"}),oe("path",{fill:"currentColor",d:"m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"})]))}}),vKe=_Ke,bKe=$e({name:"Calendar",__name:"calendar",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"})]))}}),TKe=bKe,CKe=$e({name:"CaretRight",__name:"caret-right",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),xEe=CKe,yKe=$e({name:"CaretTop",__name:"caret-top",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 320 192 704h639.936z"})]))}}),EKe=yKe,SKe=$e({name:"Check",__name:"check",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),oF=SKe,wKe=$e({name:"CircleCheckFilled",__name:"circle-check-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),IKe=wKe,LKe=$e({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),oe("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),ete=LKe,OKe=$e({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),tte=OKe,RKe=$e({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),oe("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Ob=RKe,MKe=$e({name:"Clock",__name:"clock",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),oe("path",{fill:"currentColor",d:"M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"}),oe("path",{fill:"currentColor",d:"M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32"})]))}}),PEe=MKe,kKe=$e({name:"Close",__name:"close",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Zg=kKe,AKe=$e({name:"DArrowLeft",__name:"d-arrow-left",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.592 30.592 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.592 30.592 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672l331.648-340.224zm256 0a29.12 29.12 0 0 1 41.728 0 30.592 30.592 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.592 30.592 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672l331.648-340.224z"})]))}}),ey=AKe,NKe=$e({name:"DArrowRight",__name:"d-arrow-right",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.592 30.592 0 0 1 0-42.752L764.736 512 452.864 192a30.592 30.592 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.592 30.592 0 0 1 0-42.752L508.736 512 196.864 192a30.592 30.592 0 0 1 0-42.688z"})]))}}),ty=NKe,DKe=$e({name:"Delete",__name:"delete",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),$Ke=DKe,xKe=$e({name:"DocumentAdd",__name:"document-add",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m320 512V448h64v128h128v64H544v128h-64V640H352v-64z"})]))}}),PKe=xKe,FKe=$e({name:"Document",__name:"document",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),BKe=FKe,HKe=$e({name:"Edit",__name:"edit",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),oe("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),VKe=HKe,UKe=$e({name:"FullScreen",__name:"full-screen",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}}),WKe=UKe,GKe=$e({name:"Hide",__name:"hide",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),oe("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),zKe=GKe,KKe=$e({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),nte=KKe,jKe=$e({name:"Loading",__name:"loading",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Gm=jKe,XKe=$e({name:"Minus",__name:"minus",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),YKe=XKe,qKe=$e({name:"MoreFilled",__name:"more-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),cue=qKe,JKe=$e({name:"More",__name:"more",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"})]))}}),QKe=JKe,ZKe=$e({name:"PictureFilled",__name:"picture-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384"})]))}}),eje=ZKe,tje=$e({name:"Plus",__name:"plus",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),FEe=tje,nje=$e({name:"QuestionFilled",__name:"question-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592 0-42.944-14.08-76.736-42.24-101.376-28.16-25.344-65.472-37.312-111.232-37.312zm-12.672 406.208a54.272 54.272 0 0 0-38.72 14.784 49.408 49.408 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.848 54.848 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.968 51.968 0 0 0-15.488-38.016 55.936 55.936 0 0 0-39.424-14.784z"})]))}}),ije=nje,sje=$e({name:"RefreshLeft",__name:"refresh-left",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}}),oje=sje,rje=$e({name:"RefreshRight",__name:"refresh-right",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"})]))}}),lje=rje,aje=$e({name:"ScaleToOriginal",__name:"scale-to-original",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118zm-361.412 0a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118M512 361.412a30.118 30.118 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.118 30.118 0 0 0 512 361.412M512 512a30.118 30.118 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.118 30.118 0 0 0 512 512"})]))}}),cje=aje,uje=$e({name:"Search",__name:"search",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),dje=uje,hje=$e({name:"SortDown",__name:"sort-down",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M576 96v709.568L333.312 562.816A32 32 0 1 0 288 608l297.408 297.344A32 32 0 0 0 640 882.688V96a32 32 0 0 0-64 0"})]))}}),fje=hje,gje=$e({name:"SortUp",__name:"sort-up",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M384 141.248V928a32 32 0 1 0 64 0V218.56l242.688 242.688A32 32 0 1 0 736 416L438.592 118.656A32 32 0 0 0 384 141.248"})]))}}),pje=gje,mje=$e({name:"StarFilled",__name:"star-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M283.84 867.84 512 747.776l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72z"})]))}}),yH=mje,_je=$e({name:"Star",__name:"star",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"})]))}}),vje=_je,bje=$e({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),BEe=bje,Tje=$e({name:"View",__name:"view",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Cje=Tje,yje=$e({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),C8=yje,Eje=$e({name:"ZoomIn",__name:"zoom-in",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),HEe=Eje,Sje=$e({name:"ZoomOut",__name:"zoom-out",setup(n){return(e,t)=>(G(),he("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[oe("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),wje=Sje;const ks=Ke([String,Object,Function]),ite={Close:Zg},ste={Close:Zg,SuccessFilled:BEe,InfoFilled:nte,WarningFilled:C8,CircleCloseFilled:tte},ny={success:BEe,warning:C8,error:tte,info:nte},y8={validating:Gm,success:ete,error:Ob},Ije=["light","dark"],Lje=Lt({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:YO(ny),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:Ije,default:"light"}}),Oje={close:n=>n instanceof MouseEvent},Rje=$e({name:"ElAlert"}),Mje=$e({...Rje,props:Lje,emits:Oje,setup(n,{emit:e}){const t=n,{Close:i}=ste,s=dl(),o=vt("alert"),r=te(!0),a=W(()=>ny[t.type]),c=W(()=>!!(t.description||s.default)),u=d=>{r.value=!1,e("close",d)};return(d,f)=>(G(),nt(Ta,{name:T(o).b("fade"),persisted:""},{default:_e(()=>[Un(oe("div",{class:Y([T(o).b(),T(o).m(d.type),T(o).is("center",d.center),T(o).is(d.effect)]),role:"alert"},[d.showIcon&&T(a)?(G(),nt(T(tn),{key:0,class:Y([T(o).e("icon"),{[T(o).is("big")]:T(c)}])},{default:_e(()=>[(G(),nt(ui(T(a))))]),_:1},8,["class"])):Qe("v-if",!0),oe("div",{class:Y(T(o).e("content"))},[d.title||d.$slots.title?(G(),he("span",{key:0,class:Y([T(o).e("title"),{"with-description":T(c)}])},[Ye(d.$slots,"title",{},()=>[mn(st(d.title),1)])],2)):Qe("v-if",!0),T(c)?(G(),he("p",{key:1,class:Y(T(o).e("description"))},[Ye(d.$slots,"default",{},()=>[mn(st(d.description),1)])],2)):Qe("v-if",!0),d.closable?(G(),he(Qt,{key:2},[d.closeText?(G(),he("div",{key:0,class:Y([T(o).e("close-btn"),T(o).is("customed")]),onClick:u},st(d.closeText),3)):(G(),nt(T(tn),{key:1,class:Y(T(o).e("close-btn")),onClick:u},{default:_e(()=>[ce(T(i))]),_:1},8,["class"]))],64)):Qe("v-if",!0)],2)],2),[[Gi,r.value]])]),_:3},8,["name"]))}});var kje=Rt(Mje,[["__file","alert.vue"]]);const Aje=Nn(kje),E8=()=>Si&&/firefox/i.test(window.navigator.userAgent);let bg;const Nje=`
- height:0 !important;
- visibility:hidden !important;
- ${E8()?"":"overflow:hidden !important;"}
- position:absolute !important;
- z-index:-1000 !important;
- top:0 !important;
- right:0 !important;
- `,Dje=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function $je(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),s=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:Dje.map(r=>`${r}:${e.getPropertyValue(r)}`).join(";"),paddingSize:i,borderSize:s,boxSizing:t}}function uue(n,e=1,t){var i;bg||(bg=document.createElement("textarea"),document.body.appendChild(bg));const{paddingSize:s,borderSize:o,boxSizing:r,contextStyle:a}=$je(n);bg.setAttribute("style",`${a};${Nje}`),bg.value=n.value||n.placeholder||"";let c=bg.scrollHeight;const u={};r==="border-box"?c=c+o:r==="content-box"&&(c=c-s),bg.value="";const d=bg.scrollHeight-s;if(gn(e)){let f=d*e;r==="border-box"&&(f=f+s+o),c=Math.max(f,c),u.minHeight=`${f}px`}if(gn(t)){let f=d*t;r==="border-box"&&(f=f+s+o),c=Math.min(f,c)}return u.height=`${c}px`,(i=bg.parentNode)==null||i.removeChild(bg),bg=void 0,u}const Ko=n=>n,xje=Lt({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Wa=n=>$g(xje,n),ote=Lt({id:{type:String,default:void 0},size:cl,disabled:Boolean,modelValue:{type:Ke([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ke([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ks},prefixIcon:{type:ks},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ke([Object,Array,String]),default:()=>Ko({})},autofocus:Boolean,rows:{type:Number,default:2},...Wa(["ariaLabel"])}),Pje={[Kn]:n=>sn(n),input:n=>sn(n),change:n=>sn(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},Fje=["class","style"],Bje=/^on[A-Z]/,rF=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,i=W(()=>((t==null?void 0:t.value)||[]).concat(Fje)),s=Qn();return W(s?()=>{var o;return ix(Object.entries((o=s.proxy)==null?void 0:o.$attrs).filter(([r])=>!i.value.includes(r)&&!(e&&Bje.test(r))))}:()=>({}))},Dw=Symbol("formContextKey"),zm=Symbol("formItemContextKey"),due={prefix:Math.floor(Math.random()*1e4),current:0},Hje=Symbol("elIdInjection"),rte=()=>Qn()?Kt(Hje,due):due,Va=n=>{const e=rte(),t=Aee();return pX(()=>T(n)||`${t.value}-id-${e.prefix}-${e.current++}`)},fc=()=>{const n=Kt(Dw,void 0),e=Kt(zm,void 0);return{form:n,formItem:e}},Qf=(n,{formItemContext:e,disableIdGeneration:t,disableIdManagement:i})=>{t||(t=te(!1)),i||(i=te(!1));const s=te();let o;const r=W(()=>{var a;return!!(!(n.label||n.ariaLabel)&&e&&e.inputIds&&((a=e.inputIds)==null?void 0:a.length)<=1)});return $n(()=>{o=ht([ds(n,"id"),t],([a,c])=>{const u=a??(c?void 0:Va().value);u!==s.value&&(e!=null&&e.removeInputId&&(s.value&&e.removeInputId(s.value),!(i!=null&&i.value)&&!c&&u&&e.addInputId(u)),s.value=u)},{immediate:!0})}),Cb(()=>{o&&o(),e!=null&&e.removeInputId&&s.value&&e.removeInputId(s.value)}),{isLabeledByFormItem:r,inputId:s}},VEe=n=>{const e=Qn();return W(()=>{var t,i;return(i=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:i[n]})},jr=(n,e={})=>{const t=te(void 0),i=e.prop?t:VEe("size"),s=e.global?t:OEe(),o=e.form?{size:void 0}:Kt(Dw,void 0),r=e.formItem?{size:void 0}:Kt(zm,void 0);return W(()=>i.value||T(n)||(r==null?void 0:r.size)||(o==null?void 0:o.size)||s.value||"")},gc=n=>{const e=VEe("disabled"),t=Kt(Dw,void 0);return W(()=>e.value||T(n)||(t==null?void 0:t.disabled)||!1)};function $y(n,{beforeFocus:e,afterFocus:t,beforeBlur:i,afterBlur:s}={}){const o=Qn(),{emit:r}=o,a=us(),c=te(!1),u=g=>{ln(e)&&e(g)||c.value||(c.value=!0,r("focus",g),t==null||t())},d=g=>{var p;ln(i)&&i(g)||g.relatedTarget&&((p=a.value)!=null&&p.contains(g.relatedTarget))||(c.value=!1,r("blur",g),s==null||s())},f=()=>{var g,p;(g=a.value)!=null&&g.contains(document.activeElement)&&a.value!==document.activeElement||(p=n.value)==null||p.focus()};return ht(a,g=>{g&&g.setAttribute("tabindex","-1")}),Es(a,"focus",u,!0),Es(a,"blur",d,!0),Es(a,"click",f,!0),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}const Vje=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n);function lF({afterComposition:n,emit:e}){const t=te(!1),i=a=>{e==null||e("compositionstart",a),t.value=!0},s=a=>{var c;e==null||e("compositionupdate",a);const u=(c=a.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!Vje(d)},o=a=>{e==null||e("compositionend",a),t.value&&(t.value=!1,cn(()=>n(a)))};return{isComposing:t,handleComposition:a=>{a.type==="compositionend"?o(a):s(a)},handleCompositionStart:i,handleCompositionUpdate:s,handleCompositionEnd:o}}function Uje(n){let e;function t(){if(n.value==null)return;const{selectionStart:s,selectionEnd:o,value:r}=n.value;if(s==null||o==null)return;const a=r.slice(0,Math.max(0,s)),c=r.slice(Math.max(0,o));e={selectionStart:s,selectionEnd:o,value:r,beforeTxt:a,afterTxt:c}}function i(){if(n.value==null||e==null)return;const{value:s}=n.value,{beforeTxt:o,afterTxt:r,selectionStart:a}=e;if(o==null||r==null||a==null)return;let c=s.length;if(s.endsWith(r))c=s.length-r.length;else if(s.startsWith(o))c=o.length;else{const u=o[a-1],d=s.indexOf(u,a-1);d!==-1&&(c=d+1)}n.value.setSelectionRange(c,c)}return[t,i]}const Wje=$e({name:"ElInput",inheritAttrs:!1}),Gje=$e({...Wje,props:ote,emits:Pje,setup(n,{expose:e,emit:t}){const i=n,s=Ly(),o=rF(),r=dl(),a=W(()=>[i.type==="textarea"?v.b():_.b(),_.m(g.value),_.is("disabled",p.value),_.is("exceed",Le.value),{[_.b("group")]:r.prepend||r.append,[_.m("prefix")]:r.prefix||i.prefixIcon,[_.m("suffix")]:r.suffix||i.suffixIcon||i.clearable||i.showPassword,[_.bm("suffix","password-clear")]:Z.value&&J.value,[_.b("hidden")]:i.type==="hidden"},s.class]),c=W(()=>[_.e("wrapper"),_.is("focus",D.value)]),{form:u,formItem:d}=fc(),{inputId:f}=Qf(i,{formItemContext:d}),g=jr(),p=gc(),_=vt("input"),v=vt("textarea"),C=us(),y=us(),w=te(!1),I=te(!1),L=te(),O=us(i.inputStyle),A=W(()=>C.value||y.value),{wrapperRef:N,isFocused:D,handleFocus:P,handleBlur:F}=$y(A,{beforeFocus(){return p.value},afterBlur(){var ke;i.validateEvent&&((ke=d==null?void 0:d.validate)==null||ke.call(d,"blur").catch(ot=>void 0))}}),V=W(()=>{var ke;return(ke=u==null?void 0:u.statusIcon)!=null?ke:!1}),U=W(()=>(d==null?void 0:d.validateState)||""),Q=W(()=>U.value&&y8[U.value]),de=W(()=>I.value?Cje:zKe),q=W(()=>[s.style]),K=W(()=>[i.inputStyle,O.value,{resize:i.resize}]),re=W(()=>Ul(i.modelValue)?"":String(i.modelValue)),Z=W(()=>i.clearable&&!p.value&&!i.readonly&&!!re.value&&(D.value||w.value)),J=W(()=>i.showPassword&&!p.value&&!!re.value&&(!!re.value||D.value)),ge=W(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!p.value&&!i.readonly&&!i.showPassword),ve=W(()=>re.value.length),Le=W(()=>!!ge.value&&ve.value>Number(i.maxlength)),Ee=W(()=>!!r.suffix||!!i.suffixIcon||Z.value||i.showPassword||ge.value||!!U.value&&V.value),[Ne,qe]=Uje(C);wo(y,ke=>{if(Ve(),!ge.value||i.resize!=="both")return;const ot=ke[0],{width:Ct}=ot.contentRect;L.value={right:`calc(100% - ${Ct+15+6}px)`}});const Re=()=>{const{type:ke,autosize:ot}=i;if(!(!Si||ke!=="textarea"||!y.value))if(ot){const Ct=si(ot)?ot.minRows:void 0,Gt=si(ot)?ot.maxRows:void 0,Ot=uue(y.value,Ct,Gt);O.value={overflowY:"hidden",...Ot},cn(()=>{y.value.offsetHeight,O.value=Ot})}else O.value={minHeight:uue(y.value).minHeight}},Ve=(ke=>{let ot=!1;return()=>{var Ct;if(ot||!i.autosize)return;((Ct=y.value)==null?void 0:Ct.offsetParent)===null||(ke(),ot=!0)}})(Re),Ge=()=>{const ke=A.value,ot=i.formatter?i.formatter(re.value):re.value;!ke||ke.value===ot||(ke.value=ot)},dt=async ke=>{Ne();let{value:ot}=ke.target;if(i.formatter&&(ot=i.parser?i.parser(ot):ot),!ee.value){if(ot===re.value){Ge();return}t(Kn,ot),t("input",ot),await cn(),Ge(),qe()}},ze=ke=>{t("change",ke.target.value)},{isComposing:ee,handleCompositionStart:ye,handleCompositionUpdate:Me,handleCompositionEnd:et}=lF({emit:t,afterComposition:dt}),at=()=>{Ne(),I.value=!I.value,setTimeout(qe)},Ue=()=>{var ke;return(ke=A.value)==null?void 0:ke.focus()},Se=()=>{var ke;return(ke=A.value)==null?void 0:ke.blur()},Ie=ke=>{w.value=!1,t("mouseleave",ke)},Xe=ke=>{w.value=!0,t("mouseenter",ke)},it=ke=>{t("keydown",ke)},Tt=()=>{var ke;(ke=A.value)==null||ke.select()},He=()=>{t(Kn,""),t("change",""),t("clear"),t("input","")};return ht(()=>i.modelValue,()=>{var ke;cn(()=>Re()),i.validateEvent&&((ke=d==null?void 0:d.validate)==null||ke.call(d,"change").catch(ot=>void 0))}),ht(re,()=>Ge()),ht(()=>i.type,async()=>{await cn(),Ge(),Re()}),$n(()=>{!i.formatter&&i.parser,Ge(),cn(Re)}),e({input:C,textarea:y,ref:A,textareaStyle:K,autosize:ds(i,"autosize"),isComposing:ee,focus:Ue,blur:Se,select:Tt,clear:He,resizeTextarea:Re}),(ke,ot)=>(G(),he("div",{class:Y([T(a),{[T(_).bm("group","append")]:ke.$slots.append,[T(_).bm("group","prepend")]:ke.$slots.prepend}]),style:on(T(q)),onMouseenter:Xe,onMouseleave:Ie},[Qe(" input "),ke.type!=="textarea"?(G(),he(Qt,{key:0},[Qe(" prepend slot "),ke.$slots.prepend?(G(),he("div",{key:0,class:Y(T(_).be("group","prepend"))},[Ye(ke.$slots,"prepend")],2)):Qe("v-if",!0),oe("div",{ref_key:"wrapperRef",ref:N,class:Y(T(c))},[Qe(" prefix slot "),ke.$slots.prefix||ke.prefixIcon?(G(),he("span",{key:0,class:Y(T(_).e("prefix"))},[oe("span",{class:Y(T(_).e("prefix-inner"))},[Ye(ke.$slots,"prefix"),ke.prefixIcon?(G(),nt(T(tn),{key:0,class:Y(T(_).e("icon"))},{default:_e(()=>[(G(),nt(ui(ke.prefixIcon)))]),_:1},8,["class"])):Qe("v-if",!0)],2)],2)):Qe("v-if",!0),oe("input",hi({id:T(f),ref_key:"input",ref:C,class:T(_).e("inner")},T(o),{minlength:ke.minlength,maxlength:ke.maxlength,type:ke.showPassword?I.value?"text":"password":ke.type,disabled:T(p),readonly:ke.readonly,autocomplete:ke.autocomplete,tabindex:ke.tabindex,"aria-label":ke.ariaLabel,placeholder:ke.placeholder,style:ke.inputStyle,form:ke.form,autofocus:ke.autofocus,role:ke.containerRole,onCompositionstart:T(ye),onCompositionupdate:T(Me),onCompositionend:T(et),onInput:dt,onChange:ze,onKeydown:it}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","onCompositionstart","onCompositionupdate","onCompositionend"]),Qe(" suffix slot "),T(Ee)?(G(),he("span",{key:1,class:Y(T(_).e("suffix"))},[oe("span",{class:Y(T(_).e("suffix-inner"))},[!T(Z)||!T(J)||!T(ge)?(G(),he(Qt,{key:0},[Ye(ke.$slots,"suffix"),ke.suffixIcon?(G(),nt(T(tn),{key:0,class:Y(T(_).e("icon"))},{default:_e(()=>[(G(),nt(ui(ke.suffixIcon)))]),_:1},8,["class"])):Qe("v-if",!0)],64)):Qe("v-if",!0),T(Z)?(G(),nt(T(tn),{key:1,class:Y([T(_).e("icon"),T(_).e("clear")]),onMousedown:bn(T(ps),["prevent"]),onClick:He},{default:_e(()=>[ce(T(Ob))]),_:1},8,["class","onMousedown"])):Qe("v-if",!0),T(J)?(G(),nt(T(tn),{key:2,class:Y([T(_).e("icon"),T(_).e("password")]),onClick:at},{default:_e(()=>[(G(),nt(ui(T(de))))]),_:1},8,["class"])):Qe("v-if",!0),T(ge)?(G(),he("span",{key:3,class:Y(T(_).e("count"))},[oe("span",{class:Y(T(_).e("count-inner"))},st(T(ve))+" / "+st(ke.maxlength),3)],2)):Qe("v-if",!0),T(U)&&T(Q)&&T(V)?(G(),nt(T(tn),{key:4,class:Y([T(_).e("icon"),T(_).e("validateIcon"),T(_).is("loading",T(U)==="validating")])},{default:_e(()=>[(G(),nt(ui(T(Q))))]),_:1},8,["class"])):Qe("v-if",!0)],2)],2)):Qe("v-if",!0)],2),Qe(" append slot "),ke.$slots.append?(G(),he("div",{key:1,class:Y(T(_).be("group","append"))},[Ye(ke.$slots,"append")],2)):Qe("v-if",!0)],64)):(G(),he(Qt,{key:1},[Qe(" textarea "),oe("textarea",hi({id:T(f),ref_key:"textarea",ref:y,class:[T(v).e("inner"),T(_).is("focus",T(D))]},T(o),{minlength:ke.minlength,maxlength:ke.maxlength,tabindex:ke.tabindex,disabled:T(p),readonly:ke.readonly,autocomplete:ke.autocomplete,style:T(K),"aria-label":ke.ariaLabel,placeholder:ke.placeholder,form:ke.form,autofocus:ke.autofocus,rows:ke.rows,role:ke.containerRole,onCompositionstart:T(ye),onCompositionupdate:T(Me),onCompositionend:T(et),onInput:dt,onFocus:T(P),onBlur:T(F),onChange:ze,onKeydown:it}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),T(ge)?(G(),he("span",{key:0,style:on(L.value),class:Y(T(_).e("count"))},st(T(ve))+" / "+st(ke.maxlength),7)):Qe("v-if",!0)],64))],38))}});var zje=Rt(Gje,[["__file","input.vue"]]);const Kc=Nn(zje),KL=4,UEe={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},Kje=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),lte=Symbol("scrollbarContextKey"),jje=Lt({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),Xje="Thumb",Yje=$e({__name:"thumb",props:jje,setup(n){const e=n,t=Kt(lte),i=vt("scrollbar");t||Ll(Xje,"can not inject scrollbar context");const s=te(),o=te(),r=te({}),a=te(!1);let c=!1,u=!1,d=Si?document.onselectstart:null;const f=W(()=>UEe[e.vertical?"vertical":"horizontal"]),g=W(()=>Kje({size:e.size,move:e.move,bar:f.value})),p=W(()=>s.value[f.value.offset]**2/t.wrapElement[f.value.scrollSize]/e.ratio/o.value[f.value.offset]),_=A=>{var N;if(A.stopPropagation(),A.ctrlKey||[1,2].includes(A.button))return;(N=window.getSelection())==null||N.removeAllRanges(),C(A);const D=A.currentTarget;D&&(r.value[f.value.axis]=D[f.value.offset]-(A[f.value.client]-D.getBoundingClientRect()[f.value.direction]))},v=A=>{if(!o.value||!s.value||!t.wrapElement)return;const N=Math.abs(A.target.getBoundingClientRect()[f.value.direction]-A[f.value.client]),D=o.value[f.value.offset]/2,P=(N-D)*100*p.value/s.value[f.value.offset];t.wrapElement[f.value.scroll]=P*t.wrapElement[f.value.scrollSize]/100},C=A=>{A.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",w),d=document.onselectstart,document.onselectstart=()=>!1},y=A=>{if(!s.value||!o.value||c===!1)return;const N=r.value[f.value.axis];if(!N)return;const D=(s.value.getBoundingClientRect()[f.value.direction]-A[f.value.client])*-1,P=o.value[f.value.offset]-N,F=(D-P)*100*p.value/s.value[f.value.offset];t.wrapElement[f.value.scroll]=F*t.wrapElement[f.value.scrollSize]/100},w=()=>{c=!1,r.value[f.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w),O(),u&&(a.value=!1)},I=()=>{u=!1,a.value=!!e.size},L=()=>{u=!0,a.value=c};As(()=>{O(),document.removeEventListener("mouseup",w)});const O=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Es(ds(t,"scrollbarElement"),"mousemove",I),Es(ds(t,"scrollbarElement"),"mouseleave",L),(A,N)=>(G(),nt(Ta,{name:T(i).b("fade"),persisted:""},{default:_e(()=>[Un(oe("div",{ref_key:"instance",ref:s,class:Y([T(i).e("bar"),T(i).is(T(f).key)]),onMousedown:v},[oe("div",{ref_key:"thumb",ref:o,class:Y(T(i).e("thumb")),style:on(T(g)),onMousedown:_},null,38)],34),[[Gi,A.always||a.value]])]),_:1},8,["name"]))}});var hue=Rt(Yje,[["__file","thumb.vue"]]);const qje=Lt({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),Jje=$e({__name:"bar",props:qje,setup(n,{expose:e}){const t=n,i=Kt(lte),s=te(0),o=te(0),r=te(""),a=te(""),c=te(1),u=te(1);return e({handleScroll:g=>{if(g){const p=g.offsetHeight-KL,_=g.offsetWidth-KL;o.value=g.scrollTop*100/p*c.value,s.value=g.scrollLeft*100/_*u.value}},update:()=>{const g=i==null?void 0:i.wrapElement;if(!g)return;const p=g.offsetHeight-KL,_=g.offsetWidth-KL,v=p**2/g.scrollHeight,C=_**2/g.scrollWidth,y=Math.max(v,t.minSize),w=Math.max(C,t.minSize);c.value=v/(p-v)/(y/(p-y)),u.value=C/(_-C)/(w/(_-w)),a.value=y+KL<p?`${y}px`:"",r.value=w+KL<_?`${w}px`:""}}),(g,p)=>(G(),he(Qt,null,[ce(hue,{move:s.value,ratio:u.value,size:r.value,always:g.always},null,8,["move","ratio","size","always"]),ce(hue,{move:o.value,ratio:c.value,size:a.value,vertical:"",always:g.always},null,8,["move","ratio","size","always"])],64))}});var Qje=Rt(Jje,[["__file","bar.vue"]]);const Zje=Lt({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ke([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Wa(["ariaLabel","ariaOrientation"])}),eXe={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(gn)},tXe="ElScrollbar",nXe=$e({name:tXe}),iXe=$e({...nXe,props:Zje,emits:eXe,setup(n,{expose:e,emit:t}){const i=n,s=vt("scrollbar");let o,r,a=0,c=0;const u=te(),d=te(),f=te(),g=te(),p=W(()=>{const O={};return i.height&&(O.height=mr(i.height)),i.maxHeight&&(O.maxHeight=mr(i.maxHeight)),[i.wrapStyle,O]}),_=W(()=>[i.wrapClass,s.e("wrap"),{[s.em("wrap","hidden-default")]:!i.native}]),v=W(()=>[s.e("view"),i.viewClass]),C=()=>{var O;d.value&&((O=g.value)==null||O.handleScroll(d.value),a=d.value.scrollTop,c=d.value.scrollLeft,t("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function y(O,A){si(O)?d.value.scrollTo(O):gn(O)&&gn(A)&&d.value.scrollTo(O,A)}const w=O=>{gn(O)&&(d.value.scrollTop=O)},I=O=>{gn(O)&&(d.value.scrollLeft=O)},L=()=>{var O;(O=g.value)==null||O.update()};return ht(()=>i.noresize,O=>{O?(o==null||o(),r==null||r()):({stop:o}=wo(f,L),r=Es("resize",L))},{immediate:!0}),ht(()=>[i.maxHeight,i.height],()=>{i.native||cn(()=>{var O;L(),d.value&&((O=g.value)==null||O.handleScroll(d.value))})}),pi(lte,Ki({scrollbarElement:u,wrapElement:d})),kZ(()=>{d.value&&(d.value.scrollTop=a,d.value.scrollLeft=c)}),$n(()=>{i.native||cn(()=>{L()})}),s_(()=>L()),e({wrapRef:d,update:L,scrollTo:y,setScrollTop:w,setScrollLeft:I,handleScroll:C}),(O,A)=>(G(),he("div",{ref_key:"scrollbarRef",ref:u,class:Y(T(s).b())},[oe("div",{ref_key:"wrapRef",ref:d,class:Y(T(_)),style:on(T(p)),tabindex:O.tabindex,onScroll:C},[(G(),nt(ui(O.tag),{id:O.id,ref_key:"resizeRef",ref:f,class:Y(T(v)),style:on(O.viewStyle),role:O.role,"aria-label":O.ariaLabel,"aria-orientation":O.ariaOrientation},{default:_e(()=>[Ye(O.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),O.native?Qe("v-if",!0):(G(),nt(Qje,{key:0,ref_key:"barRef",ref:g,always:O.always,"min-size":O.minSize},null,8,["always","min-size"]))],2))}});var sXe=Rt(iXe,[["__file","scrollbar.vue"]]);const a_=Nn(sXe),ate=Symbol("popper"),WEe=Symbol("popperContent"),oXe=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],GEe=Lt({role:{type:String,values:oXe,default:"tooltip"}}),rXe=$e({name:"ElPopper",inheritAttrs:!1}),lXe=$e({...rXe,props:GEe,setup(n,{expose:e}){const t=n,i=te(),s=te(),o=te(),r=te(),a=W(()=>t.role),c={triggerRef:i,popperInstanceRef:s,contentRef:o,referenceRef:r,role:a};return e(c),pi(ate,c),(u,d)=>Ye(u.$slots,"default")}});var aXe=Rt(lXe,[["__file","popper.vue"]]);const zEe=Lt({arrowOffset:{type:Number,default:5}}),cXe=$e({name:"ElPopperArrow",inheritAttrs:!1}),uXe=$e({...cXe,props:zEe,setup(n,{expose:e}){const t=n,i=vt("popper"),{arrowOffset:s,arrowRef:o,arrowStyle:r}=Kt(WEe,void 0);return ht(()=>t.arrowOffset,a=>{s.value=a}),As(()=>{o.value=void 0}),e({arrowRef:o}),(a,c)=>(G(),he("span",{ref_key:"arrowRef",ref:o,class:Y(T(i).e("arrow")),style:on(T(r)),"data-popper-arrow":""},null,6))}});var dXe=Rt(uXe,[["__file","arrow.vue"]]);const KEe=Lt({virtualRef:{type:Ke(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ke(Function)},onMouseleave:{type:Ke(Function)},onClick:{type:Ke(Function)},onKeydown:{type:Ke(Function)},onFocus:{type:Ke(Function)},onBlur:{type:Ke(Function)},onContextmenu:{type:Ke(Function)},id:String,open:Boolean}),jEe=Symbol("elForwardRef"),hXe=n=>{pi(jEe,{setForwardRef:t=>{n.value=t}})},fXe=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),gXe='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',pXe=n=>getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,fue=n=>Array.from(n.querySelectorAll(gXe)).filter(e=>vX(e)&&pXe(e)),vX=n=>{if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.tabIndex<0||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return!(n.type==="hidden"||n.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},TU=function(n,e,...t){let i;e.includes("mouse")||e.includes("click")?i="MouseEvents":e.includes("key")?i="KeyboardEvent":i="HTMLEvents";const s=document.createEvent(i);return s.initEvent(e,...t),n.dispatchEvent(s),n},XEe=n=>!n.getAttribute("aria-owns"),YEe=(n,e,t)=>{const{parentNode:i}=n;if(!i)return null;const s=i.querySelectorAll(t),o=Array.prototype.indexOf.call(s,n);return s[o+e]||null},CU=n=>{n&&(n.focus(),!XEe(n)&&n.click())},mXe="ElOnlyChild",qEe=$e({name:mXe,setup(n,{slots:e,attrs:t}){var i;const s=Kt(jEe),o=fXe((i=s==null?void 0:s.setForwardRef)!=null?i:ps);return()=>{var r;const a=(r=e.default)==null?void 0:r.call(e,t);if(!a||a.length>1)return null;const c=JEe(a);return c?Un(ib(c,t),[[o]]):null}}});function JEe(n){if(!n)return null;const e=n;for(const t of e){if(si(t))switch(t.type){case fa:continue;case ww:case"svg":return gue(t);case Qt:return JEe(t.children);default:return t}return gue(t)}return null}function gue(n){const e=vt("only-child");return ce("span",{class:e.e("content")},[n])}const _Xe=$e({name:"ElPopperTrigger",inheritAttrs:!1}),vXe=$e({..._Xe,props:KEe,setup(n,{expose:e}){const t=n,{role:i,triggerRef:s}=Kt(ate,void 0);hXe(s);const o=W(()=>a.value?t.id:void 0),r=W(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),a=W(()=>{if(i&&i.value!=="tooltip")return i.value}),c=W(()=>a.value?`${t.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return $n(()=>{ht(()=>t.virtualRef,f=>{f&&(s.value=Ou(f))},{immediate:!0}),ht(s,(f,g)=>{u==null||u(),u=void 0,mh(f)&&(d.forEach(p=>{var _;const v=t[p];v&&(f.addEventListener(p.slice(2).toLowerCase(),v),(_=g==null?void 0:g.removeEventListener)==null||_.call(g,p.slice(2).toLowerCase(),v))}),vX(f)&&(u=ht([o,r,a,c],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((_,v)=>{Ul(p[v])?f.removeAttribute(_):f.setAttribute(_,p[v])})},{immediate:!0}))),mh(g)&&vX(g)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>g.removeAttribute(p))},{immediate:!0})}),As(()=>{if(u==null||u(),u=void 0,s.value&&mh(s.value)){const f=s.value;d.forEach(g=>{const p=t[g];p&&f.removeEventListener(g.slice(2).toLowerCase(),p)}),s.value=void 0}}),e({triggerRef:s}),(f,g)=>f.virtualTriggering?Qe("v-if",!0):(G(),nt(T(qEe),hi({key:0},f.$attrs,{"aria-controls":T(o),"aria-describedby":T(r),"aria-expanded":T(c),"aria-haspopup":T(a)}),{default:_e(()=>[Ye(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var bXe=Rt(vXe,[["__file","trigger.vue"]]);const qz="focus-trap.focus-after-trapped",Jz="focus-trap.focus-after-released",TXe="focus-trap.focusout-prevented",pue={cancelable:!0,bubbles:!1},CXe={cancelable:!0,bubbles:!1},mue="focusAfterTrapped",_ue="focusAfterReleased",cte=Symbol("elFocusTrap"),ute=te(),S8=te(0),dte=te(0);let EH=0;const QEe=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},vue=(n,e)=>{for(const t of n)if(!yXe(t,e))return t},yXe=(n,e)=>{if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},EXe=n=>{const e=QEe(n),t=vue(e,n),i=vue(e.reverse(),n);return[t,i]},SXe=n=>n instanceof HTMLInputElement&&"select"in n,WT=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),dte.value=window.performance.now(),n!==t&&SXe(n)&&e&&n.select()}};function bue(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const wXe=()=>{let n=[];return{push:i=>{const s=n[0];s&&i!==s&&s.pause(),n=bue(n,i),n.unshift(i)},remove:i=>{var s,o;n=bue(n,i),(o=(s=n[0])==null?void 0:s.resume)==null||o.call(s)}}},IXe=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(WT(i,e),document.activeElement!==t)return},Tue=wXe(),LXe=()=>S8.value>dte.value,SH=()=>{ute.value="pointer",S8.value=window.performance.now()},Cue=()=>{ute.value="keyboard",S8.value=window.performance.now()},OXe=()=>($n(()=>{EH===0&&(document.addEventListener("mousedown",SH),document.addEventListener("touchstart",SH),document.addEventListener("keydown",Cue)),EH++}),As(()=>{EH--,EH<=0&&(document.removeEventListener("mousedown",SH),document.removeEventListener("touchstart",SH),document.removeEventListener("keydown",Cue))}),{focusReason:ute,lastUserFocusTimestamp:S8,lastAutomatedFocusTimestamp:dte}),wH=n=>new CustomEvent(TXe,{...CXe,detail:n}),zt={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"};let E1=[];const yue=n=>{n.code===zt.esc&&E1.forEach(e=>e(n))},RXe=n=>{$n(()=>{E1.length===0&&document.addEventListener("keydown",yue),Si&&E1.push(n)}),As(()=>{E1=E1.filter(e=>e!==n),E1.length===0&&Si&&document.removeEventListener("keydown",yue)})},MXe=$e({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[mue,_ue,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=te();let i,s;const{focusReason:o}=OXe();RXe(_=>{n.trapped&&!r.paused&&e("release-requested",_)});const r={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=_=>{if(!n.loop&&!n.trapped||r.paused)return;const{code:v,altKey:C,ctrlKey:y,metaKey:w,currentTarget:I,shiftKey:L}=_,{loop:O}=n,A=v===zt.tab&&!C&&!y&&!w,N=document.activeElement;if(A&&N){const D=I,[P,F]=EXe(D);if(P&&F){if(!L&&N===F){const U=wH({focusReason:o.value});e("focusout-prevented",U),U.defaultPrevented||(_.preventDefault(),O&&WT(P,!0))}else if(L&&[P,D].includes(N)){const U=wH({focusReason:o.value});e("focusout-prevented",U),U.defaultPrevented||(_.preventDefault(),O&&WT(F,!0))}}else if(N===D){const U=wH({focusReason:o.value});e("focusout-prevented",U),U.defaultPrevented||_.preventDefault()}}};pi(cte,{focusTrapRef:t,onKeydown:a}),ht(()=>n.focusTrapEl,_=>{_&&(t.value=_)},{immediate:!0}),ht([t],([_],[v])=>{_&&(_.addEventListener("keydown",a),_.addEventListener("focusin",d),_.addEventListener("focusout",f)),v&&(v.removeEventListener("keydown",a),v.removeEventListener("focusin",d),v.removeEventListener("focusout",f))});const c=_=>{e(mue,_)},u=_=>e(_ue,_),d=_=>{const v=T(t);if(!v)return;const C=_.target,y=_.relatedTarget,w=C&&v.contains(C);n.trapped||y&&v.contains(y)||(i=y),w&&e("focusin",_),!r.paused&&n.trapped&&(w?s=C:WT(s,!0))},f=_=>{const v=T(t);if(!(r.paused||!v))if(n.trapped){const C=_.relatedTarget;!Ul(C)&&!v.contains(C)&&setTimeout(()=>{if(!r.paused&&n.trapped){const y=wH({focusReason:o.value});e("focusout-prevented",y),y.defaultPrevented||WT(s,!0)}},0)}else{const C=_.target;C&&v.contains(C)||e("focusout",_)}};async function g(){await cn();const _=T(t);if(_){Tue.push(r);const v=_.contains(document.activeElement)?i:document.activeElement;if(i=v,!_.contains(v)){const y=new Event(qz,pue);_.addEventListener(qz,c),_.dispatchEvent(y),y.defaultPrevented||cn(()=>{let w=n.focusStartEl;sn(w)||(WT(w),document.activeElement!==w&&(w="first")),w==="first"&&IXe(QEe(_),!0),(document.activeElement===v||w==="container")&&WT(_)})}}}function p(){const _=T(t);if(_){_.removeEventListener(qz,c);const v=new CustomEvent(Jz,{...pue,detail:{focusReason:o.value}});_.addEventListener(Jz,u),_.dispatchEvent(v),!v.defaultPrevented&&(o.value=="keyboard"||!LXe()||_.contains(document.activeElement))&&WT(i??document.body),_.removeEventListener(Jz,u),Tue.remove(r)}}return $n(()=>{n.trapped&&g(),ht(()=>n.trapped,_=>{_?g():p()})}),As(()=>{n.trapped&&p(),t.value&&(t.value.removeEventListener("keydown",a),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",f),t.value=void 0)}),{onKeydown:a}}});function kXe(n,e,t,i,s,o){return Ye(n.$slots,"default",{handleKeydown:n.onKeydown})}var rM=Rt(MXe,[["render",kXe],["__file","focus-trap.vue"]]),Id="top",Gf="bottom",zf="right",Ld="left",hte="auto",aF=[Id,Gf,zf,Ld],qO="start",sx="end",AXe="clippingParents",ZEe="viewport",IN="popper",NXe="reference",Eue=aF.reduce(function(n,e){return n.concat([e+"-"+qO,e+"-"+sx])},[]),Rb=[].concat(aF,[hte]).reduce(function(n,e){return n.concat([e,e+"-"+qO,e+"-"+sx])},[]),DXe="beforeRead",$Xe="read",xXe="afterRead",PXe="beforeMain",FXe="main",BXe="afterMain",HXe="beforeWrite",VXe="write",UXe="afterWrite",WXe=[DXe,$Xe,xXe,PXe,FXe,BXe,HXe,VXe,UXe];function Km(n){return n?(n.nodeName||"").toLowerCase():null}function gp(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function JO(n){var e=gp(n).Element;return n instanceof e||n instanceof Element}function $f(n){var e=gp(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function fte(n){if(typeof ShadowRoot>"u")return!1;var e=gp(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function GXe(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},o=e.elements[t];!$f(o)||!Km(o)||(Object.assign(o.style,i),Object.keys(s).forEach(function(r){var a=s[r];a===!1?o.removeAttribute(r):o.setAttribute(r,a===!0?"":a)}))})}function zXe(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],o=e.attributes[i]||{},r=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=r.reduce(function(c,u){return c[u]="",c},{});!$f(s)||!Km(s)||(Object.assign(s.style,a),Object.keys(o).forEach(function(c){s.removeAttribute(c)}))})}}var eSe={name:"applyStyles",enabled:!0,phase:"write",fn:GXe,effect:zXe,requires:["computeStyles"]};function $m(n){return n.split("-")[0]}var a0=Math.max,mW=Math.min,QO=Math.round;function ZO(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,s=1;if($f(n)&&e){var o=n.offsetHeight,r=n.offsetWidth;r>0&&(i=QO(t.width)/r||1),o>0&&(s=QO(t.height)/o||1)}return{width:t.width/i,height:t.height/s,top:t.top/s,right:t.right/i,bottom:t.bottom/s,left:t.left/i,x:t.left/i,y:t.top/s}}function gte(n){var e=ZO(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function tSe(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&fte(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function lb(n){return gp(n).getComputedStyle(n)}function KXe(n){return["table","td","th"].indexOf(Km(n))>=0}function xy(n){return((JO(n)?n.ownerDocument:n.document)||window.document).documentElement}function w8(n){return Km(n)==="html"?n:n.assignedSlot||n.parentNode||(fte(n)?n.host:null)||xy(n)}function Sue(n){return!$f(n)||lb(n).position==="fixed"?null:n.offsetParent}function jXe(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&$f(n)){var i=lb(n);if(i.position==="fixed")return null}var s=w8(n);for(fte(s)&&(s=s.host);$f(s)&&["html","body"].indexOf(Km(s))<0;){var o=lb(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function cF(n){for(var e=gp(n),t=Sue(n);t&&KXe(t)&&lb(t).position==="static";)t=Sue(t);return t&&(Km(t)==="html"||Km(t)==="body"&&lb(t).position==="static")?e:t||jXe(n)||e}function pte(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function PD(n,e,t){return a0(n,mW(e,t))}function XXe(n,e,t){var i=PD(n,e,t);return i>t?t:i}function nSe(){return{top:0,right:0,bottom:0,left:0}}function iSe(n){return Object.assign({},nSe(),n)}function sSe(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var YXe=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,iSe(typeof n!="number"?n:sSe(n,aF))};function qXe(n){var e,t=n.state,i=n.name,s=n.options,o=t.elements.arrow,r=t.modifiersData.popperOffsets,a=$m(t.placement),c=pte(a),u=[Ld,zf].indexOf(a)>=0,d=u?"height":"width";if(!(!o||!r)){var f=YXe(s.padding,t),g=gte(o),p=c==="y"?Id:Ld,_=c==="y"?Gf:zf,v=t.rects.reference[d]+t.rects.reference[c]-r[c]-t.rects.popper[d],C=r[c]-t.rects.reference[c],y=cF(o),w=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,I=v/2-C/2,L=f[p],O=w-g[d]-f[_],A=w/2-g[d]/2+I,N=PD(L,A,O),D=c;t.modifiersData[i]=(e={},e[D]=N,e.centerOffset=N-A,e)}}function JXe(n){var e=n.state,t=n.options,i=t.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||!tSe(e.elements.popper,s)||(e.elements.arrow=s))}var QXe={name:"arrow",enabled:!0,phase:"main",fn:qXe,effect:JXe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function eR(n){return n.split("-")[1]}var ZXe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eYe(n){var e=n.x,t=n.y,i=window,s=i.devicePixelRatio||1;return{x:QO(e*s)/s||0,y:QO(t*s)/s||0}}function wue(n){var e,t=n.popper,i=n.popperRect,s=n.placement,o=n.variation,r=n.offsets,a=n.position,c=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,f=n.isFixed,g=r.x,p=g===void 0?0:g,_=r.y,v=_===void 0?0:_,C=typeof d=="function"?d({x:p,y:v}):{x:p,y:v};p=C.x,v=C.y;var y=r.hasOwnProperty("x"),w=r.hasOwnProperty("y"),I=Ld,L=Id,O=window;if(u){var A=cF(t),N="clientHeight",D="clientWidth";if(A===gp(t)&&(A=xy(t),lb(A).position!=="static"&&a==="absolute"&&(N="scrollHeight",D="scrollWidth")),A=A,s===Id||(s===Ld||s===zf)&&o===sx){L=Gf;var P=f&&A===O&&O.visualViewport?O.visualViewport.height:A[N];v-=P-i.height,v*=c?1:-1}if(s===Ld||(s===Id||s===Gf)&&o===sx){I=zf;var F=f&&A===O&&O.visualViewport?O.visualViewport.width:A[D];p-=F-i.width,p*=c?1:-1}}var V=Object.assign({position:a},u&&ZXe),U=d===!0?eYe({x:p,y:v}):{x:p,y:v};if(p=U.x,v=U.y,c){var Q;return Object.assign({},V,(Q={},Q[L]=w?"0":"",Q[I]=y?"0":"",Q.transform=(O.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",Q))}return Object.assign({},V,(e={},e[L]=w?v+"px":"",e[I]=y?p+"px":"",e.transform="",e))}function tYe(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,o=t.adaptive,r=o===void 0?!0:o,a=t.roundOffsets,c=a===void 0?!0:a,u={placement:$m(e.placement),variation:eR(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,wue(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,wue(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var oSe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tYe,data:{}},IH={passive:!0};function nYe(n){var e=n.state,t=n.instance,i=n.options,s=i.scroll,o=s===void 0?!0:s,r=i.resize,a=r===void 0?!0:r,c=gp(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",t.update,IH)}),a&&c.addEventListener("resize",t.update,IH),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",t.update,IH)}),a&&c.removeEventListener("resize",t.update,IH)}}var rSe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nYe,data:{}},iYe={left:"right",right:"left",bottom:"top",top:"bottom"};function yU(n){return n.replace(/left|right|bottom|top/g,function(e){return iYe[e]})}var sYe={start:"end",end:"start"};function Iue(n){return n.replace(/start|end/g,function(e){return sYe[e]})}function mte(n){var e=gp(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function _te(n){return ZO(xy(n)).left+mte(n).scrollLeft}function oYe(n){var e=gp(n),t=xy(n),i=e.visualViewport,s=t.clientWidth,o=t.clientHeight,r=0,a=0;return i&&(s=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(r=i.offsetLeft,a=i.offsetTop)),{width:s,height:o,x:r+_te(n),y:a}}function rYe(n){var e,t=xy(n),i=mte(n),s=(e=n.ownerDocument)==null?void 0:e.body,o=a0(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=a0(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+_te(n),c=-i.scrollTop;return lb(s||t).direction==="rtl"&&(a+=a0(t.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:c}}function vte(n){var e=lb(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function lSe(n){return["html","body","#document"].indexOf(Km(n))>=0?n.ownerDocument.body:$f(n)&&vte(n)?n:lSe(w8(n))}function FD(n,e){var t;e===void 0&&(e=[]);var i=lSe(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),o=gp(i),r=s?[o].concat(o.visualViewport||[],vte(i)?i:[]):i,a=e.concat(r);return s?a:a.concat(FD(w8(r)))}function bX(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function lYe(n){var e=ZO(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Lue(n,e){return e===ZEe?bX(oYe(n)):JO(e)?lYe(e):bX(rYe(xy(n)))}function aYe(n){var e=FD(w8(n)),t=["absolute","fixed"].indexOf(lb(n).position)>=0,i=t&&$f(n)?cF(n):n;return JO(i)?e.filter(function(s){return JO(s)&&tSe(s,i)&&Km(s)!=="body"}):[]}function cYe(n,e,t){var i=e==="clippingParents"?aYe(n):[].concat(e),s=[].concat(i,[t]),o=s[0],r=s.reduce(function(a,c){var u=Lue(n,c);return a.top=a0(u.top,a.top),a.right=mW(u.right,a.right),a.bottom=mW(u.bottom,a.bottom),a.left=a0(u.left,a.left),a},Lue(n,o));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function aSe(n){var e=n.reference,t=n.element,i=n.placement,s=i?$m(i):null,o=i?eR(i):null,r=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(s){case Id:c={x:r,y:e.y-t.height};break;case Gf:c={x:r,y:e.y+e.height};break;case zf:c={x:e.x+e.width,y:a};break;case Ld:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=s?pte(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case qO:c[u]=c[u]-(e[d]/2-t[d]/2);break;case sx:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function ox(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,o=t.boundary,r=o===void 0?AXe:o,a=t.rootBoundary,c=a===void 0?ZEe:a,u=t.elementContext,d=u===void 0?IN:u,f=t.altBoundary,g=f===void 0?!1:f,p=t.padding,_=p===void 0?0:p,v=iSe(typeof _!="number"?_:sSe(_,aF)),C=d===IN?NXe:IN,y=n.rects.popper,w=n.elements[g?C:d],I=cYe(JO(w)?w:w.contextElement||xy(n.elements.popper),r,c),L=ZO(n.elements.reference),O=aSe({reference:L,element:y,strategy:"absolute",placement:s}),A=bX(Object.assign({},y,O)),N=d===IN?A:L,D={top:I.top-N.top+v.top,bottom:N.bottom-I.bottom+v.bottom,left:I.left-N.left+v.left,right:N.right-I.right+v.right},P=n.modifiersData.offset;if(d===IN&&P){var F=P[s];Object.keys(D).forEach(function(V){var U=[zf,Gf].indexOf(V)>=0?1:-1,Q=[Id,Gf].indexOf(V)>=0?"y":"x";D[V]+=F[Q]*U})}return D}function uYe(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,o=t.rootBoundary,r=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,u=c===void 0?Rb:c,d=eR(i),f=d?a?Eue:Eue.filter(function(_){return eR(_)===d}):aF,g=f.filter(function(_){return u.indexOf(_)>=0});g.length===0&&(g=f);var p=g.reduce(function(_,v){return _[v]=ox(n,{placement:v,boundary:s,rootBoundary:o,padding:r})[$m(v)],_},{});return Object.keys(p).sort(function(_,v){return p[_]-p[v]})}function dYe(n){if($m(n)===hte)return[];var e=yU(n);return[Iue(n),e,Iue(e)]}function hYe(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,o=s===void 0?!0:s,r=t.altAxis,a=r===void 0?!0:r,c=t.fallbackPlacements,u=t.padding,d=t.boundary,f=t.rootBoundary,g=t.altBoundary,p=t.flipVariations,_=p===void 0?!0:p,v=t.allowedAutoPlacements,C=e.options.placement,y=$m(C),w=y===C,I=c||(w||!_?[yU(C)]:dYe(C)),L=[C].concat(I).reduce(function(Ne,qe){return Ne.concat($m(qe)===hte?uYe(e,{placement:qe,boundary:d,rootBoundary:f,padding:u,flipVariations:_,allowedAutoPlacements:v}):qe)},[]),O=e.rects.reference,A=e.rects.popper,N=new Map,D=!0,P=L[0],F=0;F<L.length;F++){var V=L[F],U=$m(V),Q=eR(V)===qO,de=[Id,Gf].indexOf(U)>=0,q=de?"width":"height",K=ox(e,{placement:V,boundary:d,rootBoundary:f,altBoundary:g,padding:u}),re=de?Q?zf:Ld:Q?Gf:Id;O[q]>A[q]&&(re=yU(re));var Z=yU(re),J=[];if(o&&J.push(K[U]<=0),a&&J.push(K[re]<=0,K[Z]<=0),J.every(function(Ne){return Ne})){P=V,D=!1;break}N.set(V,J)}if(D)for(var ge=_?3:1,ve=function(Ne){var qe=L.find(function(Re){var we=N.get(Re);if(we)return we.slice(0,Ne).every(function(Ve){return Ve})});if(qe)return P=qe,"break"},Le=ge;Le>0;Le--){var Ee=ve(Le);if(Ee==="break")break}e.placement!==P&&(e.modifiersData[i]._skip=!0,e.placement=P,e.reset=!0)}}var fYe={name:"flip",enabled:!0,phase:"main",fn:hYe,requiresIfExists:["offset"],data:{_skip:!1}};function Oue(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Rue(n){return[Id,zf,Gf,Ld].some(function(e){return n[e]>=0})}function gYe(n){var e=n.state,t=n.name,i=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=ox(e,{elementContext:"reference"}),a=ox(e,{altBoundary:!0}),c=Oue(r,i),u=Oue(a,s,o),d=Rue(c),f=Rue(u);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var pYe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gYe};function mYe(n,e,t){var i=$m(n),s=[Ld,Id].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Ld,zf].indexOf(i)>=0?{x:a,y:r}:{x:r,y:a}}function _Ye(n){var e=n.state,t=n.options,i=n.name,s=t.offset,o=s===void 0?[0,0]:s,r=Rb.reduce(function(d,f){return d[f]=mYe(f,e.rects,o),d},{}),a=r[e.placement],c=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[i]=r}var vYe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_Ye};function bYe(n){var e=n.state,t=n.name;e.modifiersData[t]=aSe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var cSe={name:"popperOffsets",enabled:!0,phase:"read",fn:bYe,data:{}};function TYe(n){return n==="x"?"y":"x"}function CYe(n){var e=n.state,t=n.options,i=n.name,s=t.mainAxis,o=s===void 0?!0:s,r=t.altAxis,a=r===void 0?!1:r,c=t.boundary,u=t.rootBoundary,d=t.altBoundary,f=t.padding,g=t.tether,p=g===void 0?!0:g,_=t.tetherOffset,v=_===void 0?0:_,C=ox(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),y=$m(e.placement),w=eR(e.placement),I=!w,L=pte(y),O=TYe(L),A=e.modifiersData.popperOffsets,N=e.rects.reference,D=e.rects.popper,P=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,F=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(A){if(o){var Q,de=L==="y"?Id:Ld,q=L==="y"?Gf:zf,K=L==="y"?"height":"width",re=A[L],Z=re+C[de],J=re-C[q],ge=p?-D[K]/2:0,ve=w===qO?N[K]:D[K],Le=w===qO?-D[K]:-N[K],Ee=e.elements.arrow,Ne=p&&Ee?gte(Ee):{width:0,height:0},qe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:nSe(),Re=qe[de],we=qe[q],Ve=PD(0,N[K],Ne[K]),Ge=I?N[K]/2-ge-Ve-Re-F.mainAxis:ve-Ve-Re-F.mainAxis,dt=I?-N[K]/2+ge+Ve+we+F.mainAxis:Le+Ve+we+F.mainAxis,ze=e.elements.arrow&&cF(e.elements.arrow),ee=ze?L==="y"?ze.clientTop||0:ze.clientLeft||0:0,ye=(Q=V==null?void 0:V[L])!=null?Q:0,Me=re+Ge-ye-ee,et=re+dt-ye,at=PD(p?mW(Z,Me):Z,re,p?a0(J,et):J);A[L]=at,U[L]=at-re}if(a){var Ue,Se=L==="x"?Id:Ld,Ie=L==="x"?Gf:zf,Xe=A[O],it=O==="y"?"height":"width",Tt=Xe+C[Se],He=Xe-C[Ie],ke=[Id,Ld].indexOf(y)!==-1,ot=(Ue=V==null?void 0:V[O])!=null?Ue:0,Ct=ke?Tt:Xe-N[it]-D[it]-ot+F.altAxis,Gt=ke?Xe+N[it]+D[it]-ot-F.altAxis:He,Ot=p&&ke?XXe(Ct,Xe,Gt):PD(p?Ct:Tt,Xe,p?Gt:He);A[O]=Ot,U[O]=Ot-Xe}e.modifiersData[i]=U}}var yYe={name:"preventOverflow",enabled:!0,phase:"main",fn:CYe,requiresIfExists:["offset"]};function EYe(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function SYe(n){return n===gp(n)||!$f(n)?mte(n):EYe(n)}function wYe(n){var e=n.getBoundingClientRect(),t=QO(e.width)/n.offsetWidth||1,i=QO(e.height)/n.offsetHeight||1;return t!==1||i!==1}function IYe(n,e,t){t===void 0&&(t=!1);var i=$f(e),s=$f(e)&&wYe(e),o=xy(e),r=ZO(n,s),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!t)&&((Km(e)!=="body"||vte(o))&&(a=SYe(e)),$f(e)?(c=ZO(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=_te(o))),{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function LYe(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function s(o){t.add(o.name);var r=[].concat(o.requires||[],o.requiresIfExists||[]);r.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&s(c)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||s(o)}),i}function OYe(n){var e=LYe(n);return WXe.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function RYe(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function MYe(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Mue={placement:"bottom",modifiers:[],strategy:"absolute"};function kue(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function bte(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,s=e.defaultOptions,o=s===void 0?Mue:s;return function(r,a,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mue,o),modifiersData:{},elements:{reference:r,popper:a},attributes:{},styles:{}},d=[],f=!1,g={state:u,setOptions:function(v){var C=typeof v=="function"?v(u.options):v;_(),u.options=Object.assign({},o,u.options,C),u.scrollParents={reference:JO(r)?FD(r):r.contextElement?FD(r.contextElement):[],popper:FD(a)};var y=OYe(MYe([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(w){return w.enabled}),p(),g.update()},forceUpdate:function(){if(!f){var v=u.elements,C=v.reference,y=v.popper;if(kue(C,y)){u.rects={reference:IYe(C,cF(y),u.options.strategy==="fixed"),popper:gte(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(D){return u.modifiersData[D.name]=Object.assign({},D.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var I=u.orderedModifiers[w],L=I.fn,O=I.options,A=O===void 0?{}:O,N=I.name;typeof L=="function"&&(u=L({state:u,options:A,name:N,instance:g})||u)}}}},update:RYe(function(){return new Promise(function(v){g.forceUpdate(),v(u)})}),destroy:function(){_(),f=!0}};if(!kue(r,a))return g;g.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)});function p(){u.orderedModifiers.forEach(function(v){var C=v.name,y=v.options,w=y===void 0?{}:y,I=v.effect;if(typeof I=="function"){var L=I({state:u,name:C,instance:g,options:w}),O=function(){};d.push(L||O)}})}function _(){d.forEach(function(v){return v()}),d=[]}return g}}bte();var kYe=[rSe,cSe,oSe,eSe];bte({defaultModifiers:kYe});var AYe=[rSe,cSe,oSe,eSe,vYe,fYe,yYe,QXe,pYe],NYe=bte({defaultModifiers:AYe});const DYe=["fixed","absolute"],$Ye=Lt({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ke(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Rb,default:"bottom"},popperOptions:{type:Ke(Object),default:()=>({})},strategy:{type:String,values:DYe,default:"absolute"}}),uSe=Lt({...$Ye,id:String,style:{type:Ke([String,Array,Object])},className:{type:Ke([String,Array,Object])},effect:{type:Ke(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ke([String,Array,Object])},popperStyle:{type:Ke([String,Array,Object])},referenceEl:{type:Ke(Object)},triggerTargetEl:{type:Ke(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Wa(["ariaLabel"])}),xYe={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},PYe=(n,e)=>{const t=te(!1),i=te();return{focusStartRef:i,trapped:t,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{n.visible&&!t.value&&(u.target&&(i.value=u.target),t.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},FYe=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:s}=n,o={placement:t,strategy:i,...s,modifiers:[...HYe(n),...e]};return VYe(o,s==null?void 0:s.modifiers),o},BYe=n=>{if(Si)return Ou(n)};function HYe(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function VYe(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const UYe=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=WYe(c);Object.assign(r.value,u)},requires:["computeStyles"]},s=W(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=T(t);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],i,{name:"applyStyles",enabled:!1}]}}),o=us(),r=te({styles:{popper:{position:T(s).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{o.value&&(o.value.destroy(),o.value=void 0)};return ht(s,c=>{const u=T(o);u&&u.setOptions(c)},{deep:!0}),ht([n,e],([c,u])=>{a(),!(!c||!u)&&(o.value=NYe(c,u,T(s)))}),As(()=>{a()}),{state:W(()=>{var c;return{...((c=T(o))==null?void 0:c.state)||{}}}),styles:W(()=>T(r).styles),attributes:W(()=>T(r).attributes),update:()=>{var c;return(c=T(o))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=T(o))==null?void 0:c.forceUpdate()},instanceRef:W(()=>T(o))}};function WYe(n){const e=Object.keys(n.elements),t=ix(e.map(s=>[s,n.styles[s]||{}])),i=ix(e.map(s=>[s,n.attributes[s]]));return{styles:t,attributes:i}}const GYe=0,zYe=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:s}=Kt(ate,void 0),o=te(),r=te(),a=W(()=>({name:"eventListeners",enabled:!!n.visible})),c=W(()=>{var y;const w=T(o),I=(y=T(r))!=null?y:GYe;return{name:"arrow",enabled:!pEe(w),options:{element:w,padding:I}}}),u=W(()=>({onFirstUpdate:()=>{_()},...FYe(n,[T(c),T(a)])})),d=W(()=>BYe(n.referenceEl)||T(i)),{attributes:f,state:g,styles:p,update:_,forceUpdate:v,instanceRef:C}=UYe(d,t,u);return ht(C,y=>e.value=y),$n(()=>{ht(()=>{var y;return(y=T(d))==null?void 0:y.getBoundingClientRect()},()=>{_()})}),{attributes:f,arrowRef:o,contentRef:t,instanceRef:C,state:g,styles:p,role:s,forceUpdate:v,update:_}},KYe=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:s}=sM(),o=vt("popper"),r=W(()=>T(e).popper),a=te(gn(n.zIndex)?n.zIndex:s()),c=W(()=>[o.b(),o.is("pure",n.pure),o.is(n.effect),n.popperClass]),u=W(()=>[{zIndex:T(a)},T(t).popper,n.popperStyle||{}]),d=W(()=>i.value==="dialog"?"false":void 0),f=W(()=>T(t).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:r,contentClass:c,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=gn(n.zIndex)?n.zIndex:s()}}},jYe=$e({name:"ElPopperContent"}),XYe=$e({...jYe,props:uSe,emits:xYe,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:s,trapped:o,onFocusAfterReleased:r,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=PYe(i,t),{attributes:f,arrowRef:g,contentRef:p,styles:_,instanceRef:v,role:C,update:y}=zYe(i),{ariaModal:w,arrowStyle:I,contentAttrs:L,contentClass:O,contentStyle:A,updateZIndex:N}=KYe(i,{styles:_,attributes:f,role:C}),D=Kt(zm,void 0),P=te();pi(WEe,{arrowStyle:I,arrowRef:g,arrowOffset:P}),D&&pi(zm,{...D,addInputId:ps,removeInputId:ps});let F;const V=(Q=!0)=>{y(),Q&&N()},U=()=>{V(!1),i.visible&&i.focusOnShow?o.value=!0:i.visible===!1&&(o.value=!1)};return $n(()=>{ht(()=>i.triggerTargetEl,(Q,de)=>{F==null||F(),F=void 0;const q=T(Q||p.value),K=T(de||p.value);mh(q)&&(F=ht([C,()=>i.ariaLabel,w,()=>i.id],re=>{["role","aria-label","aria-modal","id"].forEach((Z,J)=>{Ul(re[J])?q.removeAttribute(Z):q.setAttribute(Z,re[J])})},{immediate:!0})),K!==q&&mh(K)&&["role","aria-label","aria-modal","id"].forEach(re=>{K.removeAttribute(re)})},{immediate:!0}),ht(()=>i.visible,U,{immediate:!0})}),As(()=>{F==null||F(),F=void 0}),e({popperContentRef:p,popperInstanceRef:v,updatePopper:V,contentStyle:A}),(Q,de)=>(G(),he("div",hi({ref_key:"contentRef",ref:p},T(L),{style:T(A),class:T(O),tabindex:"-1",onMouseenter:q=>Q.$emit("mouseenter",q),onMouseleave:q=>Q.$emit("mouseleave",q)}),[ce(T(rM),{trapped:T(o),"trap-on-focus-in":!0,"focus-trap-el":T(p),"focus-start-el":T(s),onFocusAfterTrapped:T(a),onFocusAfterReleased:T(r),onFocusin:T(c),onFocusoutPrevented:T(u),onReleaseRequested:T(d)},{default:_e(()=>[Ye(Q.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var YYe=Rt(XYe,[["__file","content.vue"]]);const dSe=Nn(aXe),I8=Symbol("elTooltip");function Aue(){let n;const e=(i,s)=>{t(),n=window.setTimeout(i,s)},t=()=>window.clearTimeout(n);return sF(()=>t()),{registerTimeout:e,cancelTimeout:t}}const qYe=Lt({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),JYe=({showAfter:n,hideAfter:e,autoClose:t,open:i,close:s})=>{const{registerTimeout:o}=Aue(),{registerTimeout:r,cancelTimeout:a}=Aue();return{onOpen:d=>{o(()=>{i(d);const f=T(t);gn(f)&&f>0&&r(()=>{s(d)},f)},T(n))},onClose:d=>{a(),o(()=>{s(d)},T(e))}}},ua=Lt({...qYe,...uSe,appendTo:{type:Ke([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ke(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Wa(["ariaLabel"])}),rx=Lt({...KEe,disabled:Boolean,trigger:{type:Ke([String,Array]),default:"hover"},triggerKeys:{type:Ke(Array),default:()=>[zt.enter,zt.numpadEnter,zt.space]}}),QYe=fp({type:Ke(Boolean),default:null}),ZYe=fp({type:Ke(Function)}),eqe=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],s={[n]:QYe,[t]:ZYe};return{useModelToggle:({indicator:r,toggleReason:a,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const g=Qn(),{emit:p}=g,_=g.props,v=W(()=>ln(_[t])),C=W(()=>_[n]===null),y=N=>{r.value!==!0&&(r.value=!0,a&&(a.value=N),ln(d)&&d(N))},w=N=>{r.value!==!1&&(r.value=!1,a&&(a.value=N),ln(f)&&f(N))},I=N=>{if(_.disabled===!0||ln(u)&&!u())return;const D=v.value&&Si;D&&p(e,!0),(C.value||!D)&&y(N)},L=N=>{if(_.disabled===!0||!Si)return;const D=v.value&&Si;D&&p(e,!1),(C.value||!D)&&w(N)},O=N=>{Us(N)&&(_.disabled&&N?v.value&&p(e,!1):r.value!==N&&(N?y():w()))},A=()=>{r.value?L():I()};return ht(()=>_[n],O),c&&g.appContext.config.globalProperties.$route!==void 0&&ht(()=>({...g.proxy.$route}),()=>{c.value&&r.value&&L()}),$n(()=>{O(_[n])}),{hide:L,show:I,toggle:A,hasUpdateHandler:v}},useModelToggleProps:s,useModelToggleEmits:i}},{useModelToggleProps:tqe,useModelToggleEmits:nqe,useModelToggle:iqe}=eqe("visible"),sqe=Lt({...GEe,...tqe,...ua,...rx,...zEe,showArrow:{type:Boolean,default:!0}}),oqe=[...nqe,"before-show","before-hide","show","hide","open","close"],rqe=(n,e)=>yt(n)?n.includes(e):n===e,jL=(n,e,t)=>i=>{rqe(T(n),e)&&t(i)},pr=(n,e,{checkForDefaultPrevented:t=!0}={})=>s=>{const o=n==null?void 0:n(s);if(t===!1||!o)return e==null?void 0:e(s)},Nue=n=>e=>e.pointerType==="mouse"?n(e):void 0,lqe=$e({name:"ElTooltipTrigger"}),aqe=$e({...lqe,props:rx,setup(n,{expose:e}){const t=n,i=vt("tooltip"),{controlled:s,id:o,open:r,onOpen:a,onClose:c,onToggle:u}=Kt(I8,void 0),d=te(null),f=()=>{if(T(s)||t.disabled)return!0},g=ds(t,"trigger"),p=pr(f,jL(g,"hover",a)),_=pr(f,jL(g,"hover",c)),v=pr(f,jL(g,"click",L=>{L.button===0&&u(L)})),C=pr(f,jL(g,"focus",a)),y=pr(f,jL(g,"focus",c)),w=pr(f,jL(g,"contextmenu",L=>{L.preventDefault(),u(L)})),I=pr(f,L=>{const{code:O}=L;t.triggerKeys.includes(O)&&(L.preventDefault(),u(L))});return e({triggerRef:d}),(L,O)=>(G(),nt(T(bXe),{id:T(o),"virtual-ref":L.virtualRef,open:T(r),"virtual-triggering":L.virtualTriggering,class:Y(T(i).e("trigger")),onBlur:T(y),onClick:T(v),onContextmenu:T(w),onFocus:T(C),onMouseenter:T(p),onMouseleave:T(_),onKeydown:T(I)},{default:_e(()=>[Ye(L.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var cqe=Rt(aqe,[["__file","trigger.vue"]]);const uqe=Lt({to:{type:Ke([String,Object]),required:!0},disabled:Boolean}),dqe=$e({__name:"teleport",props:uqe,setup(n){return(e,t)=>e.disabled?Ye(e.$slots,"default",{key:0}):(G(),nt(hDe,{key:1,to:e.to},[Ye(e.$slots,"default")],8,["to"]))}});var hqe=Rt(dqe,[["__file","teleport.vue"]]);const lM=Nn(hqe),hSe=()=>{const n=Aee(),e=rte(),t=W(()=>`${n.value}-popper-container-${e.prefix}`),i=W(()=>`#${t.value}`);return{id:t,selector:i}},fqe=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},gqe=()=>{const{id:n,selector:e}=hSe();return A5(()=>{Si&&(document.body.querySelector(e.value)||fqe(n.value))}),{id:n,selector:e}},pqe=$e({name:"ElTooltipContent",inheritAttrs:!1}),mqe=$e({...pqe,props:ua,setup(n,{expose:e}){const t=n,{selector:i}=hSe(),s=vt("tooltip"),o=te();let r;const{controlled:a,id:c,open:u,trigger:d,onClose:f,onOpen:g,onShow:p,onHide:_,onBeforeShow:v,onBeforeHide:C}=Kt(I8,void 0),y=W(()=>t.transition||`${s.namespace.value}-fade-in-linear`),w=W(()=>t.persistent);As(()=>{r==null||r()});const I=W(()=>T(w)?!0:T(u)),L=W(()=>t.disabled?!1:T(u)),O=W(()=>t.appendTo||i.value),A=W(()=>{var K;return(K=t.style)!=null?K:{}}),N=te(!0),D=()=>{_(),N.value=!0},P=()=>{if(T(a))return!0},F=pr(P,()=>{t.enterable&&T(d)==="hover"&&g()}),V=pr(P,()=>{T(d)==="hover"&&f()}),U=()=>{var K,re;(re=(K=o.value)==null?void 0:K.updatePopper)==null||re.call(K),v==null||v()},Q=()=>{C==null||C()},de=()=>{p(),r=Yee(W(()=>{var K;return(K=o.value)==null?void 0:K.popperContentRef}),()=>{if(T(a))return;T(d)!=="hover"&&f()})},q=()=>{t.virtualTriggering||f()};return ht(()=>T(u),K=>{K?N.value=!1:r==null||r()},{flush:"post"}),ht(()=>t.content,()=>{var K,re;(re=(K=o.value)==null?void 0:K.updatePopper)==null||re.call(K)}),e({contentRef:o}),(K,re)=>(G(),nt(T(lM),{disabled:!K.teleported,to:T(O)},{default:_e(()=>[ce(Ta,{name:T(y),onAfterLeave:D,onBeforeEnter:U,onAfterEnter:de,onBeforeLeave:Q},{default:_e(()=>[T(I)?Un((G(),nt(T(YYe),hi({key:0,id:T(c),ref_key:"contentRef",ref:o},K.$attrs,{"aria-label":K.ariaLabel,"aria-hidden":N.value,"boundaries-padding":K.boundariesPadding,"fallback-placements":K.fallbackPlacements,"gpu-acceleration":K.gpuAcceleration,offset:K.offset,placement:K.placement,"popper-options":K.popperOptions,strategy:K.strategy,effect:K.effect,enterable:K.enterable,pure:K.pure,"popper-class":K.popperClass,"popper-style":[K.popperStyle,T(A)],"reference-el":K.referenceEl,"trigger-target-el":K.triggerTargetEl,visible:T(L),"z-index":K.zIndex,onMouseenter:T(F),onMouseleave:T(V),onBlur:q,onClose:T(f)}),{default:_e(()=>[Ye(K.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[Gi,T(L)]]):Qe("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var _qe=Rt(mqe,[["__file","content.vue"]]);const vqe=$e({name:"ElTooltip"}),bqe=$e({...vqe,props:sqe,emits:oqe,setup(n,{expose:e,emit:t}){const i=n;gqe();const s=Va(),o=te(),r=te(),a=()=>{var y;const w=T(o);w&&((y=w.popperInstanceRef)==null||y.update())},c=te(!1),u=te(),{show:d,hide:f,hasUpdateHandler:g}=iqe({indicator:c,toggleReason:u}),{onOpen:p,onClose:_}=JYe({showAfter:ds(i,"showAfter"),hideAfter:ds(i,"hideAfter"),autoClose:ds(i,"autoClose"),open:d,close:f}),v=W(()=>Us(i.visible)&&!g.value);pi(I8,{controlled:v,id:s,open:XR(c),trigger:ds(i,"trigger"),onOpen:y=>{p(y)},onClose:y=>{_(y)},onToggle:y=>{T(c)?_(y):p(y)},onShow:()=>{t("show",u.value)},onHide:()=>{t("hide",u.value)},onBeforeShow:()=>{t("before-show",u.value)},onBeforeHide:()=>{t("before-hide",u.value)},updatePopper:a}),ht(()=>i.disabled,y=>{y&&c.value&&(c.value=!1)});const C=y=>{var w,I;const L=(I=(w=r.value)==null?void 0:w.contentRef)==null?void 0:I.popperContentRef,O=(y==null?void 0:y.relatedTarget)||document.activeElement;return L&&L.contains(O)};return Q_e(()=>c.value&&f()),e({popperRef:o,contentRef:r,isFocusInsideContent:C,updatePopper:a,onOpen:p,onClose:_,hide:f}),(y,w)=>(G(),nt(T(dSe),{ref_key:"popperRef",ref:o,role:y.role},{default:_e(()=>[ce(cqe,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:_e(()=>[y.$slots.default?Ye(y.$slots,"default",{key:0}):Qe("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),ce(_qe,{ref_key:"contentRef",ref:r,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:_e(()=>[Ye(y.$slots,"content",{},()=>[y.rawContent?(G(),he("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(G(),he("span",{key:1},st(y.content),1))]),y.showArrow?(G(),nt(T(dXe),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):Qe("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Tqe=Rt(bqe,[["__file","tooltip.vue"]]);const uc=Nn(Tqe),Cqe=Lt({valueKey:{type:String,default:"value"},modelValue:{type:[String,Number],default:""},debounce:{type:Number,default:300},placement:{type:Ke(String),values:["top","top-start","top-end","bottom","bottom-start","bottom-end"],default:"bottom-start"},fetchSuggestions:{type:Ke([Function,Array]),default:ps},popperClass:{type:String,default:""},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},hideLoading:{type:Boolean,default:!1},teleported:ua.teleported,highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:String,...Wa(["ariaLabel"])}),yqe={[Kn]:n=>sn(n),[rc]:n=>sn(n),[Ms]:n=>sn(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,select:n=>si(n)},fSe="ElAutocomplete",Eqe=$e({name:fSe,inheritAttrs:!1}),Sqe=$e({...Eqe,props:Cqe,emits:yqe,setup(n,{expose:e,emit:t}){const i=n,s=rF(),o=Ly(),r=gc(),a=vt("autocomplete"),c=te(),u=te(),d=te(),f=te();let g=!1,p=!1;const _=te([]),v=te(-1),C=te(""),y=te(!1),w=te(!1),I=te(!1),L=Va(),O=W(()=>o.style),A=W(()=>(_.value.length>0||I.value)&&y.value),N=W(()=>!i.hideLoading&&I.value),D=W(()=>c.value?Array.from(c.value.$el.querySelectorAll("input")):[]),P=()=>{A.value&&(C.value=`${c.value.$el.offsetWidth}px`)},F=()=>{v.value=-1},V=async we=>{if(w.value)return;const Ve=Ge=>{I.value=!1,!w.value&&(yt(Ge)?(_.value=Ge,v.value=i.highlightFirstItem?0:-1):Ll(fSe,"autocomplete suggestions must be an array"))};if(I.value=!0,yt(i.fetchSuggestions))Ve(i.fetchSuggestions);else{const Ge=await i.fetchSuggestions(we,Ve);yt(Ge)&&Ve(Ge)}},U=Md(V,i.debounce),Q=we=>{const Ve=!!we;if(t(rc,we),t(Kn,we),w.value=!1,y.value||(y.value=Ve),!i.triggerOnFocus&&!we){w.value=!0,_.value=[];return}U(we)},de=we=>{var Ve;r.value||(((Ve=we.target)==null?void 0:Ve.tagName)!=="INPUT"||D.value.includes(document.activeElement))&&(y.value=!0)},q=we=>{t(Ms,we)},K=we=>{p?p=!1:(y.value=!0,t("focus",we),i.triggerOnFocus&&!g&&U(String(i.modelValue)))},re=we=>{setTimeout(()=>{var Ve;if((Ve=d.value)!=null&&Ve.isFocusInsideContent()){p=!0;return}y.value&&ve(),t("blur",we)})},Z=()=>{y.value=!1,t(Kn,""),t("clear")},J=async()=>{A.value&&v.value>=0&&v.value<_.value.length?Ne(_.value[v.value]):i.selectWhenUnmatched&&(t("select",{value:i.modelValue}),_.value=[],v.value=-1)},ge=we=>{A.value&&(we.preventDefault(),we.stopPropagation(),ve())},ve=()=>{y.value=!1},Le=()=>{var we;(we=c.value)==null||we.focus()},Ee=()=>{var we;(we=c.value)==null||we.blur()},Ne=async we=>{t(rc,we[i.valueKey]),t(Kn,we[i.valueKey]),t("select",we),_.value=[],v.value=-1},qe=we=>{if(!A.value||I.value)return;if(we<0){v.value=-1;return}we>=_.value.length&&(we=_.value.length-1);const Ve=u.value.querySelector(`.${a.be("suggestion","wrap")}`),dt=Ve.querySelectorAll(`.${a.be("suggestion","list")} li`)[we],ze=Ve.scrollTop,{offsetTop:ee,scrollHeight:ye}=dt;ee+ye>ze+Ve.clientHeight&&(Ve.scrollTop+=ye),ee<ze&&(Ve.scrollTop-=ye),v.value=we,c.value.ref.setAttribute("aria-activedescendant",`${L.value}-item-${v.value}`)},Re=Yee(f,()=>{A.value&&ve()});return As(()=>{Re==null||Re()}),$n(()=>{c.value.ref.setAttribute("role","textbox"),c.value.ref.setAttribute("aria-autocomplete","list"),c.value.ref.setAttribute("aria-controls","id"),c.value.ref.setAttribute("aria-activedescendant",`${L.value}-item-${v.value}`),g=c.value.ref.hasAttribute("readonly")}),e({highlightedIndex:v,activated:y,loading:I,inputRef:c,popperRef:d,suggestions:_,handleSelect:Ne,handleKeyEnter:J,focus:Le,blur:Ee,close:ve,highlight:qe,getData:V}),(we,Ve)=>(G(),nt(T(uc),{ref_key:"popperRef",ref:d,visible:T(A),placement:we.placement,"fallback-placements":["bottom-start","top-start"],"popper-class":[T(a).e("popper"),we.popperClass],teleported:we.teleported,"gpu-acceleration":!1,pure:"","manual-mode":"",effect:"light",trigger:"click",transition:`${T(a).namespace.value}-zoom-in-top`,persistent:"",role:"listbox",onBeforeShow:P,onHide:F},{content:_e(()=>[oe("div",{ref_key:"regionRef",ref:u,class:Y([T(a).b("suggestion"),T(a).is("loading",T(N))]),style:on({[we.fitInputWidth?"width":"minWidth"]:C.value,outline:"none"}),role:"region"},[ce(T(a_),{id:T(L),tag:"ul","wrap-class":T(a).be("suggestion","wrap"),"view-class":T(a).be("suggestion","list"),role:"listbox"},{default:_e(()=>[T(N)?(G(),he("li",{key:0},[Ye(we.$slots,"loading",{},()=>[ce(T(tn),{class:Y(T(a).is("loading"))},{default:_e(()=>[ce(T(Gm))]),_:1},8,["class"])])])):(G(!0),he(Qt,{key:1},fi(_.value,(Ge,dt)=>(G(),he("li",{id:`${T(L)}-item-${dt}`,key:dt,class:Y({highlighted:v.value===dt}),role:"option","aria-selected":v.value===dt,onClick:ze=>Ne(Ge)},[Ye(we.$slots,"default",{item:Ge},()=>[mn(st(Ge[we.valueKey]),1)])],10,["id","aria-selected","onClick"]))),128))]),_:3},8,["id","wrap-class","view-class"])],6)]),default:_e(()=>[oe("div",{ref_key:"listboxRef",ref:f,class:Y([T(a).b(),we.$attrs.class]),style:on(T(O)),role:"combobox","aria-haspopup":"listbox","aria-expanded":T(A),"aria-owns":T(L)},[ce(T(Kc),hi({ref_key:"inputRef",ref:c},T(s),{clearable:we.clearable,disabled:T(r),name:we.name,"model-value":we.modelValue,"aria-label":we.ariaLabel,onInput:Q,onChange:q,onFocus:K,onBlur:re,onClear:Z,onKeydown:[xs(bn(Ge=>qe(v.value-1),["prevent"]),["up"]),xs(bn(Ge=>qe(v.value+1),["prevent"]),["down"]),xs(J,["enter"]),xs(ve,["tab"]),xs(ge,["esc"])],onMousedown:de}),Hf({_:2},[we.$slots.prepend?{name:"prepend",fn:_e(()=>[Ye(we.$slots,"prepend")])}:void 0,we.$slots.append?{name:"append",fn:_e(()=>[Ye(we.$slots,"append")])}:void 0,we.$slots.prefix?{name:"prefix",fn:_e(()=>[Ye(we.$slots,"prefix")])}:void 0,we.$slots.suffix?{name:"suffix",fn:_e(()=>[Ye(we.$slots,"suffix")])}:void 0]),1040,["clearable","disabled","name","model-value","aria-label","onKeydown"])],14,["aria-expanded","aria-owns"])]),_:3},8,["visible","placement","popper-class","teleported","transition"]))}});var wqe=Rt(Sqe,[["__file","autocomplete.vue"]]);const Iqe=Nn(wqe),Lqe=Lt({size:{type:[Number,String],values:l_,default:"",validator:n=>gn(n)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:ks},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:Ke(String),default:"cover"}}),Oqe={error:n=>n instanceof Event},Rqe=$e({name:"ElAvatar"}),Mqe=$e({...Rqe,props:Lqe,emits:Oqe,setup(n,{emit:e}){const t=n,i=vt("avatar"),s=te(!1),o=W(()=>{const{size:u,icon:d,shape:f}=t,g=[i.b()];return sn(u)&&g.push(i.m(u)),d&&g.push(i.m("icon")),f&&g.push(i.m(f)),g}),r=W(()=>{const{size:u}=t;return gn(u)?i.cssVarBlock({size:mr(u)||""}):void 0}),a=W(()=>({objectFit:t.fit}));ht(()=>t.src,()=>s.value=!1);function c(u){s.value=!0,e("error",u)}return(u,d)=>(G(),he("span",{class:Y(T(o)),style:on(T(r))},[(u.src||u.srcSet)&&!s.value?(G(),he("img",{key:0,src:u.src,alt:u.alt,srcset:u.srcSet,style:on(T(a)),onError:c},null,44,["src","alt","srcset"])):u.icon?(G(),nt(T(tn),{key:1},{default:_e(()=>[(G(),nt(ui(u.icon)))]),_:1})):Ye(u.$slots,"default",{key:2})],6))}});var kqe=Rt(Mqe,[["__file","avatar.vue"]]);const Aqe=Nn(kqe),Nqe={visibilityHeight:{type:Number,default:200},target:{type:String,default:""},right:{type:Number,default:40},bottom:{type:Number,default:40}},Dqe={click:n=>n instanceof MouseEvent},$qe=(n,e,t)=>{const i=us(),s=us(),o=te(!1),r=()=>{i.value&&(o.value=i.value.scrollTop>=n.visibilityHeight)},a=u=>{var d;(d=i.value)==null||d.scrollTo({top:0,behavior:"smooth"}),e("click",u)},c=bEe(r,300,!0);return Es(s,"scroll",c),$n(()=>{var u;s.value=document,i.value=document.documentElement,n.target&&(i.value=(u=document.querySelector(n.target))!=null?u:void 0,i.value||Ll(t,`target does not exist: ${n.target}`),s.value=i.value),r()}),{visible:o,handleClick:a}},gSe="ElBacktop",xqe=$e({name:gSe}),Pqe=$e({...xqe,props:Nqe,emits:Dqe,setup(n,{emit:e}){const t=n,i=vt("backtop"),{handleClick:s,visible:o}=$qe(t,e,gSe),r=W(()=>({right:`${t.right}px`,bottom:`${t.bottom}px`}));return(a,c)=>(G(),nt(Ta,{name:`${T(i).namespace.value}-fade-in`},{default:_e(()=>[T(o)?(G(),he("div",{key:0,style:on(T(r)),class:Y(T(i).b()),onClick:bn(T(s),["stop"])},[Ye(a.$slots,"default",{},()=>[ce(T(tn),{class:Y(T(i).e("icon"))},{default:_e(()=>[ce(T(EKe))]),_:1},8,["class"])])],14,["onClick"])):Qe("v-if",!0)]),_:3},8,["name"]))}});var Fqe=Rt(Pqe,[["__file","backtop.vue"]]);const Bqe=Nn(Fqe),Hqe=Lt({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:Ke([String,Object,Array])},offset:{type:Ke(Array),default:[0,0]},badgeClass:{type:String}}),Vqe=$e({name:"ElBadge"}),Uqe=$e({...Vqe,props:Hqe,setup(n,{expose:e}){const t=n,i=vt("badge"),s=W(()=>t.isDot?"":gn(t.value)&&gn(t.max)?t.max<t.value?`${t.max}+`:`${t.value}`:`${t.value}`),o=W(()=>{var r,a,c,u,d;return[{backgroundColor:t.color,marginRight:mr(-((a=(r=t.offset)==null?void 0:r[0])!=null?a:0)),marginTop:mr((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:s}),(r,a)=>(G(),he("div",{class:Y(T(i).b())},[Ye(r.$slots,"default"),ce(Ta,{name:`${T(i).namespace.value}-zoom-in-center`,persisted:""},{default:_e(()=>[Un(oe("sup",{class:Y([T(i).e("content"),T(i).em("content",r.type),T(i).is("fixed",!!r.$slots.default),T(i).is("dot",r.isDot),T(i).is("hide-zero",!r.showZero&&t.value===0),r.badgeClass]),style:on(T(o))},[Ye(r.$slots,"content",{value:T(s)},()=>[mn(st(T(s)),1)])],6),[[Gi,!r.hidden&&(T(s)||r.isDot||r.$slots.content)]])]),_:3},8,["name"])],2))}});var Wqe=Rt(Uqe,[["__file","badge.vue"]]);const pSe=Nn(Wqe),mSe=Symbol("breadcrumbKey"),Gqe=Lt({separator:{type:String,default:"/"},separatorIcon:{type:ks}}),zqe=$e({name:"ElBreadcrumb"}),Kqe=$e({...zqe,props:Gqe,setup(n){const e=n,{t}=wi(),i=vt("breadcrumb"),s=te();return pi(mSe,e),$n(()=>{const o=s.value.querySelectorAll(`.${i.e("item")}`);o.length&&o[o.length-1].setAttribute("aria-current","page")}),(o,r)=>(G(),he("div",{ref_key:"breadcrumb",ref:s,class:Y(T(i).b()),"aria-label":T(t)("el.breadcrumb.label"),role:"navigation"},[Ye(o.$slots,"default")],10,["aria-label"]))}});var jqe=Rt(Kqe,[["__file","breadcrumb.vue"]]);const Xqe=Lt({to:{type:Ke([String,Object]),default:""},replace:Boolean}),Yqe=$e({name:"ElBreadcrumbItem"}),qqe=$e({...Yqe,props:Xqe,setup(n){const e=n,t=Qn(),i=Kt(mSe,void 0),s=vt("breadcrumb"),o=t.appContext.config.globalProperties.$router,r=te(),a=()=>{!e.to||!o||(e.replace?o.replace(e.to):o.push(e.to))};return(c,u)=>{var d,f;return G(),he("span",{class:Y(T(s).e("item"))},[oe("span",{ref_key:"link",ref:r,class:Y([T(s).e("inner"),T(s).is("link",!!c.to)]),role:"link",onClick:a},[Ye(c.$slots,"default")],2),(d=T(i))!=null&&d.separatorIcon?(G(),nt(T(tn),{key:0,class:Y(T(s).e("separator"))},{default:_e(()=>[(G(),nt(ui(T(i).separatorIcon)))]),_:1},8,["class"])):(G(),he("span",{key:1,class:Y(T(s).e("separator")),role:"presentation"},st((f=T(i))==null?void 0:f.separator),3))],2)}}});var _Se=Rt(qqe,[["__file","breadcrumb-item.vue"]]);const Jqe=Nn(jqe,{BreadcrumbItem:_Se}),Qqe=Xo(_Se),vSe=Symbol("buttonGroupContextKey"),RC=({from:n,replacement:e,scope:t,version:i,ref:s,type:o="API"},r)=>{ht(()=>T(r),a=>{},{immediate:!0})},Zqe=(n,e)=>{RC({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},W(()=>n.type==="text"));const t=Kt(vSe,void 0),i=b8("button"),{form:s}=fc(),o=jr(W(()=>t==null?void 0:t.size)),r=gc(),a=te(),c=dl(),u=W(()=>n.type||(t==null?void 0:t.type)||""),d=W(()=>{var _,v,C;return(C=(v=n.autoInsertSpace)!=null?v:(_=i.value)==null?void 0:_.autoInsertSpace)!=null?C:!1}),f=W(()=>n.tag==="button"?{ariaDisabled:r.value||n.loading,disabled:r.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),g=W(()=>{var _;const v=(_=c.default)==null?void 0:_.call(c);if(d.value&&(v==null?void 0:v.length)===1){const C=v[0];if((C==null?void 0:C.type)===ww){const y=C.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:r,_size:o,_type:u,_ref:a,_props:f,shouldAddSpace:g,handleClick:_=>{if(r.value||n.loading){_.stopPropagation();return}n.nativeType==="reset"&&(s==null||s.resetFields()),e("click",_)}}},TX=["default","primary","success","warning","info","danger","text",""],eJe=["button","submit","reset"],CX=Lt({size:cl,disabled:Boolean,type:{type:String,values:TX,default:""},icon:{type:ks},nativeType:{type:String,values:eJe,default:"button"},loading:Boolean,loadingIcon:{type:ks,default:()=>Gm},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ke([String,Object]),default:"button"}}),tJe={click:n=>n instanceof MouseEvent};function lc(n,e){nJe(n)&&(n="100%");var t=iJe(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function LH(n){return Math.min(1,Math.max(0,n))}function nJe(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function iJe(n){return typeof n=="string"&&n.indexOf("%")!==-1}function bSe(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function OH(n){return n<=1?"".concat(Number(n)*100,"%"):n}function US(n){return n.length===1?"0"+n:String(n)}function sJe(n,e,t){return{r:lc(n,255)*255,g:lc(e,255)*255,b:lc(t,255)*255}}function Due(n,e,t){n=lc(n,255),e=lc(e,255),t=lc(t,255);var i=Math.max(n,e,t),s=Math.min(n,e,t),o=0,r=0,a=(i+s)/2;if(i===s)r=0,o=0;else{var c=i-s;switch(r=a>.5?c/(2-i-s):c/(i+s),i){case n:o=(e-t)/c+(e<t?6:0);break;case e:o=(t-n)/c+2;break;case t:o=(n-e)/c+4;break}o/=6}return{h:o,s:r,l:a}}function Qz(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function oJe(n,e,t){var i,s,o;if(n=lc(n,360),e=lc(e,100),t=lc(t,100),e===0)s=t,o=t,i=t;else{var r=t<.5?t*(1+e):t+e-t*e,a=2*t-r;i=Qz(a,r,n+1/3),s=Qz(a,r,n),o=Qz(a,r,n-1/3)}return{r:i*255,g:s*255,b:o*255}}function $ue(n,e,t){n=lc(n,255),e=lc(e,255),t=lc(t,255);var i=Math.max(n,e,t),s=Math.min(n,e,t),o=0,r=i,a=i-s,c=i===0?0:a/i;if(i===s)o=0;else{switch(i){case n:o=(e-t)/a+(e<t?6:0);break;case e:o=(t-n)/a+2;break;case t:o=(n-e)/a+4;break}o/=6}return{h:o,s:c,v:r}}function rJe(n,e,t){n=lc(n,360)*6,e=lc(e,100),t=lc(t,100);var i=Math.floor(n),s=n-i,o=t*(1-e),r=t*(1-s*e),a=t*(1-(1-s)*e),c=i%6,u=[t,r,o,o,a,t][c],d=[a,t,t,r,o,o][c],f=[o,o,a,t,t,r][c];return{r:u*255,g:d*255,b:f*255}}function xue(n,e,t,i){var s=[US(Math.round(n).toString(16)),US(Math.round(e).toString(16)),US(Math.round(t).toString(16))];return i&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function lJe(n,e,t,i,s){var o=[US(Math.round(n).toString(16)),US(Math.round(e).toString(16)),US(Math.round(t).toString(16)),US(aJe(i))];return s&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function aJe(n){return Math.round(parseFloat(n)*255).toString(16)}function Pue(n){return th(n)/255}function th(n){return parseInt(n,16)}function cJe(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var yX={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function uJe(n){var e={r:0,g:0,b:0},t=1,i=null,s=null,o=null,r=!1,a=!1;return typeof n=="string"&&(n=fJe(n)),typeof n=="object"&&(lv(n.r)&&lv(n.g)&&lv(n.b)?(e=sJe(n.r,n.g,n.b),r=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):lv(n.h)&&lv(n.s)&&lv(n.v)?(i=OH(n.s),s=OH(n.v),e=rJe(n.h,i,s),r=!0,a="hsv"):lv(n.h)&&lv(n.s)&&lv(n.l)&&(i=OH(n.s),o=OH(n.l),e=oJe(n.h,i,o),r=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=bSe(t),{ok:r,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var dJe="[-\\+]?\\d+%?",hJe="[-\\+]?\\d*\\.\\d+%?",mC="(?:".concat(hJe,")|(?:").concat(dJe,")"),Zz="[\\s|\\(]+(".concat(mC,")[,|\\s]+(").concat(mC,")[,|\\s]+(").concat(mC,")\\s*\\)?"),e9="[\\s|\\(]+(".concat(mC,")[,|\\s]+(").concat(mC,")[,|\\s]+(").concat(mC,")[,|\\s]+(").concat(mC,")\\s*\\)?"),Cg={CSS_UNIT:new RegExp(mC),rgb:new RegExp("rgb"+Zz),rgba:new RegExp("rgba"+e9),hsl:new RegExp("hsl"+Zz),hsla:new RegExp("hsla"+e9),hsv:new RegExp("hsv"+Zz),hsva:new RegExp("hsva"+e9),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function fJe(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(yX[n])n=yX[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Cg.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Cg.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Cg.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Cg.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Cg.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Cg.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Cg.hex8.exec(n),t?{r:th(t[1]),g:th(t[2]),b:th(t[3]),a:Pue(t[4]),format:e?"name":"hex8"}:(t=Cg.hex6.exec(n),t?{r:th(t[1]),g:th(t[2]),b:th(t[3]),format:e?"name":"hex"}:(t=Cg.hex4.exec(n),t?{r:th(t[1]+t[1]),g:th(t[2]+t[2]),b:th(t[3]+t[3]),a:Pue(t[4]+t[4]),format:e?"name":"hex8"}:(t=Cg.hex3.exec(n),t?{r:th(t[1]+t[1]),g:th(t[2]+t[2]),b:th(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function lv(n){return!!Cg.CSS_UNIT.exec(String(n))}var TSe=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=cJe(e)),this.originalInput=e;var s=uJe(e);this.originalInput=e,this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:s.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=s.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,s,o=e.r/255,r=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),a<=.03928?s=a/12.92:s=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*s},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=bSe(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=$ue(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=$ue(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),s=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(s,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(s,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=Due(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=Due(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),s=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(s,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(s,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),xue(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),lJe(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(lc(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(lc(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+xue(this.r,this.g,this.b,!1),t=0,i=Object.entries(yX);t<i.length;t++){var s=i[t],o=s[0],r=s[1];if(e===r)return o}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,s=this.a<1&&this.a>=0,o=!t&&s&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=LH(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=LH(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=LH(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=LH(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),s=new n(e).toRgb(),o=t/100,r={r:(s.r-i.r)*o+i.r,g:(s.g-i.g)*o+i.g,b:(s.b-i.b)*o+i.b,a:(s.a-i.a)*o+i.a};return new n(r)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),s=360/t,o=[this];for(i.h=(i.h-(s*e>>1)+720)%360;--e;)i.h=(i.h+s)%360,o.push(new n(i));return o},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,s=t.s,o=t.v,r=[],a=1/e;e--;)r.push(new n({h:i,s,v:o})),o=(o+a)%1;return r},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),s=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/s,g:(t.g*t.a+i.g*i.a*(1-t.a))/s,b:(t.b*t.a+i.b*i.a*(1-t.a))/s,a:s})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,s=[this],o=360/e,r=1;r<e;r++)s.push(new n({h:(i+r*o)%360,s:t.s,l:t.l}));return s},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function NT(n,e=20){return n.mix("#141414",e).toString()}function gJe(n){const e=gc(),t=vt("button");return W(()=>{let i={},s=n.color;if(s){const o=s.match(/var\((.*?)\)/);o&&(s=window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));const r=new TSe(s),a=n.dark?r.tint(20).toString():NT(r,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?NT(r,90):r.tint(90).toString(),"text-color":s,"border-color":n.dark?NT(r,50):r.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":s,"hover-border-color":s,"active-bg-color":a,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":a}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?NT(r,90):r.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?NT(r,50):r.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?NT(r,80):r.tint(80).toString());else{const c=n.dark?NT(r,30):r.tint(30).toString(),u=r.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":s,"text-color":u,"border-color":s,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":a,"active-border-color":a}),e.value){const d=n.dark?NT(r,50):r.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=d,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=d}}}return i})}const pJe=$e({name:"ElButton"}),mJe=$e({...pJe,props:CX,emits:tJe,setup(n,{expose:e,emit:t}){const i=n,s=gJe(i),o=vt("button"),{_ref:r,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:g}=Zqe(i,t),p=W(()=>[o.b(),o.m(c.value),o.m(a.value),o.is("disabled",u.value),o.is("loading",i.loading),o.is("plain",i.plain),o.is("round",i.round),o.is("circle",i.circle),o.is("text",i.text),o.is("link",i.link),o.is("has-bg",i.bg)]);return e({ref:r,size:a,type:c,disabled:u,shouldAddSpace:f}),(_,v)=>(G(),nt(ui(_.tag),hi({ref_key:"_ref",ref:r},T(d),{class:T(p),style:T(s),onClick:T(g)}),{default:_e(()=>[_.loading?(G(),he(Qt,{key:0},[_.$slots.loading?Ye(_.$slots,"loading",{key:0}):(G(),nt(T(tn),{key:1,class:Y(T(o).is("loading"))},{default:_e(()=>[(G(),nt(ui(_.loadingIcon)))]),_:1},8,["class"]))],64)):_.icon||_.$slots.icon?(G(),nt(T(tn),{key:1},{default:_e(()=>[_.icon?(G(),nt(ui(_.icon),{key:0})):Ye(_.$slots,"icon",{key:1})]),_:3})):Qe("v-if",!0),_.$slots.default?(G(),he("span",{key:2,class:Y({[T(o).em("text","expand")]:T(f)})},[Ye(_.$slots,"default")],2)):Qe("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var _Je=Rt(mJe,[["__file","button.vue"]]);const vJe={size:CX.size,type:CX.type},bJe=$e({name:"ElButtonGroup"}),TJe=$e({...bJe,props:vJe,setup(n){const e=n;pi(vSe,Ki({size:ds(e,"size"),type:ds(e,"type")}));const t=vt("button");return(i,s)=>(G(),he("div",{class:Y(T(t).b("group"))},[Ye(i.$slots,"default")],2))}});var CSe=Rt(TJe,[["__file","button-group.vue"]]);const _a=Nn(_Je,{ButtonGroup:CSe}),ySe=Xo(CSe);var EU={exports:{}},CJe=EU.exports,Fue;function yJe(){return Fue||(Fue=1,function(n,e){(function(t,i){n.exports=i()})(CJe,function(){var t=1e3,i=6e4,s=36e5,o="millisecond",r="second",a="minute",c="hour",u="day",d="week",f="month",g="quarter",p="year",_="date",v="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(de){var q=["th","st","nd","rd"],K=de%100;return"["+de+(q[(K-20)%10]||q[K]||q[0])+"]"}},I=function(de,q,K){var re=String(de);return!re||re.length>=q?de:""+Array(q+1-re.length).join(K)+de},L={s:I,z:function(de){var q=-de.utcOffset(),K=Math.abs(q),re=Math.floor(K/60),Z=K%60;return(q<=0?"+":"-")+I(re,2,"0")+":"+I(Z,2,"0")},m:function de(q,K){if(q.date()<K.date())return-de(K,q);var re=12*(K.year()-q.year())+(K.month()-q.month()),Z=q.clone().add(re,f),J=K-Z<0,ge=q.clone().add(re+(J?-1:1),f);return+(-(re+(K-Z)/(J?Z-ge:ge-Z))||0)},a:function(de){return de<0?Math.ceil(de)||0:Math.floor(de)},p:function(de){return{M:f,y:p,w:d,d:u,D:_,h:c,m:a,s:r,ms:o,Q:g}[de]||String(de||"").toLowerCase().replace(/s$/,"")},u:function(de){return de===void 0}},O="en",A={};A[O]=w;var N="$isDayjsObject",D=function(de){return de instanceof U||!(!de||!de[N])},P=function de(q,K,re){var Z;if(!q)return O;if(typeof q=="string"){var J=q.toLowerCase();A[J]&&(Z=J),K&&(A[J]=K,Z=J);var ge=q.split("-");if(!Z&&ge.length>1)return de(ge[0])}else{var ve=q.name;A[ve]=q,Z=ve}return!re&&Z&&(O=Z),Z||!re&&O},F=function(de,q){if(D(de))return de.clone();var K=typeof q=="object"?q:{};return K.date=de,K.args=arguments,new U(K)},V=L;V.l=P,V.i=D,V.w=function(de,q){return F(de,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var U=function(){function de(K){this.$L=P(K.locale,null,!0),this.parse(K),this.$x=this.$x||K.x||{},this[N]=!0}var q=de.prototype;return q.parse=function(K){this.$d=function(re){var Z=re.date,J=re.utc;if(Z===null)return new Date(NaN);if(V.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var ge=Z.match(C);if(ge){var ve=ge[2]-1||0,Le=(ge[7]||"0").substring(0,3);return J?new Date(Date.UTC(ge[1],ve,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,Le)):new Date(ge[1],ve,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,Le)}}return new Date(Z)}(K),this.init()},q.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},q.$utils=function(){return V},q.isValid=function(){return this.$d.toString()!==v},q.isSame=function(K,re){var Z=F(K);return this.startOf(re)<=Z&&Z<=this.endOf(re)},q.isAfter=function(K,re){return F(K)<this.startOf(re)},q.isBefore=function(K,re){return this.endOf(re)<F(K)},q.$g=function(K,re,Z){return V.u(K)?this[re]:this.set(Z,K)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(K,re){var Z=this,J=!!V.u(re)||re,ge=V.p(K),ve=function(Ge,dt){var ze=V.w(Z.$u?Date.UTC(Z.$y,dt,Ge):new Date(Z.$y,dt,Ge),Z);return J?ze:ze.endOf(u)},Le=function(Ge,dt){return V.w(Z.toDate()[Ge].apply(Z.toDate("s"),(J?[0,0,0,0]:[23,59,59,999]).slice(dt)),Z)},Ee=this.$W,Ne=this.$M,qe=this.$D,Re="set"+(this.$u?"UTC":"");switch(ge){case p:return J?ve(1,0):ve(31,11);case f:return J?ve(1,Ne):ve(0,Ne+1);case d:var we=this.$locale().weekStart||0,Ve=(Ee<we?Ee+7:Ee)-we;return ve(J?qe-Ve:qe+(6-Ve),Ne);case u:case _:return Le(Re+"Hours",0);case c:return Le(Re+"Minutes",1);case a:return Le(Re+"Seconds",2);case r:return Le(Re+"Milliseconds",3);default:return this.clone()}},q.endOf=function(K){return this.startOf(K,!1)},q.$set=function(K,re){var Z,J=V.p(K),ge="set"+(this.$u?"UTC":""),ve=(Z={},Z[u]=ge+"Date",Z[_]=ge+"Date",Z[f]=ge+"Month",Z[p]=ge+"FullYear",Z[c]=ge+"Hours",Z[a]=ge+"Minutes",Z[r]=ge+"Seconds",Z[o]=ge+"Milliseconds",Z)[J],Le=J===u?this.$D+(re-this.$W):re;if(J===f||J===p){var Ee=this.clone().set(_,1);Ee.$d[ve](Le),Ee.init(),this.$d=Ee.set(_,Math.min(this.$D,Ee.daysInMonth())).$d}else ve&&this.$d[ve](Le);return this.init(),this},q.set=function(K,re){return this.clone().$set(K,re)},q.get=function(K){return this[V.p(K)]()},q.add=function(K,re){var Z,J=this;K=Number(K);var ge=V.p(re),ve=function(Ne){var qe=F(J);return V.w(qe.date(qe.date()+Math.round(Ne*K)),J)};if(ge===f)return this.set(f,this.$M+K);if(ge===p)return this.set(p,this.$y+K);if(ge===u)return ve(1);if(ge===d)return ve(7);var Le=(Z={},Z[a]=i,Z[c]=s,Z[r]=t,Z)[ge]||1,Ee=this.$d.getTime()+K*Le;return V.w(Ee,this)},q.subtract=function(K,re){return this.add(-1*K,re)},q.format=function(K){var re=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||v;var J=K||"YYYY-MM-DDTHH:mm:ssZ",ge=V.z(this),ve=this.$H,Le=this.$m,Ee=this.$M,Ne=Z.weekdays,qe=Z.months,Re=Z.meridiem,we=function(dt,ze,ee,ye){return dt&&(dt[ze]||dt(re,J))||ee[ze].slice(0,ye)},Ve=function(dt){return V.s(ve%12||12,dt,"0")},Ge=Re||function(dt,ze,ee){var ye=dt<12?"AM":"PM";return ee?ye.toLowerCase():ye};return J.replace(y,function(dt,ze){return ze||function(ee){switch(ee){case"YY":return String(re.$y).slice(-2);case"YYYY":return V.s(re.$y,4,"0");case"M":return Ee+1;case"MM":return V.s(Ee+1,2,"0");case"MMM":return we(Z.monthsShort,Ee,qe,3);case"MMMM":return we(qe,Ee);case"D":return re.$D;case"DD":return V.s(re.$D,2,"0");case"d":return String(re.$W);case"dd":return we(Z.weekdaysMin,re.$W,Ne,2);case"ddd":return we(Z.weekdaysShort,re.$W,Ne,3);case"dddd":return Ne[re.$W];case"H":return String(ve);case"HH":return V.s(ve,2,"0");case"h":return Ve(1);case"hh":return Ve(2);case"a":return Ge(ve,Le,!0);case"A":return Ge(ve,Le,!1);case"m":return String(Le);case"mm":return V.s(Le,2,"0");case"s":return String(re.$s);case"ss":return V.s(re.$s,2,"0");case"SSS":return V.s(re.$ms,3,"0");case"Z":return ge}return null}(dt)||ge.replace(":","")})},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(K,re,Z){var J,ge=this,ve=V.p(re),Le=F(K),Ee=(Le.utcOffset()-this.utcOffset())*i,Ne=this-Le,qe=function(){return V.m(ge,Le)};switch(ve){case p:J=qe()/12;break;case f:J=qe();break;case g:J=qe()/3;break;case d:J=(Ne-Ee)/6048e5;break;case u:J=(Ne-Ee)/864e5;break;case c:J=Ne/s;break;case a:J=Ne/i;break;case r:J=Ne/t;break;default:J=Ne}return Z?J:V.a(J)},q.daysInMonth=function(){return this.endOf(f).$D},q.$locale=function(){return A[this.$L]},q.locale=function(K,re){if(!K)return this.$L;var Z=this.clone(),J=P(K,re,!0);return J&&(Z.$L=J),Z},q.clone=function(){return V.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},de}(),Q=U.prototype;return F.prototype=Q,[["$ms",o],["$s",r],["$m",a],["$H",c],["$W",u],["$M",f],["$y",p],["$D",_]].forEach(function(de){Q[de[1]]=function(q){return this.$g(q,de[0],de[1])}}),F.extend=function(de,q){return de.$i||(de(q,U,F),de.$i=!0),F},F.locale=P,F.isDayjs=D,F.unix=function(de){return F(1e3*de)},F.en=A[O],F.Ls=A,F.p={},F})}(EU)),EU.exports}var EJe=yJe();const Mn=cp(EJe),t9=(n,e)=>[n>0?n-1:void 0,n,n<e?n+1:void 0],MC=n=>Array.from(Array.from({length:n}).keys()),ESe=n=>n.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim(),SSe=n=>n.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g,"").trim(),Bue=function(n,e){const t=WC(n),i=WC(e);return t&&i?n.getTime()===e.getTime():!t&&!i?n===e:!1},Hue=function(n,e){const t=yt(n),i=yt(e);return t&&i?n.length!==e.length?!1:n.every((s,o)=>Bue(s,e[o])):!t&&!i?Bue(n,e):!1},Vue=function(n,e,t){const i=oh(e)||e==="x"?Mn(n).locale(t):Mn(n,e).locale(t);return i.isValid()?i:void 0},Uue=function(n,e,t){return oh(e)?n:e==="x"?+n:Mn(n).locale(t).format(e)},n9=(n,e)=>{var t;const i=[],s=e==null?void 0:e();for(let o=0;o<n;o++)i.push((t=s==null?void 0:s.includes(o))!=null?t:!1);return i},RH=n=>yt(n)?n.map(e=>e.toDate()):n.toDate(),SJe=(n,e)=>{const t=n.subtract(1,"month").endOf("month").date();return MC(e).map((i,s)=>t-(e-s-1))},wJe=n=>{const e=n.daysInMonth();return MC(e).map((t,i)=>i+1)},IJe=n=>MC(n.length/7).map(e=>{const t=e*7;return n.slice(t,t+7)}),LJe=Lt({selectedDay:{type:Ke(Object)},range:{type:Ke(Array)},date:{type:Ke(Object),required:!0},hideHeader:{type:Boolean}}),OJe={pick:n=>si(n)};var SU={exports:{}},RJe=SU.exports,Wue;function MJe(){return Wue||(Wue=1,function(n,e){(function(t,i){n.exports=i()})(RJe,function(){return function(t,i,s){var o=i.prototype,r=function(f){return f&&(f.indexOf?f:f.s)},a=function(f,g,p,_,v){var C=f.name?f:f.$locale(),y=r(C[g]),w=r(C[p]),I=y||w.map(function(O){return O.slice(0,_)});if(!v)return I;var L=C.weekStart;return I.map(function(O,A){return I[(A+(L||0))%7]})},c=function(){return s.Ls[s.locale()]},u=function(f,g){return f.formats[g]||function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(_,v,C){return v||C.slice(1)})}(f.formats[g.toUpperCase()])},d=function(){var f=this;return{months:function(g){return g?g.format("MMMM"):a(f,"months")},monthsShort:function(g){return g?g.format("MMM"):a(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(g){return g?g.format("dddd"):a(f,"weekdays")},weekdaysMin:function(g){return g?g.format("dd"):a(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(g){return g?g.format("ddd"):a(f,"weekdaysShort","weekdays",3)},longDateFormat:function(g){return u(f.$locale(),g)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return d.bind(this)()},s.localeData=function(){var f=c();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(g){return u(f,g)},meridiem:f.meridiem,ordinal:f.ordinal}},s.months=function(){return a(c(),"months")},s.monthsShort=function(){return a(c(),"monthsShort","months",3)},s.weekdays=function(f){return a(c(),"weekdays",null,null,f)},s.weekdaysShort=function(f){return a(c(),"weekdaysShort","weekdays",3,f)},s.weekdaysMin=function(f){return a(c(),"weekdaysMin","weekdays",2,f)}}})}(SU)),SU.exports}var kJe=MJe();const wSe=cp(kJe),AJe=["year","years","month","months","date","dates","week","datetime","datetimerange","daterange","monthrange","yearrange"],i9=["sun","mon","tue","wed","thu","fri","sat"],NJe=(n,e)=>{Mn.extend(wSe);const t=Mn.localeData().firstDayOfWeek(),{t:i,lang:s}=wi(),o=Mn().locale(s.value),r=W(()=>!!n.range&&!!n.range.length),a=W(()=>{let g=[];if(r.value){const[p,_]=n.range,v=MC(_.date()-p.date()+1).map(w=>({text:p.date()+w,type:"current"}));let C=v.length%7;C=C===0?0:7-C;const y=MC(C).map((w,I)=>({text:I+1,type:"next"}));g=v.concat(y)}else{const p=n.date.startOf("month").day(),_=SJe(n.date,(p-t+7)%7).map(w=>({text:w,type:"prev"})),v=wJe(n.date).map(w=>({text:w,type:"current"}));g=[..._,...v];const C=7-(g.length%7||7),y=MC(C).map((w,I)=>({text:I+1,type:"next"}));g=g.concat(y)}return IJe(g)}),c=W(()=>{const g=t;return g===0?i9.map(p=>i(`el.datepicker.weeks.${p}`)):i9.slice(g).concat(i9.slice(0,g)).map(p=>i(`el.datepicker.weeks.${p}`))}),u=(g,p)=>{switch(p){case"prev":return n.date.startOf("month").subtract(1,"month").date(g);case"next":return n.date.startOf("month").add(1,"month").date(g);case"current":return n.date.date(g)}};return{now:o,isInRange:r,rows:a,weekDays:c,getFormattedDate:u,handlePickDay:({text:g,type:p})=>{const _=u(g,p);e("pick",_)},getSlotData:({text:g,type:p})=>{const _=u(g,p);return{isSelected:_.isSame(n.selectedDay),type:`${p}-month`,day:_.format("YYYY-MM-DD"),date:_.toDate()}}}},DJe=$e({name:"DateTable"}),$Je=$e({...DJe,props:LJe,emits:OJe,setup(n,{expose:e,emit:t}){const i=n,{isInRange:s,now:o,rows:r,weekDays:a,getFormattedDate:c,handlePickDay:u,getSlotData:d}=NJe(i,t),f=vt("calendar-table"),g=vt("calendar-day"),p=({text:_,type:v})=>{const C=[v];if(v==="current"){const y=c(_,v);y.isSame(i.selectedDay,"day")&&C.push(g.is("selected")),y.isSame(o,"day")&&C.push(g.is("today"))}return C};return e({getFormattedDate:c}),(_,v)=>(G(),he("table",{class:Y([T(f).b(),T(f).is("range",T(s))]),cellspacing:"0",cellpadding:"0"},[_.hideHeader?Qe("v-if",!0):(G(),he("thead",{key:0},[oe("tr",null,[(G(!0),he(Qt,null,fi(T(a),C=>(G(),he("th",{key:C,scope:"col"},st(C),1))),128))])])),oe("tbody",null,[(G(!0),he(Qt,null,fi(T(r),(C,y)=>(G(),he("tr",{key:y,class:Y({[T(f).e("row")]:!0,[T(f).em("row","hide-border")]:y===0&&_.hideHeader})},[(G(!0),he(Qt,null,fi(C,(w,I)=>(G(),he("td",{key:I,class:Y(p(w)),onClick:L=>T(u)(w)},[oe("div",{class:Y(T(g).b())},[Ye(_.$slots,"date-cell",{data:T(d)(w)},()=>[oe("span",null,st(w.text),1)])],2)],10,["onClick"]))),128))],2))),128))])],2))}});var Gue=Rt($Je,[["__file","date-table.vue"]]);const xJe=(n,e)=>{const t=n.endOf("month"),i=e.startOf("month"),o=t.isSame(i,"week")?i.add(1,"week"):i;return[[n,t],[o.startOf("week"),e]]},PJe=(n,e)=>{const t=n.endOf("month"),i=n.add(1,"month").startOf("month"),s=t.isSame(i,"week")?i.add(1,"week"):i,o=s.endOf("month"),r=e.startOf("month"),a=o.isSame(r,"week")?r.add(1,"week"):r;return[[n,t],[s.startOf("week"),o],[a.startOf("week"),e]]},FJe=(n,e,t)=>{const{lang:i}=wi(),s=te(),o=Mn().locale(i.value),r=W({get(){return n.modelValue?c.value:s.value},set(C){if(!C)return;s.value=C;const y=C.toDate();e(rc,y),e(Kn,y)}}),a=W(()=>{if(!n.range||!yt(n.range)||n.range.length!==2||n.range.some(I=>!WC(I)))return[];const C=n.range.map(I=>Mn(I).locale(i.value)),[y,w]=C;return y.isAfter(w)?[]:y.isSame(w,"month")?p(y,w):y.add(1,"month").month()!==w.month()?[]:p(y,w)}),c=W(()=>n.modelValue?Mn(n.modelValue).locale(i.value):r.value||(a.value.length?a.value[0][0]:o)),u=W(()=>c.value.subtract(1,"month").date(1)),d=W(()=>c.value.add(1,"month").date(1)),f=W(()=>c.value.subtract(1,"year").date(1)),g=W(()=>c.value.add(1,"year").date(1)),p=(C,y)=>{const w=C.startOf("week"),I=y.endOf("week"),L=w.get("month"),O=I.get("month");return L===O?[[w,I]]:(L+1)%12===O?xJe(w,I):L+2===O||(L+1)%11===O?PJe(w,I):[]},_=C=>{r.value=C};return{calculateValidatedDateRange:p,date:c,realSelectedDay:r,pickDay:_,selectDate:C=>{const w={"prev-month":u.value,"next-month":d.value,"prev-year":f.value,"next-year":g.value,today:o}[C];w.isSame(c.value,"day")||_(w)},validatedRange:a}},BJe=n=>yt(n)&&n.length===2&&n.every(e=>WC(e)),HJe=Lt({modelValue:{type:Date},range:{type:Ke(Array),validator:BJe}}),VJe={[Kn]:n=>WC(n),[rc]:n=>WC(n)},UJe="ElCalendar",WJe=$e({name:UJe}),GJe=$e({...WJe,props:HJe,emits:VJe,setup(n,{expose:e,emit:t}){const i=n,s=vt("calendar"),{calculateValidatedDateRange:o,date:r,pickDay:a,realSelectedDay:c,selectDate:u,validatedRange:d}=FJe(i,t),{t:f}=wi(),g=W(()=>{const p=`el.datepicker.month${r.value.format("M")}`;return`${r.value.year()} ${f("el.datepicker.year")} ${f(p)}`});return e({selectedDay:c,pickDay:a,selectDate:u,calculateValidatedDateRange:o}),(p,_)=>(G(),he("div",{class:Y(T(s).b())},[oe("div",{class:Y(T(s).e("header"))},[Ye(p.$slots,"header",{date:T(g)},()=>[oe("div",{class:Y(T(s).e("title"))},st(T(g)),3),T(d).length===0?(G(),he("div",{key:0,class:Y(T(s).e("button-group"))},[ce(T(ySe),null,{default:_e(()=>[ce(T(_a),{size:"small",onClick:v=>T(u)("prev-month")},{default:_e(()=>[mn(st(T(f)("el.datepicker.prevMonth")),1)]),_:1},8,["onClick"]),ce(T(_a),{size:"small",onClick:v=>T(u)("today")},{default:_e(()=>[mn(st(T(f)("el.datepicker.today")),1)]),_:1},8,["onClick"]),ce(T(_a),{size:"small",onClick:v=>T(u)("next-month")},{default:_e(()=>[mn(st(T(f)("el.datepicker.nextMonth")),1)]),_:1},8,["onClick"])]),_:1})],2)):Qe("v-if",!0)])],2),T(d).length===0?(G(),he("div",{key:0,class:Y(T(s).e("body"))},[ce(Gue,{date:T(r),"selected-day":T(c),onPick:T(a)},Hf({_:2},[p.$slots["date-cell"]?{name:"date-cell",fn:_e(v=>[Ye(p.$slots,"date-cell",wf(nb(v)))])}:void 0]),1032,["date","selected-day","onPick"])],2)):(G(),he("div",{key:1,class:Y(T(s).e("body"))},[(G(!0),he(Qt,null,fi(T(d),(v,C)=>(G(),nt(Gue,{key:C,date:v[0],"selected-day":T(c),range:v,"hide-header":C!==0,onPick:T(a)},Hf({_:2},[p.$slots["date-cell"]?{name:"date-cell",fn:_e(y=>[Ye(p.$slots,"date-cell",wf(nb(y)))])}:void 0]),1032,["date","selected-day","range","hide-header","onPick"]))),128))],2))],2))}});var zJe=Rt(GJe,[["__file","calendar.vue"]]);const KJe=Nn(zJe),jJe=Lt({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:Ke([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),XJe=$e({name:"ElCard"}),YJe=$e({...XJe,props:jJe,setup(n){const e=vt("card");return(t,i)=>(G(),he("div",{class:Y([T(e).b(),T(e).is(`${t.shadow}-shadow`)])},[t.$slots.header||t.header?(G(),he("div",{key:0,class:Y(T(e).e("header"))},[Ye(t.$slots,"header",{},()=>[mn(st(t.header),1)])],2)):Qe("v-if",!0),oe("div",{class:Y([T(e).e("body"),t.bodyClass]),style:on(t.bodyStyle)},[Ye(t.$slots,"default")],6),t.$slots.footer||t.footer?(G(),he("div",{key:1,class:Y(T(e).e("footer"))},[Ye(t.$slots,"footer",{},()=>[mn(st(t.footer),1)])],2)):Qe("v-if",!0)],2))}});var qJe=Rt(YJe,[["__file","card.vue"]]);const JJe=Nn(qJe),QJe=Lt({initialIndex:{type:Number,default:0},height:{type:String,default:""},trigger:{type:String,values:["hover","click"],default:"hover"},autoplay:{type:Boolean,default:!0},interval:{type:Number,default:3e3},indicatorPosition:{type:String,values:["","none","outside"],default:""},arrow:{type:String,values:["always","hover","never"],default:"hover"},type:{type:String,values:["","card"],default:""},cardScale:{type:Number,default:.83},loop:{type:Boolean,default:!0},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},pauseOnHover:{type:Boolean,default:!0},motionBlur:Boolean}),ZJe={change:(n,e)=>[n,e].every(gn)},ISe=Symbol("carouselContextKey"),EX="ElCarouselItem";var pf=(n=>(n[n.TEXT=1]="TEXT",n[n.CLASS=2]="CLASS",n[n.STYLE=4]="STYLE",n[n.PROPS=8]="PROPS",n[n.FULL_PROPS=16]="FULL_PROPS",n[n.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",n[n.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",n[n.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",n[n.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",n[n.NEED_PATCH=512]="NEED_PATCH",n[n.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",n[n.HOISTED=-1]="HOISTED",n[n.BAIL=-2]="BAIL",n))(pf||{});function SX(n){return Oo(n)&&n.type===Qt}function eQe(n){return Oo(n)&&n.type===fa}function tQe(n){return Oo(n)&&!SX(n)&&!eQe(n)}const nQe=n=>{if(!Oo(n))return{};const e=n.props||{},t=(Oo(n.type)?n.type.props:void 0)||{},i={};return Object.keys(t).forEach(s=>{Wi(t[s],"default")&&(i[s]=t[s].default)}),Object.keys(e).forEach(s=>{i[$u(s)]=e[s]}),i},iQe=n=>{if(!yt(n)||n.length>1)throw new Error("expect to receive a single Vue element child");return n[0]},kC=n=>{const e=yt(n)?n:[n],t=[];return e.forEach(i=>{var s;yt(i)?t.push(...kC(i)):Oo(i)&&((s=i.component)!=null&&s.subTree)?t.push(i,...kC(i.component.subTree)):Oo(i)&&yt(i.children)?t.push(...kC(i.children)):t.push(i)}),t},sQe=(n,e,t)=>kC(n.subTree).filter(o=>{var r;return Oo(o)&&((r=o.type)==null?void 0:r.name)===e&&!!o.component}).map(o=>o.component.uid).map(o=>t[o]).filter(o=>!!o),Tte=(n,e)=>{const t={},i=us([]);return{children:i,addChild:r=>{t[r.uid]=r,i.value=sQe(n,e,t)},removeChild:r=>{delete t[r],i.value=i.value.filter(a=>a.uid!==r)}}},zue=300,oQe=(n,e,t)=>{const{children:i,addChild:s,removeChild:o}=Tte(Qn(),EX),r=dl(),a=te(-1),c=te(null),u=te(!1),d=te(),f=te(0),g=te(!0),p=te(!0),_=te(!1),v=W(()=>n.arrow!=="never"&&!T(w)),C=W(()=>i.value.some(Re=>Re.props.label.toString().length>0)),y=W(()=>n.type==="card"),w=W(()=>n.direction==="vertical"),I=W(()=>n.height!=="auto"?{height:n.height}:{height:`${f.value}px`,overflow:"hidden"}),L=l0(Re=>{F(Re)},zue,{trailing:!0}),O=l0(Re=>{J(Re)},zue),A=Re=>g.value?a.value<=1?Re<=1:Re>1:!0;function N(){c.value&&(clearInterval(c.value),c.value=null)}function D(){n.interval<=0||!n.autoplay||c.value||(c.value=setInterval(()=>P(),n.interval))}const P=()=>{p.value||(_.value=!0),p.value=!1,a.value<i.value.length-1?a.value=a.value+1:n.loop?a.value=0:_.value=!1};function F(Re){if(p.value||(_.value=!0),p.value=!1,sn(Re)){const Ge=i.value.filter(dt=>dt.props.name===Re);Ge.length>0&&(Re=i.value.indexOf(Ge[0]))}if(Re=Number(Re),Number.isNaN(Re)||Re!==Math.floor(Re))return;const we=i.value.length,Ve=a.value;Re<0?a.value=n.loop?we-1:0:Re>=we?a.value=n.loop?0:we-1:a.value=Re,Ve===a.value&&V(Ve),Le()}function V(Re){i.value.forEach((we,Ve)=>{we.translateItem(Ve,a.value,Re)})}function U(Re,we){var Ve,Ge,dt,ze;const ee=T(i),ye=ee.length;if(ye===0||!Re.states.inStage)return!1;const Me=we+1,et=we-1,at=ye-1,Ue=ee[at].states.active,Se=ee[0].states.active,Ie=(Ge=(Ve=ee[Me])==null?void 0:Ve.states)==null?void 0:Ge.active,Xe=(ze=(dt=ee[et])==null?void 0:dt.states)==null?void 0:ze.active;return we===at&&Se||Ie?"left":we===0&&Ue||Xe?"right":!1}function Q(){u.value=!0,n.pauseOnHover&&N()}function de(){u.value=!1,D()}function q(){_.value=!1}function K(Re){T(w)||i.value.forEach((we,Ve)=>{Re===U(we,Ve)&&(we.states.hover=!0)})}function re(){T(w)||i.value.forEach(Re=>{Re.states.hover=!1})}function Z(Re){Re!==a.value&&(p.value||(_.value=!0)),a.value=Re}function J(Re){n.trigger==="hover"&&Re!==a.value&&(a.value=Re,p.value||(_.value=!0))}function ge(){F(a.value-1)}function ve(){F(a.value+1)}function Le(){N(),n.pauseOnHover||D()}function Ee(Re){n.height==="auto"&&(f.value=Re)}function Ne(){var Re;const we=(Re=r.default)==null?void 0:Re.call(r);if(!we)return null;const Ge=kC(we).filter(dt=>Oo(dt)&&dt.type.name===EX);return(Ge==null?void 0:Ge.length)===2&&n.loop&&!y.value?(g.value=!0,Ge):(g.value=!1,null)}ht(()=>a.value,(Re,we)=>{V(we),g.value&&(Re=Re%2,we=we%2),we>-1&&e("change",Re,we)}),ht(()=>n.autoplay,Re=>{Re?D():N()}),ht(()=>n.loop,()=>{F(a.value)}),ht(()=>n.interval,()=>{Le()});const qe=us();return $n(()=>{ht(()=>i.value,()=>{i.value.length>0&&F(n.initialIndex)},{immediate:!0}),qe.value=wo(d.value,()=>{V()}),D()}),As(()=>{N(),d.value&&qe.value&&qe.value.stop()}),pi(ISe,{root:d,isCardType:y,isVertical:w,items:i,loop:n.loop,cardScale:n.cardScale,addItem:s,removeItem:o,setActiveItem:F,setContainerHeight:Ee}),{root:d,activeIndex:a,arrowDisplay:v,hasLabel:C,hover:u,isCardType:y,isTransitioning:_,items:i,isVertical:w,containerStyle:I,isItemsTwoLength:g,handleButtonEnter:K,handleTransitionEnd:q,handleButtonLeave:re,handleIndicatorClick:Z,handleMouseEnter:Q,handleMouseLeave:de,setActiveItem:F,prev:ge,next:ve,PlaceholderItem:Ne,isTwoLengthShow:A,throttledArrowClick:L,throttledIndicatorHover:O}},rQe="ElCarousel",lQe=$e({name:rQe}),aQe=$e({...lQe,props:QJe,emits:ZJe,setup(n,{expose:e,emit:t}){const i=n,{root:s,activeIndex:o,arrowDisplay:r,hasLabel:a,hover:c,isCardType:u,items:d,isVertical:f,containerStyle:g,handleButtonEnter:p,handleButtonLeave:_,isTransitioning:v,handleIndicatorClick:C,handleMouseEnter:y,handleMouseLeave:w,handleTransitionEnd:I,setActiveItem:L,prev:O,next:A,PlaceholderItem:N,isTwoLengthShow:D,throttledArrowClick:P,throttledIndicatorHover:F}=oQe(i,t),V=vt("carousel"),{t:U}=wi(),Q=W(()=>{const K=[V.b(),V.m(i.direction)];return T(u)&&K.push(V.m("card")),K}),de=W(()=>{const K=[V.e("container")];return i.motionBlur&&T(v)&&d.value.length>1&&K.push(T(f)?`${V.namespace.value}-transitioning-vertical`:`${V.namespace.value}-transitioning`),K}),q=W(()=>{const K=[V.e("indicators"),V.em("indicators",i.direction)];return T(a)&&K.push(V.em("indicators","labels")),i.indicatorPosition==="outside"&&K.push(V.em("indicators","outside")),T(f)&&K.push(V.em("indicators","right")),K});return e({activeIndex:o,setActiveItem:L,prev:O,next:A}),(K,re)=>(G(),he("div",{ref_key:"root",ref:s,class:Y(T(Q)),onMouseenter:bn(T(y),["stop"]),onMouseleave:bn(T(w),["stop"])},[T(r)?(G(),nt(Ta,{key:0,name:"carousel-arrow-left",persisted:""},{default:_e(()=>[Un(oe("button",{type:"button",class:Y([T(V).e("arrow"),T(V).em("arrow","left")]),"aria-label":T(U)("el.carousel.leftArrow"),onMouseenter:Z=>T(p)("left"),onMouseleave:T(_),onClick:bn(Z=>T(P)(T(o)-1),["stop"])},[ce(T(tn),null,{default:_e(()=>[ce(T(ZC))]),_:1})],42,["aria-label","onMouseenter","onMouseleave","onClick"]),[[Gi,(K.arrow==="always"||T(c))&&(i.loop||T(o)>0)]])]),_:1})):Qe("v-if",!0),T(r)?(G(),nt(Ta,{key:1,name:"carousel-arrow-right",persisted:""},{default:_e(()=>[Un(oe("button",{type:"button",class:Y([T(V).e("arrow"),T(V).em("arrow","right")]),"aria-label":T(U)("el.carousel.rightArrow"),onMouseenter:Z=>T(p)("right"),onMouseleave:T(_),onClick:bn(Z=>T(P)(T(o)+1),["stop"])},[ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})],42,["aria-label","onMouseenter","onMouseleave","onClick"]),[[Gi,(K.arrow==="always"||T(c))&&(i.loop||T(o)<T(d).length-1)]])]),_:1})):Qe("v-if",!0),oe("div",{class:Y(T(de)),style:on(T(g)),onTransitionend:T(I)},[ce(T(N)),Ye(K.$slots,"default")],46,["onTransitionend"]),K.indicatorPosition!=="none"?(G(),he("ul",{key:2,class:Y(T(q))},[(G(!0),he(Qt,null,fi(T(d),(Z,J)=>Un((G(),he("li",{key:J,class:Y([T(V).e("indicator"),T(V).em("indicator",K.direction),T(V).is("active",J===T(o))]),onMouseenter:ge=>T(F)(J),onClick:bn(ge=>T(C)(J),["stop"])},[oe("button",{class:Y(T(V).e("button")),"aria-label":T(U)("el.carousel.indicator",{index:J+1})},[T(a)?(G(),he("span",{key:0},st(Z.props.label),1)):Qe("v-if",!0)],10,["aria-label"])],42,["onMouseenter","onClick"])),[[Gi,T(D)(J)]])),128))],2)):Qe("v-if",!0),i.motionBlur?(G(),he("svg",{key:3,xmlns:"http://www.w3.org/2000/svg",version:"1.1",style:{display:"none"}},[oe("defs",null,[oe("filter",{id:"elCarouselHorizontal"},[oe("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"12,0"})]),oe("filter",{id:"elCarouselVertical"},[oe("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"0,10"})])])])):Qe("v-if",!0)],42,["onMouseenter","onMouseleave"]))}});var cQe=Rt(aQe,[["__file","carousel.vue"]]);const uQe=Lt({name:{type:String,default:""},label:{type:[String,Number],default:""}}),dQe=n=>{const e=Kt(ISe),t=Qn(),i=te(),s=te(!1),o=te(0),r=te(1),a=te(!1),c=te(!1),u=te(!1),d=te(!1),{isCardType:f,isVertical:g,cardScale:p}=e;function _(I,L,O){const A=O-1,N=L-1,D=L+1,P=O/2;return L===0&&I===A?-1:L===A&&I===0?O:I<N&&L-I>=P?O+1:I>D&&I-L>=P?-2:I}function v(I,L){var O,A;const N=T(g)?((O=e.root.value)==null?void 0:O.offsetHeight)||0:((A=e.root.value)==null?void 0:A.offsetWidth)||0;return u.value?N*((2-p)*(I-L)+1)/4:I<L?-(1+p)*N/4:(3+p)*N/4}function C(I,L,O){const A=e.root.value;return A?((O?A.offsetHeight:A.offsetWidth)||0)*(I-L):0}const y=(I,L,O)=>{var A;const N=T(f),D=(A=e.items.value.length)!=null?A:Number.NaN,P=I===L;!N&&!ys(O)&&(d.value=P||I===O),!P&&D>2&&e.loop&&(I=_(I,L,D));const F=T(g);a.value=P,N?(u.value=Math.round(Math.abs(I-L))<=1,o.value=v(I,L),r.value=T(a)?1:p):o.value=C(I,L,F),c.value=!0,P&&i.value&&e.setContainerHeight(i.value.offsetHeight)};function w(){if(e&&T(f)){const I=e.items.value.findIndex(({uid:L})=>L===t.uid);e.setActiveItem(I)}}return $n(()=>{e.addItem({props:n,states:Ki({hover:s,translate:o,scale:r,active:a,ready:c,inStage:u,animating:d}),uid:t.uid,translateItem:y})}),Cb(()=>{e.removeItem(t.uid)}),{carouselItemRef:i,active:a,animating:d,hover:s,inStage:u,isVertical:g,translate:o,isCardType:f,scale:r,ready:c,handleItemClick:w}},hQe=$e({name:EX}),fQe=$e({...hQe,props:uQe,setup(n){const e=n,t=vt("carousel"),{carouselItemRef:i,active:s,animating:o,hover:r,inStage:a,isVertical:c,translate:u,isCardType:d,scale:f,ready:g,handleItemClick:p}=dQe(e),_=W(()=>[t.e("item"),t.is("active",s.value),t.is("in-stage",a.value),t.is("hover",r.value),t.is("animating",o.value),{[t.em("item","card")]:d.value,[t.em("item","card-vertical")]:d.value&&c.value}]),v=W(()=>{const y=`${`translate${T(c)?"Y":"X"}`}(${T(u)}px)`,w=`scale(${T(f)})`;return{transform:[y,w].join(" ")}});return(C,y)=>Un((G(),he("div",{ref_key:"carouselItemRef",ref:i,class:Y(T(_)),style:on(T(v)),onClick:T(p)},[T(d)?Un((G(),he("div",{key:0,class:Y(T(t).e("mask"))},null,2)),[[Gi,!T(s)]]):Qe("v-if",!0),Ye(C.$slots,"default")],14,["onClick"])),[[Gi,T(g)]])}});var LSe=Rt(fQe,[["__file","carousel-item.vue"]]);const gQe=Nn(cQe,{CarouselItem:LSe}),pQe=Xo(LSe),OSe={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:cl,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Wa(["ariaControls"])},RSe={[Kn]:n=>sn(n)||gn(n)||Us(n),change:n=>sn(n)||gn(n)||Us(n)},aM=Symbol("checkboxGroupContextKey"),mQe=({model:n,isChecked:e})=>{const t=Kt(aM,void 0),i=W(()=>{var o,r;const a=(o=t==null?void 0:t.max)==null?void 0:o.value,c=(r=t==null?void 0:t.min)==null?void 0:r.value;return!ys(a)&&n.value.length>=a&&!e.value||!ys(c)&&n.value.length<=c&&e.value});return{isDisabled:gc(W(()=>(t==null?void 0:t.disabled.value)||i.value)),isLimitDisabled:i}},_Qe=(n,{model:e,isLimitExceeded:t,hasOwnLabel:i,isDisabled:s,isLabeledByFormItem:o})=>{const r=Kt(aM,void 0),{formItem:a}=fc(),{emit:c}=Qn();function u(_){var v,C,y,w;return[!0,n.trueValue,n.trueLabel].includes(_)?(C=(v=n.trueValue)!=null?v:n.trueLabel)!=null?C:!0:(w=(y=n.falseValue)!=null?y:n.falseLabel)!=null?w:!1}function d(_,v){c("change",u(_),v)}function f(_){if(t.value)return;const v=_.target;c("change",u(v.checked),_)}async function g(_){t.value||!i.value&&!s.value&&o.value&&(_.composedPath().some(y=>y.tagName==="LABEL")||(e.value=u([!1,n.falseValue,n.falseLabel].includes(e.value)),await cn(),d(e.value,_)))}const p=W(()=>(r==null?void 0:r.validateEvent)||n.validateEvent);return ht(()=>n.modelValue,()=>{p.value&&(a==null||a.validate("change").catch(_=>void 0))}),{handleChange:f,onClickRoot:g}},vQe=n=>{const e=te(!1),{emit:t}=Qn(),i=Kt(aM,void 0),s=W(()=>ys(i)===!1),o=te(!1),r=W({get(){var a,c;return s.value?(a=i==null?void 0:i.modelValue)==null?void 0:a.value:(c=n.modelValue)!=null?c:e.value},set(a){var c,u;s.value&&yt(a)?(o.value=((c=i==null?void 0:i.max)==null?void 0:c.value)!==void 0&&a.length>(i==null?void 0:i.max.value)&&a.length>r.value.length,o.value===!1&&((u=i==null?void 0:i.changeEvent)==null||u.call(i,a))):(t(Kn,a),e.value=a)}});return{model:r,isGroup:s,isLimitExceeded:o}},bQe=(n,e,{model:t})=>{const i=Kt(aM,void 0),s=te(!1),o=W(()=>F0(n.value)?n.label:n.value),r=W(()=>{const d=t.value;return Us(d)?d:yt(d)?si(o.value)?d.map(Cs).some(f=>Ha(f,o.value)):d.map(Cs).includes(o.value):d!=null?d===n.trueValue||d===n.trueLabel:!!d}),a=jr(W(()=>{var d;return(d=i==null?void 0:i.size)==null?void 0:d.value}),{prop:!0}),c=jr(W(()=>{var d;return(d=i==null?void 0:i.size)==null?void 0:d.value})),u=W(()=>!!e.default||!F0(o.value));return{checkboxButtonSize:a,isChecked:r,isFocused:s,checkboxSize:c,hasOwnLabel:u,actualValue:o}},MSe=(n,e)=>{const{formItem:t}=fc(),{model:i,isGroup:s,isLimitExceeded:o}=vQe(n),{isFocused:r,isChecked:a,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=bQe(n,e,{model:i}),{isDisabled:g}=mQe({model:i,isChecked:a}),{inputId:p,isLabeledByFormItem:_}=Qf(n,{formItemContext:t,disableIdGeneration:d,disableIdManagement:s}),{handleChange:v,onClickRoot:C}=_Qe(n,{model:i,isLimitExceeded:o,hasOwnLabel:d,isDisabled:g,isLabeledByFormItem:_});return(()=>{function w(){var I,L;yt(i.value)&&!i.value.includes(f.value)?i.value.push(f.value):i.value=(L=(I=n.trueValue)!=null?I:n.trueLabel)!=null?L:!0}n.checked&&w()})(),RC({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},W(()=>s.value&&F0(n.value))),RC({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},W(()=>!!n.trueLabel)),RC({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},W(()=>!!n.falseLabel)),{inputId:p,isLabeledByFormItem:_,isChecked:a,isDisabled:g,isFocused:r,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:i,actualValue:f,handleChange:v,onClickRoot:C}},TQe=$e({name:"ElCheckbox"}),CQe=$e({...TQe,props:OSe,emits:RSe,setup(n){const e=n,t=dl(),{inputId:i,isLabeledByFormItem:s,isChecked:o,isDisabled:r,isFocused:a,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:g,onClickRoot:p}=MSe(e,t),_=vt("checkbox"),v=W(()=>[_.b(),_.m(c.value),_.is("disabled",r.value),_.is("bordered",e.border),_.is("checked",o.value)]),C=W(()=>[_.e("input"),_.is("disabled",r.value),_.is("checked",o.value),_.is("indeterminate",e.indeterminate),_.is("focus",a.value)]);return(y,w)=>(G(),nt(ui(!T(u)&&T(s)?"span":"label"),{class:Y(T(v)),"aria-controls":y.indeterminate?y.ariaControls:null,onClick:T(p)},{default:_e(()=>{var I,L,O,A;return[oe("span",{class:Y(T(C))},[y.trueValue||y.falseValue||y.trueLabel||y.falseLabel?Un((G(),he("input",{key:0,id:T(i),"onUpdate:modelValue":N=>Ss(d)?d.value=N:null,class:Y(T(_).e("original")),type:"checkbox",indeterminate:y.indeterminate,name:y.name,tabindex:y.tabindex,disabled:T(r),"true-value":(L=(I=y.trueValue)!=null?I:y.trueLabel)!=null?L:!0,"false-value":(A=(O=y.falseValue)!=null?O:y.falseLabel)!=null?A:!1,onChange:T(g),onFocus:N=>a.value=!0,onBlur:N=>a.value=!1,onClick:bn(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[B4,T(d)]]):Un((G(),he("input",{key:1,id:T(i),"onUpdate:modelValue":N=>Ss(d)?d.value=N:null,class:Y(T(_).e("original")),type:"checkbox",indeterminate:y.indeterminate,disabled:T(r),value:T(f),name:y.name,tabindex:y.tabindex,onChange:T(g),onFocus:N=>a.value=!0,onBlur:N=>a.value=!1,onClick:bn(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[B4,T(d)]]),oe("span",{class:Y(T(_).e("inner"))},null,2)],2),T(u)?(G(),he("span",{key:0,class:Y(T(_).e("label"))},[Ye(y.$slots,"default"),y.$slots.default?Qe("v-if",!0):(G(),he(Qt,{key:0},[mn(st(y.label),1)],64))],2)):Qe("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var yQe=Rt(CQe,[["__file","checkbox.vue"]]);const EQe=$e({name:"ElCheckboxButton"}),SQe=$e({...EQe,props:OSe,emits:RSe,setup(n){const e=n,t=dl(),{isFocused:i,isChecked:s,isDisabled:o,checkboxButtonSize:r,model:a,actualValue:c,handleChange:u}=MSe(e,t),d=Kt(aM,void 0),f=vt("checkbox"),g=W(()=>{var _,v,C,y;const w=(v=(_=d==null?void 0:d.fill)==null?void 0:_.value)!=null?v:"";return{backgroundColor:w,borderColor:w,color:(y=(C=d==null?void 0:d.textColor)==null?void 0:C.value)!=null?y:"",boxShadow:w?`-1px 0 0 0 ${w}`:void 0}}),p=W(()=>[f.b("button"),f.bm("button",r.value),f.is("disabled",o.value),f.is("checked",s.value),f.is("focus",i.value)]);return(_,v)=>{var C,y,w,I;return G(),he("label",{class:Y(T(p))},[_.trueValue||_.falseValue||_.trueLabel||_.falseLabel?Un((G(),he("input",{key:0,"onUpdate:modelValue":L=>Ss(a)?a.value=L:null,class:Y(T(f).be("button","original")),type:"checkbox",name:_.name,tabindex:_.tabindex,disabled:T(o),"true-value":(y=(C=_.trueValue)!=null?C:_.trueLabel)!=null?y:!0,"false-value":(I=(w=_.falseValue)!=null?w:_.falseLabel)!=null?I:!1,onChange:T(u),onFocus:L=>i.value=!0,onBlur:L=>i.value=!1,onClick:bn(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[B4,T(a)]]):Un((G(),he("input",{key:1,"onUpdate:modelValue":L=>Ss(a)?a.value=L:null,class:Y(T(f).be("button","original")),type:"checkbox",name:_.name,tabindex:_.tabindex,disabled:T(o),value:T(c),onChange:T(u),onFocus:L=>i.value=!0,onBlur:L=>i.value=!1,onClick:bn(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[B4,T(a)]]),_.$slots.default||_.label?(G(),he("span",{key:2,class:Y(T(f).be("button","inner")),style:on(T(s)?T(g):void 0)},[Ye(_.$slots,"default",{},()=>[mn(st(_.label),1)])],6)):Qe("v-if",!0)],2)}}});var kSe=Rt(SQe,[["__file","checkbox-button.vue"]]);const wQe=Lt({modelValue:{type:Ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:cl,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Wa(["ariaLabel"])}),IQe={[Kn]:n=>yt(n),change:n=>yt(n)},LQe=$e({name:"ElCheckboxGroup"}),OQe=$e({...LQe,props:wQe,emits:IQe,setup(n,{emit:e}){const t=n,i=vt("checkbox"),{formItem:s}=fc(),{inputId:o,isLabeledByFormItem:r}=Qf(t,{formItemContext:s}),a=async u=>{e(Kn,u),await cn(),e("change",u)},c=W({get(){return t.modelValue},set(u){a(u)}});return pi(aM,{...$g(Gl(t),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:a}),ht(()=>t.modelValue,()=>{t.validateEvent&&(s==null||s.validate("change").catch(u=>void 0))}),(u,d)=>{var f;return G(),nt(ui(u.tag),{id:T(o),class:Y(T(i).b("group")),role:"group","aria-label":T(r)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":T(r)?(f=T(s))==null?void 0:f.labelId:void 0},{default:_e(()=>[Ye(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var ASe=Rt(OQe,[["__file","checkbox-group.vue"]]);const Kf=Nn(yQe,{CheckboxButton:kSe,CheckboxGroup:ASe}),RQe=Xo(kSe),NSe=Xo(ASe),DSe=Lt({modelValue:{type:[String,Number,Boolean],default:void 0},size:cl,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),MQe=Lt({...DSe,border:Boolean}),$Se={[Kn]:n=>sn(n)||gn(n)||Us(n),[Ms]:n=>sn(n)||gn(n)||Us(n)},xSe=Symbol("radioGroupKey"),PSe=(n,e)=>{const t=te(),i=Kt(xSe,void 0),s=W(()=>!!i),o=W(()=>F0(n.value)?n.label:n.value),r=W({get(){return s.value?i.modelValue:n.modelValue},set(f){s.value?i.changeEvent(f):e&&e(Kn,f),t.value.checked=n.modelValue===o.value}}),a=jr(W(()=>i==null?void 0:i.size)),c=gc(W(()=>i==null?void 0:i.disabled)),u=te(!1),d=W(()=>c.value||s.value&&r.value!==o.value?-1:0);return RC({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},W(()=>s.value&&F0(n.value))),{radioRef:t,isGroup:s,radioGroup:i,focus:u,size:a,disabled:c,tabIndex:d,modelValue:r,actualValue:o}},kQe=$e({name:"ElRadio"}),AQe=$e({...kQe,props:MQe,emits:$Se,setup(n,{emit:e}){const t=n,i=vt("radio"),{radioRef:s,radioGroup:o,focus:r,size:a,disabled:c,modelValue:u,actualValue:d}=PSe(t,e);function f(){cn(()=>e("change",u.value))}return(g,p)=>{var _;return G(),he("label",{class:Y([T(i).b(),T(i).is("disabled",T(c)),T(i).is("focus",T(r)),T(i).is("bordered",g.border),T(i).is("checked",T(u)===T(d)),T(i).m(T(a))])},[oe("span",{class:Y([T(i).e("input"),T(i).is("disabled",T(c)),T(i).is("checked",T(u)===T(d))])},[Un(oe("input",{ref_key:"radioRef",ref:s,"onUpdate:modelValue":v=>Ss(u)?u.value=v:null,class:Y(T(i).e("original")),value:T(d),name:g.name||((_=T(o))==null?void 0:_.name),disabled:T(c),checked:T(u)===T(d),type:"radio",onFocus:v=>r.value=!0,onBlur:v=>r.value=!1,onChange:f,onClick:bn(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[Dve,T(u)]]),oe("span",{class:Y(T(i).e("inner"))},null,2)],2),oe("span",{class:Y(T(i).e("label")),onKeydown:bn(()=>{},["stop"])},[Ye(g.$slots,"default",{},()=>[mn(st(g.label),1)])],42,["onKeydown"])],2)}}});var NQe=Rt(AQe,[["__file","radio.vue"]]);const DQe=Lt({...DSe}),$Qe=$e({name:"ElRadioButton"}),xQe=$e({...$Qe,props:DQe,setup(n){const e=n,t=vt("radio"),{radioRef:i,focus:s,size:o,disabled:r,modelValue:a,radioGroup:c,actualValue:u}=PSe(e),d=W(()=>({backgroundColor:(c==null?void 0:c.fill)||"",borderColor:(c==null?void 0:c.fill)||"",boxShadow:c!=null&&c.fill?`-1px 0 0 0 ${c.fill}`:"",color:(c==null?void 0:c.textColor)||""}));return(f,g)=>{var p;return G(),he("label",{class:Y([T(t).b("button"),T(t).is("active",T(a)===T(u)),T(t).is("disabled",T(r)),T(t).is("focus",T(s)),T(t).bm("button",T(o))])},[Un(oe("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":_=>Ss(a)?a.value=_:null,class:Y(T(t).be("button","original-radio")),value:T(u),type:"radio",name:f.name||((p=T(c))==null?void 0:p.name),disabled:T(r),onFocus:_=>s.value=!0,onBlur:_=>s.value=!1,onClick:bn(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[Dve,T(a)]]),oe("span",{class:Y(T(t).be("button","inner")),style:on(T(a)===T(u)?T(d):{}),onKeydown:bn(()=>{},["stop"])},[Ye(f.$slots,"default",{},()=>[mn(st(f.label),1)])],46,["onKeydown"])],2)}}});var FSe=Rt(xQe,[["__file","radio-button.vue"]]);const PQe=Lt({id:{type:String,default:void 0},size:cl,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Wa(["ariaLabel"])}),FQe=$Se,BQe=$e({name:"ElRadioGroup"}),HQe=$e({...BQe,props:PQe,emits:FQe,setup(n,{emit:e}){const t=n,i=vt("radio"),s=Va(),o=te(),{formItem:r}=fc(),{inputId:a,isLabeledByFormItem:c}=Qf(t,{formItemContext:r}),u=f=>{e(Kn,f),cn(()=>e("change",f))};$n(()=>{const f=o.value.querySelectorAll("[type=radio]"),g=f[0];!Array.from(f).some(p=>p.checked)&&g&&(g.tabIndex=0)});const d=W(()=>t.name||s.value);return pi(xSe,Ki({...Gl(t),changeEvent:u,name:d})),ht(()=>t.modelValue,()=>{t.validateEvent&&(r==null||r.validate("change").catch(f=>void 0))}),(f,g)=>(G(),he("div",{id:T(a),ref_key:"radioGroupRef",ref:o,class:Y(T(i).b("group")),role:"radiogroup","aria-label":T(c)?void 0:f.ariaLabel||"radio-group","aria-labelledby":T(c)?T(r).labelId:void 0},[Ye(f.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var BSe=Rt(HQe,[["__file","radio-group.vue"]]);const HSe=Nn(NQe,{RadioButton:FSe,RadioGroup:BSe}),VQe=Xo(BSe),UQe=Xo(FSe);var WQe=$e({name:"NodeContent",setup(){return{ns:vt("cascader-node")}},render(){const{ns:n}=this,{node:e,panel:t}=this.$parent,{data:i,label:s}=e,{renderLabelFn:o}=t;return hn("span",{class:n.e("label")},o?o({node:e,data:i}):s)}});const Cte=Symbol(),GQe=$e({name:"ElCascaderNode",components:{ElCheckbox:Kf,ElRadio:HSe,NodeContent:WQe,ElIcon:tn,Check:oF,Loading:Gm,ArrowRight:Au},props:{node:{type:Object,required:!0},menuId:String},emits:["expand"],setup(n,{emit:e}){const t=Kt(Cte),i=vt("cascader-node"),s=W(()=>t.isHoverMenu),o=W(()=>t.config.multiple),r=W(()=>t.config.checkStrictly),a=W(()=>{var A;return(A=t.checkedNodes[0])==null?void 0:A.uid}),c=W(()=>n.node.isDisabled),u=W(()=>n.node.isLeaf),d=W(()=>r.value&&!u.value||!c.value),f=W(()=>p(t.expandingNode)),g=W(()=>r.value&&t.checkedNodes.some(p)),p=A=>{var N;const{level:D,uid:P}=n.node;return((N=A==null?void 0:A.pathNodes[D-1])==null?void 0:N.uid)===P},_=()=>{f.value||t.expandNode(n.node)},v=A=>{const{node:N}=n;A!==N.checked&&t.handleCheckChange(N,A)},C=()=>{t.lazyLoad(n.node,()=>{u.value||_()})},y=A=>{s.value&&(w(),!u.value&&e("expand",A))},w=()=>{const{node:A}=n;!d.value||A.loading||(A.loaded?_():C())},I=()=>{s.value&&!u.value||(u.value&&!c.value&&!r.value&&!o.value?O(!0):w())},L=A=>{r.value?(v(A),n.node.loaded&&_()):O(A)},O=A=>{n.node.loaded?(v(A),!r.value&&_()):C()};return{panel:t,isHoverMenu:s,multiple:o,checkStrictly:r,checkedNodeId:a,isDisabled:c,isLeaf:u,expandable:d,inExpandingPath:f,inCheckedPath:g,ns:i,handleHoverExpand:y,handleExpand:w,handleClick:I,handleCheck:O,handleSelectCheck:L}}});function zQe(n,e,t,i,s,o){const r=Bt("el-checkbox"),a=Bt("el-radio"),c=Bt("check"),u=Bt("el-icon"),d=Bt("node-content"),f=Bt("loading"),g=Bt("arrow-right");return G(),he("li",{id:`${n.menuId}-${n.node.uid}`,role:"menuitem","aria-haspopup":!n.isLeaf,"aria-owns":n.isLeaf?null:n.menuId,"aria-expanded":n.inExpandingPath,tabindex:n.expandable?-1:void 0,class:Y([n.ns.b(),n.ns.is("selectable",n.checkStrictly),n.ns.is("active",n.node.checked),n.ns.is("disabled",!n.expandable),n.inExpandingPath&&"in-active-path",n.inCheckedPath&&"in-checked-path"]),onMouseenter:n.handleHoverExpand,onFocus:n.handleHoverExpand,onClick:n.handleClick},[Qe(" prefix "),n.multiple?(G(),nt(r,{key:0,"model-value":n.node.checked,indeterminate:n.node.indeterminate,disabled:n.isDisabled,onClick:bn(()=>{},["stop"]),"onUpdate:modelValue":n.handleSelectCheck},null,8,["model-value","indeterminate","disabled","onClick","onUpdate:modelValue"])):n.checkStrictly?(G(),nt(a,{key:1,"model-value":n.checkedNodeId,label:n.node.uid,disabled:n.isDisabled,"onUpdate:modelValue":n.handleSelectCheck,onClick:bn(()=>{},["stop"])},{default:_e(()=>[Qe(`
- Add an empty element to avoid render label,
- do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485
- `),oe("span")]),_:1},8,["model-value","label","disabled","onUpdate:modelValue","onClick"])):n.isLeaf&&n.node.checked?(G(),nt(u,{key:2,class:Y(n.ns.e("prefix"))},{default:_e(()=>[ce(c)]),_:1},8,["class"])):Qe("v-if",!0),Qe(" content "),ce(d),Qe(" postfix "),n.isLeaf?Qe("v-if",!0):(G(),he(Qt,{key:3},[n.node.loading?(G(),nt(u,{key:0,class:Y([n.ns.is("loading"),n.ns.e("postfix")])},{default:_e(()=>[ce(f)]),_:1},8,["class"])):(G(),nt(u,{key:1,class:Y(["arrow-right",n.ns.e("postfix")])},{default:_e(()=>[ce(g)]),_:1},8,["class"]))],64))],42,["id","aria-haspopup","aria-owns","aria-expanded","tabindex","onMouseenter","onFocus","onClick"])}var KQe=Rt(GQe,[["render",zQe],["__file","node.vue"]]);const jQe=$e({name:"ElCascaderMenu",components:{Loading:Gm,ElIcon:tn,ElScrollbar:a_,ElCascaderNode:KQe},props:{nodes:{type:Array,required:!0},index:{type:Number,required:!0}},setup(n){const e=Qn(),t=vt("cascader-menu"),{t:i}=wi(),s=Va();let o=null,r=null;const a=Kt(Cte),c=te(null),u=W(()=>!n.nodes.length),d=W(()=>!a.initialLoaded),f=W(()=>`${s.value}-${n.index}`),g=C=>{o=C.target},p=C=>{if(!(!a.isHoverMenu||!o||!c.value))if(o.contains(C.target)){_();const y=e.vnode.el,{left:w}=y.getBoundingClientRect(),{offsetWidth:I,offsetHeight:L}=y,O=C.clientX-w,A=o.offsetTop,N=A+o.offsetHeight;c.value.innerHTML=`
- <path style="pointer-events: auto;" fill="transparent" d="M${O} ${A} L${I} 0 V${A} Z" />
- <path style="pointer-events: auto;" fill="transparent" d="M${O} ${N} L${I} ${L} V${N} Z" />
- `}else r||(r=window.setTimeout(v,a.config.hoverThreshold))},_=()=>{r&&(clearTimeout(r),r=null)},v=()=>{c.value&&(c.value.innerHTML="",_())};return{ns:t,panel:a,hoverZone:c,isEmpty:u,isLoading:d,menuId:f,t:i,handleExpand:g,handleMouseMove:p,clearHoverZone:v}}});function XQe(n,e,t,i,s,o){const r=Bt("el-cascader-node"),a=Bt("loading"),c=Bt("el-icon"),u=Bt("el-scrollbar");return G(),nt(u,{key:n.menuId,tag:"ul",role:"menu",class:Y(n.ns.b()),"wrap-class":n.ns.e("wrap"),"view-class":[n.ns.e("list"),n.ns.is("empty",n.isEmpty)],onMousemove:n.handleMouseMove,onMouseleave:n.clearHoverZone},{default:_e(()=>{var d;return[(G(!0),he(Qt,null,fi(n.nodes,f=>(G(),nt(r,{key:f.uid,node:f,"menu-id":n.menuId,onExpand:n.handleExpand},null,8,["node","menu-id","onExpand"]))),128)),n.isLoading?(G(),he("div",{key:0,class:Y(n.ns.e("empty-text"))},[ce(c,{size:"14",class:Y(n.ns.is("loading"))},{default:_e(()=>[ce(a)]),_:1},8,["class"]),mn(" "+st(n.t("el.cascader.loading")),1)],2)):n.isEmpty?(G(),he("div",{key:1,class:Y(n.ns.e("empty-text"))},[Ye(n.$slots,"empty",{},()=>[mn(st(n.t("el.cascader.noData")),1)])],2)):(d=n.panel)!=null&&d.isHoverMenu?(G(),he("svg",{key:2,ref:"hoverZone",class:Y(n.ns.e("hover-zone"))},null,2)):Qe("v-if",!0)]}),_:3},8,["class","wrap-class","view-class","onMousemove","onMouseleave"])}var YQe=Rt(jQe,[["render",XQe],["__file","menu.vue"]]);const yte=(n="")=>n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),bm=n=>PP(n);let qQe=0;const JQe=n=>{const e=[n];let{parent:t}=n;for(;t;)e.unshift(t),t=t.parent;return e};let wX=class IX{constructor(e,t,i,s=!1){this.data=e,this.config=t,this.parent=i,this.root=s,this.uid=qQe++,this.checked=!1,this.indeterminate=!1,this.loading=!1;const{value:o,label:r,children:a}=t,c=e[a],u=JQe(this);this.level=s?0:i?i.level+1:1,this.value=e[o],this.label=e[r],this.pathNodes=u,this.pathValues=u.map(d=>d.value),this.pathLabels=u.map(d=>d.label),this.childrenData=c,this.children=(c||[]).map(d=>new IX(d,t,this)),this.loaded=!t.lazy||this.isLeaf||!oh(c)}get isDisabled(){const{data:e,parent:t,config:i}=this,{disabled:s,checkStrictly:o}=i;return(ln(s)?s(e,this):!!e[s])||!o&&(t==null?void 0:t.isDisabled)}get isLeaf(){const{data:e,config:t,childrenData:i,loaded:s}=this,{lazy:o,leaf:r}=t,a=ln(r)?r(e,this):e[r];return ys(a)?o&&!s?!1:!(yt(i)&&i.length):!!a}get valueByOption(){return this.config.emitPath?this.pathValues:this.value}appendChild(e){const{childrenData:t,children:i}=this,s=new IX(e,this.config,this);return yt(t)?t.push(e):this.childrenData=[e],i.push(s),s}calcText(e,t){const i=e?this.pathLabels.join(t):this.label;return this.text=i,i}broadcast(e,...t){const i=`onParent${bm(e)}`;this.children.forEach(s=>{s&&(s.broadcast(e,...t),s[i]&&s[i](...t))})}emit(e,...t){const{parent:i}=this,s=`onChild${bm(e)}`;i&&(i[s]&&i[s](...t),i.emit(e,...t))}onParentCheck(e){this.isDisabled||this.setCheckState(e)}onChildCheck(){const{children:e}=this,t=e.filter(s=>!s.isDisabled),i=t.length?t.every(s=>s.checked):!1;this.setCheckState(i)}setCheckState(e){const t=this.children.length,i=this.children.reduce((s,o)=>{const r=o.checked?1:o.indeterminate?.5:0;return s+r},0);this.checked=this.loaded&&this.children.filter(s=>!s.isDisabled).every(s=>s.loaded&&s.checked)&&e,this.indeterminate=this.loaded&&i!==t&&i>0}doCheck(e){if(this.checked===e)return;const{checkStrictly:t,multiple:i}=this.config;t||!i?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check"))}};const LX=(n,e)=>n.reduce((t,i)=>(i.isLeaf?t.push(i):(!e&&t.push(i),t=t.concat(LX(i.children,e))),t),[]);class Kue{constructor(e,t){this.config=t;const i=(e||[]).map(s=>new wX(s,this.config));this.nodes=i,this.allNodes=LX(i,!1),this.leafNodes=LX(i,!0)}getNodes(){return this.nodes}getFlattedNodes(e){return e?this.leafNodes:this.allNodes}appendNode(e,t){const i=t?t.appendChild(e):new wX(e,this.config);t||this.nodes.push(i),this.allNodes.push(i),i.isLeaf&&this.leafNodes.push(i)}appendNodes(e,t){e.forEach(i=>this.appendNode(i,t))}getNodeByValue(e,t=!1){return!e&&e!==0?null:this.getFlattedNodes(t).find(s=>Ha(s.value,e)||Ha(s.pathValues,e))||null}getSameNode(e){return e&&this.getFlattedNodes(!1).find(({value:i,level:s})=>Ha(e.value,i)&&e.level===s)||null}}const VSe=Lt({modelValue:{type:Ke([Number,String,Array])},options:{type:Ke(Array),default:()=>[]},props:{type:Ke(Object),default:()=>({})}}),QQe={expandTrigger:"click",multiple:!1,checkStrictly:!1,emitPath:!0,lazy:!1,lazyLoad:ps,value:"value",label:"label",children:"children",leaf:"leaf",disabled:"disabled",hoverThreshold:500},ZQe=n=>W(()=>({...QQe,...n.props})),jue=n=>{if(!n)return 0;const e=n.id.split("-");return Number(e[e.length-2])},eZe=n=>{if(!n)return;const e=n.querySelector("input");e?e.click():XEe(n)&&n.click()},tZe=(n,e)=>{const t=e.slice(0),i=t.map(o=>o.uid),s=n.reduce((o,r)=>{const a=i.indexOf(r.uid);return a>-1&&(o.push(r),t.splice(a,1),i.splice(a,1)),o},[]);return s.push(...t),s},Xue=n=>[...new Set(n)],Iu=n=>!n&&n!==0?[]:yt(n)?n:[n],nZe=$e({name:"ElCascaderPanel",components:{ElCascaderMenu:YQe},props:{...VSe,border:{type:Boolean,default:!0},renderLabel:Function},emits:[Kn,Ms,"close","expand-change"],setup(n,{emit:e,slots:t}){let i=!1;const s=vt("cascader"),o=ZQe(n);let r=null;const a=te(!0),c=te([]),u=te(null),d=te([]),f=te(null),g=te([]),p=W(()=>o.value.expandTrigger==="hover"),_=W(()=>n.renderLabel||t.default),v=()=>{const{options:U}=n,Q=o.value;i=!1,r=new Kue(U,Q),d.value=[r.getNodes()],Q.lazy&&oh(n.options)?(a.value=!1,C(void 0,de=>{de&&(r=new Kue(de,Q),d.value=[r.getNodes()]),a.value=!0,D(!1,!0)})):D(!1,!0)},C=(U,Q)=>{const de=o.value;U=U||new wX({},de,void 0,!0),U.loading=!0;const q=K=>{const re=U,Z=re.root?null:re;K&&(r==null||r.appendNodes(K,Z)),re.loading=!1,re.loaded=!0,re.childrenData=re.childrenData||[],Q&&Q(K)};de.lazyLoad(U,q)},y=(U,Q)=>{var de;const{level:q}=U,K=d.value.slice(0,q);let re;U.isLeaf?re=U.pathNodes[q-2]:(re=U,K.push(U.children)),((de=f.value)==null?void 0:de.uid)!==(re==null?void 0:re.uid)&&(f.value=U,d.value=K,!Q&&e("expand-change",(U==null?void 0:U.pathValues)||[]))},w=(U,Q,de=!0)=>{const{checkStrictly:q,multiple:K}=o.value,re=g.value[0];i=!0,!K&&(re==null||re.doCheck(!1)),U.doCheck(Q),N(),de&&!K&&!q&&e("close"),!de&&!K&&!q&&I(U)},I=U=>{U&&(U=U.parent,I(U),U&&y(U))},L=U=>r==null?void 0:r.getFlattedNodes(U),O=U=>{var Q;return(Q=L(U))==null?void 0:Q.filter(de=>de.checked!==!1)},A=()=>{g.value.forEach(U=>U.doCheck(!1)),N(),d.value=d.value.slice(0,1),f.value=null,e("expand-change",[])},N=()=>{var U;const{checkStrictly:Q,multiple:de}=o.value,q=g.value,K=O(!Q),re=tZe(q,K),Z=re.map(J=>J.valueByOption);g.value=re,u.value=de?Z:(U=Z[0])!=null?U:null},D=(U=!1,Q=!1)=>{const{modelValue:de}=n,{lazy:q,multiple:K,checkStrictly:re}=o.value,Z=!re;if(!(!a.value||i||!Q&&Ha(de,u.value)))if(q&&!U){const ge=Xue(j9e(Iu(de))).map(ve=>r==null?void 0:r.getNodeByValue(ve)).filter(ve=>!!ve&&!ve.loaded&&!ve.loading);ge.length?ge.forEach(ve=>{C(ve,()=>D(!1,Q))}):D(!0,Q)}else{const J=K?Iu(de):[de],ge=Xue(J.map(ve=>r==null?void 0:r.getNodeByValue(ve,Z)));P(ge,Q),u.value=gW(de)}},P=(U,Q=!0)=>{const{checkStrictly:de}=o.value,q=g.value,K=U.filter(J=>!!J&&(de||J.isLeaf)),re=r==null?void 0:r.getSameNode(f.value),Z=Q&&re||K[0];Z?Z.pathNodes.forEach(J=>y(J,!0)):f.value=null,q.forEach(J=>J.doCheck(!1)),Ki(K).forEach(J=>J.doCheck(!0)),g.value=K,cn(F)},F=()=>{Si&&c.value.forEach(U=>{const Q=U==null?void 0:U.$el;if(Q){const de=Q.querySelector(`.${s.namespace.value}-scrollbar__wrap`),q=Q.querySelector(`.${s.b("node")}.${s.is("active")}`)||Q.querySelector(`.${s.b("node")}.in-active-path`);Qee(de,q)}})},V=U=>{const Q=U.target,{code:de}=U;switch(de){case zt.up:case zt.down:{U.preventDefault();const q=de===zt.up?-1:1;CU(YEe(Q,q,`.${s.b("node")}[tabindex="-1"]`));break}case zt.left:{U.preventDefault();const q=c.value[jue(Q)-1],K=q==null?void 0:q.$el.querySelector(`.${s.b("node")}[aria-expanded="true"]`);CU(K);break}case zt.right:{U.preventDefault();const q=c.value[jue(Q)+1],K=q==null?void 0:q.$el.querySelector(`.${s.b("node")}[tabindex="-1"]`);CU(K);break}case zt.enter:case zt.numpadEnter:eZe(Q);break}};return pi(Cte,Ki({config:o,expandingNode:f,checkedNodes:g,isHoverMenu:p,initialLoaded:a,renderLabelFn:_,lazyLoad:C,expandNode:y,handleCheckChange:w})),ht([o,()=>n.options],v,{deep:!0,immediate:!0}),ht(()=>n.modelValue,()=>{i=!1,D()},{deep:!0}),ht(()=>u.value,U=>{Ha(U,n.modelValue)||(e(Kn,U),e(Ms,U))}),eve(()=>c.value=[]),$n(()=>!oh(n.modelValue)&&D()),{ns:s,menuList:c,menus:d,checkedNodes:g,handleKeyDown:V,handleCheckChange:w,getFlattedNodes:L,getCheckedNodes:O,clearCheckedNodes:A,calculateCheckedValue:N,scrollToExpandingNode:F}}});function iZe(n,e,t,i,s,o){const r=Bt("el-cascader-menu");return G(),he("div",{class:Y([n.ns.b("panel"),n.ns.is("bordered",n.border)]),onKeydown:n.handleKeyDown},[(G(!0),he(Qt,null,fi(n.menus,(a,c)=>(G(),nt(r,{key:c,ref_for:!0,ref:u=>n.menuList[c]=u,index:c,nodes:[...a]},{empty:_e(()=>[Ye(n.$slots,"empty")]),_:2},1032,["index","nodes"]))),128))],42,["onKeydown"])}var sZe=Rt(nZe,[["render",iZe],["__file","index.vue"]]);const USe=Nn(sZe),ab=Lt({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:l_},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),oZe={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},rZe=$e({name:"ElTag"}),lZe=$e({...rZe,props:ab,emits:oZe,setup(n,{emit:e}){const t=n,i=jr(),s=vt("tag"),o=W(()=>{const{type:u,hit:d,effect:f,closable:g,round:p}=t;return[s.b(),s.is("closable",g),s.m(u||"primary"),s.m(i.value),s.m(f),s.is("hit",d),s.is("round",p)]}),r=u=>{e("close",u)},a=u=>{e("click",u)},c=u=>{var d,f,g;(g=(f=(d=u==null?void 0:u.component)==null?void 0:d.subTree)==null?void 0:f.component)!=null&&g.bum&&(u.component.subTree.component.bum=null)};return(u,d)=>u.disableTransitions?(G(),he("span",{key:0,class:Y(T(o)),style:on({backgroundColor:u.color}),onClick:a},[oe("span",{class:Y(T(s).e("content"))},[Ye(u.$slots,"default")],2),u.closable?(G(),nt(T(tn),{key:0,class:Y(T(s).e("close")),onClick:bn(r,["stop"])},{default:_e(()=>[ce(T(Zg))]),_:1},8,["class","onClick"])):Qe("v-if",!0)],6)):(G(),nt(Ta,{key:1,name:`${T(s).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:_e(()=>[oe("span",{class:Y(T(o)),style:on({backgroundColor:u.color}),onClick:a},[oe("span",{class:Y(T(s).e("content"))},[Ye(u.$slots,"default")],2),u.closable?(G(),nt(T(tn),{key:0,class:Y(T(s).e("close")),onClick:bn(r,["stop"])},{default:_e(()=>[ce(T(Zg))]),_:1},8,["class","onClick"])):Qe("v-if",!0)],6)]),_:3},8,["name"]))}});var aZe=Rt(lZe,[["__file","tag.vue"]]);const tR=Nn(aZe),cZe=Lt({...VSe,size:cl,placeholder:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,filterMethod:{type:Ke(Function),default:(n,e)=>n.text.includes(e)},separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,maxCollapseTags:{type:Number,default:1},collapseTagsTooltip:{type:Boolean,default:!1},debounce:{type:Number,default:300},beforeFilter:{type:Ke(Function),default:()=>!0},placement:{type:Ke(String),values:Rb,default:"bottom-start"},fallbackPlacements:{type:Ke(Array),default:["bottom-start","bottom","top-start","top","right","left"]},popperClass:{type:String,default:""},teleported:ua.teleported,tagType:{...ab.type,default:"info"},tagEffect:{...ab.effect,default:"light"},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},...oM}),uZe={[Kn]:n=>!0,[Ms]:n=>!0,focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,visibleChange:n=>Us(n),expandChange:n=>!!n,removeTag:n=>!!n},GT=new Map;if(Si){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of GT.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function Yue(n,e){let t=[];return yt(e.arg)?t=e.arg:mh(e.arg)&&t.push(e.arg),function(i,s){const o=e.instance.popperRef,r=i.target,a=s==null?void 0:s.target,c=!e||!e.instance,u=!r||!a,d=n.contains(r)||n.contains(a),f=n===r,g=t.length&&t.some(_=>_==null?void 0:_.contains(r))||t.length&&t.includes(a),p=o&&(o.contains(r)||o.contains(a));c||u||d||f||g||p||e.value(i,s)}}const cb={beforeMount(n,e){GT.has(n)||GT.set(n,[]),GT.get(n).push({documentHandler:Yue(n,e),bindingFn:e.value})},updated(n,e){GT.has(n)||GT.set(n,[]);const t=GT.get(n),i=t.findIndex(o=>o.bindingFn===e.oldValue),s={documentHandler:Yue(n,e),bindingFn:e.value};i>=0?t.splice(i,1,s):t.push(s)},unmounted(n){GT.delete(n)}},dZe="ElCascader",hZe=$e({name:dZe}),fZe=$e({...hZe,props:cZe,emits:uZe,setup(n,{expose:e,emit:t}){const i=n,s={modifiers:[{name:"arrowPosition",enabled:!0,phase:"main",fn:({state:pe})=>{const{modifiersData:je,placement:Ae}=pe;["right","left","bottom","top"].includes(Ae)||(je.arrow.x=35)},requires:["arrow"]}]},o=Ly();let r=0,a=0;const c=vt("cascader"),u=vt("input"),{t:d}=wi(),{form:f,formItem:g}=fc(),{valueOnClear:p}=v8(i),{isComposing:_,handleComposition:v}=lF({afterComposition(pe){var je;const Ae=(je=pe.target)==null?void 0:je.value;le(Ae)}}),C=te(null),y=te(null),w=te(null),I=te(null),L=te(null),O=te(!1),A=te(!1),N=te(!1),D=te(!1),P=te(""),F=te(""),V=te([]),U=te([]),Q=te([]),de=W(()=>o.style),q=W(()=>i.disabled||(f==null?void 0:f.disabled)),K=W(()=>i.placeholder||d("el.cascader.placeholder")),re=W(()=>F.value||V.value.length>0||_.value?"":K.value),Z=jr(),J=W(()=>Z.value==="small"?"small":"default"),ge=W(()=>!!i.props.multiple),ve=W(()=>!i.filterable||ge.value),Le=W(()=>ge.value?F.value:P.value),Ee=W(()=>{var pe;return((pe=I.value)==null?void 0:pe.checkedNodes)||[]}),Ne=W(()=>!i.clearable||q.value||N.value||!A.value?!1:!!Ee.value.length),qe=W(()=>{const{showAllLevels:pe,separator:je}=i,Ae=Ee.value;return Ae.length?ge.value?"":Ae[0].calcText(pe,je):""}),Re=W(()=>(g==null?void 0:g.validateState)||""),we=W({get(){return gW(i.modelValue)},set(pe){const je=pe??p.value;t(Kn,je),t(Ms,je),i.validateEvent&&(g==null||g.validate("change").catch(Ae=>void 0))}}),Ve=W(()=>[c.b(),c.m(Z.value),c.is("disabled",q.value),o.class]),Ge=W(()=>[u.e("icon"),"icon-arrow-down",c.is("reverse",O.value)]),dt=W(()=>c.is("focus",O.value||D.value)),ze=W(()=>{var pe,je;return(je=(pe=C.value)==null?void 0:pe.popperRef)==null?void 0:je.contentRef}),ee=pe=>{var je,Ae,Et;q.value||(pe=pe??!O.value,pe!==O.value&&(O.value=pe,(Ae=(je=y.value)==null?void 0:je.input)==null||Ae.setAttribute("aria-expanded",`${pe}`),pe?(ye(),cn((Et=I.value)==null?void 0:Et.scrollToExpandingNode)):i.filterable&&ot(),t("visibleChange",pe)))},ye=()=>{cn(()=>{var pe;(pe=C.value)==null||pe.updatePopper()})},Me=()=>{N.value=!1},et=pe=>{const{showAllLevels:je,separator:Ae}=i;return{node:pe,key:pe.uid,text:pe.calcText(je,Ae),hitState:!1,closable:!q.value&&!pe.isDisabled,isCollapseTag:!1}},at=pe=>{var je;const Ae=pe.node;Ae.doCheck(!1),(je=I.value)==null||je.calculateCheckedValue(),t("removeTag",Ae.valueByOption)},Ue=()=>{if(!ge.value)return;const pe=Ee.value,je=[],Ae=[];if(pe.forEach(Et=>Ae.push(et(Et))),U.value=Ae,pe.length){pe.slice(0,i.maxCollapseTags).forEach(Hn=>je.push(et(Hn)));const Et=pe.slice(i.maxCollapseTags),Tn=Et.length;Tn&&(i.collapseTags?je.push({key:-1,text:`+ ${Tn}`,closable:!1,isCollapseTag:!0}):Et.forEach(Hn=>je.push(et(Hn))))}V.value=je},Se=()=>{var pe,je;const{filterMethod:Ae,showAllLevels:Et,separator:Tn}=i,Hn=(je=(pe=I.value)==null?void 0:pe.getFlattedNodes(!i.props.checkStrictly))==null?void 0:je.filter(Xn=>Xn.isDisabled?!1:(Xn.calcText(Et,Tn),Ae(Xn,Le.value)));ge.value&&(V.value.forEach(Xn=>{Xn.hitState=!1}),U.value.forEach(Xn=>{Xn.hitState=!1})),N.value=!0,Q.value=Hn,ye()},Ie=()=>{var pe;let je;N.value&&L.value?je=L.value.$el.querySelector(`.${c.e("suggestion-item")}`):je=(pe=I.value)==null?void 0:pe.$el.querySelector(`.${c.b("node")}[tabindex="-1"]`),je&&(je.focus(),!N.value&&je.click())},Xe=()=>{var pe,je;const Ae=(pe=y.value)==null?void 0:pe.input,Et=w.value,Tn=(je=L.value)==null?void 0:je.$el;if(!(!Si||!Ae)){if(Tn){const Hn=Tn.querySelector(`.${c.e("suggestion-list")}`);Hn.style.minWidth=`${Ae.offsetWidth}px`}if(Et){const{offsetHeight:Hn}=Et,Xn=V.value.length>0?`${Math.max(Hn,r)-2}px`:`${r}px`;Ae.style.height=Xn,ye()}}},it=pe=>{var je;return(je=I.value)==null?void 0:je.getCheckedNodes(pe)},Tt=pe=>{ye(),t("expandChange",pe)},He=pe=>{if(!_.value)switch(pe.code){case zt.enter:case zt.numpadEnter:ee();break;case zt.down:ee(!0),cn(Ie),pe.preventDefault();break;case zt.esc:O.value===!0&&(pe.preventDefault(),pe.stopPropagation(),ee(!1));break;case zt.tab:ee(!1);break}},ke=()=>{var pe;(pe=I.value)==null||pe.clearCheckedNodes(),!O.value&&i.filterable&&ot(),ee(!1),t("clear")},ot=()=>{const{value:pe}=qe;P.value=pe,F.value=pe},Ct=pe=>{var je,Ae;const{checked:Et}=pe;ge.value?(je=I.value)==null||je.handleCheckChange(pe,!Et,!1):(!Et&&((Ae=I.value)==null||Ae.handleCheckChange(pe,!0,!1)),ee(!1))},Gt=pe=>{const je=pe.target,{code:Ae}=pe;switch(Ae){case zt.up:case zt.down:{const Et=Ae===zt.up?-1:1;CU(YEe(je,Et,`.${c.e("suggestion-item")}[tabindex="-1"]`));break}case zt.enter:case zt.numpadEnter:je.click();break}},Ot=()=>{const pe=V.value,je=pe[pe.length-1];a=F.value?0:a+1,!(!je||!a||i.collapseTags&&pe.length>1)&&(je.hitState?at(je):je.hitState=!0)},En=pe=>{const je=pe.target,Ae=c.e("search-input");je.className===Ae&&(D.value=!0),t("focus",pe)},fe=pe=>{D.value=!1,t("blur",pe)},se=Md(()=>{const{value:pe}=Le;if(!pe)return;const je=i.beforeFilter(pe);S$(je)?je.then(Se).catch(()=>{}):je!==!1?Se():Me()},i.debounce),le=(pe,je)=>{!O.value&&ee(!0),!(je!=null&&je.isComposing)&&(pe?se():Me())},Fe=pe=>Number.parseFloat(O7e(u.cssVarName("input-height"),pe).value)-2;return ht(N,ye),ht([Ee,q,()=>i.collapseTags],Ue),ht(V,()=>{cn(()=>Xe())}),ht(Z,async()=>{await cn();const pe=y.value.input;r=Fe(pe)||r,Xe()}),ht(qe,ot,{immediate:!0}),$n(()=>{const pe=y.value.input,je=Fe(pe);r=pe.offsetHeight||je,wo(pe,Xe)}),e({getCheckedNodes:it,cascaderPanelRef:I,togglePopperVisible:ee,contentRef:ze,presentText:qe}),(pe,je)=>(G(),nt(T(uc),{ref_key:"tooltipRef",ref:C,visible:O.value,teleported:pe.teleported,"popper-class":[T(c).e("dropdown"),pe.popperClass],"popper-options":s,"fallback-placements":pe.fallbackPlacements,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,placement:pe.placement,transition:`${T(c).namespace.value}-zoom-in-top`,effect:"light",pure:"",persistent:pe.persistent,onHide:Me},{default:_e(()=>[Un((G(),he("div",{class:Y(T(Ve)),style:on(T(de)),onClick:()=>ee(T(ve)?void 0:!0),onKeydown:He,onMouseenter:Ae=>A.value=!0,onMouseleave:Ae=>A.value=!1},[ce(T(Kc),{ref_key:"input",ref:y,modelValue:P.value,"onUpdate:modelValue":Ae=>P.value=Ae,placeholder:T(re),readonly:T(ve),disabled:T(q),"validate-event":!1,size:T(Z),class:Y(T(dt)),tabindex:T(ge)&&pe.filterable&&!T(q)?-1:void 0,onCompositionstart:T(v),onCompositionupdate:T(v),onCompositionend:T(v),onFocus:En,onBlur:fe,onInput:le},{suffix:_e(()=>[T(Ne)?(G(),nt(T(tn),{key:"clear",class:Y([T(u).e("icon"),"icon-circle-close"]),onClick:bn(ke,["stop"])},{default:_e(()=>[ce(T(Ob))]),_:1},8,["class","onClick"])):(G(),nt(T(tn),{key:"arrow-down",class:Y(T(Ge)),onClick:bn(Ae=>ee(),["stop"])},{default:_e(()=>[ce(T(Lb))]),_:1},8,["class","onClick"]))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder","readonly","disabled","size","class","tabindex","onCompositionstart","onCompositionupdate","onCompositionend"]),T(ge)?(G(),he("div",{key:0,ref_key:"tagWrapper",ref:w,class:Y([T(c).e("tags"),T(c).is("validate",!!T(Re))])},[(G(!0),he(Qt,null,fi(V.value,Ae=>(G(),nt(T(tR),{key:Ae.key,type:pe.tagType,size:T(J),effect:pe.tagEffect,hit:Ae.hitState,closable:Ae.closable,"disable-transitions":"",onClose:Et=>at(Ae)},{default:_e(()=>[Ae.isCollapseTag===!1?(G(),he("span",{key:0},st(Ae.text),1)):(G(),nt(T(uc),{key:1,disabled:O.value||!pe.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],placement:"bottom",effect:"light"},{default:_e(()=>[oe("span",null,st(Ae.text),1)]),content:_e(()=>[oe("div",{class:Y(T(c).e("collapse-tags"))},[(G(!0),he(Qt,null,fi(U.value.slice(pe.maxCollapseTags),(Et,Tn)=>(G(),he("div",{key:Tn,class:Y(T(c).e("collapse-tag"))},[(G(),nt(T(tR),{key:Et.key,class:"in-tooltip",type:pe.tagType,size:T(J),effect:pe.tagEffect,hit:Et.hitState,closable:Et.closable,"disable-transitions":"",onClose:Hn=>at(Et)},{default:_e(()=>[oe("span",null,st(Et.text),1)]),_:2},1032,["type","size","effect","hit","closable","onClose"]))],2))),128))],2)]),_:2},1032,["disabled"]))]),_:2},1032,["type","size","effect","hit","closable","onClose"]))),128)),pe.filterable&&!T(q)?Un((G(),he("input",{key:0,"onUpdate:modelValue":Ae=>F.value=Ae,type:"text",class:Y(T(c).e("search-input")),placeholder:T(qe)?"":T(K),onInput:Ae=>le(F.value,Ae),onClick:bn(Ae=>ee(!0),["stop"]),onKeydown:xs(Ot,["delete"]),onCompositionstart:T(v),onCompositionupdate:T(v),onCompositionend:T(v),onFocus:En,onBlur:fe},null,42,["onUpdate:modelValue","placeholder","onInput","onClick","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend"])),[[x5,F.value]]):Qe("v-if",!0)],2)):Qe("v-if",!0)],46,["onClick","onMouseenter","onMouseleave"])),[[T(cb),()=>ee(!1),T(ze)]])]),content:_e(()=>[Un(ce(T(USe),{ref_key:"cascaderPanelRef",ref:I,modelValue:T(we),"onUpdate:modelValue":Ae=>Ss(we)?we.value=Ae:null,options:pe.options,props:i.props,border:!1,"render-label":pe.$slots.default,onExpandChange:Tt,onClose:Ae=>pe.$nextTick(()=>ee(!1))},{empty:_e(()=>[Ye(pe.$slots,"empty")]),_:3},8,["modelValue","onUpdate:modelValue","options","props","render-label","onClose"]),[[Gi,!N.value]]),pe.filterable?Un((G(),nt(T(a_),{key:0,ref_key:"suggestionPanel",ref:L,tag:"ul",class:Y(T(c).e("suggestion-panel")),"view-class":T(c).e("suggestion-list"),onKeydown:Gt},{default:_e(()=>[Q.value.length?(G(!0),he(Qt,{key:0},fi(Q.value,Ae=>(G(),he("li",{key:Ae.uid,class:Y([T(c).e("suggestion-item"),T(c).is("checked",Ae.checked)]),tabindex:-1,onClick:Et=>Ct(Ae)},[oe("span",null,st(Ae.text),1),Ae.checked?(G(),nt(T(tn),{key:0},{default:_e(()=>[ce(T(oF))]),_:1})):Qe("v-if",!0)],10,["onClick"]))),128)):Ye(pe.$slots,"empty",{key:1},()=>[oe("li",{class:Y(T(c).e("empty-text"))},st(T(d)("el.cascader.noMatch")),3)])]),_:3},8,["class","view-class"])),[[Gi,N.value]]):Qe("v-if",!0)]),_:3},8,["visible","teleported","popper-class","fallback-placements","placement","transition","persistent"]))}});var gZe=Rt(fZe,[["__file","cascader.vue"]]);const pZe=Nn(gZe),mZe=Lt({checked:Boolean,disabled:Boolean,type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"}}),_Ze={"update:checked":n=>Us(n),[Ms]:n=>Us(n)},vZe=$e({name:"ElCheckTag"}),bZe=$e({...vZe,props:mZe,emits:_Ze,setup(n,{emit:e}){const t=n,i=vt("check-tag"),s=W(()=>t.disabled),o=W(()=>[i.b(),i.is("checked",t.checked),i.is("disabled",s.value),i.m(t.type||"primary")]),r=()=>{if(s.value)return;const a=!t.checked;e(Ms,a),e("update:checked",a)};return(a,c)=>(G(),he("span",{class:Y(T(o)),onClick:r},[Ye(a.$slots,"default")],2))}});var TZe=Rt(bZe,[["__file","check-tag.vue"]]);const CZe=Nn(TZe),yZe=Lt({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ke([Number,Object]),default:()=>Ko({})},sm:{type:Ke([Number,Object]),default:()=>Ko({})},md:{type:Ke([Number,Object]),default:()=>Ko({})},lg:{type:Ke([Number,Object]),default:()=>Ko({})},xl:{type:Ke([Number,Object]),default:()=>Ko({})}}),WSe=Symbol("rowContextKey"),EZe=$e({name:"ElCol"}),SZe=$e({...EZe,props:yZe,setup(n){const e=n,{gutter:t}=Kt(WSe,{gutter:W(()=>0)}),i=vt("col"),s=W(()=>{const r={};return t.value&&(r.paddingLeft=r.paddingRight=`${t.value/2}px`),r}),o=W(()=>{const r=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];gn(d)&&(u==="span"?r.push(i.b(`${e[u]}`)):d>0&&r.push(i.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{gn(e[u])?r.push(i.b(`${u}-${e[u]}`)):si(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{r.push(d!=="span"?i.b(`${u}-${d}-${f}`):i.b(`${u}-${f}`))})}),t.value&&r.push(i.is("guttered")),[i.b(),r]});return(r,a)=>(G(),nt(ui(r.tag),{class:Y(T(o)),style:on(T(s))},{default:_e(()=>[Ye(r.$slots,"default")]),_:3},8,["class","style"]))}});var wZe=Rt(SZe,[["__file","col.vue"]]);const IZe=Nn(wZe),que=n=>gn(n)||sn(n)||yt(n),LZe=Lt({accordion:Boolean,modelValue:{type:Ke([Array,String,Number]),default:()=>Ko([])}}),OZe={[Kn]:que,[Ms]:que},GSe=Symbol("collapseContextKey"),RZe=(n,e)=>{const t=te(Gc(n.modelValue)),i=o=>{t.value=o;const r=n.accordion?t.value[0]:t.value;e(Kn,r),e(Ms,r)},s=o=>{if(n.accordion)i([t.value[0]===o?"":o]);else{const r=[...t.value],a=r.indexOf(o);a>-1?r.splice(a,1):r.push(o),i(r)}};return ht(()=>n.modelValue,()=>t.value=Gc(n.modelValue),{deep:!0}),pi(GSe,{activeNames:t,handleItemClick:s}),{activeNames:t,setActiveNames:i}},MZe=()=>{const n=vt("collapse");return{rootKls:W(()=>n.b())}},kZe=$e({name:"ElCollapse"}),AZe=$e({...kZe,props:LZe,emits:OZe,setup(n,{expose:e,emit:t}){const i=n,{activeNames:s,setActiveNames:o}=RZe(i,t),{rootKls:r}=MZe();return e({activeNames:s,setActiveNames:o}),(a,c)=>(G(),he("div",{class:Y(T(r))},[Ye(a.$slots,"default")],2))}});var NZe=Rt(AZe,[["__file","collapse.vue"]]);const DZe=$e({name:"ElCollapseTransition"}),$Ze=$e({...DZe,setup(n){const e=vt("collapse-transition"),t=s=>{s.style.maxHeight="",s.style.overflow=s.dataset.oldOverflow,s.style.paddingTop=s.dataset.oldPaddingTop,s.style.paddingBottom=s.dataset.oldPaddingBottom},i={beforeEnter(s){s.dataset||(s.dataset={}),s.dataset.oldPaddingTop=s.style.paddingTop,s.dataset.oldPaddingBottom=s.style.paddingBottom,s.style.height&&(s.dataset.elExistsHeight=s.style.height),s.style.maxHeight=0,s.style.paddingTop=0,s.style.paddingBottom=0},enter(s){requestAnimationFrame(()=>{s.dataset.oldOverflow=s.style.overflow,s.dataset.elExistsHeight?s.style.maxHeight=s.dataset.elExistsHeight:s.scrollHeight!==0?s.style.maxHeight=`${s.scrollHeight}px`:s.style.maxHeight=0,s.style.paddingTop=s.dataset.oldPaddingTop,s.style.paddingBottom=s.dataset.oldPaddingBottom,s.style.overflow="hidden"})},afterEnter(s){s.style.maxHeight="",s.style.overflow=s.dataset.oldOverflow},enterCancelled(s){t(s)},beforeLeave(s){s.dataset||(s.dataset={}),s.dataset.oldPaddingTop=s.style.paddingTop,s.dataset.oldPaddingBottom=s.style.paddingBottom,s.dataset.oldOverflow=s.style.overflow,s.style.maxHeight=`${s.scrollHeight}px`,s.style.overflow="hidden"},leave(s){s.scrollHeight!==0&&(s.style.maxHeight=0,s.style.paddingTop=0,s.style.paddingBottom=0)},afterLeave(s){t(s)},leaveCancelled(s){t(s)}};return(s,o)=>(G(),nt(Ta,hi({name:T(e).b()},CDe(i)),{default:_e(()=>[Ye(s.$slots,"default")]),_:3},16,["name"]))}});var xZe=Rt($Ze,[["__file","collapse-transition.vue"]]);const L8=Nn(xZe),PZe=Lt({title:{type:String,default:""},name:{type:Ke([String,Number]),default:void 0},icon:{type:ks,default:Au},disabled:Boolean}),FZe=n=>{const e=Kt(GSe),{namespace:t}=vt("collapse"),i=te(!1),s=te(!1),o=rte(),r=W(()=>o.current++),a=W(()=>{var g;return(g=n.name)!=null?g:`${t.value}-id-${o.prefix}-${T(r)}`}),c=W(()=>e==null?void 0:e.activeNames.value.includes(T(a)));return{focusing:i,id:r,isActive:c,handleFocus:()=>{setTimeout(()=>{s.value?s.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(T(a)),i.value=!1,s.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(T(a))}}},BZe=(n,{focusing:e,isActive:t,id:i})=>{const s=vt("collapse"),o=W(()=>[s.b("item"),s.is("active",T(t)),s.is("disabled",n.disabled)]),r=W(()=>[s.be("item","header"),s.is("active",T(t)),{focusing:T(e)&&!n.disabled}]),a=W(()=>[s.be("item","arrow"),s.is("active",T(t))]),c=W(()=>s.be("item","wrap")),u=W(()=>s.be("item","content")),d=W(()=>s.b(`content-${T(i)}`)),f=W(()=>s.b(`head-${T(i)}`));return{arrowKls:a,headKls:r,rootKls:o,itemWrapperKls:c,itemContentKls:u,scopedContentId:d,scopedHeadId:f}},HZe=$e({name:"ElCollapseItem"}),VZe=$e({...HZe,props:PZe,setup(n,{expose:e}){const t=n,{focusing:i,id:s,isActive:o,handleFocus:r,handleHeaderClick:a,handleEnterClick:c}=FZe(t),{arrowKls:u,headKls:d,rootKls:f,itemWrapperKls:g,itemContentKls:p,scopedContentId:_,scopedHeadId:v}=BZe(t,{focusing:i,isActive:o,id:s});return e({isActive:o}),(C,y)=>(G(),he("div",{class:Y(T(f))},[oe("button",{id:T(v),class:Y(T(d)),"aria-expanded":T(o),"aria-controls":T(_),"aria-describedby":T(_),tabindex:C.disabled?-1:0,type:"button",onClick:T(a),onKeydown:xs(bn(T(c),["stop","prevent"]),["space","enter"]),onFocus:T(r),onBlur:w=>i.value=!1},[Ye(C.$slots,"title",{},()=>[mn(st(C.title),1)]),Ye(C.$slots,"icon",{isActive:T(o)},()=>[ce(T(tn),{class:Y(T(u))},{default:_e(()=>[(G(),nt(ui(C.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),ce(T(L8),null,{default:_e(()=>[Un(oe("div",{id:T(_),role:"region",class:Y(T(g)),"aria-hidden":!T(o),"aria-labelledby":T(v)},[oe("div",{class:Y(T(p))},[Ye(C.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[Gi,T(o)]])]),_:3})],2))}});var zSe=Rt(VZe,[["__file","collapse-item.vue"]]);const UZe=Nn(NZe,{CollapseItem:zSe}),WZe=Xo(zSe),GZe=Lt({color:{type:Ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let s9=!1;function lx(n,e){if(!Si)return;const t=function(o){var r;(r=e.drag)==null||r.call(e,o)},i=function(o){var r;document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",i),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",i),document.onselectstart=null,document.ondragstart=null,s9=!1,(r=e.end)==null||r.call(e,o)},s=function(o){var r;s9||(o.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",t),document.addEventListener("mouseup",i),document.addEventListener("touchmove",t),document.addEventListener("touchend",i),s9=!0,(r=e.start)==null||r.call(e,o))};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s,{passive:!1})}const zZe=(n,e)=>{if(!Si||!n||!e)return!1;const t=n.getBoundingClientRect();let i;return e instanceof Element?i=e.getBoundingClientRect():i={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0},t.top<i.bottom&&t.bottom>i.top&&t.right>i.left&&t.left<i.right},Jue=n=>{let e=0,t=n;for(;t;)e+=t.offsetTop,t=t.offsetParent;return e},OX=(n,e)=>Math.abs(Jue(n)-Jue(e)),Ete=n=>{let e,t;return n.type==="touchend"?(t=n.changedTouches[0].clientY,e=n.changedTouches[0].clientX):n.type.startsWith("touch")?(t=n.touches[0].clientY,e=n.touches[0].clientX):(t=n.clientY,e=n.clientX),{clientX:e,clientY:t}},KZe=n=>{const e=Qn(),{t}=wi(),i=us(),s=us(),o=W(()=>n.color.get("alpha")),r=W(()=>t("el.colorpicker.alphaLabel"));function a(f){var g;f.target!==i.value&&c(f),(g=i.value)==null||g.focus()}function c(f){if(!s.value||!i.value)return;const p=e.vnode.el.getBoundingClientRect(),{clientX:_,clientY:v}=Ete(f);if(n.vertical){let C=v-p.top;C=Math.max(i.value.offsetHeight/2,C),C=Math.min(C,p.height-i.value.offsetHeight/2),n.color.set("alpha",Math.round((C-i.value.offsetHeight/2)/(p.height-i.value.offsetHeight)*100))}else{let C=_-p.left;C=Math.max(i.value.offsetWidth/2,C),C=Math.min(C,p.width-i.value.offsetWidth/2),n.color.set("alpha",Math.round((C-i.value.offsetWidth/2)/(p.width-i.value.offsetWidth)*100))}}function u(f){const{code:g,shiftKey:p}=f,_=p?10:1;switch(g){case zt.left:case zt.down:f.preventDefault(),f.stopPropagation(),d(-_);break;case zt.right:case zt.up:f.preventDefault(),f.stopPropagation(),d(_);break}}function d(f){let g=o.value+f;g=g<0?0:g>100?100:g,n.color.set("alpha",g)}return{thumb:i,bar:s,alpha:o,alphaLabel:r,handleDrag:c,handleClick:a,handleKeydown:u}},jZe=(n,{bar:e,thumb:t,handleDrag:i})=>{const s=Qn(),o=vt("color-alpha-slider"),r=te(0),a=te(0),c=te();function u(){if(!t.value||n.vertical)return 0;const w=s.vnode.el,I=n.color.get("alpha");return w?Math.round(I*(w.offsetWidth-t.value.offsetWidth/2)/100):0}function d(){if(!t.value)return 0;const w=s.vnode.el;if(!n.vertical)return 0;const I=n.color.get("alpha");return w?Math.round(I*(w.offsetHeight-t.value.offsetHeight/2)/100):0}function f(){if(n.color&&n.color.value){const{r:w,g:I,b:L}=n.color.toRgb();return`linear-gradient(to right, rgba(${w}, ${I}, ${L}, 0) 0%, rgba(${w}, ${I}, ${L}, 1) 100%)`}return""}function g(){r.value=u(),a.value=d(),c.value=f()}$n(()=>{if(!e.value||!t.value)return;const w={drag:I=>{i(I)},end:I=>{i(I)}};lx(e.value,w),lx(t.value,w),g()}),ht(()=>n.color.get("alpha"),()=>g()),ht(()=>n.color.value,()=>g());const p=W(()=>[o.b(),o.is("vertical",n.vertical)]),_=W(()=>o.e("bar")),v=W(()=>o.e("thumb")),C=W(()=>({background:c.value})),y=W(()=>({left:mr(r.value),top:mr(a.value)}));return{rootKls:p,barKls:_,barStyle:C,thumbKls:v,thumbStyle:y,update:g}},XZe="ElColorAlphaSlider",YZe=$e({name:XZe}),qZe=$e({...YZe,props:GZe,setup(n,{expose:e}){const t=n,{alpha:i,alphaLabel:s,bar:o,thumb:r,handleDrag:a,handleClick:c,handleKeydown:u}=KZe(t),{rootKls:d,barKls:f,barStyle:g,thumbKls:p,thumbStyle:_,update:v}=jZe(t,{bar:o,thumb:r,handleDrag:a});return e({update:v,bar:o,thumb:r}),(C,y)=>(G(),he("div",{class:Y(T(d))},[oe("div",{ref_key:"bar",ref:o,class:Y(T(f)),style:on(T(g)),onClick:T(c)},null,14,["onClick"]),oe("div",{ref_key:"thumb",ref:r,class:Y(T(p)),style:on(T(_)),"aria-label":T(s),"aria-valuenow":T(i),"aria-orientation":C.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:T(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var JZe=Rt(qZe,[["__file","alpha-slider.vue"]]);const QZe=$e({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(n){const e=vt("color-hue-slider"),t=Qn(),i=te(),s=te(),o=te(0),r=te(0),a=W(()=>n.color.get("hue"));ht(()=>a.value,()=>{g()});function c(p){p.target!==i.value&&u(p)}function u(p){if(!s.value||!i.value)return;const v=t.vnode.el.getBoundingClientRect(),{clientX:C,clientY:y}=Ete(p);let w;if(n.vertical){let I=y-v.top;I=Math.min(I,v.height-i.value.offsetHeight/2),I=Math.max(i.value.offsetHeight/2,I),w=Math.round((I-i.value.offsetHeight/2)/(v.height-i.value.offsetHeight)*360)}else{let I=C-v.left;I=Math.min(I,v.width-i.value.offsetWidth/2),I=Math.max(i.value.offsetWidth/2,I),w=Math.round((I-i.value.offsetWidth/2)/(v.width-i.value.offsetWidth)*360)}n.color.set("hue",w)}function d(){if(!i.value)return 0;const p=t.vnode.el;if(n.vertical)return 0;const _=n.color.get("hue");return p?Math.round(_*(p.offsetWidth-i.value.offsetWidth/2)/360):0}function f(){if(!i.value)return 0;const p=t.vnode.el;if(!n.vertical)return 0;const _=n.color.get("hue");return p?Math.round(_*(p.offsetHeight-i.value.offsetHeight/2)/360):0}function g(){o.value=d(),r.value=f()}return $n(()=>{if(!s.value||!i.value)return;const p={drag:_=>{u(_)},end:_=>{u(_)}};lx(s.value,p),lx(i.value,p),g()}),{bar:s,thumb:i,thumbLeft:o,thumbTop:r,hueValue:a,handleClick:c,update:g,ns:e}}});function ZZe(n,e,t,i,s,o){return G(),he("div",{class:Y([n.ns.b(),n.ns.is("vertical",n.vertical)])},[oe("div",{ref:"bar",class:Y(n.ns.e("bar")),onClick:n.handleClick},null,10,["onClick"]),oe("div",{ref:"thumb",class:Y(n.ns.e("thumb")),style:on({left:n.thumbLeft+"px",top:n.thumbTop+"px"})},null,6)],2)}var eet=Rt(QZe,[["render",ZZe],["__file","hue-slider.vue"]]);const tet=Lt({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:cl,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:ua.teleported,predefine:{type:Ke(Array)},validateEvent:{type:Boolean,default:!0},...Wa(["ariaLabel"])}),net={[Kn]:n=>sn(n)||Ul(n),[Ms]:n=>sn(n)||Ul(n),activeChange:n=>sn(n)||Ul(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent},KSe=Symbol("colorPickerContextKey"),Que=function(n,e,t){return[n,e*t/((n=(2-e)*t)<1?n:2-n)||0,n/2]},iet=function(n){return sn(n)&&n.includes(".")&&Number.parseFloat(n)===1},set=function(n){return sn(n)&&n.includes("%")},uO=function(n,e){iet(n)&&(n="100%");const t=set(n);return n=Math.min(e,Math.max(0,Number.parseFloat(`${n}`))),t&&(n=Number.parseInt(`${n*e}`,10)/100),Math.abs(n-e)<1e-6?1:n%e/Number.parseFloat(e)},Zue={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},wU=n=>{n=Math.min(Math.round(n),255);const e=Math.floor(n/16),t=n%16;return`${Zue[e]||e}${Zue[t]||t}`},ede=function({r:n,g:e,b:t}){return Number.isNaN(+n)||Number.isNaN(+e)||Number.isNaN(+t)?"":`#${wU(n)}${wU(e)}${wU(t)}`},o9={A:10,B:11,C:12,D:13,E:14,F:15},aS=function(n){return n.length===2?(o9[n[0].toUpperCase()]||+n[0])*16+(o9[n[1].toUpperCase()]||+n[1]):o9[n[1].toUpperCase()]||+n[1]},oet=function(n,e,t){e=e/100,t=t/100;let i=e;const s=Math.max(t,.01);t*=2,e*=t<=1?t:2-t,i*=s<=1?s:2-s;const o=(t+e)/2,r=t===0?2*i/(s+i):2*e/(t+e);return{h:n,s:r*100,v:o*100}},tde=(n,e,t)=>{n=uO(n,255),e=uO(e,255),t=uO(t,255);const i=Math.max(n,e,t),s=Math.min(n,e,t);let o;const r=i,a=i-s,c=i===0?0:a/i;if(i===s)o=0;else{switch(i){case n:{o=(e-t)/a+(e<t?6:0);break}case e:{o=(t-n)/a+2;break}case t:{o=(n-e)/a+4;break}}o/=6}return{h:o*360,s:c*100,v:r*100}},LN=function(n,e,t){n=uO(n,360)*6,e=uO(e,100),t=uO(t,100);const i=Math.floor(n),s=n-i,o=t*(1-e),r=t*(1-s*e),a=t*(1-(1-s)*e),c=i%6,u=[t,r,o,o,a,t][c],d=[a,t,t,r,o,o][c],f=[o,o,a,t,t,r][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};let BD=class{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const t in e)Wi(e,t)&&(this[t]=e[t]);e.value?this.fromString(e.value):this.doOnChange()}set(e,t){if(arguments.length===1&&typeof e=="object"){for(const i in e)Wi(e,i)&&this.set(i,e[i]);return}this[`_${e}`]=t,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return LN(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const t=(i,s,o)=>{this._hue=Math.max(0,Math.min(360,i)),this._saturation=Math.max(0,Math.min(100,s)),this._value=Math.max(0,Math.min(100,o)),this.doOnChange()};if(e.includes("hsl")){const i=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(s=>s!=="").map((s,o)=>o>2?Number.parseFloat(s):Number.parseInt(s,10));if(i.length===4?this._alpha=Number.parseFloat(i[3])*100:i.length===3&&(this._alpha=100),i.length>=3){const{h:s,s:o,v:r}=oet(i[0],i[1],i[2]);t(s,o,r)}}else if(e.includes("hsv")){const i=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(s=>s!=="").map((s,o)=>o>2?Number.parseFloat(s):Number.parseInt(s,10));i.length===4?this._alpha=Number.parseFloat(i[3])*100:i.length===3&&(this._alpha=100),i.length>=3&&t(i[0],i[1],i[2])}else if(e.includes("rgb")){const i=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(s=>s!=="").map((s,o)=>o>2?Number.parseFloat(s):Number.parseInt(s,10));if(i.length===4?this._alpha=Number.parseFloat(i[3])*100:i.length===3&&(this._alpha=100),i.length>=3){const{h:s,s:o,v:r}=tde(i[0],i[1],i[2]);t(s,o,r)}}else if(e.includes("#")){const i=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(i))return;let s,o,r;i.length===3?(s=aS(i[0]+i[0]),o=aS(i[1]+i[1]),r=aS(i[2]+i[2])):(i.length===6||i.length===8)&&(s=aS(i.slice(0,2)),o=aS(i.slice(2,4)),r=aS(i.slice(4,6))),i.length===8?this._alpha=aS(i.slice(6))/255*100:(i.length===3||i.length===6)&&(this._alpha=100);const{h:a,s:c,v:u}=tde(s,o,r);t(a,c,u)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:t,_value:i,_alpha:s,format:o}=this;if(this.enableAlpha)switch(o){case"hsl":{const r=Que(e,t/100,i/100);this.value=`hsla(${e}, ${Math.round(r[1]*100)}%, ${Math.round(r[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(t)}%, ${Math.round(i)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${ede(LN(e,t,i))}${wU(s*255/100)}`;break}default:{const{r,g:a,b:c}=LN(e,t,i);this.value=`rgba(${r}, ${a}, ${c}, ${this.get("alpha")/100})`}}else switch(o){case"hsl":{const r=Que(e,t/100,i/100);this.value=`hsl(${e}, ${Math.round(r[1]*100)}%, ${Math.round(r[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(t)}%, ${Math.round(i)}%)`;break}case"rgb":{const{r,g:a,b:c}=LN(e,t,i);this.value=`rgb(${r}, ${a}, ${c})`;break}default:this.value=ede(LN(e,t,i))}}};const ret=$e({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(n){const e=vt("color-predefine"),{currentColor:t}=Kt(KSe),i=te(o(n.colors,n.color));ht(()=>t.value,r=>{const a=new BD;a.fromString(r),i.value.forEach(c=>{c.selected=a.compare(c)})}),Sl(()=>{i.value=o(n.colors,n.color)});function s(r){n.color.fromString(n.colors[r])}function o(r,a){return r.map(c=>{const u=new BD;return u.enableAlpha=n.enableAlpha,u.format="rgba",u.fromString(c),u.selected=u.value===a.value,u})}return{rgbaColors:i,handleSelect:s,ns:e}}});function aet(n,e,t,i,s,o){return G(),he("div",{class:Y(n.ns.b())},[oe("div",{class:Y(n.ns.e("colors"))},[(G(!0),he(Qt,null,fi(n.rgbaColors,(r,a)=>(G(),he("div",{key:n.colors[a],class:Y([n.ns.e("color-selector"),n.ns.is("alpha",r._alpha<100),{selected:r.selected}]),onClick:c=>n.handleSelect(a)},[oe("div",{style:on({backgroundColor:r.value})},null,4)],10,["onClick"]))),128))],2)],2)}var cet=Rt(ret,[["render",aet],["__file","predefine.vue"]]);const uet=$e({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(n){const e=vt("color-svpanel"),t=Qn(),i=te(0),s=te(0),o=te("hsl(0, 100%, 50%)"),r=W(()=>{const u=n.color.get("hue"),d=n.color.get("value");return{hue:u,value:d}});function a(){const u=n.color.get("saturation"),d=n.color.get("value"),f=t.vnode.el,{clientWidth:g,clientHeight:p}=f;s.value=u*g/100,i.value=(100-d)*p/100,o.value=`hsl(${n.color.get("hue")}, 100%, 50%)`}function c(u){const f=t.vnode.el.getBoundingClientRect(),{clientX:g,clientY:p}=Ete(u);let _=g-f.left,v=p-f.top;_=Math.max(0,_),_=Math.min(_,f.width),v=Math.max(0,v),v=Math.min(v,f.height),s.value=_,i.value=v,n.color.set({saturation:_/f.width*100,value:100-v/f.height*100})}return ht(()=>r.value,()=>{a()}),$n(()=>{lx(t.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),a()}),{cursorTop:i,cursorLeft:s,background:o,colorValue:r,handleDrag:c,update:a,ns:e}}});function det(n,e,t,i,s,o){return G(),he("div",{class:Y(n.ns.b()),style:on({backgroundColor:n.background})},[oe("div",{class:Y(n.ns.e("white"))},null,2),oe("div",{class:Y(n.ns.e("black"))},null,2),oe("div",{class:Y(n.ns.e("cursor")),style:on({top:n.cursorTop+"px",left:n.cursorLeft+"px"})},[oe("div")],6)],6)}var het=Rt(uet,[["render",det],["__file","sv-panel.vue"]]);const fet=$e({name:"ElColorPicker"}),get=$e({...fet,props:tet,emits:net,setup(n,{expose:e,emit:t}){const i=n,{t:s}=wi(),o=vt("color"),{formItem:r}=fc(),a=jr(),c=gc(),{inputId:u,isLabeledByFormItem:d}=Qf(i,{formItemContext:r}),f=te(),g=te(),p=te(),_=te(),v=te(),C=te(),{isFocused:y,handleFocus:w,handleBlur:I}=$y(v,{beforeFocus(){return c.value},beforeBlur(Ge){var dt;return(dt=_.value)==null?void 0:dt.isFocusInsideContent(Ge)},afterBlur(){q(!1),J()}});let L=!0;const O=Ki(new BD({enableAlpha:i.showAlpha,format:i.colorFormat||"",value:i.modelValue})),A=te(!1),N=te(!1),D=te(""),P=W(()=>!i.modelValue&&!N.value?"transparent":de(O,i.showAlpha)),F=W(()=>!i.modelValue&&!N.value?"":O.value),V=W(()=>d.value?void 0:i.ariaLabel||s("el.colorpicker.defaultLabel")),U=W(()=>d.value?r==null?void 0:r.labelId:void 0),Q=W(()=>[o.b("picker"),o.is("disabled",c.value),o.bm("picker",a.value),o.is("focused",y.value)]);function de(Ge,dt){if(!(Ge instanceof BD))throw new TypeError("color should be instance of _color Class");const{r:ze,g:ee,b:ye}=Ge.toRgb();return dt?`rgba(${ze}, ${ee}, ${ye}, ${Ge.get("alpha")/100})`:`rgb(${ze}, ${ee}, ${ye})`}function q(Ge){A.value=Ge}const K=Md(q,100,{leading:!0});function re(){c.value||q(!0)}function Z(){K(!1),J()}function J(){cn(()=>{i.modelValue?O.fromString(i.modelValue):(O.value="",cn(()=>{N.value=!1}))})}function ge(){c.value||K(!A.value)}function ve(){O.fromString(D.value)}function Le(){const Ge=O.value;t(Kn,Ge),t("change",Ge),i.validateEvent&&(r==null||r.validate("change").catch(dt=>void 0)),K(!1),cn(()=>{const dt=new BD({enableAlpha:i.showAlpha,format:i.colorFormat||"",value:i.modelValue});O.compare(dt)||J()})}function Ee(){K(!1),t(Kn,null),t("change",null),i.modelValue!==null&&i.validateEvent&&(r==null||r.validate("change").catch(Ge=>void 0)),J()}function Ne(){A.value&&(Z(),y.value&&we())}function qe(Ge){Ge.preventDefault(),Ge.stopPropagation(),q(!1),J()}function Re(Ge){switch(Ge.code){case zt.enter:case zt.numpadEnter:case zt.space:Ge.preventDefault(),Ge.stopPropagation(),re(),C.value.focus();break;case zt.esc:qe(Ge);break}}function we(){v.value.focus()}function Ve(){v.value.blur()}return $n(()=>{i.modelValue&&(D.value=F.value)}),ht(()=>i.modelValue,Ge=>{Ge?Ge&&Ge!==O.value&&(L=!1,O.fromString(Ge)):N.value=!1}),ht(()=>[i.colorFormat,i.showAlpha],()=>{O.enableAlpha=i.showAlpha,O.format=i.colorFormat||O.format,O.doOnChange(),t(Kn,O.value)}),ht(()=>F.value,Ge=>{D.value=Ge,L&&t("activeChange",Ge),L=!0}),ht(()=>O.value,()=>{!i.modelValue&&!N.value&&(N.value=!0)}),ht(()=>A.value,()=>{cn(()=>{var Ge,dt,ze;(Ge=f.value)==null||Ge.update(),(dt=g.value)==null||dt.update(),(ze=p.value)==null||ze.update()})}),pi(KSe,{currentColor:F}),e({color:O,show:re,hide:Z,focus:we,blur:Ve}),(Ge,dt)=>(G(),nt(T(uc),{ref_key:"popper",ref:_,visible:A.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[T(o).be("picker","panel"),T(o).b("dropdown"),Ge.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:Ge.teleported,transition:`${T(o).namespace.value}-zoom-in-top`,persistent:"",onHide:ze=>q(!1)},{content:_e(()=>[Un((G(),he("div",{onKeydown:xs(qe,["esc"])},[oe("div",{class:Y(T(o).be("dropdown","main-wrapper"))},[ce(eet,{ref_key:"hue",ref:f,class:"hue-slider",color:T(O),vertical:""},null,8,["color"]),ce(het,{ref_key:"sv",ref:g,color:T(O)},null,8,["color"])],2),Ge.showAlpha?(G(),nt(JZe,{key:0,ref_key:"alpha",ref:p,color:T(O)},null,8,["color"])):Qe("v-if",!0),Ge.predefine?(G(),nt(cet,{key:1,ref:"predefine","enable-alpha":Ge.showAlpha,color:T(O),colors:Ge.predefine},null,8,["enable-alpha","color","colors"])):Qe("v-if",!0),oe("div",{class:Y(T(o).be("dropdown","btns"))},[oe("span",{class:Y(T(o).be("dropdown","value"))},[ce(T(Kc),{ref_key:"inputRef",ref:C,modelValue:D.value,"onUpdate:modelValue":ze=>D.value=ze,"validate-event":!1,size:"small",onKeyup:xs(ve,["enter"]),onBlur:ve},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),ce(T(_a),{class:Y(T(o).be("dropdown","link-btn")),text:"",size:"small",onClick:Ee},{default:_e(()=>[mn(st(T(s)("el.colorpicker.clear")),1)]),_:1},8,["class"]),ce(T(_a),{plain:"",size:"small",class:Y(T(o).be("dropdown","btn")),onClick:Le},{default:_e(()=>[mn(st(T(s)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[T(cb),Ne]])]),default:_e(()=>[oe("div",hi({id:T(u),ref_key:"triggerRef",ref:v},Ge.$attrs,{class:T(Q),role:"button","aria-label":T(V),"aria-labelledby":T(U),"aria-description":T(s)("el.colorpicker.description",{color:Ge.modelValue||""}),"aria-disabled":T(c),tabindex:T(c)?-1:Ge.tabindex,onKeydown:Re,onFocus:T(w),onBlur:T(I)}),[T(c)?(G(),he("div",{key:0,class:Y(T(o).be("picker","mask"))},null,2)):Qe("v-if",!0),oe("div",{class:Y(T(o).be("picker","trigger")),onClick:ge},[oe("span",{class:Y([T(o).be("picker","color"),T(o).is("alpha",Ge.showAlpha)])},[oe("span",{class:Y(T(o).be("picker","color-inner")),style:on({backgroundColor:T(P)})},[Un(ce(T(tn),{class:Y([T(o).be("picker","icon"),T(o).is("icon-arrow-down")])},{default:_e(()=>[ce(T(Lb))]),_:1},8,["class"]),[[Gi,Ge.modelValue||N.value]]),Un(ce(T(tn),{class:Y([T(o).be("picker","empty"),T(o).is("icon-close")])},{default:_e(()=>[ce(T(Zg))]),_:1},8,["class"]),[[Gi,!Ge.modelValue&&!N.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var pet=Rt(get,[["__file","color-picker.vue"]]);const met=Nn(pet),_et=Lt({a11y:{type:Boolean,default:!0},locale:{type:Ke(Object)},size:cl,button:{type:Ke(Object)},experimentalFeatures:{type:Ke(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:Ke(Object)},zIndex:Number,namespace:{type:String,default:"el"},...oM}),yg={},vet=$e({name:"ElConfigProvider",props:_et,setup(n,{slots:e}){ht(()=>n.message,i=>{Object.assign(yg,i??{})},{immediate:!0,deep:!0});const t=qee(n);return()=>Ye(e,"default",{config:t==null?void 0:t.value})}}),bet=Nn(vet),Tet=$e({name:"ElContainer"}),Cet=$e({...Tet,props:{direction:{type:String}},setup(n){const e=n,t=dl(),i=vt("container"),s=W(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(r=>{const a=r.type.name;return a==="ElHeader"||a==="ElFooter"}):!1);return(o,r)=>(G(),he("section",{class:Y([T(i).b(),T(i).is("vertical",T(s))])},[Ye(o.$slots,"default")],2))}});var yet=Rt(Cet,[["__file","container.vue"]]);const Eet=$e({name:"ElAside"}),wet=$e({...Eet,props:{width:{type:String,default:null}},setup(n){const e=n,t=vt("aside"),i=W(()=>e.width?t.cssVarBlock({width:e.width}):{});return(s,o)=>(G(),he("aside",{class:Y(T(t).b()),style:on(T(i))},[Ye(s.$slots,"default")],6))}});var jSe=Rt(wet,[["__file","aside.vue"]]);const Iet=$e({name:"ElFooter"}),Let=$e({...Iet,props:{height:{type:String,default:null}},setup(n){const e=n,t=vt("footer"),i=W(()=>e.height?t.cssVarBlock({height:e.height}):{});return(s,o)=>(G(),he("footer",{class:Y(T(t).b()),style:on(T(i))},[Ye(s.$slots,"default")],6))}});var XSe=Rt(Let,[["__file","footer.vue"]]);const Oet=$e({name:"ElHeader"}),Ret=$e({...Oet,props:{height:{type:String,default:null}},setup(n){const e=n,t=vt("header"),i=W(()=>e.height?t.cssVarBlock({height:e.height}):{});return(s,o)=>(G(),he("header",{class:Y(T(t).b()),style:on(T(i))},[Ye(s.$slots,"default")],6))}});var YSe=Rt(Ret,[["__file","header.vue"]]);const Met=$e({name:"ElMain"}),ket=$e({...Met,setup(n){const e=vt("main");return(t,i)=>(G(),he("main",{class:Y(T(e).b())},[Ye(t.$slots,"default")],2))}});var qSe=Rt(ket,[["__file","main.vue"]]);const Aet=Nn(yet,{Aside:jSe,Footer:XSe,Header:YSe,Main:qSe}),Net=Xo(jSe),Det=Xo(XSe),$et=Xo(YSe),xet=Xo(qSe);var IU={exports:{}},Pet=IU.exports,nde;function Fet(){return nde||(nde=1,function(n,e){(function(t,i){n.exports=i()})(Pet,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,o=/\d\d/,r=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,c={},u=function(C){return(C=+C)+(C>68?1900:2e3)},d=function(C){return function(y){this[C]=+y}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var w=y.match(/([+-]|\d\d)/g),I=60*w[1]+(+w[2]||0);return I===0?0:w[0]==="+"?-I:I}(C)}],g=function(C){var y=c[C];return y&&(y.indexOf?y:y.s.concat(y.f))},p=function(C,y){var w,I=c.meridiem;if(I){for(var L=1;L<=24;L+=1)if(C.indexOf(I(L,0,y))>-1){w=L>12;break}}else w=C===(y?"pm":"PM");return w},_={A:[a,function(C){this.afternoon=p(C,!1)}],a:[a,function(C){this.afternoon=p(C,!0)}],Q:[s,function(C){this.month=3*(C-1)+1}],S:[s,function(C){this.milliseconds=100*+C}],SS:[o,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[r,d("seconds")],ss:[r,d("seconds")],m:[r,d("minutes")],mm:[r,d("minutes")],H:[r,d("hours")],h:[r,d("hours")],HH:[r,d("hours")],hh:[r,d("hours")],D:[r,d("day")],DD:[o,d("day")],Do:[a,function(C){var y=c.ordinal,w=C.match(/\d+/);if(this.day=w[0],y)for(var I=1;I<=31;I+=1)y(I).replace(/\[|\]/g,"")===C&&(this.day=I)}],w:[r,d("week")],ww:[o,d("week")],M:[r,d("month")],MM:[o,d("month")],MMM:[a,function(C){var y=g("months"),w=(g("monthsShort")||y.map(function(I){return I.slice(0,3)})).indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(C){var y=g("months").indexOf(C)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,d("year")],YY:[o,function(C){this.year=u(C)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function v(C){var y,w;y=C,w=c&&c.formats;for(var I=(C=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(F,V,U){var Q=U&&U.toUpperCase();return V||w[U]||t[U]||w[Q].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(de,q,K){return q||K.slice(1)})})).match(i),L=I.length,O=0;O<L;O+=1){var A=I[O],N=_[A],D=N&&N[0],P=N&&N[1];I[O]=P?{regex:D,parser:P}:A.replace(/^\[|\]$/g,"")}return function(F){for(var V={},U=0,Q=0;U<L;U+=1){var de=I[U];if(typeof de=="string")Q+=de.length;else{var q=de.regex,K=de.parser,re=F.slice(Q),Z=q.exec(re)[0];K.call(V,Z),F=F.replace(Z,"")}}return function(J){var ge=J.afternoon;if(ge!==void 0){var ve=J.hours;ge?ve<12&&(J.hours+=12):ve===12&&(J.hours=0),delete J.afternoon}}(V),V}}return function(C,y,w){w.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(u=C.parseTwoDigitYear);var I=y.prototype,L=I.parse;I.parse=function(O){var A=O.date,N=O.utc,D=O.args;this.$u=N;var P=D[1];if(typeof P=="string"){var F=D[2]===!0,V=D[3]===!0,U=F||V,Q=D[2];V&&(Q=D[2]),c=this.$locale(),!F&&Q&&(c=w.Ls[Q]),this.$d=function(re,Z,J,ge){try{if(["x","X"].indexOf(Z)>-1)return new Date((Z==="X"?1e3:1)*re);var ve=v(Z)(re),Le=ve.year,Ee=ve.month,Ne=ve.day,qe=ve.hours,Re=ve.minutes,we=ve.seconds,Ve=ve.milliseconds,Ge=ve.zone,dt=ve.week,ze=new Date,ee=Ne||(Le||Ee?1:ze.getDate()),ye=Le||ze.getFullYear(),Me=0;Le&&!Ee||(Me=Ee>0?Ee-1:ze.getMonth());var et,at=qe||0,Ue=Re||0,Se=we||0,Ie=Ve||0;return Ge?new Date(Date.UTC(ye,Me,ee,at,Ue,Se,Ie+60*Ge.offset*1e3)):J?new Date(Date.UTC(ye,Me,ee,at,Ue,Se,Ie)):(et=new Date(ye,Me,ee,at,Ue,Se,Ie),dt&&(et=ge(et).week(dt).toDate()),et)}catch{return new Date("")}}(A,P,N,w),this.init(),Q&&Q!==!0&&(this.$L=this.locale(Q).$L),U&&A!=this.format(P)&&(this.$d=new Date("")),c={}}else if(P instanceof Array)for(var de=P.length,q=1;q<=de;q+=1){D[1]=P[q-1];var K=w.apply(this,D);if(K.isValid()){this.$d=K.$d,this.$L=K.$L,this.init();break}q===de&&(this.$d=new Date(""))}else L.call(this,O)}}})}(IU)),IU.exports}var Bet=Fet();const Ste=cp(Bet);var LU={exports:{}},Het=LU.exports,ide;function Vet(){return ide||(ide=1,function(n,e){(function(t,i){n.exports=i()})(Het,function(){return function(t,i){var s=i.prototype,o=s.format;s.format=function(r){var a=this,c=this.$locale();if(!this.isValid())return o.bind(this)(r);var u=this.$utils(),d=(r||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(f){switch(f){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return c.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return c.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),f==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),f==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return f}});return o.bind(this)(d)}}})}(LU)),LU.exports}var Uet=Vet();const Wet=cp(Uet);var OU={exports:{}},Get=OU.exports,sde;function zet(){return sde||(sde=1,function(n,e){(function(t,i){n.exports=i()})(Get,function(){var t="week",i="year";return function(s,o,r){var a=o.prototype;a.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=r(this).startOf(i).add(1,i).date(u),f=r(this).endOf(t);if(d.isBefore(f))return 1}var g=r(this).startOf(i).date(u).startOf(t).subtract(1,"millisecond"),p=this.diff(g,t,!0);return p<0?r(this).startOf("week").week():Math.ceil(p)},a.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})}(OU)),OU.exports}var Ket=zet();const jet=cp(Ket);var RU={exports:{}},Xet=RU.exports,ode;function Yet(){return ode||(ode=1,function(n,e){(function(t,i){n.exports=i()})(Xet,function(){return function(t,i){i.prototype.weekYear=function(){var s=this.month(),o=this.week(),r=this.year();return o===1&&s===11?r+1:s===0&&o>=52?r-1:r}}})}(RU)),RU.exports}var qet=Yet();const Jet=cp(qet);var MU={exports:{}},Qet=MU.exports,rde;function Zet(){return rde||(rde=1,function(n,e){(function(t,i){n.exports=i()})(Qet,function(){return function(t,i,s){i.prototype.dayOfYear=function(o){var r=Math.round((s(this).startOf("day")-s(this).startOf("year"))/864e5)+1;return o==null?r:this.add(o-r,"day")}}})}(MU)),MU.exports}var ett=Zet();const ttt=cp(ett);var kU={exports:{}},ntt=kU.exports,lde;function itt(){return lde||(lde=1,function(n,e){(function(t,i){n.exports=i()})(ntt,function(){return function(t,i){i.prototype.isSameOrAfter=function(s,o){return this.isSame(s,o)||this.isAfter(s,o)}}})}(kU)),kU.exports}var stt=itt();const ott=cp(stt);var AU={exports:{}},rtt=AU.exports,ade;function ltt(){return ade||(ade=1,function(n,e){(function(t,i){n.exports=i()})(rtt,function(){return function(t,i){i.prototype.isSameOrBefore=function(s,o){return this.isSame(s,o)||this.isBefore(s,o)}}})}(AU)),AU.exports}var att=ltt();const ctt=cp(att),cde=["hours","minutes","seconds"],RX="HH:mm:ss",S1="YYYY-MM-DD",utt={date:S1,dates:S1,week:"gggg[w]ww",year:"YYYY",years:"YYYY",month:"YYYY-MM",months:"YYYY-MM",datetime:`${S1} ${RX}`,monthrange:"YYYY-MM",yearrange:"YYYY",daterange:S1,datetimerange:`${S1} ${RX}`},JSe=Lt({disabledHours:{type:Ke(Function)},disabledMinutes:{type:Ke(Function)},disabledSeconds:{type:Ke(Function)}}),QSe=Lt({visible:Boolean,actualVisible:{type:Boolean,default:void 0},format:{type:String,default:""}}),wte=Lt({id:{type:Ke([Array,String])},name:{type:Ke([Array,String])},popperClass:{type:String,default:""},format:String,valueFormat:String,dateFormat:String,timeFormat:String,type:{type:String,default:""},clearable:{type:Boolean,default:!0},clearIcon:{type:Ke([String,Object]),default:Ob},editable:{type:Boolean,default:!0},prefixIcon:{type:Ke([String,Object]),default:""},size:cl,readonly:Boolean,disabled:Boolean,placeholder:{type:String,default:""},popperOptions:{type:Ke(Object),default:()=>({})},modelValue:{type:Ke([Date,Array,String,Number]),default:""},rangeSeparator:{type:String,default:"-"},startPlaceholder:String,endPlaceholder:String,defaultValue:{type:Ke([Date,Array])},defaultTime:{type:Ke([Date,Array])},isRange:Boolean,...JSe,disabledDate:{type:Function},cellClassName:{type:Function},shortcuts:{type:Array,default:()=>[]},arrowControl:Boolean,tabindex:{type:Ke([String,Number]),default:0},validateEvent:{type:Boolean,default:!0},unlinkPanels:Boolean,placement:{type:Ke(String),values:Rb,default:"bottom"},fallbackPlacements:{type:Ke(Array),default:["bottom","top","right","left"]},...oM,...Wa(["ariaLabel"]),showNow:{type:Boolean,default:!0}}),dtt=Lt({id:{type:Ke(Array)},name:{type:Ke(Array)},modelValue:{type:Ke([Array,String])},startPlaceholder:String,endPlaceholder:String}),htt=$e({name:"PickerRangeTrigger",inheritAttrs:!1}),ftt=$e({...htt,props:dtt,emits:["mouseenter","mouseleave","click","touchstart","focus","blur","startInput","endInput","startChange","endChange"],setup(n,{expose:e,emit:t}){const i=rF(),s=vt("date"),o=vt("range"),r=te(),a=te(),{wrapperRef:c,isFocused:u}=$y(r),d=L=>{t("click",L)},f=L=>{t("mouseenter",L)},g=L=>{t("mouseleave",L)},p=L=>{t("mouseenter",L)},_=L=>{t("startInput",L)},v=L=>{t("endInput",L)},C=L=>{t("startChange",L)},y=L=>{t("endChange",L)};return e({focus:()=>{var L;(L=r.value)==null||L.focus()},blur:()=>{var L,O;(L=r.value)==null||L.blur(),(O=a.value)==null||O.blur()}}),(L,O)=>(G(),he("div",{ref_key:"wrapperRef",ref:c,class:Y([T(s).is("active",T(u)),L.$attrs.class]),style:on(L.$attrs.style),onClick:d,onMouseenter:f,onMouseleave:g,onTouchstartPassive:p},[Ye(L.$slots,"prefix"),oe("input",hi(T(i),{id:L.id&&L.id[0],ref_key:"inputRef",ref:r,name:L.name&&L.name[0],placeholder:L.startPlaceholder,value:L.modelValue&&L.modelValue[0],class:T(o).b("input"),onInput:_,onChange:C}),null,16,["id","name","placeholder","value"]),Ye(L.$slots,"range-separator"),oe("input",hi(T(i),{id:L.id&&L.id[1],ref_key:"endInputRef",ref:a,name:L.name&&L.name[1],placeholder:L.endPlaceholder,value:L.modelValue&&L.modelValue[1],class:T(o).b("input"),onInput:v,onChange:y}),null,16,["id","name","placeholder","value"]),Ye(L.$slots,"suffix")],38))}});var gtt=Rt(ftt,[["__file","picker-range-trigger.vue"]]);const ptt=$e({name:"Picker"}),mtt=$e({...ptt,props:wte,emits:["update:modelValue","change","focus","blur","clear","calendar-change","panel-change","visible-change","keydown"],setup(n,{expose:e,emit:t}){const i=n,s=Ly(),{lang:o}=wi(),r=vt("date"),a=vt("input"),c=vt("range"),{form:u,formItem:d}=fc(),f=Kt("ElPopperOptions",{}),{valueOnClear:g}=v8(i,null),p=te(),_=te(),v=te(!1),C=te(!1),y=te(null);let w=!1;const{isFocused:I,handleFocus:L,handleBlur:O}=$y(_,{beforeFocus(){return i.readonly||J.value},afterFocus(){v.value=!0},beforeBlur(Ae){var Et;return!w&&((Et=p.value)==null?void 0:Et.isFocusInsideContent(Ae))},afterBlur(){Xe(),v.value=!1,w=!1,i.validateEvent&&(d==null||d.validate("blur").catch(Ae=>void 0))}}),A=W(()=>[r.b("editor"),r.bm("editor",i.type),a.e("wrapper"),r.is("disabled",J.value),r.is("active",v.value),c.b("editor"),at?c.bm("editor",at.value):"",s.class]),N=W(()=>[a.e("icon"),c.e("close-icon"),Ve.value?"":c.e("close-icon--hidden")]);ht(v,Ae=>{Ae?cn(()=>{Ae&&(y.value=i.modelValue)}):(Ie.value=null,cn(()=>{D(i.modelValue)}))});const D=(Ae,Et)=>{(Et||!Hue(Ae,y.value))&&(t("change",Ae),i.validateEvent&&(d==null||d.validate("change").catch(Tn=>void 0)))},P=Ae=>{if(!Hue(i.modelValue,Ae)){let Et;yt(Ae)?Et=Ae.map(Tn=>Uue(Tn,i.valueFormat,o.value)):Ae&&(Et=Uue(Ae,i.valueFormat,o.value)),t("update:modelValue",Ae&&Et,o.value)}},F=Ae=>{t("keydown",Ae)},V=W(()=>_.value?Array.from(_.value.$el.querySelectorAll("input")):[]),U=(Ae,Et,Tn)=>{const Hn=V.value;Hn.length&&(!Tn||Tn==="min"?(Hn[0].setSelectionRange(Ae,Et),Hn[0].focus()):Tn==="max"&&(Hn[1].setSelectionRange(Ae,Et),Hn[1].focus()))},Q=(Ae="",Et=!1)=>{v.value=Et;let Tn;yt(Ae)?Tn=Ae.map(Hn=>Hn.toDate()):Tn=Ae&&Ae.toDate(),Ie.value=null,P(Tn)},de=()=>{C.value=!0},q=()=>{t("visible-change",!0)},K=()=>{C.value=!1,v.value=!1,t("visible-change",!1)},re=()=>{v.value=!0},Z=()=>{v.value=!1},J=W(()=>i.disabled||(u==null?void 0:u.disabled)),ge=W(()=>{let Ae;if(dt.value?fe.value.getDefaultValue&&(Ae=fe.value.getDefaultValue()):yt(i.modelValue)?Ae=i.modelValue.map(Et=>Vue(Et,i.valueFormat,o.value)):Ae=Vue(i.modelValue,i.valueFormat,o.value),fe.value.getRangeAvailableTime){const Et=fe.value.getRangeAvailableTime(Ae);Ha(Et,Ae)||(Ae=Et,dt.value||P(RH(Ae)))}return yt(Ae)&&Ae.some(Et=>!Et)&&(Ae=[]),Ae}),ve=W(()=>{if(!fe.value.panelReady)return"";const Ae=Tt(ge.value);return yt(Ie.value)?[Ie.value[0]||Ae&&Ae[0]||"",Ie.value[1]||Ae&&Ae[1]||""]:Ie.value!==null?Ie.value:!Ee.value&&dt.value||!v.value&&dt.value?"":Ae?Ne.value||qe.value||Re.value?Ae.join(", "):Ae:""}),Le=W(()=>i.type.includes("time")),Ee=W(()=>i.type.startsWith("time")),Ne=W(()=>i.type==="dates"),qe=W(()=>i.type==="months"),Re=W(()=>i.type==="years"),we=W(()=>i.prefixIcon||(Le.value?PEe:TKe)),Ve=te(!1),Ge=Ae=>{i.readonly||J.value||(Ve.value&&(Ae.stopPropagation(),fe.value.handleClear?fe.value.handleClear():P(g.value),D(g.value,!0),Ve.value=!1,K()),t("clear"))},dt=W(()=>{const{modelValue:Ae}=i;return!Ae||yt(Ae)&&!Ae.filter(Boolean).length}),ze=async Ae=>{var Et;i.readonly||J.value||(((Et=Ae.target)==null?void 0:Et.tagName)!=="INPUT"||I.value)&&(v.value=!0)},ee=()=>{i.readonly||J.value||!dt.value&&i.clearable&&(Ve.value=!0)},ye=()=>{Ve.value=!1},Me=Ae=>{var Et;i.readonly||J.value||(((Et=Ae.touches[0].target)==null?void 0:Et.tagName)!=="INPUT"||I.value)&&(v.value=!0)},et=W(()=>i.type.includes("range")),at=jr(),Ue=W(()=>{var Ae,Et;return(Et=(Ae=T(p))==null?void 0:Ae.popperRef)==null?void 0:Et.contentRef}),Se=Yee(_,Ae=>{const Et=T(Ue),Tn=Ou(_);Et&&(Ae.target===Et||Ae.composedPath().includes(Et))||Ae.target===Tn||Tn&&Ae.composedPath().includes(Tn)||(v.value=!1)});As(()=>{Se==null||Se()});const Ie=te(null),Xe=()=>{if(Ie.value){const Ae=it(ve.value);Ae&&He(Ae)&&(P(RH(Ae)),Ie.value=null)}Ie.value===""&&(P(g.value),D(g.value),Ie.value=null)},it=Ae=>Ae?fe.value.parseUserInput(Ae):null,Tt=Ae=>Ae?fe.value.formatToString(Ae):null,He=Ae=>fe.value.isValidValue(Ae),ke=async Ae=>{if(i.readonly||J.value)return;const{code:Et}=Ae;if(F(Ae),Et===zt.esc){v.value===!0&&(v.value=!1,Ae.preventDefault(),Ae.stopPropagation());return}if(Et===zt.down&&(fe.value.handleFocusPicker&&(Ae.preventDefault(),Ae.stopPropagation()),v.value===!1&&(v.value=!0,await cn()),fe.value.handleFocusPicker)){fe.value.handleFocusPicker();return}if(Et===zt.tab){w=!0;return}if(Et===zt.enter||Et===zt.numpadEnter){(Ie.value===null||Ie.value===""||He(it(ve.value)))&&(Xe(),v.value=!1),Ae.stopPropagation();return}if(Ie.value){Ae.stopPropagation();return}fe.value.handleKeydownInput&&fe.value.handleKeydownInput(Ae)},ot=Ae=>{Ie.value=Ae,v.value||(v.value=!0)},Ct=Ae=>{const Et=Ae.target;Ie.value?Ie.value=[Et.value,Ie.value[1]]:Ie.value=[Et.value,null]},Gt=Ae=>{const Et=Ae.target;Ie.value?Ie.value=[Ie.value[0],Et.value]:Ie.value=[null,Et.value]},Ot=()=>{var Ae;const Et=Ie.value,Tn=it(Et&&Et[0]),Hn=T(ge);if(Tn&&Tn.isValid()){Ie.value=[Tt(Tn),((Ae=ve.value)==null?void 0:Ae[1])||null];const Xn=[Tn,Hn&&(Hn[1]||null)];He(Xn)&&(P(RH(Xn)),Ie.value=null)}},En=()=>{var Ae;const Et=T(Ie),Tn=it(Et&&Et[1]),Hn=T(ge);if(Tn&&Tn.isValid()){Ie.value=[((Ae=T(ve))==null?void 0:Ae[0])||null,Tt(Tn)];const Xn=[Hn&&Hn[0],Tn];He(Xn)&&(P(RH(Xn)),Ie.value=null)}},fe=te({}),se=Ae=>{fe.value[Ae[0]]=Ae[1],fe.value.panelReady=!0},le=Ae=>{t("calendar-change",Ae)},Fe=(Ae,Et,Tn)=>{t("panel-change",Ae,Et,Tn)},pe=()=>{var Ae;(Ae=_.value)==null||Ae.focus()},je=()=>{var Ae;(Ae=_.value)==null||Ae.blur()};return pi("EP_PICKER_BASE",{props:i}),e({focus:pe,blur:je,handleOpen:re,handleClose:Z,onPick:Q}),(Ae,Et)=>(G(),nt(T(uc),hi({ref_key:"refPopper",ref:p,visible:v.value,effect:"light",pure:"",trigger:"click"},Ae.$attrs,{role:"dialog",teleported:"",transition:`${T(r).namespace.value}-zoom-in-top`,"popper-class":[`${T(r).namespace.value}-picker__popper`,Ae.popperClass],"popper-options":T(f),"fallback-placements":Ae.fallbackPlacements,"gpu-acceleration":!1,placement:Ae.placement,"stop-popper-mouse-event":!1,"hide-after":0,persistent:"",onBeforeShow:de,onShow:q,onHide:K}),{default:_e(()=>[T(et)?(G(),nt(gtt,{key:1,id:Ae.id,ref_key:"inputRef",ref:_,"model-value":T(ve),name:Ae.name,disabled:T(J),readonly:!Ae.editable||Ae.readonly,"start-placeholder":Ae.startPlaceholder,"end-placeholder":Ae.endPlaceholder,class:Y(T(A)),style:on(Ae.$attrs.style),"aria-label":Ae.ariaLabel,tabindex:Ae.tabindex,autocomplete:"off",role:"combobox",onClick:ze,onFocus:T(L),onBlur:T(O),onStartInput:Ct,onStartChange:Ot,onEndInput:Gt,onEndChange:En,onMousedown:ze,onMouseenter:ee,onMouseleave:ye,onTouchstartPassive:Me,onKeydown:ke},{prefix:_e(()=>[T(we)?(G(),nt(T(tn),{key:0,class:Y([T(a).e("icon"),T(c).e("icon")])},{default:_e(()=>[(G(),nt(ui(T(we))))]),_:1},8,["class"])):Qe("v-if",!0)]),"range-separator":_e(()=>[Ye(Ae.$slots,"range-separator",{},()=>[oe("span",{class:Y(T(c).b("separator"))},st(Ae.rangeSeparator),3)])]),suffix:_e(()=>[Ae.clearIcon?(G(),nt(T(tn),{key:0,class:Y(T(N)),onMousedown:bn(T(ps),["prevent"]),onClick:Ge},{default:_e(()=>[(G(),nt(ui(Ae.clearIcon)))]),_:1},8,["class","onMousedown"])):Qe("v-if",!0)]),_:3},8,["id","model-value","name","disabled","readonly","start-placeholder","end-placeholder","class","style","aria-label","tabindex","onFocus","onBlur"])):(G(),nt(T(Kc),{key:0,id:Ae.id,ref_key:"inputRef",ref:_,"container-role":"combobox","model-value":T(ve),name:Ae.name,size:T(at),disabled:T(J),placeholder:Ae.placeholder,class:Y([T(r).b("editor"),T(r).bm("editor",Ae.type),Ae.$attrs.class]),style:on(Ae.$attrs.style),readonly:!Ae.editable||Ae.readonly||T(Ne)||T(qe)||T(Re)||Ae.type==="week","aria-label":Ae.ariaLabel,tabindex:Ae.tabindex,"validate-event":!1,onInput:ot,onFocus:T(L),onBlur:T(O),onKeydown:ke,onChange:Xe,onMousedown:ze,onMouseenter:ee,onMouseleave:ye,onTouchstartPassive:Me,onClick:bn(()=>{},["stop"])},{prefix:_e(()=>[T(we)?(G(),nt(T(tn),{key:0,class:Y(T(a).e("icon")),onMousedown:bn(ze,["prevent"]),onTouchstartPassive:Me},{default:_e(()=>[(G(),nt(ui(T(we))))]),_:1},8,["class","onMousedown"])):Qe("v-if",!0)]),suffix:_e(()=>[Ve.value&&Ae.clearIcon?(G(),nt(T(tn),{key:0,class:Y(`${T(a).e("icon")} clear-icon`),onMousedown:bn(T(ps),["prevent"]),onClick:Ge},{default:_e(()=>[(G(),nt(ui(Ae.clearIcon)))]),_:1},8,["class","onMousedown"])):Qe("v-if",!0)]),_:1},8,["id","model-value","name","size","disabled","placeholder","class","style","readonly","aria-label","tabindex","onFocus","onBlur","onClick"]))]),content:_e(()=>[Ye(Ae.$slots,"default",{visible:v.value,actualVisible:C.value,parsedValue:T(ge),format:Ae.format,dateFormat:Ae.dateFormat,timeFormat:Ae.timeFormat,unlinkPanels:Ae.unlinkPanels,type:Ae.type,defaultValue:Ae.defaultValue,showNow:Ae.showNow,onPick:Q,onSelectRange:U,onSetPickerOption:se,onCalendarChange:le,onPanelChange:Fe,onMousedown:bn(()=>{},["stop"])})]),_:3},16,["visible","transition","popper-class","popper-options","fallback-placements","placement"]))}});var ZSe=Rt(mtt,[["__file","picker.vue"]]);const _tt=Lt({...QSe,datetimeRole:String,parsedValue:{type:Ke(Object)}}),e0e=({getAvailableHours:n,getAvailableMinutes:e,getAvailableSeconds:t})=>{const i=(r,a,c,u)=>{const d={hour:n,minute:e,second:t};let f=r;return["hour","minute","second"].forEach(g=>{if(d[g]){let p;const _=d[g];switch(g){case"minute":{p=_(f.hour(),a,u);break}case"second":{p=_(f.hour(),f.minute(),a,u);break}default:{p=_(a,u);break}}if(p!=null&&p.length&&!p.includes(f[g]())){const v=c?0:p.length-1;f=f[g](p[v])}}}),f},s={};return{timePickerOptions:s,getAvailableTime:i,onSetOption:([r,a])=>{s[r]=a}}},r9=n=>{const e=(i,s)=>i||s,t=i=>i!==!0;return n.map(e).filter(t)},t0e=(n,e,t)=>({getHoursList:(r,a)=>n9(24,n&&(()=>n==null?void 0:n(r,a))),getMinutesList:(r,a,c)=>n9(60,e&&(()=>e==null?void 0:e(r,a,c))),getSecondsList:(r,a,c,u)=>n9(60,t&&(()=>t==null?void 0:t(r,a,c,u)))}),n0e=(n,e,t)=>{const{getHoursList:i,getMinutesList:s,getSecondsList:o}=t0e(n,e,t);return{getAvailableHours:(u,d)=>r9(i(u,d)),getAvailableMinutes:(u,d,f)=>r9(s(u,d,f)),getAvailableSeconds:(u,d,f,g)=>r9(o(u,d,f,g))}},i0e=n=>{const e=te(n.parsedValue);return ht(()=>n.visible,t=>{t||(e.value=n.parsedValue)}),e},vtt=Lt({role:{type:String,required:!0},spinnerDate:{type:Ke(Object),required:!0},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:Ke(String),default:""},...JSe}),btt=100,Ttt=600,_W={beforeMount(n,e){const t=e.value,{interval:i=btt,delay:s=Ttt}=ln(t)?{}:t;let o,r;const a=()=>ln(t)?t():t.handler(),c=()=>{r&&(clearTimeout(r),r=void 0),o&&(clearInterval(o),o=void 0)};n.addEventListener("mousedown",u=>{u.button===0&&(c(),a(),document.addEventListener("mouseup",()=>c(),{once:!0}),r=setTimeout(()=>{o=setInterval(()=>{a()},i)},s))})}},Ctt=$e({__name:"basic-time-spinner",props:vtt,emits:["change","select-range","set-option"],setup(n,{emit:e}){const t=n,i=Kt("EP_PICKER_BASE"),{isRange:s}=i.props,o=vt("time"),{getHoursList:r,getMinutesList:a,getSecondsList:c}=t0e(t.disabledHours,t.disabledMinutes,t.disabledSeconds);let u=!1;const d=te(),f=te(),g=te(),p=te(),_={hours:f,minutes:g,seconds:p},v=W(()=>t.showSeconds?cde:cde.slice(0,2)),C=W(()=>{const{spinnerDate:ve}=t,Le=ve.hour(),Ee=ve.minute(),Ne=ve.second();return{hours:Le,minutes:Ee,seconds:Ne}}),y=W(()=>{const{hours:ve,minutes:Le}=T(C),{role:Ee,spinnerDate:Ne}=t,qe=s?void 0:Ne;return{hours:r(Ee,qe),minutes:a(ve,Ee,qe),seconds:c(ve,Le,Ee,qe)}}),w=W(()=>{const{hours:ve,minutes:Le,seconds:Ee}=T(C);return{hours:t9(ve,23),minutes:t9(Le,59),seconds:t9(Ee,59)}}),I=Md(ve=>{u=!1,A(ve)},200),L=ve=>{if(!!!t.amPmMode)return"";const Ee=t.amPmMode==="A";let Ne=ve<12?" am":" pm";return Ee&&(Ne=Ne.toUpperCase()),Ne},O=ve=>{let Le;switch(ve){case"hours":Le=[0,2];break;case"minutes":Le=[3,5];break;case"seconds":Le=[6,8];break}const[Ee,Ne]=Le;e("select-range",Ee,Ne),d.value=ve},A=ve=>{P(ve,T(C)[ve])},N=()=>{A("hours"),A("minutes"),A("seconds")},D=ve=>ve.querySelector(`.${o.namespace.value}-scrollbar__wrap`),P=(ve,Le)=>{if(t.arrowControl)return;const Ee=T(_[ve]);Ee&&Ee.$el&&(D(Ee.$el).scrollTop=Math.max(0,Le*F(ve)))},F=ve=>{const Le=T(_[ve]),Ee=Le==null?void 0:Le.$el.querySelector("li");return Ee&&Number.parseFloat($v(Ee,"height"))||0},V=()=>{Q(1)},U=()=>{Q(-1)},Q=ve=>{d.value||O("hours");const Le=d.value,Ee=T(C)[Le],Ne=d.value==="hours"?24:60,qe=de(Le,Ee,ve,Ne);q(Le,qe),P(Le,qe),cn(()=>O(Le))},de=(ve,Le,Ee,Ne)=>{let qe=(Le+Ee+Ne)%Ne;const Re=T(y)[ve];for(;Re[qe]&&qe!==Le;)qe=(qe+Ee+Ne)%Ne;return qe},q=(ve,Le)=>{if(T(y)[ve][Le])return;const{hours:qe,minutes:Re,seconds:we}=T(C);let Ve;switch(ve){case"hours":Ve=t.spinnerDate.hour(Le).minute(Re).second(we);break;case"minutes":Ve=t.spinnerDate.hour(qe).minute(Le).second(we);break;case"seconds":Ve=t.spinnerDate.hour(qe).minute(Re).second(Le);break}e("change",Ve)},K=(ve,{value:Le,disabled:Ee})=>{Ee||(q(ve,Le),O(ve),P(ve,Le))},re=ve=>{const Le=T(_[ve]);if(!Le)return;u=!0,I(ve);const Ee=Math.min(Math.round((D(Le.$el).scrollTop-(Z(ve)*.5-10)/F(ve)+3)/F(ve)),ve==="hours"?23:59);q(ve,Ee)},Z=ve=>T(_[ve]).$el.offsetHeight,J=()=>{const ve=Le=>{const Ee=T(_[Le]);Ee&&Ee.$el&&(D(Ee.$el).onscroll=()=>{re(Le)})};ve("hours"),ve("minutes"),ve("seconds")};$n(()=>{cn(()=>{!t.arrowControl&&J(),N(),t.role==="start"&&O("hours")})});const ge=(ve,Le)=>{_[Le].value=ve??void 0};return e("set-option",[`${t.role}_scrollDown`,Q]),e("set-option",[`${t.role}_emitSelectRange`,O]),ht(()=>t.spinnerDate,()=>{u||N()}),(ve,Le)=>(G(),he("div",{class:Y([T(o).b("spinner"),{"has-seconds":ve.showSeconds}])},[ve.arrowControl?Qe("v-if",!0):(G(!0),he(Qt,{key:0},fi(T(v),Ee=>(G(),nt(T(a_),{key:Ee,ref_for:!0,ref:Ne=>ge(Ne,Ee),class:Y(T(o).be("spinner","wrapper")),"wrap-style":"max-height: inherit;","view-class":T(o).be("spinner","list"),noresize:"",tag:"ul",onMouseenter:Ne=>O(Ee),onMousemove:Ne=>A(Ee)},{default:_e(()=>[(G(!0),he(Qt,null,fi(T(y)[Ee],(Ne,qe)=>(G(),he("li",{key:qe,class:Y([T(o).be("spinner","item"),T(o).is("active",qe===T(C)[Ee]),T(o).is("disabled",Ne)]),onClick:Re=>K(Ee,{value:qe,disabled:Ne})},[Ee==="hours"?(G(),he(Qt,{key:0},[mn(st(("0"+(ve.amPmMode?qe%12||12:qe)).slice(-2))+st(L(qe)),1)],64)):(G(),he(Qt,{key:1},[mn(st(("0"+qe).slice(-2)),1)],64))],10,["onClick"]))),128))]),_:2},1032,["class","view-class","onMouseenter","onMousemove"]))),128)),ve.arrowControl?(G(!0),he(Qt,{key:1},fi(T(v),Ee=>(G(),he("div",{key:Ee,class:Y([T(o).be("spinner","wrapper"),T(o).is("arrow")]),onMouseenter:Ne=>O(Ee)},[Un((G(),nt(T(tn),{class:Y(["arrow-up",T(o).be("spinner","arrow")])},{default:_e(()=>[ce(T(Zee))]),_:1},8,["class"])),[[T(_W),U]]),Un((G(),nt(T(tn),{class:Y(["arrow-down",T(o).be("spinner","arrow")])},{default:_e(()=>[ce(T(Lb))]),_:1},8,["class"])),[[T(_W),V]]),oe("ul",{class:Y(T(o).be("spinner","list"))},[(G(!0),he(Qt,null,fi(T(w)[Ee],(Ne,qe)=>(G(),he("li",{key:qe,class:Y([T(o).be("spinner","item"),T(o).is("active",Ne===T(C)[Ee]),T(o).is("disabled",T(y)[Ee][Ne])])},[T(gn)(Ne)?(G(),he(Qt,{key:0},[Ee==="hours"?(G(),he(Qt,{key:0},[mn(st(("0"+(ve.amPmMode?Ne%12||12:Ne)).slice(-2))+st(L(Ne)),1)],64)):(G(),he(Qt,{key:1},[mn(st(("0"+Ne).slice(-2)),1)],64))],64)):Qe("v-if",!0)],2))),128))],2)],42,["onMouseenter"]))),128)):Qe("v-if",!0)],2))}});var MX=Rt(Ctt,[["__file","basic-time-spinner.vue"]]);const ytt=$e({__name:"panel-time-pick",props:_tt,emits:["pick","select-range","set-picker-option"],setup(n,{emit:e}){const t=n,i=Kt("EP_PICKER_BASE"),{arrowControl:s,disabledHours:o,disabledMinutes:r,disabledSeconds:a,defaultValue:c}=i.props,{getAvailableHours:u,getAvailableMinutes:d,getAvailableSeconds:f}=n0e(o,r,a),g=vt("time"),{t:p,lang:_}=wi(),v=te([0,2]),C=i0e(t),y=W(()=>ys(t.actualVisible)?`${g.namespace.value}-zoom-in-top`:""),w=W(()=>t.format.includes("ss")),I=W(()=>t.format.includes("A")?"A":t.format.includes("a")?"a":""),L=Z=>{const J=Mn(Z).locale(_.value),ge=de(J);return J.isSame(ge)},O=()=>{e("pick",C.value,!1)},A=(Z=!1,J=!1)=>{J||e("pick",t.parsedValue,Z)},N=Z=>{if(!t.visible)return;const J=de(Z).millisecond(0);e("pick",J,!0)},D=(Z,J)=>{e("select-range",Z,J),v.value=[Z,J]},P=Z=>{const J=[0,3].concat(w.value?[6]:[]),ge=["hours","minutes"].concat(w.value?["seconds"]:[]),Le=(J.indexOf(v.value[0])+Z+J.length)%J.length;V.start_emitSelectRange(ge[Le])},F=Z=>{const J=Z.code,{left:ge,right:ve,up:Le,down:Ee}=zt;if([ge,ve].includes(J)){P(J===ge?-1:1),Z.preventDefault();return}if([Le,Ee].includes(J)){const Ne=J===Le?-1:1;V.start_scrollDown(Ne),Z.preventDefault();return}},{timePickerOptions:V,onSetOption:U,getAvailableTime:Q}=e0e({getAvailableHours:u,getAvailableMinutes:d,getAvailableSeconds:f}),de=Z=>Q(Z,t.datetimeRole||"",!0),q=Z=>Z?Mn(Z,t.format).locale(_.value):null,K=Z=>Z?Z.format(t.format):null,re=()=>Mn(c).locale(_.value);return e("set-picker-option",["isValidValue",L]),e("set-picker-option",["formatToString",K]),e("set-picker-option",["parseUserInput",q]),e("set-picker-option",["handleKeydownInput",F]),e("set-picker-option",["getRangeAvailableTime",de]),e("set-picker-option",["getDefaultValue",re]),(Z,J)=>(G(),nt(Ta,{name:T(y)},{default:_e(()=>[Z.actualVisible||Z.visible?(G(),he("div",{key:0,class:Y(T(g).b("panel"))},[oe("div",{class:Y([T(g).be("panel","content"),{"has-seconds":T(w)}])},[ce(MX,{ref:"spinner",role:Z.datetimeRole||"start","arrow-control":T(s),"show-seconds":T(w),"am-pm-mode":T(I),"spinner-date":Z.parsedValue,"disabled-hours":T(o),"disabled-minutes":T(r),"disabled-seconds":T(a),onChange:N,onSetOption:T(U),onSelectRange:D},null,8,["role","arrow-control","show-seconds","am-pm-mode","spinner-date","disabled-hours","disabled-minutes","disabled-seconds","onSetOption"])],2),oe("div",{class:Y(T(g).be("panel","footer"))},[oe("button",{type:"button",class:Y([T(g).be("panel","btn"),"cancel"]),onClick:O},st(T(p)("el.datepicker.cancel")),3),oe("button",{type:"button",class:Y([T(g).be("panel","btn"),"confirm"]),onClick:ge=>A()},st(T(p)("el.datepicker.confirm")),11,["onClick"])],2)],2)):Qe("v-if",!0)]),_:1},8,["name"]))}});var vW=Rt(ytt,[["__file","panel-time-pick.vue"]]);const Ett=Lt({...QSe,parsedValue:{type:Ke(Array)}}),Stt=$e({__name:"panel-time-range",props:Ett,emits:["pick","select-range","set-picker-option"],setup(n,{emit:e}){const t=n,i=(ze,ee)=>{const ye=[];for(let Me=ze;Me<=ee;Me++)ye.push(Me);return ye},{t:s,lang:o}=wi(),r=vt("time"),a=vt("picker"),c=Kt("EP_PICKER_BASE"),{arrowControl:u,disabledHours:d,disabledMinutes:f,disabledSeconds:g,defaultValue:p}=c.props,_=W(()=>[r.be("range-picker","body"),r.be("panel","content"),r.is("arrow",u),L.value?"has-seconds":""]),v=W(()=>[r.be("range-picker","body"),r.be("panel","content"),r.is("arrow",u),L.value?"has-seconds":""]),C=W(()=>t.parsedValue[0]),y=W(()=>t.parsedValue[1]),w=i0e(t),I=()=>{e("pick",w.value,!1)},L=W(()=>t.format.includes("ss")),O=W(()=>t.format.includes("A")?"A":t.format.includes("a")?"a":""),A=(ze=!1)=>{e("pick",[C.value,y.value],ze)},N=ze=>{F(ze.millisecond(0),y.value)},D=ze=>{F(C.value,ze.millisecond(0))},P=ze=>{const ee=ze.map(Me=>Mn(Me).locale(o.value)),ye=ve(ee);return ee[0].isSame(ye[0])&&ee[1].isSame(ye[1])},F=(ze,ee)=>{t.visible&&e("pick",[ze,ee],!0)},V=W(()=>C.value>y.value),U=te([0,2]),Q=(ze,ee)=>{e("select-range",ze,ee,"min"),U.value=[ze,ee]},de=W(()=>L.value?11:8),q=(ze,ee)=>{e("select-range",ze,ee,"max");const ye=T(de);U.value=[ze+ye,ee+ye]},K=ze=>{const ee=L.value?[0,3,6,11,14,17]:[0,3,8,11],ye=["hours","minutes"].concat(L.value?["seconds"]:[]),et=(ee.indexOf(U.value[0])+ze+ee.length)%ee.length,at=ee.length/2;et<at?qe.start_emitSelectRange(ye[et]):qe.end_emitSelectRange(ye[et-at])},re=ze=>{const ee=ze.code,{left:ye,right:Me,up:et,down:at}=zt;if([ye,Me].includes(ee)){K(ee===ye?-1:1),ze.preventDefault();return}if([et,at].includes(ee)){const Ue=ee===et?-1:1,Se=U.value[0]<de.value?"start":"end";qe[`${Se}_scrollDown`](Ue),ze.preventDefault();return}},Z=(ze,ee)=>{const ye=d?d(ze):[],Me=ze==="start",at=(ee||(Me?y.value:C.value)).hour(),Ue=Me?i(at+1,23):i(0,at-1);return Yz(ye,Ue)},J=(ze,ee,ye)=>{const Me=f?f(ze,ee):[],et=ee==="start",at=ye||(et?y.value:C.value),Ue=at.hour();if(ze!==Ue)return Me;const Se=at.minute(),Ie=et?i(Se+1,59):i(0,Se-1);return Yz(Me,Ie)},ge=(ze,ee,ye,Me)=>{const et=g?g(ze,ee,ye):[],at=ye==="start",Ue=Me||(at?y.value:C.value),Se=Ue.hour(),Ie=Ue.minute();if(ze!==Se||ee!==Ie)return et;const Xe=Ue.second(),it=at?i(Xe+1,59):i(0,Xe-1);return Yz(et,it)},ve=([ze,ee])=>[Re(ze,"start",!0,ee),Re(ee,"end",!1,ze)],{getAvailableHours:Le,getAvailableMinutes:Ee,getAvailableSeconds:Ne}=n0e(Z,J,ge),{timePickerOptions:qe,getAvailableTime:Re,onSetOption:we}=e0e({getAvailableHours:Le,getAvailableMinutes:Ee,getAvailableSeconds:Ne}),Ve=ze=>ze?yt(ze)?ze.map(ee=>Mn(ee,t.format).locale(o.value)):Mn(ze,t.format).locale(o.value):null,Ge=ze=>ze?yt(ze)?ze.map(ee=>ee.format(t.format)):ze.format(t.format):null,dt=()=>{if(yt(p))return p.map(ee=>Mn(ee).locale(o.value));const ze=Mn(p).locale(o.value);return[ze,ze.add(60,"m")]};return e("set-picker-option",["formatToString",Ge]),e("set-picker-option",["parseUserInput",Ve]),e("set-picker-option",["isValidValue",P]),e("set-picker-option",["handleKeydownInput",re]),e("set-picker-option",["getDefaultValue",dt]),e("set-picker-option",["getRangeAvailableTime",ve]),(ze,ee)=>ze.actualVisible?(G(),he("div",{key:0,class:Y([T(r).b("range-picker"),T(a).b("panel")])},[oe("div",{class:Y(T(r).be("range-picker","content"))},[oe("div",{class:Y(T(r).be("range-picker","cell"))},[oe("div",{class:Y(T(r).be("range-picker","header"))},st(T(s)("el.datepicker.startTime")),3),oe("div",{class:Y(T(_))},[ce(MX,{ref:"minSpinner",role:"start","show-seconds":T(L),"am-pm-mode":T(O),"arrow-control":T(u),"spinner-date":T(C),"disabled-hours":Z,"disabled-minutes":J,"disabled-seconds":ge,onChange:N,onSetOption:T(we),onSelectRange:Q},null,8,["show-seconds","am-pm-mode","arrow-control","spinner-date","onSetOption"])],2)],2),oe("div",{class:Y(T(r).be("range-picker","cell"))},[oe("div",{class:Y(T(r).be("range-picker","header"))},st(T(s)("el.datepicker.endTime")),3),oe("div",{class:Y(T(v))},[ce(MX,{ref:"maxSpinner",role:"end","show-seconds":T(L),"am-pm-mode":T(O),"arrow-control":T(u),"spinner-date":T(y),"disabled-hours":Z,"disabled-minutes":J,"disabled-seconds":ge,onChange:D,onSetOption:T(we),onSelectRange:q},null,8,["show-seconds","am-pm-mode","arrow-control","spinner-date","onSetOption"])],2)],2)],2),oe("div",{class:Y(T(r).be("panel","footer"))},[oe("button",{type:"button",class:Y([T(r).be("panel","btn"),"cancel"]),onClick:ye=>I()},st(T(s)("el.datepicker.cancel")),11,["onClick"]),oe("button",{type:"button",class:Y([T(r).be("panel","btn"),"confirm"]),disabled:T(V),onClick:ye=>A()},st(T(s)("el.datepicker.confirm")),11,["disabled","onClick"])],2)],2)):Qe("v-if",!0)}});var wtt=Rt(Stt,[["__file","panel-time-range.vue"]]);Mn.extend(Ste);var Itt=$e({name:"ElTimePicker",install:null,props:{...wte,isRange:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,e){const t=te(),[i,s]=n.isRange?["timerange",wtt]:["time",vW],o=r=>e.emit("update:modelValue",r);return pi("ElPopperOptions",n.popperOptions),e.expose({focus:()=>{var r;(r=t.value)==null||r.focus()},blur:()=>{var r;(r=t.value)==null||r.blur()},handleOpen:()=>{var r;(r=t.value)==null||r.handleOpen()},handleClose:()=>{var r;(r=t.value)==null||r.handleClose()}}),()=>{var r;const a=(r=n.format)!=null?r:RX;return ce(ZSe,hi(n,{ref:t,type:i,format:a,"onUpdate:modelValue":o}),{default:c=>ce(s,c,null)})}}});const Ltt=Nn(Itt),O8=Symbol(),Ott=Lt({...wte,type:{type:Ke(String),default:"date"}}),Rtt=["date","dates","year","years","month","months","week","range"],Ite=Lt({disabledDate:{type:Ke(Function)},date:{type:Ke(Object),required:!0},minDate:{type:Ke(Object)},maxDate:{type:Ke(Object)},parsedValue:{type:Ke([Object,Array])},rangeState:{type:Ke(Object),default:()=>({endDate:null,selecting:!1})}}),s0e=Lt({type:{type:Ke(String),required:!0,values:AJe},dateFormat:String,timeFormat:String,showNow:{type:Boolean,default:!0}}),Lte=Lt({unlinkPanels:Boolean,parsedValue:{type:Ke(Array)}}),Ote=n=>({type:String,values:Rtt,default:n}),Mtt=Lt({...s0e,parsedValue:{type:Ke([Object,Array])},visible:{type:Boolean},format:{type:String,default:""}}),nR=n=>{if(!yt(n))return!1;const[e,t]=n;return Mn.isDayjs(e)&&Mn.isDayjs(t)&&e.isSameOrBefore(t)},Rte=(n,{lang:e,unit:t,unlinkPanels:i})=>{let s;if(yt(n)){let[o,r]=n.map(a=>Mn(a).locale(e));return i||(r=o.add(1,t)),[o,r]}else n?s=Mn(n):s=Mn();return s=s.locale(e),[s,s.add(1,t)]},ktt=(n,e,{columnIndexOffset:t,startDate:i,nextEndDate:s,now:o,unit:r,relativeDateGetter:a,setCellMetadata:c,setRowMetadata:u})=>{for(let d=0;d<n.row;d++){const f=e[d];for(let g=0;g<n.column;g++){let p=f[g+t];p||(p={row:d,column:g,type:"normal",inRange:!1,start:!1,end:!1});const _=d*n.column+g,v=a(_);p.dayjs=v,p.date=v.toDate(),p.timestamp=v.valueOf(),p.type="normal",p.inRange=!!(i&&v.isSameOrAfter(i,r)&&s&&v.isSameOrBefore(s,r))||!!(i&&v.isSameOrBefore(i,r)&&s&&v.isSameOrAfter(s,r)),i!=null&&i.isSameOrAfter(s)?(p.start=!!s&&v.isSame(s,r),p.end=i&&v.isSame(i,r)):(p.start=!!i&&v.isSame(i,r),p.end=!!s&&v.isSame(s,r)),v.isSame(o,r)&&(p.type="today"),c==null||c(p,{rowIndex:d,columnIndex:g}),f[g+t]=p}u==null||u(f)}},bW=(n,e,t)=>{const i=Mn().locale(t).startOf("month").month(e).year(n),s=i.daysInMonth();return MC(s).map(o=>i.add(o,"day").toDate())},ax=(n,e,t,i)=>{const s=Mn().year(n).month(e).startOf("month"),o=bW(n,e,t).find(r=>!(i!=null&&i(r)));return o?Mn(o).locale(t):s.locale(t)},kX=(n,e,t)=>{const i=n.year();if(!(t!=null&&t(n.toDate())))return n.locale(e);const s=n.month();if(!bW(i,s,e).every(t))return ax(i,s,e,t);for(let o=0;o<12;o++)if(!bW(i,o,e).every(t))return ax(i,o,e,t);return n},Att=Lt({...Ite,cellClassName:{type:Ke(Function)},showWeekNumber:Boolean,selectionMode:Ote("date")}),Ntt=["changerange","pick","select"],AX=(n="")=>["normal","today"].includes(n),Dtt=(n,e)=>{const{lang:t}=wi(),i=te(),s=te(),o=te(),r=te(),a=te([[],[],[],[],[],[]]);let c=!1;const u=n.date.$locale().weekStart||7,d=n.date.locale("en").localeData().weekdaysShort().map(J=>J.toLowerCase()),f=W(()=>u>3?7-u:-u),g=W(()=>{const J=n.date.startOf("month");return J.subtract(J.day()||7,"day")}),p=W(()=>d.concat(d).slice(u,u+7)),_=W(()=>Gye(T(L)).some(J=>J.isCurrent)),v=W(()=>{const J=n.date.startOf("month"),ge=J.day()||7,ve=J.daysInMonth(),Le=J.subtract(1,"month").daysInMonth();return{startOfMonthDay:ge,dateCountOfMonth:ve,dateCountOfLastMonth:Le}}),C=W(()=>n.selectionMode==="dates"?Iu(n.parsedValue):[]),y=(J,{count:ge,rowIndex:ve,columnIndex:Le})=>{const{startOfMonthDay:Ee,dateCountOfMonth:Ne,dateCountOfLastMonth:qe}=T(v),Re=T(f);if(ve>=0&&ve<=1){const we=Ee+Re<0?7+Ee+Re:Ee+Re;if(Le+ve*7>=we)return J.text=ge,!0;J.text=qe-(we-Le%7)+1+ve*7,J.type="prev-month"}else return ge<=Ne?J.text=ge:(J.text=ge-Ne,J.type="next-month"),!0;return!1},w=(J,{columnIndex:ge,rowIndex:ve},Le)=>{const{disabledDate:Ee,cellClassName:Ne}=n,qe=T(C),Re=y(J,{count:Le,rowIndex:ve,columnIndex:ge}),we=J.dayjs.toDate();return J.selected=qe.find(Ve=>Ve.isSame(J.dayjs,"day")),J.isSelected=!!J.selected,J.isCurrent=A(J),J.disabled=Ee==null?void 0:Ee(we),J.customClass=Ne==null?void 0:Ne(we),Re},I=J=>{if(n.selectionMode==="week"){const[ge,ve]=n.showWeekNumber?[1,7]:[0,6],Le=Z(J[ge+1]);J[ge].inRange=Le,J[ge].start=Le,J[ve].inRange=Le,J[ve].end=Le}},L=W(()=>{const{minDate:J,maxDate:ge,rangeState:ve,showWeekNumber:Le}=n,Ee=T(f),Ne=T(a),qe="day";let Re=1;if(Le)for(let we=0;we<6;we++)Ne[we][0]||(Ne[we][0]={type:"week",text:T(g).add(we*7+1,qe).week()});return ktt({row:6,column:7},Ne,{startDate:J,columnIndexOffset:Le?1:0,nextEndDate:ve.endDate||ge||ve.selecting&&J||null,now:Mn().locale(T(t)).startOf(qe),unit:qe,relativeDateGetter:we=>T(g).add(we-Ee,qe),setCellMetadata:(...we)=>{w(...we,Re)&&(Re+=1)},setRowMetadata:I}),Ne});ht(()=>n.date,async()=>{var J;(J=T(i))!=null&&J.contains(document.activeElement)&&(await cn(),await O())});const O=async()=>{var J;return(J=T(s))==null?void 0:J.focus()},A=J=>n.selectionMode==="date"&&AX(J.type)&&N(J,n.parsedValue),N=(J,ge)=>ge?Mn(ge).locale(T(t)).isSame(n.date.date(Number(J.text)),"day"):!1,D=(J,ge)=>{const ve=J*7+(ge-(n.showWeekNumber?1:0))-T(f);return T(g).add(ve,"day")},P=J=>{var ge;if(!n.rangeState.selecting)return;let ve=J.target;if(ve.tagName==="SPAN"&&(ve=(ge=ve.parentNode)==null?void 0:ge.parentNode),ve.tagName==="DIV"&&(ve=ve.parentNode),ve.tagName!=="TD")return;const Le=ve.parentNode.rowIndex-1,Ee=ve.cellIndex;T(L)[Le][Ee].disabled||(Le!==T(o)||Ee!==T(r))&&(o.value=Le,r.value=Ee,e("changerange",{selecting:!0,endDate:D(Le,Ee)}))},F=J=>!T(_)&&(J==null?void 0:J.text)===1&&J.type==="normal"||J.isCurrent,V=J=>{c||T(_)||n.selectionMode!=="date"||re(J,!0)},U=J=>{J.target.closest("td")&&(c=!0)},Q=J=>{J.target.closest("td")&&(c=!1)},de=J=>{!n.rangeState.selecting||!n.minDate?(e("pick",{minDate:J,maxDate:null}),e("select",!0)):(J>=n.minDate?e("pick",{minDate:n.minDate,maxDate:J}):e("pick",{minDate:J,maxDate:n.minDate}),e("select",!1))},q=J=>{const ge=J.week(),ve=`${J.year()}w${ge}`;e("pick",{year:J.year(),week:ge,value:ve,date:J.startOf("week")})},K=(J,ge)=>{const ve=ge?Iu(n.parsedValue).filter(Le=>(Le==null?void 0:Le.valueOf())!==J.valueOf()):Iu(n.parsedValue).concat([J]);e("pick",ve)},re=(J,ge=!1)=>{const ve=J.target.closest("td");if(!ve)return;const Le=ve.parentNode.rowIndex-1,Ee=ve.cellIndex,Ne=T(L)[Le][Ee];if(Ne.disabled||Ne.type==="week")return;const qe=D(Le,Ee);switch(n.selectionMode){case"range":{de(qe);break}case"date":{e("pick",qe,ge);break}case"week":{q(qe);break}case"dates":{K(qe,!!Ne.selected);break}}},Z=J=>{if(n.selectionMode!=="week")return!1;let ge=n.date.startOf("day");if(J.type==="prev-month"&&(ge=ge.subtract(1,"month")),J.type==="next-month"&&(ge=ge.add(1,"month")),ge=ge.date(Number.parseInt(J.text,10)),n.parsedValue&&!yt(n.parsedValue)){const ve=(n.parsedValue.day()-u+7)%7-1;return n.parsedValue.subtract(ve,"day").isSame(ge,"day")}return!1};return{WEEKS:p,rows:L,tbodyRef:i,currentCellRef:s,focus:O,isCurrent:A,isWeekActive:Z,isSelectedCell:F,handlePickDate:re,handleMouseUp:Q,handleMouseDown:U,handleMouseMove:P,handleFocus:V}},$tt=(n,{isCurrent:e,isWeekActive:t})=>{const i=vt("date-table"),{t:s}=wi(),o=W(()=>[i.b(),{"is-week-mode":n.selectionMode==="week"}]),r=W(()=>s("el.datepicker.dateTablePrompt")),a=W(()=>s("el.datepicker.week"));return{tableKls:o,tableLabel:r,weekLabel:a,getCellClasses:d=>{const f=[];return AX(d.type)&&!d.disabled?(f.push("available"),d.type==="today"&&f.push("today")):f.push(d.type),e(d)&&f.push("current"),d.inRange&&(AX(d.type)||n.selectionMode==="week")&&(f.push("in-range"),d.start&&f.push("start-date"),d.end&&f.push("end-date")),d.disabled&&f.push("disabled"),d.selected&&f.push("selected"),d.customClass&&f.push(d.customClass),f.join(" ")},getRowKls:d=>[i.e("row"),{current:t(d)}],t:s}},xtt=Lt({cell:{type:Ke(Object)}});var Mte=$e({name:"ElDatePickerCell",props:xtt,setup(n){const e=vt("date-table-cell"),{slots:t}=Kt(O8);return()=>{const{cell:i}=n;return Ye(t,"default",{...i},()=>{var s;return[ce("div",{class:e.b()},[ce("span",{class:e.e("text")},[(s=i==null?void 0:i.renderText)!=null?s:i==null?void 0:i.text])])]})}}});const Ptt=$e({__name:"basic-date-table",props:Att,emits:Ntt,setup(n,{expose:e,emit:t}){const i=n,{WEEKS:s,rows:o,tbodyRef:r,currentCellRef:a,focus:c,isCurrent:u,isWeekActive:d,isSelectedCell:f,handlePickDate:g,handleMouseUp:p,handleMouseDown:_,handleMouseMove:v,handleFocus:C}=Dtt(i,t),{tableLabel:y,tableKls:w,weekLabel:I,getCellClasses:L,getRowKls:O,t:A}=$tt(i,{isCurrent:u,isWeekActive:d});return e({focus:c}),(N,D)=>(G(),he("table",{"aria-label":T(y),class:Y(T(w)),cellspacing:"0",cellpadding:"0",role:"grid",onClick:T(g),onMousemove:T(v),onMousedown:bn(T(_),["prevent"]),onMouseup:T(p)},[oe("tbody",{ref_key:"tbodyRef",ref:r},[oe("tr",null,[N.showWeekNumber?(G(),he("th",{key:0,scope:"col"},st(T(I)),1)):Qe("v-if",!0),(G(!0),he(Qt,null,fi(T(s),(P,F)=>(G(),he("th",{key:F,"aria-label":T(A)("el.datepicker.weeksFull."+P),scope:"col"},st(T(A)("el.datepicker.weeks."+P)),9,["aria-label"]))),128))]),(G(!0),he(Qt,null,fi(T(o),(P,F)=>(G(),he("tr",{key:F,class:Y(T(O)(P[1]))},[(G(!0),he(Qt,null,fi(P,(V,U)=>(G(),he("td",{key:`${F}.${U}`,ref_for:!0,ref:Q=>T(f)(V)&&(a.value=Q),class:Y(T(L)(V)),"aria-current":V.isCurrent?"date":void 0,"aria-selected":V.isCurrent,tabindex:T(f)(V)?0:-1,onFocus:T(C)},[ce(T(Mte),{cell:V},null,8,["cell"])],42,["aria-current","aria-selected","tabindex","onFocus"]))),128))],2))),128))],512)],42,["aria-label","onClick","onMousemove","onMousedown","onMouseup"]))}});var NX=Rt(Ptt,[["__file","basic-date-table.vue"]]);const Ftt=Lt({...Ite,selectionMode:Ote("month")}),Btt=$e({__name:"basic-month-table",props:Ftt,emits:["changerange","pick","select"],setup(n,{expose:e,emit:t}){const i=n,s=vt("month-table"),{t:o,lang:r}=wi(),a=te(),c=te(),u=te(i.date.locale("en").localeData().monthsShort().map(I=>I.toLowerCase())),d=te([[],[],[]]),f=te(),g=te(),p=W(()=>{var I,L;const O=d.value,A=Mn().locale(r.value).startOf("month");for(let N=0;N<3;N++){const D=O[N];for(let P=0;P<4;P++){const F=D[P]||(D[P]={row:N,column:P,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1});F.type="normal";const V=N*4+P,U=i.date.startOf("year").month(V),Q=i.rangeState.endDate||i.maxDate||i.rangeState.selecting&&i.minDate||null;F.inRange=!!(i.minDate&&U.isSameOrAfter(i.minDate,"month")&&Q&&U.isSameOrBefore(Q,"month"))||!!(i.minDate&&U.isSameOrBefore(i.minDate,"month")&&Q&&U.isSameOrAfter(Q,"month")),(I=i.minDate)!=null&&I.isSameOrAfter(Q)?(F.start=!!(Q&&U.isSame(Q,"month")),F.end=i.minDate&&U.isSame(i.minDate,"month")):(F.start=!!(i.minDate&&U.isSame(i.minDate,"month")),F.end=!!(Q&&U.isSame(Q,"month"))),A.isSame(U)&&(F.type="today"),F.text=V,F.disabled=((L=i.disabledDate)==null?void 0:L.call(i,U.toDate()))||!1}}return O}),_=()=>{var I;(I=c.value)==null||I.focus()},v=I=>{const L={},O=i.date.year(),A=new Date,N=I.text;return L.disabled=i.disabledDate?bW(O,N,r.value).every(i.disabledDate):!1,L.current=Iu(i.parsedValue).findIndex(D=>Mn.isDayjs(D)&&D.year()===O&&D.month()===N)>=0,L.today=A.getFullYear()===O&&A.getMonth()===N,I.inRange&&(L["in-range"]=!0,I.start&&(L["start-date"]=!0),I.end&&(L["end-date"]=!0)),L},C=I=>{const L=i.date.year(),O=I.text;return Iu(i.date).findIndex(A=>A.year()===L&&A.month()===O)>=0},y=I=>{var L;if(!i.rangeState.selecting)return;let O=I.target;if(O.tagName==="SPAN"&&(O=(L=O.parentNode)==null?void 0:L.parentNode),O.tagName==="DIV"&&(O=O.parentNode),O.tagName!=="TD")return;const A=O.parentNode.rowIndex,N=O.cellIndex;p.value[A][N].disabled||(A!==f.value||N!==g.value)&&(f.value=A,g.value=N,t("changerange",{selecting:!0,endDate:i.date.startOf("year").month(A*4+N)}))},w=I=>{var L;const O=(L=I.target)==null?void 0:L.closest("td");if((O==null?void 0:O.tagName)!=="TD"||Td(O,"disabled"))return;const A=O.cellIndex,D=O.parentNode.rowIndex*4+A,P=i.date.startOf("year").month(D);if(i.selectionMode==="months"){if(I.type==="keydown"){t("pick",Iu(i.parsedValue),!1);return}const F=ax(i.date.year(),D,r.value,i.disabledDate),V=Td(O,"current")?Iu(i.parsedValue).filter(U=>(U==null?void 0:U.month())!==F.month()):Iu(i.parsedValue).concat([Mn(F)]);t("pick",V)}else i.selectionMode==="range"?i.rangeState.selecting?(i.minDate&&P>=i.minDate?t("pick",{minDate:i.minDate,maxDate:P}):t("pick",{minDate:P,maxDate:i.minDate}),t("select",!1)):(t("pick",{minDate:P,maxDate:null}),t("select",!0)):t("pick",D)};return ht(()=>i.date,async()=>{var I,L;(I=a.value)!=null&&I.contains(document.activeElement)&&(await cn(),(L=c.value)==null||L.focus())}),e({focus:_}),(I,L)=>(G(),he("table",{role:"grid","aria-label":T(o)("el.datepicker.monthTablePrompt"),class:Y(T(s).b()),onClick:w,onMousemove:y},[oe("tbody",{ref_key:"tbodyRef",ref:a},[(G(!0),he(Qt,null,fi(T(p),(O,A)=>(G(),he("tr",{key:A},[(G(!0),he(Qt,null,fi(O,(N,D)=>(G(),he("td",{key:D,ref_for:!0,ref:P=>C(N)&&(c.value=P),class:Y(v(N)),"aria-selected":`${C(N)}`,"aria-label":T(o)(`el.datepicker.month${+N.text+1}`),tabindex:C(N)?0:-1,onKeydown:[xs(bn(w,["prevent","stop"]),["space"]),xs(bn(w,["prevent","stop"]),["enter"])]},[ce(T(Mte),{cell:{...N,renderText:T(o)("el.datepicker.months."+u.value[N.text])}},null,8,["cell"])],42,["aria-selected","aria-label","tabindex","onKeydown"]))),128))]))),128))],512)],42,["aria-label"]))}});var DX=Rt(Btt,[["__file","basic-month-table.vue"]]);const Htt=Lt({...Ite,selectionMode:Ote("year")}),Vtt=$e({__name:"basic-year-table",props:Htt,emits:["changerange","pick","select"],setup(n,{expose:e,emit:t}){const i=n,s=(L,O)=>{const A=Mn(String(L)).locale(O).startOf("year"),D=A.endOf("year").dayOfYear();return MC(D).map(P=>A.add(P,"day").toDate())},o=vt("year-table"),{t:r,lang:a}=wi(),c=te(),u=te(),d=W(()=>Math.floor(i.date.year()/10)*10),f=te([[],[],[]]),g=te(),p=te(),_=W(()=>{var L;const O=f.value,A=Mn().locale(a.value).startOf("year");for(let N=0;N<3;N++){const D=O[N];for(let P=0;P<4&&!(N*4+P>=10);P++){let F=D[P];F||(F={row:N,column:P,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1}),F.type="normal";const V=N*4+P+d.value,U=Mn().year(V),Q=i.rangeState.endDate||i.maxDate||i.rangeState.selecting&&i.minDate||null;F.inRange=!!(i.minDate&&U.isSameOrAfter(i.minDate,"year")&&Q&&U.isSameOrBefore(Q,"year"))||!!(i.minDate&&U.isSameOrBefore(i.minDate,"year")&&Q&&U.isSameOrAfter(Q,"year")),(L=i.minDate)!=null&&L.isSameOrAfter(Q)?(F.start=!!(Q&&U.isSame(Q,"year")),F.end=!!(i.minDate&&U.isSame(i.minDate,"year"))):(F.start=!!(i.minDate&&U.isSame(i.minDate,"year")),F.end=!!(Q&&U.isSame(Q,"year"))),A.isSame(U)&&(F.type="today"),F.text=V;const q=U.toDate();F.disabled=i.disabledDate&&i.disabledDate(q)||!1,D[P]=F}}return O}),v=()=>{var L;(L=u.value)==null||L.focus()},C=L=>{const O={},A=Mn().locale(a.value),N=L.text;return O.disabled=i.disabledDate?s(N,a.value).every(i.disabledDate):!1,O.today=A.year()===N,O.current=Iu(i.parsedValue).findIndex(D=>D.year()===N)>=0,L.inRange&&(O["in-range"]=!0,L.start&&(O["start-date"]=!0),L.end&&(O["end-date"]=!0)),O},y=L=>{const O=L.text;return Iu(i.date).findIndex(A=>A.year()===O)>=0},w=L=>{var O;const A=(O=L.target)==null?void 0:O.closest("td");if(!A||!A.textContent||Td(A,"disabled"))return;const N=A.cellIndex,P=A.parentNode.rowIndex*4+N+d.value,F=Mn().year(P);if(i.selectionMode==="range")i.rangeState.selecting?(i.minDate&&F>=i.minDate?t("pick",{minDate:i.minDate,maxDate:F}):t("pick",{minDate:F,maxDate:i.minDate}),t("select",!1)):(t("pick",{minDate:F,maxDate:null}),t("select",!0));else if(i.selectionMode==="years"){if(L.type==="keydown"){t("pick",Iu(i.parsedValue),!1);return}const V=kX(F.startOf("year"),a.value,i.disabledDate),U=Td(A,"current")?Iu(i.parsedValue).filter(Q=>(Q==null?void 0:Q.year())!==P):Iu(i.parsedValue).concat([V]);t("pick",U)}else t("pick",P)},I=L=>{var O;if(!i.rangeState.selecting)return;const A=(O=L.target)==null?void 0:O.closest("td");if(!A)return;const N=A.parentNode.rowIndex,D=A.cellIndex;_.value[N][D].disabled||(N!==g.value||D!==p.value)&&(g.value=N,p.value=D,t("changerange",{selecting:!0,endDate:Mn().year(d.value).add(N*4+D,"year")}))};return ht(()=>i.date,async()=>{var L,O;(L=c.value)!=null&&L.contains(document.activeElement)&&(await cn(),(O=u.value)==null||O.focus())}),e({focus:v}),(L,O)=>(G(),he("table",{role:"grid","aria-label":T(r)("el.datepicker.yearTablePrompt"),class:Y(T(o).b()),onClick:w,onMousemove:I},[oe("tbody",{ref_key:"tbodyRef",ref:c},[(G(!0),he(Qt,null,fi(T(_),(A,N)=>(G(),he("tr",{key:N},[(G(!0),he(Qt,null,fi(A,(D,P)=>(G(),he("td",{key:`${N}_${P}`,ref_for:!0,ref:F=>y(D)&&(u.value=F),class:Y(["available",C(D)]),"aria-selected":y(D),"aria-label":String(D.text),tabindex:y(D)?0:-1,onKeydown:[xs(bn(w,["prevent","stop"]),["space"]),xs(bn(w,["prevent","stop"]),["enter"])]},[ce(T(Mte),{cell:D},null,8,["cell"])],42,["aria-selected","aria-label","tabindex","onKeydown"]))),128))]))),128))],512)],42,["aria-label"]))}});var $X=Rt(Vtt,[["__file","basic-year-table.vue"]]);const Utt=$e({__name:"panel-date-pick",props:Mtt,emits:["pick","set-picker-option","panel-change"],setup(n,{emit:e}){const t=n,i=(le,Fe,pe)=>!0,s=vt("picker-panel"),o=vt("date-picker"),r=Ly(),a=dl(),{t:c,lang:u}=wi(),d=Kt("EP_PICKER_BASE"),f=Kt(I8),{shortcuts:g,disabledDate:p,cellClassName:_,defaultTime:v}=d.props,C=ds(d.props,"defaultValue"),y=te(),w=te(Mn().locale(u.value)),I=te(!1);let L=!1;const O=W(()=>Mn(v).locale(u.value)),A=W(()=>w.value.month()),N=W(()=>w.value.year()),D=te([]),P=te(null),F=te(null),V=le=>D.value.length>0?i(le,D.value,t.format||"HH:mm:ss"):!0,U=le=>v&&!et.value&&!I.value&&!L?O.value.year(le.year()).month(le.month()).date(le.date()):we.value?le.millisecond(0):le.startOf("day"),Q=(le,...Fe)=>{if(!le)e("pick",le,...Fe);else if(yt(le)){const pe=le.map(U);e("pick",pe,...Fe)}else e("pick",U(le),...Fe);P.value=null,F.value=null,I.value=!1,L=!1},de=async(le,Fe)=>{if(ge.value==="date"){le=le;let pe=t.parsedValue?t.parsedValue.year(le.year()).month(le.month()).date(le.date()):le;V(pe)||(pe=D.value[0][0].year(le.year()).month(le.month()).date(le.date())),w.value=pe,Q(pe,we.value||Fe),t.type==="datetime"&&(await cn(),Ot())}else ge.value==="week"?Q(le.date):ge.value==="dates"&&Q(le,!0)},q=le=>{const Fe=le?"add":"subtract";w.value=w.value[Fe](1,"month"),se("month")},K=le=>{const Fe=w.value,pe=le?"add":"subtract";w.value=re.value==="year"?Fe[pe](10,"year"):Fe[pe](1,"year"),se("year")},re=te("date"),Z=W(()=>{const le=c("el.datepicker.year");if(re.value==="year"){const Fe=Math.floor(N.value/10)*10;return le?`${Fe} ${le} - ${Fe+9} ${le}`:`${Fe} - ${Fe+9}`}return`${N.value} ${le}`}),J=le=>{const Fe=ln(le.value)?le.value():le.value;if(Fe){L=!0,Q(Mn(Fe).locale(u.value));return}le.onClick&&le.onClick({attrs:r,slots:a,emit:e})},ge=W(()=>{const{type:le}=t;return["week","month","months","year","years","dates"].includes(le)?le:"date"}),ve=W(()=>ge.value==="dates"||ge.value==="months"||ge.value==="years"),Le=W(()=>ge.value==="date"?re.value:ge.value),Ee=W(()=>!!g.length),Ne=async(le,Fe)=>{ge.value==="month"?(w.value=ax(w.value.year(),le,u.value,p),Q(w.value,!1)):ge.value==="months"?Q(le,Fe??!0):(w.value=ax(w.value.year(),le,u.value,p),re.value="date",["month","year","date","week"].includes(ge.value)&&(Q(w.value,!0),await cn(),Ot())),se("month")},qe=async(le,Fe)=>{if(ge.value==="year"){const pe=w.value.startOf("year").year(le);w.value=kX(pe,u.value,p),Q(w.value,!1)}else if(ge.value==="years")Q(le,Fe??!0);else{const pe=w.value.year(le);w.value=kX(pe,u.value,p),re.value="month",["month","year","date","week"].includes(ge.value)&&(Q(w.value,!0),await cn(),Ot())}se("year")},Re=async le=>{re.value=le,await cn(),Ot()},we=W(()=>t.type==="datetime"||t.type==="datetimerange"),Ve=W(()=>{const le=we.value||ge.value==="dates",Fe=ge.value==="years",pe=ge.value==="months",je=re.value==="date",Ae=re.value==="year",Et=re.value==="month";return le&&je||Fe&&Ae||pe&&Et}),Ge=W(()=>p?t.parsedValue?yt(t.parsedValue)?p(t.parsedValue[0].toDate()):p(t.parsedValue.toDate()):!0:!1),dt=()=>{if(ve.value)Q(t.parsedValue);else{let le=t.parsedValue;if(!le){const Fe=Mn(v).locale(u.value),pe=Gt();le=Fe.year(pe.year()).month(pe.month()).date(pe.date())}w.value=le,Q(le)}},ze=W(()=>p?p(Mn().locale(u.value).toDate()):!1),ee=()=>{const Fe=Mn().locale(u.value).toDate();I.value=!0,(!p||!p(Fe))&&V(Fe)&&(w.value=Mn().locale(u.value),Q(w.value))},ye=W(()=>t.timeFormat||SSe(t.format)),Me=W(()=>t.dateFormat||ESe(t.format)),et=W(()=>{if(F.value)return F.value;if(!(!t.parsedValue&&!C.value))return(t.parsedValue||w.value).format(ye.value)}),at=W(()=>{if(P.value)return P.value;if(!(!t.parsedValue&&!C.value))return(t.parsedValue||w.value).format(Me.value)}),Ue=te(!1),Se=()=>{Ue.value=!0},Ie=()=>{Ue.value=!1},Xe=le=>({hour:le.hour(),minute:le.minute(),second:le.second(),year:le.year(),month:le.month(),date:le.date()}),it=(le,Fe,pe)=>{const{hour:je,minute:Ae,second:Et}=Xe(le),Tn=t.parsedValue?t.parsedValue.hour(je).minute(Ae).second(Et):le;w.value=Tn,Q(w.value,!0),pe||(Ue.value=Fe)},Tt=le=>{const Fe=Mn(le,ye.value).locale(u.value);if(Fe.isValid()&&V(Fe)){const{year:pe,month:je,date:Ae}=Xe(w.value);w.value=Fe.year(pe).month(je).date(Ae),F.value=null,Ue.value=!1,Q(w.value,!0)}},He=le=>{const Fe=Mn(le,Me.value).locale(u.value);if(Fe.isValid()){if(p&&p(Fe.toDate()))return;const{hour:pe,minute:je,second:Ae}=Xe(w.value);w.value=Fe.hour(pe).minute(je).second(Ae),P.value=null,Q(w.value,!0)}},ke=le=>Mn.isDayjs(le)&&le.isValid()&&(p?!p(le.toDate()):!0),ot=le=>yt(le)?le.map(Fe=>Fe.format(t.format)):le.format(t.format),Ct=le=>Mn(le,t.format).locale(u.value),Gt=()=>{const le=Mn(C.value).locale(u.value);if(!C.value){const Fe=O.value;return Mn().hour(Fe.hour()).minute(Fe.minute()).second(Fe.second()).locale(u.value)}return le},Ot=async()=>{var le;["week","month","year","date"].includes(ge.value)&&((le=y.value)==null||le.focus(),ge.value==="week"&&fe(zt.down))},En=le=>{const{code:Fe}=le;[zt.up,zt.down,zt.left,zt.right,zt.home,zt.end,zt.pageUp,zt.pageDown].includes(Fe)&&(fe(Fe),le.stopPropagation(),le.preventDefault()),[zt.enter,zt.space,zt.numpadEnter].includes(Fe)&&P.value===null&&F.value===null&&(le.preventDefault(),Q(w.value,!1))},fe=le=>{var Fe;const{up:pe,down:je,left:Ae,right:Et,home:Tn,end:Hn,pageUp:Xn,pageDown:vs}=zt,Zn={year:{[pe]:-4,[je]:4,[Ae]:-1,[Et]:1,offset:(ti,Ps)=>ti.setFullYear(ti.getFullYear()+Ps)},month:{[pe]:-4,[je]:4,[Ae]:-1,[Et]:1,offset:(ti,Ps)=>ti.setMonth(ti.getMonth()+Ps)},week:{[pe]:-1,[je]:1,[Ae]:-1,[Et]:1,offset:(ti,Ps)=>ti.setDate(ti.getDate()+Ps*7)},date:{[pe]:-7,[je]:7,[Ae]:-1,[Et]:1,[Tn]:ti=>-ti.getDay(),[Hn]:ti=>-ti.getDay()+6,[Xn]:ti=>-new Date(ti.getFullYear(),ti.getMonth(),0).getDate(),[vs]:ti=>new Date(ti.getFullYear(),ti.getMonth()+1,0).getDate(),offset:(ti,Ps)=>ti.setDate(ti.getDate()+Ps)}},Hi=w.value.toDate();for(;Math.abs(w.value.diff(Hi,"year",!0))<1;){const ti=Zn[Le.value];if(!ti)return;if(ti.offset(Hi,ln(ti[le])?ti[le](Hi):(Fe=ti[le])!=null?Fe:0),p&&p(Hi))break;const Ps=Mn(Hi).locale(u.value);w.value=Ps,e("pick",Ps,!0);break}},se=le=>{e("panel-change",w.value.toDate(),le,re.value)};return ht(()=>ge.value,le=>{if(["month","year"].includes(le)){re.value=le;return}else if(le==="years"){re.value="year";return}else if(le==="months"){re.value="month";return}re.value="date"},{immediate:!0}),ht(()=>re.value,()=>{f==null||f.updatePopper()}),ht(()=>C.value,le=>{le&&(w.value=Gt())},{immediate:!0}),ht(()=>t.parsedValue,le=>{if(le){if(ve.value||yt(le))return;w.value=le}else w.value=Gt()},{immediate:!0}),e("set-picker-option",["isValidValue",ke]),e("set-picker-option",["formatToString",ot]),e("set-picker-option",["parseUserInput",Ct]),e("set-picker-option",["handleFocusPicker",Ot]),(le,Fe)=>(G(),he("div",{class:Y([T(s).b(),T(o).b(),{"has-sidebar":le.$slots.sidebar||T(Ee),"has-time":T(we)}])},[oe("div",{class:Y(T(s).e("body-wrapper"))},[Ye(le.$slots,"sidebar",{class:Y(T(s).e("sidebar"))}),T(Ee)?(G(),he("div",{key:0,class:Y(T(s).e("sidebar"))},[(G(!0),he(Qt,null,fi(T(g),(pe,je)=>(G(),he("button",{key:je,type:"button",class:Y(T(s).e("shortcut")),onClick:Ae=>J(pe)},st(pe.text),11,["onClick"]))),128))],2)):Qe("v-if",!0),oe("div",{class:Y(T(s).e("body"))},[T(we)?(G(),he("div",{key:0,class:Y(T(o).e("time-header"))},[oe("span",{class:Y(T(o).e("editor-wrap"))},[ce(T(Kc),{placeholder:T(c)("el.datepicker.selectDate"),"model-value":T(at),size:"small","validate-event":!1,onInput:pe=>P.value=pe,onChange:He},null,8,["placeholder","model-value","onInput"])],2),Un((G(),he("span",{class:Y(T(o).e("editor-wrap"))},[ce(T(Kc),{placeholder:T(c)("el.datepicker.selectTime"),"model-value":T(et),size:"small","validate-event":!1,onFocus:Se,onInput:pe=>F.value=pe,onChange:Tt},null,8,["placeholder","model-value","onInput"]),ce(T(vW),{visible:Ue.value,format:T(ye),"parsed-value":w.value,onPick:it},null,8,["visible","format","parsed-value"])],2)),[[T(cb),Ie]])],2)):Qe("v-if",!0),Un(oe("div",{class:Y([T(o).e("header"),(re.value==="year"||re.value==="month")&&T(o).e("header--bordered")])},[oe("span",{class:Y(T(o).e("prev-btn"))},[oe("button",{type:"button","aria-label":T(c)("el.datepicker.prevYear"),class:Y(["d-arrow-left",T(s).e("icon-btn")]),onClick:pe=>K(!1)},[Ye(le.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["aria-label","onClick"]),Un(oe("button",{type:"button","aria-label":T(c)("el.datepicker.prevMonth"),class:Y([T(s).e("icon-btn"),"arrow-left"]),onClick:pe=>q(!1)},[Ye(le.$slots,"prev-month",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ZC))]),_:1})])],10,["aria-label","onClick"]),[[Gi,re.value==="date"]])],2),oe("span",{role:"button",class:Y(T(o).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:xs(pe=>Re("year"),["enter"]),onClick:pe=>Re("year")},st(T(Z)),43,["onKeydown","onClick"]),Un(oe("span",{role:"button","aria-live":"polite",tabindex:"0",class:Y([T(o).e("header-label"),{active:re.value==="month"}]),onKeydown:xs(pe=>Re("month"),["enter"]),onClick:pe=>Re("month")},st(T(c)(`el.datepicker.month${T(A)+1}`)),43,["onKeydown","onClick"]),[[Gi,re.value==="date"]]),oe("span",{class:Y(T(o).e("next-btn"))},[Un(oe("button",{type:"button","aria-label":T(c)("el.datepicker.nextMonth"),class:Y([T(s).e("icon-btn"),"arrow-right"]),onClick:pe=>q(!0)},[Ye(le.$slots,"next-month",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})])],10,["aria-label","onClick"]),[[Gi,re.value==="date"]]),oe("button",{type:"button","aria-label":T(c)("el.datepicker.nextYear"),class:Y([T(s).e("icon-btn"),"d-arrow-right"]),onClick:pe=>K(!0)},[Ye(le.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["aria-label","onClick"])],2)],2),[[Gi,re.value!=="time"]]),oe("div",{class:Y(T(s).e("content")),onKeydown:En},[re.value==="date"?(G(),nt(NX,{key:0,ref_key:"currentViewRef",ref:y,"selection-mode":T(ge),date:w.value,"parsed-value":le.parsedValue,"disabled-date":T(p),"cell-class-name":T(_),onPick:de},null,8,["selection-mode","date","parsed-value","disabled-date","cell-class-name"])):Qe("v-if",!0),re.value==="year"?(G(),nt($X,{key:1,ref_key:"currentViewRef",ref:y,"selection-mode":T(ge),date:w.value,"disabled-date":T(p),"parsed-value":le.parsedValue,onPick:qe},null,8,["selection-mode","date","disabled-date","parsed-value"])):Qe("v-if",!0),re.value==="month"?(G(),nt(DX,{key:2,ref_key:"currentViewRef",ref:y,"selection-mode":T(ge),date:w.value,"parsed-value":le.parsedValue,"disabled-date":T(p),onPick:Ne},null,8,["selection-mode","date","parsed-value","disabled-date"])):Qe("v-if",!0)],34)],2)],2),Un(oe("div",{class:Y(T(s).e("footer"))},[Un(ce(T(_a),{text:"",size:"small",class:Y(T(s).e("link-btn")),disabled:T(ze),onClick:ee},{default:_e(()=>[mn(st(T(c)("el.datepicker.now")),1)]),_:1},8,["class","disabled"]),[[Gi,!T(ve)&&le.showNow]]),ce(T(_a),{plain:"",size:"small",class:Y(T(s).e("link-btn")),disabled:T(Ge),onClick:dt},{default:_e(()=>[mn(st(T(c)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled"])],2),[[Gi,T(Ve)]])],2))}});var Wtt=Rt(Utt,[["__file","panel-date-pick.vue"]]);const Gtt=Lt({...s0e,...Lte,visible:Boolean}),o0e=n=>{const{emit:e}=Qn(),t=Ly(),i=dl();return o=>{const r=ln(o.value)?o.value():o.value;if(r){e("pick",[Mn(r[0]).locale(n.value),Mn(r[1]).locale(n.value)]);return}o.onClick&&o.onClick({attrs:t,slots:i,emit:e})}},r0e=(n,{defaultValue:e,leftDate:t,rightDate:i,unit:s,onParsedValueChanged:o})=>{const{emit:r}=Qn(),{pickerNs:a}=Kt(O8),c=vt("date-range-picker"),{t:u,lang:d}=wi(),f=o0e(d),g=te(),p=te(),_=te({endDate:null,selecting:!1}),v=L=>{_.value=L},C=(L=!1)=>{const O=T(g),A=T(p);nR([O,A])&&r("pick",[O,A],L)},y=L=>{_.value.selecting=L,L||(_.value.endDate=null)},w=L=>{if(yt(L)&&L.length===2){const[O,A]=L;g.value=O,t.value=O,p.value=A,o(T(g),T(p))}else I()},I=()=>{const[L,O]=Rte(T(e),{lang:T(d),unit:s,unlinkPanels:n.unlinkPanels});g.value=void 0,p.value=void 0,t.value=L,i.value=O};return ht(e,L=>{L&&I()},{immediate:!0}),ht(()=>n.parsedValue,w,{immediate:!0}),{minDate:g,maxDate:p,rangeState:_,lang:d,ppNs:a,drpNs:c,handleChangeRange:v,handleRangeConfirm:C,handleShortcutClick:f,onSelect:y,onReset:w,t:u}},MH="month",ztt=$e({__name:"panel-date-range",props:Gtt,emits:["pick","set-picker-option","calendar-change","panel-change"],setup(n,{emit:e}){const t=n,i=Kt("EP_PICKER_BASE"),{disabledDate:s,cellClassName:o,defaultTime:r,clearable:a}=i.props,c=ds(i.props,"format"),u=ds(i.props,"shortcuts"),d=ds(i.props,"defaultValue"),{lang:f}=wi(),g=te(Mn().locale(f.value)),p=te(Mn().locale(f.value).add(1,MH)),{minDate:_,maxDate:v,rangeState:C,ppNs:y,drpNs:w,handleChangeRange:I,handleRangeConfirm:L,handleShortcutClick:O,onSelect:A,onReset:N,t:D}=r0e(t,{defaultValue:d,leftDate:g,rightDate:p,unit:MH,onParsedValueChanged:Fe});ht(()=>t.visible,pe=>{!pe&&C.value.selecting&&(N(t.parsedValue),A(!1))});const P=te({min:null,max:null}),F=te({min:null,max:null}),V=W(()=>`${g.value.year()} ${D("el.datepicker.year")} ${D(`el.datepicker.month${g.value.month()+1}`)}`),U=W(()=>`${p.value.year()} ${D("el.datepicker.year")} ${D(`el.datepicker.month${p.value.month()+1}`)}`),Q=W(()=>g.value.year()),de=W(()=>g.value.month()),q=W(()=>p.value.year()),K=W(()=>p.value.month()),re=W(()=>!!u.value.length),Z=W(()=>P.value.min!==null?P.value.min:_.value?_.value.format(Ee.value):""),J=W(()=>P.value.max!==null?P.value.max:v.value||_.value?(v.value||_.value).format(Ee.value):""),ge=W(()=>F.value.min!==null?F.value.min:_.value?_.value.format(Le.value):""),ve=W(()=>F.value.max!==null?F.value.max:v.value||_.value?(v.value||_.value).format(Le.value):""),Le=W(()=>t.timeFormat||SSe(c.value)),Ee=W(()=>t.dateFormat||ESe(c.value)),Ne=pe=>nR(pe)&&(s?!s(pe[0].toDate())&&!s(pe[1].toDate()):!0),qe=()=>{g.value=g.value.subtract(1,"year"),t.unlinkPanels||(p.value=g.value.add(1,"month")),ye("year")},Re=()=>{g.value=g.value.subtract(1,"month"),t.unlinkPanels||(p.value=g.value.add(1,"month")),ye("month")},we=()=>{t.unlinkPanels?p.value=p.value.add(1,"year"):(g.value=g.value.add(1,"year"),p.value=g.value.add(1,"month")),ye("year")},Ve=()=>{t.unlinkPanels?p.value=p.value.add(1,"month"):(g.value=g.value.add(1,"month"),p.value=g.value.add(1,"month")),ye("month")},Ge=()=>{g.value=g.value.add(1,"year"),ye("year")},dt=()=>{g.value=g.value.add(1,"month"),ye("month")},ze=()=>{p.value=p.value.subtract(1,"year"),ye("year")},ee=()=>{p.value=p.value.subtract(1,"month"),ye("month")},ye=pe=>{e("panel-change",[g.value.toDate(),p.value.toDate()],pe)},Me=W(()=>{const pe=(de.value+1)%12,je=de.value+1>=12?1:0;return t.unlinkPanels&&new Date(Q.value+je,pe)<new Date(q.value,K.value)}),et=W(()=>t.unlinkPanels&&q.value*12+K.value-(Q.value*12+de.value+1)>=12),at=W(()=>!(_.value&&v.value&&!C.value.selecting&&nR([_.value,v.value]))),Ue=W(()=>t.type==="datetime"||t.type==="datetimerange"),Se=(pe,je)=>{if(pe)return r?Mn(r[je]||r).locale(f.value).year(pe.year()).month(pe.month()).date(pe.date()):pe},Ie=(pe,je=!0)=>{const Ae=pe.minDate,Et=pe.maxDate,Tn=Se(Ae,0),Hn=Se(Et,1);v.value===Hn&&_.value===Tn||(e("calendar-change",[Ae.toDate(),Et&&Et.toDate()]),v.value=Hn,_.value=Tn,!(!je||Ue.value)&&L())},Xe=te(!1),it=te(!1),Tt=()=>{Xe.value=!1},He=()=>{it.value=!1},ke=(pe,je)=>{P.value[je]=pe;const Ae=Mn(pe,Ee.value).locale(f.value);if(Ae.isValid()){if(s&&s(Ae.toDate()))return;je==="min"?(g.value=Ae,_.value=(_.value||g.value).year(Ae.year()).month(Ae.month()).date(Ae.date()),!t.unlinkPanels&&(!v.value||v.value.isBefore(_.value))&&(p.value=Ae.add(1,"month"),v.value=_.value.add(1,"month"))):(p.value=Ae,v.value=(v.value||p.value).year(Ae.year()).month(Ae.month()).date(Ae.date()),!t.unlinkPanels&&(!_.value||_.value.isAfter(v.value))&&(g.value=Ae.subtract(1,"month"),_.value=v.value.subtract(1,"month")))}},ot=(pe,je)=>{P.value[je]=null},Ct=(pe,je)=>{F.value[je]=pe;const Ae=Mn(pe,Le.value).locale(f.value);Ae.isValid()&&(je==="min"?(Xe.value=!0,_.value=(_.value||g.value).hour(Ae.hour()).minute(Ae.minute()).second(Ae.second())):(it.value=!0,v.value=(v.value||p.value).hour(Ae.hour()).minute(Ae.minute()).second(Ae.second()),p.value=v.value))},Gt=(pe,je)=>{F.value[je]=null,je==="min"?(g.value=_.value,Xe.value=!1,(!v.value||v.value.isBefore(_.value))&&(v.value=_.value)):(p.value=v.value,it.value=!1,v.value&&v.value.isBefore(_.value)&&(_.value=v.value))},Ot=(pe,je,Ae)=>{F.value.min||(pe&&(g.value=pe,_.value=(_.value||g.value).hour(pe.hour()).minute(pe.minute()).second(pe.second())),Ae||(Xe.value=je),(!v.value||v.value.isBefore(_.value))&&(v.value=_.value,p.value=pe))},En=(pe,je,Ae)=>{F.value.max||(pe&&(p.value=pe,v.value=(v.value||p.value).hour(pe.hour()).minute(pe.minute()).second(pe.second())),Ae||(it.value=je),v.value&&v.value.isBefore(_.value)&&(_.value=v.value))},fe=()=>{g.value=Rte(T(d),{lang:T(f),unit:"month",unlinkPanels:t.unlinkPanels})[0],p.value=g.value.add(1,"month"),v.value=void 0,_.value=void 0,e("pick",null)},se=pe=>yt(pe)?pe.map(je=>je.format(c.value)):pe.format(c.value),le=pe=>yt(pe)?pe.map(je=>Mn(je,c.value).locale(f.value)):Mn(pe,c.value).locale(f.value);function Fe(pe,je){if(t.unlinkPanels&&je){const Ae=(pe==null?void 0:pe.year())||0,Et=(pe==null?void 0:pe.month())||0,Tn=je.year(),Hn=je.month();p.value=Ae===Tn&&Et===Hn?je.add(1,MH):je}else p.value=g.value.add(1,MH),je&&(p.value=p.value.hour(je.hour()).minute(je.minute()).second(je.second()))}return e("set-picker-option",["isValidValue",Ne]),e("set-picker-option",["parseUserInput",le]),e("set-picker-option",["formatToString",se]),e("set-picker-option",["handleClear",fe]),(pe,je)=>(G(),he("div",{class:Y([T(y).b(),T(w).b(),{"has-sidebar":pe.$slots.sidebar||T(re),"has-time":T(Ue)}])},[oe("div",{class:Y(T(y).e("body-wrapper"))},[Ye(pe.$slots,"sidebar",{class:Y(T(y).e("sidebar"))}),T(re)?(G(),he("div",{key:0,class:Y(T(y).e("sidebar"))},[(G(!0),he(Qt,null,fi(T(u),(Ae,Et)=>(G(),he("button",{key:Et,type:"button",class:Y(T(y).e("shortcut")),onClick:Tn=>T(O)(Ae)},st(Ae.text),11,["onClick"]))),128))],2)):Qe("v-if",!0),oe("div",{class:Y(T(y).e("body"))},[T(Ue)?(G(),he("div",{key:0,class:Y(T(w).e("time-header"))},[oe("span",{class:Y(T(w).e("editors-wrap"))},[oe("span",{class:Y(T(w).e("time-picker-wrap"))},[ce(T(Kc),{size:"small",disabled:T(C).selecting,placeholder:T(D)("el.datepicker.startDate"),class:Y(T(w).e("editor")),"model-value":T(Z),"validate-event":!1,onInput:Ae=>ke(Ae,"min"),onChange:Ae=>ot(Ae,"min")},null,8,["disabled","placeholder","class","model-value","onInput","onChange"])],2),Un((G(),he("span",{class:Y(T(w).e("time-picker-wrap"))},[ce(T(Kc),{size:"small",class:Y(T(w).e("editor")),disabled:T(C).selecting,placeholder:T(D)("el.datepicker.startTime"),"model-value":T(ge),"validate-event":!1,onFocus:Ae=>Xe.value=!0,onInput:Ae=>Ct(Ae,"min"),onChange:Ae=>Gt(Ae,"min")},null,8,["class","disabled","placeholder","model-value","onFocus","onInput","onChange"]),ce(T(vW),{visible:Xe.value,format:T(Le),"datetime-role":"start","parsed-value":g.value,onPick:Ot},null,8,["visible","format","parsed-value"])],2)),[[T(cb),Tt]])],2),oe("span",null,[ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})]),oe("span",{class:Y([T(w).e("editors-wrap"),"is-right"])},[oe("span",{class:Y(T(w).e("time-picker-wrap"))},[ce(T(Kc),{size:"small",class:Y(T(w).e("editor")),disabled:T(C).selecting,placeholder:T(D)("el.datepicker.endDate"),"model-value":T(J),readonly:!T(_),"validate-event":!1,onInput:Ae=>ke(Ae,"max"),onChange:Ae=>ot(Ae,"max")},null,8,["class","disabled","placeholder","model-value","readonly","onInput","onChange"])],2),Un((G(),he("span",{class:Y(T(w).e("time-picker-wrap"))},[ce(T(Kc),{size:"small",class:Y(T(w).e("editor")),disabled:T(C).selecting,placeholder:T(D)("el.datepicker.endTime"),"model-value":T(ve),readonly:!T(_),"validate-event":!1,onFocus:Ae=>T(_)&&(it.value=!0),onInput:Ae=>Ct(Ae,"max"),onChange:Ae=>Gt(Ae,"max")},null,8,["class","disabled","placeholder","model-value","readonly","onFocus","onInput","onChange"]),ce(T(vW),{"datetime-role":"end",visible:it.value,format:T(Le),"parsed-value":p.value,onPick:En},null,8,["visible","format","parsed-value"])],2)),[[T(cb),He]])],2)],2)):Qe("v-if",!0),oe("div",{class:Y([[T(y).e("content"),T(w).e("content")],"is-left"])},[oe("div",{class:Y(T(w).e("header"))},[oe("button",{type:"button",class:Y([T(y).e("icon-btn"),"d-arrow-left"]),"aria-label":T(D)("el.datepicker.prevYear"),onClick:qe},[Ye(pe.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["aria-label"]),oe("button",{type:"button",class:Y([T(y).e("icon-btn"),"arrow-left"]),"aria-label":T(D)("el.datepicker.prevMonth"),onClick:Re},[Ye(pe.$slots,"prev-month",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ZC))]),_:1})])],10,["aria-label"]),pe.unlinkPanels?(G(),he("button",{key:0,type:"button",disabled:!T(et),class:Y([[T(y).e("icon-btn"),{"is-disabled":!T(et)}],"d-arrow-right"]),"aria-label":T(D)("el.datepicker.nextYear"),onClick:Ge},[Ye(pe.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["disabled","aria-label"])):Qe("v-if",!0),pe.unlinkPanels?(G(),he("button",{key:1,type:"button",disabled:!T(Me),class:Y([[T(y).e("icon-btn"),{"is-disabled":!T(Me)}],"arrow-right"]),"aria-label":T(D)("el.datepicker.nextMonth"),onClick:dt},[Ye(pe.$slots,"next-month",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})])],10,["disabled","aria-label"])):Qe("v-if",!0),oe("div",null,st(T(V)),1)],2),ce(NX,{"selection-mode":"range",date:g.value,"min-date":T(_),"max-date":T(v),"range-state":T(C),"disabled-date":T(s),"cell-class-name":T(o),onChangerange:T(I),onPick:Ie,onSelect:T(A)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2),oe("div",{class:Y([[T(y).e("content"),T(w).e("content")],"is-right"])},[oe("div",{class:Y(T(w).e("header"))},[pe.unlinkPanels?(G(),he("button",{key:0,type:"button",disabled:!T(et),class:Y([[T(y).e("icon-btn"),{"is-disabled":!T(et)}],"d-arrow-left"]),"aria-label":T(D)("el.datepicker.prevYear"),onClick:ze},[Ye(pe.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["disabled","aria-label"])):Qe("v-if",!0),pe.unlinkPanels?(G(),he("button",{key:1,type:"button",disabled:!T(Me),class:Y([[T(y).e("icon-btn"),{"is-disabled":!T(Me)}],"arrow-left"]),"aria-label":T(D)("el.datepicker.prevMonth"),onClick:ee},[Ye(pe.$slots,"prev-month",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ZC))]),_:1})])],10,["disabled","aria-label"])):Qe("v-if",!0),oe("button",{type:"button","aria-label":T(D)("el.datepicker.nextYear"),class:Y([T(y).e("icon-btn"),"d-arrow-right"]),onClick:we},[Ye(pe.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["aria-label"]),oe("button",{type:"button",class:Y([T(y).e("icon-btn"),"arrow-right"]),"aria-label":T(D)("el.datepicker.nextMonth"),onClick:Ve},[Ye(pe.$slots,"next-month",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})])],10,["aria-label"]),oe("div",null,st(T(U)),1)],2),ce(NX,{"selection-mode":"range",date:p.value,"min-date":T(_),"max-date":T(v),"range-state":T(C),"disabled-date":T(s),"cell-class-name":T(o),onChangerange:T(I),onPick:Ie,onSelect:T(A)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2)],2)],2),T(Ue)?(G(),he("div",{key:0,class:Y(T(y).e("footer"))},[T(a)?(G(),nt(T(_a),{key:0,text:"",size:"small",class:Y(T(y).e("link-btn")),onClick:fe},{default:_e(()=>[mn(st(T(D)("el.datepicker.clear")),1)]),_:1},8,["class"])):Qe("v-if",!0),ce(T(_a),{plain:"",size:"small",class:Y(T(y).e("link-btn")),disabled:T(at),onClick:Ae=>T(L)(!1)},{default:_e(()=>[mn(st(T(D)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled","onClick"])],2)):Qe("v-if",!0)],2))}});var Ktt=Rt(ztt,[["__file","panel-date-range.vue"]]);const jtt=Lt({...Lte}),Xtt=["pick","set-picker-option","calendar-change"],Ytt=({unlinkPanels:n,leftDate:e,rightDate:t})=>{const{t:i}=wi(),s=()=>{e.value=e.value.subtract(1,"year"),n.value||(t.value=t.value.subtract(1,"year"))},o=()=>{n.value||(e.value=e.value.add(1,"year")),t.value=t.value.add(1,"year")},r=()=>{e.value=e.value.add(1,"year")},a=()=>{t.value=t.value.subtract(1,"year")},c=W(()=>`${e.value.year()} ${i("el.datepicker.year")}`),u=W(()=>`${t.value.year()} ${i("el.datepicker.year")}`),d=W(()=>e.value.year()),f=W(()=>t.value.year()===e.value.year()?e.value.year()+1:t.value.year());return{leftPrevYear:s,rightNextYear:o,leftNextYear:r,rightPrevYear:a,leftLabel:c,rightLabel:u,leftYear:d,rightYear:f}},kH="year",qtt=$e({name:"DatePickerMonthRange"}),Jtt=$e({...qtt,props:jtt,emits:Xtt,setup(n,{emit:e}){const t=n,{lang:i}=wi(),s=Kt("EP_PICKER_BASE"),{shortcuts:o,disabledDate:r}=s.props,a=ds(s.props,"format"),c=ds(s.props,"defaultValue"),u=te(Mn().locale(i.value)),d=te(Mn().locale(i.value).add(1,kH)),{minDate:f,maxDate:g,rangeState:p,ppNs:_,drpNs:v,handleChangeRange:C,handleRangeConfirm:y,handleShortcutClick:w,onSelect:I}=r0e(t,{defaultValue:c,leftDate:u,rightDate:d,unit:kH,onParsedValueChanged:Z}),L=W(()=>!!o.length),{leftPrevYear:O,rightNextYear:A,leftNextYear:N,rightPrevYear:D,leftLabel:P,rightLabel:F,leftYear:V,rightYear:U}=Ytt({unlinkPanels:ds(t,"unlinkPanels"),leftDate:u,rightDate:d}),Q=W(()=>t.unlinkPanels&&U.value>V.value+1),de=(J,ge=!0)=>{const ve=J.minDate,Le=J.maxDate;g.value===Le&&f.value===ve||(e("calendar-change",[ve.toDate(),Le&&Le.toDate()]),g.value=Le,f.value=ve,ge&&y())},q=()=>{u.value=Rte(T(c),{lang:T(i),unit:"year",unlinkPanels:t.unlinkPanels})[0],d.value=u.value.add(1,"year"),e("pick",null)},K=J=>yt(J)?J.map(ge=>ge.format(a.value)):J.format(a.value),re=J=>yt(J)?J.map(ge=>Mn(ge,a.value).locale(i.value)):Mn(J,a.value).locale(i.value);function Z(J,ge){if(t.unlinkPanels&&ge){const ve=(J==null?void 0:J.year())||0,Le=ge.year();d.value=ve===Le?ge.add(1,kH):ge}else d.value=u.value.add(1,kH)}return e("set-picker-option",["isValidValue",nR]),e("set-picker-option",["formatToString",K]),e("set-picker-option",["parseUserInput",re]),e("set-picker-option",["handleClear",q]),(J,ge)=>(G(),he("div",{class:Y([T(_).b(),T(v).b(),{"has-sidebar":!!J.$slots.sidebar||T(L)}])},[oe("div",{class:Y(T(_).e("body-wrapper"))},[Ye(J.$slots,"sidebar",{class:Y(T(_).e("sidebar"))}),T(L)?(G(),he("div",{key:0,class:Y(T(_).e("sidebar"))},[(G(!0),he(Qt,null,fi(T(o),(ve,Le)=>(G(),he("button",{key:Le,type:"button",class:Y(T(_).e("shortcut")),onClick:Ee=>T(w)(ve)},st(ve.text),11,["onClick"]))),128))],2)):Qe("v-if",!0),oe("div",{class:Y(T(_).e("body"))},[oe("div",{class:Y([[T(_).e("content"),T(v).e("content")],"is-left"])},[oe("div",{class:Y(T(v).e("header"))},[oe("button",{type:"button",class:Y([T(_).e("icon-btn"),"d-arrow-left"]),onClick:T(O)},[Ye(J.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["onClick"]),J.unlinkPanels?(G(),he("button",{key:0,type:"button",disabled:!T(Q),class:Y([[T(_).e("icon-btn"),{[T(_).is("disabled")]:!T(Q)}],"d-arrow-right"]),onClick:T(N)},[Ye(J.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["disabled","onClick"])):Qe("v-if",!0),oe("div",null,st(T(P)),1)],2),ce(DX,{"selection-mode":"range",date:u.value,"min-date":T(f),"max-date":T(g),"range-state":T(p),"disabled-date":T(r),onChangerange:T(C),onPick:de,onSelect:T(I)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2),oe("div",{class:Y([[T(_).e("content"),T(v).e("content")],"is-right"])},[oe("div",{class:Y(T(v).e("header"))},[J.unlinkPanels?(G(),he("button",{key:0,type:"button",disabled:!T(Q),class:Y([[T(_).e("icon-btn"),{"is-disabled":!T(Q)}],"d-arrow-left"]),onClick:T(D)},[Ye(J.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["disabled","onClick"])):Qe("v-if",!0),oe("button",{type:"button",class:Y([T(_).e("icon-btn"),"d-arrow-right"]),onClick:T(A)},[Ye(J.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["onClick"]),oe("div",null,st(T(F)),1)],2),ce(DX,{"selection-mode":"range",date:d.value,"min-date":T(f),"max-date":T(g),"range-state":T(p),"disabled-date":T(r),onChangerange:T(C),onPick:de,onSelect:T(I)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2)],2)],2)],2))}});var Qtt=Rt(Jtt,[["__file","panel-month-range.vue"]]);const Ztt=Lt({...Lte}),ent=["pick","set-picker-option","calendar-change"],tnt=({unlinkPanels:n,leftDate:e,rightDate:t})=>{const i=()=>{e.value=e.value.subtract(10,"year"),n.value||(t.value=t.value.subtract(10,"year"))},s=()=>{n.value||(e.value=e.value.add(10,"year")),t.value=t.value.add(10,"year")},o=()=>{e.value=e.value.add(10,"year")},r=()=>{t.value=t.value.subtract(10,"year")},a=W(()=>{const f=Math.floor(e.value.year()/10)*10;return`${f}-${f+9}`}),c=W(()=>{const f=Math.floor(t.value.year()/10)*10;return`${f}-${f+9}`}),u=W(()=>Math.floor(e.value.year()/10)*10+9),d=W(()=>Math.floor(t.value.year()/10)*10);return{leftPrevYear:i,rightNextYear:s,leftNextYear:o,rightPrevYear:r,leftLabel:a,rightLabel:c,leftYear:u,rightYear:d}},ude="year",nnt=$e({name:"DatePickerYearRange"}),int=$e({...nnt,props:Ztt,emits:ent,setup(n,{emit:e}){const t=n,{lang:i}=wi(),s=te(Mn().locale(i.value)),o=te(s.value.add(10,"year")),{pickerNs:r}=Kt(O8),a=vt("date-range-picker"),c=W(()=>!!de.length),u=W(()=>[r.b(),a.b(),{"has-sidebar":!!dl().sidebar||c.value}]),d=W(()=>({content:[r.e("content"),a.e("content"),"is-left"],arrowLeftBtn:[r.e("icon-btn"),"d-arrow-left"],arrowRightBtn:[r.e("icon-btn"),{[r.is("disabled")]:!O.value},"d-arrow-right"]})),f=W(()=>({content:[r.e("content"),a.e("content"),"is-right"],arrowLeftBtn:[r.e("icon-btn"),{"is-disabled":!O.value},"d-arrow-left"],arrowRightBtn:[r.e("icon-btn"),"d-arrow-right"]})),g=o0e(i),{leftPrevYear:p,rightNextYear:_,leftNextYear:v,rightPrevYear:C,leftLabel:y,rightLabel:w,leftYear:I,rightYear:L}=tnt({unlinkPanels:ds(t,"unlinkPanels"),leftDate:s,rightDate:o}),O=W(()=>t.unlinkPanels&&L.value>I.value+1),A=te(),N=te(),D=te({endDate:null,selecting:!1}),P=Ee=>{D.value=Ee},F=(Ee,Ne=!0)=>{const qe=Ee.minDate,Re=Ee.maxDate;N.value===Re&&A.value===qe||(e("calendar-change",[qe.toDate(),Re&&Re.toDate()]),N.value=Re,A.value=qe,Ne&&V())},V=(Ee=!1)=>{nR([A.value,N.value])&&e("pick",[A.value,N.value],Ee)},U=Ee=>{D.value.selecting=Ee,Ee||(D.value.endDate=null)},Q=Kt("EP_PICKER_BASE"),{shortcuts:de,disabledDate:q}=Q.props,K=ds(Q.props,"format"),re=ds(Q.props,"defaultValue"),Z=()=>{let Ee;if(yt(re.value)){const Ne=Mn(re.value[0]);let qe=Mn(re.value[1]);return t.unlinkPanels||(qe=Ne.add(10,ude)),[Ne,qe]}else re.value?Ee=Mn(re.value):Ee=Mn();return Ee=Ee.locale(i.value),[Ee,Ee.add(10,ude)]};ht(()=>re.value,Ee=>{if(Ee){const Ne=Z();s.value=Ne[0],o.value=Ne[1]}},{immediate:!0}),ht(()=>t.parsedValue,Ee=>{if(Ee&&Ee.length===2)if(A.value=Ee[0],N.value=Ee[1],s.value=A.value,t.unlinkPanels&&N.value){const Ne=A.value.year(),qe=N.value.year();o.value=Ne===qe?N.value.add(10,"year"):N.value}else o.value=s.value.add(10,"year");else{const Ne=Z();A.value=void 0,N.value=void 0,s.value=Ne[0],o.value=Ne[1]}},{immediate:!0});const J=Ee=>yt(Ee)?Ee.map(Ne=>Mn(Ne,K.value).locale(i.value)):Mn(Ee,K.value).locale(i.value),ge=Ee=>yt(Ee)?Ee.map(Ne=>Ne.format(K.value)):Ee.format(K.value),ve=Ee=>nR(Ee)&&(q?!q(Ee[0].toDate())&&!q(Ee[1].toDate()):!0),Le=()=>{const Ee=Z();s.value=Ee[0],o.value=Ee[1],N.value=void 0,A.value=void 0,e("pick",null)};return e("set-picker-option",["isValidValue",ve]),e("set-picker-option",["parseUserInput",J]),e("set-picker-option",["formatToString",ge]),e("set-picker-option",["handleClear",Le]),(Ee,Ne)=>(G(),he("div",{class:Y(T(u))},[oe("div",{class:Y(T(r).e("body-wrapper"))},[Ye(Ee.$slots,"sidebar",{class:Y(T(r).e("sidebar"))}),T(c)?(G(),he("div",{key:0,class:Y(T(r).e("sidebar"))},[(G(!0),he(Qt,null,fi(T(de),(qe,Re)=>(G(),he("button",{key:Re,type:"button",class:Y(T(r).e("shortcut")),onClick:we=>T(g)(qe)},st(qe.text),11,["onClick"]))),128))],2)):Qe("v-if",!0),oe("div",{class:Y(T(r).e("body"))},[oe("div",{class:Y(T(d).content)},[oe("div",{class:Y(T(a).e("header"))},[oe("button",{type:"button",class:Y(T(d).arrowLeftBtn),onClick:T(p)},[Ye(Ee.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["onClick"]),Ee.unlinkPanels?(G(),he("button",{key:0,type:"button",disabled:!T(O),class:Y(T(d).arrowRightBtn),onClick:T(v)},[Ye(Ee.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["disabled","onClick"])):Qe("v-if",!0),oe("div",null,st(T(y)),1)],2),ce($X,{"selection-mode":"range",date:s.value,"min-date":A.value,"max-date":N.value,"range-state":D.value,"disabled-date":T(q),onChangerange:P,onPick:F,onSelect:U},null,8,["date","min-date","max-date","range-state","disabled-date"])],2),oe("div",{class:Y(T(f).content)},[oe("div",{class:Y(T(a).e("header"))},[Ee.unlinkPanels?(G(),he("button",{key:0,type:"button",disabled:!T(O),class:Y(T(f).arrowLeftBtn),onClick:T(C)},[Ye(Ee.$slots,"prev-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ey))]),_:1})])],10,["disabled","onClick"])):Qe("v-if",!0),oe("button",{type:"button",class:Y(T(f).arrowRightBtn),onClick:T(_)},[Ye(Ee.$slots,"next-year",{},()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ty))]),_:1})])],10,["onClick"]),oe("div",null,st(T(w)),1)],2),ce($X,{"selection-mode":"range",date:o.value,"min-date":A.value,"max-date":N.value,"range-state":D.value,"disabled-date":T(q),onChangerange:P,onPick:F,onSelect:U},null,8,["date","min-date","max-date","range-state","disabled-date"])],2)],2)],2)],2))}});var snt=Rt(int,[["__file","panel-year-range.vue"]]);const ont=function(n){switch(n){case"daterange":case"datetimerange":return Ktt;case"monthrange":return Qtt;case"yearrange":return snt;default:return Wtt}};Mn.extend(wSe);Mn.extend(Wet);Mn.extend(Ste);Mn.extend(jet);Mn.extend(Jet);Mn.extend(ttt);Mn.extend(ott);Mn.extend(ctt);var rnt=$e({name:"ElDatePicker",install:null,props:Ott,emits:["update:modelValue"],setup(n,{expose:e,emit:t,slots:i}){const s=vt("picker-panel");pi("ElPopperOptions",Ki(ds(n,"popperOptions"))),pi(O8,{slots:i,pickerNs:s});const o=te();e({focus:()=>{var c;(c=o.value)==null||c.focus()},blur:()=>{var c;(c=o.value)==null||c.blur()},handleOpen:()=>{var c;(c=o.value)==null||c.handleOpen()},handleClose:()=>{var c;(c=o.value)==null||c.handleClose()}});const a=c=>{t("update:modelValue",c)};return()=>{var c;const u=(c=n.format)!=null?c:utt[n.type]||S1,d=ont(n.type);return ce(ZSe,hi(n,{format:u,type:n.type,ref:o,"onUpdate:modelValue":a}),{default:f=>ce(d,f,{"prev-month":i["prev-month"],"next-month":i["next-month"],"prev-year":i["prev-year"],"next-year":i["next-year"]}),"range-separator":i["range-separator"]})}}});const lnt=Nn(rnt),kte=Symbol("elDescriptions");var ON=$e({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup(){return{descriptions:Kt(kte,{})}},render(){var n;const e=nQe(this.cell),t=(((n=this.cell)==null?void 0:n.dirs)||[]).map(y=>{const{dir:w,arg:I,modifiers:L,value:O}=y;return[w,O,I,L]}),{border:i,direction:s}=this.descriptions,o=s==="vertical",r=()=>{var y,w,I;return((I=(w=(y=this.cell)==null?void 0:y.children)==null?void 0:w.label)==null?void 0:I.call(w))||e.label},a=()=>{var y,w,I;return(I=(w=(y=this.cell)==null?void 0:y.children)==null?void 0:w.default)==null?void 0:I.call(w)},c=e.span,u=e.rowspan,d=e.align?`is-${e.align}`:"",f=e.labelAlign?`is-${e.labelAlign}`:d,g=e.className,p=e.labelClassName,_=this.type==="label"&&(e.labelWidth||this.descriptions.labelWidth)||e.width,v={width:mr(_),minWidth:mr(e.minWidth)},C=vt("descriptions");switch(this.type){case"label":return Un(hn(this.tag,{style:v,class:[C.e("cell"),C.e("label"),C.is("bordered-label",i),C.is("vertical-label",o),f,p],colSpan:o?c:1,rowspan:o?1:u},r()),t);case"content":return Un(hn(this.tag,{style:v,class:[C.e("cell"),C.e("content"),C.is("bordered-content",i),C.is("vertical-content",o),d,g],colSpan:o?c:c*2-1,rowspan:o?u*2-1:u},a()),t);default:{const y=r();return Un(hn("td",{style:v,class:[C.e("cell"),d],colSpan:c,rowspan:u},[Ul(y)?void 0:hn("span",{class:[C.e("label"),p]},y),hn("span",{class:[C.e("content"),g]},a())]),t)}}}});const ant=Lt({row:{type:Ke(Array),default:()=>[]}}),cnt=$e({name:"ElDescriptionsRow"}),unt=$e({...cnt,props:ant,setup(n){const e=Kt(kte,{});return(t,i)=>T(e).direction==="vertical"?(G(),he(Qt,{key:0},[oe("tr",null,[(G(!0),he(Qt,null,fi(t.row,(s,o)=>(G(),nt(T(ON),{key:`tr1-${o}`,cell:s,tag:"th",type:"label"},null,8,["cell"]))),128))]),oe("tr",null,[(G(!0),he(Qt,null,fi(t.row,(s,o)=>(G(),nt(T(ON),{key:`tr2-${o}`,cell:s,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(G(),he("tr",{key:1},[(G(!0),he(Qt,null,fi(t.row,(s,o)=>(G(),he(Qt,{key:`tr3-${o}`},[T(e).border?(G(),he(Qt,{key:0},[ce(T(ON),{cell:s,tag:"td",type:"label"},null,8,["cell"]),ce(T(ON),{cell:s,tag:"td",type:"content"},null,8,["cell"])],64)):(G(),nt(T(ON),{key:1,cell:s,tag:"td",type:"both"},null,8,["cell"]))],64))),128))]))}});var dnt=Rt(unt,[["__file","descriptions-row.vue"]]);const hnt=Lt({border:Boolean,column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:cl,title:{type:String,default:""},extra:{type:String,default:""},labelWidth:{type:[String,Number],default:""}}),fnt=$e({name:"ElDescriptions"}),gnt=$e({...fnt,props:hnt,setup(n){const e=n,t=vt("descriptions"),i=jr(),s=dl();pi(kte,e);const o=W(()=>[t.b(),t.m(i.value)]),r=(c,u,d,f=!1)=>(c.props||(c.props={}),u>d&&(c.props.span=d),f&&(c.props.span=u),c),a=()=>{if(!s.default)return[];const c=kC(s.default()).filter(_=>{var v;return((v=_==null?void 0:_.type)==null?void 0:v.name)==="ElDescriptionsItem"}),u=[];let d=[],f=e.column,g=0;const p=[];return c.forEach((_,v)=>{var C,y,w;const I=((C=_.props)==null?void 0:C.span)||1,L=((y=_.props)==null?void 0:y.rowspan)||1,O=u.length;if(p[O]||(p[O]=0),L>1)for(let A=1;A<L;A++)p[w=O+A]||(p[w]=0),p[O+A]++,g++;if(p[O]>0&&(f-=p[O],p[O]=0),v<c.length-1&&(g+=I>f?f:I),v===c.length-1){const A=e.column-g%e.column;d.push(r(_,A,f,!0)),u.push(d);return}I<f?(f-=I,d.push(_)):(d.push(r(_,I,f)),u.push(d),f=e.column,d=[])}),u};return(c,u)=>(G(),he("div",{class:Y(T(o))},[c.title||c.extra||c.$slots.title||c.$slots.extra?(G(),he("div",{key:0,class:Y(T(t).e("header"))},[oe("div",{class:Y(T(t).e("title"))},[Ye(c.$slots,"title",{},()=>[mn(st(c.title),1)])],2),oe("div",{class:Y(T(t).e("extra"))},[Ye(c.$slots,"extra",{},()=>[mn(st(c.extra),1)])],2)],2)):Qe("v-if",!0),oe("div",{class:Y(T(t).e("body"))},[oe("table",{class:Y([T(t).e("table"),T(t).is("bordered",c.border)])},[oe("tbody",null,[(G(!0),he(Qt,null,fi(a(),(d,f)=>(G(),nt(dnt,{key:f,row:d},null,8,["row"]))),128))])],2)],2)],2))}});var pnt=Rt(gnt,[["__file","description.vue"]]);const mnt=Lt({label:{type:String,default:""},span:{type:Number,default:1},rowspan:{type:Number,default:1},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},labelWidth:{type:[String,Number],default:""},align:{type:String,default:"left"},labelAlign:{type:String,default:""},className:{type:String,default:""},labelClassName:{type:String,default:""}}),l0e=$e({name:"ElDescriptionsItem",props:mnt}),_nt=Nn(pnt,{DescriptionsItem:l0e}),vnt=Xo(l0e),Ate=n=>{if(!n)return{onClick:ps,onMousedown:ps,onMouseup:ps};let e=!1,t=!1;return{onClick:r=>{e&&t&&n(r),e=t=!1},onMousedown:r=>{e=r.target===r.currentTarget},onMouseup:r=>{t=r.target===r.currentTarget}}},bnt=Lt({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:Ke([String,Array,Object])},zIndex:{type:Ke([String,Number])}}),Tnt={click:n=>n instanceof MouseEvent},Cnt="overlay";var ynt=$e({name:"ElOverlay",props:bnt,emits:Tnt,setup(n,{slots:e,emit:t}){const i=vt(Cnt),s=c=>{t("click",c)},{onClick:o,onMousedown:r,onMouseup:a}=Ate(n.customMaskEvent?void 0:s);return()=>n.mask?ce("div",{class:[i.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:o,onMousedown:r,onMouseup:a},[Ye(e,"default")],pf.STYLE|pf.CLASS|pf.PROPS,["onClick","onMouseup","onMousedown"]):hn("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[Ye(e,"default")])}});const Nte=ynt,a0e=Symbol("dialogInjectionKey"),c0e=Lt({center:Boolean,alignCenter:Boolean,closeIcon:{type:ks},draggable:Boolean,overflow:Boolean,fullscreen:Boolean,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}}),Ent={close:()=>!0},u0e=(n,e,t,i)=>{let s={offsetX:0,offsetY:0};const o=u=>{const d=u.clientX,f=u.clientY,{offsetX:g,offsetY:p}=s,_=n.value.getBoundingClientRect(),v=_.left,C=_.top,y=_.width,w=_.height,I=document.documentElement.clientWidth,L=document.documentElement.clientHeight,O=-v+g,A=-C+p,N=I-v-y+g,D=L-C-w+p,P=V=>{let U=g+V.clientX-d,Q=p+V.clientY-f;i!=null&&i.value||(U=Math.min(Math.max(U,O),N),Q=Math.min(Math.max(Q,A),D)),s={offsetX:U,offsetY:Q},n.value&&(n.value.style.transform=`translate(${mr(U)}, ${mr(Q)})`)},F=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",F)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",F)},r=()=>{e.value&&n.value&&e.value.addEventListener("mousedown",o)},a=()=>{e.value&&n.value&&e.value.removeEventListener("mousedown",o)},c=()=>{s={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return $n(()=>{Sl(()=>{t.value?r():a()})}),As(()=>{a()}),{resetPosition:c}},R8=(...n)=>e=>{n.forEach(t=>{ln(t)?t(e):t.value=e})},Snt=$e({name:"ElDialogContent"}),wnt=$e({...Snt,props:c0e,emits:Ent,setup(n,{expose:e}){const t=n,{t:i}=wi(),{Close:s}=ite,{dialogRef:o,headerRef:r,bodyId:a,ns:c,style:u}=Kt(a0e),{focusTrapRef:d}=Kt(cte),f=W(()=>[c.b(),c.is("fullscreen",t.fullscreen),c.is("draggable",t.draggable),c.is("align-center",t.alignCenter),{[c.m("center")]:t.center}]),g=R8(d,o),p=W(()=>t.draggable),_=W(()=>t.overflow),{resetPosition:v}=u0e(o,r,p,_);return e({resetPosition:v}),(C,y)=>(G(),he("div",{ref:T(g),class:Y(T(f)),style:on(T(u)),tabindex:"-1"},[oe("header",{ref_key:"headerRef",ref:r,class:Y([T(c).e("header"),{"show-close":C.showClose}])},[Ye(C.$slots,"header",{},()=>[oe("span",{role:"heading","aria-level":C.ariaLevel,class:Y(T(c).e("title"))},st(C.title),11,["aria-level"])]),C.showClose?(G(),he("button",{key:0,"aria-label":T(i)("el.dialog.close"),class:Y(T(c).e("headerbtn")),type:"button",onClick:w=>C.$emit("close")},[ce(T(tn),{class:Y(T(c).e("close"))},{default:_e(()=>[(G(),nt(ui(C.closeIcon||T(s))))]),_:1},8,["class"])],10,["aria-label","onClick"])):Qe("v-if",!0)],2),oe("div",{id:T(a),class:Y(T(c).e("body"))},[Ye(C.$slots,"default")],10,["id"]),C.$slots.footer?(G(),he("footer",{key:0,class:Y(T(c).e("footer"))},[Ye(C.$slots,"footer")],2)):Qe("v-if",!0)],6))}});var Int=Rt(wnt,[["__file","dialog-content.vue"]]);const d0e=Lt({...c0e,appendToBody:Boolean,appendTo:{type:Ke([String,Object]),default:"body"},beforeClose:{type:Ke(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:Boolean,headerAriaLevel:{type:String,default:"2"}}),h0e={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[Kn]:n=>Us(n),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},Dte=(n,e={})=>{Ss(n)||Ll("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||vt("popup"),i=W(()=>t.bm("parent","hidden"));if(!Si||Td(document.body,i.value))return;let s=0,o=!1,r="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(qc(document==null?void 0:document.body,i.value),o&&document&&(document.body.style.width=r))},200)};ht(n,c=>{if(!c){a();return}o=!Td(document.body,i.value),o&&(r=document.body.style.width),s=NEe(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=$v(document.body,"overflowY");s>0&&(u||d==="scroll")&&o&&(document.body.style.width=`calc(100% - ${s}px)`),Of(document.body,i.value)}),CZ(()=>a())},f0e=(n,e)=>{var t;const s=Qn().emit,{nextZIndex:o}=sM();let r="";const a=Va(),c=Va(),u=te(!1),d=te(!1),f=te(!1),g=te((t=n.zIndex)!=null?t:o());let p,_;const v=b8("namespace",$D),C=W(()=>{const q={},K=`--${v.value}-dialog`;return n.fullscreen||(n.top&&(q[`${K}-margin-top`]=n.top),n.width&&(q[`${K}-width`]=mr(n.width))),q}),y=W(()=>n.alignCenter?{display:"flex"}:{});function w(){s("opened")}function I(){s("closed"),s(Kn,!1),n.destroyOnClose&&(f.value=!1)}function L(){s("close")}function O(){_==null||_(),p==null||p(),n.openDelay&&n.openDelay>0?{stop:p}=B0(()=>P(),n.openDelay):P()}function A(){p==null||p(),_==null||_(),n.closeDelay&&n.closeDelay>0?{stop:_}=B0(()=>F(),n.closeDelay):F()}function N(){function q(K){K||(d.value=!0,u.value=!1)}n.beforeClose?n.beforeClose(q):A()}function D(){n.closeOnClickModal&&N()}function P(){Si&&(u.value=!0)}function F(){u.value=!1}function V(){s("openAutoFocus")}function U(){s("closeAutoFocus")}function Q(q){var K;((K=q.detail)==null?void 0:K.focusReason)==="pointer"&&q.preventDefault()}n.lockScroll&&Dte(u);function de(){n.closeOnPressEscape&&N()}return ht(()=>n.modelValue,q=>{q?(d.value=!1,O(),f.value=!0,g.value=pEe(n.zIndex)?o():g.value++,cn(()=>{s("open"),e.value&&(e.value.scrollTop=0)})):u.value&&A()}),ht(()=>n.fullscreen,q=>{e.value&&(q?(r=e.value.style.transform,e.value.style.transform=""):e.value.style.transform=r)}),$n(()=>{n.modelValue&&(u.value=!0,f.value=!0,O())}),{afterEnter:w,afterLeave:I,beforeLeave:L,handleClose:N,onModalClick:D,close:A,doClose:F,onOpenAutoFocus:V,onCloseAutoFocus:U,onCloseRequested:de,onFocusoutPrevented:Q,titleId:a,bodyId:c,closed:d,style:C,overlayDialogStyle:y,rendered:f,visible:u,zIndex:g}},Lnt=$e({name:"ElDialog",inheritAttrs:!1}),Ont=$e({...Lnt,props:d0e,emits:h0e,setup(n,{expose:e}){const t=n,i=dl();RC({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},W(()=>!!i.title));const s=vt("dialog"),o=te(),r=te(),a=te(),{visible:c,titleId:u,bodyId:d,style:f,overlayDialogStyle:g,rendered:p,zIndex:_,afterEnter:v,afterLeave:C,beforeLeave:y,handleClose:w,onModalClick:I,onOpenAutoFocus:L,onCloseAutoFocus:O,onCloseRequested:A,onFocusoutPrevented:N}=f0e(t,o);pi(a0e,{dialogRef:o,headerRef:r,bodyId:d,ns:s,rendered:p,style:f});const D=Ate(I),P=W(()=>t.draggable&&!t.fullscreen);return e({visible:c,dialogContentRef:a,resetPosition:()=>{var V;(V=a.value)==null||V.resetPosition()}}),(V,U)=>(G(),nt(T(lM),{to:V.appendTo,disabled:V.appendTo!=="body"?!1:!V.appendToBody},{default:_e(()=>[ce(Ta,{name:"dialog-fade",onAfterEnter:T(v),onAfterLeave:T(C),onBeforeLeave:T(y),persisted:""},{default:_e(()=>[Un(ce(T(Nte),{"custom-mask-event":"",mask:V.modal,"overlay-class":V.modalClass,"z-index":T(_)},{default:_e(()=>[oe("div",{role:"dialog","aria-modal":"true","aria-label":V.title||void 0,"aria-labelledby":V.title?void 0:T(u),"aria-describedby":T(d),class:Y(`${T(s).namespace.value}-overlay-dialog`),style:on(T(g)),onClick:T(D).onClick,onMousedown:T(D).onMousedown,onMouseup:T(D).onMouseup},[ce(T(rM),{loop:"",trapped:T(c),"focus-start-el":"container",onFocusAfterTrapped:T(L),onFocusAfterReleased:T(O),onFocusoutPrevented:T(N),onReleaseRequested:T(A)},{default:_e(()=>[T(p)?(G(),nt(Int,hi({key:0,ref_key:"dialogContentRef",ref:a},V.$attrs,{center:V.center,"align-center":V.alignCenter,"close-icon":V.closeIcon,draggable:T(P),overflow:V.overflow,fullscreen:V.fullscreen,"show-close":V.showClose,title:V.title,"aria-level":V.headerAriaLevel,onClose:T(w)}),Hf({header:_e(()=>[V.$slots.title?Ye(V.$slots,"title",{key:1}):Ye(V.$slots,"header",{key:0,close:T(w),titleId:T(u),titleClass:T(s).e("title")})]),default:_e(()=>[Ye(V.$slots,"default")]),_:2},[V.$slots.footer?{name:"footer",fn:_e(()=>[Ye(V.$slots,"footer")])}:void 0]),1040,["center","align-center","close-icon","draggable","overflow","fullscreen","show-close","title","aria-level","onClose"])):Qe("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,["aria-label","aria-labelledby","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["mask","overlay-class","z-index"]),[[Gi,T(c)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Rnt=Rt(Ont,[["__file","dialog.vue"]]);const Mnt=Nn(Rnt),knt=Lt({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},contentPosition:{type:String,values:["left","center","right"],default:"center"},borderStyle:{type:Ke(String),default:"solid"}}),Ant=$e({name:"ElDivider"}),Nnt=$e({...Ant,props:knt,setup(n){const e=n,t=vt("divider"),i=W(()=>t.cssVar({"border-style":e.borderStyle}));return(s,o)=>(G(),he("div",{class:Y([T(t).b(),T(t).m(s.direction)]),style:on(T(i)),role:"separator"},[s.$slots.default&&s.direction!=="vertical"?(G(),he("div",{key:0,class:Y([T(t).e("text"),T(t).is(s.contentPosition)])},[Ye(s.$slots,"default")],2)):Qe("v-if",!0)],6))}});var Dnt=Rt(Nnt,[["__file","divider.vue"]]);const g0e=Nn(Dnt),$nt=Lt({...d0e,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),xnt=h0e,Pnt=$e({name:"ElDrawer",inheritAttrs:!1}),Fnt=$e({...Pnt,props:$nt,emits:xnt,setup(n,{expose:e}){const t=n,i=dl();RC({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},W(()=>!!i.title));const s=te(),o=te(),r=vt("drawer"),{t:a}=wi(),{afterEnter:c,afterLeave:u,beforeLeave:d,visible:f,rendered:g,titleId:p,bodyId:_,zIndex:v,onModalClick:C,onOpenAutoFocus:y,onCloseAutoFocus:w,onFocusoutPrevented:I,onCloseRequested:L,handleClose:O}=f0e(t,s),A=W(()=>t.direction==="rtl"||t.direction==="ltr"),N=W(()=>mr(t.size));return e({handleClose:O,afterEnter:c,afterLeave:u}),(D,P)=>(G(),nt(T(lM),{to:D.appendTo,disabled:D.appendTo!=="body"?!1:!D.appendToBody},{default:_e(()=>[ce(Ta,{name:T(r).b("fade"),onAfterEnter:T(c),onAfterLeave:T(u),onBeforeLeave:T(d),persisted:""},{default:_e(()=>[Un(ce(T(Nte),{mask:D.modal,"overlay-class":D.modalClass,"z-index":T(v),onClick:T(C)},{default:_e(()=>[ce(T(rM),{loop:"",trapped:T(f),"focus-trap-el":s.value,"focus-start-el":o.value,onFocusAfterTrapped:T(y),onFocusAfterReleased:T(w),onFocusoutPrevented:T(I),onReleaseRequested:T(L)},{default:_e(()=>[oe("div",hi({ref_key:"drawerRef",ref:s,"aria-modal":"true","aria-label":D.title||void 0,"aria-labelledby":D.title?void 0:T(p),"aria-describedby":T(_)},D.$attrs,{class:[T(r).b(),D.direction,T(f)&&"open"],style:T(A)?"width: "+T(N):"height: "+T(N),role:"dialog",onClick:bn(()=>{},["stop"])}),[oe("span",{ref_key:"focusStartRef",ref:o,class:Y(T(r).e("sr-focus")),tabindex:"-1"},null,2),D.withHeader?(G(),he("header",{key:0,class:Y(T(r).e("header"))},[D.$slots.title?Ye(D.$slots,"title",{key:1},()=>[Qe(" DEPRECATED SLOT ")]):Ye(D.$slots,"header",{key:0,close:T(O),titleId:T(p),titleClass:T(r).e("title")},()=>[D.$slots.title?Qe("v-if",!0):(G(),he("span",{key:0,id:T(p),role:"heading","aria-level":D.headerAriaLevel,class:Y(T(r).e("title"))},st(D.title),11,["id","aria-level"]))]),D.showClose?(G(),he("button",{key:2,"aria-label":T(a)("el.drawer.close"),class:Y(T(r).e("close-btn")),type:"button",onClick:T(O)},[ce(T(tn),{class:Y(T(r).e("close"))},{default:_e(()=>[ce(T(Zg))]),_:1},8,["class"])],10,["aria-label","onClick"])):Qe("v-if",!0)],2)):Qe("v-if",!0),T(g)?(G(),he("div",{key:1,id:T(_),class:Y(T(r).e("body"))},[Ye(D.$slots,"default")],10,["id"])):Qe("v-if",!0),D.$slots.footer?(G(),he("div",{key:2,class:Y(T(r).e("footer"))},[Ye(D.$slots,"footer")],2)):Qe("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[Gi,T(f)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Bnt=Rt(Fnt,[["__file","drawer.vue"]]);const Hnt=Nn(Bnt),Vnt=$e({inheritAttrs:!1});function Unt(n,e,t,i,s,o){return Ye(n.$slots,"default")}var Wnt=Rt(Vnt,[["render",Unt],["__file","collection.vue"]]);const Gnt=$e({name:"ElCollectionItem",inheritAttrs:!1});function znt(n,e,t,i,s,o){return Ye(n.$slots,"default")}var Knt=Rt(Gnt,[["render",znt],["__file","collection-item.vue"]]);const p0e="data-el-collection-item",m0e=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),s=Symbol(t),o={...Wnt,name:e,setup(){const a=te(null),c=new Map;pi(i,{itemMap:c,getItems:()=>{const d=T(a);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${p0e}]`));return[...c.values()].sort((p,_)=>f.indexOf(p.ref)-f.indexOf(_.ref))},collectionRef:a})}},r={...Knt,name:t,setup(a,{attrs:c}){const u=te(null),d=Kt(i,void 0);pi(s,{collectionItemRef:u}),$n(()=>{const f=T(u);f&&d.itemMap.set(f,{ref:f,...c})}),As(()=>{const f=T(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:s,ElCollection:o,ElCollectionItem:r}},jnt=Lt({style:{type:Ke([String,Array,Object])},currentTabId:{type:Ke(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:Ke(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:Xnt,ElCollectionItem:Ynt,COLLECTION_INJECTION_KEY:$te,COLLECTION_ITEM_INJECTION_KEY:qnt}=m0e("RovingFocusGroup"),xte=Symbol("elRovingFocusGroup"),_0e=Symbol("elRovingFocusGroupItem"),Jnt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},Qnt=(n,e)=>n,Znt=(n,e,t)=>{const i=Qnt(n.code);return Jnt[i]},eit=(n,e)=>n.map((t,i)=>n[(i+e)%n.length]),Pte=n=>{const{activeElement:e}=document;for(const t of n)if(t===e||(t.focus(),e!==document.activeElement))return},dde="currentTabIdChange",hde="rovingFocusGroup.entryFocus",tit={bubbles:!1,cancelable:!0},nit=$e({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:jnt,emits:[dde,"entryFocus"],setup(n,{emit:e}){var t;const i=te((t=n.currentTabId||n.defaultCurrentTabId)!=null?t:null),s=te(!1),o=te(!1),r=te(null),{getItems:a}=Kt($te,void 0),c=W(()=>[{outline:"none"},n.style]),u=v=>{e(dde,v)},d=()=>{s.value=!0},f=pr(v=>{var C;(C=n.onMousedown)==null||C.call(n,v)},()=>{o.value=!0}),g=pr(v=>{var C;(C=n.onFocus)==null||C.call(n,v)},v=>{const C=!T(o),{target:y,currentTarget:w}=v;if(y===w&&C&&!T(s)){const I=new Event(hde,tit);if(w==null||w.dispatchEvent(I),!I.defaultPrevented){const L=a().filter(P=>P.focusable),O=L.find(P=>P.active),A=L.find(P=>P.id===T(i)),D=[O,A,...L].filter(Boolean).map(P=>P.ref);Pte(D)}}o.value=!1}),p=pr(v=>{var C;(C=n.onBlur)==null||C.call(n,v)},()=>{s.value=!1}),_=(...v)=>{e("entryFocus",...v)};pi(xte,{currentTabbedId:XR(i),loop:ds(n,"loop"),tabIndex:W(()=>T(s)?-1:0),rovingFocusGroupRef:r,rovingFocusGroupRootStyle:c,orientation:ds(n,"orientation"),dir:ds(n,"dir"),onItemFocus:u,onItemShiftTab:d,onBlur:p,onFocus:g,onMousedown:f}),ht(()=>n.currentTabId,v=>{i.value=v??null}),Es(r,hde,_)}});function iit(n,e,t,i,s,o){return Ye(n.$slots,"default")}var sit=Rt(nit,[["render",iit],["__file","roving-focus-group-impl.vue"]]);const oit=$e({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:Xnt,ElRovingFocusGroupImpl:sit}});function rit(n,e,t,i,s,o){const r=Bt("el-roving-focus-group-impl"),a=Bt("el-focus-group-collection");return G(),nt(a,null,{default:_e(()=>[ce(r,wf(nb(n.$attrs)),{default:_e(()=>[Ye(n.$slots,"default")]),_:3},16)]),_:3})}var lit=Rt(oit,[["render",rit],["__file","roving-focus-group.vue"]]);const NU=Lt({trigger:rx.trigger,triggerKeys:{type:Ke(Array),default:()=>[zt.enter,zt.numpadEnter,zt.space,zt.down]},effect:{...ua.effect,default:"light"},type:{type:Ke(String)},placement:{type:Ke(String),default:"bottom"},popperOptions:{type:Ke(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ke([Number,String]),default:0},maxHeight:{type:Ke([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ke(Object)},teleported:ua.teleported}),v0e=Lt({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ks}}),ait=Lt({onKeydown:{type:Ke(Function)}}),cit=[zt.down,zt.pageDown,zt.home],b0e=[zt.up,zt.pageUp,zt.end],uit=[...cit,...b0e],{ElCollection:dit,ElCollectionItem:hit,COLLECTION_INJECTION_KEY:fit,COLLECTION_ITEM_INJECTION_KEY:git}=m0e("Dropdown"),M8=Symbol("elDropdown"),{ButtonGroup:pit}=_a,mit=$e({name:"ElDropdown",components:{ElButton:_a,ElButtonGroup:pit,ElScrollbar:a_,ElDropdownCollection:dit,ElTooltip:uc,ElRovingFocusGroup:lit,ElOnlyChild:qEe,ElIcon:tn,ArrowDown:Lb},props:NU,emits:["visible-change","click","command"],setup(n,{emit:e}){const t=Qn(),i=vt("dropdown"),{t:s}=wi(),o=te(),r=te(),a=te(null),c=te(null),u=te(null),d=te(null),f=te(!1),g=W(()=>({maxHeight:mr(n.maxHeight)})),p=W(()=>[i.m(L.value)]),_=W(()=>Gc(n.trigger)),v=Va().value,C=W(()=>n.id||v);ht([o,_],([K,re],[Z])=>{var J,ge,ve;(J=Z==null?void 0:Z.$el)!=null&&J.removeEventListener&&Z.$el.removeEventListener("pointerenter",A),(ge=K==null?void 0:K.$el)!=null&&ge.removeEventListener&&K.$el.removeEventListener("pointerenter",A),(ve=K==null?void 0:K.$el)!=null&&ve.addEventListener&&re.includes("hover")&&K.$el.addEventListener("pointerenter",A)},{immediate:!0}),As(()=>{var K,re;(re=(K=o.value)==null?void 0:K.$el)!=null&&re.removeEventListener&&o.value.$el.removeEventListener("pointerenter",A)});function y(){w()}function w(){var K;(K=a.value)==null||K.onClose()}function I(){var K;(K=a.value)==null||K.onOpen()}const L=jr();function O(...K){e("command",...K)}function A(){var K,re;(re=(K=o.value)==null?void 0:K.$el)==null||re.focus()}function N(){}function D(){const K=T(c);_.value.includes("hover")&&(K==null||K.focus()),d.value=null}function P(K){d.value=K}function F(K){f.value||(K.preventDefault(),K.stopImmediatePropagation())}function V(){e("visible-change",!0)}function U(K){(K==null?void 0:K.type)==="keydown"&&c.value.focus()}function Q(){e("visible-change",!1)}return pi(M8,{contentRef:c,role:W(()=>n.role),triggerId:C,isUsingKeyboard:f,onItemEnter:N,onItemLeave:D}),pi("elDropdown",{instance:t,dropdownSize:L,handleClick:y,commandHandler:O,trigger:ds(n,"trigger"),hideOnClick:ds(n,"hideOnClick")}),{t:s,ns:i,scrollbar:u,wrapStyle:g,dropdownTriggerKls:p,dropdownSize:L,triggerId:C,currentTabId:d,handleCurrentTabIdChange:P,handlerMainButtonClick:K=>{e("click",K)},handleEntryFocus:F,handleClose:w,handleOpen:I,handleBeforeShowTooltip:V,handleShowTooltip:U,handleBeforeHideTooltip:Q,onFocusAfterTrapped:K=>{var re,Z;K.preventDefault(),(Z=(re=c.value)==null?void 0:re.focus)==null||Z.call(re,{preventScroll:!0})},popperRef:a,contentRef:c,triggeringElementRef:o,referenceElementRef:r}}});function _it(n,e,t,i,s,o){var r;const a=Bt("el-dropdown-collection"),c=Bt("el-roving-focus-group"),u=Bt("el-scrollbar"),d=Bt("el-only-child"),f=Bt("el-tooltip"),g=Bt("el-button"),p=Bt("arrow-down"),_=Bt("el-icon"),v=Bt("el-button-group");return G(),he("div",{class:Y([n.ns.b(),n.ns.is("disabled",n.disabled)])},[ce(f,{ref:"popperRef",role:n.role,effect:n.effect,"fallback-placements":["bottom","top"],"popper-options":n.popperOptions,"gpu-acceleration":!1,"hide-after":n.trigger==="hover"?n.hideTimeout:0,"manual-mode":!0,placement:n.placement,"popper-class":[n.ns.e("popper"),n.popperClass],"reference-element":(r=n.referenceElementRef)==null?void 0:r.$el,trigger:n.trigger,"trigger-keys":n.triggerKeys,"trigger-target-el":n.contentRef,"show-after":n.trigger==="hover"?n.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":n.triggeringElementRef,"virtual-triggering":n.splitButton,disabled:n.disabled,transition:`${n.ns.namespace.value}-zoom-in-top`,teleported:n.teleported,pure:"",persistent:"",onBeforeShow:n.handleBeforeShowTooltip,onShow:n.handleShowTooltip,onBeforeHide:n.handleBeforeHideTooltip},Hf({content:_e(()=>[ce(u,{ref:"scrollbar","wrap-style":n.wrapStyle,tag:"div","view-class":n.ns.e("list")},{default:_e(()=>[ce(c,{loop:n.loop,"current-tab-id":n.currentTabId,orientation:"horizontal",onCurrentTabIdChange:n.handleCurrentTabIdChange,onEntryFocus:n.handleEntryFocus},{default:_e(()=>[ce(a,null,{default:_e(()=>[Ye(n.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[n.splitButton?void 0:{name:"default",fn:_e(()=>[ce(d,{id:n.triggerId,ref:"triggeringElementRef",role:"button",tabindex:n.tabindex},{default:_e(()=>[Ye(n.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","onBeforeShow","onShow","onBeforeHide"]),n.splitButton?(G(),nt(v,{key:0},{default:_e(()=>[ce(g,hi({ref:"referenceElementRef"},n.buttonProps,{size:n.dropdownSize,type:n.type,disabled:n.disabled,tabindex:n.tabindex,onClick:n.handlerMainButtonClick}),{default:_e(()=>[Ye(n.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),ce(g,hi({id:n.triggerId,ref:"triggeringElementRef"},n.buttonProps,{role:"button",size:n.dropdownSize,type:n.type,class:n.ns.e("caret-button"),disabled:n.disabled,tabindex:n.tabindex,"aria-label":n.t("el.dropdown.toggleDropdown")}),{default:_e(()=>[ce(_,{class:Y(n.ns.e("icon"))},{default:_e(()=>[ce(p)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):Qe("v-if",!0)],2)}var vit=Rt(mit,[["render",_it],["__file","dropdown.vue"]]);const bit=$e({components:{ElRovingFocusCollectionItem:Ynt},props:{focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!1}},emits:["mousedown","focus","keydown"],setup(n,{emit:e}){const{currentTabbedId:t,loop:i,onItemFocus:s,onItemShiftTab:o}=Kt(xte,void 0),{getItems:r}=Kt($te,void 0),a=Va(),c=te(null),u=pr(p=>{e("mousedown",p)},p=>{n.focusable?s(T(a)):p.preventDefault()}),d=pr(p=>{e("focus",p)},()=>{s(T(a))}),f=pr(p=>{e("keydown",p)},p=>{const{code:_,shiftKey:v,target:C,currentTarget:y}=p;if(_===zt.tab&&v){o();return}if(C!==y)return;const w=Znt(p);if(w){p.preventDefault();let L=r().filter(O=>O.focusable).map(O=>O.ref);switch(w){case"last":{L.reverse();break}case"prev":case"next":{w==="prev"&&L.reverse();const O=L.indexOf(y);L=i.value?eit(L,O+1):L.slice(O+1);break}}cn(()=>{Pte(L)})}}),g=W(()=>t.value===T(a));return pi(_0e,{rovingFocusGroupItemRef:c,tabIndex:W(()=>T(g)?0:-1),handleMousedown:u,handleFocus:d,handleKeydown:f}),{id:a,handleKeydown:f,handleFocus:d,handleMousedown:u}}});function Tit(n,e,t,i,s,o){const r=Bt("el-roving-focus-collection-item");return G(),nt(r,{id:n.id,focusable:n.focusable,active:n.active},{default:_e(()=>[Ye(n.$slots,"default")]),_:3},8,["id","focusable","active"])}var Cit=Rt(bit,[["render",Tit],["__file","roving-focus-item.vue"]]);const yit=$e({name:"DropdownItemImpl",components:{ElIcon:tn},props:v0e,emits:["pointermove","pointerleave","click","clickimpl"],setup(n,{emit:e}){const t=vt("dropdown"),{role:i}=Kt(M8,void 0),{collectionItemRef:s}=Kt(git,void 0),{collectionItemRef:o}=Kt(qnt,void 0),{rovingFocusGroupItemRef:r,tabIndex:a,handleFocus:c,handleKeydown:u,handleMousedown:d}=Kt(_0e,void 0),f=R8(s,o,r),g=W(()=>i.value==="menu"?"menuitem":i.value==="navigation"?"link":"button"),p=pr(_=>{if([zt.enter,zt.numpadEnter,zt.space].includes(_.code))return _.preventDefault(),_.stopImmediatePropagation(),e("clickimpl",_),!0},u);return{ns:t,itemRef:f,dataset:{[p0e]:""},role:g,tabIndex:a,handleFocus:c,handleKeydown:p,handleMousedown:d}}});function Eit(n,e,t,i,s,o){const r=Bt("el-icon");return G(),he(Qt,null,[n.divided?(G(),he("li",{key:0,role:"separator",class:Y(n.ns.bem("menu","item","divided"))},null,2)):Qe("v-if",!0),oe("li",hi({ref:n.itemRef},{...n.dataset,...n.$attrs},{"aria-disabled":n.disabled,class:[n.ns.be("menu","item"),n.ns.is("disabled",n.disabled)],tabindex:n.tabIndex,role:n.role,onClick:a=>n.$emit("clickimpl",a),onFocus:n.handleFocus,onKeydown:bn(n.handleKeydown,["self"]),onMousedown:n.handleMousedown,onPointermove:a=>n.$emit("pointermove",a),onPointerleave:a=>n.$emit("pointerleave",a)}),[n.icon?(G(),nt(r,{key:0},{default:_e(()=>[(G(),nt(ui(n.icon)))]),_:1})):Qe("v-if",!0),Ye(n.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}var Sit=Rt(yit,[["render",Eit],["__file","dropdown-item-impl.vue"]]);const T0e=()=>{const n=Kt("elDropdown",{}),e=W(()=>n==null?void 0:n.dropdownSize);return{elDropdown:n,_elDropdownSize:e}},wit=$e({name:"ElDropdownItem",components:{ElDropdownCollectionItem:hit,ElRovingFocusItem:Cit,ElDropdownItemImpl:Sit},inheritAttrs:!1,props:v0e,emits:["pointermove","pointerleave","click"],setup(n,{emit:e,attrs:t}){const{elDropdown:i}=T0e(),s=Qn(),o=te(null),r=W(()=>{var p,_;return(_=(p=T(o))==null?void 0:p.textContent)!=null?_:""}),{onItemEnter:a,onItemLeave:c}=Kt(M8,void 0),u=pr(p=>(e("pointermove",p),p.defaultPrevented),Nue(p=>{if(n.disabled){c(p);return}const _=p.currentTarget;_===document.activeElement||_.contains(document.activeElement)||(a(p),p.defaultPrevented||_==null||_.focus())})),d=pr(p=>(e("pointerleave",p),p.defaultPrevented),Nue(c)),f=pr(p=>{if(!n.disabled)return e("click",p),p.type!=="keydown"&&p.defaultPrevented},p=>{var _,v,C;if(n.disabled){p.stopImmediatePropagation();return}(_=i==null?void 0:i.hideOnClick)!=null&&_.value&&((v=i.handleClick)==null||v.call(i)),(C=i.commandHandler)==null||C.call(i,n.command,s,p)}),g=W(()=>({...n,...t}));return{handleClick:f,handlePointerMove:u,handlePointerLeave:d,textContent:r,propsAndAttrs:g}}});function Iit(n,e,t,i,s,o){var r;const a=Bt("el-dropdown-item-impl"),c=Bt("el-roving-focus-item"),u=Bt("el-dropdown-collection-item");return G(),nt(u,{disabled:n.disabled,"text-value":(r=n.textValue)!=null?r:n.textContent},{default:_e(()=>[ce(c,{focusable:!n.disabled},{default:_e(()=>[ce(a,hi(n.propsAndAttrs,{onPointerleave:n.handlePointerLeave,onPointermove:n.handlePointerMove,onClickimpl:n.handleClick}),{default:_e(()=>[Ye(n.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}var C0e=Rt(wit,[["render",Iit],["__file","dropdown-item.vue"]]);const Lit=$e({name:"ElDropdownMenu",props:ait,setup(n){const e=vt("dropdown"),{_elDropdownSize:t}=T0e(),i=t.value,{focusTrapRef:s,onKeydown:o}=Kt(cte,void 0),{contentRef:r,role:a,triggerId:c}=Kt(M8,void 0),{collectionRef:u,getItems:d}=Kt(fit,void 0),{rovingFocusGroupRef:f,rovingFocusGroupRootStyle:g,tabIndex:p,onBlur:_,onFocus:v,onMousedown:C}=Kt(xte,void 0),{collectionRef:y}=Kt($te,void 0),w=W(()=>[e.b("menu"),e.bm("menu",i==null?void 0:i.value)]),I=R8(r,u,s,f,y),L=pr(A=>{var N;(N=n.onKeydown)==null||N.call(n,A)},A=>{const{currentTarget:N,code:D,target:P}=A;if(N.contains(P),zt.tab===D&&A.stopImmediatePropagation(),A.preventDefault(),P!==T(r)||!uit.includes(D))return;const V=d().filter(U=>!U.disabled).map(U=>U.ref);b0e.includes(D)&&V.reverse(),Pte(V)});return{size:i,rovingFocusGroupRootStyle:g,tabIndex:p,dropdownKls:w,role:a,triggerId:c,dropdownListWrapperRef:I,handleKeydown:A=>{L(A),o(A)},onBlur:_,onFocus:v,onMousedown:C}}});function Oit(n,e,t,i,s,o){return G(),he("ul",{ref:n.dropdownListWrapperRef,class:Y(n.dropdownKls),style:on(n.rovingFocusGroupRootStyle),tabindex:-1,role:n.role,"aria-labelledby":n.triggerId,onBlur:n.onBlur,onFocus:n.onFocus,onKeydown:bn(n.handleKeydown,["self"]),onMousedown:bn(n.onMousedown,["self"])},[Ye(n.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}var y0e=Rt(Lit,[["render",Oit],["__file","dropdown-menu.vue"]]);const Rit=Nn(vit,{DropdownItem:C0e,DropdownMenu:y0e}),Mit=Xo(C0e),kit=Xo(y0e),Ait=$e({name:"ImgEmpty"}),Nit=$e({...Ait,setup(n){const e=vt("empty"),t=Va();return(i,s)=>(G(),he("svg",{viewBox:"0 0 79 86",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[oe("defs",null,[oe("linearGradient",{id:`linearGradient-1-${T(t)}`,x1:"38.8503086%",y1:"0%",x2:"61.1496914%",y2:"100%"},[oe("stop",{"stop-color":`var(${T(e).cssVarBlockName("fill-color-1")})`,offset:"0%"},null,8,["stop-color"]),oe("stop",{"stop-color":`var(${T(e).cssVarBlockName("fill-color-4")})`,offset:"100%"},null,8,["stop-color"])],8,["id"]),oe("linearGradient",{id:`linearGradient-2-${T(t)}`,x1:"0%",y1:"9.5%",x2:"100%",y2:"90.5%"},[oe("stop",{"stop-color":`var(${T(e).cssVarBlockName("fill-color-1")})`,offset:"0%"},null,8,["stop-color"]),oe("stop",{"stop-color":`var(${T(e).cssVarBlockName("fill-color-6")})`,offset:"100%"},null,8,["stop-color"])],8,["id"]),oe("rect",{id:`path-3-${T(t)}`,x:"0",y:"0",width:"17",height:"36"},null,8,["id"])]),oe("g",{id:"Illustrations",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[oe("g",{id:"B-type",transform:"translate(-1268.000000, -535.000000)"},[oe("g",{id:"Group-2",transform:"translate(1268.000000, 535.000000)"},[oe("path",{id:"Oval-Copy-2",d:"M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",fill:`var(${T(e).cssVarBlockName("fill-color-3")})`},null,8,["fill"]),oe("polygon",{id:"Rectangle-Copy-14",fill:`var(${T(e).cssVarBlockName("fill-color-7")})`,transform:"translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",points:"13 58 53 58 42 45 2 45"},null,8,["fill"]),oe("g",{id:"Group-Copy",transform:"translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"},[oe("polygon",{id:"Rectangle-Copy-10",fill:`var(${T(e).cssVarBlockName("fill-color-7")})`,transform:"translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",points:"2.84078316e-14 3 18 3 23 7 5 7"},null,8,["fill"]),oe("polygon",{id:"Rectangle-Copy-11",fill:`var(${T(e).cssVarBlockName("fill-color-5")})`,points:"-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"},null,8,["fill"]),oe("rect",{id:"Rectangle-Copy-12",fill:`url(#linearGradient-1-${T(t)})`,transform:"translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",x:"38",y:"7",width:"17",height:"36"},null,8,["fill"]),oe("polygon",{id:"Rectangle-Copy-13",fill:`var(${T(e).cssVarBlockName("fill-color-2")})`,transform:"translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",points:"24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"},null,8,["fill"])]),oe("rect",{id:"Rectangle-Copy-15",fill:`url(#linearGradient-2-${T(t)})`,x:"13",y:"45",width:"40",height:"36"},null,8,["fill"]),oe("g",{id:"Rectangle-Copy-17",transform:"translate(53.000000, 45.000000)"},[oe("use",{id:"Mask",fill:`var(${T(e).cssVarBlockName("fill-color-8")})`,transform:"translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ","xlink:href":`#path-3-${T(t)}`},null,8,["fill","xlink:href"]),oe("polygon",{id:"Rectangle-Copy",fill:`var(${T(e).cssVarBlockName("fill-color-9")})`,mask:`url(#mask-4-${T(t)})`,transform:"translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",points:"7 0 24 0 20 18 7 16.5"},null,8,["fill","mask"])]),oe("polygon",{id:"Rectangle-Copy-18",fill:`var(${T(e).cssVarBlockName("fill-color-2")})`,transform:"translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",points:"62 45 79 45 70 58 53 58"},null,8,["fill"])])])])]))}});var Dit=Rt(Nit,[["__file","img-empty.vue"]]);const $it=Lt({image:{type:String,default:""},imageSize:Number,description:{type:String,default:""}}),xit=$e({name:"ElEmpty"}),Pit=$e({...xit,props:$it,setup(n){const e=n,{t}=wi(),i=vt("empty"),s=W(()=>e.description||t("el.table.emptyText")),o=W(()=>({width:mr(e.imageSize)}));return(r,a)=>(G(),he("div",{class:Y(T(i).b())},[oe("div",{class:Y(T(i).e("image")),style:on(T(o))},[r.image?(G(),he("img",{key:0,src:r.image,ondragstart:"return false"},null,8,["src"])):Ye(r.$slots,"image",{key:1},()=>[ce(Dit)])],6),oe("div",{class:Y(T(i).e("description"))},[r.$slots.description?Ye(r.$slots,"description",{key:0}):(G(),he("p",{key:1},st(T(s)),1))],2),r.$slots.default?(G(),he("div",{key:0,class:Y(T(i).e("bottom"))},[Ye(r.$slots,"default")],2)):Qe("v-if",!0)],2))}});var Fit=Rt(Pit,[["__file","empty.vue"]]);const E0e=Nn(Fit),Bit=Lt({size:{type:String,values:l_},disabled:Boolean}),Hit=Lt({...Bit,model:Object,rules:{type:Ke(Object)},labelPosition:{type:String,values:["left","right","top"],default:"right"},requireAsteriskPosition:{type:String,values:["left","right"],default:"left"},labelWidth:{type:[String,Number],default:""},labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:Boolean,scrollToError:Boolean,scrollIntoViewOptions:{type:[Object,Boolean]}}),Vit={validate:(n,e,t)=>(yt(n)||sn(n))&&Us(e)&&sn(t)};function Uit(){const n=te([]),e=W(()=>{if(!n.value.length)return"0";const o=Math.max(...n.value);return o?`${o}px`:""});function t(o){const r=n.value.indexOf(o);return r===-1&&e.value,r}function i(o,r){if(o&&r){const a=t(r);n.value.splice(a,1,o)}else o&&n.value.push(o)}function s(o){const r=t(o);r>-1&&n.value.splice(r,1)}return{autoLabelWidth:e,registerLabelWidth:i,deregisterLabelWidth:s}}const AH=(n,e)=>{const t=Gc(e);return t.length>0?n.filter(i=>i.prop&&t.includes(i.prop)):n},Wit="ElForm",Git=$e({name:Wit}),zit=$e({...Git,props:Hit,emits:Vit,setup(n,{expose:e,emit:t}){const i=n,s=[],o=jr(),r=vt("form"),a=W(()=>{const{labelPosition:I,inline:L}=i;return[r.b(),r.m(o.value||"default"),{[r.m(`label-${I}`)]:I,[r.m("inline")]:L}]}),c=I=>s.find(L=>L.prop===I),u=I=>{s.push(I)},d=I=>{I.prop&&s.splice(s.indexOf(I),1)},f=(I=[])=>{i.model&&AH(s,I).forEach(L=>L.resetField())},g=(I=[])=>{AH(s,I).forEach(L=>L.clearValidate())},p=W(()=>!!i.model),_=I=>{if(s.length===0)return[];const L=AH(s,I);return L.length?L:[]},v=async I=>y(void 0,I),C=async(I=[])=>{if(!p.value)return!1;const L=_(I);if(L.length===0)return!0;let O={};for(const A of L)try{await A.validate("")}catch(N){O={...O,...N}}return Object.keys(O).length===0?!0:Promise.reject(O)},y=async(I=[],L)=>{const O=!ln(L);try{const A=await C(I);return A===!0&&await(L==null?void 0:L(A)),A}catch(A){if(A instanceof Error)throw A;const N=A;return i.scrollToError&&w(Object.keys(N)[0]),await(L==null?void 0:L(!1,N)),O&&Promise.reject(N)}},w=I=>{var L;const O=AH(s,I)[0];O&&((L=O.$el)==null||L.scrollIntoView(i.scrollIntoViewOptions))};return ht(()=>i.rules,()=>{i.validateOnRuleChange&&v().catch(I=>void 0)},{deep:!0}),pi(Dw,Ki({...Gl(i),emit:t,resetFields:f,clearValidate:g,validateField:y,getField:c,addField:u,removeField:d,...Uit()})),e({validate:v,validateField:y,resetFields:f,clearValidate:g,scrollToField:w,fields:s}),(I,L)=>(G(),he("form",{class:Y(T(a))},[Ye(I.$slots,"default")],2))}});var Kit=Rt(zit,[["__file","form.vue"]]);function WS(){return WS=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},WS.apply(this,arguments)}function jit(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,cx(n,e)}function xX(n){return xX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xX(n)}function cx(n,e){return cx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,s){return i.__proto__=s,i},cx(n,e)}function Xit(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function DU(n,e,t){return Xit()?DU=Reflect.construct.bind():DU=function(s,o,r){var a=[null];a.push.apply(a,o);var c=Function.bind.apply(s,a),u=new c;return r&&cx(u,r.prototype),u},DU.apply(null,arguments)}function Yit(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function PX(n){var e=typeof Map=="function"?new Map:void 0;return PX=function(i){if(i===null||!Yit(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,s)}function s(){return DU(i,arguments,xX(this).constructor)}return s.prototype=Object.create(i.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),cx(s,i)},PX(n)}var qit=/%[sdj%]/g,Jit=function(){};function FX(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var i=t.field;e[i]=e[i]||[],e[i].push(t)}),e}function hh(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var s=0,o=t.length;if(typeof n=="function")return n.apply(null,t);if(typeof n=="string"){var r=n.replace(qit,function(a){if(a==="%%")return"%";if(s>=o)return a;switch(a){case"%s":return String(t[s++]);case"%d":return Number(t[s++]);case"%j":try{return JSON.stringify(t[s++])}catch{return"[Circular]"}break;default:return a}});return r}return n}function Qit(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function Ca(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||Qit(e)&&typeof n=="string"&&!n)}function Zit(n,e,t){var i=[],s=0,o=n.length;function r(a){i.push.apply(i,a||[]),s++,s===o&&t(i)}n.forEach(function(a){e(a,r)})}function fde(n,e,t){var i=0,s=n.length;function o(r){if(r&&r.length){t(r);return}var a=i;i=i+1,a<s?e(n[a],o):t([])}o([])}function est(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,n[t]||[])}),e}var gde=function(n){jit(e,n);function e(t,i){var s;return s=n.call(this,"Async Validation Error")||this,s.errors=t,s.fields=i,s}return e}(PX(Error));function tst(n,e,t,i,s){if(e.first){var o=new Promise(function(g,p){var _=function(y){return i(y),y.length?p(new gde(y,FX(y))):g(s)},v=est(n);fde(v,t,_)});return o.catch(function(g){return g}),o}var r=e.firstFields===!0?Object.keys(n):e.firstFields||[],a=Object.keys(n),c=a.length,u=0,d=[],f=new Promise(function(g,p){var _=function(C){if(d.push.apply(d,C),u++,u===c)return i(d),d.length?p(new gde(d,FX(d))):g(s)};a.length||(i(d),g(s)),a.forEach(function(v){var C=n[v];r.indexOf(v)!==-1?fde(C,t,_):Zit(C,t,_)})});return f.catch(function(g){return g}),f}function nst(n){return!!(n&&n.message!==void 0)}function ist(n,e){for(var t=n,i=0;i<e.length;i++){if(t==null)return t;t=t[e[i]]}return t}function pde(n,e){return function(t){var i;return n.fullFields?i=ist(e,n.fullFields):i=e[t.field||n.fullField],nst(t)?(t.field=t.field||n.fullField,t.fieldValue=i,t):{message:typeof t=="function"?t():t,fieldValue:i,field:t.field||n.fullField}}}function mde(n,e){if(e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];typeof i=="object"&&typeof n[t]=="object"?n[t]=WS({},n[t],i):n[t]=i}}return n}var S0e=function(e,t,i,s,o,r){e.required&&(!i.hasOwnProperty(e.field)||Ca(t,r||e.type))&&s.push(hh(o.messages.required,e.fullField))},sst=function(e,t,i,s,o){(/^\s+$/.test(t)||t==="")&&s.push(hh(o.messages.whitespace,e.fullField))},NH,ost=function(){if(NH)return NH;var n="[a-fA-F\\d:]",e=function(L){return L&&L.includeBoundaries?"(?:(?<=\\s|^)(?="+n+")|(?<="+n+")(?=\\s|$))":""},t="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",s=(`
- (?:
- (?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
- (?:`+i+":){6}(?:"+t+"|:"+i+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
- (?:`+i+":){5}(?::"+t+"|(?::"+i+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
- (?:`+i+":){4}(?:(?::"+i+"){0,1}:"+t+"|(?::"+i+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
- (?:`+i+":){3}(?:(?::"+i+"){0,2}:"+t+"|(?::"+i+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
- (?:`+i+":){2}(?:(?::"+i+"){0,3}:"+t+"|(?::"+i+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
- (?:`+i+":){1}(?:(?::"+i+"){0,4}:"+t+"|(?::"+i+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
- (?::(?:(?::`+i+"){0,5}:"+t+"|(?::"+i+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
- )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
- `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+s+"$)"),r=new RegExp("^"+t+"$"),a=new RegExp("^"+s+"$"),c=function(L){return L&&L.exact?o:new RegExp("(?:"+e(L)+t+e(L)+")|(?:"+e(L)+s+e(L)+")","g")};c.v4=function(I){return I&&I.exact?r:new RegExp(""+e(I)+t+e(I),"g")},c.v6=function(I){return I&&I.exact?a:new RegExp(""+e(I)+s+e(I),"g")};var u="(?:(?:[a-z]+:)?//)",d="(?:\\S+(?::\\S*)?@)?",f=c.v4().source,g=c.v6().source,p="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",_="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",v="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",C="(?::\\d{2,5})?",y='(?:[/?#][^\\s"]*)?',w="(?:"+u+"|www\\.)"+d+"(?:localhost|"+f+"|"+g+"|"+p+_+v+")"+C+y;return NH=new RegExp("(?:^"+w+"$)","i"),NH},_de={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},oD={integer:function(e){return oD.number(e)&&parseInt(e,10)===e},float:function(e){return oD.number(e)&&!oD.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!oD.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(_de.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(ost())},hex:function(e){return typeof e=="string"&&!!e.match(_de.hex)}},rst=function(e,t,i,s,o){if(e.required&&t===void 0){S0e(e,t,i,s,o);return}var r=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;r.indexOf(a)>-1?oD[a](t)||s.push(hh(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&s.push(hh(o.messages.types[a],e.fullField,e.type))},lst=function(e,t,i,s,o){var r=typeof e.len=="number",a=typeof e.min=="number",c=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=t,f=null,g=typeof t=="number",p=typeof t=="string",_=Array.isArray(t);if(g?f="number":p?f="string":_&&(f="array"),!f)return!1;_&&(d=t.length),p&&(d=t.replace(u,"_").length),r?d!==e.len&&s.push(hh(o.messages[f].len,e.fullField,e.len)):a&&!c&&d<e.min?s.push(hh(o.messages[f].min,e.fullField,e.min)):c&&!a&&d>e.max?s.push(hh(o.messages[f].max,e.fullField,e.max)):a&&c&&(d<e.min||d>e.max)&&s.push(hh(o.messages[f].range,e.fullField,e.min,e.max))},XL="enum",ast=function(e,t,i,s,o){e[XL]=Array.isArray(e[XL])?e[XL]:[],e[XL].indexOf(t)===-1&&s.push(hh(o.messages[XL],e.fullField,e[XL].join(", ")))},cst=function(e,t,i,s,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||s.push(hh(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var r=new RegExp(e.pattern);r.test(t)||s.push(hh(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},Ws={required:S0e,whitespace:sst,type:rst,range:lst,enum:ast,pattern:cst},ust=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t,"string")&&!e.required)return i();Ws.required(e,t,s,r,o,"string"),Ca(t,"string")||(Ws.type(e,t,s,r,o),Ws.range(e,t,s,r,o),Ws.pattern(e,t,s,r,o),e.whitespace===!0&&Ws.whitespace(e,t,s,r,o))}i(r)},dst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&Ws.type(e,t,s,r,o)}i(r)},hst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&(Ws.type(e,t,s,r,o),Ws.range(e,t,s,r,o))}i(r)},fst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&Ws.type(e,t,s,r,o)}i(r)},gst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),Ca(t)||Ws.type(e,t,s,r,o)}i(r)},pst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&(Ws.type(e,t,s,r,o),Ws.range(e,t,s,r,o))}i(r)},mst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&(Ws.type(e,t,s,r,o),Ws.range(e,t,s,r,o))}i(r)},_st=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return i();Ws.required(e,t,s,r,o,"array"),t!=null&&(Ws.type(e,t,s,r,o),Ws.range(e,t,s,r,o))}i(r)},vst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&Ws.type(e,t,s,r,o)}i(r)},bst="enum",Tst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o),t!==void 0&&Ws[bst](e,t,s,r,o)}i(r)},Cst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t,"string")&&!e.required)return i();Ws.required(e,t,s,r,o),Ca(t,"string")||Ws.pattern(e,t,s,r,o)}i(r)},yst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t,"date")&&!e.required)return i();if(Ws.required(e,t,s,r,o),!Ca(t,"date")){var c;t instanceof Date?c=t:c=new Date(t),Ws.type(e,c,s,r,o),c&&Ws.range(e,c.getTime(),s,r,o)}}i(r)},Est=function(e,t,i,s,o){var r=[],a=Array.isArray(t)?"array":typeof t;Ws.required(e,t,s,r,o,a),i(r)},l9=function(e,t,i,s,o){var r=e.type,a=[],c=e.required||!e.required&&s.hasOwnProperty(e.field);if(c){if(Ca(t,r)&&!e.required)return i();Ws.required(e,t,s,a,o,r),Ca(t,r)||Ws.type(e,t,s,a,o)}i(a)},Sst=function(e,t,i,s,o){var r=[],a=e.required||!e.required&&s.hasOwnProperty(e.field);if(a){if(Ca(t)&&!e.required)return i();Ws.required(e,t,s,r,o)}i(r)},HD={string:ust,method:dst,number:hst,boolean:fst,regexp:gst,integer:pst,float:mst,array:_st,object:vst,enum:Tst,pattern:Cst,date:yst,url:l9,hex:l9,email:l9,required:Est,any:Sst};function BX(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var HX=BX(),uF=function(){function n(t){this.rules=null,this._messages=HX,this.define(t)}var e=n.prototype;return e.define=function(i){var s=this;if(!i)throw new Error("Cannot configure a schema with no rules");if(typeof i!="object"||Array.isArray(i))throw new Error("Rules must be an object");this.rules={},Object.keys(i).forEach(function(o){var r=i[o];s.rules[o]=Array.isArray(r)?r:[r]})},e.messages=function(i){return i&&(this._messages=mde(BX(),i)),this._messages},e.validate=function(i,s,o){var r=this;s===void 0&&(s={}),o===void 0&&(o=function(){});var a=i,c=s,u=o;if(typeof c=="function"&&(u=c,c={}),!this.rules||Object.keys(this.rules).length===0)return u&&u(null,a),Promise.resolve(a);function d(v){var C=[],y={};function w(L){if(Array.isArray(L)){var O;C=(O=C).concat.apply(O,L)}else C.push(L)}for(var I=0;I<v.length;I++)w(v[I]);C.length?(y=FX(C),u(C,y)):u(null,a)}if(c.messages){var f=this.messages();f===HX&&(f=BX()),mde(f,c.messages),c.messages=f}else c.messages=this.messages();var g={},p=c.keys||Object.keys(this.rules);p.forEach(function(v){var C=r.rules[v],y=a[v];C.forEach(function(w){var I=w;typeof I.transform=="function"&&(a===i&&(a=WS({},a)),y=a[v]=I.transform(y)),typeof I=="function"?I={validator:I}:I=WS({},I),I.validator=r.getValidationMethod(I),I.validator&&(I.field=v,I.fullField=I.fullField||v,I.type=r.getType(I),g[v]=g[v]||[],g[v].push({rule:I,value:y,source:a,field:v}))})});var _={};return tst(g,c,function(v,C){var y=v.rule,w=(y.type==="object"||y.type==="array")&&(typeof y.fields=="object"||typeof y.defaultField=="object");w=w&&(y.required||!y.required&&v.value),y.field=v.field;function I(A,N){return WS({},N,{fullField:y.fullField+"."+A,fullFields:y.fullFields?[].concat(y.fullFields,[A]):[A]})}function L(A){A===void 0&&(A=[]);var N=Array.isArray(A)?A:[A];!c.suppressWarning&&N.length&&n.warning("async-validator:",N),N.length&&y.message!==void 0&&(N=[].concat(y.message));var D=N.map(pde(y,a));if(c.first&&D.length)return _[y.field]=1,C(D);if(!w)C(D);else{if(y.required&&!v.value)return y.message!==void 0?D=[].concat(y.message).map(pde(y,a)):c.error&&(D=[c.error(y,hh(c.messages.required,y.field))]),C(D);var P={};y.defaultField&&Object.keys(v.value).map(function(U){P[U]=y.defaultField}),P=WS({},P,v.rule.fields);var F={};Object.keys(P).forEach(function(U){var Q=P[U],de=Array.isArray(Q)?Q:[Q];F[U]=de.map(I.bind(null,U))});var V=new n(F);V.messages(c.messages),v.rule.options&&(v.rule.options.messages=c.messages,v.rule.options.error=c.error),V.validate(v.value,v.rule.options||c,function(U){var Q=[];D&&D.length&&Q.push.apply(Q,D),U&&U.length&&Q.push.apply(Q,U),C(Q.length?Q:null)})}}var O;if(y.asyncValidator)O=y.asyncValidator(y,v.value,L,v.source,c);else if(y.validator){try{O=y.validator(y,v.value,L,v.source,c)}catch(A){console.error==null||console.error(A),c.suppressValidatorError||setTimeout(function(){throw A},0),L(A.message)}O===!0?L():O===!1?L(typeof y.message=="function"?y.message(y.fullField||y.field):y.message||(y.fullField||y.field)+" fails"):O instanceof Array?L(O):O instanceof Error&&L(O.message)}O&&O.then&&O.then(function(){return L()},function(A){return L(A)})},function(v){d(v)},a)},e.getType=function(i){if(i.type===void 0&&i.pattern instanceof RegExp&&(i.type="pattern"),typeof i.validator!="function"&&i.type&&!HD.hasOwnProperty(i.type))throw new Error(hh("Unknown rule type %s",i.type));return i.type||"string"},e.getValidationMethod=function(i){if(typeof i.validator=="function")return i.validator;var s=Object.keys(i),o=s.indexOf("message");return o!==-1&&s.splice(o,1),s.length===1&&s[0]==="required"?HD.required:HD[this.getType(i)]||void 0},n}();uF.register=function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");HD[e]=t};uF.warning=Jit;uF.messages=HX;uF.validators=HD;const wst=["","error","validating","success"],Ist=Lt({label:String,labelWidth:{type:[String,Number],default:""},labelPosition:{type:String,values:["left","right","top",""],default:""},prop:{type:Ke([String,Array])},required:{type:Boolean,default:void 0},rules:{type:Ke([Object,Array])},error:String,validateStatus:{type:String,values:wst},for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:{type:String,values:l_}}),vde="ElLabelWrap";var Lst=$e({name:vde,props:{isAutoWidth:Boolean,updateAll:Boolean},setup(n,{slots:e}){const t=Kt(Dw,void 0),i=Kt(zm);i||Ll(vde,"usage: <el-form-item><label-wrap /></el-form-item>");const s=vt("form"),o=te(),r=te(0),a=()=>{var d;if((d=o.value)!=null&&d.firstElementChild){const f=window.getComputedStyle(o.value.firstElementChild).width;return Math.ceil(Number.parseFloat(f))}else return 0},c=(d="update")=>{cn(()=>{e.default&&n.isAutoWidth&&(d==="update"?r.value=a():d==="remove"&&(t==null||t.deregisterLabelWidth(r.value)))})},u=()=>c("update");return $n(()=>{u()}),As(()=>{c("remove")}),s_(()=>u()),ht(r,(d,f)=>{n.updateAll&&(t==null||t.registerLabelWidth(d,f))}),wo(W(()=>{var d,f;return(f=(d=o.value)==null?void 0:d.firstElementChild)!=null?f:null}),u),()=>{var d,f;if(!e)return null;const{isAutoWidth:g}=n;if(g){const p=t==null?void 0:t.autoLabelWidth,_=i==null?void 0:i.hasLabel,v={};if(_&&p&&p!=="auto"){const C=Math.max(0,Number.parseInt(p,10)-r.value),w=(i.labelPosition||t.labelPosition)==="left"?"marginRight":"marginLeft";C&&(v[w]=`${C}px`)}return ce("div",{ref:o,class:[s.be("item","label-wrap")],style:v},[(d=e.default)==null?void 0:d.call(e)])}else return ce(Qt,{ref:o},[(f=e.default)==null?void 0:f.call(e)])}}});const Ost=$e({name:"ElFormItem"}),Rst=$e({...Ost,props:Ist,setup(n,{expose:e}){const t=n,i=dl(),s=Kt(Dw,void 0),o=Kt(zm,void 0),r=jr(void 0,{formItem:!1}),a=vt("form-item"),c=Va().value,u=te([]),d=te(""),f=S7e(d,100),g=te(""),p=te();let _,v=!1;const C=W(()=>t.labelPosition||(s==null?void 0:s.labelPosition)),y=W(()=>{if(C.value==="top")return{};const Ve=mr(t.labelWidth||(s==null?void 0:s.labelWidth)||"");return Ve?{width:Ve}:{}}),w=W(()=>{if(C.value==="top"||s!=null&&s.inline)return{};if(!t.label&&!t.labelWidth&&F)return{};const Ve=mr(t.labelWidth||(s==null?void 0:s.labelWidth)||"");return!t.label&&!i.label?{marginLeft:Ve}:{}}),I=W(()=>[a.b(),a.m(r.value),a.is("error",d.value==="error"),a.is("validating",d.value==="validating"),a.is("success",d.value==="success"),a.is("required",q.value||t.required),a.is("no-asterisk",s==null?void 0:s.hideRequiredAsterisk),(s==null?void 0:s.requireAsteriskPosition)==="right"?"asterisk-right":"asterisk-left",{[a.m("feedback")]:s==null?void 0:s.statusIcon,[a.m(`label-${C.value}`)]:C.value}]),L=W(()=>Us(t.inlineMessage)?t.inlineMessage:(s==null?void 0:s.inlineMessage)||!1),O=W(()=>[a.e("error"),{[a.em("error","inline")]:L.value}]),A=W(()=>t.prop?sn(t.prop)?t.prop:t.prop.join("."):""),N=W(()=>!!(t.label||i.label)),D=W(()=>t.for||(u.value.length===1?u.value[0]:void 0)),P=W(()=>!D.value&&N.value),F=!!o,V=W(()=>{const Ve=s==null?void 0:s.model;if(!(!Ve||!t.prop))return bU(Ve,t.prop).value}),U=W(()=>{const{required:Ve}=t,Ge=[];t.rules&&Ge.push(...Gc(t.rules));const dt=s==null?void 0:s.rules;if(dt&&t.prop){const ze=bU(dt,t.prop).value;ze&&Ge.push(...Gc(ze))}if(Ve!==void 0){const ze=Ge.map((ee,ye)=>[ee,ye]).filter(([ee])=>Object.keys(ee).includes("required"));if(ze.length>0)for(const[ee,ye]of ze)ee.required!==Ve&&(Ge[ye]={...ee,required:Ve});else Ge.push({required:Ve})}return Ge}),Q=W(()=>U.value.length>0),de=Ve=>U.value.filter(dt=>!dt.trigger||!Ve?!0:yt(dt.trigger)?dt.trigger.includes(Ve):dt.trigger===Ve).map(({trigger:dt,...ze})=>ze),q=W(()=>U.value.some(Ve=>Ve.required)),K=W(()=>{var Ve;return f.value==="error"&&t.showMessage&&((Ve=s==null?void 0:s.showMessage)!=null?Ve:!0)}),re=W(()=>`${t.label||""}${(s==null?void 0:s.labelSuffix)||""}`),Z=Ve=>{d.value=Ve},J=Ve=>{var Ge,dt;const{errors:ze,fields:ee}=Ve;(!ze||!ee)&&console.error(Ve),Z("error"),g.value=ze?(dt=(Ge=ze==null?void 0:ze[0])==null?void 0:Ge.message)!=null?dt:`${t.prop} is required`:"",s==null||s.emit("validate",t.prop,!1,g.value)},ge=()=>{Z("success"),s==null||s.emit("validate",t.prop,!0,"")},ve=async Ve=>{const Ge=A.value;return new uF({[Ge]:Ve}).validate({[Ge]:V.value},{firstFields:!0}).then(()=>(ge(),!0)).catch(ze=>(J(ze),Promise.reject(ze)))},Le=async(Ve,Ge)=>{if(v||!t.prop)return!1;const dt=ln(Ge);if(!Q.value)return Ge==null||Ge(!1),!1;const ze=de(Ve);return ze.length===0?(Ge==null||Ge(!0),!0):(Z("validating"),ve(ze).then(()=>(Ge==null||Ge(!0),!0)).catch(ee=>{const{fields:ye}=ee;return Ge==null||Ge(!1,ye),dt?!1:Promise.reject(ye)}))},Ee=()=>{Z(""),g.value="",v=!1},Ne=async()=>{const Ve=s==null?void 0:s.model;if(!Ve||!t.prop)return;const Ge=bU(Ve,t.prop);v=!0,Ge.value=Vce(_),await cn(),Ee(),v=!1},qe=Ve=>{u.value.includes(Ve)||u.value.push(Ve)},Re=Ve=>{u.value=u.value.filter(Ge=>Ge!==Ve)};ht(()=>t.error,Ve=>{g.value=Ve||"",Z(Ve?"error":"")},{immediate:!0}),ht(()=>t.validateStatus,Ve=>Z(Ve||""));const we=Ki({...Gl(t),$el:p,size:r,validateState:d,labelId:c,inputIds:u,isGroup:P,hasLabel:N,fieldValue:V,addInputId:qe,removeInputId:Re,resetField:Ne,clearValidate:Ee,validate:Le});return pi(zm,we),$n(()=>{t.prop&&(s==null||s.addField(we),_=Vce(V.value))}),As(()=>{s==null||s.removeField(we)}),e({size:r,validateMessage:g,validateState:d,validate:Le,clearValidate:Ee,resetField:Ne}),(Ve,Ge)=>{var dt;return G(),he("div",{ref_key:"formItemRef",ref:p,class:Y(T(I)),role:T(P)?"group":void 0,"aria-labelledby":T(P)?T(c):void 0},[ce(T(Lst),{"is-auto-width":T(y).width==="auto","update-all":((dt=T(s))==null?void 0:dt.labelWidth)==="auto"},{default:_e(()=>[T(N)?(G(),nt(ui(T(D)?"label":"div"),{key:0,id:T(c),for:T(D),class:Y(T(a).e("label")),style:on(T(y))},{default:_e(()=>[Ye(Ve.$slots,"label",{label:T(re)},()=>[mn(st(T(re)),1)])]),_:3},8,["id","for","class","style"])):Qe("v-if",!0)]),_:3},8,["is-auto-width","update-all"]),oe("div",{class:Y(T(a).e("content")),style:on(T(w))},[Ye(Ve.$slots,"default"),ce(Nve,{name:`${T(a).namespace.value}-zoom-in-top`},{default:_e(()=>[T(K)?Ye(Ve.$slots,"error",{key:0,error:g.value},()=>[oe("div",{class:Y(T(O))},st(g.value),3)]):Qe("v-if",!0)]),_:3},8,["name"])],6)],10,["role","aria-labelledby"])}}});var w0e=Rt(Rst,[["__file","form-item.vue"]]);const Mst=Nn(Kit,{FormItem:w0e}),kst=Xo(w0e),Ast=Lt({urlList:{type:Ke(Array),default:()=>Ko([])},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:Boolean,teleported:Boolean,closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},crossorigin:{type:Ke(String)}}),Nst={close:()=>!0,switch:n=>gn(n),rotate:n=>gn(n)},Dst=$e({name:"ElImageViewer"}),$st=$e({...Dst,props:Ast,emits:Nst,setup(n,{expose:e,emit:t}){var i;const s=n,o={CONTAIN:{name:"contain",icon:Nm(WKe)},ORIGINAL:{name:"original",icon:Nm(cje)}},{t:r}=wi(),a=vt("image-viewer"),{nextZIndex:c}=sM(),u=te(),d=te([]),f=I5(),g=te(!0),p=te(s.initialIndex),_=us(o.CONTAIN),v=te({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),C=te((i=s.zIndex)!=null?i:c()),y=W(()=>{const{urlList:Le}=s;return Le.length<=1}),w=W(()=>p.value===0),I=W(()=>p.value===s.urlList.length-1),L=W(()=>s.urlList[p.value]),O=W(()=>[a.e("btn"),a.e("prev"),a.is("disabled",!s.infinite&&w.value)]),A=W(()=>[a.e("btn"),a.e("next"),a.is("disabled",!s.infinite&&I.value)]),N=W(()=>{const{scale:Le,deg:Ee,offsetX:Ne,offsetY:qe,enableTransition:Re}=v.value;let we=Ne/Le,Ve=qe/Le;const Ge=Ee*Math.PI/180,dt=Math.cos(Ge),ze=Math.sin(Ge);we=we*dt+Ve*ze,Ve=Ve*dt-Ne/Le*ze;const ee={transform:`scale(${Le}) rotate(${Ee}deg) translate(${we}px, ${Ve}px)`,transition:Re?"transform .3s":""};return _.value.name===o.CONTAIN.name&&(ee.maxWidth=ee.maxHeight="100%"),ee});function D(){F(),t("close")}function P(){const Le=l0(Ne=>{switch(Ne.code){case zt.esc:s.closeOnPressEscape&&D();break;case zt.space:q();break;case zt.left:re();break;case zt.up:J("zoomIn");break;case zt.right:Z();break;case zt.down:J("zoomOut");break}}),Ee=l0(Ne=>{const qe=Ne.deltaY||Ne.deltaX;J(qe<0?"zoomIn":"zoomOut",{zoomRate:s.zoomRate,enableTransition:!1})});f.run(()=>{Es(document,"keydown",Le),Es(document,"wheel",Ee)})}function F(){f.stop()}function V(){g.value=!1}function U(Le){g.value=!1,Le.target.alt=r("el.image.error")}function Q(Le){if(g.value||Le.button!==0||!u.value)return;v.value.enableTransition=!1;const{offsetX:Ee,offsetY:Ne}=v.value,qe=Le.pageX,Re=Le.pageY,we=l0(Ge=>{v.value={...v.value,offsetX:Ee+Ge.pageX-qe,offsetY:Ne+Ge.pageY-Re}}),Ve=Es(document,"mousemove",we);Es(document,"mouseup",()=>{Ve()}),Le.preventDefault()}function de(){v.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function q(){if(g.value)return;const Le=YO(o),Ee=Object.values(o),Ne=_.value.name,Re=(Ee.findIndex(we=>we.name===Ne)+1)%Le.length;_.value=o[Le[Re]],de()}function K(Le){const Ee=s.urlList.length;p.value=(Le+Ee)%Ee}function re(){w.value&&!s.infinite||K(p.value-1)}function Z(){I.value&&!s.infinite||K(p.value+1)}function J(Le,Ee={}){if(g.value)return;const{minScale:Ne,maxScale:qe}=s,{zoomRate:Re,rotateDeg:we,enableTransition:Ve}={zoomRate:s.zoomRate,rotateDeg:90,enableTransition:!0,...Ee};switch(Le){case"zoomOut":v.value.scale>Ne&&(v.value.scale=Number.parseFloat((v.value.scale/Re).toFixed(3)));break;case"zoomIn":v.value.scale<qe&&(v.value.scale=Number.parseFloat((v.value.scale*Re).toFixed(3)));break;case"clockwise":v.value.deg+=we,t("rotate",v.value.deg);break;case"anticlockwise":v.value.deg-=we,t("rotate",v.value.deg);break}v.value.enableTransition=Ve}function ge(Le){var Ee;((Ee=Le.detail)==null?void 0:Ee.focusReason)==="pointer"&&Le.preventDefault()}function ve(){s.closeOnPressEscape&&D()}return ht(L,()=>{cn(()=>{const Le=d.value[0];Le!=null&&Le.complete||(g.value=!0)})}),ht(p,Le=>{de(),t("switch",Le)}),$n(()=>{P()}),e({setActiveItem:K}),(Le,Ee)=>(G(),nt(T(lM),{to:"body",disabled:!Le.teleported},{default:_e(()=>[ce(Ta,{name:"viewer-fade",appear:""},{default:_e(()=>[oe("div",{ref_key:"wrapper",ref:u,tabindex:-1,class:Y(T(a).e("wrapper")),style:on({zIndex:C.value})},[ce(T(rM),{loop:"",trapped:"","focus-trap-el":u.value,"focus-start-el":"container",onFocusoutPrevented:ge,onReleaseRequested:ve},{default:_e(()=>[oe("div",{class:Y(T(a).e("mask")),onClick:bn(Ne=>Le.hideOnClickModal&&D(),["self"])},null,10,["onClick"]),Qe(" CLOSE "),oe("span",{class:Y([T(a).e("btn"),T(a).e("close")]),onClick:D},[ce(T(tn),null,{default:_e(()=>[ce(T(Zg))]),_:1})],2),Qe(" ARROW "),T(y)?Qe("v-if",!0):(G(),he(Qt,{key:0},[oe("span",{class:Y(T(O)),onClick:re},[ce(T(tn),null,{default:_e(()=>[ce(T(ZC))]),_:1})],2),oe("span",{class:Y(T(A)),onClick:Z},[ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})],2)],64)),Qe(" ACTIONS "),oe("div",{class:Y([T(a).e("btn"),T(a).e("actions")])},[oe("div",{class:Y(T(a).e("actions__inner"))},[ce(T(tn),{onClick:Ne=>J("zoomOut")},{default:_e(()=>[ce(T(wje))]),_:1},8,["onClick"]),ce(T(tn),{onClick:Ne=>J("zoomIn")},{default:_e(()=>[ce(T(HEe))]),_:1},8,["onClick"]),oe("i",{class:Y(T(a).e("actions__divider"))},null,2),ce(T(tn),{onClick:q},{default:_e(()=>[(G(),nt(ui(T(_).icon)))]),_:1}),oe("i",{class:Y(T(a).e("actions__divider"))},null,2),ce(T(tn),{onClick:Ne=>J("anticlockwise")},{default:_e(()=>[ce(T(oje))]),_:1},8,["onClick"]),ce(T(tn),{onClick:Ne=>J("clockwise")},{default:_e(()=>[ce(T(lje))]),_:1},8,["onClick"])],2)],2),Qe(" CANVAS "),oe("div",{class:Y(T(a).e("canvas"))},[(G(!0),he(Qt,null,fi(Le.urlList,(Ne,qe)=>Un((G(),he("img",{ref_for:!0,ref:Re=>d.value[qe]=Re,key:Ne,src:Ne,style:on(T(N)),class:Y(T(a).e("img")),crossorigin:Le.crossorigin,onLoad:V,onError:U,onMousedown:Q},null,46,["src","crossorigin"])),[[Gi,qe===p.value]])),128))],2),Ye(Le.$slots,"default")]),_:3},8,["focus-trap-el"])],6)]),_:3})]),_:3},8,["disabled"]))}});var xst=Rt($st,[["__file","image-viewer.vue"]]);const I0e=Nn(xst),Pst=Lt({hideOnClickModal:Boolean,src:{type:String,default:""},fit:{type:String,values:["","contain","cover","fill","none","scale-down"],default:""},loading:{type:String,values:["eager","lazy"]},lazy:Boolean,scrollContainer:{type:Ke([String,Object])},previewSrcList:{type:Ke(Array),default:()=>Ko([])},previewTeleported:Boolean,zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},crossorigin:{type:Ke(String)}}),Fst={load:n=>n instanceof Event,error:n=>n instanceof Event,switch:n=>gn(n),close:()=>!0,show:()=>!0},Bst=$e({name:"ElImage",inheritAttrs:!1}),Hst=$e({...Bst,props:Pst,emits:Fst,setup(n,{emit:e}){const t=n;let i="";const{t:s}=wi(),o=vt("image"),r=Ly(),a=W(()=>ix(Object.entries(r).filter(([Z])=>/^(data-|on[A-Z])/i.test(Z)||["id","style"].includes(Z)))),c=rF({excludeListeners:!0,excludeKeys:W(()=>Object.keys(a.value))}),u=te(),d=te(!1),f=te(!0),g=te(!1),p=te(),_=te(),v=Si&&"loading"in HTMLImageElement.prototype;let C,y;const w=W(()=>[o.e("inner"),L.value&&o.e("preview"),f.value&&o.is("loading")]),I=W(()=>{const{fit:Z}=t;return Si&&Z?{objectFit:Z}:{}}),L=W(()=>{const{previewSrcList:Z}=t;return yt(Z)&&Z.length>0}),O=W(()=>{const{previewSrcList:Z,initialIndex:J}=t;let ge=J;return J>Z.length-1&&(ge=0),ge}),A=W(()=>t.loading==="eager"?!1:!v&&t.loading==="lazy"||t.lazy),N=()=>{Si&&(f.value=!0,d.value=!1,u.value=t.src)};function D(Z){f.value=!1,d.value=!1,e("load",Z)}function P(Z){f.value=!1,d.value=!0,e("error",Z)}function F(){zZe(p.value,_.value)&&(N(),Q())}const V=bEe(F,200,!0);async function U(){var Z;if(!Si)return;await cn();const{scrollContainer:J}=t;mh(J)?_.value=J:sn(J)&&J!==""?_.value=(Z=document.querySelector(J))!=null?Z:void 0:p.value&&(_.value=Jee(p.value)),_.value&&(C=Es(_,"scroll",V),setTimeout(()=>F(),100))}function Q(){!Si||!_.value||!V||(C==null||C(),_.value=void 0)}function de(Z){if(Z.ctrlKey){if(Z.deltaY<0)return Z.preventDefault(),!1;if(Z.deltaY>0)return Z.preventDefault(),!1}}function q(){L.value&&(y=Es("wheel",de,{passive:!1}),i=document.body.style.overflow,document.body.style.overflow="hidden",g.value=!0,e("show"))}function K(){y==null||y(),document.body.style.overflow=i,g.value=!1,e("close")}function re(Z){e("switch",Z)}return ht(()=>t.src,()=>{A.value?(f.value=!0,d.value=!1,Q(),U()):N()}),$n(()=>{A.value?U():N()}),(Z,J)=>(G(),he("div",hi({ref_key:"container",ref:p},T(a),{class:[T(o).b(),Z.$attrs.class]}),[d.value?Ye(Z.$slots,"error",{key:0},()=>[oe("div",{class:Y(T(o).e("error"))},st(T(s)("el.image.error")),3)]):(G(),he(Qt,{key:1},[u.value!==void 0?(G(),he("img",hi({key:0},T(c),{src:u.value,loading:Z.loading,style:T(I),class:T(w),crossorigin:Z.crossorigin,onClick:q,onLoad:D,onError:P}),null,16,["src","loading","crossorigin"])):Qe("v-if",!0),f.value?(G(),he("div",{key:1,class:Y(T(o).e("wrapper"))},[Ye(Z.$slots,"placeholder",{},()=>[oe("div",{class:Y(T(o).e("placeholder"))},null,2)])],2)):Qe("v-if",!0)],64)),T(L)?(G(),he(Qt,{key:2},[g.value?(G(),nt(T(I0e),{key:0,"z-index":Z.zIndex,"initial-index":T(O),infinite:Z.infinite,"zoom-rate":Z.zoomRate,"min-scale":Z.minScale,"max-scale":Z.maxScale,"url-list":Z.previewSrcList,crossorigin:Z.crossorigin,"hide-on-click-modal":Z.hideOnClickModal,teleported:Z.previewTeleported,"close-on-press-escape":Z.closeOnPressEscape,onClose:K,onSwitch:re},{default:_e(()=>[Z.$slots.viewer?(G(),he("div",{key:0},[Ye(Z.$slots,"viewer")])):Qe("v-if",!0)]),_:3},8,["z-index","initial-index","infinite","zoom-rate","min-scale","max-scale","url-list","crossorigin","hide-on-click-modal","teleported","close-on-press-escape"])):Qe("v-if",!0)],64)):Qe("v-if",!0)],16))}});var Vst=Rt(Hst,[["__file","image.vue"]]);const Ust=Nn(Vst),Wst=Lt({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:cl,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||gn(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Wa(["ariaLabel"])}),Gst={[Ms]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[rc]:n=>gn(n)||Ul(n),[Kn]:n=>gn(n)||Ul(n)},zst=$e({name:"ElInputNumber"}),Kst=$e({...zst,props:Wst,emits:Gst,setup(n,{expose:e,emit:t}){const i=n,{t:s}=wi(),o=vt("input-number"),r=te(),a=Ki({currentValue:i.modelValue,userInput:null}),{formItem:c}=fc(),u=W(()=>gn(i.modelValue)&&i.modelValue<=i.min),d=W(()=>gn(i.modelValue)&&i.modelValue>=i.max),f=W(()=>{const q=y(i.step);return ys(i.precision)?Math.max(y(i.modelValue),q):(q>i.precision,i.precision)}),g=W(()=>i.controls&&i.controlsPosition==="right"),p=jr(),_=gc(),v=W(()=>{if(a.userInput!==null)return a.userInput;let q=a.currentValue;if(Ul(q))return"";if(gn(q)){if(Number.isNaN(q))return"";ys(i.precision)||(q=q.toFixed(i.precision))}return q}),C=(q,K)=>{if(ys(K)&&(K=f.value),K===0)return Math.round(q);let re=String(q);const Z=re.indexOf(".");if(Z===-1||!re.replace(".","").split("")[Z+K])return q;const ve=re.length;return re.charAt(ve-1)==="5"&&(re=`${re.slice(0,Math.max(0,ve-1))}6`),Number.parseFloat(Number(re).toFixed(K))},y=q=>{if(Ul(q))return 0;const K=q.toString(),re=K.indexOf(".");let Z=0;return re!==-1&&(Z=K.length-re-1),Z},w=(q,K=1)=>gn(q)?C(q+i.step*K):a.currentValue,I=()=>{if(i.readonly||_.value||d.value)return;const q=Number(v.value)||0,K=w(q);A(K),t(rc,a.currentValue),Q()},L=()=>{if(i.readonly||_.value||u.value)return;const q=Number(v.value)||0,K=w(q,-1);A(K),t(rc,a.currentValue),Q()},O=(q,K)=>{const{max:re,min:Z,step:J,precision:ge,stepStrictly:ve,valueOnClear:Le}=i;re<Z&&Ll("InputNumber","min should not be greater than max.");let Ee=Number(q);if(Ul(q)||Number.isNaN(Ee))return null;if(q===""){if(Le===null)return null;Ee=sn(Le)?{min:Z,max:re}[Le]:Le}return ve&&(Ee=C(Math.round(Ee/J)*J,ge),Ee!==q&&K&&t(Kn,Ee)),ys(ge)||(Ee=C(Ee,ge)),(Ee>re||Ee<Z)&&(Ee=Ee>re?re:Z,K&&t(Kn,Ee)),Ee},A=(q,K=!0)=>{var re;const Z=a.currentValue,J=O(q);if(!K){t(Kn,J);return}Z===J&&q||(a.userInput=null,t(Kn,J),Z!==J&&t(Ms,J,Z),i.validateEvent&&((re=c==null?void 0:c.validate)==null||re.call(c,"change").catch(ge=>void 0)),a.currentValue=J)},N=q=>{a.userInput=q;const K=q===""?null:Number(q);t(rc,K),A(K,!1)},D=q=>{const K=q!==""?Number(q):"";(gn(K)&&!Number.isNaN(K)||q==="")&&A(K),Q(),a.userInput=null},P=()=>{var q,K;(K=(q=r.value)==null?void 0:q.focus)==null||K.call(q)},F=()=>{var q,K;(K=(q=r.value)==null?void 0:q.blur)==null||K.call(q)},V=q=>{t("focus",q)},U=q=>{var K,re;a.userInput=null,E8()&&a.currentValue===null&&((K=r.value)!=null&&K.input)&&(r.value.input.value=""),t("blur",q),i.validateEvent&&((re=c==null?void 0:c.validate)==null||re.call(c,"blur").catch(Z=>void 0))},Q=()=>{a.currentValue!==i.modelValue&&(a.currentValue=i.modelValue)},de=q=>{document.activeElement===q.target&&q.preventDefault()};return ht(()=>i.modelValue,(q,K)=>{const re=O(q,!0);a.userInput===null&&re!==K&&(a.currentValue=re)},{immediate:!0}),$n(()=>{var q;const{min:K,max:re,modelValue:Z}=i,J=(q=r.value)==null?void 0:q.input;if(J.setAttribute("role","spinbutton"),Number.isFinite(re)?J.setAttribute("aria-valuemax",String(re)):J.removeAttribute("aria-valuemax"),Number.isFinite(K)?J.setAttribute("aria-valuemin",String(K)):J.removeAttribute("aria-valuemin"),J.setAttribute("aria-valuenow",a.currentValue||a.currentValue===0?String(a.currentValue):""),J.setAttribute("aria-disabled",String(_.value)),!gn(Z)&&Z!=null){let ge=Number(Z);Number.isNaN(ge)&&(ge=null),t(Kn,ge)}J.addEventListener("wheel",de,{passive:!1})}),s_(()=>{var q,K;const re=(q=r.value)==null?void 0:q.input;re==null||re.setAttribute("aria-valuenow",`${(K=a.currentValue)!=null?K:""}`)}),e({focus:P,blur:F}),(q,K)=>(G(),he("div",{class:Y([T(o).b(),T(o).m(T(p)),T(o).is("disabled",T(_)),T(o).is("without-controls",!q.controls),T(o).is("controls-right",T(g))]),onDragstart:bn(()=>{},["prevent"])},[q.controls?Un((G(),he("span",{key:0,role:"button","aria-label":T(s)("el.inputNumber.decrease"),class:Y([T(o).e("decrease"),T(o).is("disabled",T(u))]),onKeydown:xs(L,["enter"])},[Ye(q.$slots,"decrease-icon",{},()=>[ce(T(tn),null,{default:_e(()=>[T(g)?(G(),nt(T(Lb),{key:0})):(G(),nt(T(YKe),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[T(_W),L]]):Qe("v-if",!0),q.controls?Un((G(),he("span",{key:1,role:"button","aria-label":T(s)("el.inputNumber.increase"),class:Y([T(o).e("increase"),T(o).is("disabled",T(d))]),onKeydown:xs(I,["enter"])},[Ye(q.$slots,"increase-icon",{},()=>[ce(T(tn),null,{default:_e(()=>[T(g)?(G(),nt(T(Zee),{key:0})):(G(),nt(T(FEe),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[T(_W),I]]):Qe("v-if",!0),ce(T(Kc),{id:q.id,ref_key:"input",ref:r,type:"number",step:q.step,"model-value":T(v),placeholder:q.placeholder,readonly:q.readonly,disabled:T(_),size:T(p),max:q.max,min:q.min,name:q.name,"aria-label":q.ariaLabel,"validate-event":!1,onKeydown:[xs(bn(I,["prevent"]),["up"]),xs(bn(L,["prevent"]),["down"])],onBlur:U,onFocus:V,onInput:N,onChange:D},Hf({_:2},[q.$slots.prefix?{name:"prefix",fn:_e(()=>[Ye(q.$slots,"prefix")])}:void 0,q.$slots.suffix?{name:"suffix",fn:_e(()=>[Ye(q.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var jst=Rt(Kst,[["__file","input-number.vue"]]);const L0e=Nn(jst),Xst=Lt({modelValue:{type:Ke(Array)},max:Number,tagType:{...ab.type,default:"info"},tagEffect:ab.effect,trigger:{type:Ke(String),default:zt.enter},draggable:{type:Boolean,default:!1},size:cl,clearable:Boolean,disabled:{type:Boolean,default:void 0},validateEvent:{type:Boolean,default:!0},readonly:Boolean,autofocus:Boolean,id:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},placeholder:String,autocomplete:{type:String,default:"off"},ariaLabel:String}),Yst={[Kn]:n=>yt(n)||ys(n),[Ms]:n=>yt(n)||ys(n),[rc]:n=>sn(n),"add-tag":n=>sn(n),"remove-tag":n=>sn(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0};function qst({props:n,emit:e,formItem:t}){const i=gc(),s=jr(),o=us(),r=te(),a=W(()=>["small"].includes(s.value)?"small":"default"),c=W(()=>{var P;return(P=n.modelValue)!=null&&P.length?void 0:n.placeholder}),u=W(()=>!(n.readonly||i.value)),d=W(()=>{var P,F;return ys(n.max)?!1:((F=(P=n.modelValue)==null?void 0:P.length)!=null?F:0)>=n.max}),f=P=>{if(d.value){r.value=void 0;return}O.value||e(rc,P.target.value)},g=P=>{var F;if(!O.value)switch(P.code){case n.trigger:P.preventDefault(),P.stopPropagation(),p();break;case zt.numpadEnter:n.trigger===zt.enter&&(P.preventDefault(),P.stopPropagation(),p());break;case zt.backspace:!r.value&&((F=n.modelValue)!=null&&F.length)&&(P.preventDefault(),P.stopPropagation(),_(n.modelValue.length-1));break}},p=()=>{var P,F;const V=(P=r.value)==null?void 0:P.trim();if(!V||d.value)return;const U=[...(F=n.modelValue)!=null?F:[],V];e(Kn,U),e(Ms,U),e("add-tag",V),r.value=void 0},_=P=>{var F;const V=((F=n.modelValue)!=null?F:[]).slice(),[U]=V.splice(P,1);e(Kn,V),e(Ms,V),e("remove-tag",U)},v=()=>{r.value=void 0,e(Kn,void 0),e(Ms,void 0),e("clear")},C=(P,F,V)=>{var U;const Q=((U=n.modelValue)!=null?U:[]).slice(),[de]=Q.splice(P,1),q=F>P&&V==="before"?-1:F<P&&V==="after"?1:0;Q.splice(F+q,0,de),e(Kn,Q),e(Ms,Q)},y=()=>{var P;(P=o.value)==null||P.focus()},w=()=>{var P;(P=o.value)==null||P.blur()},{wrapperRef:I,isFocused:L}=$y(o,{beforeFocus(){return i.value},afterBlur(){var P;p(),n.validateEvent&&((P=t==null?void 0:t.validate)==null||P.call(t,"blur").catch(F=>void 0))}}),{isComposing:O,handleCompositionStart:A,handleCompositionUpdate:N,handleCompositionEnd:D}=lF({afterComposition:f});return ht(()=>n.modelValue,()=>{var P;n.validateEvent&&((P=t==null?void 0:t.validate)==null||P.call(t,Ms).catch(F=>void 0))}),{inputRef:o,wrapperRef:I,isFocused:L,isComposing:O,inputValue:r,size:s,tagSize:a,placeholder:c,closable:u,disabled:i,inputLimit:d,handleDragged:C,handleInput:f,handleKeydown:g,handleAddTag:p,handleRemoveTag:_,handleClear:v,handleCompositionStart:A,handleCompositionUpdate:N,handleCompositionEnd:D,focus:y,blur:w}}function Jst(){const n=te(!1);return{hovering:n,handleMouseEnter:()=>{n.value=!0},handleMouseLeave:()=>{n.value=!1}}}function Qst(){const n=us(),e=te(0),t=11,i=W(()=>({minWidth:`${Math.max(e.value,t)}px`}));return wo(n,()=>{var o,r;e.value=(r=(o=n.value)==null?void 0:o.getBoundingClientRect().width)!=null?r:0}),{calculatorRef:n,calculatorWidth:e,inputStyle:i}}function Zst({wrapperRef:n,handleDragged:e,afterDragged:t}){const i=vt("input-tag"),s=us(),o=te(!1);let r,a,c,u;function d(_){return`.${i.e("inner")} .${i.namespace.value}-tag:nth-child(${_+1})`}function f(_,v){r=v,a=n.value.querySelector(d(v)),a&&(a.style.opacity="0.5"),_.dataTransfer.effectAllowed="move"}function g(_,v){if(c=v,_.preventDefault(),_.dataTransfer.dropEffect="move",ys(r)||r===v){o.value=!1;return}const C=n.value.querySelector(d(v)).getBoundingClientRect(),y=r+1!==v,w=r-1!==v,I=_.clientX-C.left,L=y?w?.5:1:-1,O=w?y?.5:0:1;I<=C.width*L?u="before":I>C.width*O?u="after":u=void 0;const A=n.value.querySelector(`.${i.e("inner")}`),N=A.getBoundingClientRect(),D=Number.parseFloat($v(A,"gap"))/2,P=C.top-N.top;let F=-9999;if(u==="before")F=Math.max(C.left-N.left-D,Math.floor(-D/2));else if(u==="after"){const V=C.right-N.left;F=V+(N.width===V?Math.floor(D/2):D)}AEe(s.value,{top:`${P}px`,left:`${F}px`}),o.value=!!u}function p(_){_.preventDefault(),a&&(a.style.opacity=""),u&&!ys(r)&&!ys(c)&&r!==c&&e(r,c,u),o.value=!1,r=void 0,a=null,c=void 0,u=void 0,t==null||t()}return{dropIndicatorRef:s,showDropIndicator:o,handleDragStart:f,handleDragOver:g,handleDragEnd:p}}function eot({props:n,isFocused:e,hovering:t,disabled:i,inputValue:s,size:o,validateState:r,validateIcon:a,needStatusIcon:c}){const u=Ly(),d=dl(),f=vt("input-tag"),g=vt("input"),p=W(()=>[f.b(),f.is("focused",e.value),f.is("hovering",t.value),f.is("disabled",i.value),f.m(o.value),f.e("wrapper"),u.class]),_=W(()=>[u.style]),v=W(()=>{var w,I;return[f.e("inner"),f.is("draggable",n.draggable),f.is("left-space",!((w=n.modelValue)!=null&&w.length)&&!d.prefix),f.is("right-space",!((I=n.modelValue)!=null&&I.length)&&!y.value)]}),C=W(()=>{var w;return n.clearable&&!i.value&&!n.readonly&&(((w=n.modelValue)==null?void 0:w.length)||s.value)&&(e.value||t.value)}),y=W(()=>d.suffix||C.value||r.value&&a.value&&c.value);return{ns:f,nsInput:g,containerKls:p,containerStyle:_,innerKls:v,showClear:C,showSuffix:y}}const tot=$e({name:"ElInputTag",inheritAttrs:!1}),not=$e({...tot,props:Xst,emits:Yst,setup(n,{expose:e,emit:t}){const i=n,s=rF(),o=dl(),{form:r,formItem:a}=fc(),{inputId:c}=Qf(i,{formItemContext:a}),u=W(()=>{var ee;return(ee=r==null?void 0:r.statusIcon)!=null?ee:!1}),d=W(()=>(a==null?void 0:a.validateState)||""),f=W(()=>d.value&&y8[d.value]),{inputRef:g,wrapperRef:p,isFocused:_,inputValue:v,size:C,tagSize:y,placeholder:w,closable:I,disabled:L,handleDragged:O,handleInput:A,handleKeydown:N,handleRemoveTag:D,handleClear:P,handleCompositionStart:F,handleCompositionUpdate:V,handleCompositionEnd:U,focus:Q,blur:de}=qst({props:i,emit:t,formItem:a}),{hovering:q,handleMouseEnter:K,handleMouseLeave:re}=Jst(),{calculatorRef:Z,inputStyle:J}=Qst(),{dropIndicatorRef:ge,showDropIndicator:ve,handleDragStart:Le,handleDragOver:Ee,handleDragEnd:Ne}=Zst({wrapperRef:p,handleDragged:O,afterDragged:Q}),{ns:qe,nsInput:Re,containerKls:we,containerStyle:Ve,innerKls:Ge,showClear:dt,showSuffix:ze}=eot({props:i,hovering:q,isFocused:_,inputValue:v,disabled:L,size:C,validateState:d,validateIcon:f,needStatusIcon:u});return e({focus:Q,blur:de}),(ee,ye)=>(G(),he("div",{ref_key:"wrapperRef",ref:p,class:Y(T(we)),style:on(T(Ve)),onMouseenter:T(K),onMouseleave:T(re)},[T(o).prefix?(G(),he("div",{key:0,class:Y(T(qe).e("prefix"))},[Ye(ee.$slots,"prefix")],2)):Qe("v-if",!0),oe("div",{class:Y(T(Ge))},[(G(!0),he(Qt,null,fi(ee.modelValue,(Me,et)=>(G(),nt(T(tR),{key:et,size:T(y),closable:T(I),type:ee.tagType,effect:ee.tagEffect,draggable:T(I)&&ee.draggable,"disable-transitions":"",onClose:at=>T(D)(et),onDragstart:at=>T(Le)(at,et),onDragover:at=>T(Ee)(at,et),onDragend:T(Ne),onDrop:bn(()=>{},["stop"])},{default:_e(()=>[Ye(ee.$slots,"tag",{value:Me,index:et},()=>[mn(st(Me),1)])]),_:2},1032,["size","closable","type","effect","draggable","onClose","onDragstart","onDragover","onDragend","onDrop"]))),128)),oe("div",{class:Y(T(qe).e("input-wrapper"))},[Un(oe("input",hi({id:T(c),ref_key:"inputRef",ref:g,"onUpdate:modelValue":Me=>Ss(v)?v.value=Me:null},T(s),{type:"text",minlength:ee.minlength,maxlength:ee.maxlength,disabled:T(L),readonly:ee.readonly,autocomplete:ee.autocomplete,tabindex:ee.tabindex,placeholder:T(w),autofocus:ee.autofocus,ariaLabel:ee.ariaLabel,class:T(qe).e("input"),style:T(J),onCompositionstart:T(F),onCompositionupdate:T(V),onCompositionend:T(U),onInput:T(A),onKeydown:T(N)}),null,16,["id","onUpdate:modelValue","minlength","maxlength","disabled","readonly","autocomplete","tabindex","placeholder","autofocus","ariaLabel","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onKeydown"]),[[x5,T(v)]]),oe("span",{ref_key:"calculatorRef",ref:Z,"aria-hidden":"true",class:Y(T(qe).e("input-calculator")),textContent:st(T(v))},null,10,["textContent"])],2),Un(oe("div",{ref_key:"dropIndicatorRef",ref:ge,class:Y(T(qe).e("drop-indicator"))},null,2),[[Gi,T(ve)]])],2),T(ze)?(G(),he("div",{key:1,class:Y(T(qe).e("suffix"))},[Ye(ee.$slots,"suffix"),T(dt)?(G(),nt(T(tn),{key:0,class:Y([T(qe).e("icon"),T(qe).e("clear")]),onMousedown:bn(T(ps),["prevent"]),onClick:T(P)},{default:_e(()=>[ce(T(Ob))]),_:1},8,["class","onMousedown","onClick"])):Qe("v-if",!0),T(d)&&T(f)&&T(u)?(G(),nt(T(tn),{key:1,class:Y([T(Re).e("icon"),T(Re).e("validateIcon"),T(Re).is("loading",T(d)==="validating")])},{default:_e(()=>[(G(),nt(ui(T(f))))]),_:1},8,["class"])):Qe("v-if",!0)],2)):Qe("v-if",!0)],46,["onMouseenter","onMouseleave"]))}});var iot=Rt(not,[["__file","input-tag.vue"]]);const sot=Nn(iot),oot=Lt({type:{type:String,values:["primary","success","warning","info","danger","default"],default:"default"},underline:{type:Boolean,default:!0},disabled:Boolean,href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:ks}}),rot={click:n=>n instanceof MouseEvent},lot=$e({name:"ElLink"}),aot=$e({...lot,props:oot,emits:rot,setup(n,{emit:e}){const t=n,i=vt("link"),s=W(()=>[i.b(),i.m(t.type),i.is("disabled",t.disabled),i.is("underline",t.underline&&!t.disabled)]);function o(r){t.disabled||e("click",r)}return(r,a)=>(G(),he("a",{class:Y(T(s)),href:r.disabled||!r.href?void 0:r.href,target:r.disabled||!r.href?void 0:r.target,onClick:o},[r.icon?(G(),nt(T(tn),{key:0},{default:_e(()=>[(G(),nt(ui(r.icon)))]),_:1})):Qe("v-if",!0),r.$slots.default?(G(),he("span",{key:1,class:Y(T(i).e("inner"))},[Ye(r.$slots,"default")],2)):Qe("v-if",!0),r.$slots.icon?Ye(r.$slots,"icon",{key:2}):Qe("v-if",!0)],10,["href","target"]))}});var cot=Rt(aot,[["__file","link.vue"]]);const uot=Nn(cot);let dot=class{constructor(e,t){this.parent=e,this.domNode=t,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(e){e===this.subMenuItems.length?e=0:e<0&&(e=this.subMenuItems.length-1),this.subMenuItems[e].focus(),this.subIndex=e}addListeners(){const e=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,t=>{t.addEventListener("keydown",i=>{let s=!1;switch(i.code){case zt.down:{this.gotoSubIndex(this.subIndex+1),s=!0;break}case zt.up:{this.gotoSubIndex(this.subIndex-1),s=!0;break}case zt.tab:{TU(e,"mouseleave");break}case zt.enter:case zt.numpadEnter:case zt.space:{s=!0,i.currentTarget.click();break}}return s&&(i.preventDefault(),i.stopPropagation()),!1})})}},hot=class{constructor(e,t){this.domNode=e,this.submenu=null,this.submenu=null,this.init(t)}init(e){this.domNode.setAttribute("tabindex","0");const t=this.domNode.querySelector(`.${e}-menu`);t&&(this.submenu=new dot(this,t)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",e=>{let t=!1;switch(e.code){case zt.down:{TU(e.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),t=!0;break}case zt.up:{TU(e.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),t=!0;break}case zt.tab:{TU(e.currentTarget,"mouseleave");break}case zt.enter:case zt.numpadEnter:case zt.space:{t=!0,e.currentTarget.click();break}}t&&e.preventDefault()})}},fot=class{constructor(e,t){this.domNode=e,this.init(t)}init(e){const t=this.domNode.childNodes;Array.from(t).forEach(i=>{i.nodeType===1&&new hot(i,e)})}};const got=$e({name:"ElMenuCollapseTransition",setup(){const n=vt("menu");return{listeners:{onBeforeEnter:t=>t.style.opacity="0.2",onEnter(t,i){Of(t,`${n.namespace.value}-opacity-transition`),t.style.opacity="1",i()},onAfterEnter(t){qc(t,`${n.namespace.value}-opacity-transition`),t.style.opacity=""},onBeforeLeave(t){t.dataset||(t.dataset={}),Td(t,n.m("collapse"))?(qc(t,n.m("collapse")),t.dataset.oldOverflow=t.style.overflow,t.dataset.scrollWidth=t.clientWidth.toString(),Of(t,n.m("collapse"))):(Of(t,n.m("collapse")),t.dataset.oldOverflow=t.style.overflow,t.dataset.scrollWidth=t.clientWidth.toString(),qc(t,n.m("collapse"))),t.style.width=`${t.scrollWidth}px`,t.style.overflow="hidden"},onLeave(t){Of(t,"horizontal-collapse-transition"),t.style.width=`${t.dataset.scrollWidth}px`}}}}});function pot(n,e,t,i,s,o){return G(),nt(Ta,hi({mode:"out-in"},n.listeners),{default:_e(()=>[Ye(n.$slots,"default")]),_:3},16)}var mot=Rt(got,[["render",pot],["__file","menu-collapse-transition.vue"]]);function O0e(n,e){const t=W(()=>{let s=n.parent;const o=[e.value];for(;s.type.name!=="ElMenu";)s.props.index&&o.unshift(s.props.index),s=s.parent;return o});return{parentMenu:W(()=>{let s=n.parent;for(;s&&!["ElMenu","ElSubMenu"].includes(s.type.name);)s=s.parent;return s}),indexPath:t}}function _ot(n){return W(()=>{const t=n.backgroundColor;return t?new TSe(t).shade(20).toString():""})}const R0e=(n,e)=>{const t=vt("menu");return W(()=>t.cssVarBlock({"text-color":n.textColor||"","hover-text-color":n.textColor||"","bg-color":n.backgroundColor||"","hover-bg-color":_ot(n).value||"","active-color":n.activeTextColor||"",level:`${e}`}))},vot=Lt({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:ks},expandOpenIcon:{type:ks},collapseCloseIcon:{type:ks},collapseOpenIcon:{type:ks}}),a9="ElSubMenu";var Fte=$e({name:a9,props:vot,setup(n,{slots:e,expose:t}){const i=Qn(),{indexPath:s,parentMenu:o}=O0e(i,W(()=>n.index)),r=vt("menu"),a=vt("sub-menu"),c=Kt("rootMenu");c||Ll(a9,"can not inject root menu");const u=Kt(`subMenu:${o.value.uid}`);u||Ll(a9,"can not inject sub menu");const d=te({}),f=te({});let g;const p=te(!1),_=te(),v=te(null),C=W(()=>D.value==="horizontal"&&w.value?"bottom-start":"right-start"),y=W(()=>D.value==="horizontal"&&w.value||D.value==="vertical"&&!c.props.collapse?n.expandCloseIcon&&n.expandOpenIcon?A.value?n.expandOpenIcon:n.expandCloseIcon:Lb:n.collapseCloseIcon&&n.collapseOpenIcon?A.value?n.collapseOpenIcon:n.collapseCloseIcon:Au),w=W(()=>u.level===0),I=W(()=>{const ge=n.teleported;return ge===void 0?w.value:ge}),L=W(()=>c.props.collapse?`${r.namespace.value}-zoom-in-left`:`${r.namespace.value}-zoom-in-top`),O=W(()=>D.value==="horizontal"&&w.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),A=W(()=>c.openedMenus.includes(n.index)),N=W(()=>{let ge=!1;return Object.values(d.value).forEach(ve=>{ve.active&&(ge=!0)}),Object.values(f.value).forEach(ve=>{ve.active&&(ge=!0)}),ge}),D=W(()=>c.props.mode),P=Ki({index:n.index,indexPath:s,active:N}),F=R0e(c.props,u.level+1),V=W(()=>{var ge;return(ge=n.popperOffset)!=null?ge:c.props.popperOffset}),U=W(()=>{var ge;return(ge=n.popperClass)!=null?ge:c.props.popperClass}),Q=W(()=>{var ge;return(ge=n.showTimeout)!=null?ge:c.props.showTimeout}),de=W(()=>{var ge;return(ge=n.hideTimeout)!=null?ge:c.props.hideTimeout}),q=()=>{var ge,ve,Le;return(Le=(ve=(ge=v.value)==null?void 0:ge.popperRef)==null?void 0:ve.popperInstanceRef)==null?void 0:Le.destroy()},K=ge=>{ge||q()},re=()=>{c.props.menuTrigger==="hover"&&c.props.mode==="horizontal"||c.props.collapse&&c.props.mode==="vertical"||n.disabled||c.handleSubMenuClick({index:n.index,indexPath:s.value,active:N.value})},Z=(ge,ve=Q.value)=>{var Le;if(ge.type!=="focus"){if(c.props.menuTrigger==="click"&&c.props.mode==="horizontal"||!c.props.collapse&&c.props.mode==="vertical"||n.disabled){u.mouseInChild.value=!0;return}u.mouseInChild.value=!0,g==null||g(),{stop:g}=B0(()=>{c.openMenu(n.index,s.value)},ve),I.value&&((Le=o.value.vnode.el)==null||Le.dispatchEvent(new MouseEvent("mouseenter")))}},J=(ge=!1)=>{var ve;if(c.props.menuTrigger==="click"&&c.props.mode==="horizontal"||!c.props.collapse&&c.props.mode==="vertical"){u.mouseInChild.value=!1;return}g==null||g(),u.mouseInChild.value=!1,{stop:g}=B0(()=>!p.value&&c.closeMenu(n.index,s.value),de.value),I.value&&ge&&((ve=u.handleMouseleave)==null||ve.call(u,!0))};ht(()=>c.props.collapse,ge=>K(!!ge));{const ge=Le=>{f.value[Le.index]=Le},ve=Le=>{delete f.value[Le.index]};pi(`subMenu:${i.uid}`,{addSubMenu:ge,removeSubMenu:ve,handleMouseleave:J,mouseInChild:p,level:u.level+1})}return t({opened:A}),$n(()=>{c.addSubMenu(P),u.addSubMenu(P)}),As(()=>{u.removeSubMenu(P),c.removeSubMenu(P)}),()=>{var ge;const ve=[(ge=e.title)==null?void 0:ge.call(e),hn(tn,{class:a.e("icon-arrow"),style:{transform:A.value?n.expandCloseIcon&&n.expandOpenIcon||n.collapseCloseIcon&&n.collapseOpenIcon&&c.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>sn(y.value)?hn(i.appContext.components[y.value]):hn(y.value)})],Le=c.isMenuPopup?hn(uc,{ref:v,visible:A.value,effect:"light",pure:!0,offset:V.value,showArrow:!1,persistent:!0,popperClass:U.value,placement:C.value,teleported:I.value,fallbackPlacements:O.value,transition:L.value,gpuAcceleration:!1},{content:()=>{var Ee;return hn("div",{class:[r.m(D.value),r.m("popup-container"),U.value],onMouseenter:Ne=>Z(Ne,100),onMouseleave:()=>J(!0),onFocus:Ne=>Z(Ne,100)},[hn("ul",{class:[r.b(),r.m("popup"),r.m(`popup-${C.value}`)],style:F.value},[(Ee=e.default)==null?void 0:Ee.call(e)])])},default:()=>hn("div",{class:a.e("title"),onClick:re},ve)}):hn(Qt,{},[hn("div",{class:a.e("title"),ref:_,onClick:re},ve),hn(L8,{},{default:()=>{var Ee;return Un(hn("ul",{role:"menu",class:[r.b(),r.m("inline")],style:F.value},[(Ee=e.default)==null?void 0:Ee.call(e)]),[[Gi,A.value]])}})]);return hn("li",{class:[a.b(),a.is("active",N.value),a.is("opened",A.value),a.is("disabled",n.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:A.value,onMouseenter:Z,onMouseleave:()=>J(),onFocus:Z},[Le])}}});const bot=Lt({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:Ke(Array),default:()=>Ko([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:ks,default:()=>QKe},popperEffect:{type:Ke(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),c9=n=>yt(n)&&n.every(e=>sn(e)),Tot={close:(n,e)=>sn(n)&&c9(e),open:(n,e)=>sn(n)&&c9(e),select:(n,e,t,i)=>sn(n)&&c9(e)&&si(t)&&(i===void 0||i instanceof Promise)};var Cot=$e({name:"ElMenu",props:bot,emits:Tot,setup(n,{emit:e,slots:t,expose:i}){const s=Qn(),o=s.appContext.config.globalProperties.$router,r=te(),a=vt("menu"),c=vt("sub-menu"),u=te(-1),d=te(n.defaultOpeneds&&!n.collapse?n.defaultOpeneds.slice(0):[]),f=te(n.defaultActive),g=te({}),p=te({}),_=W(()=>n.mode==="horizontal"||n.mode==="vertical"&&n.collapse),v=()=>{const q=f.value&&g.value[f.value];if(!q||n.mode==="horizontal"||n.collapse)return;q.indexPath.forEach(re=>{const Z=p.value[re];Z&&C(re,Z.indexPath)})},C=(q,K)=>{d.value.includes(q)||(n.uniqueOpened&&(d.value=d.value.filter(re=>K.includes(re))),d.value.push(q),e("open",q,K))},y=q=>{const K=d.value.indexOf(q);K!==-1&&d.value.splice(K,1)},w=(q,K)=>{y(q),e("close",q,K)},I=({index:q,indexPath:K})=>{d.value.includes(q)?w(q,K):C(q,K)},L=q=>{(n.mode==="horizontal"||n.collapse)&&(d.value=[]);const{index:K,indexPath:re}=q;if(!(Ul(K)||Ul(re)))if(n.router&&o){const Z=q.route||K,J=o.push(Z).then(ge=>(ge||(f.value=K),ge));e("select",K,re,{index:K,indexPath:re,route:Z},J)}else f.value=K,e("select",K,re,{index:K,indexPath:re})},O=q=>{const K=g.value,re=K[q]||f.value&&K[f.value]||K[n.defaultActive];re?f.value=re.index:f.value=q},A=q=>{const K=getComputedStyle(q),re=Number.parseInt(K.marginLeft,10),Z=Number.parseInt(K.marginRight,10);return q.offsetWidth+re+Z||0},N=()=>{var q,K;if(!r.value)return-1;const re=Array.from((K=(q=r.value)==null?void 0:q.childNodes)!=null?K:[]).filter(qe=>qe.nodeName!=="#comment"&&(qe.nodeName!=="#text"||qe.nodeValue)),Z=64,J=getComputedStyle(r.value),ge=Number.parseInt(J.paddingLeft,10),ve=Number.parseInt(J.paddingRight,10),Le=r.value.clientWidth-ge-ve;let Ee=0,Ne=0;return re.forEach((qe,Re)=>{Ee+=A(qe),Ee<=Le-Z&&(Ne=Re+1)}),Ne===re.length?-1:Ne},D=q=>p.value[q].indexPath,P=(q,K=33.34)=>{let re;return()=>{re&&clearTimeout(re),re=setTimeout(()=>{q()},K)}};let F=!0;const V=()=>{if(u.value===N())return;const q=()=>{u.value=-1,cn(()=>{u.value=N()})};F?q():P(q)(),F=!1};ht(()=>n.defaultActive,q=>{g.value[q]||(f.value=""),O(q)}),ht(()=>n.collapse,q=>{q&&(d.value=[])}),ht(g.value,v);let U;Sl(()=>{n.mode==="horizontal"&&n.ellipsis?U=wo(r,V).stop:U==null||U()});const Q=te(!1);{const q=J=>{p.value[J.index]=J},K=J=>{delete p.value[J.index]};pi("rootMenu",Ki({props:n,openedMenus:d,items:g,subMenus:p,activeIndex:f,isMenuPopup:_,addMenuItem:J=>{g.value[J.index]=J},removeMenuItem:J=>{delete g.value[J.index]},addSubMenu:q,removeSubMenu:K,openMenu:C,closeMenu:w,handleMenuItemClick:L,handleSubMenuClick:I})),pi(`subMenu:${s.uid}`,{addSubMenu:q,removeSubMenu:K,mouseInChild:Q,level:0})}$n(()=>{n.mode==="horizontal"&&new fot(s.vnode.el,a.namespace.value)}),i({open:K=>{const{indexPath:re}=p.value[K];re.forEach(Z=>C(Z,re))},close:y,handleResize:V});const de=R0e(n,0);return()=>{var q,K;let re=(K=(q=t.default)==null?void 0:q.call(t))!=null?K:[];const Z=[];if(n.mode==="horizontal"&&r.value){const ve=kC(re),Le=u.value===-1?ve:ve.slice(0,u.value),Ee=u.value===-1?[]:ve.slice(u.value);Ee!=null&&Ee.length&&n.ellipsis&&(re=Le,Z.push(hn(Fte,{index:"sub-menu-more",class:c.e("hide-arrow"),popperOffset:n.popperOffset},{title:()=>hn(tn,{class:c.e("icon-more")},{default:()=>hn(n.ellipsisIcon)}),default:()=>Ee})))}const J=n.closeOnClickOutside?[[cb,()=>{d.value.length&&(Q.value||(d.value.forEach(ve=>e("close",ve,D(ve))),d.value=[]))}]]:[],ge=Un(hn("ul",{key:String(n.collapse),role:"menubar",ref:r,style:de.value,class:{[a.b()]:!0,[a.m(n.mode)]:!0,[a.m("collapse")]:n.collapse}},[...re,...Z]),J);return n.collapseTransition&&n.mode==="vertical"?hn(mot,()=>ge):ge}}});const yot=Lt({index:{type:Ke([String,null]),default:null},route:{type:Ke([String,Object])},disabled:Boolean}),Eot={click:n=>sn(n.index)&&yt(n.indexPath)},u9="ElMenuItem",Sot=$e({name:u9,components:{ElTooltip:uc},props:yot,emits:Eot,setup(n,{emit:e}){const t=Qn(),i=Kt("rootMenu"),s=vt("menu"),o=vt("menu-item");i||Ll(u9,"can not inject root menu");const{parentMenu:r,indexPath:a}=O0e(t,ds(n,"index")),c=Kt(`subMenu:${r.value.uid}`);c||Ll(u9,"can not inject sub menu");const u=W(()=>n.index===i.activeIndex),d=Ki({index:n.index,indexPath:a,active:u}),f=()=>{n.disabled||(i.handleMenuItemClick({index:n.index,indexPath:a.value,route:n.route}),e("click",d))};return $n(()=>{c.addSubMenu(d),i.addMenuItem(d)}),As(()=>{c.removeSubMenu(d),i.removeMenuItem(d)}),{parentMenu:r,rootMenu:i,active:u,nsMenu:s,nsMenuItem:o,handleClick:f}}});function wot(n,e,t,i,s,o){const r=Bt("el-tooltip");return G(),he("li",{class:Y([n.nsMenuItem.b(),n.nsMenuItem.is("active",n.active),n.nsMenuItem.is("disabled",n.disabled)]),role:"menuitem",tabindex:"-1",onClick:n.handleClick},[n.parentMenu.type.name==="ElMenu"&&n.rootMenu.props.collapse&&n.$slots.title?(G(),nt(r,{key:0,effect:n.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:_e(()=>[Ye(n.$slots,"title")]),default:_e(()=>[oe("div",{class:Y(n.nsMenu.be("tooltip","trigger"))},[Ye(n.$slots,"default")],2)]),_:3},8,["effect"])):(G(),he(Qt,{key:1},[Ye(n.$slots,"default"),Ye(n.$slots,"title")],64))],10,["onClick"])}var M0e=Rt(Sot,[["render",wot],["__file","menu-item.vue"]]);const Iot={title:String},Lot="ElMenuItemGroup",Oot=$e({name:Lot,props:Iot,setup(){return{ns:vt("menu-item-group")}}});function Rot(n,e,t,i,s,o){return G(),he("li",{class:Y(n.ns.b())},[oe("div",{class:Y(n.ns.e("title"))},[n.$slots.title?Ye(n.$slots,"title",{key:1}):(G(),he(Qt,{key:0},[mn(st(n.title),1)],64))],2),oe("ul",null,[Ye(n.$slots,"default")])],2)}var k0e=Rt(Oot,[["render",Rot],["__file","menu-item-group.vue"]]);const Mot=Nn(Cot,{MenuItem:M0e,MenuItemGroup:k0e,SubMenu:Fte}),kot=Xo(M0e),Aot=Xo(k0e),Not=Xo(Fte),Dot=Lt({icon:{type:ks,default:()=>vKe},title:String,content:{type:String,default:""}}),$ot={back:()=>!0},xot=$e({name:"ElPageHeader"}),Pot=$e({...xot,props:Dot,emits:$ot,setup(n,{emit:e}){const t=dl(),{t:i}=wi(),s=vt("page-header"),o=W(()=>[s.b(),{[s.m("has-breadcrumb")]:!!t.breadcrumb,[s.m("has-extra")]:!!t.extra,[s.is("contentful")]:!!t.default}]);function r(){e("back")}return(a,c)=>(G(),he("div",{class:Y(T(o))},[a.$slots.breadcrumb?(G(),he("div",{key:0,class:Y(T(s).e("breadcrumb"))},[Ye(a.$slots,"breadcrumb")],2)):Qe("v-if",!0),oe("div",{class:Y(T(s).e("header"))},[oe("div",{class:Y(T(s).e("left"))},[oe("div",{class:Y(T(s).e("back")),role:"button",tabindex:"0",onClick:r},[a.icon||a.$slots.icon?(G(),he("div",{key:0,"aria-label":a.title||T(i)("el.pageHeader.title"),class:Y(T(s).e("icon"))},[Ye(a.$slots,"icon",{},()=>[a.icon?(G(),nt(T(tn),{key:0},{default:_e(()=>[(G(),nt(ui(a.icon)))]),_:1})):Qe("v-if",!0)])],10,["aria-label"])):Qe("v-if",!0),oe("div",{class:Y(T(s).e("title"))},[Ye(a.$slots,"title",{},()=>[mn(st(a.title||T(i)("el.pageHeader.title")),1)])],2)],2),ce(T(g0e),{direction:"vertical"}),oe("div",{class:Y(T(s).e("content"))},[Ye(a.$slots,"content",{},()=>[mn(st(a.content),1)])],2)],2),a.$slots.extra?(G(),he("div",{key:0,class:Y(T(s).e("extra"))},[Ye(a.$slots,"extra")],2)):Qe("v-if",!0)],2),a.$slots.default?(G(),he("div",{key:1,class:Y(T(s).e("main"))},[Ye(a.$slots,"default")],2)):Qe("v-if",!0)],2))}});var Fot=Rt(Pot,[["__file","page-header.vue"]]);const Bot=Nn(Fot),A0e=Symbol("elPaginationKey"),Hot=Lt({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:ks}}),Vot={click:n=>n instanceof MouseEvent},Uot=$e({name:"ElPaginationPrev"}),Wot=$e({...Uot,props:Hot,emits:Vot,setup(n){const e=n,{t}=wi(),i=W(()=>e.disabled||e.currentPage<=1);return(s,o)=>(G(),he("button",{type:"button",class:"btn-prev",disabled:T(i),"aria-label":s.prevText||T(t)("el.pagination.prev"),"aria-disabled":T(i),onClick:r=>s.$emit("click",r)},[s.prevText?(G(),he("span",{key:0},st(s.prevText),1)):(G(),nt(T(tn),{key:1},{default:_e(()=>[(G(),nt(ui(s.prevIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var Got=Rt(Wot,[["__file","prev.vue"]]);const zot=Lt({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:ks}}),Kot=$e({name:"ElPaginationNext"}),jot=$e({...Kot,props:zot,emits:["click"],setup(n){const e=n,{t}=wi(),i=W(()=>e.disabled||e.currentPage===e.pageCount||e.pageCount===0);return(s,o)=>(G(),he("button",{type:"button",class:"btn-next",disabled:T(i),"aria-label":s.nextText||T(t)("el.pagination.next"),"aria-disabled":T(i),onClick:r=>s.$emit("click",r)},[s.nextText?(G(),he("span",{key:0},st(s.nextText),1)):(G(),nt(T(tn),{key:1},{default:_e(()=>[(G(),nt(ui(s.nextIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var Xot=Rt(jot,[["__file","next.vue"]]);const N0e=Symbol("ElSelectGroup"),cM=Symbol("ElSelect");function Yot(n,e){const t=Kt(cM),i=Kt(N0e,{disabled:!1}),s=W(()=>d(Gc(t.props.modelValue),n.value)),o=W(()=>{var p;if(t.props.multiple){const _=Gc((p=t.props.modelValue)!=null?p:[]);return!s.value&&_.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),r=W(()=>n.label||(si(n.value)?"":n.value)),a=W(()=>n.value||n.label||""),c=W(()=>n.disabled||e.groupDisabled||o.value),u=Qn(),d=(p=[],_)=>{if(si(n.value)){const v=t.props.valueKey;return p&&p.some(C=>Cs(Fr(C,v))===Fr(_,v))}else return p&&p.includes(_)},f=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(u.proxy))},g=p=>{const _=new RegExp(yte(p),"i");e.visible=_.test(r.value)||n.created};return ht(()=>r.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),ht(()=>n.value,(p,_)=>{const{remote:v,valueKey:C}=t.props;if(p!==_&&(t.onOptionDestroy(_,u.proxy),t.onOptionCreate(u.proxy)),!n.created&&!v){if(C&&si(p)&&si(_)&&p[C]===_[C])return;t.setSelected()}}),ht(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:r,currentValue:a,itemSelected:s,isDisabled:c,hoverItem:f,updateOption:g}}const qot=$e({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=vt("select"),t=Va(),i=W(()=>[e.be("dropdown","item"),e.is("disabled",T(a)),e.is("selected",T(r)),e.is("hovering",T(g))]),s=Ki({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:o,itemSelected:r,isDisabled:a,select:c,hoverItem:u,updateOption:d}=Yot(n,s),{visible:f,hover:g}=Gl(s),p=Qn().proxy;c.onOptionCreate(p),As(()=>{const v=p.value,{selected:C}=c.states,y=C.some(w=>w.value===p.value);cn(()=>{c.states.cachedOptions.get(v)===p&&!y&&c.states.cachedOptions.delete(v)}),c.onOptionDestroy(v,p)});function _(){a.value||c.handleOptionSelect(p)}return{ns:e,id:t,containerKls:i,currentLabel:o,itemSelected:r,isDisabled:a,select:c,hoverItem:u,updateOption:d,visible:f,hover:g,selectOptionClick:_,states:s}}});function Jot(n,e,t,i,s,o){return Un((G(),he("li",{id:n.id,class:Y(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMousemove:n.hoverItem,onClick:bn(n.selectOptionClick,["stop"])},[Ye(n.$slots,"default",{},()=>[oe("span",null,st(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMousemove","onClick"])),[[Gi,n.visible]])}var Bte=Rt(qot,[["render",Jot],["__file","option.vue"]]);const Qot=$e({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=Kt(cM),e=vt("select"),t=W(()=>n.props.popperClass),i=W(()=>n.props.multiple),s=W(()=>n.props.fitInputWidth),o=te("");function r(){var a;o.value=`${(a=n.selectRef)==null?void 0:a.offsetWidth}px`}return $n(()=>{r(),wo(n.selectRef,r)}),{ns:e,minWidth:o,popperClass:t,isMultiple:i,isFitInputWidth:s}}});function Zot(n,e,t,i,s,o){return G(),he("div",{class:Y([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:on({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(G(),he("div",{key:0,class:Y(n.ns.be("dropdown","header"))},[Ye(n.$slots,"header")],2)):Qe("v-if",!0),Ye(n.$slots,"default"),n.$slots.footer?(G(),he("div",{key:1,class:Y(n.ns.be("dropdown","footer"))},[Ye(n.$slots,"footer")],2)):Qe("v-if",!0)],6)}var ert=Rt(Qot,[["render",Zot],["__file","select-dropdown.vue"]]);const trt=11,nrt=(n,e)=>{const{t}=wi(),i=Va(),s=vt("select"),o=vt("input"),r=Ki({inputValue:"",options:new Map,cachedOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),a=te(null),c=te(null),u=te(null),d=te(null),f=te(null),g=te(null),p=te(null),_=te(null),v=te(null),C=te(null),y=te(null),w=te(null),{isComposing:I,handleCompositionStart:L,handleCompositionUpdate:O,handleCompositionEnd:A}=lF({afterComposition:gt=>En(gt)}),{wrapperRef:N,isFocused:D,handleBlur:P}=$y(f,{beforeFocus(){return re.value},afterFocus(){n.automaticDropdown&&!F.value&&(F.value=!0,r.menuVisibleOnFocus=!0)},beforeBlur(gt){var Ft,pn;return((Ft=u.value)==null?void 0:Ft.isFocusInsideContent(gt))||((pn=d.value)==null?void 0:pn.isFocusInsideContent(gt))},afterBlur(){F.value=!1,r.menuVisibleOnFocus=!1}}),F=te(!1),V=te(),{form:U,formItem:Q}=fc(),{inputId:de}=Qf(n,{formItemContext:Q}),{valueOnClear:q,isEmptyValue:K}=v8(n),re=W(()=>n.disabled||(U==null?void 0:U.disabled)),Z=W(()=>yt(n.modelValue)?n.modelValue.length>0:!K(n.modelValue)),J=W(()=>{var gt;return(gt=U==null?void 0:U.statusIcon)!=null?gt:!1}),ge=W(()=>n.clearable&&!re.value&&r.inputHovering&&Z.value),ve=W(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),Le=W(()=>s.is("reverse",ve.value&&F.value)),Ee=W(()=>(Q==null?void 0:Q.validateState)||""),Ne=W(()=>y8[Ee.value]),qe=W(()=>n.remote?300:0),Re=W(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!r.inputValue&&r.options.size===0?!1:n.filterable&&r.inputValue&&r.options.size>0&&we.value===0?n.noMatchText||t("el.select.noMatch"):r.options.size===0?n.noDataText||t("el.select.noData"):null),we=W(()=>Ve.value.filter(gt=>gt.visible).length),Ve=W(()=>{const gt=Array.from(r.options.values()),Ft=[];return r.optionValues.forEach(pn=>{const Fn=gt.findIndex(Cn=>Cn.value===pn);Fn>-1&&Ft.push(gt[Fn])}),Ft.length>=gt.length?Ft:gt}),Ge=W(()=>Array.from(r.cachedOptions.values())),dt=W(()=>{const gt=Ve.value.filter(Ft=>!Ft.created).some(Ft=>Ft.currentLabel===r.inputValue);return n.filterable&&n.allowCreate&&r.inputValue!==""&&!gt}),ze=()=>{n.filterable&&ln(n.filterMethod)||n.filterable&&n.remote&&ln(n.remoteMethod)||Ve.value.forEach(gt=>{var Ft;(Ft=gt.updateOption)==null||Ft.call(gt,r.inputValue)})},ee=jr(),ye=W(()=>["small"].includes(ee.value)?"small":"default"),Me=W({get(){return F.value&&Re.value!==!1},set(gt){F.value=gt}}),et=W(()=>{if(n.multiple&&!ys(n.modelValue))return Gc(n.modelValue).length===0&&!r.inputValue;const gt=yt(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||ys(gt)?!r.inputValue:!0}),at=W(()=>{var gt;const Ft=(gt=n.placeholder)!=null?gt:t("el.select.placeholder");return n.multiple||!Z.value?Ft:r.selectedLabel}),Ue=W(()=>_X?null:"mouseenter");ht(()=>n.modelValue,(gt,Ft)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(r.inputValue="",Se("")),Xe(),!Ha(gt,Ft)&&n.validateEvent&&(Q==null||Q.validate("change").catch(pn=>void 0))},{flush:"post",deep:!0}),ht(()=>F.value,gt=>{gt?Se(r.inputValue):(r.inputValue="",r.previousQuery=null,r.isBeforeHide=!0),e("visible-change",gt)}),ht(()=>r.options.entries(),()=>{Si&&(Xe(),n.defaultFirstOption&&(n.filterable||n.remote)&&we.value&&Ie())},{flush:"post"}),ht(()=>r.hoveringIndex,gt=>{gn(gt)&>>-1?V.value=Ve.value[gt]||{}:V.value={},Ve.value.forEach(Ft=>{Ft.hover=V.value===Ft})}),Sl(()=>{r.isBeforeHide||ze()});const Se=gt=>{r.previousQuery===gt||I.value||(r.previousQuery=gt,n.filterable&&ln(n.filterMethod)?n.filterMethod(gt):n.filterable&&n.remote&&ln(n.remoteMethod)&&n.remoteMethod(gt),n.defaultFirstOption&&(n.filterable||n.remote)&&we.value?cn(Ie):cn(Tt))},Ie=()=>{const gt=Ve.value.filter(Cn=>Cn.visible&&!Cn.disabled&&!Cn.states.groupDisabled),Ft=gt.find(Cn=>Cn.created),pn=gt[0],Fn=Ve.value.map(Cn=>Cn.value);r.hoveringIndex=Et(Fn,Ft||pn)},Xe=()=>{if(n.multiple)r.selectedLabel="";else{const Ft=yt(n.modelValue)?n.modelValue[0]:n.modelValue,pn=it(Ft);r.selectedLabel=pn.currentLabel,r.selected=[pn];return}const gt=[];ys(n.modelValue)||Gc(n.modelValue).forEach(Ft=>{gt.push(it(Ft))}),r.selected=gt},it=gt=>{let Ft;const pn=w$(gt);for(let Fs=r.cachedOptions.size-1;Fs>=0;Fs--){const vi=Ge.value[Fs];if(pn?Fr(vi.value,n.valueKey)===Fr(gt,n.valueKey):vi.value===gt){Ft={value:gt,currentLabel:vi.currentLabel,get isDisabled(){return vi.isDisabled}};break}}if(Ft)return Ft;const Fn=pn?gt.label:gt??"";return{value:gt,currentLabel:Fn}},Tt=()=>{r.hoveringIndex=Ve.value.findIndex(gt=>r.selected.some(Ft=>ue(Ft)===ue(gt)))},He=()=>{r.selectionWidth=c.value.getBoundingClientRect().width},ke=()=>{r.calculatorWidth=g.value.getBoundingClientRect().width},ot=()=>{r.collapseItemWidth=y.value.getBoundingClientRect().width},Ct=()=>{var gt,Ft;(Ft=(gt=u.value)==null?void 0:gt.updatePopper)==null||Ft.call(gt)},Gt=()=>{var gt,Ft;(Ft=(gt=d.value)==null?void 0:gt.updatePopper)==null||Ft.call(gt)},Ot=()=>{r.inputValue.length>0&&!F.value&&(F.value=!0),Se(r.inputValue)},En=gt=>{if(r.inputValue=gt.target.value,n.remote)fe();else return Ot()},fe=Md(()=>{Ot()},qe.value),se=gt=>{Ha(n.modelValue,gt)||e(Ms,gt)},le=gt=>gEe(gt,Ft=>{const pn=r.cachedOptions.get(Ft);return pn&&!pn.disabled&&!pn.states.groupDisabled}),Fe=gt=>{if(n.multiple&>.code!==zt.delete&>.target.value.length<=0){const Ft=Gc(n.modelValue).slice(),pn=le(Ft);if(pn<0)return;const Fn=Ft[pn];Ft.splice(pn,1),e(Kn,Ft),se(Ft),e("remove-tag",Fn)}},pe=(gt,Ft)=>{const pn=r.selected.indexOf(Ft);if(pn>-1&&!re.value){const Fn=Gc(n.modelValue).slice();Fn.splice(pn,1),e(Kn,Fn),se(Fn),e("remove-tag",Ft.value)}gt.stopPropagation(),Hi()},je=gt=>{gt.stopPropagation();const Ft=n.multiple?[]:q.value;if(n.multiple)for(const pn of r.selected)pn.isDisabled&&Ft.push(pn.value);e(Kn,Ft),se(Ft),r.hoveringIndex=-1,F.value=!1,e("clear"),Hi()},Ae=gt=>{var Ft;if(n.multiple){const pn=Gc((Ft=n.modelValue)!=null?Ft:[]).slice(),Fn=Et(pn,gt);Fn>-1?pn.splice(Fn,1):(n.multipleLimit<=0||pn.length<n.multipleLimit)&&pn.push(gt.value),e(Kn,pn),se(pn),gt.created&&Se(""),n.filterable&&!n.reserveKeyword&&(r.inputValue="")}else e(Kn,gt.value),se(gt.value),F.value=!1;Hi(),!F.value&&cn(()=>{Tn(gt)})},Et=(gt=[],Ft)=>ys(Ft)?-1:si(Ft.value)?gt.findIndex(pn=>Ha(Fr(pn,n.valueKey),ue(Ft))):gt.indexOf(Ft.value),Tn=gt=>{var Ft,pn,Fn,Cn,Fs;const vi=yt(gt)?gt[0]:gt;let go=null;if(vi!=null&&vi.value){const gl=Ve.value.filter(vo=>vo.value===vi.value);gl.length>0&&(go=gl[0].$el)}if(u.value&&go){const gl=(Cn=(Fn=(pn=(Ft=u.value)==null?void 0:Ft.popperRef)==null?void 0:pn.contentRef)==null?void 0:Fn.querySelector)==null?void 0:Cn.call(Fn,`.${s.be("dropdown","wrap")}`);gl&&Qee(gl,go)}(Fs=w.value)==null||Fs.handleScroll()},Hn=gt=>{r.options.set(gt.value,gt),r.cachedOptions.set(gt.value,gt)},Xn=(gt,Ft)=>{r.options.get(gt)===Ft&&r.options.delete(gt)},vs=W(()=>{var gt,Ft;return(Ft=(gt=u.value)==null?void 0:gt.popperRef)==null?void 0:Ft.contentRef}),Zn=()=>{r.isBeforeHide=!1,cn(()=>Tn(r.selected))},Hi=()=>{var gt;(gt=f.value)==null||gt.focus()},ti=()=>{var gt;if(F.value){F.value=!1,cn(()=>{var Ft;return(Ft=f.value)==null?void 0:Ft.blur()});return}(gt=f.value)==null||gt.blur()},Ps=gt=>{je(gt)},ae=gt=>{if(F.value=!1,D.value){const Ft=new FocusEvent("focus",gt);cn(()=>P(Ft))}},xe=()=>{r.inputValue.length>0?r.inputValue="":F.value=!1},H=()=>{re.value||(_X&&(r.inputHovering=!0),r.menuVisibleOnFocus?r.menuVisibleOnFocus=!1:F.value=!F.value)},j=()=>{if(!F.value)H();else{const gt=Ve.value[r.hoveringIndex];gt&&!gt.isDisabled&&Ae(gt)}},ue=gt=>si(gt.value)?Fr(gt.value,n.valueKey):gt.value,ie=W(()=>Ve.value.filter(gt=>gt.visible).every(gt=>gt.isDisabled)),Te=W(()=>n.multiple?n.collapseTags?r.selected.slice(0,n.maxCollapseTags):r.selected:[]),De=W(()=>n.multiple?n.collapseTags?r.selected.slice(n.maxCollapseTags):[]:[]),me=gt=>{if(!F.value){F.value=!0;return}if(!(r.options.size===0||we.value===0||I.value)&&!ie.value){gt==="next"?(r.hoveringIndex++,r.hoveringIndex===r.options.size&&(r.hoveringIndex=0)):gt==="prev"&&(r.hoveringIndex--,r.hoveringIndex<0&&(r.hoveringIndex=r.options.size-1));const Ft=Ve.value[r.hoveringIndex];(Ft.isDisabled||!Ft.visible)&&me(gt),cn(()=>Tn(V.value))}},tt=()=>{if(!c.value)return 0;const gt=window.getComputedStyle(c.value);return Number.parseFloat(gt.gap||"6px")},It=W(()=>{const gt=tt();return{maxWidth:`${y.value&&n.maxCollapseTags===1?r.selectionWidth-r.collapseItemWidth-gt:r.selectionWidth}px`}}),kt=W(()=>({maxWidth:`${r.selectionWidth}px`})),un=W(()=>({width:`${Math.max(r.calculatorWidth,trt)}px`}));return wo(c,He),wo(g,ke),wo(v,Ct),wo(N,Ct),wo(C,Gt),wo(y,ot),$n(()=>{Xe()}),{inputId:de,contentId:i,nsSelect:s,nsInput:o,states:r,isFocused:D,expanded:F,optionsArray:Ve,hoverOption:V,selectSize:ee,filteredOptionsCount:we,resetCalculatorWidth:ke,updateTooltip:Ct,updateTagTooltip:Gt,debouncedOnInputChange:fe,onInput:En,deletePrevTag:Fe,deleteTag:pe,deleteSelected:je,handleOptionSelect:Ae,scrollToOption:Tn,hasModelValue:Z,shouldShowPlaceholder:et,currentPlaceholder:at,mouseEnterEventName:Ue,needStatusIcon:J,showClose:ge,iconComponent:ve,iconReverse:Le,validateState:Ee,validateIcon:Ne,showNewOption:dt,updateOptions:ze,collapseTagSize:ye,setSelected:Xe,selectDisabled:re,emptyText:Re,handleCompositionStart:L,handleCompositionUpdate:O,handleCompositionEnd:A,onOptionCreate:Hn,onOptionDestroy:Xn,handleMenuEnter:Zn,focus:Hi,blur:ti,handleClearClick:Ps,handleClickOutside:ae,handleEsc:xe,toggleMenu:H,selectOption:j,getValueKey:ue,navigateOptions:me,dropdownMenuVisible:Me,showTagList:Te,collapseTagList:De,tagStyle:It,collapseTagStyle:kt,inputStyle:un,popperRef:vs,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:g,prefixRef:p,suffixRef:_,selectRef:a,wrapperRef:N,selectionRef:c,scrollbarRef:w,menuRef:v,tagMenuRef:C,collapseItemRef:y}};var irt=$e({name:"ElOptions",setup(n,{slots:e}){const t=Kt(cM);let i=[];return()=>{var s,o;const r=(s=e.default)==null?void 0:s.call(e),a=[];function c(u){yt(u)&&u.forEach(d=>{var f,g,p,_;const v=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;v==="ElOptionGroup"?c(!sn(d.children)&&!yt(d.children)&&ln((g=d.children)==null?void 0:g.default)?(p=d.children)==null?void 0:p.default():d.children):v==="ElOption"?a.push((_=d.props)==null?void 0:_.value):yt(d.children)&&c(d.children)})}return r.length&&c((o=r[0])==null?void 0:o.children),Ha(a,i)||(i=a,t&&(t.states.optionValues=a)),r}}});const srt=Lt({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:cl,effect:{type:Ke(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ke(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:ua.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ks,default:Ob},fitInputWidth:Boolean,suffixIcon:{type:ks,default:Lb},tagType:{...ab.type,default:"info"},tagEffect:{...ab.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:Ke(String),values:Rb,default:"bottom-start"},fallbackPlacements:{type:Ke(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:String,...oM,...Wa(["ariaLabel"])}),bde="ElSelect",ort=$e({name:bde,componentName:bde,components:{ElSelectMenu:ert,ElOption:Bte,ElOptions:irt,ElTag:tR,ElScrollbar:a_,ElTooltip:uc,ElIcon:tn},directives:{ClickOutside:cb},props:srt,emits:[Kn,Ms,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=W(()=>{const{modelValue:r,multiple:a}=n,c=a?[]:void 0;return yt(r)?a?r:c:a?c:r}),i=Ki({...Gl(n),modelValue:t}),s=nrt(i,e);pi(cM,Ki({props:i,states:s.states,optionsArray:s.optionsArray,handleOptionSelect:s.handleOptionSelect,onOptionCreate:s.onOptionCreate,onOptionDestroy:s.onOptionDestroy,selectRef:s.selectRef,setSelected:s.setSelected}));const o=W(()=>n.multiple?s.states.selected.map(r=>r.currentLabel):s.states.selectedLabel);return{...s,modelValue:t,selectedLabel:o}}});function rrt(n,e,t,i,s,o){const r=Bt("el-tag"),a=Bt("el-tooltip"),c=Bt("el-icon"),u=Bt("el-option"),d=Bt("el-options"),f=Bt("el-scrollbar"),g=Bt("el-select-menu"),p=N5("click-outside");return Un((G(),he("div",{ref:"selectRef",class:Y([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[ED(n.mouseEnterEventName)]:_=>n.states.inputHovering=!0,onMouseleave:_=>n.states.inputHovering=!1},[ce(a,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,"show-arrow":n.showArrow,offset:n.offset,onBeforeShow:n.handleMenuEnter,onHide:_=>n.states.isBeforeHide=!1},{default:_e(()=>{var _;return[oe("div",{ref:"wrapperRef",class:Y([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:bn(n.toggleMenu,["prevent"])},[n.$slots.prefix?(G(),he("div",{key:0,ref:"prefixRef",class:Y(n.nsSelect.e("prefix"))},[Ye(n.$slots,"prefix")],2)):Qe("v-if",!0),oe("div",{ref:"selectionRef",class:Y([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?Ye(n.$slots,"tag",{key:0},()=>[(G(!0),he(Qt,null,fi(n.showTagList,v=>(G(),he("div",{key:n.getValueKey(v),class:Y(n.nsSelect.e("selected-item"))},[ce(r,{closable:!n.selectDisabled&&!v.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:on(n.tagStyle),onClose:C=>n.deleteTag(C,v)},{default:_e(()=>[oe("span",{class:Y(n.nsSelect.e("tags-text"))},[Ye(n.$slots,"label",{label:v.currentLabel,value:v.value},()=>[mn(st(v.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(G(),nt(a,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:_e(()=>[oe("div",{ref:"collapseItemRef",class:Y(n.nsSelect.e("selected-item"))},[ce(r,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:on(n.collapseTagStyle)},{default:_e(()=>[oe("span",{class:Y(n.nsSelect.e("tags-text"))}," + "+st(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:_e(()=>[oe("div",{ref:"tagMenuRef",class:Y(n.nsSelect.e("selection"))},[(G(!0),he(Qt,null,fi(n.collapseTagList,v=>(G(),he("div",{key:n.getValueKey(v),class:Y(n.nsSelect.e("selected-item"))},[ce(r,{class:"in-tooltip",closable:!n.selectDisabled&&!v.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:C=>n.deleteTag(C,v)},{default:_e(()=>[oe("span",{class:Y(n.nsSelect.e("tags-text"))},[Ye(n.$slots,"label",{label:v.currentLabel,value:v.value},()=>[mn(st(v.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):Qe("v-if",!0)]):Qe("v-if",!0),oe("div",{class:Y([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[Un(oe("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":v=>n.states.inputValue=v,type:"text",name:n.name,class:Y([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:on(n.inputStyle),tabindex:n.tabindex,role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((_=n.hoverOption)==null?void 0:_.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[xs(bn(v=>n.navigateOptions("next"),["stop","prevent"]),["down"]),xs(bn(v=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),xs(bn(n.handleEsc,["stop","prevent"]),["esc"]),xs(bn(n.selectOption,["stop","prevent"]),["enter"]),xs(bn(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:bn(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","tabindex","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[x5,n.states.inputValue]]),n.filterable?(G(),he("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:Y(n.nsSelect.e("input-calculator")),textContent:st(n.states.inputValue)},null,10,["textContent"])):Qe("v-if",!0)],2),n.shouldShowPlaceholder?(G(),he("div",{key:1,class:Y([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?Ye(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[oe("span",null,st(n.currentPlaceholder),1)]):(G(),he("span",{key:1},st(n.currentPlaceholder),1))],2)):Qe("v-if",!0)],2),oe("div",{ref:"suffixRef",class:Y(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(G(),nt(c,{key:0,class:Y([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:_e(()=>[(G(),nt(ui(n.iconComponent)))]),_:1},8,["class"])):Qe("v-if",!0),n.showClose&&n.clearIcon?(G(),nt(c,{key:1,class:Y([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:_e(()=>[(G(),nt(ui(n.clearIcon)))]),_:1},8,["class","onClick"])):Qe("v-if",!0),n.validateState&&n.validateIcon&&n.needStatusIcon?(G(),nt(c,{key:2,class:Y([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:_e(()=>[(G(),nt(ui(n.validateIcon)))]),_:1},8,["class"])):Qe("v-if",!0)],2)],10,["onClick"])]}),content:_e(()=>[ce(g,{ref:"menuRef"},{default:_e(()=>[n.$slots.header?(G(),he("div",{key:0,class:Y(n.nsSelect.be("dropdown","header")),onClick:bn(()=>{},["stop"])},[Ye(n.$slots,"header")],10,["onClick"])):Qe("v-if",!0),Un(ce(f,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:Y([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:_e(()=>[n.showNewOption?(G(),nt(u,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):Qe("v-if",!0),ce(d,null,{default:_e(()=>[Ye(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[Gi,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(G(),he("div",{key:1,class:Y(n.nsSelect.be("dropdown","loading"))},[Ye(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(G(),he("div",{key:2,class:Y(n.nsSelect.be("dropdown","empty"))},[Ye(n.$slots,"empty",{},()=>[oe("span",null,st(n.emptyText),1)])],2)):Qe("v-if",!0),n.$slots.footer?(G(),he("div",{key:3,class:Y(n.nsSelect.be("dropdown","footer")),onClick:bn(()=>{},["stop"])},[Ye(n.$slots,"footer")],10,["onClick"])):Qe("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","show-arrow","offset","onBeforeShow","onHide"])],16,["onMouseleave"])),[[p,n.handleClickOutside,n.popperRef]])}var lrt=Rt(ort,[["render",rrt],["__file","select.vue"]]);const art=$e({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=vt("select"),t=te(null),i=Qn(),s=te([]);pi(N0e,Ki({...Gl(n)}));const o=W(()=>s.value.some(u=>u.visible===!0)),r=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},a=u=>{const d=Gc(u),f=[];return d.forEach(g=>{var p,_;r(g)?f.push(g.component.proxy):(p=g.children)!=null&&p.length?f.push(...a(g.children)):(_=g.component)!=null&&_.subTree&&f.push(...a(g.component.subTree))}),f},c=()=>{s.value=a(i.subTree)};return $n(()=>{c()}),CEe(t,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:o,ns:e}}});function crt(n,e,t,i,s,o){return Un((G(),he("ul",{ref:"groupRef",class:Y(n.ns.be("group","wrap"))},[oe("li",{class:Y(n.ns.be("group","title"))},st(n.label),3),oe("li",null,[oe("ul",{class:Y(n.ns.b("group"))},[Ye(n.$slots,"default")],2)])],2)),[[Gi,n.visible]])}var D0e=Rt(art,[["render",crt],["__file","option-group.vue"]]);const V0=Nn(lrt,{Option:Bte,OptionGroup:D0e}),TW=Xo(Bte),urt=Xo(D0e),Hte=()=>Kt(A0e,{}),drt=Lt({pageSize:{type:Number,required:!0},pageSizes:{type:Ke(Array),default:()=>Ko([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:l_},appendSizeTo:String}),hrt=$e({name:"ElPaginationSizes"}),frt=$e({...hrt,props:drt,emits:["page-size-change"],setup(n,{emit:e}){const t=n,{t:i}=wi(),s=vt("pagination"),o=Hte(),r=te(t.pageSize);ht(()=>t.pageSizes,(u,d)=>{if(!Ha(u,d)&&yt(u)){const f=u.includes(t.pageSize)?t.pageSize:t.pageSizes[0];e("page-size-change",f)}}),ht(()=>t.pageSize,u=>{r.value=u});const a=W(()=>t.pageSizes);function c(u){var d;u!==r.value&&(r.value=u,(d=o.handleSizeChange)==null||d.call(o,Number(u)))}return(u,d)=>(G(),he("span",{class:Y(T(s).e("sizes"))},[ce(T(V0),{"model-value":r.value,disabled:u.disabled,"popper-class":u.popperClass,size:u.size,teleported:u.teleported,"validate-event":!1,"append-to":u.appendSizeTo,onChange:c},{default:_e(()=>[(G(!0),he(Qt,null,fi(T(a),f=>(G(),nt(T(TW),{key:f,value:f,label:f+T(i)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported","append-to"])],2))}});var grt=Rt(frt,[["__file","sizes.vue"]]);const prt=Lt({size:{type:String,values:l_}}),mrt=$e({name:"ElPaginationJumper"}),_rt=$e({...mrt,props:prt,setup(n){const{t:e}=wi(),t=vt("pagination"),{pageCount:i,disabled:s,currentPage:o,changeEvent:r}=Hte(),a=te(),c=W(()=>{var f;return(f=a.value)!=null?f:o==null?void 0:o.value});function u(f){a.value=f?+f:""}function d(f){f=Math.trunc(+f),r==null||r(f),a.value=void 0}return(f,g)=>(G(),he("span",{class:Y(T(t).e("jump")),disabled:T(s)},[oe("span",{class:Y([T(t).e("goto")])},st(T(e)("el.pagination.goto")),3),ce(T(Kc),{size:f.size,class:Y([T(t).e("editor"),T(t).is("in-pagination")]),min:1,max:T(i),disabled:T(s),"model-value":T(c),"validate-event":!1,"aria-label":T(e)("el.pagination.page"),type:"number","onUpdate:modelValue":u,onChange:d},null,8,["size","class","max","disabled","model-value","aria-label"]),oe("span",{class:Y([T(t).e("classifier")])},st(T(e)("el.pagination.pageClassifier")),3)],10,["disabled"]))}});var vrt=Rt(_rt,[["__file","jumper.vue"]]);const brt=Lt({total:{type:Number,default:1e3}}),Trt=$e({name:"ElPaginationTotal"}),Crt=$e({...Trt,props:brt,setup(n){const{t:e}=wi(),t=vt("pagination"),{disabled:i}=Hte();return(s,o)=>(G(),he("span",{class:Y(T(t).e("total")),disabled:T(i)},st(T(e)("el.pagination.total",{total:s.total})),11,["disabled"]))}});var yrt=Rt(Crt,[["__file","total.vue"]]);const Ert=Lt({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),Srt=$e({name:"ElPaginationPager"}),wrt=$e({...Srt,props:Ert,emits:["change"],setup(n,{emit:e}){const t=n,i=vt("pager"),s=vt("icon"),{t:o}=wi(),r=te(!1),a=te(!1),c=te(!1),u=te(!1),d=te(!1),f=te(!1),g=W(()=>{const L=t.pagerCount,O=(L-1)/2,A=Number(t.currentPage),N=Number(t.pageCount);let D=!1,P=!1;N>L&&(A>L-O&&(D=!0),A<N-O&&(P=!0));const F=[];if(D&&!P){const V=N-(L-2);for(let U=V;U<N;U++)F.push(U)}else if(!D&&P)for(let V=2;V<L;V++)F.push(V);else if(D&&P){const V=Math.floor(L/2)-1;for(let U=A-V;U<=A+V;U++)F.push(U)}else for(let V=2;V<N;V++)F.push(V);return F}),p=W(()=>["more","btn-quickprev",s.b(),i.is("disabled",t.disabled)]),_=W(()=>["more","btn-quicknext",s.b(),i.is("disabled",t.disabled)]),v=W(()=>t.disabled?-1:0);Sl(()=>{const L=(t.pagerCount-1)/2;r.value=!1,a.value=!1,t.pageCount>t.pagerCount&&(t.currentPage>t.pagerCount-L&&(r.value=!0),t.currentPage<t.pageCount-L&&(a.value=!0))});function C(L=!1){t.disabled||(L?c.value=!0:u.value=!0)}function y(L=!1){L?d.value=!0:f.value=!0}function w(L){const O=L.target;if(O.tagName.toLowerCase()==="li"&&Array.from(O.classList).includes("number")){const A=Number(O.textContent);A!==t.currentPage&&e("change",A)}else O.tagName.toLowerCase()==="li"&&Array.from(O.classList).includes("more")&&I(L)}function I(L){const O=L.target;if(O.tagName.toLowerCase()==="ul"||t.disabled)return;let A=Number(O.textContent);const N=t.pageCount,D=t.currentPage,P=t.pagerCount-2;O.className.includes("more")&&(O.className.includes("quickprev")?A=D-P:O.className.includes("quicknext")&&(A=D+P)),Number.isNaN(+A)||(A<1&&(A=1),A>N&&(A=N)),A!==D&&e("change",A)}return(L,O)=>(G(),he("ul",{class:Y(T(i).b()),onClick:I,onKeyup:xs(w,["enter"])},[L.pageCount>0?(G(),he("li",{key:0,class:Y([[T(i).is("active",L.currentPage===1),T(i).is("disabled",L.disabled)],"number"]),"aria-current":L.currentPage===1,"aria-label":T(o)("el.pagination.currentPage",{pager:1}),tabindex:T(v)}," 1 ",10,["aria-current","aria-label","tabindex"])):Qe("v-if",!0),r.value?(G(),he("li",{key:1,class:Y(T(p)),tabindex:T(v),"aria-label":T(o)("el.pagination.prevPages",{pager:L.pagerCount-2}),onMouseenter:A=>C(!0),onMouseleave:A=>c.value=!1,onFocus:A=>y(!0),onBlur:A=>d.value=!1},[(c.value||d.value)&&!L.disabled?(G(),nt(T(ey),{key:0})):(G(),nt(T(cue),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):Qe("v-if",!0),(G(!0),he(Qt,null,fi(T(g),A=>(G(),he("li",{key:A,class:Y([[T(i).is("active",L.currentPage===A),T(i).is("disabled",L.disabled)],"number"]),"aria-current":L.currentPage===A,"aria-label":T(o)("el.pagination.currentPage",{pager:A}),tabindex:T(v)},st(A),11,["aria-current","aria-label","tabindex"]))),128)),a.value?(G(),he("li",{key:2,class:Y(T(_)),tabindex:T(v),"aria-label":T(o)("el.pagination.nextPages",{pager:L.pagerCount-2}),onMouseenter:A=>C(),onMouseleave:A=>u.value=!1,onFocus:A=>y(),onBlur:A=>f.value=!1},[(u.value||f.value)&&!L.disabled?(G(),nt(T(ty),{key:0})):(G(),nt(T(cue),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):Qe("v-if",!0),L.pageCount>1?(G(),he("li",{key:3,class:Y([[T(i).is("active",L.currentPage===L.pageCount),T(i).is("disabled",L.disabled)],"number"]),"aria-current":L.currentPage===L.pageCount,"aria-label":T(o)("el.pagination.currentPage",{pager:L.pageCount}),tabindex:T(v)},st(L.pageCount),11,["aria-current","aria-label","tabindex"])):Qe("v-if",!0)],42,["onKeyup"]))}});var Irt=Rt(wrt,[["__file","pager.vue"]]);const fu=n=>typeof n!="number",Lrt=Lt({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:n=>gn(n)&&Math.trunc(n)===n&&n>4&&n<22&&n%2===1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:Ke(Array),default:()=>Ko([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:ks,default:()=>ZC},nextText:{type:String,default:""},nextIcon:{type:ks,default:()=>Au},teleported:{type:Boolean,default:!0},small:Boolean,size:cl,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),Ort={"update:current-page":n=>gn(n),"update:page-size":n=>gn(n),"size-change":n=>gn(n),change:(n,e)=>gn(n)&&gn(e),"current-change":n=>gn(n),"prev-click":n=>gn(n),"next-click":n=>gn(n)},Tde="ElPagination";var Rrt=$e({name:Tde,props:Lrt,emits:Ort,setup(n,{emit:e,slots:t}){const{t:i}=wi(),s=vt("pagination"),o=Qn().vnode.props||{},r=OEe(),a=W(()=>{var O;return n.small?"small":(O=n.size)!=null?O:r.value});RC({from:"small",replacement:"size",version:"3.0.0",scope:"el-pagination",ref:"https://element-plus.org/zh-CN/component/pagination.html"},W(()=>!!n.small));const c="onUpdate:currentPage"in o||"onUpdate:current-page"in o||"onCurrentChange"in o,u="onUpdate:pageSize"in o||"onUpdate:page-size"in o||"onSizeChange"in o,d=W(()=>{if(fu(n.total)&&fu(n.pageCount)||!fu(n.currentPage)&&!c)return!1;if(n.layout.includes("sizes")){if(fu(n.pageCount)){if(!fu(n.total)&&!fu(n.pageSize)&&!u)return!1}else if(!u)return!1}return!0}),f=te(fu(n.defaultPageSize)?10:n.defaultPageSize),g=te(fu(n.defaultCurrentPage)?1:n.defaultCurrentPage),p=W({get(){return fu(n.pageSize)?f.value:n.pageSize},set(O){fu(n.pageSize)&&(f.value=O),u&&(e("update:page-size",O),e("size-change",O))}}),_=W(()=>{let O=0;return fu(n.pageCount)?fu(n.total)||(O=Math.max(1,Math.ceil(n.total/p.value))):O=n.pageCount,O}),v=W({get(){return fu(n.currentPage)?g.value:n.currentPage},set(O){let A=O;O<1?A=1:O>_.value&&(A=_.value),fu(n.currentPage)&&(g.value=A),c&&(e("update:current-page",A),e("current-change",A))}});ht(_,O=>{v.value>O&&(v.value=O)}),ht([v,p],O=>{e("change",...O)},{flush:"post"});function C(O){v.value=O}function y(O){p.value=O;const A=_.value;v.value>A&&(v.value=A)}function w(){n.disabled||(v.value-=1,e("prev-click",v.value))}function I(){n.disabled||(v.value+=1,e("next-click",v.value))}function L(O,A){O&&(O.props||(O.props={}),O.props.class=[O.props.class,A].join(" "))}return pi(A0e,{pageCount:_,disabled:W(()=>n.disabled),currentPage:v,changeEvent:C,handleSizeChange:y}),()=>{var O,A;if(!d.value)return i("el.pagination.deprecationWarning"),null;if(!n.layout||n.hideOnSinglePage&&_.value<=1)return null;const N=[],D=[],P=hn("div",{class:s.e("rightwrapper")},D),F={prev:hn(Got,{disabled:n.disabled,currentPage:v.value,prevText:n.prevText,prevIcon:n.prevIcon,onClick:w}),jumper:hn(vrt,{size:a.value}),pager:hn(Irt,{currentPage:v.value,pageCount:_.value,pagerCount:n.pagerCount,onChange:C,disabled:n.disabled}),next:hn(Xot,{disabled:n.disabled,currentPage:v.value,pageCount:_.value,nextText:n.nextText,nextIcon:n.nextIcon,onClick:I}),sizes:hn(grt,{pageSize:p.value,pageSizes:n.pageSizes,popperClass:n.popperClass,disabled:n.disabled,teleported:n.teleported,size:a.value,appendSizeTo:n.appendSizeTo}),slot:(A=(O=t==null?void 0:t.default)==null?void 0:O.call(t))!=null?A:null,total:hn(yrt,{total:fu(n.total)?0:n.total})},V=n.layout.split(",").map(Q=>Q.trim());let U=!1;return V.forEach(Q=>{if(Q==="->"){U=!0;return}U?D.push(F[Q]):N.push(F[Q])}),L(N[0],s.is("first")),L(N[N.length-1],s.is("last")),U&&D.length>0&&(L(D[0],s.is("first")),L(D[D.length-1],s.is("last")),N.push(P)),hn("div",{class:[s.b(),s.is("background",n.background),s.m(a.value)]},N)}}});const Mrt=Nn(Rrt),krt=Lt({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:TX,default:"primary"},cancelButtonType:{type:String,values:TX,default:"text"},icon:{type:ks,default:()=>ije},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1},hideAfter:{type:Number,default:200},teleported:ua.teleported,persistent:ua.persistent,width:{type:[String,Number],default:150}}),Art={confirm:n=>n instanceof MouseEvent,cancel:n=>n instanceof MouseEvent},Nrt=$e({name:"ElPopconfirm"}),Drt=$e({...Nrt,props:krt,emits:Art,setup(n,{emit:e}){const t=n,{t:i}=wi(),s=vt("popconfirm"),o=te(),r=()=>{var g,p;(p=(g=o.value)==null?void 0:g.onClose)==null||p.call(g)},a=W(()=>({width:mr(t.width)})),c=g=>{e("confirm",g),r()},u=g=>{e("cancel",g),r()},d=W(()=>t.confirmButtonText||i("el.popconfirm.confirmButtonText")),f=W(()=>t.cancelButtonText||i("el.popconfirm.cancelButtonText"));return(g,p)=>(G(),nt(T(uc),hi({ref_key:"tooltipRef",ref:o,trigger:"click",effect:"light"},g.$attrs,{"popper-class":`${T(s).namespace.value}-popover`,"popper-style":T(a),teleported:g.teleported,"fallback-placements":["bottom","top","right","left"],"hide-after":g.hideAfter,persistent:g.persistent}),{content:_e(()=>[oe("div",{class:Y(T(s).b())},[oe("div",{class:Y(T(s).e("main"))},[!g.hideIcon&&g.icon?(G(),nt(T(tn),{key:0,class:Y(T(s).e("icon")),style:on({color:g.iconColor})},{default:_e(()=>[(G(),nt(ui(g.icon)))]),_:1},8,["class","style"])):Qe("v-if",!0),mn(" "+st(g.title),1)],2),oe("div",{class:Y(T(s).e("action"))},[Ye(g.$slots,"actions",{confirm:c,cancel:u},()=>[ce(T(_a),{size:"small",type:g.cancelButtonType==="text"?"":g.cancelButtonType,text:g.cancelButtonType==="text",onClick:u},{default:_e(()=>[mn(st(T(f)),1)]),_:1},8,["type","text"]),ce(T(_a),{size:"small",type:g.confirmButtonType==="text"?"":g.confirmButtonType,text:g.confirmButtonType==="text",onClick:c},{default:_e(()=>[mn(st(T(d)),1)]),_:1},8,["type","text"])])],2)],2)]),default:_e(()=>[g.$slots.reference?Ye(g.$slots,"reference",{key:0}):Qe("v-if",!0)]),_:3},16,["popper-class","popper-style","teleported","hide-after","persistent"]))}});var $rt=Rt(Drt,[["__file","popconfirm.vue"]]);const xrt=Nn($rt),Prt=Lt({trigger:rx.trigger,placement:NU.placement,disabled:rx.disabled,visible:ua.visible,transition:ua.transition,popperOptions:NU.popperOptions,tabindex:NU.tabindex,content:ua.content,popperStyle:ua.popperStyle,popperClass:ua.popperClass,enterable:{...ua.enterable,default:!0},effect:{...ua.effect,default:"light"},teleported:ua.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Frt={"update:visible":n=>Us(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Brt="onUpdate:visible",Hrt=$e({name:"ElPopover"}),Vrt=$e({...Hrt,props:Prt,emits:Frt,setup(n,{expose:e,emit:t}){const i=n,s=W(()=>i[Brt]),o=vt("popover"),r=te(),a=W(()=>{var C;return(C=T(r))==null?void 0:C.popperRef}),c=W(()=>[{width:mr(i.width)},i.popperStyle]),u=W(()=>[o.b(),i.popperClass,{[o.m("plain")]:!!i.content}]),d=W(()=>i.transition===`${o.namespace.value}-fade-in-linear`),f=()=>{var C;(C=r.value)==null||C.hide()},g=()=>{t("before-enter")},p=()=>{t("before-leave")},_=()=>{t("after-enter")},v=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:a,hide:f}),(C,y)=>(G(),nt(T(uc),hi({ref_key:"tooltipRef",ref:r},C.$attrs,{trigger:C.trigger,placement:C.placement,disabled:C.disabled,visible:C.visible,transition:C.transition,"popper-options":C.popperOptions,tabindex:C.tabindex,content:C.content,offset:C.offset,"show-after":C.showAfter,"hide-after":C.hideAfter,"auto-close":C.autoClose,"show-arrow":C.showArrow,"aria-label":C.title,effect:C.effect,enterable:C.enterable,"popper-class":T(u),"popper-style":T(c),teleported:C.teleported,persistent:C.persistent,"gpu-acceleration":T(d),"onUpdate:visible":T(s),onBeforeShow:g,onBeforeHide:p,onShow:_,onHide:v}),{content:_e(()=>[C.title?(G(),he("div",{key:0,class:Y(T(o).e("title")),role:"title"},st(C.title),3)):Qe("v-if",!0),Ye(C.$slots,"default",{},()=>[mn(st(C.content),1)])]),default:_e(()=>[C.$slots.reference?Ye(C.$slots,"reference",{key:0}):Qe("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var Urt=Rt(Vrt,[["__file","popover.vue"]]);const Cde=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var Wrt={mounted(n,e){Cde(n,e)},updated(n,e){Cde(n,e)}};const Grt="popover",$0e=lKe(Wrt,Grt),zrt=Nn(Urt,{directive:$0e}),Krt=Lt({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:n=>n>=0&&n<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:Boolean,duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:Ke(String),default:"round"},textInside:Boolean,width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:Ke([String,Array,Function]),default:""},striped:Boolean,stripedFlow:Boolean,format:{type:Ke(Function),default:n=>`${n}%`}}),jrt=$e({name:"ElProgress"}),Xrt=$e({...jrt,props:Krt,setup(n){const e=n,t={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},i=vt("progress"),s=W(()=>{const I={width:`${e.percentage}%`,animationDuration:`${e.duration}s`},L=w(e.percentage);return L.includes("gradient")?I.background=L:I.backgroundColor=L,I}),o=W(()=>(e.strokeWidth/e.width*100).toFixed(1)),r=W(()=>["circle","dashboard"].includes(e.type)?Number.parseInt(`${50-Number.parseFloat(o.value)/2}`,10):0),a=W(()=>{const I=r.value,L=e.type==="dashboard";return`
- M 50 50
- m 0 ${L?"":"-"}${I}
- a ${I} ${I} 0 1 1 0 ${L?"-":""}${I*2}
- a ${I} ${I} 0 1 1 0 ${L?"":"-"}${I*2}
- `}),c=W(()=>2*Math.PI*r.value),u=W(()=>e.type==="dashboard"?.75:1),d=W(()=>`${-1*c.value*(1-u.value)/2}px`),f=W(()=>({strokeDasharray:`${c.value*u.value}px, ${c.value}px`,strokeDashoffset:d.value})),g=W(()=>({strokeDasharray:`${c.value*u.value*(e.percentage/100)}px, ${c.value}px`,strokeDashoffset:d.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),p=W(()=>{let I;return e.color?I=w(e.percentage):I=t[e.status]||t.default,I}),_=W(()=>e.status==="warning"?C8:e.type==="line"?e.status==="success"?ete:Ob:e.status==="success"?oF:Zg),v=W(()=>e.type==="line"?12+e.strokeWidth*.4:e.width*.111111+2),C=W(()=>e.format(e.percentage));function y(I){const L=100/I.length;return I.map((A,N)=>sn(A)?{color:A,percentage:(N+1)*L}:A).sort((A,N)=>A.percentage-N.percentage)}const w=I=>{var L;const{color:O}=e;if(ln(O))return O(I);if(sn(O))return O;{const A=y(O);for(const N of A)if(N.percentage>I)return N.color;return(L=A[A.length-1])==null?void 0:L.color}};return(I,L)=>(G(),he("div",{class:Y([T(i).b(),T(i).m(I.type),T(i).is(I.status),{[T(i).m("without-text")]:!I.showText,[T(i).m("text-inside")]:I.textInside}]),role:"progressbar","aria-valuenow":I.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[I.type==="line"?(G(),he("div",{key:0,class:Y(T(i).b("bar"))},[oe("div",{class:Y(T(i).be("bar","outer")),style:on({height:`${I.strokeWidth}px`})},[oe("div",{class:Y([T(i).be("bar","inner"),{[T(i).bem("bar","inner","indeterminate")]:I.indeterminate},{[T(i).bem("bar","inner","striped")]:I.striped},{[T(i).bem("bar","inner","striped-flow")]:I.stripedFlow}]),style:on(T(s))},[(I.showText||I.$slots.default)&&I.textInside?(G(),he("div",{key:0,class:Y(T(i).be("bar","innerText"))},[Ye(I.$slots,"default",{percentage:I.percentage},()=>[oe("span",null,st(T(C)),1)])],2)):Qe("v-if",!0)],6)],6)],2)):(G(),he("div",{key:1,class:Y(T(i).b("circle")),style:on({height:`${I.width}px`,width:`${I.width}px`})},[(G(),he("svg",{viewBox:"0 0 100 100"},[oe("path",{class:Y(T(i).be("circle","track")),d:T(a),stroke:`var(${T(i).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":I.strokeLinecap,"stroke-width":T(o),fill:"none",style:on(T(f))},null,14,["d","stroke","stroke-linecap","stroke-width"]),oe("path",{class:Y(T(i).be("circle","path")),d:T(a),stroke:T(p),fill:"none",opacity:I.percentage?1:0,"stroke-linecap":I.strokeLinecap,"stroke-width":T(o),style:on(T(g))},null,14,["d","stroke","opacity","stroke-linecap","stroke-width"])]))],6)),(I.showText||I.$slots.default)&&!I.textInside?(G(),he("div",{key:2,class:Y(T(i).e("text")),style:on({fontSize:`${T(v)}px`})},[Ye(I.$slots,"default",{percentage:I.percentage},()=>[I.status?(G(),nt(T(tn),{key:1},{default:_e(()=>[(G(),nt(ui(T(_))))]),_:1})):(G(),he("span",{key:0},st(T(C)),1))])],6)):Qe("v-if",!0)],10,["aria-valuenow"]))}});var Yrt=Rt(Xrt,[["__file","progress.vue"]]);const x0e=Nn(Yrt),qrt=Lt({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:Ke([Array,Object]),default:()=>Ko(["","",""])},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:Ke([Array,Object]),default:()=>[yH,yH,yH]},voidIcon:{type:ks,default:()=>vje},disabledVoidIcon:{type:ks,default:()=>yH},disabled:Boolean,allowHalf:Boolean,showText:Boolean,showScore:Boolean,textColor:{type:String,default:""},texts:{type:Ke(Array),default:()=>Ko(["Extremely bad","Disappointed","Fair","Satisfied","Surprise"])},scoreTemplate:{type:String,default:"{value}"},size:cl,clearable:Boolean,...Wa(["ariaLabel"])}),Jrt={[Ms]:n=>gn(n),[Kn]:n=>gn(n)},Qrt=$e({name:"ElRate"}),Zrt=$e({...Qrt,props:qrt,emits:Jrt,setup(n,{expose:e,emit:t}){const i=n;function s(K,re){const Z=ve=>si(ve),J=Object.keys(re).map(ve=>+ve).filter(ve=>{const Le=re[ve];return(Z(Le)?Le.excluded:!1)?K<ve:K<=ve}).sort((ve,Le)=>ve-Le),ge=re[J[0]];return Z(ge)&&ge.value||ge}const o=Kt(Dw,void 0),r=Kt(zm,void 0),a=jr(),c=vt("rate"),{inputId:u,isLabeledByFormItem:d}=Qf(i,{formItemContext:r}),f=te(i.modelValue),g=te(-1),p=te(!0),_=W(()=>[c.b(),c.m(a.value)]),v=W(()=>i.disabled||(o==null?void 0:o.disabled)),C=W(()=>c.cssVarBlock({"void-color":i.voidColor,"disabled-void-color":i.disabledVoidColor,"fill-color":L.value})),y=W(()=>{let K="";return i.showScore?K=i.scoreTemplate.replace(/\{\s*value\s*\}/,v.value?`${i.modelValue}`:`${f.value}`):i.showText&&(K=i.texts[Math.ceil(f.value)-1]),K}),w=W(()=>i.modelValue*100-Math.floor(i.modelValue)*100),I=W(()=>yt(i.colors)?{[i.lowThreshold]:i.colors[0],[i.highThreshold]:{value:i.colors[1],excluded:!0},[i.max]:i.colors[2]}:i.colors),L=W(()=>{const K=s(f.value,I.value);return si(K)?"":K}),O=W(()=>{let K="";return v.value?K=`${w.value}%`:i.allowHalf&&(K="50%"),{color:L.value,width:K}}),A=W(()=>{let K=yt(i.icons)?[...i.icons]:{...i.icons};return K=Nm(K),yt(K)?{[i.lowThreshold]:K[0],[i.highThreshold]:{value:K[1],excluded:!0},[i.max]:K[2]}:K}),N=W(()=>s(i.modelValue,A.value)),D=W(()=>v.value?sn(i.disabledVoidIcon)?i.disabledVoidIcon:Nm(i.disabledVoidIcon):sn(i.voidIcon)?i.voidIcon:Nm(i.voidIcon)),P=W(()=>s(f.value,A.value));function F(K){const re=v.value&&w.value>0&&K-1<i.modelValue&&K>i.modelValue,Z=i.allowHalf&&p.value&&K-.5<=f.value&&K>f.value;return re||Z}function V(K){i.clearable&&K===i.modelValue&&(K=0),t(Kn,K),i.modelValue!==K&&t("change",K)}function U(K){v.value||(i.allowHalf&&p.value?V(f.value):V(K))}function Q(K){if(v.value)return;let re=f.value;const Z=K.code;return Z===zt.up||Z===zt.right?(i.allowHalf?re+=.5:re+=1,K.stopPropagation(),K.preventDefault()):(Z===zt.left||Z===zt.down)&&(i.allowHalf?re-=.5:re-=1,K.stopPropagation(),K.preventDefault()),re=re<0?0:re,re=re>i.max?i.max:re,t(Kn,re),t("change",re),re}function de(K,re){if(!v.value){if(i.allowHalf&&re){let Z=re.target;Td(Z,c.e("item"))&&(Z=Z.querySelector(`.${c.e("icon")}`)),(Z.clientWidth===0||Td(Z,c.e("decimal")))&&(Z=Z.parentNode),p.value=re.offsetX*2<=Z.clientWidth,f.value=p.value?K-.5:K}else f.value=K;g.value=K}}function q(){v.value||(i.allowHalf&&(p.value=i.modelValue!==Math.floor(i.modelValue)),f.value=i.modelValue,g.value=-1)}return ht(()=>i.modelValue,K=>{f.value=K,p.value=i.modelValue!==Math.floor(i.modelValue)}),i.modelValue||t(Kn,0),e({setCurrentValue:de,resetCurrentValue:q}),(K,re)=>{var Z;return G(),he("div",{id:T(u),class:Y([T(_),T(c).is("disabled",T(v))]),role:"slider","aria-label":T(d)?void 0:K.ariaLabel||"rating","aria-labelledby":T(d)?(Z=T(r))==null?void 0:Z.labelId:void 0,"aria-valuenow":f.value,"aria-valuetext":T(y)||void 0,"aria-valuemin":"0","aria-valuemax":K.max,tabindex:"0",style:on(T(C)),onKeydown:Q},[(G(!0),he(Qt,null,fi(K.max,(J,ge)=>(G(),he("span",{key:ge,class:Y(T(c).e("item")),onMousemove:ve=>de(J,ve),onMouseleave:q,onClick:ve=>U(J)},[ce(T(tn),{class:Y([T(c).e("icon"),{hover:g.value===J},T(c).is("active",J<=f.value)])},{default:_e(()=>[F(J)?Qe("v-if",!0):(G(),he(Qt,{key:0},[Un((G(),nt(ui(T(P)),null,null,512)),[[Gi,J<=f.value]]),Un((G(),nt(ui(T(D)),null,null,512)),[[Gi,!(J<=f.value)]])],64)),F(J)?(G(),he(Qt,{key:1},[(G(),nt(ui(T(D)),{class:Y([T(c).em("decimal","box")])},null,8,["class"])),ce(T(tn),{style:on(T(O)),class:Y([T(c).e("icon"),T(c).e("decimal")])},{default:_e(()=>[(G(),nt(ui(T(N))))]),_:1},8,["style","class"])],64)):Qe("v-if",!0)]),_:2},1032,["class"])],42,["onMousemove","onClick"]))),128)),K.showText||K.showScore?(G(),he("span",{key:0,class:Y(T(c).e("text")),style:on({color:K.textColor})},st(T(y)),7)):Qe("v-if",!0)],46,["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax"])}}});var elt=Rt(Zrt,[["__file","rate.vue"]]);const tlt=Nn(elt),x1={success:"icon-success",warning:"icon-warning",error:"icon-error",info:"icon-info"},yde={[x1.success]:IKe,[x1.warning]:C8,[x1.error]:tte,[x1.info]:nte},nlt=Lt({title:{type:String,default:""},subTitle:{type:String,default:""},icon:{type:String,values:["success","warning","info","error"],default:"info"}}),ilt=$e({name:"ElResult"}),slt=$e({...ilt,props:nlt,setup(n){const e=n,t=vt("result"),i=W(()=>{const s=e.icon,o=s&&x1[s]?x1[s]:"icon-info",r=yde[o]||yde["icon-info"];return{class:o,component:r}});return(s,o)=>(G(),he("div",{class:Y(T(t).b())},[oe("div",{class:Y(T(t).e("icon"))},[Ye(s.$slots,"icon",{},()=>[T(i).component?(G(),nt(ui(T(i).component),{key:0,class:Y(T(i).class)},null,8,["class"])):Qe("v-if",!0)])],2),s.title||s.$slots.title?(G(),he("div",{key:0,class:Y(T(t).e("title"))},[Ye(s.$slots,"title",{},()=>[oe("p",null,st(s.title),1)])],2)):Qe("v-if",!0),s.subTitle||s.$slots["sub-title"]?(G(),he("div",{key:1,class:Y(T(t).e("subtitle"))},[Ye(s.$slots,"sub-title",{},()=>[oe("p",null,st(s.subTitle),1)])],2)):Qe("v-if",!0),s.$slots.extra?(G(),he("div",{key:2,class:Y(T(t).e("extra"))},[Ye(s.$slots,"extra")],2)):Qe("v-if",!0)],2))}});var olt=Rt(slt,[["__file","result.vue"]]);const rlt=Nn(olt),llt=["start","center","end","space-around","space-between","space-evenly"],alt=["top","middle","bottom"],clt=Lt({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:llt,default:"start"},align:{type:String,values:alt}}),ult=$e({name:"ElRow"}),dlt=$e({...ult,props:clt,setup(n){const e=n,t=vt("row"),i=W(()=>e.gutter);pi(WSe,{gutter:i});const s=W(()=>{const r={};return e.gutter&&(r.marginRight=r.marginLeft=`-${e.gutter/2}px`),r}),o=W(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(r,a)=>(G(),nt(ui(r.tag),{class:Y(T(o)),style:on(T(s))},{default:_e(()=>[Ye(r.$slots,"default")]),_:3},8,["class","style"]))}});var hlt=Rt(dlt,[["__file","row.vue"]]);const flt=Nn(hlt),glt=$e({props:{item:{type:Object,required:!0},style:{type:Object},height:Number},setup(){return{ns:vt("select")}}});function plt(n,e,t,i,s,o){return G(),he("div",{class:Y(n.ns.be("group","title")),style:on({...n.style,lineHeight:`${n.height}px`})},st(n.item.label),7)}var mlt=Rt(glt,[["render",plt],["__file","group-item.vue"]]);function _lt(n,{emit:e}){return{hoverItem:()=>{n.disabled||e("hover",n.index)},selectOptionClick:()=>{n.disabled||e("select",n.item,n.index)}}}const P0e={label:"label",value:"value",disabled:"disabled",options:"options"};function k8(n){const e=W(()=>({...P0e,...n.props}));return{aliasProps:e,getLabel:r=>Fr(r,e.value.label),getValue:r=>Fr(r,e.value.value),getDisabled:r=>Fr(r,e.value.disabled),getOptions:r=>Fr(r,e.value.options)}}const vlt=Lt({allowCreate:Boolean,autocomplete:{type:Ke(String),default:"none"},automaticDropdown:Boolean,clearable:Boolean,clearIcon:{type:ks,default:Ob},effect:{type:Ke(String),default:"light"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},defaultFirstOption:Boolean,disabled:Boolean,estimatedOptionHeight:{type:Number,default:void 0},filterable:Boolean,filterMethod:Function,height:{type:Number,default:274},itemHeight:{type:Number,default:34},id:String,loading:Boolean,loadingText:String,modelValue:{type:Ke([Array,String,Number,Boolean,Object])},multiple:Boolean,multipleLimit:{type:Number,default:0},name:String,noDataText:String,noMatchText:String,remoteMethod:Function,reserveKeyword:{type:Boolean,default:!0},options:{type:Ke(Array),required:!0},placeholder:{type:String},teleported:ua.teleported,persistent:{type:Boolean,default:!0},popperClass:{type:String,default:""},popperOptions:{type:Ke(Object),default:()=>({})},remote:Boolean,size:cl,props:{type:Ke(Object),default:()=>P0e},valueKey:{type:String,default:"value"},scrollbarAlwaysOn:Boolean,validateEvent:{type:Boolean,default:!0},offset:{type:Number,default:12},showArrow:{type:Boolean,default:!0},placement:{type:Ke(String),values:Rb,default:"bottom-start"},fallbackPlacements:{type:Ke(Array),default:["bottom-start","top-start","right","left"]},tagType:{...ab.type,default:"info"},tagEffect:{...ab.effect,default:"light"},tabindex:{type:[String,Number],default:0},appendTo:String,...oM,...Wa(["ariaLabel"])}),blt=Lt({data:Array,disabled:Boolean,hovering:Boolean,item:{type:Ke(Object),required:!0},index:Number,style:Object,selected:Boolean,created:Boolean}),Tlt={[Kn]:n=>!0,[Ms]:n=>!0,"remove-tag":n=>!0,"visible-change":n=>!0,focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0},Clt={hover:n=>gn(n),select:(n,e)=>!0},Vte=Symbol("ElSelectV2Injection"),ylt=$e({props:blt,emits:Clt,setup(n,{emit:e}){const t=Kt(Vte),i=vt("select"),{hoverItem:s,selectOptionClick:o}=_lt(n,{emit:e}),{getLabel:r}=k8(t.props);return{ns:i,hoverItem:s,selectOptionClick:o,getLabel:r}}});function Elt(n,e,t,i,s,o){return G(),he("li",{"aria-selected":n.selected,style:on(n.style),class:Y([n.ns.be("dropdown","item"),n.ns.is("selected",n.selected),n.ns.is("disabled",n.disabled),n.ns.is("created",n.created),n.ns.is("hovering",n.hovering)]),onMousemove:n.hoverItem,onClick:bn(n.selectOptionClick,["stop"])},[Ye(n.$slots,"default",{item:n.item,index:n.index,disabled:n.disabled},()=>[oe("span",null,st(n.getLabel(n.item)),1)])],46,["aria-selected","onMousemove","onClick"])}var Slt=Rt(ylt,[["render",Elt],["__file","option-item.vue"]]),Ede=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function wlt(n,e){return!!(n===e||Ede(n)&&Ede(e))}function Ilt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!wlt(n[t],e[t]))return!1;return!0}function Llt(n,e){e===void 0&&(e=Ilt);var t=null;function i(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var r=n.apply(this,s);return t={lastResult:r,lastArgs:s,lastThis:this},r}return i.clear=function(){t=null},i}const F0e=()=>{const e=Qn().proxy.$props;return W(()=>{const t=(i,s,o)=>({});return e.perfMode?g8(t):Llt(t)})},VX=50,CW="itemRendered",yW="scroll",P1="forward",EW="backward",Rf="auto",A8="smart",ux="start",Rm="center",dx="end",iR="horizontal",Ute="vertical",Olt="ltr",dO="rtl",hx="negative",Wte="positive-ascending",Gte="positive-descending",Rlt={[iR]:"left",[Ute]:"top"},Mlt=20,klt={[iR]:"deltaX",[Ute]:"deltaY"},Alt=({atEndEdge:n,atStartEdge:e,layout:t},i)=>{let s,o=0;const r=c=>c<0&&e.value||c>0&&n.value;return{hasReachedEdge:r,onWheel:c=>{H0(s);const u=c[klt[t.value]];r(o)&&r(o+u)||(o+=u,E8()||c.preventDefault(),s=QC(()=>{i(o),o=0}))}}},UX=fp({type:Ke([Number,Function]),required:!0}),WX=fp({type:Number}),GX=fp({type:Number,default:2}),Nlt=fp({type:String,values:["ltr","rtl"],default:"ltr"}),zX=fp({type:Number,default:0}),SW=fp({type:Number,required:!0}),B0e=fp({type:String,values:["horizontal","vertical"],default:Ute}),H0e=Lt({className:{type:String,default:""},containerElement:{type:Ke([String,Object]),default:"div"},data:{type:Ke(Array),default:()=>Ko([])},direction:Nlt,height:{type:[String,Number],required:!0},innerElement:{type:[String,Object],default:"div"},style:{type:Ke([Object,String,Array])},useIsScrolling:{type:Boolean,default:!1},width:{type:[Number,String],required:!1},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:{type:Boolean,default:!1}}),V0e=Lt({cache:GX,estimatedItemSize:WX,layout:B0e,initScrollOffset:zX,total:SW,itemSize:UX,...H0e}),KX={type:Number,default:6},U0e={type:Number,default:0},W0e={type:Number,default:2},c0=Lt({columnCache:GX,columnWidth:UX,estimatedColumnWidth:WX,estimatedRowHeight:WX,initScrollLeft:zX,initScrollTop:zX,itemKey:{type:Ke(Function),default:({columnIndex:n,rowIndex:e})=>`${e}:${n}`},rowCache:GX,rowHeight:UX,totalColumn:SW,totalRow:SW,hScrollbarSize:KX,vScrollbarSize:KX,scrollbarStartGap:U0e,scrollbarEndGap:W0e,role:String,...H0e}),G0e=Lt({alwaysOn:Boolean,class:String,layout:B0e,total:SW,ratio:{type:Number,required:!0},clientSize:{type:Number,required:!0},scrollFrom:{type:Number,required:!0},scrollbarSize:KX,startGap:U0e,endGap:W0e,visible:Boolean}),GS=(n,e)=>n<e?P1:EW,fx=n=>n===Olt||n===dO||n===iR,Sde=n=>n===dO;let YL=null;function wW(n=!1){if(YL===null||n){const e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";const i=document.createElement("div"),s=i.style;return s.width="100px",s.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?YL=Gte:(e.scrollLeft=1,e.scrollLeft===0?YL=hx:YL=Wte),document.body.removeChild(e),YL}return YL}function Dlt({move:n,size:e,bar:t},i){const s={},o=`translate${t.axis}(${n}px)`;return s[t.size]=e,s.transform=o,s.msTransform=o,s.webkitTransform=o,i==="horizontal"?s.height="100%":s.width="100%",s}const jX=$e({name:"ElVirtualScrollBar",props:G0e,emits:["scroll","start-move","stop-move"],setup(n,{emit:e}){const t=W(()=>n.startGap+n.endGap),i=vt("virtual-scrollbar"),s=vt("scrollbar"),o=te(),r=te();let a=null,c=null;const u=Ki({isDragging:!1,traveled:0}),d=W(()=>UEe[n.layout]),f=W(()=>n.clientSize-T(t)),g=W(()=>({position:"absolute",width:`${iR===n.layout?f.value:n.scrollbarSize}px`,height:`${iR===n.layout?n.scrollbarSize:f.value}px`,[Rlt[n.layout]]:"2px",right:"2px",bottom:"2px",borderRadius:"4px"})),p=W(()=>{const A=n.ratio,N=n.clientSize;if(A>=100)return Number.POSITIVE_INFINITY;if(A>=50)return A*N/100;const D=N/3;return Math.floor(Math.min(Math.max(A*N,Mlt),D))}),_=W(()=>{if(!Number.isFinite(p.value))return{display:"none"};const A=`${p.value}px`;return Dlt({bar:d.value,size:A,move:u.traveled},n.layout)}),v=W(()=>Math.floor(n.clientSize-p.value-T(t))),C=()=>{window.addEventListener("mousemove",L),window.addEventListener("mouseup",I);const A=T(r);A&&(c=document.onselectstart,document.onselectstart=()=>!1,A.addEventListener("touchmove",L,{passive:!0}),A.addEventListener("touchend",I))},y=()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",I),document.onselectstart=c,c=null;const A=T(r);A&&(A.removeEventListener("touchmove",L),A.removeEventListener("touchend",I))},w=A=>{A.stopImmediatePropagation(),!(A.ctrlKey||[1,2].includes(A.button))&&(u.isDragging=!0,u[d.value.axis]=A.currentTarget[d.value.offset]-(A[d.value.client]-A.currentTarget.getBoundingClientRect()[d.value.direction]),e("start-move"),C())},I=()=>{u.isDragging=!1,u[d.value.axis]=0,e("stop-move"),y()},L=A=>{const{isDragging:N}=u;if(!N||!r.value||!o.value)return;const D=u[d.value.axis];if(!D)return;H0(a);const P=(o.value.getBoundingClientRect()[d.value.direction]-A[d.value.client])*-1,F=r.value[d.value.offset]-D,V=P-F;a=QC(()=>{u.traveled=Math.max(n.startGap,Math.min(V,v.value)),e("scroll",V,v.value)})},O=A=>{const N=Math.abs(A.target.getBoundingClientRect()[d.value.direction]-A[d.value.client]),D=r.value[d.value.offset]/2,P=N-D;u.traveled=Math.max(0,Math.min(P,v.value)),e("scroll",P,v.value)};return ht(()=>n.scrollFrom,A=>{u.isDragging||(u.traveled=Math.ceil(A*v.value))}),As(()=>{y()}),()=>hn("div",{role:"presentation",ref:o,class:[i.b(),n.class,(n.alwaysOn||u.isDragging)&&"always-on"],style:g.value,onMousedown:bn(O,["stop","prevent"]),onTouchstartPrevent:w},hn("div",{ref:r,class:s.e("thumb"),style:_.value,onMousedown:w},[]))}}),z0e=({name:n,getOffset:e,getItemSize:t,getItemOffset:i,getEstimatedTotalSize:s,getStartIndexForOffset:o,getStopIndexForStartIndex:r,initCache:a,clearCache:c,validateProps:u})=>$e({name:n??"ElVirtualList",props:V0e,emits:[CW,yW],setup(d,{emit:f,expose:g}){u(d);const p=Qn(),_=vt("vl"),v=te(a(d,p)),C=F0e(),y=te(),w=te(),I=te(),L=te({isScrolling:!1,scrollDir:"forward",scrollOffset:gn(d.initScrollOffset)?d.initScrollOffset:0,updateRequested:!1,isScrollbarDragging:!1,scrollbarAlwaysOn:d.scrollbarAlwaysOn}),O=W(()=>{const{total:Ee,cache:Ne}=d,{isScrolling:qe,scrollDir:Re,scrollOffset:we}=T(L);if(Ee===0)return[0,0,0,0];const Ve=o(d,we,T(v)),Ge=r(d,Ve,we,T(v)),dt=!qe||Re===EW?Math.max(1,Ne):1,ze=!qe||Re===P1?Math.max(1,Ne):1;return[Math.max(0,Ve-dt),Math.max(0,Math.min(Ee-1,Ge+ze)),Ve,Ge]}),A=W(()=>s(d,T(v))),N=W(()=>fx(d.layout)),D=W(()=>[{position:"relative",[`overflow-${N.value?"x":"y"}`]:"scroll",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:d.direction,height:gn(d.height)?`${d.height}px`:d.height,width:gn(d.width)?`${d.width}px`:d.width},d.style]),P=W(()=>{const Ee=T(A),Ne=T(N);return{height:Ne?"100%":`${Ee}px`,pointerEvents:T(L).isScrolling?"none":void 0,width:Ne?`${Ee}px`:"100%"}}),F=W(()=>N.value?d.width:d.height),{onWheel:V}=Alt({atStartEdge:W(()=>L.value.scrollOffset<=0),atEndEdge:W(()=>L.value.scrollOffset>=A.value),layout:W(()=>d.layout)},Ee=>{var Ne,qe;(qe=(Ne=I.value).onMouseUp)==null||qe.call(Ne),re(Math.min(L.value.scrollOffset+Ee,A.value-F.value))});Es(y,"wheel",V,{passive:!1});const U=()=>{const{total:Ee}=d;if(Ee>0){const[we,Ve,Ge,dt]=T(O);f(CW,we,Ve,Ge,dt)}const{scrollDir:Ne,scrollOffset:qe,updateRequested:Re}=T(L);f(yW,Ne,qe,Re)},Q=Ee=>{const{clientHeight:Ne,scrollHeight:qe,scrollTop:Re}=Ee.currentTarget,we=T(L);if(we.scrollOffset===Re)return;const Ve=Math.max(0,Math.min(Re,qe-Ne));L.value={...we,isScrolling:!0,scrollDir:GS(we.scrollOffset,Ve),scrollOffset:Ve,updateRequested:!1},cn(ge)},de=Ee=>{const{clientWidth:Ne,scrollLeft:qe,scrollWidth:Re}=Ee.currentTarget,we=T(L);if(we.scrollOffset===qe)return;const{direction:Ve}=d;let Ge=qe;if(Ve===dO)switch(wW()){case hx:{Ge=-qe;break}case Gte:{Ge=Re-Ne-qe;break}}Ge=Math.max(0,Math.min(Ge,Re-Ne)),L.value={...we,isScrolling:!0,scrollDir:GS(we.scrollOffset,Ge),scrollOffset:Ge,updateRequested:!1},cn(ge)},q=Ee=>{T(N)?de(Ee):Q(Ee),U()},K=(Ee,Ne)=>{const qe=(A.value-F.value)/Ne*Ee;re(Math.min(A.value-F.value,qe))},re=Ee=>{Ee=Math.max(Ee,0),Ee!==T(L).scrollOffset&&(L.value={...T(L),scrollOffset:Ee,scrollDir:GS(T(L).scrollOffset,Ee),updateRequested:!0},cn(ge))},Z=(Ee,Ne=Rf)=>{const{scrollOffset:qe}=T(L);Ee=Math.max(0,Math.min(Ee,d.total-1)),re(e(d,Ee,Ne,qe,T(v)))},J=Ee=>{const{direction:Ne,itemSize:qe,layout:Re}=d,we=C.value(c&&qe,c&&Re,c&&Ne);let Ve;if(Wi(we,String(Ee)))Ve=we[Ee];else{const Ge=i(d,Ee,T(v)),dt=t(d,Ee,T(v)),ze=T(N),ee=Ne===dO,ye=ze?Ge:0;we[Ee]=Ve={position:"absolute",left:ee?void 0:`${ye}px`,right:ee?`${ye}px`:void 0,top:ze?0:`${Ge}px`,height:ze?"100%":`${dt}px`,width:ze?`${dt}px`:"100%"}}return Ve},ge=()=>{L.value.isScrolling=!1,cn(()=>{C.value(-1,null,null)})},ve=()=>{const Ee=y.value;Ee&&(Ee.scrollTop=0)};$n(()=>{if(!Si)return;const{initScrollOffset:Ee}=d,Ne=T(y);gn(Ee)&&Ne&&(T(N)?Ne.scrollLeft=Ee:Ne.scrollTop=Ee),U()}),s_(()=>{const{direction:Ee,layout:Ne}=d,{scrollOffset:qe,updateRequested:Re}=T(L),we=T(y);if(Re&&we)if(Ne===iR)if(Ee===dO)switch(wW()){case hx:{we.scrollLeft=-qe;break}case Wte:{we.scrollLeft=qe;break}default:{const{clientWidth:Ve,scrollWidth:Ge}=we;we.scrollLeft=Ge-Ve-qe;break}}else we.scrollLeft=qe;else we.scrollTop=qe}),kZ(()=>{T(y).scrollTop=T(L).scrollOffset});const Le={ns:_,clientSize:F,estimatedTotalSize:A,windowStyle:D,windowRef:y,innerRef:w,innerStyle:P,itemsToRender:O,scrollbarRef:I,states:L,getItemStyle:J,onScroll:q,onScrollbarScroll:K,onWheel:V,scrollTo:re,scrollToItem:Z,resetScrollTop:ve};return g({windowRef:y,innerRef:w,getItemStyleCache:C,scrollTo:re,scrollToItem:Z,resetScrollTop:ve,states:L}),Le},render(d){var f;const{$slots:g,className:p,clientSize:_,containerElement:v,data:C,getItemStyle:y,innerElement:w,itemsToRender:I,innerStyle:L,layout:O,total:A,onScroll:N,onScrollbarScroll:D,states:P,useIsScrolling:F,windowStyle:V,ns:U}=d,[Q,de]=I,q=ui(v),K=ui(w),re=[];if(A>0)for(let ve=Q;ve<=de;ve++)re.push(hn(Qt,{key:ve},(f=g.default)==null?void 0:f.call(g,{data:C,index:ve,isScrolling:F?P.isScrolling:void 0,style:y(ve)})));const Z=[hn(K,{style:L,ref:"innerRef"},sn(K)?re:{default:()=>re})],J=hn(jX,{ref:"scrollbarRef",clientSize:_,layout:O,onScroll:D,ratio:_*100/this.estimatedTotalSize,scrollFrom:P.scrollOffset/(this.estimatedTotalSize-_),total:A}),ge=hn(q,{class:[U.e("window"),p],style:V,onScroll:N,ref:"windowRef",key:0},sn(q)?[Z]:{default:()=>[Z]});return hn("div",{key:0,class:[U.e("wrapper"),P.scrollbarAlwaysOn?"always-on":""]},[ge,J])}}),K0e=z0e({name:"ElFixedSizeList",getItemOffset:({itemSize:n},e)=>e*n,getItemSize:({itemSize:n})=>n,getEstimatedTotalSize:({total:n,itemSize:e})=>e*n,getOffset:({height:n,total:e,itemSize:t,layout:i,width:s},o,r,a)=>{const c=fx(i)?s:n,u=Math.max(0,e*t-c),d=Math.min(u,o*t),f=Math.max(0,(o+1)*t-c);switch(r===A8&&(a>=f-c&&a<=d+c?r=Rf:r=Rm),r){case ux:return d;case dx:return f;case Rm:{const g=Math.round(f+(d-f)/2);return g<Math.ceil(c/2)?0:g>u+Math.floor(c/2)?u:g}case Rf:default:return a>=f&&a<=d?a:a<f?f:d}},getStartIndexForOffset:({total:n,itemSize:e},t)=>Math.max(0,Math.min(n-1,Math.floor(t/e))),getStopIndexForStartIndex:({height:n,total:e,itemSize:t,layout:i,width:s},o,r)=>{const a=o*t,c=fx(i)?s:n,u=Math.ceil((c+r-a)/t);return Math.max(0,Math.min(e-1,o+u-1))},initCache(){},clearCache:!0,validateProps(){}}),F1=(n,e,t)=>{const{itemSize:i}=n,{items:s,lastVisitedIndex:o}=t;if(e>o){let r=0;if(o>=0){const a=s[o];r=a.offset+a.size}for(let a=o+1;a<=e;a++){const c=i(a);s[a]={offset:r,size:c},r+=c}t.lastVisitedIndex=e}return s[e]},$lt=(n,e,t)=>{const{items:i,lastVisitedIndex:s}=e;return(s>0?i[s].offset:0)>=t?j0e(n,e,0,s,t):xlt(n,e,Math.max(0,s),t)},j0e=(n,e,t,i,s)=>{for(;t<=i;){const o=t+Math.floor((i-t)/2),r=F1(n,o,e).offset;if(r===s)return o;r<s?t=o+1:r>s&&(i=o-1)}return Math.max(0,t-1)},xlt=(n,e,t,i)=>{const{total:s}=n;let o=1;for(;t<s&&F1(n,t,e).offset<i;)t+=o,o*=2;return j0e(n,e,Math.floor(t/2),Math.min(t,s-1),i)},wde=({total:n},{items:e,estimatedItemSize:t,lastVisitedIndex:i})=>{let s=0;if(i>=n&&(i=n-1),i>=0){const a=e[i];s=a.offset+a.size}const r=(n-i-1)*t;return s+r},Plt=z0e({name:"ElDynamicSizeList",getItemOffset:(n,e,t)=>F1(n,e,t).offset,getItemSize:(n,e,{items:t})=>t[e].size,getEstimatedTotalSize:wde,getOffset:(n,e,t,i,s)=>{const{height:o,layout:r,width:a}=n,c=fx(r)?a:o,u=F1(n,e,s),d=wde(n,s),f=Math.max(0,Math.min(d-c,u.offset)),g=Math.max(0,u.offset-c+u.size);switch(t===A8&&(i>=g-c&&i<=f+c?t=Rf:t=Rm),t){case ux:return f;case dx:return g;case Rm:return Math.round(g+(f-g)/2);case Rf:default:return i>=g&&i<=f?i:i<g?g:f}},getStartIndexForOffset:(n,e,t)=>$lt(n,t,e),getStopIndexForStartIndex:(n,e,t,i)=>{const{height:s,total:o,layout:r,width:a}=n,c=fx(r)?a:s,u=F1(n,e,i),d=t+c;let f=u.offset+u.size,g=e;for(;g<o-1&&f<d;)g++,f+=F1(n,g,i).size;return g},initCache({estimatedItemSize:n=VX},e){const t={items:{},estimatedItemSize:n,lastVisitedIndex:-1};return t.clearCacheAfterIndex=(i,s=!0)=>{var o,r;t.lastVisitedIndex=Math.min(t.lastVisitedIndex,i-1),(o=e.exposed)==null||o.getItemStyleCache(-1),s&&((r=e.proxy)==null||r.$forceUpdate())},t},clearCache:!1,validateProps:({itemSize:n})=>{}}),Flt={loading:Boolean,data:{type:Array,required:!0},hoveringIndex:Number,width:Number};var Blt=$e({name:"ElSelectDropdown",props:Flt,setup(n,{slots:e,expose:t}){const i=Kt(Vte),s=vt("select"),{getLabel:o,getValue:r,getDisabled:a}=k8(i.props),c=te([]),u=te(),d=W(()=>n.data.length);ht(()=>d.value,()=>{var V,U;(U=(V=i.tooltipRef.value).updatePopper)==null||U.call(V)});const f=W(()=>ys(i.props.estimatedOptionHeight)),g=W(()=>f.value?{itemSize:i.props.itemHeight}:{estimatedSize:i.props.estimatedOptionHeight,itemSize:V=>c.value[V]}),p=(V=[],U)=>{const{props:{valueKey:Q}}=i;return si(U)?V&&V.some(de=>Cs(Fr(de,Q))===Fr(U,Q)):V.includes(U)},_=(V,U)=>{if(si(U)){const{valueKey:Q}=i.props;return Fr(V,Q)===Fr(U,Q)}else return V===U},v=(V,U)=>i.props.multiple?p(V,r(U)):_(V,r(U)),C=(V,U)=>{const{disabled:Q,multiple:de,multipleLimit:q}=i.props;return Q||!U&&(de?q>0&&V.length>=q:!1)},y=V=>n.hoveringIndex===V;t({listRef:u,isSized:f,isItemDisabled:C,isItemHovering:y,isItemSelected:v,scrollToItem:V=>{const U=u.value;U&&U.scrollToItem(V)},resetScrollTop:()=>{const V=u.value;V&&V.resetScrollTop()}});const O=V=>{const{index:U,data:Q,style:de}=V,q=T(f),{itemSize:K,estimatedSize:re}=T(g),{modelValue:Z}=i.props,{onSelect:J,onHover:ge}=i,ve=Q[U];if(ve.type==="Group")return ce(mlt,{item:ve,style:de,height:q?K:re},null);const Le=v(Z,ve),Ee=C(Z,Le),Ne=y(U);return ce(Slt,hi(V,{selected:Le,disabled:a(ve)||Ee,created:!!ve.created,hovering:Ne,item:ve,onSelect:J,onHover:ge}),{default:qe=>{var Re;return((Re=e.default)==null?void 0:Re.call(e,qe))||ce("span",null,[o(ve)])}})},{onKeyboardNavigate:A,onKeyboardSelect:N}=i,D=()=>{A("forward")},P=()=>{A("backward")},F=V=>{const{code:U}=V,{tab:Q,esc:de,down:q,up:K,enter:re,numpadEnter:Z}=zt;switch(U!==Q&&(V.preventDefault(),V.stopPropagation()),U){case Q:case de:break;case q:D();break;case K:P();break;case re:case Z:N();break}};return()=>{var V,U,Q,de;const{data:q,width:K}=n,{height:re,multiple:Z,scrollbarAlwaysOn:J}=i.props,ge=T(f)?K0e:Plt;return ce("div",{class:[s.b("dropdown"),s.is("multiple",Z)],style:{width:`${K}px`}},[(V=e.header)==null?void 0:V.call(e),((U=e.loading)==null?void 0:U.call(e))||((Q=e.empty)==null?void 0:Q.call(e))||ce(ge,hi({ref:u},T(g),{className:s.be("dropdown","list"),scrollbarAlwaysOn:J,data:q,height:re,width:K,total:q.length,onKeydown:F}),{default:ve=>ce(O,ve,null)}),(de=e.footer)==null?void 0:de.call(e)])}}});function Hlt(n,e){const{aliasProps:t,getLabel:i,getValue:s}=k8(n),o=te(0),r=te(),a=W(()=>n.allowCreate&&n.filterable);function c(p){const _=v=>i(v)===p;return n.options&&n.options.some(_)||e.createdOptions.some(_)}function u(p){a.value&&(n.multiple&&p.created?o.value++:r.value=p)}function d(p){if(a.value)if(p&&p.length>0){if(c(p))return;const _={[t.value.value]:p,[t.value.label]:p,created:!0,[t.value.disabled]:!1};e.createdOptions.length>=o.value?e.createdOptions[o.value]=_:e.createdOptions.push(_)}else if(n.multiple)e.createdOptions.length=o.value;else{const _=r.value;e.createdOptions.length=0,_&&_.created&&e.createdOptions.push(_)}}function f(p){if(!a.value||!p||!p.created||p.created&&n.reserveKeyword&&e.inputValue===i(p))return;const _=e.createdOptions.findIndex(v=>s(v)===s(p));~_&&(e.createdOptions.splice(_,1),o.value--)}function g(){a.value&&(e.createdOptions.length=0,o.value=0)}return{createNewOption:d,removeNewOption:f,selectNewOption:u,clearAllNewOption:g}}const Vlt=11,Ult=(n,e)=>{const{t}=wi(),i=vt("select"),s=vt("input"),{form:o,formItem:r}=fc(),{inputId:a}=Qf(n,{formItemContext:r}),{aliasProps:c,getLabel:u,getValue:d,getDisabled:f,getOptions:g}=k8(n),{valueOnClear:p,isEmptyValue:_}=v8(n),v=Ki({inputValue:"",cachedOptions:[],createdOptions:[],hoveringIndex:-1,inputHovering:!1,selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,previousQuery:null,previousValue:void 0,selectedLabel:"",menuVisibleOnFocus:!1,isBeforeHide:!1}),C=te(-1),y=te(),w=te(),I=te(),L=te(),O=te(),A=te(),N=te(),D=te(),P=te(),F=te(),V=te(),{isComposing:U,handleCompositionStart:Q,handleCompositionEnd:de,handleCompositionUpdate:q}=lF({afterComposition:At=>Cn(At)}),{wrapperRef:K,isFocused:re,handleBlur:Z}=$y(O,{beforeFocus(){return Le.value},afterFocus(){n.automaticDropdown&&!ve.value&&(ve.value=!0,v.menuVisibleOnFocus=!0)},beforeBlur(At){var In,Yn;return((In=I.value)==null?void 0:In.isFocusInsideContent(At))||((Yn=L.value)==null?void 0:Yn.isFocusInsideContent(At))},afterBlur(){ve.value=!1,v.menuVisibleOnFocus=!1}}),J=te([]),ge=te([]),ve=te(!1),Le=W(()=>n.disabled||(o==null?void 0:o.disabled)),Ee=W(()=>{var At;return(At=o==null?void 0:o.statusIcon)!=null?At:!1}),Ne=W(()=>{const At=ge.value.length*n.itemHeight;return At>n.height?n.height:At}),qe=W(()=>n.multiple?yt(n.modelValue)&&n.modelValue.length>0:!_(n.modelValue)),Re=W(()=>n.clearable&&!Le.value&&v.inputHovering&&qe.value),we=W(()=>n.remote&&n.filterable?"":Lb),Ve=W(()=>we.value&&i.is("reverse",ve.value)),Ge=W(()=>(r==null?void 0:r.validateState)||""),dt=W(()=>{if(Ge.value)return y8[Ge.value]}),ze=W(()=>n.remote?300:0),ee=W(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!v.inputValue&&J.value.length===0?!1:n.filterable&&v.inputValue&&J.value.length>0&&ge.value.length===0?n.noMatchText||t("el.select.noMatch"):J.value.length===0?n.noDataText||t("el.select.noData"):null),ye=At=>{const In=Yn=>{if(n.filterable&&ln(n.filterMethod)||n.filterable&&n.remote&&ln(n.remoteMethod))return!0;const bi=new RegExp(yte(At),"i");return At?bi.test(u(Yn)||""):!0};return n.loading?[]:[...v.createdOptions,...n.options].reduce((Yn,bi)=>{const Ur=g(bi);if(yt(Ur)){const Yl=Ur.filter(In);Yl.length>0&&Yn.push({label:u(bi),type:"Group"},...Yl)}else(n.remote||In(bi))&&Yn.push(bi);return Yn},[])},Me=()=>{J.value=ye(""),ge.value=ye(v.inputValue)},et=W(()=>{const At=new Map;return J.value.forEach((In,Yn)=>{At.set(ti(d(In)),{option:In,index:Yn})}),At}),at=W(()=>{const At=new Map;return ge.value.forEach((In,Yn)=>{At.set(ti(d(In)),{option:In,index:Yn})}),At}),Ue=W(()=>ge.value.every(At=>f(At))),Se=jr(),Ie=W(()=>Se.value==="small"?"small":"default"),Xe=()=>{var At;C.value=((At=y.value)==null?void 0:At.offsetWidth)||200},it=()=>{if(!w.value)return 0;const At=window.getComputedStyle(w.value);return Number.parseFloat(At.gap||"6px")},Tt=W(()=>{const At=it();return{maxWidth:`${V.value&&n.maxCollapseTags===1?v.selectionWidth-v.collapseItemWidth-At:v.selectionWidth}px`}}),He=W(()=>({maxWidth:`${v.selectionWidth}px`})),ke=W(()=>({width:`${Math.max(v.calculatorWidth,Vlt)}px`})),ot=W(()=>yt(n.modelValue)?n.modelValue.length===0&&!v.inputValue:n.filterable?!v.inputValue:!0),Ct=W(()=>{var At;const In=(At=n.placeholder)!=null?At:t("el.select.placeholder");return n.multiple||!qe.value?In:v.selectedLabel}),Gt=W(()=>{var At,In;return(In=(At=I.value)==null?void 0:At.popperRef)==null?void 0:In.contentRef}),Ot=W(()=>{if(n.multiple){const At=n.modelValue.length;if(n.modelValue.length>0&&at.value.has(n.modelValue[At-1])){const{index:In}=at.value.get(n.modelValue[At-1]);return In}}else if(!_(n.modelValue)&&at.value.has(n.modelValue)){const{index:At}=at.value.get(n.modelValue);return At}return-1}),En=W({get(){return ve.value&&ee.value!==!1},set(At){ve.value=At}}),fe=W(()=>n.multiple?n.collapseTags?v.cachedOptions.slice(0,n.maxCollapseTags):v.cachedOptions:[]),se=W(()=>n.multiple?n.collapseTags?v.cachedOptions.slice(n.maxCollapseTags):[]:[]),{createNewOption:le,removeNewOption:Fe,selectNewOption:pe,clearAllNewOption:je}=Hlt(n,v),Ae=()=>{Le.value||(v.menuVisibleOnFocus?v.menuVisibleOnFocus=!1:ve.value=!ve.value)},Et=()=>{v.inputValue.length>0&&!ve.value&&(ve.value=!0),le(v.inputValue),Hn(v.inputValue)},Tn=Md(Et,ze.value),Hn=At=>{v.previousQuery===At||U.value||(v.previousQuery=At,n.filterable&&ln(n.filterMethod)?n.filterMethod(At):n.filterable&&n.remote&&ln(n.remoteMethod)&&n.remoteMethod(At),n.defaultFirstOption&&(n.filterable||n.remote)&&ge.value.length?cn(Xn):cn(Fn))},Xn=()=>{const At=ge.value.filter(bi=>!bi.disabled&&bi.type!=="Group"),In=At.find(bi=>bi.created),Yn=At[0];v.hoveringIndex=Hi(ge.value,In||Yn)},vs=At=>{Ha(n.modelValue,At)||e(Ms,At)},Zn=At=>{e(Kn,At),vs(At),v.previousValue=n.multiple?String(At):At},Hi=(At=[],In)=>{if(!si(In))return At.indexOf(In);const Yn=n.valueKey;let bi=-1;return At.some((Ur,Yl)=>Fr(Ur,Yn)===Fr(In,Yn)?(bi=Yl,!0):!1),bi},ti=At=>si(At)?Fr(At,n.valueKey):At,Ps=()=>{Xe()},ae=()=>{v.selectionWidth=w.value.getBoundingClientRect().width},xe=()=>{v.calculatorWidth=A.value.getBoundingClientRect().width},H=()=>{v.collapseItemWidth=V.value.getBoundingClientRect().width},j=()=>{var At,In;(In=(At=I.value)==null?void 0:At.updatePopper)==null||In.call(At)},ue=()=>{var At,In;(In=(At=L.value)==null?void 0:At.updatePopper)==null||In.call(At)},ie=At=>{if(n.multiple){let In=n.modelValue.slice();const Yn=Hi(In,d(At));Yn>-1?(In=[...In.slice(0,Yn),...In.slice(Yn+1)],v.cachedOptions.splice(Yn,1),Fe(At)):(n.multipleLimit<=0||In.length<n.multipleLimit)&&(In=[...In,d(At)],v.cachedOptions.push(At),pe(At)),Zn(In),At.created&&Hn(""),n.filterable&&!n.reserveKeyword&&(v.inputValue="")}else v.selectedLabel=u(At),Zn(d(At)),ve.value=!1,pe(At),At.created||je();De()},Te=(At,In)=>{let Yn=n.modelValue.slice();const bi=Hi(Yn,d(In));bi>-1&&!Le.value&&(Yn=[...n.modelValue.slice(0,bi),...n.modelValue.slice(bi+1)],v.cachedOptions.splice(bi,1),Zn(Yn),e("remove-tag",d(In)),Fe(In)),At.stopPropagation(),De()},De=()=>{var At;(At=O.value)==null||At.focus()},me=()=>{var At;if(ve.value){ve.value=!1,cn(()=>{var In;return(In=O.value)==null?void 0:In.blur()});return}(At=O.value)==null||At.blur()},tt=()=>{v.inputValue.length>0?v.inputValue="":ve.value=!1},It=At=>gEe(At,In=>!v.cachedOptions.some(Yn=>d(Yn)===In&&f(Yn))),kt=At=>{if(n.multiple&&At.code!==zt.delete&&v.inputValue.length===0){At.preventDefault();const In=n.modelValue.slice(),Yn=It(In);if(Yn<0)return;const bi=In[Yn];In.splice(Yn,1);const Ur=v.cachedOptions[Yn];v.cachedOptions.splice(Yn,1),Fe(Ur),Zn(In),e("remove-tag",bi)}},un=()=>{let At;yt(n.modelValue)?At=[]:At=p.value,n.multiple?v.cachedOptions=[]:v.selectedLabel="",ve.value=!1,Zn(At),e("clear"),je(),De()},gt=(At,In=void 0)=>{const Yn=ge.value;if(!["forward","backward"].includes(At)||Le.value||Yn.length<=0||Ue.value||U.value)return;if(!ve.value)return Ae();In===void 0&&(In=v.hoveringIndex);let bi=-1;At==="forward"?(bi=In+1,bi>=Yn.length&&(bi=0)):At==="backward"&&(bi=In-1,(bi<0||bi>=Yn.length)&&(bi=Yn.length-1));const Ur=Yn[bi];if(f(Ur)||Ur.type==="Group")return gt(At,bi);v.hoveringIndex=bi,go(bi)},Ft=()=>{if(ve.value)~v.hoveringIndex&&ge.value[v.hoveringIndex]&&ie(ge.value[v.hoveringIndex]);else return Ae()},pn=At=>{v.hoveringIndex=At??-1},Fn=()=>{n.multiple?v.hoveringIndex=ge.value.findIndex(At=>n.modelValue.some(In=>ti(In)===ti(At))):v.hoveringIndex=ge.value.findIndex(At=>ti(At)===ti(n.modelValue))},Cn=At=>{if(v.inputValue=At.target.value,n.remote)Tn();else return Et()},Fs=At=>{if(ve.value=!1,re.value){const In=new FocusEvent("focus",At);Z(In)}},vi=()=>(v.isBeforeHide=!1,cn(()=>{~Ot.value&&go(v.hoveringIndex)})),go=At=>{P.value.scrollToItem(At)},gl=(At,In)=>{const Yn=ti(At);if(et.value.has(Yn)){const{option:bi}=et.value.get(Yn);return bi}if(In&&In.length){const bi=In.find(Ur=>ti(d(Ur))===Yn);if(bi)return bi}return{[c.value.value]:At,[c.value.label]:At}},vo=(At=!1)=>{if(n.multiple)if(n.modelValue.length>0){const In=v.cachedOptions.slice();v.cachedOptions.length=0,v.previousValue=n.modelValue.toString();for(const Yn of n.modelValue){const bi=gl(Yn,In);v.cachedOptions.push(bi)}}else v.cachedOptions=[],v.previousValue=void 0;else if(qe.value){v.previousValue=n.modelValue;const In=ge.value,Yn=In.findIndex(bi=>ti(d(bi))===ti(n.modelValue));~Yn?v.selectedLabel=u(In[Yn]):(!v.selectedLabel||At)&&(v.selectedLabel=ti(n.modelValue))}else v.selectedLabel="",v.previousValue=void 0;je(),Xe()};return ht(ve,At=>{At?Hn(""):(v.inputValue="",v.previousQuery=null,v.isBeforeHide=!0,le("")),e("visible-change",At)}),ht(()=>n.modelValue,(At,In)=>{var Yn;(!At||yt(At)&&At.length===0||n.multiple&&!Ha(At.toString(),v.previousValue)||!n.multiple&&ti(At)!==ti(v.previousValue))&&vo(!0),!Ha(At,In)&&n.validateEvent&&((Yn=r==null?void 0:r.validate)==null||Yn.call(r,"change").catch(Ur=>void 0))},{deep:!0}),ht(()=>n.options,()=>{const At=O.value;(!At||At&&document.activeElement!==At)&&vo()},{deep:!0,flush:"post"}),ht(()=>ge.value,()=>P.value&&cn(P.value.resetScrollTop)),Sl(()=>{v.isBeforeHide||Me()}),Sl(()=>{const{valueKey:At,options:In}=n,Yn=new Map;for(const bi of In){const Ur=d(bi);let Yl=Ur;if(si(Yl)&&(Yl=Fr(Ur,At)),Yn.get(Yl))break;Yn.set(Yl,!0)}}),$n(()=>{vo()}),wo(y,Ps),wo(w,ae),wo(A,xe),wo(P,j),wo(K,j),wo(F,ue),wo(V,H),{inputId:a,collapseTagSize:Ie,currentPlaceholder:Ct,expanded:ve,emptyText:ee,popupHeight:Ne,debounce:ze,allOptions:J,filteredOptions:ge,iconComponent:we,iconReverse:Ve,tagStyle:Tt,collapseTagStyle:He,inputStyle:ke,popperSize:C,dropdownMenuVisible:En,hasModelValue:qe,shouldShowPlaceholder:ot,selectDisabled:Le,selectSize:Se,needStatusIcon:Ee,showClearBtn:Re,states:v,isFocused:re,nsSelect:i,nsInput:s,calculatorRef:A,inputRef:O,menuRef:P,tagMenuRef:F,tooltipRef:I,tagTooltipRef:L,selectRef:y,wrapperRef:K,selectionRef:w,prefixRef:N,suffixRef:D,collapseItemRef:V,popperRef:Gt,validateState:Ge,validateIcon:dt,showTagList:fe,collapseTagList:se,debouncedOnInputChange:Tn,deleteTag:Te,getLabel:u,getValue:d,getDisabled:f,getValueKey:ti,handleClear:un,handleClickOutside:Fs,handleDel:kt,handleEsc:tt,focus:De,blur:me,handleMenuEnter:vi,handleResize:Ps,resetSelectionWidth:ae,resetCalculatorWidth:xe,updateTooltip:j,updateTagTooltip:ue,updateOptions:Me,toggleMenu:Ae,scrollTo:go,onInput:Cn,onKeyboardNavigate:gt,onKeyboardSelect:Ft,onSelect:ie,onHover:pn,handleCompositionStart:Q,handleCompositionEnd:de,handleCompositionUpdate:q}},Wlt=$e({name:"ElSelectV2",components:{ElSelectMenu:Blt,ElTag:tR,ElTooltip:uc,ElIcon:tn},directives:{ClickOutside:cb},props:vlt,emits:Tlt,setup(n,{emit:e}){const t=W(()=>{const{modelValue:o,multiple:r}=n,a=r?[]:void 0;return yt(o)?r?o:a:r?a:o}),i=Ult(Ki({...Gl(n),modelValue:t}),e);pi(Vte,{props:Ki({...Gl(n),height:i.popupHeight,modelValue:t}),expanded:i.expanded,tooltipRef:i.tooltipRef,onSelect:i.onSelect,onHover:i.onHover,onKeyboardNavigate:i.onKeyboardNavigate,onKeyboardSelect:i.onKeyboardSelect});const s=W(()=>n.multiple?i.states.cachedOptions.map(o=>o.label):i.states.selectedLabel);return{...i,modelValue:t,selectedLabel:s}}});function Glt(n,e,t,i,s,o){const r=Bt("el-tag"),a=Bt("el-tooltip"),c=Bt("el-icon"),u=Bt("el-select-menu"),d=N5("click-outside");return Un((G(),he("div",{ref:"selectRef",class:Y([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),onMouseenter:f=>n.states.inputHovering=!0,onMouseleave:f=>n.states.inputHovering=!1},[ce(a,{ref:"tooltipRef",visible:n.dropdownMenuVisible,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,placement:n.placement,pure:"",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,trigger:"click",persistent:n.persistent,"append-to":n.appendTo,"show-arrow":n.showArrow,offset:n.offset,onBeforeShow:n.handleMenuEnter,onHide:f=>n.states.isBeforeHide=!1},{default:_e(()=>[oe("div",{ref:"wrapperRef",class:Y([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:bn(n.toggleMenu,["prevent"])},[n.$slots.prefix?(G(),he("div",{key:0,ref:"prefixRef",class:Y(n.nsSelect.e("prefix"))},[Ye(n.$slots,"prefix")],2)):Qe("v-if",!0),oe("div",{ref:"selectionRef",class:Y([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.modelValue.length)])},[n.multiple?Ye(n.$slots,"tag",{key:0},()=>[(G(!0),he(Qt,null,fi(n.showTagList,f=>(G(),he("div",{key:n.getValueKey(n.getValue(f)),class:Y(n.nsSelect.e("selected-item"))},[ce(r,{closable:!n.selectDisabled&&!n.getDisabled(f),size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:on(n.tagStyle),onClose:g=>n.deleteTag(g,f)},{default:_e(()=>[oe("span",{class:Y(n.nsSelect.e("tags-text"))},[Ye(n.$slots,"label",{label:n.getLabel(f),value:n.getValue(f)},()=>[mn(st(n.getLabel(f)),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.modelValue.length>n.maxCollapseTags?(G(),nt(a,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:_e(()=>[oe("div",{ref:"collapseItemRef",class:Y(n.nsSelect.e("selected-item"))},[ce(r,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,style:on(n.collapseTagStyle),"disable-transitions":""},{default:_e(()=>[oe("span",{class:Y(n.nsSelect.e("tags-text"))}," + "+st(n.modelValue.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:_e(()=>[oe("div",{ref:"tagMenuRef",class:Y(n.nsSelect.e("selection"))},[(G(!0),he(Qt,null,fi(n.collapseTagList,f=>(G(),he("div",{key:n.getValueKey(n.getValue(f)),class:Y(n.nsSelect.e("selected-item"))},[ce(r,{class:"in-tooltip",closable:!n.selectDisabled&&!n.getDisabled(f),size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:g=>n.deleteTag(g,f)},{default:_e(()=>[oe("span",{class:Y(n.nsSelect.e("tags-text"))},[Ye(n.$slots,"label",{label:n.getLabel(f),value:n.getValue(f)},()=>[mn(st(n.getLabel(f)),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):Qe("v-if",!0)]):Qe("v-if",!0),oe("div",{class:Y([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[Un(oe("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":f=>n.states.inputValue=f,style:on(n.inputStyle),autocomplete:n.autocomplete,tabindex:n.tabindex,"aria-autocomplete":"list","aria-haspopup":"listbox",autocapitalize:"off","aria-expanded":n.expanded,"aria-label":n.ariaLabel,class:Y([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,role:"combobox",readonly:!n.filterable,spellcheck:"false",type:"text",name:n.name,onInput:n.onInput,onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onKeydown:[xs(bn(f=>n.onKeyboardNavigate("backward"),["stop","prevent"]),["up"]),xs(bn(f=>n.onKeyboardNavigate("forward"),["stop","prevent"]),["down"]),xs(bn(n.onKeyboardSelect,["stop","prevent"]),["enter"]),xs(bn(n.handleEsc,["stop","prevent"]),["esc"]),xs(bn(n.handleDel,["stop"]),["delete"])],onClick:bn(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","autocomplete","tabindex","aria-expanded","aria-label","disabled","readonly","name","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick"]),[[x5,n.states.inputValue]]),n.filterable?(G(),he("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:Y(n.nsSelect.e("input-calculator")),textContent:st(n.states.inputValue)},null,10,["textContent"])):Qe("v-if",!0)],2),n.shouldShowPlaceholder?(G(),he("div",{key:1,class:Y([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?Ye(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[oe("span",null,st(n.currentPlaceholder),1)]):(G(),he("span",{key:1},st(n.currentPlaceholder),1))],2)):Qe("v-if",!0)],2),oe("div",{ref:"suffixRef",class:Y(n.nsSelect.e("suffix"))},[n.iconComponent?Un((G(),nt(c,{key:0,class:Y([n.nsSelect.e("caret"),n.nsInput.e("icon"),n.iconReverse])},{default:_e(()=>[(G(),nt(ui(n.iconComponent)))]),_:1},8,["class"])),[[Gi,!n.showClearBtn]]):Qe("v-if",!0),n.showClearBtn&&n.clearIcon?(G(),nt(c,{key:1,class:Y([n.nsSelect.e("caret"),n.nsInput.e("icon"),n.nsSelect.e("clear")]),onClick:bn(n.handleClear,["prevent","stop"])},{default:_e(()=>[(G(),nt(ui(n.clearIcon)))]),_:1},8,["class","onClick"])):Qe("v-if",!0),n.validateState&&n.validateIcon&&n.needStatusIcon?(G(),nt(c,{key:2,class:Y([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:_e(()=>[(G(),nt(ui(n.validateIcon)))]),_:1},8,["class"])):Qe("v-if",!0)],2)],10,["onClick"])]),content:_e(()=>[ce(u,{ref:"menuRef",data:n.filteredOptions,width:n.popperSize,"hovering-index":n.states.hoveringIndex,"scrollbar-always-on":n.scrollbarAlwaysOn},Hf({default:_e(f=>[Ye(n.$slots,"default",wf(nb(f)))]),_:2},[n.$slots.header?{name:"header",fn:_e(()=>[oe("div",{class:Y(n.nsSelect.be("dropdown","header"))},[Ye(n.$slots,"header")],2)])}:void 0,n.$slots.loading&&n.loading?{name:"loading",fn:_e(()=>[oe("div",{class:Y(n.nsSelect.be("dropdown","loading"))},[Ye(n.$slots,"loading")],2)])}:n.loading||n.filteredOptions.length===0?{name:"empty",fn:_e(()=>[oe("div",{class:Y(n.nsSelect.be("dropdown","empty"))},[Ye(n.$slots,"empty",{},()=>[oe("span",null,st(n.emptyText),1)])],2)])}:void 0,n.$slots.footer?{name:"footer",fn:_e(()=>[oe("div",{class:Y(n.nsSelect.be("dropdown","footer"))},[Ye(n.$slots,"footer")],2)])}:void 0]),1032,["data","width","hovering-index","scrollbar-always-on"])]),_:3},8,["visible","teleported","popper-class","popper-options","fallback-placements","effect","placement","transition","persistent","append-to","show-arrow","offset","onBeforeShow","onHide"])],42,["onMouseenter","onMouseleave"])),[[d,n.handleClickOutside,n.popperRef]])}var zlt=Rt(Wlt,[["render",Glt],["__file","select.vue"]]);const Klt=Nn(zlt),jlt=Lt({animated:{type:Boolean,default:!1},count:{type:Number,default:1},rows:{type:Number,default:3},loading:{type:Boolean,default:!0},throttle:{type:Ke([Number,Object])}}),Xlt=Lt({variant:{type:String,values:["circle","rect","h1","h3","text","caption","p","image","button"],default:"text"}}),Ylt=$e({name:"ElSkeletonItem"}),qlt=$e({...Ylt,props:Xlt,setup(n){const e=vt("skeleton");return(t,i)=>(G(),he("div",{class:Y([T(e).e("item"),T(e).e(t.variant)])},[t.variant==="image"?(G(),nt(T(eje),{key:0})):Qe("v-if",!0)],2))}});var IW=Rt(qlt,[["__file","skeleton-item.vue"]]);const Jlt=(n,e=0)=>{if(e===0)return n;const t=si(e)&&!!e.initVal,i=te(t);let s=null;const o=a=>{if(ys(a)){i.value=n.value;return}s&&clearTimeout(s),s=setTimeout(()=>{i.value=n.value},a)},r=a=>{a==="leading"?gn(e)?o(e):o(e.leading):si(e)?o(e.trailing):i.value=!1};return $n(()=>r("leading")),ht(()=>n.value,a=>{r(a?"leading":"trailing")}),i},Qlt=$e({name:"ElSkeleton"}),Zlt=$e({...Qlt,props:jlt,setup(n,{expose:e}){const t=n,i=vt("skeleton"),s=Jlt(ds(t,"loading"),t.throttle);return e({uiLoading:s}),(o,r)=>T(s)?(G(),he("div",hi({key:0,class:[T(i).b(),T(i).is("animated",o.animated)]},o.$attrs),[(G(!0),he(Qt,null,fi(o.count,a=>(G(),he(Qt,{key:a},[T(s)?Ye(o.$slots,"template",{key:a},()=>[ce(IW,{class:Y(T(i).is("first")),variant:"p"},null,8,["class"]),(G(!0),he(Qt,null,fi(o.rows,c=>(G(),nt(IW,{key:c,class:Y([T(i).e("paragraph"),T(i).is("last",c===o.rows&&o.rows>1)]),variant:"p"},null,8,["class"]))),128))]):Qe("v-if",!0)],64))),128))],16)):Ye(o.$slots,"default",wf(hi({key:1},o.$attrs)))}});var eat=Rt(Zlt,[["__file","skeleton.vue"]]);const tat=Nn(eat,{SkeletonItem:IW}),nat=Xo(IW),X0e=Symbol("sliderContextKey"),iat=Lt({modelValue:{type:Ke([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:cl,inputSize:cl,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ke(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ke(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:Rb,default:"top"},marks:{type:Ke(Object)},validateEvent:{type:Boolean,default:!0},...Wa(["ariaLabel"])}),d9=n=>gn(n)||yt(n)&&n.every(gn),sat={[Kn]:d9,[rc]:d9,[Ms]:d9},oat=Lt({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:Rb,default:"top"}}),rat={[Kn]:n=>gn(n)},lat=(n,e,t)=>{const i=te(),s=te(!1),o=W(()=>e.value instanceof Function),r=W(()=>o.value&&e.value(n.modelValue)||n.modelValue),a=Md(()=>{t.value&&(s.value=!0)},50),c=Md(()=>{t.value&&(s.value=!1)},50);return{tooltip:i,tooltipVisible:s,formatValue:r,displayTooltip:a,hideTooltip:c}},aat=(n,e,t)=>{const{disabled:i,min:s,max:o,step:r,showTooltip:a,precision:c,sliderSize:u,formatTooltip:d,emitChange:f,resetSize:g,updateDragging:p}=Kt(X0e),{tooltip:_,tooltipVisible:v,formatValue:C,displayTooltip:y,hideTooltip:w}=lat(n,d,a),I=te(),L=W(()=>`${(n.modelValue-s.value)/(o.value-s.value)*100}%`),O=W(()=>n.vertical?{bottom:L.value}:{left:L.value}),A=()=>{e.hovering=!0,y()},N=()=>{e.hovering=!1,e.dragging||w()},D=Le=>{i.value||(Le.preventDefault(),Z(Le),window.addEventListener("mousemove",J),window.addEventListener("touchmove",J),window.addEventListener("mouseup",ge),window.addEventListener("touchend",ge),window.addEventListener("contextmenu",ge),I.value.focus())},P=Le=>{i.value||(e.newPosition=Number.parseFloat(L.value)+Le/(o.value-s.value)*100,ve(e.newPosition),f())},F=()=>{P(-r.value)},V=()=>{P(r.value)},U=()=>{P(-r.value*4)},Q=()=>{P(r.value*4)},de=()=>{i.value||(ve(0),f())},q=()=>{i.value||(ve(100),f())},K=Le=>{let Ee=!0;switch(Le.code){case zt.left:case zt.down:F();break;case zt.right:case zt.up:V();break;case zt.home:de();break;case zt.end:q();break;case zt.pageDown:U();break;case zt.pageUp:Q();break;default:Ee=!1;break}Ee&&Le.preventDefault()},re=Le=>{let Ee,Ne;return Le.type.startsWith("touch")?(Ne=Le.touches[0].clientY,Ee=Le.touches[0].clientX):(Ne=Le.clientY,Ee=Le.clientX),{clientX:Ee,clientY:Ne}},Z=Le=>{e.dragging=!0,e.isClick=!0;const{clientX:Ee,clientY:Ne}=re(Le);n.vertical?e.startY=Ne:e.startX=Ee,e.startPosition=Number.parseFloat(L.value),e.newPosition=e.startPosition},J=Le=>{if(e.dragging){e.isClick=!1,y(),g();let Ee;const{clientX:Ne,clientY:qe}=re(Le);n.vertical?(e.currentY=qe,Ee=(e.startY-e.currentY)/u.value*100):(e.currentX=Ne,Ee=(e.currentX-e.startX)/u.value*100),e.newPosition=e.startPosition+Ee,ve(e.newPosition)}},ge=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||w(),e.isClick||ve(e.newPosition),f()},0),window.removeEventListener("mousemove",J),window.removeEventListener("touchmove",J),window.removeEventListener("mouseup",ge),window.removeEventListener("touchend",ge),window.removeEventListener("contextmenu",ge))},ve=async Le=>{if(Le===null||Number.isNaN(+Le))return;Le<0?Le=0:Le>100&&(Le=100);const Ee=100/((o.value-s.value)/r.value);let qe=Math.round(Le/Ee)*Ee*(o.value-s.value)*.01+s.value;qe=Number.parseFloat(qe.toFixed(c.value)),qe!==n.modelValue&&t(Kn,qe),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await cn(),e.dragging&&y(),_.value.updatePopper()};return ht(()=>e.dragging,Le=>{p(Le)}),Es(I,"touchstart",D,{passive:!1}),{disabled:i,button:I,tooltip:_,tooltipVisible:v,showTooltip:a,wrapperStyle:O,formatValue:C,handleMouseEnter:A,handleMouseLeave:N,onButtonDown:D,onKeyDown:K,setPosition:ve}},cat=$e({name:"ElSliderButton"}),uat=$e({...cat,props:oat,emits:rat,setup(n,{expose:e,emit:t}){const i=n,s=vt("slider"),o=Ki({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:r,button:a,tooltip:c,showTooltip:u,tooltipVisible:d,wrapperStyle:f,formatValue:g,handleMouseEnter:p,handleMouseLeave:_,onButtonDown:v,onKeyDown:C,setPosition:y}=aat(i,o,t),{hovering:w,dragging:I}=Gl(o);return e({onButtonDown:v,onKeyDown:C,setPosition:y,hovering:w,dragging:I}),(L,O)=>(G(),he("div",{ref_key:"button",ref:a,class:Y([T(s).e("button-wrapper"),{hover:T(w),dragging:T(I)}]),style:on(T(f)),tabindex:T(r)?-1:0,onMouseenter:T(p),onMouseleave:T(_),onMousedown:T(v),onFocus:T(p),onBlur:T(_),onKeydown:T(C)},[ce(T(uc),{ref_key:"tooltip",ref:c,visible:T(d),placement:L.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":L.tooltipClass,disabled:!T(u),persistent:T(u)},{content:_e(()=>[oe("span",null,st(T(g)),1)]),default:_e(()=>[oe("div",{class:Y([T(s).e("button"),{hover:T(w),dragging:T(I)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled","persistent"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var Ide=Rt(uat,[["__file","button.vue"]]);const dat=Lt({mark:{type:Ke([String,Object]),default:void 0}});var hat=$e({name:"ElSliderMarker",props:dat,setup(n){const e=vt("slider"),t=W(()=>sn(n.mark)?n.mark:n.mark.label),i=W(()=>sn(n.mark)?void 0:n.mark.style);return()=>hn("div",{class:e.e("marks-text"),style:i.value},t.value)}});const fat=(n,e,t)=>{const{form:i,formItem:s}=fc(),o=us(),r=te(),a=te(),c={firstButton:r,secondButton:a},u=W(()=>n.disabled||(i==null?void 0:i.disabled)||!1),d=W(()=>Math.min(e.firstValue,e.secondValue)),f=W(()=>Math.max(e.firstValue,e.secondValue)),g=W(()=>n.range?`${100*(f.value-d.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),p=W(()=>n.range?`${100*(d.value-n.min)/(n.max-n.min)}%`:"0%"),_=W(()=>n.vertical?{height:n.height}:{}),v=W(()=>n.vertical?{height:g.value,bottom:p.value}:{width:g.value,left:p.value}),C=()=>{o.value&&(e.sliderSize=o.value[`client${n.vertical?"Height":"Width"}`])},y=U=>{const Q=n.min+U*(n.max-n.min)/100;if(!n.range)return r;let de;return Math.abs(d.value-Q)<Math.abs(f.value-Q)?de=e.firstValue<e.secondValue?"firstButton":"secondButton":de=e.firstValue>e.secondValue?"firstButton":"secondButton",c[de]},w=U=>{const Q=y(U);return Q.value.setPosition(U),Q},I=U=>{e.firstValue=U??n.min,O(n.range?[d.value,f.value]:U??n.min)},L=U=>{e.secondValue=U,n.range&&O([d.value,f.value])},O=U=>{t(Kn,U),t(rc,U)},A=async()=>{await cn(),t(Ms,n.range?[d.value,f.value]:n.modelValue)},N=U=>{var Q,de,q,K,re,Z;if(u.value||e.dragging)return;C();let J=0;if(n.vertical){const ge=(q=(de=(Q=U.touches)==null?void 0:Q.item(0))==null?void 0:de.clientY)!=null?q:U.clientY;J=(o.value.getBoundingClientRect().bottom-ge)/e.sliderSize*100}else{const ge=(Z=(re=(K=U.touches)==null?void 0:K.item(0))==null?void 0:re.clientX)!=null?Z:U.clientX,ve=o.value.getBoundingClientRect().left;J=(ge-ve)/e.sliderSize*100}if(!(J<0||J>100))return w(J)};return{elFormItem:s,slider:o,firstButton:r,secondButton:a,sliderDisabled:u,minValue:d,maxValue:f,runwayStyle:_,barStyle:v,resetSize:C,setPosition:w,emitChange:A,onSliderWrapperPrevent:U=>{var Q,de;((Q=c.firstButton.value)!=null&&Q.dragging||(de=c.secondButton.value)!=null&&de.dragging)&&U.preventDefault()},onSliderClick:U=>{N(U)&&A()},onSliderDown:async U=>{const Q=N(U);Q&&(await cn(),Q.value.onButtonDown(U))},onSliderMarkerDown:U=>{u.value||e.dragging||w(U)},setFirstValue:I,setSecondValue:L}},gat=(n,e,t,i)=>({stops:W(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return[];const r=(n.max-n.min)/n.step,a=100*n.step/(n.max-n.min),c=Array.from({length:r-1}).map((u,d)=>(d+1)*a);return n.range?c.filter(u=>u<100*(t.value-n.min)/(n.max-n.min)||u>100*(i.value-n.min)/(n.max-n.min)):c.filter(u=>u>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:r=>n.vertical?{bottom:`${r}%`}:{left:`${r}%`}}),pat=n=>W(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),mat=(n,e,t,i,s,o)=>{const r=u=>{s(Kn,u),s(rc,u)},a=()=>n.range?![t.value,i.value].every((u,d)=>u===e.oldValue[d]):n.modelValue!==e.oldValue,c=()=>{var u,d;n.min>n.max&&Ll("Slider","min should not be greater than max.");const f=n.modelValue;n.range&&yt(f)?f[1]<n.min?r([n.min,n.min]):f[0]>n.max?r([n.max,n.max]):f[0]<n.min?r([n.min,f[1]]):f[1]>n.max?r([f[0],n.max]):(e.firstValue=f[0],e.secondValue=f[1],a()&&(n.validateEvent&&((u=o==null?void 0:o.validate)==null||u.call(o,"change").catch(g=>void 0)),e.oldValue=f.slice())):!n.range&&gn(f)&&!Number.isNaN(f)&&(f<n.min?r(n.min):f>n.max?r(n.max):(e.firstValue=f,a()&&(n.validateEvent&&((d=o==null?void 0:o.validate)==null||d.call(o,"change").catch(g=>void 0)),e.oldValue=f)))};c(),ht(()=>e.dragging,u=>{u||c()}),ht(()=>n.modelValue,(u,d)=>{e.dragging||yt(u)&&yt(d)&&u.every((f,g)=>f===d[g])&&e.firstValue===u[0]&&e.secondValue===u[1]||c()},{deep:!0}),ht(()=>[n.min,n.max],()=>{c()})},_at=(n,e,t)=>{const i=te();return $n(async()=>{n.range?(yt(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(!gn(n.modelValue)||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),Es(window,"resize",t),await cn(),t()}),{sliderWrapper:i}},vat=$e({name:"ElSlider"}),bat=$e({...vat,props:iat,emits:sat,setup(n,{expose:e,emit:t}){const i=n,s=vt("slider"),{t:o}=wi(),r=Ki({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:a,slider:c,firstButton:u,secondButton:d,sliderDisabled:f,minValue:g,maxValue:p,runwayStyle:_,barStyle:v,resetSize:C,emitChange:y,onSliderWrapperPrevent:w,onSliderClick:I,onSliderDown:L,onSliderMarkerDown:O,setFirstValue:A,setSecondValue:N}=fat(i,r,t),{stops:D,getStopStyle:P}=gat(i,r,g,p),{inputId:F,isLabeledByFormItem:V}=Qf(i,{formItemContext:a}),U=jr(),Q=W(()=>i.inputSize||U.value),de=W(()=>i.ariaLabel||o("el.slider.defaultLabel",{min:i.min,max:i.max})),q=W(()=>i.range?i.rangeStartLabel||o("el.slider.defaultRangeStartLabel"):de.value),K=W(()=>i.formatValueText?i.formatValueText(Ee.value):`${Ee.value}`),re=W(()=>i.rangeEndLabel||o("el.slider.defaultRangeEndLabel")),Z=W(()=>i.formatValueText?i.formatValueText(Ne.value):`${Ne.value}`),J=W(()=>[s.b(),s.m(U.value),s.is("vertical",i.vertical),{[s.m("with-input")]:i.showInput}]),ge=pat(i);mat(i,r,g,p,t,a);const ve=W(()=>{const we=[i.min,i.max,i.step].map(Ve=>{const Ge=`${Ve}`.split(".")[1];return Ge?Ge.length:0});return Math.max.apply(null,we)}),{sliderWrapper:Le}=_at(i,r,C),{firstValue:Ee,secondValue:Ne,sliderSize:qe}=Gl(r),Re=we=>{r.dragging=we};return Es(Le,"touchstart",w,{passive:!1}),Es(Le,"touchmove",w,{passive:!1}),pi(X0e,{...Gl(i),sliderSize:qe,disabled:f,precision:ve,emitChange:y,resetSize:C,updateDragging:Re}),e({onSliderClick:I}),(we,Ve)=>{var Ge,dt;return G(),he("div",{id:we.range?T(F):void 0,ref_key:"sliderWrapper",ref:Le,class:Y(T(J)),role:we.range?"group":void 0,"aria-label":we.range&&!T(V)?T(de):void 0,"aria-labelledby":we.range&&T(V)?(Ge=T(a))==null?void 0:Ge.labelId:void 0},[oe("div",{ref_key:"slider",ref:c,class:Y([T(s).e("runway"),{"show-input":we.showInput&&!we.range},T(s).is("disabled",T(f))]),style:on(T(_)),onMousedown:T(L),onTouchstartPassive:T(L)},[oe("div",{class:Y(T(s).e("bar")),style:on(T(v))},null,6),ce(Ide,{id:we.range?void 0:T(F),ref_key:"firstButton",ref:u,"model-value":T(Ee),vertical:we.vertical,"tooltip-class":we.tooltipClass,placement:we.placement,role:"slider","aria-label":we.range||!T(V)?T(q):void 0,"aria-labelledby":!we.range&&T(V)?(dt=T(a))==null?void 0:dt.labelId:void 0,"aria-valuemin":we.min,"aria-valuemax":we.range?T(Ne):we.max,"aria-valuenow":T(Ee),"aria-valuetext":T(K),"aria-orientation":we.vertical?"vertical":"horizontal","aria-disabled":T(f),"onUpdate:modelValue":T(A)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),we.range?(G(),nt(Ide,{key:0,ref_key:"secondButton",ref:d,"model-value":T(Ne),vertical:we.vertical,"tooltip-class":we.tooltipClass,placement:we.placement,role:"slider","aria-label":T(re),"aria-valuemin":T(Ee),"aria-valuemax":we.max,"aria-valuenow":T(Ne),"aria-valuetext":T(Z),"aria-orientation":we.vertical?"vertical":"horizontal","aria-disabled":T(f),"onUpdate:modelValue":T(N)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):Qe("v-if",!0),we.showStops?(G(),he("div",{key:1},[(G(!0),he(Qt,null,fi(T(D),(ze,ee)=>(G(),he("div",{key:ee,class:Y(T(s).e("stop")),style:on(T(P)(ze))},null,6))),128))])):Qe("v-if",!0),T(ge).length>0?(G(),he(Qt,{key:2},[oe("div",null,[(G(!0),he(Qt,null,fi(T(ge),(ze,ee)=>(G(),he("div",{key:ee,style:on(T(P)(ze.position)),class:Y([T(s).e("stop"),T(s).e("marks-stop")])},null,6))),128))]),oe("div",{class:Y(T(s).e("marks"))},[(G(!0),he(Qt,null,fi(T(ge),(ze,ee)=>(G(),nt(T(hat),{key:ee,mark:ze.mark,style:on(T(P)(ze.position)),onMousedown:bn(ye=>T(O)(ze.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):Qe("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),we.showInput&&!we.range?(G(),nt(T(L0e),{key:0,ref:"input","model-value":T(Ee),class:Y(T(s).e("input")),step:we.step,disabled:T(f),controls:we.showInputControls,min:we.min,max:we.max,precision:T(ve),debounce:we.debounce,size:T(Q),"onUpdate:modelValue":T(A),onChange:T(y)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):Qe("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var Tat=Rt(bat,[["__file","slider.vue"]]);const Cat=Nn(Tat),yat=Lt({prefixCls:{type:String}}),Lde=$e({name:"ElSpaceItem",props:yat,setup(n,{slots:e}){const t=vt("space"),i=W(()=>`${n.prefixCls||t.b()}__item`);return()=>hn("div",{class:i.value},Ye(e,"default"))}}),Ode={small:8,default:12,large:16};function Eat(n){const e=vt("space"),t=W(()=>[e.b(),e.m(n.direction),n.class]),i=te(0),s=te(0),o=W(()=>{const a=n.wrap||n.fill?{flexWrap:"wrap"}:{},c={alignItems:n.alignment},u={rowGap:`${s.value}px`,columnGap:`${i.value}px`};return[a,c,u,n.style]}),r=W(()=>n.fill?{flexGrow:1,minWidth:`${n.fillRatio}%`}:{});return Sl(()=>{const{size:a="small",wrap:c,direction:u,fill:d}=n;if(yt(a)){const[f=0,g=0]=a;i.value=f,s.value=g}else{let f;gn(a)?f=a:f=Ode[a||"small"]||Ode.small,(c||d)&&u==="horizontal"?i.value=s.value=f:u==="horizontal"?(i.value=f,s.value=0):(s.value=f,i.value=0)}}),{classes:t,containerStyle:o,itemStyle:r}}const Sat=Lt({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:Ke([String,Object,Array]),default:""},style:{type:Ke([String,Array,Object]),default:""},alignment:{type:Ke(String),default:"center"},prefixCls:{type:String},spacer:{type:Ke([Object,String,Number,Array]),default:null,validator:n=>Oo(n)||gn(n)||sn(n)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:l_,validator:n=>gn(n)||yt(n)&&n.length===2&&n.every(gn)}}),wat=$e({name:"ElSpace",props:Sat,setup(n,{slots:e}){const{classes:t,containerStyle:i,itemStyle:s}=Eat(n);function o(r,a="",c=[]){const{prefixCls:u}=n;return r.forEach((d,f)=>{SX(d)?yt(d.children)&&d.children.forEach((g,p)=>{SX(g)&&yt(g.children)?o(g.children,`${a+p}-`,c):c.push(ce(Lde,{style:s.value,prefixCls:u,key:`nested-${a+p}`},{default:()=>[g]},pf.PROPS|pf.STYLE,["style","prefixCls"]))}):tQe(d)&&c.push(ce(Lde,{style:s.value,prefixCls:u,key:`LoopKey${a+f}`},{default:()=>[d]},pf.PROPS|pf.STYLE,["style","prefixCls"]))}),c}return()=>{var r;const{spacer:a,direction:c}=n,u=Ye(e,"default",{key:0},()=>[]);if(((r=u.children)!=null?r:[]).length===0)return null;if(yt(u.children)){let d=o(u.children);if(a){const f=d.length-1;d=d.reduce((g,p,_)=>{const v=[...g,p];return _!==f&&v.push(ce("span",{style:[s.value,c==="vertical"?"width: 100%":null],key:_},[Oo(a)?a:mn(a,pf.TEXT)],pf.STYLE)),v},[])}return ce("div",{class:t.value,style:i.value},d,pf.STYLE|pf.CLASS)}return u.children}}}),Iat=Nn(wat),Lat=Lt({decimalSeparator:{type:String,default:"."},groupSeparator:{type:String,default:","},precision:{type:Number,default:0},formatter:Function,value:{type:Ke([Number,Object]),default:0},prefix:String,suffix:String,title:String,valueStyle:{type:Ke([String,Object,Array])}}),Oat=$e({name:"ElStatistic"}),Rat=$e({...Oat,props:Lat,setup(n,{expose:e}){const t=n,i=vt("statistic"),s=W(()=>{const{value:o,formatter:r,precision:a,decimalSeparator:c,groupSeparator:u}=t;if(ln(r))return r(o);if(!gn(o)||Number.isNaN(o))return o;let[d,f=""]=String(o).split(".");return f=f.padEnd(a,"0").slice(0,a>0?a:0),d=d.replace(/\B(?=(\d{3})+(?!\d))/g,u),[d,f].join(f?c:"")});return e({displayValue:s}),(o,r)=>(G(),he("div",{class:Y(T(i).b())},[o.$slots.title||o.title?(G(),he("div",{key:0,class:Y(T(i).e("head"))},[Ye(o.$slots,"title",{},()=>[mn(st(o.title),1)])],2)):Qe("v-if",!0),oe("div",{class:Y(T(i).e("content"))},[o.$slots.prefix||o.prefix?(G(),he("div",{key:0,class:Y(T(i).e("prefix"))},[Ye(o.$slots,"prefix",{},()=>[oe("span",null,st(o.prefix),1)])],2)):Qe("v-if",!0),oe("span",{class:Y(T(i).e("number")),style:on(o.valueStyle)},st(T(s)),7),o.$slots.suffix||o.suffix?(G(),he("div",{key:1,class:Y(T(i).e("suffix"))},[Ye(o.$slots,"suffix",{},()=>[oe("span",null,st(o.suffix),1)])],2)):Qe("v-if",!0)],2)],2))}});var Mat=Rt(Rat,[["__file","statistic.vue"]]);const Y0e=Nn(Mat),kat=Lt({format:{type:String,default:"HH:mm:ss"},prefix:String,suffix:String,title:String,value:{type:Ke([Number,Object]),default:0},valueStyle:{type:Ke([String,Object,Array])}}),Aat={finish:()=>!0,[Ms]:n=>gn(n)},Nat=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]],Rde=n=>gn(n)?new Date(n).getTime():n.valueOf(),Mde=(n,e)=>{let t=n;const i=/\[([^\]]*)]/g;return Nat.reduce((o,[r,a])=>{const c=new RegExp(`${r}+(?![^\\[\\]]*\\])`,"g");if(c.test(o)){const u=Math.floor(t/a);return t-=u*a,o.replace(c,d=>String(u).padStart(d.length,"0"))}return o},e).replace(i,"$1")},Dat=$e({name:"ElCountdown"}),$at=$e({...Dat,props:kat,emits:Aat,setup(n,{expose:e,emit:t}){const i=n;let s;const o=te(0),r=W(()=>Mde(o.value,i.format)),a=d=>Mde(d,i.format),c=()=>{s&&(H0(s),s=void 0)},u=()=>{const d=Rde(i.value),f=()=>{let g=d-Date.now();t("change",g),g<=0?(g=0,c(),t("finish")):s=QC(f),o.value=g};s=QC(f)};return $n(()=>{o.value=Rde(i.value)-Date.now(),ht(()=>[i.value,i.format],()=>{c(),u()},{immediate:!0})}),As(()=>{c()}),e({displayValue:r}),(d,f)=>(G(),nt(T(Y0e),{value:o.value,title:d.title,prefix:d.prefix,suffix:d.suffix,"value-style":d.valueStyle,formatter:a},Hf({_:2},[fi(d.$slots,(g,p)=>({name:p,fn:_e(()=>[Ye(d.$slots,p)])}))]),1032,["value","title","prefix","suffix","value-style"]))}});var xat=Rt($at,[["__file","countdown.vue"]]);const Pat=Nn(xat),Fat=Lt({space:{type:[Number,String],default:""},active:{type:Number,default:0},direction:{type:String,default:"horizontal",values:["horizontal","vertical"]},alignCenter:{type:Boolean},simple:{type:Boolean},finishStatus:{type:String,values:["wait","process","finish","error","success"],default:"finish"},processStatus:{type:String,values:["wait","process","finish","error","success"],default:"process"}}),Bat={[Ms]:(n,e)=>[n,e].every(gn)},Hat=$e({name:"ElSteps"}),Vat=$e({...Hat,props:Fat,emits:Bat,setup(n,{emit:e}){const t=n,i=vt("steps"),{children:s,addChild:o,removeChild:r}=Tte(Qn(),"ElStep");return ht(s,()=>{s.value.forEach((a,c)=>{a.setIndex(c)})}),pi("ElSteps",{props:t,steps:s,addStep:o,removeStep:r}),ht(()=>t.active,(a,c)=>{e(Ms,a,c)}),(a,c)=>(G(),he("div",{class:Y([T(i).b(),T(i).m(a.simple?"simple":a.direction)])},[Ye(a.$slots,"default")],2))}});var Uat=Rt(Vat,[["__file","steps.vue"]]);const Wat=Lt({title:{type:String,default:""},icon:{type:ks},description:{type:String,default:""},status:{type:String,values:["","wait","process","finish","error","success"],default:""}}),Gat=$e({name:"ElStep"}),zat=$e({...Gat,props:Wat,setup(n){const e=n,t=vt("step"),i=te(-1),s=te({}),o=te(""),r=Kt("ElSteps"),a=Qn();$n(()=>{ht([()=>r.props.active,()=>r.props.processStatus,()=>r.props.finishStatus],([A])=>{L(A)},{immediate:!0})}),As(()=>{r.removeStep(O.uid)});const c=W(()=>e.status||o.value),u=W(()=>{const A=r.steps.value[i.value-1];return A?A.currentStatus:"wait"}),d=W(()=>r.props.alignCenter),f=W(()=>r.props.direction==="vertical"),g=W(()=>r.props.simple),p=W(()=>r.steps.value.length),_=W(()=>{var A;return((A=r.steps.value[p.value-1])==null?void 0:A.uid)===(a==null?void 0:a.uid)}),v=W(()=>g.value?"":r.props.space),C=W(()=>[t.b(),t.is(g.value?"simple":r.props.direction),t.is("flex",_.value&&!v.value&&!d.value),t.is("center",d.value&&!f.value&&!g.value)]),y=W(()=>{const A={flexBasis:gn(v.value)?`${v.value}px`:v.value?v.value:`${100/(p.value-(d.value?0:1))}%`};return f.value||_.value&&(A.maxWidth=`${100/p.value}%`),A}),w=A=>{i.value=A},I=A=>{const N=A==="wait",D={transitionDelay:`${N?"-":""}${150*i.value}ms`},P=A===r.props.processStatus||N?0:100;D.borderWidth=P&&!g.value?"1px":0,D[r.props.direction==="vertical"?"height":"width"]=`${P}%`,s.value=D},L=A=>{A>i.value?o.value=r.props.finishStatus:A===i.value&&u.value!=="error"?o.value=r.props.processStatus:o.value="wait";const N=r.steps.value[i.value-1];N&&N.calcProgress(o.value)},O=Ki({uid:a.uid,currentStatus:c,setIndex:w,calcProgress:I});return r.addStep(O),(A,N)=>(G(),he("div",{style:on(T(y)),class:Y(T(C))},[Qe(" icon & line "),oe("div",{class:Y([T(t).e("head"),T(t).is(T(c))])},[T(g)?Qe("v-if",!0):(G(),he("div",{key:0,class:Y(T(t).e("line"))},[oe("i",{class:Y(T(t).e("line-inner")),style:on(s.value)},null,6)],2)),oe("div",{class:Y([T(t).e("icon"),T(t).is(A.icon||A.$slots.icon?"icon":"text")])},[Ye(A.$slots,"icon",{},()=>[A.icon?(G(),nt(T(tn),{key:0,class:Y(T(t).e("icon-inner"))},{default:_e(()=>[(G(),nt(ui(A.icon)))]),_:1},8,["class"])):T(c)==="success"?(G(),nt(T(tn),{key:1,class:Y([T(t).e("icon-inner"),T(t).is("status")])},{default:_e(()=>[ce(T(oF))]),_:1},8,["class"])):T(c)==="error"?(G(),nt(T(tn),{key:2,class:Y([T(t).e("icon-inner"),T(t).is("status")])},{default:_e(()=>[ce(T(Zg))]),_:1},8,["class"])):T(g)?Qe("v-if",!0):(G(),he("div",{key:3,class:Y(T(t).e("icon-inner"))},st(i.value+1),3))])],2)],2),Qe(" title & description "),oe("div",{class:Y(T(t).e("main"))},[oe("div",{class:Y([T(t).e("title"),T(t).is(T(c))])},[Ye(A.$slots,"title",{},()=>[mn(st(A.title),1)])],2),T(g)?(G(),he("div",{key:0,class:Y(T(t).e("arrow"))},null,2)):(G(),he("div",{key:1,class:Y([T(t).e("description"),T(t).is(T(c))])},[Ye(A.$slots,"description",{},()=>[mn(st(A.description),1)])],2))],2)],6))}});var q0e=Rt(zat,[["__file","item.vue"]]);const Kat=Nn(Uat,{Step:q0e}),jat=Xo(q0e),J0e=n=>["",...l_].includes(n),Xat=Lt({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:J0e},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:ks},activeActionIcon:{type:ks},activeIcon:{type:ks},inactiveIcon:{type:ks},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:Ke(Function)},id:String,tabindex:{type:[String,Number]},...Wa(["ariaLabel"])}),Yat={[Kn]:n=>Us(n)||sn(n)||gn(n),[Ms]:n=>Us(n)||sn(n)||gn(n),[rc]:n=>Us(n)||sn(n)||gn(n)},Q0e="ElSwitch",qat=$e({name:Q0e}),Jat=$e({...qat,props:Xat,emits:Yat,setup(n,{expose:e,emit:t}){const i=n,{formItem:s}=fc(),o=jr(),r=vt("switch"),{inputId:a}=Qf(i,{formItemContext:s}),c=gc(W(()=>i.loading)),u=te(i.modelValue!==!1),d=te(),f=te(),g=W(()=>[r.b(),r.m(o.value),r.is("disabled",c.value),r.is("checked",y.value)]),p=W(()=>[r.e("label"),r.em("label","left"),r.is("active",!y.value)]),_=W(()=>[r.e("label"),r.em("label","right"),r.is("active",y.value)]),v=W(()=>({width:mr(i.width)}));ht(()=>i.modelValue,()=>{u.value=!0});const C=W(()=>u.value?i.modelValue:!1),y=W(()=>C.value===i.activeValue);[i.activeValue,i.inactiveValue].includes(C.value)||(t(Kn,i.inactiveValue),t(Ms,i.inactiveValue),t(rc,i.inactiveValue)),ht(y,O=>{var A;d.value.checked=O,i.validateEvent&&((A=s==null?void 0:s.validate)==null||A.call(s,"change").catch(N=>void 0))});const w=()=>{const O=y.value?i.inactiveValue:i.activeValue;t(Kn,O),t(Ms,O),t(rc,O),cn(()=>{d.value.checked=y.value})},I=()=>{if(c.value)return;const{beforeChange:O}=i;if(!O){w();return}const A=O();[S$(A),Us(A)].includes(!0)||Ll(Q0e,"beforeChange must return type `Promise<boolean>` or `boolean`"),S$(A)?A.then(D=>{D&&w()}).catch(D=>{}):A&&w()},L=()=>{var O,A;(A=(O=d.value)==null?void 0:O.focus)==null||A.call(O)};return $n(()=>{d.value.checked=y.value}),e({focus:L,checked:y}),(O,A)=>(G(),he("div",{class:Y(T(g)),onClick:bn(I,["prevent"])},[oe("input",{id:T(a),ref_key:"input",ref:d,class:Y(T(r).e("input")),type:"checkbox",role:"switch","aria-checked":T(y),"aria-disabled":T(c),"aria-label":O.ariaLabel,name:O.name,"true-value":O.activeValue,"false-value":O.inactiveValue,disabled:T(c),tabindex:O.tabindex,onChange:w,onKeydown:xs(I,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!O.inlinePrompt&&(O.inactiveIcon||O.inactiveText)?(G(),he("span",{key:0,class:Y(T(p))},[O.inactiveIcon?(G(),nt(T(tn),{key:0},{default:_e(()=>[(G(),nt(ui(O.inactiveIcon)))]),_:1})):Qe("v-if",!0),!O.inactiveIcon&&O.inactiveText?(G(),he("span",{key:1,"aria-hidden":T(y)},st(O.inactiveText),9,["aria-hidden"])):Qe("v-if",!0)],2)):Qe("v-if",!0),oe("span",{ref_key:"core",ref:f,class:Y(T(r).e("core")),style:on(T(v))},[O.inlinePrompt?(G(),he("div",{key:0,class:Y(T(r).e("inner"))},[O.activeIcon||O.inactiveIcon?(G(),nt(T(tn),{key:0,class:Y(T(r).is("icon"))},{default:_e(()=>[(G(),nt(ui(T(y)?O.activeIcon:O.inactiveIcon)))]),_:1},8,["class"])):O.activeText||O.inactiveText?(G(),he("span",{key:1,class:Y(T(r).is("text")),"aria-hidden":!T(y)},st(T(y)?O.activeText:O.inactiveText),11,["aria-hidden"])):Qe("v-if",!0)],2)):Qe("v-if",!0),oe("div",{class:Y(T(r).e("action"))},[O.loading?(G(),nt(T(tn),{key:0,class:Y(T(r).is("loading"))},{default:_e(()=>[ce(T(Gm))]),_:1},8,["class"])):T(y)?Ye(O.$slots,"active-action",{key:1},()=>[O.activeActionIcon?(G(),nt(T(tn),{key:0},{default:_e(()=>[(G(),nt(ui(O.activeActionIcon)))]),_:1})):Qe("v-if",!0)]):T(y)?Qe("v-if",!0):Ye(O.$slots,"inactive-action",{key:2},()=>[O.inactiveActionIcon?(G(),nt(T(tn),{key:0},{default:_e(()=>[(G(),nt(ui(O.inactiveActionIcon)))]),_:1})):Qe("v-if",!0)])],2)],6),!O.inlinePrompt&&(O.activeIcon||O.activeText)?(G(),he("span",{key:1,class:Y(T(_))},[O.activeIcon?(G(),nt(T(tn),{key:0},{default:_e(()=>[(G(),nt(ui(O.activeIcon)))]),_:1})):Qe("v-if",!0),!O.activeIcon&&O.activeText?(G(),he("span",{key:1,"aria-hidden":!T(y)},st(O.activeText),9,["aria-hidden"])):Qe("v-if",!0)],2)):Qe("v-if",!0)],10,["onClick"]))}});var Qat=Rt(Jat,[["__file","switch.vue"]]);const Zat=Nn(Qat),h9=function(n){var e;return(e=n.target)==null?void 0:e.closest("td")},ect=function(n,e,t,i,s){if(!e&&!i&&(!s||yt(s)&&!s.length))return n;sn(t)?t=t==="descending"?-1:1:t=t&&t<0?-1:1;const o=i?null:function(a,c){return s?(yt(s)||(s=[s]),s.map(u=>sn(u)?Fr(a,u):u(a,c,n))):(e!=="$key"&&si(a)&&"$value"in a&&(a=a.$value),[si(a)?Fr(a,e):a])},r=function(a,c){if(i)return i(a.value,c.value);for(let u=0,d=a.key.length;u<d;u++){if(a.key[u]<c.key[u])return-1;if(a.key[u]>c.key[u])return 1}return 0};return n.map((a,c)=>({value:a,index:c,key:o?o(a,c):null})).sort((a,c)=>{let u=r(a,c);return u||(u=a.index-c.index),u*+t}).map(a=>a.value)},Z0e=function(n,e){let t=null;return n.columns.forEach(i=>{i.id===e&&(t=i)}),t},tct=function(n,e){let t=null;for(let i=0;i<n.columns.length;i++){const s=n.columns[i];if(s.columnKey===e){t=s;break}}return t||Ll("ElTable",`No column matching with column-key: ${e}`),t},kde=function(n,e,t){const i=(e.className||"").match(new RegExp(`${t}-table_[^\\s]+`,"gm"));return i?Z0e(n,i[0]):null},zc=(n,e)=>{if(!n)throw new Error("Row is required when get row identity");if(sn(e)){if(!e.includes("."))return`${n[e]}`;const t=e.split(".");let i=n;for(const s of t)i=i[s];return`${i}`}else if(ln(e))return e.call(null,n)},zS=function(n,e){const t={};return(n||[]).forEach((i,s)=>{t[zc(i,e)]={row:i,index:s}}),t};function nct(n,e){const t={};let i;for(i in n)t[i]=n[i];for(i in e)if(Wi(e,i)){const s=e[i];typeof s<"u"&&(t[i]=s)}return t}function zte(n){return n===""||n!==void 0&&(n=Number.parseInt(n,10),Number.isNaN(n)&&(n="")),n}function ewe(n){return n===""||n!==void 0&&(n=zte(n),Number.isNaN(n)&&(n=80)),n}function ict(n){return gn(n)?n:sn(n)?/^\d+(?:px)?$/.test(n)?Number.parseInt(n,10):n:null}function sct(...n){return n.length===0?e=>e:n.length===1?n[0]:n.reduce((e,t)=>(...i)=>e(t(...i)))}function LW(n,e,t,i,s,o){let r=o??0,a=!1;const c=n.indexOf(e),u=c!==-1,d=s==null?void 0:s.call(null,e,o),f=p=>{p==="add"?n.push(e):n.splice(c,1),a=!0},g=p=>{let _=0;const v=(i==null?void 0:i.children)&&p[i.children];return v&&yt(v)&&(_+=v.length,v.forEach(C=>{_+=g(C)})),_};return(!s||d)&&(Us(t)?t&&!u?f("add"):!t&&u&&f("remove"):f(u?"remove":"add")),!(i!=null&&i.checkStrictly)&&(i!=null&&i.children)&&yt(e[i.children])&&e[i.children].forEach(p=>{LW(n,p,t??!u,i,s,r+1),r+=g(p)+1}),a}function oct(n,e,t="children",i="hasChildren"){const s=r=>!(yt(r)&&r.length);function o(r,a,c){e(r,a,c),a.forEach(u=>{if(u[i]){e(u,null,c+1);return}const d=u[t];s(d)||o(u,d,c+1)})}n.forEach(r=>{if(r[i]){e(r,null,0);return}const a=r[t];s(a)||o(r,a,0)})}const Ade=(n,e)=>({content:e,...n,popperOptions:{strategy:"fixed",...n.popperOptions}});let uf=null;function rct(n,e,t,i){if((uf==null?void 0:uf.trigger)===t){mEe(uf.vm.component.props,Ade(n,e));return}uf==null||uf();const s=i==null?void 0:i.refs.tableWrapper,o=s==null?void 0:s.dataset.prefix,r=ce(uc,{virtualTriggering:!0,virtualRef:t,appendTo:s,placement:"top",transition:"none",offset:0,hideAfter:0,...Ade(n,e)});r.appContext={...i.appContext,...i};const a=document.createElement("div");GC(r,a),r.component.exposed.onOpen();const c=s==null?void 0:s.querySelector(`.${o}-scrollbar__wrap`);uf=()=>{GC(null,a),c==null||c.removeEventListener("scroll",uf),uf=null},uf.trigger=t,uf.vm=r,c==null||c.addEventListener("scroll",uf)}function twe(n){return n.children?z9e(n.children,twe):[n]}function Nde(n,e){return n+e.colSpan}const nwe=(n,e,t,i)=>{let s=0,o=n;const r=t.states.columns.value;if(i){const c=twe(i[n]);s=r.slice(0,r.indexOf(c[0])).reduce(Nde,0),o=s+c.reduce(Nde,0)-1}else s=n;let a;switch(e){case"left":o<t.states.fixedLeafColumnsLength.value&&(a="left");break;case"right":s>=r.length-t.states.rightFixedLeafColumnsLength.value&&(a="right");break;default:o<t.states.fixedLeafColumnsLength.value?a="left":s>=r.length-t.states.rightFixedLeafColumnsLength.value&&(a="right")}return a?{direction:a,start:s,after:o}:{}},Kte=(n,e,t,i,s,o=0)=>{const r=[],{direction:a,start:c,after:u}=nwe(e,t,i,s);if(a){const d=a==="left";r.push(`${n}-fixed-column--${a}`),d&&u+o===i.states.fixedLeafColumnsLength.value-1?r.push("is-last-column"):!d&&c-o===i.states.columns.value.length-i.states.rightFixedLeafColumnsLength.value&&r.push("is-first-column")}return r};function Dde(n,e){return n+(e.realWidth===null||Number.isNaN(e.realWidth)?Number(e.width):e.realWidth)}const jte=(n,e,t,i)=>{const{direction:s,start:o=0,after:r=0}=nwe(n,e,t,i);if(!s)return;const a={},c=s==="left",u=t.states.columns.value;return c?a.left=u.slice(0,o).reduce(Dde,0):a.right=u.slice(r+1).reverse().reduce(Dde,0),a},sR=(n,e)=>{n&&(Number.isNaN(n[e])||(n[e]=`${n[e]}px`))};function lct(n){const e=Qn(),t=te(!1),i=te([]);return{updateExpandRows:()=>{const c=n.data.value||[],u=n.rowKey.value;if(t.value)i.value=c.slice();else if(u){const d=zS(i.value,u);i.value=c.reduce((f,g)=>{const p=zc(g,u);return d[p]&&f.push(g),f},[])}else i.value=[]},toggleRowExpansion:(c,u)=>{LW(i.value,c,u)&&e.emit("expand-change",c,i.value.slice())},setExpandRowKeys:c=>{e.store.assertRowKey();const u=n.data.value||[],d=n.rowKey.value,f=zS(u,d);i.value=c.reduce((g,p)=>{const _=f[p];return _&&g.push(_.row),g},[])},isRowExpanded:c=>{const u=n.rowKey.value;return u?!!zS(i.value,u)[zc(c,u)]:i.value.includes(c)},states:{expandRows:i,defaultExpandAll:t}}}function act(n){const e=Qn(),t=te(null),i=te(null),s=u=>{e.store.assertRowKey(),t.value=u,r(u)},o=()=>{t.value=null},r=u=>{const{data:d,rowKey:f}=n;let g=null;f.value&&(g=(T(d)||[]).find(p=>zc(p,f.value)===u)),i.value=g,e.emit("current-change",i.value,null)};return{setCurrentRowKey:s,restoreCurrentRowKey:o,setCurrentRowByKey:r,updateCurrentRow:u=>{const d=i.value;if(u&&u!==d){i.value=u,e.emit("current-change",i.value,d);return}!u&&d&&(i.value=null,e.emit("current-change",null,d))},updateCurrentRowData:()=>{const u=n.rowKey.value,d=n.data.value||[],f=i.value;if(!d.includes(f)&&f){if(u){const g=zc(f,u);r(g)}else i.value=null;i.value===null&&e.emit("current-change",null,f)}else t.value&&(r(t.value),o())},states:{_currentRowKey:t,currentRow:i}}}function cct(n){const e=te([]),t=te({}),i=te(16),s=te(!1),o=te({}),r=te("hasChildren"),a=te("children"),c=te(!1),u=Qn(),d=W(()=>{if(!n.rowKey.value)return{};const I=n.data.value||[];return g(I)}),f=W(()=>{const I=n.rowKey.value,L=Object.keys(o.value),O={};return L.length&&L.forEach(A=>{if(o.value[A].length){const N={children:[]};o.value[A].forEach(D=>{const P=zc(D,I);N.children.push(P),D[r.value]&&!O[P]&&(O[P]={children:[]})}),O[A]=N}}),O}),g=I=>{const L=n.rowKey.value,O={};return oct(I,(A,N,D)=>{const P=zc(A,L);yt(N)?O[P]={children:N.map(F=>zc(F,L)),level:D}:s.value&&(O[P]={children:[],lazy:!0,level:D})},a.value,r.value),O},p=(I=!1,L=(O=>(O=u.store)==null?void 0:O.states.defaultExpandAll.value)())=>{var O;const A=d.value,N=f.value,D=Object.keys(A),P={};if(D.length){const F=T(t),V=[],U=(de,q)=>{if(I)return e.value?L||e.value.includes(q):!!(L||de!=null&&de.expanded);{const K=L||e.value&&e.value.includes(q);return!!(de!=null&&de.expanded||K)}};D.forEach(de=>{const q=F[de],K={...A[de]};if(K.expanded=U(q,de),K.lazy){const{loaded:re=!1,loading:Z=!1}=q||{};K.loaded=!!re,K.loading=!!Z,V.push(de)}P[de]=K});const Q=Object.keys(N);s.value&&Q.length&&V.length&&Q.forEach(de=>{const q=F[de],K=N[de].children;if(V.includes(de)){if(P[de].children.length!==0)throw new Error("[ElTable]children must be an empty array.");P[de].children=K}else{const{loaded:re=!1,loading:Z=!1}=q||{};P[de]={lazy:!0,loaded:!!re,loading:!!Z,expanded:U(q,de),children:K,level:""}}})}t.value=P,(O=u.store)==null||O.updateTableScrollY()};ht(()=>e.value,()=>{p(!0)}),ht(()=>d.value,()=>{p()}),ht(()=>f.value,()=>{p()});const _=I=>{e.value=I,p()},v=(I,L)=>{u.store.assertRowKey();const O=n.rowKey.value,A=zc(I,O),N=A&&t.value[A];if(A&&N&&"expanded"in N){const D=N.expanded;L=ys(L)?!N.expanded:L,t.value[A].expanded=L,D!==L&&u.emit("expand-change",I,L),u.store.updateTableScrollY()}},C=I=>{u.store.assertRowKey();const L=n.rowKey.value,O=zc(I,L),A=t.value[O];s.value&&A&&"loaded"in A&&!A.loaded?y(I,O,A):v(I,void 0)},y=(I,L,O)=>{const{load:A}=u.props;A&&!t.value[L].loaded&&(t.value[L].loading=!0,A(I,O,N=>{if(!yt(N))throw new TypeError("[ElTable] data must be an array");t.value[L].loading=!1,t.value[L].loaded=!0,t.value[L].expanded=!0,N.length&&(o.value[L]=N),u.emit("expand-change",I,!0)}))};return{loadData:y,loadOrToggle:C,toggleTreeExpansion:v,updateTreeExpandKeys:_,updateTreeData:p,updateKeyChildren:(I,L)=>{const{lazy:O,rowKey:A}=u.props;if(O){if(!A)throw new Error("[Table] rowKey is required in updateKeyChild");o.value[I]&&(o.value[I]=L)}},normalize:g,states:{expandRowKeys:e,treeData:t,indent:i,lazy:s,lazyTreeNodeMap:o,lazyColumnIdentifier:r,childrenColumnName:a,checkStrictly:c}}}const uct=(n,e)=>{const t=e.sortingColumn;return!t||sn(t.sortable)?n:ect(n,e.sortProp,e.sortOrder,t.sortMethod,t.sortBy)},$U=n=>{const e=[];return n.forEach(t=>{t.children&&t.children.length>0?e.push.apply(e,$U(t.children)):e.push(t)}),e};function dct(){var n;const e=Qn(),{size:t}=Gl((n=e.proxy)==null?void 0:n.$props),i=te(null),s=te([]),o=te([]),r=te(!1),a=te([]),c=te([]),u=te([]),d=te([]),f=te([]),g=te([]),p=te([]),_=te([]),v=[],C=te(0),y=te(0),w=te(0),I=te(!1),L=te([]),O=te(!1),A=te(!1),N=te(null),D=te({}),P=te(null),F=te(null),V=te(null),U=te(null),Q=te(null);ht(s,()=>{var le;e.state&&(Z(!1),e.props.tableLayout==="auto"&&((le=e.refs.tableHeaderRef)==null||le.updateFixedColumnStyle()))},{deep:!0});const de=()=>{if(!i.value)throw new Error("[ElTable] prop row-key is required")},q=le=>{var Fe;(Fe=le.children)==null||Fe.forEach(pe=>{pe.fixed=le.fixed,q(pe)})};let K;const re=()=>{a.value.forEach(Ae=>{q(Ae)}),d.value=a.value.filter(Ae=>Ae.fixed===!0||Ae.fixed==="left"),f.value=a.value.filter(Ae=>Ae.fixed==="right"),ys(K)&&a.value[0]&&a.value[0].type==="selection"&&(K=!!a.value[0].fixed),d.value.length>0&&a.value[0]&&a.value[0].type==="selection"&&(a.value[0].fixed?d.value.some(Et=>Et.type!=="selection")?K=void 0:(a.value[0].fixed=K,K||d.value.shift()):(a.value[0].fixed=!0,d.value.unshift(a.value[0])));const le=a.value.filter(Ae=>!Ae.fixed);c.value=[].concat(d.value).concat(le).concat(f.value);const Fe=$U(le),pe=$U(d.value),je=$U(f.value);C.value=Fe.length,y.value=pe.length,w.value=je.length,u.value=[].concat(pe).concat(Fe).concat(je),r.value=d.value.length>0||f.value.length>0},Z=(le,Fe=!1)=>{le&&re(),Fe?e.state.doLayout():e.state.debouncedUpdateLayout()},J=le=>L.value.some(Fe=>Ha(Fe,le)),ge=()=>{I.value=!1;const le=L.value;L.value=[],le.length&&e.emit("selection-change",[])},ve=()=>{let le;if(i.value){le=[];const Fe=zS(L.value,i.value),pe=zS(s.value,i.value);for(const je in Fe)Wi(Fe,je)&&!pe[je]&&le.push(Fe[je].row)}else le=L.value.filter(Fe=>!s.value.includes(Fe));if(le.length){const Fe=L.value.filter(pe=>!le.includes(pe));L.value=Fe,e.emit("selection-change",Fe.slice())}},Le=()=>(L.value||[]).slice(),Ee=(le,Fe,pe=!0,je=!1)=>{var Ae,Et,Tn,Hn;const Xn={children:(Et=(Ae=e==null?void 0:e.store)==null?void 0:Ae.states)==null?void 0:Et.childrenColumnName.value,checkStrictly:(Hn=(Tn=e==null?void 0:e.store)==null?void 0:Tn.states)==null?void 0:Hn.checkStrictly.value};if(LW(L.value,le,Fe,Xn,je?void 0:N.value)){const Zn=(L.value||[]).slice();pe&&e.emit("select",Zn,le),e.emit("selection-change",Zn)}},Ne=()=>{var le,Fe;const pe=A.value?!I.value:!(I.value||L.value.length);I.value=pe;let je=!1,Ae=0;const Et=(Fe=(le=e==null?void 0:e.store)==null?void 0:le.states)==null?void 0:Fe.rowKey.value,{childrenColumnName:Tn}=e.store.states,Hn={children:Tn.value,checkStrictly:!1};s.value.forEach((Xn,vs)=>{const Zn=vs+Ae;LW(L.value,Xn,pe,Hn,N.value,Zn)&&(je=!0),Ae+=we(zc(Xn,Et))}),je&&e.emit("selection-change",L.value?L.value.slice():[]),e.emit("select-all",(L.value||[]).slice())},qe=()=>{const le=zS(L.value,i.value);s.value.forEach(Fe=>{const pe=zc(Fe,i.value),je=le[pe];je&&(L.value[je.index]=Fe)})},Re=()=>{var le;if(((le=s.value)==null?void 0:le.length)===0){I.value=!1;return}const{childrenColumnName:Fe}=e.store.states,pe=i.value?zS(L.value,i.value):void 0;let je=0,Ae=0;const Et=Xn=>pe?!!pe[zc(Xn,i.value)]:L.value.includes(Xn),Tn=Xn=>{var vs;for(const Zn of Xn){const Hi=N.value&&N.value.call(null,Zn,je);if(Et(Zn))Ae++;else if(!N.value||Hi)return!1;if(je++,(vs=Zn[Fe.value])!=null&&vs.length&&!Tn(Zn[Fe.value]))return!1}return!0},Hn=Tn(s.value||[]);I.value=Ae===0?!1:Hn},we=le=>{var Fe;if(!e||!e.store)return 0;const{treeData:pe}=e.store.states;let je=0;const Ae=(Fe=pe.value[le])==null?void 0:Fe.children;return Ae&&(je+=Ae.length,Ae.forEach(Et=>{je+=we(Et)})),je},Ve=(le,Fe)=>{yt(le)||(le=[le]);const pe={};return le.forEach(je=>{D.value[je.id]=Fe,pe[je.columnKey||je.id]=Fe}),pe},Ge=(le,Fe,pe)=>{F.value&&F.value!==le&&(F.value.order=null),F.value=le,V.value=Fe,U.value=pe},dt=()=>{let le=T(o);Object.keys(D.value).forEach(Fe=>{const pe=D.value[Fe];if(!pe||pe.length===0)return;const je=Z0e({columns:u.value},Fe);je&&je.filterMethod&&(le=le.filter(Ae=>pe.some(Et=>je.filterMethod.call(null,Et,Ae,je))))}),P.value=le},ze=()=>{s.value=uct(P.value,{sortingColumn:F.value,sortProp:V.value,sortOrder:U.value})},ee=(le=void 0)=>{le&&le.filter||dt(),ze()},ye=le=>{const{tableHeaderRef:Fe}=e.refs;if(!Fe)return;const pe=Object.assign({},Fe.filterPanels),je=Object.keys(pe);if(je.length)if(sn(le)&&(le=[le]),yt(le)){const Ae=le.map(Et=>tct({columns:u.value},Et));je.forEach(Et=>{const Tn=Ae.find(Hn=>Hn.id===Et);Tn&&(Tn.filteredValue=[])}),e.store.commit("filterChange",{column:Ae,values:[],silent:!0,multi:!0})}else je.forEach(Ae=>{const Et=u.value.find(Tn=>Tn.id===Ae);Et&&(Et.filteredValue=[])}),D.value={},e.store.commit("filterChange",{column:{},values:[],silent:!0})},Me=()=>{F.value&&(Ge(null,null,null),e.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:et,toggleRowExpansion:at,updateExpandRows:Ue,states:Se,isRowExpanded:Ie}=lct({data:s,rowKey:i}),{updateTreeExpandKeys:Xe,toggleTreeExpansion:it,updateTreeData:Tt,updateKeyChildren:He,loadOrToggle:ke,states:ot}=cct({data:s,rowKey:i}),{updateCurrentRowData:Ct,updateCurrentRow:Gt,setCurrentRowKey:Ot,states:En}=act({data:s,rowKey:i});return{assertRowKey:de,updateColumns:re,scheduleLayout:Z,isSelected:J,clearSelection:ge,cleanSelection:ve,getSelectionRows:Le,toggleRowSelection:Ee,_toggleAllSelection:Ne,toggleAllSelection:null,updateSelectionByRowKey:qe,updateAllSelected:Re,updateFilters:Ve,updateCurrentRow:Gt,updateSort:Ge,execFilter:dt,execSort:ze,execQuery:ee,clearFilter:ye,clearSort:Me,toggleRowExpansion:at,setExpandRowKeysAdapter:le=>{et(le),Xe(le)},setCurrentRowKey:Ot,toggleRowExpansionAdapter:(le,Fe)=>{u.value.some(({type:je})=>je==="expand")?at(le,Fe):it(le,Fe)},isRowExpanded:Ie,updateExpandRows:Ue,updateCurrentRowData:Ct,loadOrToggle:ke,updateTreeData:Tt,updateKeyChildren:He,states:{tableSize:t,rowKey:i,data:s,_data:o,isComplex:r,_columns:a,originColumns:c,columns:u,fixedColumns:d,rightFixedColumns:f,leafColumns:g,fixedLeafColumns:p,rightFixedLeafColumns:_,updateOrderFns:v,leafColumnsLength:C,fixedLeafColumnsLength:y,rightFixedLeafColumnsLength:w,isAllSelected:I,selection:L,reserveSelection:O,selectOnIndeterminate:A,selectable:N,filters:D,filteredData:P,sortingColumn:F,sortProp:V,sortOrder:U,hoverRow:Q,...Se,...ot,...En}}}function XX(n,e){return n.map(t=>{var i;return t.id===e.id?e:((i=t.children)!=null&&i.length&&(t.children=XX(t.children,e)),t)})}function YX(n){n.forEach(e=>{var t,i;e.no=(t=e.getColumnIndex)==null?void 0:t.call(e),(i=e.children)!=null&&i.length&&YX(e.children)}),n.sort((e,t)=>e.no-t.no)}function hct(){const n=Qn(),e=dct();return{ns:vt("table"),...e,mutations:{setData(r,a){const c=T(r._data)!==a;r.data.value=a,r._data.value=a,n.store.execQuery(),n.store.updateCurrentRowData(),n.store.updateExpandRows(),n.store.updateTreeData(n.store.states.defaultExpandAll.value),T(r.reserveSelection)?(n.store.assertRowKey(),n.store.updateSelectionByRowKey()):c?n.store.clearSelection():n.store.cleanSelection(),n.store.updateAllSelected(),n.$ready&&n.store.scheduleLayout()},insertColumn(r,a,c,u){const d=T(r._columns);let f=[];c?(c&&!c.children&&(c.children=[]),c.children.push(a),f=XX(d,c)):(d.push(a),f=d),YX(f),r._columns.value=f,r.updateOrderFns.push(u),a.type==="selection"&&(r.selectable.value=a.selectable,r.reserveSelection.value=a.reserveSelection),n.$ready&&(n.store.updateColumns(),n.store.scheduleLayout())},updateColumnOrder(r,a){var c;((c=a.getColumnIndex)==null?void 0:c.call(a))!==a.no&&(YX(r._columns.value),n.$ready&&n.store.updateColumns())},removeColumn(r,a,c,u){const d=T(r._columns)||[];if(c)c.children.splice(c.children.findIndex(g=>g.id===a.id),1),cn(()=>{var g;((g=c.children)==null?void 0:g.length)===0&&delete c.children}),r._columns.value=XX(d,c);else{const g=d.indexOf(a);g>-1&&(d.splice(g,1),r._columns.value=d)}const f=r.updateOrderFns.indexOf(u);f>-1&&r.updateOrderFns.splice(f,1),n.$ready&&(n.store.updateColumns(),n.store.scheduleLayout())},sort(r,a){const{prop:c,order:u,init:d}=a;if(c){const f=T(r.columns).find(g=>g.property===c);f&&(f.order=u,n.store.updateSort(f,c,u),n.store.commit("changeSortCondition",{init:d}))}},changeSortCondition(r,a){const{sortingColumn:c,sortProp:u,sortOrder:d}=r,f=T(c),g=T(u),p=T(d);p===null&&(r.sortingColumn.value=null,r.sortProp.value=null);const _={filter:!0};n.store.execQuery(_),(!a||!(a.silent||a.init))&&n.emit("sort-change",{column:f,prop:g,order:p}),n.store.updateTableScrollY()},filterChange(r,a){const{column:c,values:u,silent:d}=a,f=n.store.updateFilters(c,u);n.store.execQuery(),d||n.emit("filter-change",f),n.store.updateTableScrollY()},toggleAllSelection(){n.store.toggleAllSelection()},rowSelectedChanged(r,a){n.store.toggleRowSelection(a),n.store.updateAllSelected()},setHoverRow(r,a){r.hoverRow.value=a},setCurrentRow(r,a){n.store.updateCurrentRow(a)}},commit:function(r,...a){const c=n.store.mutations;if(c[r])c[r].apply(n,[n.store.states].concat(a));else throw new Error(`Action not found: ${r}`)},updateTableScrollY:function(){cn(()=>n.layout.updateScrollY.apply(n.layout))}}}const VD={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data","treeProps.hasChildren":{key:"lazyColumnIdentifier",default:"hasChildren"},"treeProps.children":{key:"childrenColumnName",default:"children"},"treeProps.checkStrictly":{key:"checkStrictly",default:!1}};function fct(n,e){if(!n)throw new Error("Table is required.");const t=hct();return t.toggleAllSelection=Md(t._toggleAllSelection,10),Object.keys(VD).forEach(i=>{iwe(swe(e,i),i,t)}),gct(t,e),t}function gct(n,e){Object.keys(VD).forEach(t=>{ht(()=>swe(e,t),i=>{iwe(i,t,n)})})}function iwe(n,e,t){let i=n,s=VD[e];typeof VD[e]=="object"&&(s=s.key,i=i||VD[e].default),t.states[s].value=i}function swe(n,e){if(e.includes(".")){const t=e.split(".");let i=n;return t.forEach(s=>{i=i[s]}),i}else return n[e]}class pct{constructor(e){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=te(null),this.scrollX=te(!1),this.scrollY=te(!1),this.bodyWidth=te(null),this.fixedWidth=te(null),this.rightFixedWidth=te(null),this.gutterWidth=0;for(const t in e)Wi(e,t)&&(Ss(this[t])?this[t].value=e[t]:this[t]=e[t]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const t=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(t!=null&&t.wrapRef)){let i=!0;const s=this.scrollY.value;return i=t.wrapRef.scrollHeight>t.wrapRef.clientHeight,this.scrollY.value=i,s!==i}return!1}setHeight(e,t="height"){if(!Si)return;const i=this.table.vnode.el;if(e=ict(e),this.height.value=Number(e),!i&&(e||e===0))return cn(()=>this.setHeight(e,t));gn(e)?(i.style[t]=`${e}px`,this.updateElsHeight()):sn(e)&&(i.style[t]=e,this.updateElsHeight())}setMaxHeight(e){this.setHeight(e,"max-height")}getFlattenColumns(){const e=[];return this.table.store.states.columns.value.forEach(i=>{i.isColumnGroup?e.push.apply(e,i.columns):e.push(i)}),e}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(e){if(!e)return!0;let t=e;for(;t.tagName!=="DIV";){if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}updateColumnsWidth(){if(!Si)return;const e=this.fit,t=this.table.vnode.el.clientWidth;let i=0;const s=this.getFlattenColumns(),o=s.filter(c=>!gn(c.width));if(s.forEach(c=>{gn(c.width)&&c.realWidth&&(c.realWidth=null)}),o.length>0&&e){if(s.forEach(c=>{i+=Number(c.width||c.minWidth||80)}),i<=t){this.scrollX.value=!1;const c=t-i;if(o.length===1)o[0].realWidth=Number(o[0].minWidth||80)+c;else{const u=o.reduce((g,p)=>g+Number(p.minWidth||80),0),d=c/u;let f=0;o.forEach((g,p)=>{if(p===0)return;const _=Math.floor(Number(g.minWidth||80)*d);f+=_,g.realWidth=Number(g.minWidth||80)+_}),o[0].realWidth=Number(o[0].minWidth||80)+c-f}}else this.scrollX.value=!0,o.forEach(c=>{c.realWidth=Number(c.minWidth)});this.bodyWidth.value=Math.max(i,t),this.table.state.resizeState.value.width=this.bodyWidth.value}else s.forEach(c=>{!c.width&&!c.minWidth?c.realWidth=80:c.realWidth=Number(c.width||c.minWidth),i+=c.realWidth}),this.scrollX.value=i>t,this.bodyWidth.value=i;const r=this.store.states.fixedColumns.value;if(r.length>0){let c=0;r.forEach(u=>{c+=Number(u.realWidth||u.width)}),this.fixedWidth.value=c}const a=this.store.states.rightFixedColumns.value;if(a.length>0){let c=0;a.forEach(u=>{c+=Number(u.realWidth||u.width)}),this.rightFixedWidth.value=c}this.notifyObservers("columns")}addObserver(e){this.observers.push(e)}removeObserver(e){const t=this.observers.indexOf(e);t!==-1&&this.observers.splice(t,1)}notifyObservers(e){this.observers.forEach(i=>{var s,o;switch(e){case"columns":(s=i.state)==null||s.onColumnsChange(this);break;case"scrollable":(o=i.state)==null||o.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${e}.`)}})}}const{CheckboxGroup:mct}=Kf,_ct=$e({name:"ElTableFilterPanel",components:{ElCheckbox:Kf,ElCheckboxGroup:mct,ElScrollbar:a_,ElTooltip:uc,ElIcon:tn,ArrowDown:Lb,ArrowUp:Zee},directives:{ClickOutside:cb},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function},appendTo:{type:String}},setup(n){const e=Qn(),{t}=wi(),i=vt("table-filter"),s=e==null?void 0:e.parent;s.filterPanels.value[n.column.id]||(s.filterPanels.value[n.column.id]=e);const o=te(!1),r=te(null),a=W(()=>n.column&&n.column.filters),c=W(()=>n.column.filterClassName?`${i.b()} ${n.column.filterClassName}`:i.b()),u=W({get:()=>{var O;return(((O=n.column)==null?void 0:O.filteredValue)||[])[0]},set:O=>{d.value&&(typeof O<"u"&&O!==null?d.value.splice(0,1,O):d.value.splice(0,1))}}),d=W({get(){return n.column?n.column.filteredValue||[]:[]},set(O){n.column&&n.upDataColumn("filteredValue",O)}}),f=W(()=>n.column?n.column.filterMultiple:!0),g=O=>O.value===u.value,p=()=>{o.value=!1},_=O=>{O.stopPropagation(),o.value=!o.value},v=()=>{o.value=!1},C=()=>{I(d.value),p()},y=()=>{d.value=[],I(d.value),p()},w=O=>{u.value=O,I(typeof O<"u"&&O!==null?d.value:[]),p()},I=O=>{n.store.commit("filterChange",{column:n.column,values:O}),n.store.updateAllSelected()};ht(o,O=>{n.column&&n.upDataColumn("filterOpened",O)},{immediate:!0});const L=W(()=>{var O,A;return(A=(O=r.value)==null?void 0:O.popperRef)==null?void 0:A.contentRef});return{tooltipVisible:o,multiple:f,filterClassName:c,filteredValue:d,filterValue:u,filters:a,handleConfirm:C,handleReset:y,handleSelect:w,isActive:g,t,ns:i,showFilterPanel:_,hideFilterPanel:v,popperPaneRef:L,tooltip:r}}});function vct(n,e,t,i,s,o){const r=Bt("el-checkbox"),a=Bt("el-checkbox-group"),c=Bt("el-scrollbar"),u=Bt("arrow-up"),d=Bt("arrow-down"),f=Bt("el-icon"),g=Bt("el-tooltip"),p=N5("click-outside");return G(),nt(g,{ref:"tooltip",visible:n.tooltipVisible,offset:0,placement:n.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":n.filterClassName,persistent:"","append-to":n.appendTo},{content:_e(()=>[n.multiple?(G(),he("div",{key:0},[oe("div",{class:Y(n.ns.e("content"))},[ce(c,{"wrap-class":n.ns.e("wrap")},{default:_e(()=>[ce(a,{modelValue:n.filteredValue,"onUpdate:modelValue":_=>n.filteredValue=_,class:Y(n.ns.e("checkbox-group"))},{default:_e(()=>[(G(!0),he(Qt,null,fi(n.filters,_=>(G(),nt(r,{key:_.value,value:_.value},{default:_e(()=>[mn(st(_.text),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","class"])]),_:1},8,["wrap-class"])],2),oe("div",{class:Y(n.ns.e("bottom"))},[oe("button",{class:Y({[n.ns.is("disabled")]:n.filteredValue.length===0}),disabled:n.filteredValue.length===0,type:"button",onClick:n.handleConfirm},st(n.t("el.table.confirmFilter")),11,["disabled","onClick"]),oe("button",{type:"button",onClick:n.handleReset},st(n.t("el.table.resetFilter")),9,["onClick"])],2)])):(G(),he("ul",{key:1,class:Y(n.ns.e("list"))},[oe("li",{class:Y([n.ns.e("list-item"),{[n.ns.is("active")]:n.filterValue===void 0||n.filterValue===null}]),onClick:_=>n.handleSelect(null)},st(n.t("el.table.clearFilter")),11,["onClick"]),(G(!0),he(Qt,null,fi(n.filters,_=>(G(),he("li",{key:_.value,class:Y([n.ns.e("list-item"),n.ns.is("active",n.isActive(_))]),label:_.value,onClick:v=>n.handleSelect(_.value)},st(_.text),11,["label","onClick"]))),128))],2))]),default:_e(()=>[Un((G(),he("span",{class:Y([`${n.ns.namespace.value}-table__column-filter-trigger`,`${n.ns.namespace.value}-none-outline`]),onClick:n.showFilterPanel},[ce(f,null,{default:_e(()=>[Ye(n.$slots,"filter-icon",{},()=>[n.column.filterOpened?(G(),nt(u,{key:0})):(G(),nt(d,{key:1}))])]),_:3})],10,["onClick"])),[[p,n.hideFilterPanel,n.popperPaneRef]])]),_:3},8,["visible","placement","popper-class","append-to"])}var bct=Rt(_ct,[["render",vct],["__file","filter-panel.vue"]]);function owe(n){const e=Qn();A5(()=>{t.value.addObserver(e)}),$n(()=>{i(t.value),s(t.value)}),s_(()=>{i(t.value),s(t.value)}),Cb(()=>{t.value.removeObserver(e)});const t=W(()=>{const o=n.layout;if(!o)throw new Error("Can not find table layout.");return o}),i=o=>{var r;const a=((r=n.vnode.el)==null?void 0:r.querySelectorAll("colgroup > col"))||[];if(!a.length)return;const c=o.getFlattenColumns(),u={};c.forEach(d=>{u[d.id]=d});for(let d=0,f=a.length;d<f;d++){const g=a[d],p=g.getAttribute("name"),_=u[p];_&&g.setAttribute("width",_.realWidth||_.width)}},s=o=>{var r,a;const c=((r=n.vnode.el)==null?void 0:r.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let d=0,f=c.length;d<f;d++)c[d].setAttribute("width",o.scrollY.value?o.gutterWidth:"0");const u=((a=n.vnode.el)==null?void 0:a.querySelectorAll("th.gutter"))||[];for(let d=0,f=u.length;d<f;d++){const g=u[d];g.style.width=o.scrollY.value?`${o.gutterWidth}px`:"0",g.style.display=o.scrollY.value?"":"none"}};return{tableLayout:t.value,onColumnsChange:i,onScrollableChange:s}}const c_=Symbol("ElTable");function Tct(n,e){const t=Qn(),i=Kt(c_),s=v=>{v.stopPropagation()},o=(v,C)=>{!C.filters&&C.sortable?_(v,C,!1):C.filterable&&!C.sortable&&s(v),i==null||i.emit("header-click",C,v)},r=(v,C)=>{i==null||i.emit("header-contextmenu",C,v)},a=te(null),c=te(!1),u=te({}),d=(v,C)=>{if(Si&&!(C.children&&C.children.length>0)&&a.value&&n.border){c.value=!0;const y=i;e("set-drag-visible",!0);const I=(y==null?void 0:y.vnode.el).getBoundingClientRect().left,L=t.vnode.el.querySelector(`th.${C.id}`),O=L.getBoundingClientRect(),A=O.left-I+30;Of(L,"noclick"),u.value={startMouseLeft:v.clientX,startLeft:O.right-I,startColumnLeft:O.left-I,tableLeft:I};const N=y==null?void 0:y.refs.resizeProxy;N.style.left=`${u.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const D=F=>{const V=F.clientX-u.value.startMouseLeft,U=u.value.startLeft+V;N.style.left=`${Math.max(A,U)}px`},P=()=>{if(c.value){const{startColumnLeft:F,startLeft:V}=u.value,Q=Number.parseInt(N.style.left,10)-F;C.width=C.realWidth=Q,y==null||y.emit("header-dragend",C.width,V-F,C,v),requestAnimationFrame(()=>{n.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",c.value=!1,a.value=null,u.value={},e("set-drag-visible",!1)}document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",P),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{qc(L,"noclick")},0)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",P)}},f=(v,C)=>{var y;if(C.children&&C.children.length>0)return;const w=v.target;if(!mh(w))return;const I=w==null?void 0:w.closest("th");if(!(!C||!C.resizable||!I)&&!c.value&&n.border){const L=I.getBoundingClientRect(),O=document.body.style,A=((y=I.parentNode)==null?void 0:y.lastElementChild)===I;L.width>12&&L.right-v.pageX<8&&!A?(O.cursor="col-resize",Td(I,"is-sortable")&&(I.style.cursor="col-resize"),a.value=C):c.value||(O.cursor="",Td(I,"is-sortable")&&(I.style.cursor="pointer"),a.value=null)}},g=()=>{Si&&(document.body.style.cursor="")},p=({order:v,sortOrders:C})=>{if(v==="")return C[0];const y=C.indexOf(v||null);return C[y>C.length-2?0:y+1]},_=(v,C,y)=>{var w;v.stopPropagation();const I=C.order===y?null:y||p(C),L=(w=v.target)==null?void 0:w.closest("th");if(L&&Td(L,"noclick")){qc(L,"noclick");return}if(!C.sortable)return;const O=v.currentTarget;if(["ascending","descending"].some(F=>Td(O,F)&&!C.sortOrders.includes(F)))return;const A=n.store.states;let N=A.sortProp.value,D;const P=A.sortingColumn.value;(P!==C||P===C&&P.order===null)&&(P&&(P.order=null),A.sortingColumn.value=C,N=C.property),I?D=C.order=I:D=C.order=null,A.sortProp.value=N,A.sortOrder.value=D,i==null||i.store.commit("changeSortCondition")};return{handleHeaderClick:o,handleHeaderContextMenu:r,handleMouseDown:d,handleMouseMove:f,handleMouseOut:g,handleSortClick:_,handleFilterClick:s}}function Cct(n){const e=Kt(c_),t=vt("table");return{getHeaderRowStyle:a=>{const c=e==null?void 0:e.props.headerRowStyle;return ln(c)?c.call(null,{rowIndex:a}):c},getHeaderRowClass:a=>{const c=[],u=e==null?void 0:e.props.headerRowClassName;return sn(u)?c.push(u):ln(u)&&c.push(u.call(null,{rowIndex:a})),c.join(" ")},getHeaderCellStyle:(a,c,u,d)=>{var f;let g=(f=e==null?void 0:e.props.headerCellStyle)!=null?f:{};ln(g)&&(g=g.call(null,{rowIndex:a,columnIndex:c,row:u,column:d}));const p=jte(c,d.fixed,n.store,u);return sR(p,"left"),sR(p,"right"),Object.assign({},g,p)},getHeaderCellClass:(a,c,u,d)=>{const f=Kte(t.b(),c,d.fixed,n.store,u),g=[d.id,d.order,d.headerAlign,d.className,d.labelClassName,...f];d.children||g.push("is-leaf"),d.sortable&&g.push("is-sortable");const p=e==null?void 0:e.props.headerCellClassName;return sn(p)?g.push(p):ln(p)&&g.push(p.call(null,{rowIndex:a,columnIndex:c,row:u,column:d})),g.push(t.e("cell")),g.filter(_=>!!_).join(" ")}}}const rwe=n=>{const e=[];return n.forEach(t=>{t.children?(e.push(t),e.push.apply(e,rwe(t.children))):e.push(t)}),e},lwe=n=>{let e=1;const t=(o,r)=>{if(r&&(o.level=r.level+1,e<o.level&&(e=o.level)),o.children){let a=0;o.children.forEach(c=>{t(c,o),a+=c.colSpan}),o.colSpan=a}else o.colSpan=1};n.forEach(o=>{o.level=1,t(o,void 0)});const i=[];for(let o=0;o<e;o++)i.push([]);return rwe(n).forEach(o=>{o.children?(o.rowSpan=1,o.children.forEach(r=>r.isSubColumn=!0)):o.rowSpan=e-o.level+1,i[o.level-1].push(o)}),i};function yct(n){const e=Kt(c_),t=W(()=>lwe(n.store.states.originColumns.value));return{isGroup:W(()=>{const o=t.value.length>1;return o&&e&&(e.state.isGroup.value=!0),o}),toggleAllSelection:o=>{o.stopPropagation(),e==null||e.store.commit("toggleAllSelection")},columnRows:t}}var Ect=$e({name:"ElTableHeader",components:{ElCheckbox:Kf},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})},appendFilterPanelTo:{type:String}},setup(n,{emit:e}){const t=Qn(),i=Kt(c_),s=vt("table"),o=te({}),{onColumnsChange:r,onScrollableChange:a}=owe(i),c=(i==null?void 0:i.props.tableLayout)==="auto",u=Ki(new Map),d=te(),f=()=>{setTimeout(()=>{u.size>0&&(u.forEach((F,V)=>{const U=d.value.querySelector(`.${V.replace(/\s/g,".")}`);if(U){const Q=U.getBoundingClientRect().width;F.width=Q}}),u.clear())})};ht(u,f),$n(async()=>{await cn(),await cn();const{prop:F,order:V}=n.defaultSort;i==null||i.store.commit("sort",{prop:F,order:V,init:!0}),f()});const{handleHeaderClick:g,handleHeaderContextMenu:p,handleMouseDown:_,handleMouseMove:v,handleMouseOut:C,handleSortClick:y,handleFilterClick:w}=Tct(n,e),{getHeaderRowStyle:I,getHeaderRowClass:L,getHeaderCellStyle:O,getHeaderCellClass:A}=Cct(n),{isGroup:N,toggleAllSelection:D,columnRows:P}=yct(n);return t.state={onColumnsChange:r,onScrollableChange:a},t.filterPanels=o,{ns:s,filterPanels:o,onColumnsChange:r,onScrollableChange:a,columnRows:P,getHeaderRowClass:L,getHeaderRowStyle:I,getHeaderCellClass:A,getHeaderCellStyle:O,handleHeaderClick:g,handleHeaderContextMenu:p,handleMouseDown:_,handleMouseMove:v,handleMouseOut:C,handleSortClick:y,handleFilterClick:w,isGroup:N,toggleAllSelection:D,saveIndexSelection:u,isTableLayoutAuto:c,theadRef:d,updateFixedColumnStyle:f}},render(){const{ns:n,isGroup:e,columnRows:t,getHeaderCellStyle:i,getHeaderCellClass:s,getHeaderRowClass:o,getHeaderRowStyle:r,handleHeaderClick:a,handleHeaderContextMenu:c,handleMouseDown:u,handleMouseMove:d,handleSortClick:f,handleMouseOut:g,store:p,$parent:_,saveIndexSelection:v,isTableLayoutAuto:C}=this;let y=1;return hn("thead",{ref:"theadRef",class:{[n.is("group")]:e}},t.map((w,I)=>hn("tr",{class:o(I),key:I,style:r(I)},w.map((L,O)=>{L.rowSpan>y&&(y=L.rowSpan);const A=s(I,O,w,L);return C&&L.fixed&&v.set(A,L),hn("th",{class:A,colspan:L.colSpan,key:`${L.id}-thead`,rowspan:L.rowSpan,style:i(I,O,w,L),onClick:N=>{N.currentTarget.classList.contains("noclick")||a(N,L)},onContextmenu:N=>c(N,L),onMousedown:N=>u(N,L),onMousemove:N=>d(N,L),onMouseout:g},[hn("div",{class:["cell",L.filteredValue&&L.filteredValue.length>0?"highlight":""]},[L.renderHeader?L.renderHeader({column:L,$index:O,store:p,_self:_}):L.label,L.sortable&&hn("span",{onClick:N=>f(N,L),class:"caret-wrapper"},[hn("i",{onClick:N=>f(N,L,"ascending"),class:"sort-caret ascending"}),hn("i",{onClick:N=>f(N,L,"descending"),class:"sort-caret descending"})]),L.filterable&&hn(bct,{store:p,placement:L.filterPlacement||"bottom-start",appendTo:_.appendFilterPanelTo,column:L,upDataColumn:(N,D)=>{L[N]=D}},{"filter-icon":()=>L.renderFilterIcon?L.renderFilterIcon({filterOpened:L.filterOpened}):null})])])}))))}});function f9(n,e,t=.03){return n-e>t}function Sct(n){const e=Kt(c_),t=te(""),i=te(hn("div")),s=(_,v,C)=>{var y;const w=e,I=h9(_);let L;const O=(y=w==null?void 0:w.vnode.el)==null?void 0:y.dataset.prefix;I&&(L=kde({columns:n.store.states.columns.value},I,O),L&&(w==null||w.emit(`cell-${C}`,v,L,I,_))),w==null||w.emit(`row-${C}`,v,L,_)},o=(_,v)=>{s(_,v,"dblclick")},r=(_,v)=>{n.store.commit("setCurrentRow",v),s(_,v,"click")},a=(_,v)=>{s(_,v,"contextmenu")},c=Md(_=>{n.store.commit("setHoverRow",_)},30),u=Md(()=>{n.store.commit("setHoverRow",null)},30),d=_=>{const v=window.getComputedStyle(_,null),C=Number.parseInt(v.paddingLeft,10)||0,y=Number.parseInt(v.paddingRight,10)||0,w=Number.parseInt(v.paddingTop,10)||0,I=Number.parseInt(v.paddingBottom,10)||0;return{left:C,right:y,top:w,bottom:I}},f=(_,v,C)=>{let y=v.target.parentNode;for(;_>1&&(y=y==null?void 0:y.nextSibling,!(!y||y.nodeName!=="TR"));)C(y,"hover-row hover-fixed-row"),_--};return{handleDoubleClick:o,handleClick:r,handleContextMenu:a,handleMouseEnter:c,handleMouseLeave:u,handleCellMouseEnter:(_,v,C)=>{var y;const w=e,I=h9(_),L=(y=w==null?void 0:w.vnode.el)==null?void 0:y.dataset.prefix;if(I){const re=kde({columns:n.store.states.columns.value},I,L);I.rowSpan>1&&f(I.rowSpan,_,Of);const Z=w.hoverState={cell:I,column:re,row:v};w==null||w.emit("cell-mouse-enter",Z.row,Z.column,Z.cell,_)}if(!C)return;const O=_.target.querySelector(".cell");if(!(Td(O,`${L}-tooltip`)&&O.childNodes.length))return;const A=document.createRange();A.setStart(O,0),A.setEnd(O,O.childNodes.length);const{width:N,height:D}=A.getBoundingClientRect(),{width:P,height:F}=O.getBoundingClientRect(),{top:V,left:U,right:Q,bottom:de}=d(O),q=U+Q,K=V+de;(f9(N+q,P)||f9(D+K,F)||f9(O.scrollWidth,P))&&rct(C,I.innerText||I.textContent,I,w)},handleCellMouseLeave:_=>{const v=h9(_);if(!v)return;v.rowSpan>1&&f(v.rowSpan,_,qc);const C=e==null?void 0:e.hoverState;e==null||e.emit("cell-mouse-leave",C==null?void 0:C.row,C==null?void 0:C.column,C==null?void 0:C.cell,_)},tooltipContent:t,tooltipTrigger:i}}function wct(n){const e=Kt(c_),t=vt("table");return{getRowStyle:(u,d)=>{const f=e==null?void 0:e.props.rowStyle;return ln(f)?f.call(null,{row:u,rowIndex:d}):f||null},getRowClass:(u,d)=>{const f=[t.e("row")];e!=null&&e.props.highlightCurrentRow&&u===n.store.states.currentRow.value&&f.push("current-row"),n.stripe&&d%2===1&&f.push(t.em("row","striped"));const g=e==null?void 0:e.props.rowClassName;return sn(g)?f.push(g):ln(g)&&f.push(g.call(null,{row:u,rowIndex:d})),f},getCellStyle:(u,d,f,g)=>{const p=e==null?void 0:e.props.cellStyle;let _=p??{};ln(p)&&(_=p.call(null,{rowIndex:u,columnIndex:d,row:f,column:g}));const v=jte(d,n==null?void 0:n.fixed,n.store);return sR(v,"left"),sR(v,"right"),Object.assign({},_,v)},getCellClass:(u,d,f,g,p)=>{const _=Kte(t.b(),d,n==null?void 0:n.fixed,n.store,void 0,p),v=[g.id,g.align,g.className,..._],C=e==null?void 0:e.props.cellClassName;return sn(C)?v.push(C):ln(C)&&v.push(C.call(null,{rowIndex:u,columnIndex:d,row:f,column:g})),v.push(t.e("cell")),v.filter(y=>!!y).join(" ")},getSpan:(u,d,f,g)=>{let p=1,_=1;const v=e==null?void 0:e.props.spanMethod;if(ln(v)){const C=v({row:u,column:d,rowIndex:f,columnIndex:g});yt(C)?(p=C[0],_=C[1]):typeof C=="object"&&(p=C.rowspan,_=C.colspan)}return{rowspan:p,colspan:_}},getColspanRealWidth:(u,d,f)=>{if(d<1)return u[f].realWidth;const g=u.map(({realWidth:p,width:_})=>p||_).slice(f,f+d);return Number(g.reduce((p,_)=>Number(p)+Number(_),-1))}}}const Ict=$e({name:"TableTdWrapper"}),Lct=$e({...Ict,props:{colspan:{type:Number,default:1},rowspan:{type:Number,default:1}},setup(n){return(e,t)=>(G(),he("td",{colspan:n.colspan,rowspan:n.rowspan},[Ye(e.$slots,"default")],8,["colspan","rowspan"]))}});var Oct=Rt(Lct,[["__file","td-wrapper.vue"]]);function Rct(n){const e=Kt(c_),t=vt("table"),{handleDoubleClick:i,handleClick:s,handleContextMenu:o,handleMouseEnter:r,handleMouseLeave:a,handleCellMouseEnter:c,handleCellMouseLeave:u,tooltipContent:d,tooltipTrigger:f}=Sct(n),{getRowStyle:g,getRowClass:p,getCellStyle:_,getCellClass:v,getSpan:C,getColspanRealWidth:y}=wct(n),w=W(()=>n.store.states.columns.value.findIndex(({type:N})=>N==="default")),I=(N,D)=>{const P=e.props.rowKey;return P?zc(N,P):D},L=(N,D,P,F=!1)=>{const{tooltipEffect:V,tooltipOptions:U,store:Q}=n,{indent:de,columns:q}=Q.states,K=p(N,D);let re=!0;return P&&(K.push(t.em("row",`level-${P.level}`)),re=P.display),hn("tr",{style:[re?null:{display:"none"},g(N,D)],class:K,key:I(N,D),onDblclick:J=>i(J,N),onClick:J=>s(J,N),onContextmenu:J=>o(J,N),onMouseenter:()=>r(D),onMouseleave:a},q.value.map((J,ge)=>{const{rowspan:ve,colspan:Le}=C(N,J,D,ge);if(!ve||!Le)return null;const Ee=Object.assign({},J);Ee.realWidth=y(q.value,Le,ge);const Ne={store:n.store,_self:n.context||e,column:Ee,row:N,$index:D,cellIndex:ge,expanded:F};ge===w.value&&P&&(Ne.treeNode={indent:P.level*de.value,level:P.level},Us(P.expanded)&&(Ne.treeNode.expanded=P.expanded,"loading"in P&&(Ne.treeNode.loading=P.loading),"noLazyChildren"in P&&(Ne.treeNode.noLazyChildren=P.noLazyChildren)));const qe=`${I(N,D)},${ge}`,Re=Ee.columnKey||Ee.rawColumnKey||"",we=J.showOverflowTooltip&&mEe({effect:V},U,J.showOverflowTooltip);return hn(Oct,{style:_(D,ge,N,J),class:v(D,ge,N,J,Le-1),key:`${Re}${qe}`,rowspan:ve,colspan:Le,onMouseenter:Ve=>c(Ve,N,we),onMouseleave:u},{default:()=>O(ge,J,Ne)})}))},O=(N,D,P)=>D.renderCell(P);return{wrappedRowRender:(N,D)=>{const P=n.store,{isRowExpanded:F,assertRowKey:V}=P,{treeData:U,lazyTreeNodeMap:Q,childrenColumnName:de,rowKey:q}=P.states,K=P.states.columns.value;if(K.some(({type:Z})=>Z==="expand")){const Z=F(N),J=L(N,D,void 0,Z),ge=e.renderExpanded;return Z?ge?[[J,hn("tr",{key:`expanded-row__${J.key}`},[hn("td",{colspan:K.length,class:`${t.e("cell")} ${t.e("expanded-cell")}`},[ge({row:N,$index:D,store:P,expanded:Z})])])]]:(console.error("[Element Error]renderExpanded is required."),J):[[J]]}else if(Object.keys(U.value).length){V();const Z=zc(N,q.value);let J=U.value[Z],ge=null;J&&(ge={expanded:J.expanded,level:J.level,display:!0},Us(J.lazy)&&(Us(J.loaded)&&J.loaded&&(ge.noLazyChildren=!(J.children&&J.children.length)),ge.loading=J.loading));const ve=[L(N,D,ge)];if(J){let Le=0;const Ee=(qe,Re)=>{qe&&qe.length&&Re&&qe.forEach(we=>{const Ve={display:Re.display&&Re.expanded,level:Re.level+1,expanded:!1,noLazyChildren:!1,loading:!1},Ge=zc(we,q.value);if(Ge==null)throw new Error("For nested data item, row-key is required.");if(J={...U.value[Ge]},J&&(Ve.expanded=J.expanded,J.level=J.level||Ve.level,J.display=!!(J.expanded&&Ve.display),Us(J.lazy)&&(Us(J.loaded)&&J.loaded&&(Ve.noLazyChildren=!(J.children&&J.children.length)),Ve.loading=J.loading)),Le++,ve.push(L(we,D+Le,Ve)),J){const dt=Q.value[Ge]||we[de.value];Ee(dt,J)}})};J.display=!0;const Ne=Q.value[Z]||N[de.value];Ee(Ne,J)}return ve}else return L(N,D,void 0)},tooltipContent:d,tooltipTrigger:f}}const Mct={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var kct=$e({name:"ElTableBody",props:Mct,setup(n){const e=Qn(),t=Kt(c_),i=vt("table"),{wrappedRowRender:s,tooltipContent:o,tooltipTrigger:r}=Rct(n),{onColumnsChange:a,onScrollableChange:c}=owe(t),u=[];return ht(n.store.states.hoverRow,(d,f)=>{var g;const p=e==null?void 0:e.vnode.el,_=Array.from((p==null?void 0:p.children)||[]).filter(y=>y==null?void 0:y.classList.contains(`${i.e("row")}`));let v=d;const C=(g=_[v])==null?void 0:g.childNodes;if(C!=null&&C.length){let y=0;Array.from(C).reduce((I,L,O)=>{var A,N;return((A=C[O])==null?void 0:A.colSpan)>1&&(y=(N=C[O])==null?void 0:N.colSpan),L.nodeName!=="TD"&&y===0&&I.push(O),y>0&&y--,I},[]).forEach(I=>{var L;for(v=d;v>0;){const O=(L=_[v-1])==null?void 0:L.childNodes;if(O[I]&&O[I].nodeName==="TD"&&O[I].rowSpan>1){Of(O[I],"hover-cell"),u.push(O[I]);break}v--}})}else u.forEach(y=>qc(y,"hover-cell")),u.length=0;!n.store.states.isComplex.value||!Si||QC(()=>{const y=_[f],w=_[d];y&&!y.classList.contains("hover-fixed-row")&&qc(y,"hover-row"),w&&Of(w,"hover-row")})}),Cb(()=>{var d;(d=uf)==null||d()}),{ns:i,onColumnsChange:a,onScrollableChange:c,wrappedRowRender:s,tooltipContent:o,tooltipTrigger:r}},render(){const{wrappedRowRender:n,store:e}=this,t=e.states.data.value||[];return hn("tbody",{tabIndex:-1},[t.reduce((i,s)=>i.concat(n(s,i.length)),[])])}});function Act(){const n=Kt(c_),e=n==null?void 0:n.store,t=W(()=>e.states.fixedLeafColumnsLength.value),i=W(()=>e.states.rightFixedColumns.value.length),s=W(()=>e.states.columns.value.length),o=W(()=>e.states.fixedColumns.value.length),r=W(()=>e.states.rightFixedColumns.value.length);return{leftFixedLeafCount:t,rightFixedLeafCount:i,columnsCount:s,leftFixedCount:o,rightFixedCount:r,columns:e.states.columns}}function Nct(n){const{columns:e}=Act(),t=vt("table");return{getCellClasses:(o,r)=>{const a=o[r],c=[t.e("cell"),a.id,a.align,a.labelClassName,...Kte(t.b(),r,a.fixed,n.store)];return a.className&&c.push(a.className),a.children||c.push(t.is("leaf")),c},getCellStyles:(o,r)=>{const a=jte(r,o.fixed,n.store);return sR(a,"left"),sR(a,"right"),a},columns:e}}var Dct=$e({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(n){const{getCellClasses:e,getCellStyles:t,columns:i}=Nct(n);return{ns:vt("table"),getCellClasses:e,getCellStyles:t,columns:i}},render(){const{columns:n,getCellStyles:e,getCellClasses:t,summaryMethod:i,sumText:s}=this,o=this.store.states.data.value;let r=[];return i?r=i({columns:n,data:o}):n.forEach((a,c)=>{if(c===0){r[c]=s;return}const u=o.map(p=>Number(p[a.property])),d=[];let f=!0;u.forEach(p=>{if(!Number.isNaN(+p)){f=!1;const _=`${p}`.split(".")[1];d.push(_?_.length:0)}});const g=Math.max.apply(null,d);f?r[c]="":r[c]=u.reduce((p,_)=>{const v=Number(_);return Number.isNaN(+v)?p:Number.parseFloat((p+_).toFixed(Math.min(g,20)))},0)}),hn(hn("tfoot",[hn("tr",{},[...n.map((a,c)=>hn("td",{key:c,colspan:a.colSpan,rowspan:a.rowSpan,class:t(n,c),style:e(a,c)},[hn("div",{class:["cell",a.labelClassName]},[r[c]])]))])]))}});function $ct(n){return{setCurrentRow:f=>{n.commit("setCurrentRow",f)},getSelectionRows:()=>n.getSelectionRows(),toggleRowSelection:(f,g,p=!0)=>{n.toggleRowSelection(f,g,!1,p),n.updateAllSelected()},clearSelection:()=>{n.clearSelection()},clearFilter:f=>{n.clearFilter(f)},toggleAllSelection:()=>{n.commit("toggleAllSelection")},toggleRowExpansion:(f,g)=>{n.toggleRowExpansionAdapter(f,g)},clearSort:()=>{n.clearSort()},sort:(f,g)=>{n.commit("sort",{prop:f,order:g})},updateKeyChildren:(f,g)=>{n.updateKeyChildren(f,g)}}}function xct(n,e,t,i){const s=te(!1),o=te(null),r=te(!1),a=Z=>{r.value=Z},c=te({width:null,height:null,headerHeight:null}),u=te(!1),d={display:"inline-block",verticalAlign:"middle"},f=te(),g=te(0),p=te(0),_=te(0),v=te(0),C=te(0);Sl(()=>{e.setHeight(n.height)}),Sl(()=>{e.setMaxHeight(n.maxHeight)}),ht(()=>[n.currentRowKey,t.states.rowKey],([Z,J])=>{!T(J)||!T(Z)||t.setCurrentRowKey(`${Z}`)},{immediate:!0}),ht(()=>n.data,Z=>{i.store.commit("setData",Z)},{immediate:!0,deep:!0}),Sl(()=>{n.expandRowKeys&&t.setExpandRowKeysAdapter(n.expandRowKeys)});const y=()=>{i.store.commit("setHoverRow",null),i.hoverState&&(i.hoverState=null)},w=(Z,J)=>{const{pixelX:ge,pixelY:ve}=J;Math.abs(ge)>=Math.abs(ve)&&(i.refs.bodyWrapper.scrollLeft+=J.pixelX/5)},I=W(()=>n.height||n.maxHeight||t.states.fixedColumns.value.length>0||t.states.rightFixedColumns.value.length>0),L=W(()=>({width:e.bodyWidth.value?`${e.bodyWidth.value}px`:""})),O=()=>{I.value&&e.updateElsHeight(),e.updateColumnsWidth(),requestAnimationFrame(P)};$n(async()=>{await cn(),t.updateColumns(),F(),requestAnimationFrame(O);const Z=i.vnode.el,J=i.refs.headerWrapper;n.flexible&&Z&&Z.parentElement&&(Z.parentElement.style.minWidth="0"),c.value={width:f.value=Z.offsetWidth,height:Z.offsetHeight,headerHeight:n.showHeader&&J?J.offsetHeight:null},t.states.columns.value.forEach(ge=>{ge.filteredValue&&ge.filteredValue.length&&i.store.commit("filterChange",{column:ge,values:ge.filteredValue,silent:!0})}),i.$ready=!0});const A=(Z,J)=>{if(!Z)return;const ge=Array.from(Z.classList).filter(ve=>!ve.startsWith("is-scrolling-"));ge.push(e.scrollX.value?J:"is-scrolling-none"),Z.className=ge.join(" ")},N=Z=>{const{tableWrapper:J}=i.refs;A(J,Z)},D=Z=>{const{tableWrapper:J}=i.refs;return!!(J&&J.classList.contains(Z))},P=function(){if(!i.refs.scrollBarRef)return;if(!e.scrollX.value){const qe="is-scrolling-none";D(qe)||N(qe);return}const Z=i.refs.scrollBarRef.wrapRef;if(!Z)return;const{scrollLeft:J,offsetWidth:ge,scrollWidth:ve}=Z,{headerWrapper:Le,footerWrapper:Ee}=i.refs;Le&&(Le.scrollLeft=J),Ee&&(Ee.scrollLeft=J);const Ne=ve-ge-1;J>=Ne?N("is-scrolling-right"):N(J===0?"is-scrolling-left":"is-scrolling-middle")},F=()=>{i.refs.scrollBarRef&&(i.refs.scrollBarRef.wrapRef&&Es(i.refs.scrollBarRef.wrapRef,"scroll",P,{passive:!0}),n.fit?wo(i.vnode.el,V):Es(window,"resize",V),wo(i.refs.bodyWrapper,()=>{var Z,J;V(),(J=(Z=i.refs)==null?void 0:Z.scrollBarRef)==null||J.update()}))},V=()=>{var Z,J,ge,ve;const Le=i.vnode.el;if(!i.$ready||!Le)return;let Ee=!1;const{width:Ne,height:qe,headerHeight:Re}=c.value,we=f.value=Le.offsetWidth;Ne!==we&&(Ee=!0);const Ve=Le.offsetHeight;(n.height||I.value)&&qe!==Ve&&(Ee=!0);const Ge=n.tableLayout==="fixed"?i.refs.headerWrapper:(Z=i.refs.tableHeaderRef)==null?void 0:Z.$el;n.showHeader&&(Ge==null?void 0:Ge.offsetHeight)!==Re&&(Ee=!0),g.value=((J=i.refs.tableWrapper)==null?void 0:J.scrollHeight)||0,_.value=(Ge==null?void 0:Ge.scrollHeight)||0,v.value=((ge=i.refs.footerWrapper)==null?void 0:ge.offsetHeight)||0,C.value=((ve=i.refs.appendWrapper)==null?void 0:ve.offsetHeight)||0,p.value=g.value-_.value-v.value-C.value,Ee&&(c.value={width:we,height:Ve,headerHeight:n.showHeader&&(Ge==null?void 0:Ge.offsetHeight)||0},O())},U=jr(),Q=W(()=>{const{bodyWidth:Z,scrollY:J,gutterWidth:ge}=e;return Z.value?`${Z.value-(J.value?ge:0)}px`:""}),de=W(()=>n.maxHeight?"fixed":n.tableLayout),q=W(()=>{if(n.data&&n.data.length)return null;let Z="100%";n.height&&p.value&&(Z=`${p.value}px`);const J=f.value;return{width:J?`${J}px`:"",height:Z}}),K=W(()=>n.height?{height:"100%"}:n.maxHeight?Number.isNaN(Number(n.maxHeight))?{maxHeight:`calc(${n.maxHeight} - ${_.value+v.value}px)`}:{maxHeight:`${n.maxHeight-_.value-v.value}px`}:{});return{isHidden:s,renderExpanded:o,setDragVisible:a,isGroup:u,handleMouseLeave:y,handleHeaderFooterMousewheel:w,tableSize:U,emptyBlockStyle:q,handleFixedMousewheel:(Z,J)=>{const ge=i.refs.bodyWrapper;if(Math.abs(J.spinY)>0){const ve=ge.scrollTop;J.pixelY<0&&ve!==0&&Z.preventDefault(),J.pixelY>0&&ge.scrollHeight-ge.clientHeight>ve&&Z.preventDefault(),ge.scrollTop+=Math.ceil(J.pixelY/5)}else ge.scrollLeft+=Math.ceil(J.pixelX/5)},resizeProxyVisible:r,bodyWidth:Q,resizeState:c,doLayout:O,tableBodyStyles:L,tableLayout:de,scrollbarViewStyle:d,scrollbarStyle:K}}function Pct(n){const e=te(),t=()=>{const s=n.vnode.el.querySelector(".hidden-columns"),o={childList:!0,subtree:!0},r=n.store.states.updateOrderFns;e.value=new MutationObserver(()=>{r.forEach(a=>a())}),e.value.observe(s,o)};$n(()=>{t()}),Cb(()=>{var i;(i=e.value)==null||i.disconnect()})}var Fct={data:{type:Array,default:()=>[]},size:cl,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children",checkStrictly:!1})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:Boolean,flexible:Boolean,showOverflowTooltip:[Boolean,Object],appendFilterPanelTo:String,scrollbarTabindex:{type:[Number,String],default:void 0}};function awe(n){const e=n.tableLayout==="auto";let t=n.columns||[];e&&t.every(s=>s.width===void 0)&&(t=[]);const i=s=>{const o={key:`${n.tableLayout}_${s.id}`,style:{},name:void 0};return e?o.style={width:`${s.width}px`}:o.name=s.id,o};return hn("colgroup",{},t.map(s=>hn("col",i(s))))}awe.props=["columns","tableLayout"];const Bct=()=>{const n=te(),e=(o,r)=>{const a=n.value;a&&a.scrollTo(o,r)},t=(o,r)=>{const a=n.value;a&&gn(r)&&["Top","Left"].includes(o)&&a[`setScroll${o}`](r)};return{scrollBarRef:n,scrollTo:e,setScrollTop:o=>t("Top",o),setScrollLeft:o=>t("Left",o)}};var $de=!1,wS,qX,JX,xU,PU,cwe,FU,QX,ZX,eY,uwe,tY,nY,dwe,hwe;function od(){if(!$de){$de=!0;var n=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(n),t=/(Mac OS X)|(Windows)|(Linux)/.exec(n);if(tY=/\b(iPhone|iP[ao]d)/.exec(n),nY=/\b(iP[ao]d)/.exec(n),eY=/Android/i.exec(n),dwe=/FBAN\/\w+;/i.exec(n),hwe=/Mobile/i.exec(n),uwe=!!/Win64/.exec(n),e){wS=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,wS&&document&&document.documentMode&&(wS=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(n);cwe=i?parseFloat(i[1])+4:wS,qX=e[2]?parseFloat(e[2]):NaN,JX=e[3]?parseFloat(e[3]):NaN,xU=e[4]?parseFloat(e[4]):NaN,xU?(e=/(?:Chrome\/(\d+\.\d+))/.exec(n),PU=e&&e[1]?parseFloat(e[1]):NaN):PU=NaN}else wS=qX=JX=PU=xU=NaN;if(t){if(t[1]){var s=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(n);FU=s?parseFloat(s[1].replace("_",".")):!0}else FU=!1;QX=!!t[2],ZX=!!t[3]}else FU=QX=ZX=!1}}var iY={ie:function(){return od()||wS},ieCompatibilityMode:function(){return od()||cwe>wS},ie64:function(){return iY.ie()&&uwe},firefox:function(){return od()||qX},opera:function(){return od()||JX},webkit:function(){return od()||xU},safari:function(){return iY.webkit()},chrome:function(){return od()||PU},windows:function(){return od()||QX},osx:function(){return od()||FU},linux:function(){return od()||ZX},iphone:function(){return od()||tY},mobile:function(){return od()||tY||nY||eY||hwe},nativeApp:function(){return od()||dwe},android:function(){return od()||eY},ipad:function(){return od()||nY}},Hct=iY,DH=!!(typeof window<"u"&&window.document&&window.document.createElement),Vct={canUseDOM:DH,canUseWorkers:typeof Worker<"u",canUseEventListeners:DH&&!!(window.addEventListener||window.attachEvent),canUseViewport:DH&&!!window.screen,isInWorker:!DH},fwe=Vct,gwe;fwe.canUseDOM&&(gwe=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function Uct(n,e){if(!fwe.canUseDOM||e&&!("addEventListener"in document))return!1;var t="on"+n,i=t in document;if(!i){var s=document.createElement("div");s.setAttribute(t,"return;"),i=typeof s[t]=="function"}return!i&&gwe&&n==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var Wct=Uct,xde=10,Pde=40,Fde=800;function pwe(n){var e=0,t=0,i=0,s=0;return"detail"in n&&(t=n.detail),"wheelDelta"in n&&(t=-n.wheelDelta/120),"wheelDeltaY"in n&&(t=-n.wheelDeltaY/120),"wheelDeltaX"in n&&(e=-n.wheelDeltaX/120),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(e=t,t=0),i=e*xde,s=t*xde,"deltaY"in n&&(s=n.deltaY),"deltaX"in n&&(i=n.deltaX),(i||s)&&n.deltaMode&&(n.deltaMode==1?(i*=Pde,s*=Pde):(i*=Fde,s*=Fde)),i&&!e&&(e=i<1?-1:1),s&&!t&&(t=s<1?-1:1),{spinX:e,spinY:t,pixelX:i,pixelY:s}}pwe.getEventType=function(){return Hct.firefox()?"DOMMouseScroll":Wct("wheel")?"wheel":"mousewheel"};var Gct=pwe;/**
- * Checks if an event is supported in the current execution environment.
- *
- * NOTE: This will not work correctly for non-generic events such as `change`,
- * `reset`, `load`, `error`, and `select`.
- *
- * Borrows from Modernizr.
- *
- * @param {string} eventNameSuffix Event name, e.g. "click".
- * @param {?boolean} capture Check if the capture phase is supported.
- * @return {boolean} True if the event is supported.
- * @internal
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
- */const zct=function(n,e){if(n&&n.addEventListener){const t=function(i){const s=Gct(i);e&&Reflect.apply(e,this,[i,s])};n.addEventListener("wheel",t,{passive:!0})}},Kct={beforeMount(n,e){zct(n,e.value)}};let jct=1;const Xct=$e({name:"ElTable",directives:{Mousewheel:Kct},components:{TableHeader:Ect,TableBody:kct,TableFooter:Dct,ElScrollbar:a_,hColgroup:awe},props:Fct,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(n){const{t:e}=wi(),t=vt("table"),i=Qn();pi(c_,i);const s=fct(i,n);i.store=s;const o=new pct({store:i.store,table:i,fit:n.fit,showHeader:n.showHeader});i.layout=o;const r=W(()=>(s.states.data.value||[]).length===0),{setCurrentRow:a,getSelectionRows:c,toggleRowSelection:u,clearSelection:d,clearFilter:f,toggleAllSelection:g,toggleRowExpansion:p,clearSort:_,sort:v,updateKeyChildren:C}=$ct(s),{isHidden:y,renderExpanded:w,setDragVisible:I,isGroup:L,handleMouseLeave:O,handleHeaderFooterMousewheel:A,tableSize:N,emptyBlockStyle:D,handleFixedMousewheel:P,resizeProxyVisible:F,bodyWidth:V,resizeState:U,doLayout:Q,tableBodyStyles:de,tableLayout:q,scrollbarViewStyle:K,scrollbarStyle:re}=xct(n,o,s,i),{scrollBarRef:Z,scrollTo:J,setScrollLeft:ge,setScrollTop:ve}=Bct(),Le=Md(Q,50),Ee=`${t.namespace.value}-table_${jct++}`;i.tableId=Ee,i.state={isGroup:L,resizeState:U,doLayout:Q,debouncedUpdateLayout:Le};const Ne=W(()=>{var we;return(we=n.sumText)!=null?we:e("el.table.sumText")}),qe=W(()=>{var we;return(we=n.emptyText)!=null?we:e("el.table.emptyText")}),Re=W(()=>lwe(s.states.originColumns.value)[0]);return Pct(i),As(()=>{Le.cancel()}),{ns:t,layout:o,store:s,columns:Re,handleHeaderFooterMousewheel:A,handleMouseLeave:O,tableId:Ee,tableSize:N,isHidden:y,isEmpty:r,renderExpanded:w,resizeProxyVisible:F,resizeState:U,isGroup:L,bodyWidth:V,tableBodyStyles:de,emptyBlockStyle:D,debouncedUpdateLayout:Le,handleFixedMousewheel:P,setCurrentRow:a,getSelectionRows:c,toggleRowSelection:u,clearSelection:d,clearFilter:f,toggleAllSelection:g,toggleRowExpansion:p,clearSort:_,doLayout:Q,sort:v,updateKeyChildren:C,t:e,setDragVisible:I,context:i,computedSumText:Ne,computedEmptyText:qe,tableLayout:q,scrollbarViewStyle:K,scrollbarStyle:re,scrollBarRef:Z,scrollTo:J,setScrollLeft:ge,setScrollTop:ve}}});function Yct(n,e,t,i,s,o){const r=Bt("hColgroup"),a=Bt("table-header"),c=Bt("table-body"),u=Bt("table-footer"),d=Bt("el-scrollbar"),f=N5("mousewheel");return G(),he("div",{ref:"tableWrapper",class:Y([{[n.ns.m("fit")]:n.fit,[n.ns.m("striped")]:n.stripe,[n.ns.m("border")]:n.border||n.isGroup,[n.ns.m("hidden")]:n.isHidden,[n.ns.m("group")]:n.isGroup,[n.ns.m("fluid-height")]:n.maxHeight,[n.ns.m("scrollable-x")]:n.layout.scrollX.value,[n.ns.m("scrollable-y")]:n.layout.scrollY.value,[n.ns.m("enable-row-hover")]:!n.store.states.isComplex.value,[n.ns.m("enable-row-transition")]:(n.store.states.data.value||[]).length!==0&&(n.store.states.data.value||[]).length<100,"has-footer":n.showSummary},n.ns.m(n.tableSize),n.className,n.ns.b(),n.ns.m(`layout-${n.tableLayout}`)]),style:on(n.style),"data-prefix":n.ns.namespace.value,onMouseleave:n.handleMouseLeave},[oe("div",{class:Y(n.ns.e("inner-wrapper"))},[oe("div",{ref:"hiddenColumns",class:"hidden-columns"},[Ye(n.$slots,"default")],512),n.showHeader&&n.tableLayout==="fixed"?Un((G(),he("div",{key:0,ref:"headerWrapper",class:Y(n.ns.e("header-wrapper"))},[oe("table",{ref:"tableHeader",class:Y(n.ns.e("header")),style:on(n.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[ce(r,{columns:n.store.states.columns.value,"table-layout":n.tableLayout},null,8,["columns","table-layout"]),ce(a,{ref:"tableHeaderRef",border:n.border,"default-sort":n.defaultSort,store:n.store,"append-filter-panel-to":n.appendFilterPanelTo,onSetDragVisible:n.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","onSetDragVisible"])],6)],2)),[[f,n.handleHeaderFooterMousewheel]]):Qe("v-if",!0),oe("div",{ref:"bodyWrapper",class:Y(n.ns.e("body-wrapper"))},[ce(d,{ref:"scrollBarRef","view-style":n.scrollbarViewStyle,"wrap-style":n.scrollbarStyle,always:n.scrollbarAlwaysOn,tabindex:n.scrollbarTabindex,onScroll:g=>n.$emit("scroll",g)},{default:_e(()=>[oe("table",{ref:"tableBody",class:Y(n.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:on({width:n.bodyWidth,tableLayout:n.tableLayout})},[ce(r,{columns:n.store.states.columns.value,"table-layout":n.tableLayout},null,8,["columns","table-layout"]),n.showHeader&&n.tableLayout==="auto"?(G(),nt(a,{key:0,ref:"tableHeaderRef",class:Y(n.ns.e("body-header")),border:n.border,"default-sort":n.defaultSort,store:n.store,"append-filter-panel-to":n.appendFilterPanelTo,onSetDragVisible:n.setDragVisible},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):Qe("v-if",!0),ce(c,{context:n.context,highlight:n.highlightCurrentRow,"row-class-name":n.rowClassName,"tooltip-effect":n.tooltipEffect,"tooltip-options":n.tooltipOptions,"row-style":n.rowStyle,store:n.store,stripe:n.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),n.showSummary&&n.tableLayout==="auto"?(G(),nt(u,{key:1,class:Y(n.ns.e("body-footer")),border:n.border,"default-sort":n.defaultSort,store:n.store,"sum-text":n.computedSumText,"summary-method":n.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):Qe("v-if",!0)],6),n.isEmpty?(G(),he("div",{key:0,ref:"emptyBlock",style:on(n.emptyBlockStyle),class:Y(n.ns.e("empty-block"))},[oe("span",{class:Y(n.ns.e("empty-text"))},[Ye(n.$slots,"empty",{},()=>[mn(st(n.computedEmptyText),1)])],2)],6)):Qe("v-if",!0),n.$slots.append?(G(),he("div",{key:1,ref:"appendWrapper",class:Y(n.ns.e("append-wrapper"))},[Ye(n.$slots,"append")],2)):Qe("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","onScroll"])],2),n.showSummary&&n.tableLayout==="fixed"?Un((G(),he("div",{key:1,ref:"footerWrapper",class:Y(n.ns.e("footer-wrapper"))},[oe("table",{class:Y(n.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:on(n.tableBodyStyles)},[ce(r,{columns:n.store.states.columns.value,"table-layout":n.tableLayout},null,8,["columns","table-layout"]),ce(u,{border:n.border,"default-sort":n.defaultSort,store:n.store,"sum-text":n.computedSumText,"summary-method":n.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[Gi,!n.isEmpty],[f,n.handleHeaderFooterMousewheel]]):Qe("v-if",!0),n.border||n.isGroup?(G(),he("div",{key:2,class:Y(n.ns.e("border-left-patch"))},null,2)):Qe("v-if",!0)],2),Un(oe("div",{ref:"resizeProxy",class:Y(n.ns.e("column-resize-proxy"))},null,2),[[Gi,n.resizeProxyVisible]])],46,["data-prefix","onMouseleave"])}var qct=Rt(Xct,[["render",Yct],["__file","table.vue"]]);const Jct={selection:"table-column--selection",expand:"table__expand-column"},Qct={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Zct=n=>Jct[n]||"",eut={selection:{renderHeader({store:n,column:e}){function t(){return n.states.data.value&&n.states.data.value.length===0}return hn(Kf,{disabled:t(),size:n.states.tableSize.value,indeterminate:n.states.selection.value.length>0&&!n.states.isAllSelected.value,"onUpdate:modelValue":n.toggleAllSelection,modelValue:n.states.isAllSelected.value,ariaLabel:e.label})},renderCell({row:n,column:e,store:t,$index:i}){return hn(Kf,{disabled:e.selectable?!e.selectable.call(null,n,i):!1,size:t.states.tableSize.value,onChange:()=>{t.commit("rowSelectedChanged",n)},onClick:s=>s.stopPropagation(),modelValue:t.isSelected(n),ariaLabel:e.label})},sortable:!1,resizable:!1},index:{renderHeader({column:n}){return n.label||"#"},renderCell({column:n,$index:e}){let t=e+1;const i=n.index;return gn(i)?t=e+i:ln(i)&&(t=i(e)),hn("div",{},[t])},sortable:!1},expand:{renderHeader({column:n}){return n.label||""},renderCell({row:n,store:e,expanded:t}){const{ns:i}=e,s=[i.e("expand-icon")];return t&&s.push(i.em("expand-icon","expanded")),hn("div",{class:s,onClick:function(r){r.stopPropagation(),e.toggleRowExpansion(n)}},{default:()=>[hn(tn,null,{default:()=>[hn(Au)]})]})},sortable:!1,resizable:!1}};function tut({row:n,column:e,$index:t}){var i;const s=e.property,o=s&&bU(n,s).value;return e&&e.formatter?e.formatter(n,e,o,t):((i=o==null?void 0:o.toString)==null?void 0:i.call(o))||""}function nut({row:n,treeNode:e,store:t},i=!1){const{ns:s}=t;if(!e)return i?[hn("span",{class:s.e("placeholder")})]:null;const o=[],r=function(a){a.stopPropagation(),!e.loading&&t.loadOrToggle(n)};if(e.indent&&o.push(hn("span",{class:s.e("indent"),style:{"padding-left":`${e.indent}px`}})),Us(e.expanded)&&!e.noLazyChildren){const a=[s.e("expand-icon"),e.expanded?s.em("expand-icon","expanded"):""];let c=Au;e.loading&&(c=Gm),o.push(hn("div",{class:a,onClick:r},{default:()=>[hn(tn,{class:{[s.is("loading")]:e.loading}},{default:()=>[hn(c)]})]}))}else o.push(hn("span",{class:s.e("placeholder")}));return o}function Bde(n,e){return n.reduce((t,i)=>(t[i]=i,t),e)}function iut(n,e){const t=Qn();return{registerComplexWatchers:()=>{const o=["fixed"],r={realWidth:"width",realMinWidth:"minWidth"},a=Bde(o,r);Object.keys(a).forEach(c=>{const u=r[c];Wi(e,u)&&ht(()=>e[u],d=>{let f=d;u==="width"&&c==="realWidth"&&(f=zte(d)),u==="minWidth"&&c==="realMinWidth"&&(f=ewe(d)),t.columnConfig.value[u]=f,t.columnConfig.value[c]=f;const g=u==="fixed";n.value.store.scheduleLayout(g)})})},registerNormalWatchers:()=>{const o=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip"],r={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},a=Bde(o,r);Object.keys(a).forEach(c=>{const u=r[c];Wi(e,u)&&ht(()=>e[u],d=>{t.columnConfig.value[c]=d})})}}}function sut(n,e,t){const i=Qn(),s=te(""),o=te(!1),r=te(),a=te(),c=vt("table");Sl(()=>{r.value=n.align?`is-${n.align}`:null,r.value}),Sl(()=>{a.value=n.headerAlign?`is-${n.headerAlign}`:r.value,a.value});const u=W(()=>{let L=i.vnode.vParent||i.parent;for(;L&&!L.tableId&&!L.columnId;)L=L.vnode.vParent||L.parent;return L}),d=W(()=>{const{store:L}=i.parent;if(!L)return!1;const{treeData:O}=L.states,A=O.value;return A&&Object.keys(A).length>0}),f=te(zte(n.width)),g=te(ewe(n.minWidth)),p=L=>(f.value&&(L.width=f.value),g.value&&(L.minWidth=g.value),!f.value&&g.value&&(L.width=void 0),L.minWidth||(L.minWidth=80),L.realWidth=Number(L.width===void 0?L.minWidth:L.width),L),_=L=>{const O=L.type,A=eut[O]||{};Object.keys(A).forEach(D=>{const P=A[D];D!=="className"&&P!==void 0&&(L[D]=P)});const N=Zct(O);if(N){const D=`${T(c.namespace)}-${N}`;L.className=L.className?`${L.className} ${D}`:D}return L},v=L=>{yt(L)?L.forEach(A=>O(A)):O(L);function O(A){var N;((N=A==null?void 0:A.type)==null?void 0:N.name)==="ElTableColumn"&&(A.vParent=i)}};return{columnId:s,realAlign:r,isSubColumn:o,realHeaderAlign:a,columnOrTableParent:u,setColumnWidth:p,setColumnForcedProps:_,setColumnRenders:L=>{n.renderHeader||L.type!=="selection"&&(L.renderHeader=A=>(i.columnConfig.value.label,Ye(e,"header",A,()=>[L.label]))),e["filter-icon"]&&(L.renderFilterIcon=A=>Ye(e,"filter-icon",A));let O=L.renderCell;return L.type==="expand"?(L.renderCell=A=>hn("div",{class:"cell"},[O(A)]),t.value.renderExpanded=A=>e.default?e.default(A):e.default):(O=O||tut,L.renderCell=A=>{let N=null;if(e.default){const Q=e.default(A);N=Q.some(de=>de.type!==fa)?Q:O(A)}else N=O(A);const{columns:D}=t.value.store.states,P=D.value.findIndex(Q=>Q.type==="default"),F=d.value&&A.cellIndex===P,V=nut(A,F),U={class:"cell",style:{}};return L.showOverflowTooltip&&(U.class=`${U.class} ${T(c.namespace)}-tooltip`,U.style={width:`${(A.column.realWidth||Number(A.column.width))-1}px`}),v(N),hn("div",U,[V,N])}),L},getPropsData:(...L)=>L.reduce((O,A)=>(yt(A)&&A.forEach(N=>{O[N]=n[N]}),O),{}),getColumnElIndex:(L,O)=>Array.prototype.indexOf.call(L,O),updateColumnOrder:()=>{t.value.store.commit("updateColumnOrder",i.columnConfig.value)}}}var out={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:n=>n.every(e=>["ascending","descending",null].includes(e))}};let rut=1;var mwe=$e({name:"ElTableColumn",components:{ElCheckbox:Kf},props:out,setup(n,{slots:e}){const t=Qn(),i=te({}),s=W(()=>{let I=t.parent;for(;I&&!I.tableId;)I=I.parent;return I}),{registerNormalWatchers:o,registerComplexWatchers:r}=iut(s,n),{columnId:a,isSubColumn:c,realHeaderAlign:u,columnOrTableParent:d,setColumnWidth:f,setColumnForcedProps:g,setColumnRenders:p,getPropsData:_,getColumnElIndex:v,realAlign:C,updateColumnOrder:y}=sut(n,e,s),w=d.value;a.value=`${w.tableId||w.columnId}_column_${rut++}`,A5(()=>{c.value=s.value!==w;const I=n.type||"default",L=n.sortable===""?!0:n.sortable,O=ys(n.showOverflowTooltip)?w.props.showOverflowTooltip:n.showOverflowTooltip,A={...Qct[I],id:a.value,type:I,property:n.prop||n.property,align:C,headerAlign:u,showOverflowTooltip:O,filterable:n.filters||n.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:L,index:n.index,rawColumnKey:t.vnode.key};let V=_(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);V=nct(A,V),V=sct(p,f,g)(V),i.value=V,o(),r()}),$n(()=>{var I;const L=d.value,O=c.value?L.vnode.el.children:(I=L.refs.hiddenColumns)==null?void 0:I.children,A=()=>v(O||[],t.vnode.el);i.value.getColumnIndex=A,A()>-1&&s.value.store.commit("insertColumn",i.value,c.value?L.columnConfig.value:null,y)}),As(()=>{const I=i.value.getColumnIndex;(I?I():-1)>-1&&s.value.store.commit("removeColumn",i.value,c.value?w.columnConfig.value:null,y)}),t.columnId=a.value,t.columnConfig=i},render(){var n,e,t;try{const i=(e=(n=this.$slots).default)==null?void 0:e.call(n,{row:{},column:{},$index:-1}),s=[];if(yt(i))for(const r of i)((t=r.type)==null?void 0:t.name)==="ElTableColumn"||r.shapeFlag&2?s.push(r):r.type===Qt&&yt(r.children)&&r.children.forEach(a=>{(a==null?void 0:a.patchFlag)!==1024&&!sn(a==null?void 0:a.children)&&s.push(a)});return hn("div",s)}catch{return hn("div",[])}}});const lut=Nn(qct,{TableColumn:mwe}),aut=Xo(mwe);var gx=(n=>(n.ASC="asc",n.DESC="desc",n))(gx||{}),px=(n=>(n.CENTER="center",n.RIGHT="right",n))(px||{}),_we=(n=>(n.LEFT="left",n.RIGHT="right",n))(_we||{});const sY={asc:"desc",desc:"asc"},mx=Symbol("placeholder"),cut=(n,e,t)=>{var i;const s={flexGrow:0,flexShrink:0,...t?{}:{flexGrow:n.flexGrow||0,flexShrink:n.flexShrink||1}};t||(s.flexShrink=1);const o={...(i=n.style)!=null?i:{},...s,flexBasis:"auto",width:n.width};return e||(n.maxWidth&&(o.maxWidth=n.maxWidth),n.minWidth&&(o.minWidth=n.minWidth)),o};function uut(n,e,t){const i=W(()=>T(e).map((C,y)=>{var w,I;return{...C,key:(I=(w=C.key)!=null?w:C.dataKey)!=null?I:y}})),s=W(()=>T(i).filter(C=>!C.hidden)),o=W(()=>T(s).filter(C=>C.fixed==="left"||C.fixed===!0)),r=W(()=>T(s).filter(C=>C.fixed==="right")),a=W(()=>T(s).filter(C=>!C.fixed)),c=W(()=>{const C=[];return T(o).forEach(y=>{C.push({...y,placeholderSign:mx})}),T(a).forEach(y=>{C.push(y)}),T(r).forEach(y=>{C.push({...y,placeholderSign:mx})}),C}),u=W(()=>T(o).length||T(r).length),d=W(()=>T(i).reduce((C,y)=>(C[y.key]=cut(y,T(t),n.fixed),C),{})),f=W(()=>T(s).reduce((C,y)=>C+y.width,0)),g=C=>T(i).find(y=>y.key===C),p=C=>T(d)[C],_=(C,y)=>{C.width=y};function v(C){var y;const{key:w}=C.currentTarget.dataset;if(!w)return;const{sortState:I,sortBy:L}=n;let O=gx.ASC;si(I)?O=sY[I[w]]:O=sY[L.order],(y=n.onColumnSort)==null||y.call(n,{column:g(w),key:w,order:O})}return{columns:i,columnsStyles:d,columnsTotalWidth:f,fixedColumnsOnLeft:o,fixedColumnsOnRight:r,hasFixedColumns:u,mainColumns:c,normalColumns:a,visibleColumns:s,getColumn:g,getColumnStyle:p,updateColumnWidth:_,onColumnSorted:v}}const dut=(n,{mainTableRef:e,leftTableRef:t,rightTableRef:i,onMaybeEndReached:s})=>{const o=te({scrollLeft:0,scrollTop:0});function r(p){var _,v,C;const{scrollTop:y}=p;(_=e.value)==null||_.scrollTo(p),(v=t.value)==null||v.scrollToTop(y),(C=i.value)==null||C.scrollToTop(y)}function a(p){o.value=p,r(p)}function c(p){o.value.scrollTop=p,r(T(o))}function u(p){var _,v;o.value.scrollLeft=p,(v=(_=e.value)==null?void 0:_.scrollTo)==null||v.call(_,T(o))}function d(p){var _;a(p),(_=n.onScroll)==null||_.call(n,p)}function f({scrollTop:p}){const{scrollTop:_}=T(o);p!==_&&c(p)}function g(p,_="auto"){var v;(v=e.value)==null||v.scrollToRow(p,_)}return ht(()=>T(o).scrollTop,(p,_)=>{p>_&&s()}),{scrollPos:o,scrollTo:a,scrollToLeft:u,scrollToTop:c,scrollToRow:g,onScroll:d,onVerticalScroll:f}},hut=(n,{mainTableRef:e,leftTableRef:t,rightTableRef:i,tableInstance:s,ns:o,isScrolling:r})=>{const a=Qn(),{emit:c}=a,u=us(!1),d=te(n.defaultExpandedRowKeys||[]),f=te(-1),g=us(null),p=te({}),_=te({}),v=us({}),C=us({}),y=us({}),w=W(()=>gn(n.estimatedRowHeight));function I(F){var V;(V=n.onRowsRendered)==null||V.call(n,F),F.rowCacheEnd>T(f)&&(f.value=F.rowCacheEnd)}function L({hovered:F,rowKey:V}){if(r.value)return;s.vnode.el.querySelectorAll(`[rowkey="${String(V)}"]`).forEach(de=>{F?de.classList.add(o.is("hovered")):de.classList.remove(o.is("hovered"))})}function O({expanded:F,rowData:V,rowIndex:U,rowKey:Q}){var de,q;const K=[...T(d)],re=K.indexOf(Q);F?re===-1&&K.push(Q):re>-1&&K.splice(re,1),d.value=K,c("update:expandedRowKeys",K),(de=n.onRowExpand)==null||de.call(n,{expanded:F,rowData:V,rowIndex:U,rowKey:Q}),(q=n.onExpandedRowsChange)==null||q.call(n,K)}const A=Md(()=>{var F,V,U,Q;u.value=!0,p.value={...T(p),...T(_)},N(T(g),!1),_.value={},g.value=null,(F=e.value)==null||F.forceUpdate(),(V=t.value)==null||V.forceUpdate(),(U=i.value)==null||U.forceUpdate(),(Q=a.proxy)==null||Q.$forceUpdate(),u.value=!1},0);function N(F,V=!1){T(w)&&[e,t,i].forEach(U=>{const Q=T(U);Q&&Q.resetAfterRowIndex(F,V)})}function D(F,V,U){const Q=T(g);(Q===null||Q>U)&&(g.value=U),_.value[F]=V}function P({rowKey:F,height:V,rowIndex:U},Q){Q?Q===_we.RIGHT?y.value[F]=V:v.value[F]=V:C.value[F]=V;const de=Math.max(...[v,y,C].map(q=>q.value[F]||0));T(p)[F]!==de&&(D(F,de,U),A())}return{expandedRowKeys:d,lastRenderedRowIndex:f,isDynamic:w,isResetting:u,rowHeights:p,resetAfterIndex:N,onRowExpanded:O,onRowHovered:L,onRowsRendered:I,onRowHeightChange:P}},fut=(n,{expandedRowKeys:e,lastRenderedRowIndex:t,resetAfterIndex:i})=>{const s=te({}),o=W(()=>{const a={},{data:c,rowKey:u}=n,d=T(e);if(!d||!d.length)return c;const f=[],g=new Set;d.forEach(_=>g.add(_));let p=c.slice();for(p.forEach(_=>a[_[u]]=0);p.length>0;){const _=p.shift();f.push(_),g.has(_[u])&&yt(_.children)&&_.children.length>0&&(p=[..._.children,...p],_.children.forEach(v=>a[v[u]]=a[_[u]]+1))}return s.value=a,f}),r=W(()=>{const{data:a,expandColumnKey:c}=n;return c?T(o):a});return ht(r,(a,c)=>{a!==c&&(t.value=-1,i(0,!0))}),{data:r,depthMap:s}},gut=(n,e)=>n+e,BU=n=>yt(n)?n.reduce(gut,0):n,U0=(n,e,t={})=>ln(n)?n(e):n??t,_C=n=>(["width","maxWidth","minWidth","height"].forEach(e=>{n[e]=mr(n[e])}),n),vwe=n=>Oo(n)?e=>hn(n,e):n,put=(n,{columnsTotalWidth:e,rowsHeight:t,fixedColumnsOnLeft:i,fixedColumnsOnRight:s})=>{const o=W(()=>{const{fixed:w,width:I,vScrollbarSize:L}=n,O=I-L;return w?Math.max(Math.round(T(e)),O):O}),r=W(()=>T(o)+n.vScrollbarSize),a=W(()=>{const{height:w=0,maxHeight:I=0,footerHeight:L,hScrollbarSize:O}=n;if(I>0){const A=T(p),N=T(t),P=T(g)+A+N+O;return Math.min(P,I-L)}return w-L}),c=W(()=>{const{maxHeight:w}=n,I=T(a);if(gn(w)&&w>0)return I;const L=T(t)+T(g)+T(p);return Math.min(I,L)}),u=w=>w.width,d=W(()=>BU(T(i).map(u))),f=W(()=>BU(T(s).map(u))),g=W(()=>BU(n.headerHeight)),p=W(()=>{var w;return(((w=n.fixedData)==null?void 0:w.length)||0)*n.rowHeight}),_=W(()=>T(a)-T(g)-T(p)),v=W(()=>{const{style:w={},height:I,width:L}=n;return _C({...w,height:I,width:L})}),C=W(()=>_C({height:n.footerHeight})),y=W(()=>({top:mr(T(g)),bottom:mr(n.footerHeight),width:mr(n.width)}));return{bodyWidth:o,fixedTableHeight:c,mainTableHeight:a,leftTableWidth:d,rightTableWidth:f,headerWidth:r,windowHeight:_,footerHeight:C,emptyStyle:y,rootStyle:v,headerHeight:g}};function mut(n){const e=te(),t=te(),i=te(),{columns:s,columnsStyles:o,columnsTotalWidth:r,fixedColumnsOnLeft:a,fixedColumnsOnRight:c,hasFixedColumns:u,mainColumns:d,onColumnSorted:f}=uut(n,ds(n,"columns"),ds(n,"fixed")),{scrollTo:g,scrollToLeft:p,scrollToTop:_,scrollToRow:v,onScroll:C,onVerticalScroll:y,scrollPos:w}=dut(n,{mainTableRef:e,leftTableRef:t,rightTableRef:i,onMaybeEndReached:ye}),I=vt("table-v2"),L=Qn(),O=us(!1),{expandedRowKeys:A,lastRenderedRowIndex:N,isDynamic:D,isResetting:P,rowHeights:F,resetAfterIndex:V,onRowExpanded:U,onRowHeightChange:Q,onRowHovered:de,onRowsRendered:q}=hut(n,{mainTableRef:e,leftTableRef:t,rightTableRef:i,tableInstance:L,ns:I,isScrolling:O}),{data:K,depthMap:re}=fut(n,{expandedRowKeys:A,lastRenderedRowIndex:N,resetAfterIndex:V}),Z=W(()=>{const{estimatedRowHeight:Me,rowHeight:et}=n,at=T(K);return gn(Me)?Object.values(T(F)).reduce((Ue,Se)=>Ue+Se,0):at.length*et}),{bodyWidth:J,fixedTableHeight:ge,mainTableHeight:ve,leftTableWidth:Le,rightTableWidth:Ee,headerWidth:Ne,windowHeight:qe,footerHeight:Re,emptyStyle:we,rootStyle:Ve,headerHeight:Ge}=put(n,{columnsTotalWidth:r,fixedColumnsOnLeft:a,fixedColumnsOnRight:c,rowsHeight:Z}),dt=te(),ze=W(()=>{const Me=T(K).length===0;return yt(n.fixedData)?n.fixedData.length===0&&Me:Me});function ee(Me){const{estimatedRowHeight:et,rowHeight:at,rowKey:Ue}=n;return et?T(F)[T(K)[Me][Ue]]||et:at}function ye(){const{onEndReached:Me}=n;if(!Me)return;const{scrollTop:et}=T(w),at=T(Z),Ue=T(qe),Se=at-(et+Ue)+n.hScrollbarSize;T(N)>=0&&at===et+T(ve)-T(Ge)&&Me(Se)}return ht(()=>n.expandedRowKeys,Me=>A.value=Me,{deep:!0}),{columns:s,containerRef:dt,mainTableRef:e,leftTableRef:t,rightTableRef:i,isDynamic:D,isResetting:P,isScrolling:O,hasFixedColumns:u,columnsStyles:o,columnsTotalWidth:r,data:K,expandedRowKeys:A,depthMap:re,fixedColumnsOnLeft:a,fixedColumnsOnRight:c,mainColumns:d,bodyWidth:J,emptyStyle:we,rootStyle:Ve,headerWidth:Ne,footerHeight:Re,mainTableHeight:ve,fixedTableHeight:ge,leftTableWidth:Le,rightTableWidth:Ee,showEmpty:ze,getRowHeight:ee,onColumnSorted:f,onRowHovered:de,onRowExpanded:U,onRowsRendered:q,onRowHeightChange:Q,scrollTo:g,scrollToLeft:p,scrollToTop:_,scrollToRow:v,onScroll:C,onVerticalScroll:y}}const Xte=Symbol("tableV2"),bwe=String,dF={type:Ke(Array),required:!0},Yte={type:Ke(Array)},Twe={...Yte,required:!0},_ut=String,Hde={type:Ke(Array),default:()=>Ko([])},IS={type:Number,required:!0},Cwe={type:Ke([String,Number,Symbol]),default:"id"},Vde={type:Ke(Object)},KS=Lt({class:String,columns:dF,columnsStyles:{type:Ke(Object),required:!0},depth:Number,expandColumnKey:_ut,estimatedRowHeight:{...c0.estimatedRowHeight,default:void 0},isScrolling:Boolean,onRowExpand:{type:Ke(Function)},onRowHover:{type:Ke(Function)},onRowHeightChange:{type:Ke(Function)},rowData:{type:Ke(Object),required:!0},rowEventHandlers:{type:Ke(Object)},rowIndex:{type:Number,required:!0},rowKey:Cwe,style:{type:Ke(Object)}}),g9={type:Number,required:!0},qte=Lt({class:String,columns:dF,fixedHeaderData:{type:Ke(Array)},headerData:{type:Ke(Array),required:!0},headerHeight:{type:Ke([Number,Array]),default:50},rowWidth:g9,rowHeight:{type:Number,default:50},height:g9,width:g9}),HU=Lt({columns:dF,data:Twe,fixedData:Yte,estimatedRowHeight:KS.estimatedRowHeight,width:IS,height:IS,headerWidth:IS,headerHeight:qte.headerHeight,bodyWidth:IS,rowHeight:IS,cache:V0e.cache,useIsScrolling:Boolean,scrollbarAlwaysOn:c0.scrollbarAlwaysOn,scrollbarStartGap:c0.scrollbarStartGap,scrollbarEndGap:c0.scrollbarEndGap,class:bwe,style:Vde,containerStyle:Vde,getRowHeight:{type:Ke(Function),required:!0},rowKey:KS.rowKey,onRowsRendered:{type:Ke(Function)},onScroll:{type:Ke(Function)}}),vut=Lt({cache:HU.cache,estimatedRowHeight:KS.estimatedRowHeight,rowKey:Cwe,headerClass:{type:Ke([String,Function])},headerProps:{type:Ke([Object,Function])},headerCellProps:{type:Ke([Object,Function])},headerHeight:qte.headerHeight,footerHeight:{type:Number,default:0},rowClass:{type:Ke([String,Function])},rowProps:{type:Ke([Object,Function])},rowHeight:{type:Number,default:50},cellProps:{type:Ke([Object,Function])},columns:dF,data:Twe,dataGetter:{type:Ke(Function)},fixedData:Yte,expandColumnKey:KS.expandColumnKey,expandedRowKeys:Hde,defaultExpandedRowKeys:Hde,class:bwe,fixed:Boolean,style:{type:Ke(Object)},width:IS,height:IS,maxHeight:Number,useIsScrolling:Boolean,indentSize:{type:Number,default:12},iconSize:{type:Number,default:12},hScrollbarSize:c0.hScrollbarSize,vScrollbarSize:c0.vScrollbarSize,scrollbarAlwaysOn:G0e.alwaysOn,sortBy:{type:Ke(Object),default:()=>({})},sortState:{type:Ke(Object),default:void 0},onColumnSort:{type:Ke(Function)},onExpandedRowsChange:{type:Ke(Function)},onEndReached:{type:Ke(Function)},onRowExpand:KS.onRowExpand,onScroll:HU.onScroll,onRowsRendered:HU.onRowsRendered,rowEventHandlers:KS.rowEventHandlers}),but="ElTableV2Header",Tut=$e({name:but,props:qte,setup(n,{slots:e,expose:t}){const i=vt("table-v2"),s=Kt("tableV2GridScrollLeft"),o=te(),r=W(()=>_C({width:n.width,height:n.height})),a=W(()=>_C({width:n.rowWidth,height:n.height})),c=W(()=>Gc(T(n.headerHeight))),u=g=>{const p=T(o);cn(()=>{p!=null&&p.scroll&&p.scroll({left:g})})},d=()=>{const g=i.e("fixed-header-row"),{columns:p,fixedHeaderData:_,rowHeight:v}=n;return _==null?void 0:_.map((C,y)=>{var w;const I=_C({height:v,width:"100%"});return(w=e.fixed)==null?void 0:w.call(e,{class:g,columns:p,rowData:C,rowIndex:-(y+1),style:I})})},f=()=>{const g=i.e("dynamic-header-row"),{columns:p}=n;return T(c).map((_,v)=>{var C;const y=_C({width:"100%",height:_});return(C=e.dynamic)==null?void 0:C.call(e,{class:g,columns:p,headerIndex:v,style:y})})};return s_(()=>{s!=null&&s.value&&u(s.value)}),t({scrollToLeft:u}),()=>{if(!(n.height<=0))return ce("div",{ref:o,class:n.class,style:T(r),role:"rowgroup"},[ce("div",{style:T(a),class:i.e("header")},[f(),d()])])}}});var Cut=Tut;const yut=({atXEndEdge:n,atXStartEdge:e,atYEndEdge:t,atYStartEdge:i},s)=>{let o=null,r=0,a=0;const c=(d,f)=>{const g=d<=0&&e.value||d>=0&&n.value,p=f<=0&&i.value||f>=0&&t.value;return g&&p};return{hasReachedEdge:c,onWheel:d=>{H0(o);let f=d.deltaX,g=d.deltaY;Math.abs(f)>Math.abs(g)?g=0:f=0,d.shiftKey&&g!==0&&(f=g,g=0),!(c(r,a)&&c(r+f,a+g))&&(r+=f,a+=g,d.preventDefault(),o=QC(()=>{s(r,a),r=0,a=0}))}}},ywe=({name:n,clearCache:e,getColumnPosition:t,getColumnStartIndexForOffset:i,getColumnStopIndexForStartIndex:s,getEstimatedTotalHeight:o,getEstimatedTotalWidth:r,getColumnOffset:a,getRowOffset:c,getRowPosition:u,getRowStartIndexForOffset:d,getRowStopIndexForStartIndex:f,initCache:g,injectToInstance:p,validateProps:_})=>$e({name:n??"ElVirtualList",props:c0,emits:[CW,yW],setup(v,{emit:C,expose:y,slots:w}){const I=vt("vl");_(v);const L=Qn(),O=te(g(v,L));p==null||p(L,O);const A=te(),N=te(),D=te(),P=te(null),F=te({isScrolling:!1,scrollLeft:gn(v.initScrollLeft)?v.initScrollLeft:0,scrollTop:gn(v.initScrollTop)?v.initScrollTop:0,updateRequested:!1,xAxisScrollDir:P1,yAxisScrollDir:P1}),V=F0e(),U=W(()=>Number.parseInt(`${v.height}`,10)),Q=W(()=>Number.parseInt(`${v.width}`,10)),de=W(()=>{const{totalColumn:Ue,totalRow:Se,columnCache:Ie}=v,{isScrolling:Xe,xAxisScrollDir:it,scrollLeft:Tt}=T(F);if(Ue===0||Se===0)return[0,0,0,0];const He=i(v,Tt,T(O)),ke=s(v,He,Tt,T(O)),ot=!Xe||it===EW?Math.max(1,Ie):1,Ct=!Xe||it===P1?Math.max(1,Ie):1;return[Math.max(0,He-ot),Math.max(0,Math.min(Ue-1,ke+Ct)),He,ke]}),q=W(()=>{const{totalColumn:Ue,totalRow:Se,rowCache:Ie}=v,{isScrolling:Xe,yAxisScrollDir:it,scrollTop:Tt}=T(F);if(Ue===0||Se===0)return[0,0,0,0];const He=d(v,Tt,T(O)),ke=f(v,He,Tt,T(O)),ot=!Xe||it===EW?Math.max(1,Ie):1,Ct=!Xe||it===P1?Math.max(1,Ie):1;return[Math.max(0,He-ot),Math.max(0,Math.min(Se-1,ke+Ct)),He,ke]}),K=W(()=>o(v,T(O))),re=W(()=>r(v,T(O))),Z=W(()=>{var Ue;return[{position:"relative",overflow:"hidden",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:v.direction,height:gn(v.height)?`${v.height}px`:v.height,width:gn(v.width)?`${v.width}px`:v.width},(Ue=v.style)!=null?Ue:{}]}),J=W(()=>{const Ue=`${T(re)}px`;return{height:`${T(K)}px`,pointerEvents:T(F).isScrolling?"none":void 0,width:Ue}}),ge=()=>{const{totalColumn:Ue,totalRow:Se}=v;if(Ue>0&&Se>0){const[ke,ot,Ct,Gt]=T(de),[Ot,En,fe,se]=T(q);C(CW,{columnCacheStart:ke,columnCacheEnd:ot,rowCacheStart:Ot,rowCacheEnd:En,columnVisibleStart:Ct,columnVisibleEnd:Gt,rowVisibleStart:fe,rowVisibleEnd:se})}const{scrollLeft:Ie,scrollTop:Xe,updateRequested:it,xAxisScrollDir:Tt,yAxisScrollDir:He}=T(F);C(yW,{xAxisScrollDir:Tt,scrollLeft:Ie,yAxisScrollDir:He,scrollTop:Xe,updateRequested:it})},ve=Ue=>{const{clientHeight:Se,clientWidth:Ie,scrollHeight:Xe,scrollLeft:it,scrollTop:Tt,scrollWidth:He}=Ue.currentTarget,ke=T(F);if(ke.scrollTop===Tt&&ke.scrollLeft===it)return;let ot=it;if(Sde(v.direction))switch(wW()){case hx:ot=-it;break;case Gte:ot=He-Ie-it;break}F.value={...ke,isScrolling:!0,scrollLeft:ot,scrollTop:Math.max(0,Math.min(Tt,Xe-Se)),updateRequested:!0,xAxisScrollDir:GS(ke.scrollLeft,ot),yAxisScrollDir:GS(ke.scrollTop,Tt)},cn(()=>Ve()),Ge(),ge()},Le=(Ue,Se)=>{const Ie=T(U),Xe=(K.value-Ie)/Se*Ue;qe({scrollTop:Math.min(K.value-Ie,Xe)})},Ee=(Ue,Se)=>{const Ie=T(Q),Xe=(re.value-Ie)/Se*Ue;qe({scrollLeft:Math.min(re.value-Ie,Xe)})},{onWheel:Ne}=yut({atXStartEdge:W(()=>F.value.scrollLeft<=0),atXEndEdge:W(()=>F.value.scrollLeft>=re.value-T(Q)),atYStartEdge:W(()=>F.value.scrollTop<=0),atYEndEdge:W(()=>F.value.scrollTop>=K.value-T(U))},(Ue,Se)=>{var Ie,Xe,it,Tt;(Xe=(Ie=N.value)==null?void 0:Ie.onMouseUp)==null||Xe.call(Ie),(Tt=(it=D.value)==null?void 0:it.onMouseUp)==null||Tt.call(it);const He=T(Q),ke=T(U);qe({scrollLeft:Math.min(F.value.scrollLeft+Ue,re.value-He),scrollTop:Math.min(F.value.scrollTop+Se,K.value-ke)})});Es(A,"wheel",Ne,{passive:!1});const qe=({scrollLeft:Ue=F.value.scrollLeft,scrollTop:Se=F.value.scrollTop})=>{Ue=Math.max(Ue,0),Se=Math.max(Se,0);const Ie=T(F);Se===Ie.scrollTop&&Ue===Ie.scrollLeft||(F.value={...Ie,xAxisScrollDir:GS(Ie.scrollLeft,Ue),yAxisScrollDir:GS(Ie.scrollTop,Se),scrollLeft:Ue,scrollTop:Se,updateRequested:!0},cn(()=>Ve()),Ge(),ge())},Re=(Ue=0,Se=0,Ie=Rf)=>{const Xe=T(F);Se=Math.max(0,Math.min(Se,v.totalColumn-1)),Ue=Math.max(0,Math.min(Ue,v.totalRow-1));const it=NEe(I.namespace.value),Tt=T(O),He=o(v,Tt),ke=r(v,Tt);qe({scrollLeft:a(v,Se,Ie,Xe.scrollLeft,Tt,ke>v.width?it:0),scrollTop:c(v,Ue,Ie,Xe.scrollTop,Tt,He>v.height?it:0)})},we=(Ue,Se)=>{const{columnWidth:Ie,direction:Xe,rowHeight:it}=v,Tt=V.value(e&&Ie,e&&it,e&&Xe),He=`${Ue},${Se}`;if(Wi(Tt,He))return Tt[He];{const[,ke]=t(v,Se,T(O)),ot=T(O),Ct=Sde(Xe),[Gt,Ot]=u(v,Ue,ot),[En]=t(v,Se,ot);return Tt[He]={position:"absolute",left:Ct?void 0:`${ke}px`,right:Ct?`${ke}px`:void 0,top:`${Ot}px`,height:`${Gt}px`,width:`${En}px`},Tt[He]}},Ve=()=>{F.value.isScrolling=!1,cn(()=>{V.value(-1,null,null)})};$n(()=>{if(!Si)return;const{initScrollLeft:Ue,initScrollTop:Se}=v,Ie=T(A);Ie&&(gn(Ue)&&(Ie.scrollLeft=Ue),gn(Se)&&(Ie.scrollTop=Se)),ge()});const Ge=()=>{const{direction:Ue}=v,{scrollLeft:Se,scrollTop:Ie,updateRequested:Xe}=T(F),it=T(A);if(Xe&&it){if(Ue===dO)switch(wW()){case hx:{it.scrollLeft=-Se;break}case Wte:{it.scrollLeft=Se;break}default:{const{clientWidth:Tt,scrollWidth:He}=it;it.scrollLeft=He-Tt-Se;break}}else it.scrollLeft=Math.max(0,Se);it.scrollTop=Math.max(0,Ie)}},{resetAfterColumnIndex:dt,resetAfterRowIndex:ze,resetAfter:ee}=L.proxy;y({windowRef:A,innerRef:P,getItemStyleCache:V,scrollTo:qe,scrollToItem:Re,states:F,resetAfterColumnIndex:dt,resetAfterRowIndex:ze,resetAfter:ee});const ye=()=>{const{scrollbarAlwaysOn:Ue,scrollbarStartGap:Se,scrollbarEndGap:Ie,totalColumn:Xe,totalRow:it}=v,Tt=T(Q),He=T(U),ke=T(re),ot=T(K),{scrollLeft:Ct,scrollTop:Gt}=T(F),Ot=hn(jX,{ref:N,alwaysOn:Ue,startGap:Se,endGap:Ie,class:I.e("horizontal"),clientSize:Tt,layout:"horizontal",onScroll:Ee,ratio:Tt*100/ke,scrollFrom:Ct/(ke-Tt),total:it,visible:!0}),En=hn(jX,{ref:D,alwaysOn:Ue,startGap:Se,endGap:Ie,class:I.e("vertical"),clientSize:He,layout:"vertical",onScroll:Le,ratio:He*100/ot,scrollFrom:Gt/(ot-He),total:Xe,visible:!0});return{horizontalScrollbar:Ot,verticalScrollbar:En}},Me=()=>{var Ue;const[Se,Ie]=T(de),[Xe,it]=T(q),{data:Tt,totalColumn:He,totalRow:ke,useIsScrolling:ot,itemKey:Ct}=v,Gt=[];if(ke>0&&He>0)for(let Ot=Xe;Ot<=it;Ot++)for(let En=Se;En<=Ie;En++){const fe=Ct({columnIndex:En,data:Tt,rowIndex:Ot});Gt.push(hn(Qt,{key:fe},(Ue=w.default)==null?void 0:Ue.call(w,{columnIndex:En,data:Tt,isScrolling:ot?T(F).isScrolling:void 0,style:we(Ot,En),rowIndex:Ot})))}return Gt},et=()=>{const Ue=ui(v.innerElement),Se=Me();return[hn(Ue,{style:T(J),ref:P},sn(Ue)?Se:{default:()=>Se})]};return()=>{const Ue=ui(v.containerElement),{horizontalScrollbar:Se,verticalScrollbar:Ie}=ye(),Xe=et();return hn("div",{key:0,class:I.e("wrapper"),role:v.role},[hn(Ue,{class:v.className,style:T(Z),onScroll:ve,ref:A},sn(Ue)?Xe:{default:()=>Xe}),Se,Ie])}}}),{max:OW,min:Ewe,floor:Swe}=Math,Eut={column:"columnWidth",row:"rowHeight"},oY={column:"lastVisitedColumnIndex",row:"lastVisitedRowIndex"},Sv=(n,e,t,i)=>{const[s,o,r]=[t[i],n[Eut[i]],t[oY[i]]];if(e>r){let a=0;if(r>=0){const c=s[r];a=c.offset+c.size}for(let c=r+1;c<=e;c++){const u=o(c);s[c]={offset:a,size:u},a+=u}t[oY[i]]=e}return s[e]},wwe=(n,e,t,i,s,o)=>{for(;t<=i;){const r=t+Swe((i-t)/2),a=Sv(n,r,e,o).offset;if(a===s)return r;a<s?t=r+1:i=r-1}return OW(0,t-1)},Sut=(n,e,t,i,s)=>{const o=s==="column"?n.totalColumn:n.totalRow;let r=1;for(;t<o&&Sv(n,t,e,s).offset<i;)t+=r,r*=2;return wwe(n,e,Swe(t/2),Ewe(t,o-1),i,s)},Ude=(n,e,t,i)=>{const[s,o]=[e[i],e[oY[i]]];return(o>0?s[o].offset:0)>=t?wwe(n,e,0,o,t,i):Sut(n,e,OW(0,o),t,i)},Iwe=({totalRow:n},{estimatedRowHeight:e,lastVisitedRowIndex:t,row:i})=>{let s=0;if(t>=n&&(t=n-1),t>=0){const a=i[t];s=a.offset+a.size}const r=(n-t-1)*e;return s+r},Lwe=({totalColumn:n},{column:e,estimatedColumnWidth:t,lastVisitedColumnIndex:i})=>{let s=0;if(i>n&&(i=n-1),i>=0){const a=e[i];s=a.offset+a.size}const r=(n-i-1)*t;return s+r},wut={column:Lwe,row:Iwe},Wde=(n,e,t,i,s,o,r)=>{const[a,c]=[o==="row"?n.height:n.width,wut[o]],u=Sv(n,e,s,o),d=c(n,s),f=OW(0,Ewe(d-a,u.offset)),g=OW(0,u.offset-a+r+u.size);switch(t===A8&&(i>=g-a&&i<=f+a?t=Rf:t=Rm),t){case ux:return f;case dx:return g;case Rm:return Math.round(g+(f-g)/2);case Rf:default:return i>=g&&i<=f?i:g>f||i<g?g:f}},Iut=ywe({name:"ElDynamicSizeGrid",getColumnPosition:(n,e,t)=>{const i=Sv(n,e,t,"column");return[i.size,i.offset]},getRowPosition:(n,e,t)=>{const i=Sv(n,e,t,"row");return[i.size,i.offset]},getColumnOffset:(n,e,t,i,s,o)=>Wde(n,e,t,i,s,"column",o),getRowOffset:(n,e,t,i,s,o)=>Wde(n,e,t,i,s,"row",o),getColumnStartIndexForOffset:(n,e,t)=>Ude(n,t,e,"column"),getColumnStopIndexForStartIndex:(n,e,t,i)=>{const s=Sv(n,e,i,"column"),o=t+n.width;let r=s.offset+s.size,a=e;for(;a<n.totalColumn-1&&r<o;)a++,r+=Sv(n,e,i,"column").size;return a},getEstimatedTotalHeight:Iwe,getEstimatedTotalWidth:Lwe,getRowStartIndexForOffset:(n,e,t)=>Ude(n,t,e,"row"),getRowStopIndexForStartIndex:(n,e,t,i)=>{const{totalRow:s,height:o}=n,r=Sv(n,e,i,"row"),a=t+o;let c=r.size+r.offset,u=e;for(;u<s-1&&c<a;)u++,c+=Sv(n,u,i,"row").size;return u},injectToInstance:(n,e)=>{const t=({columnIndex:o,rowIndex:r},a)=>{var c,u;a=ys(a)?!0:a,gn(o)&&(e.value.lastVisitedColumnIndex=Math.min(e.value.lastVisitedColumnIndex,o-1)),gn(r)&&(e.value.lastVisitedRowIndex=Math.min(e.value.lastVisitedRowIndex,r-1)),(c=n.exposed)==null||c.getItemStyleCache.value(-1,null,null),a&&((u=n.proxy)==null||u.$forceUpdate())},i=(o,r)=>{t({columnIndex:o},r)},s=(o,r)=>{t({rowIndex:o},r)};Object.assign(n.proxy,{resetAfterColumnIndex:i,resetAfterRowIndex:s,resetAfter:t})},initCache:({estimatedColumnWidth:n=VX,estimatedRowHeight:e=VX})=>({column:{},estimatedColumnWidth:n,estimatedRowHeight:e,lastVisitedColumnIndex:-1,lastVisitedRowIndex:-1,row:{}}),clearCache:!1,validateProps:({columnWidth:n,rowHeight:e})=>{}}),Lut=ywe({name:"ElFixedSizeGrid",getColumnPosition:({columnWidth:n},e)=>[n,e*n],getRowPosition:({rowHeight:n},e)=>[n,e*n],getEstimatedTotalHeight:({totalRow:n,rowHeight:e})=>e*n,getEstimatedTotalWidth:({totalColumn:n,columnWidth:e})=>e*n,getColumnOffset:({totalColumn:n,columnWidth:e,width:t},i,s,o,r,a)=>{t=Number(t);const c=Math.max(0,n*e-t),u=Math.min(c,i*e),d=Math.max(0,i*e-t+a+e);switch(s==="smart"&&(o>=d-t&&o<=u+t?s=Rf:s=Rm),s){case ux:return u;case dx:return d;case Rm:{const f=Math.round(d+(u-d)/2);return f<Math.ceil(t/2)?0:f>c+Math.floor(t/2)?c:f}case Rf:default:return o>=d&&o<=u?o:d>u||o<d?d:u}},getRowOffset:({rowHeight:n,height:e,totalRow:t},i,s,o,r,a)=>{e=Number(e);const c=Math.max(0,t*n-e),u=Math.min(c,i*n),d=Math.max(0,i*n-e+a+n);switch(s===A8&&(o>=d-e&&o<=u+e?s=Rf:s=Rm),s){case ux:return u;case dx:return d;case Rm:{const f=Math.round(d+(u-d)/2);return f<Math.ceil(e/2)?0:f>c+Math.floor(e/2)?c:f}case Rf:default:return o>=d&&o<=u?o:d>u||o<d?d:u}},getColumnStartIndexForOffset:({columnWidth:n,totalColumn:e},t)=>Math.max(0,Math.min(e-1,Math.floor(t/n))),getColumnStopIndexForStartIndex:({columnWidth:n,totalColumn:e,width:t},i,s)=>{const o=i*n,r=Math.ceil((t+s-o)/n);return Math.max(0,Math.min(e-1,i+r-1))},getRowStartIndexForOffset:({rowHeight:n,totalRow:e},t)=>Math.max(0,Math.min(e-1,Math.floor(t/n))),getRowStopIndexForStartIndex:({rowHeight:n,totalRow:e,height:t},i,s)=>{const o=i*n,r=Math.ceil((t+s-o)/n);return Math.max(0,Math.min(e-1,i+r-1))},initCache:()=>{},clearCache:!0,validateProps:({columnWidth:n,rowHeight:e})=>{}}),Out="ElTableV2Grid",Rut=n=>{const e=te(),t=te(),i=te(0),s=W(()=>{const{data:C,rowHeight:y,estimatedRowHeight:w}=n;if(!w)return C.length*y}),o=W(()=>{const{fixedData:C,rowHeight:y}=n;return((C==null?void 0:C.length)||0)*y}),r=W(()=>BU(n.headerHeight)),a=W(()=>{const{height:C}=n;return Math.max(0,C-T(r)-T(o))}),c=W(()=>T(r)+T(o)>0),u=({data:C,rowIndex:y})=>C[y][n.rowKey];function d({rowCacheStart:C,rowCacheEnd:y,rowVisibleStart:w,rowVisibleEnd:I}){var L;(L=n.onRowsRendered)==null||L.call(n,{rowCacheStart:C,rowCacheEnd:y,rowVisibleStart:w,rowVisibleEnd:I})}function f(C,y){var w;(w=t.value)==null||w.resetAfterRowIndex(C,y)}function g(C,y){const w=T(e),I=T(t);si(C)?(w==null||w.scrollToLeft(C.scrollLeft),i.value=C.scrollLeft,I==null||I.scrollTo(C)):(w==null||w.scrollToLeft(C),i.value=C,I==null||I.scrollTo({scrollLeft:C,scrollTop:y}))}function p(C){var y;(y=T(t))==null||y.scrollTo({scrollTop:C})}function _(C,y){var w;(w=T(t))==null||w.scrollToItem(C,1,y)}function v(){var C,y;(C=T(t))==null||C.$forceUpdate(),(y=T(e))==null||y.$forceUpdate()}return{bodyRef:t,forceUpdate:v,fixedRowHeight:o,gridHeight:a,hasHeader:c,headerHeight:r,headerRef:e,totalHeight:s,itemKey:u,onItemRendered:d,resetAfterRowIndex:f,scrollTo:g,scrollToTop:p,scrollToRow:_,scrollLeft:i}},Mut=$e({name:Out,props:HU,setup(n,{slots:e,expose:t}){const{ns:i}=Kt(Xte),{bodyRef:s,fixedRowHeight:o,gridHeight:r,hasHeader:a,headerRef:c,headerHeight:u,totalHeight:d,forceUpdate:f,itemKey:g,onItemRendered:p,resetAfterRowIndex:_,scrollTo:v,scrollToTop:C,scrollToRow:y,scrollLeft:w}=Rut(n);pi("tableV2GridScrollLeft",w),t({forceUpdate:f,totalHeight:d,scrollTo:v,scrollToTop:C,scrollToRow:y,resetAfterRowIndex:_});const I=()=>n.bodyWidth;return()=>{const{cache:L,columns:O,data:A,fixedData:N,useIsScrolling:D,scrollbarAlwaysOn:P,scrollbarEndGap:F,scrollbarStartGap:V,style:U,rowHeight:Q,bodyWidth:de,estimatedRowHeight:q,headerWidth:K,height:re,width:Z,getRowHeight:J,onScroll:ge}=n,ve=gn(q),Le=ve?Iut:Lut,Ee=T(u);return ce("div",{role:"table",class:[i.e("table"),n.class],style:U},[ce(Le,{ref:s,data:A,useIsScrolling:D,itemKey:g,columnCache:0,columnWidth:ve?I:de,totalColumn:1,totalRow:A.length,rowCache:L,rowHeight:ve?J:Q,width:Z,height:T(r),class:i.e("body"),role:"rowgroup",scrollbarStartGap:V,scrollbarEndGap:F,scrollbarAlwaysOn:P,onScroll:ge,onItemRendered:p,perfMode:!1},{default:Ne=>{var qe;const Re=A[Ne.rowIndex];return(qe=e.row)==null?void 0:qe.call(e,{...Ne,columns:O,rowData:Re})}}),T(a)&&ce(Cut,{ref:c,class:i.e("header-wrapper"),columns:O,headerData:A,headerHeight:n.headerHeight,fixedHeaderData:N,rowWidth:K,rowHeight:Q,width:Z,height:Math.min(Ee+T(o),re)},{dynamic:e.header,fixed:e.row})])}}});var Jte=Mut;function kut(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Oo(n)}const Aut=(n,{slots:e})=>{const{mainTableRef:t,...i}=n;return ce(Jte,hi({ref:t},i),kut(e)?e:{default:()=>[e]})};var Nut=Aut;function Dut(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Oo(n)}const $ut=(n,{slots:e})=>{if(!n.columns.length)return;const{leftTableRef:t,...i}=n;return ce(Jte,hi({ref:t},i),Dut(e)?e:{default:()=>[e]})};var xut=$ut;function Put(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Oo(n)}const Fut=(n,{slots:e})=>{if(!n.columns.length)return;const{rightTableRef:t,...i}=n;return ce(Jte,hi({ref:t},i),Put(e)?e:{default:()=>[e]})};var But=Fut;const Hut=n=>{const{isScrolling:e}=Kt(Xte),t=te(!1),i=te(),s=W(()=>gn(n.estimatedRowHeight)&&n.rowIndex>=0),o=(c=!1)=>{const u=T(i);if(!u)return;const{columns:d,onRowHeightChange:f,rowKey:g,rowIndex:p,style:_}=n,{height:v}=u.getBoundingClientRect();t.value=!0,cn(()=>{if(c||v!==Number.parseInt(_.height)){const C=d[0],y=(C==null?void 0:C.placeholderSign)===mx;f==null||f({rowKey:g,height:v,rowIndex:p},C&&!y&&C.fixed)}})},r=W(()=>{const{rowData:c,rowIndex:u,rowKey:d,onRowHover:f}=n,g=n.rowEventHandlers||{},p={};return Object.entries(g).forEach(([_,v])=>{ln(v)&&(p[_]=C=>{v({event:C,rowData:c,rowIndex:u,rowKey:d})})}),f&&[{name:"onMouseleave",hovered:!1},{name:"onMouseenter",hovered:!0}].forEach(({name:_,hovered:v})=>{const C=p[_];p[_]=y=>{f({event:y,hovered:v,rowData:c,rowIndex:u,rowKey:d}),C==null||C(y)}}),p}),a=c=>{const{onRowExpand:u,rowData:d,rowIndex:f,rowKey:g}=n;u==null||u({expanded:c,rowData:d,rowIndex:f,rowKey:g})};return $n(()=>{T(s)&&o(!0)}),{isScrolling:e,measurable:s,measured:t,rowRef:i,eventHandlers:r,onExpand:a}},Vut="ElTableV2TableRow",Uut=$e({name:Vut,props:KS,setup(n,{expose:e,slots:t,attrs:i}){const{eventHandlers:s,isScrolling:o,measurable:r,measured:a,rowRef:c,onExpand:u}=Hut(n);return e({onExpand:u}),()=>{const{columns:d,columnsStyles:f,expandColumnKey:g,depth:p,rowData:_,rowIndex:v,style:C}=n;let y=d.map((w,I)=>{const L=yt(_.children)&&_.children.length>0&&w.key===g;return t.cell({column:w,columns:d,columnIndex:I,depth:p,style:f[w.key],rowData:_,rowIndex:v,isScrolling:T(o),expandIconProps:L?{rowData:_,rowIndex:v,onExpand:u}:void 0})});if(t.row&&(y=t.row({cells:y.map(w=>yt(w)&&w.length===1?w[0]:w),style:C,columns:d,depth:p,rowData:_,rowIndex:v,isScrolling:T(o)})),T(r)){const{height:w,...I}=C||{},L=T(a);return ce("div",hi({ref:c,class:n.class,style:L?C:I,role:"row"},i,T(s)),[y])}return ce("div",hi(i,{ref:c,class:n.class,style:C,role:"row"},T(s)),[y])}}});var Wut=Uut;function Gut(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Oo(n)}const zut=(n,{slots:e})=>{const{columns:t,columnsStyles:i,depthMap:s,expandColumnKey:o,expandedRowKeys:r,estimatedRowHeight:a,hasFixedColumns:c,rowData:u,rowIndex:d,style:f,isScrolling:g,rowProps:p,rowClass:_,rowKey:v,rowEventHandlers:C,ns:y,onRowHovered:w,onRowExpanded:I}=n,L=U0(_,{columns:t,rowData:u,rowIndex:d},""),O=U0(p,{columns:t,rowData:u,rowIndex:d}),A=u[v],N=s[A]||0,D=!!o,P=d<0,F=[y.e("row"),L,{[y.e(`row-depth-${N}`)]:D&&d>=0,[y.is("expanded")]:D&&r.includes(A),[y.is("fixed")]:!N&&P,[y.is("customized")]:!!e.row}],V=c?w:void 0,U={...O,columns:t,columnsStyles:i,class:F,depth:N,expandColumnKey:o,estimatedRowHeight:P?void 0:a,isScrolling:g,rowIndex:d,rowData:u,rowKey:A,rowEventHandlers:C,style:f};return ce(Wut,hi(U,{onRowExpand:I,onMouseenter:q=>{V==null||V({hovered:!0,rowKey:A,event:q,rowData:u,rowIndex:d})},onMouseleave:q=>{V==null||V({hovered:!1,rowKey:A,event:q,rowData:u,rowIndex:d})},rowkey:A}),Gut(e)?e:{default:()=>[e]})};var Kut=zut;const Qte=(n,{slots:e})=>{var t;const{cellData:i,style:s}=n,o=((t=i==null?void 0:i.toString)==null?void 0:t.call(i))||"",r=Ye(e,"default",n,()=>[o]);return ce("div",{class:n.class,title:o,style:s},[r])};Qte.displayName="ElTableV2Cell";Qte.inheritAttrs=!1;var jut=Qte;const Xut=n=>{const{expanded:e,expandable:t,onExpand:i,style:s,size:o}=n,r={onClick:t?()=>i(!e):void 0,class:n.class};return ce(tn,hi(r,{size:o,style:s}),{default:()=>[ce(Au,null,null)]})};var Yut=Xut;const Owe=({columns:n,column:e,columnIndex:t,depth:i,expandIconProps:s,isScrolling:o,rowData:r,rowIndex:a,style:c,expandedRowKeys:u,ns:d,cellProps:f,expandColumnKey:g,indentSize:p,iconSize:_,rowKey:v},{slots:C})=>{const y=_C(c);if(e.placeholderSign===mx)return ce("div",{class:d.em("row-cell","placeholder"),style:y},null);const{cellRenderer:w,dataKey:I,dataGetter:L}=e,O=ln(L)?L({columns:n,column:e,columnIndex:t,rowData:r,rowIndex:a}):Fr(r,I??""),A=U0(f,{cellData:O,columns:n,column:e,columnIndex:t,rowIndex:a,rowData:r}),N={class:d.e("cell-text"),columns:n,column:e,columnIndex:t,cellData:O,isScrolling:o,rowData:r,rowIndex:a},D=vwe(w),P=D?D(N):Ye(C,"default",N,()=>[ce(jut,N,null)]),F=[d.e("row-cell"),e.class,e.align===px.CENTER&&d.is("align-center"),e.align===px.RIGHT&&d.is("align-right")],V=a>=0&&g&&e.key===g,U=a>=0&&u.includes(r[v]);let Q;const de=`margin-inline-start: ${i*p}px;`;return V&&(si(s)?Q=ce(Yut,hi(s,{class:[d.e("expand-icon"),d.is("expanded",U)],size:_,expanded:U,style:de,expandable:!0}),null):Q=ce("div",{style:[de,`width: ${_}px; height: ${_}px;`].join(" ")},null)),ce("div",hi({class:F,style:y},A,{role:"cell"}),[Q,P])};Owe.inheritAttrs=!1;var Gde=Owe;const qut=Lt({class:String,columns:dF,columnsStyles:{type:Ke(Object),required:!0},headerIndex:Number,style:{type:Ke(Object)}}),Jut=$e({name:"ElTableV2HeaderRow",props:qut,setup(n,{slots:e}){return()=>{const{columns:t,columnsStyles:i,headerIndex:s,style:o}=n;let r=t.map((a,c)=>e.cell({columns:t,column:a,columnIndex:c,headerIndex:s,style:i[a.key]}));return e.header&&(r=e.header({cells:r.map(a=>yt(a)&&a.length===1?a[0]:a),columns:t,headerIndex:s})),ce("div",{class:n.class,style:o,role:"row"},[r])}}});var Qut=Jut;function Zut(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Oo(n)}const edt=({columns:n,columnsStyles:e,headerIndex:t,style:i,headerClass:s,headerProps:o,ns:r},{slots:a})=>{const c={columns:n,headerIndex:t},u=[r.e("header-row"),U0(s,c,""),{[r.is("customized")]:!!a.header}],d={...U0(o,c),columnsStyles:e,class:u,columns:n,headerIndex:t,style:i};return ce(Qut,d,Zut(a)?a:{default:()=>[a]})};var tdt=edt;const Zte=(n,{slots:e})=>Ye(e,"default",n,()=>{var t,i;return[ce("div",{class:n.class,title:(t=n.column)==null?void 0:t.title},[(i=n.column)==null?void 0:i.title])]});Zte.displayName="ElTableV2HeaderCell";Zte.inheritAttrs=!1;var ndt=Zte;const idt=n=>{const{sortOrder:e}=n;return ce(tn,{size:14,class:n.class},{default:()=>[e===gx.ASC?ce(pje,null,null):ce(fje,null,null)]})};var sdt=idt;const odt=(n,{slots:e})=>{const{column:t,ns:i,style:s,onColumnSorted:o}=n,r=_C(s);if(t.placeholderSign===mx)return ce("div",{class:i.em("header-row-cell","placeholder"),style:r},null);const{headerCellRenderer:a,headerClass:c,sortable:u}=t,d={...n,class:i.e("header-cell-text")},f=vwe(a),g=f?f(d):Ye(e,"default",d,()=>[ce(ndt,d,null)]),{sortBy:p,sortState:_,headerCellProps:v}=n;let C,y;if(_){const L=_[t.key];C=!!sY[L],y=C?L:gx.ASC}else C=t.key===p.key,y=C?p.order:gx.ASC;const w=[i.e("header-cell"),U0(c,n,""),t.align===px.CENTER&&i.is("align-center"),t.align===px.RIGHT&&i.is("align-right"),u&&i.is("sortable")],I={...U0(v,n),onClick:t.sortable?o:void 0,class:w,style:r,"data-key":t.key};return ce("div",hi(I,{role:"columnheader"}),[g,u&&ce(sdt,{class:[i.e("sort-icon"),C&&i.is("sorting")],sortOrder:y},null)])};var zde=odt;const Rwe=(n,{slots:e})=>{var t;return ce("div",{class:n.class,style:n.style},[(t=e.default)==null?void 0:t.call(e)])};Rwe.displayName="ElTableV2Footer";var rdt=Rwe;const Mwe=(n,{slots:e})=>{const t=Ye(e,"default",{},()=>[ce(E0e,null,null)]);return ce("div",{class:n.class,style:n.style},[t])};Mwe.displayName="ElTableV2Empty";var ldt=Mwe;const kwe=(n,{slots:e})=>{var t;return ce("div",{class:n.class,style:n.style},[(t=e.default)==null?void 0:t.call(e)])};kwe.displayName="ElTableV2Overlay";var adt=kwe;function RN(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Oo(n)}const cdt="ElTableV2",udt=$e({name:cdt,props:vut,setup(n,{slots:e,expose:t}){const i=vt("table-v2"),{columnsStyles:s,fixedColumnsOnLeft:o,fixedColumnsOnRight:r,mainColumns:a,mainTableHeight:c,fixedTableHeight:u,leftTableWidth:d,rightTableWidth:f,data:g,depthMap:p,expandedRowKeys:_,hasFixedColumns:v,mainTableRef:C,leftTableRef:y,rightTableRef:w,isDynamic:I,isResetting:L,isScrolling:O,bodyWidth:A,emptyStyle:N,rootStyle:D,headerWidth:P,footerHeight:F,showEmpty:V,scrollTo:U,scrollToLeft:Q,scrollToTop:de,scrollToRow:q,getRowHeight:K,onColumnSorted:re,onRowHeightChange:Z,onRowHovered:J,onRowExpanded:ge,onRowsRendered:ve,onScroll:Le,onVerticalScroll:Ee}=mut(n);return t({scrollTo:U,scrollToLeft:Q,scrollToTop:de,scrollToRow:q}),pi(Xte,{ns:i,isResetting:L,isScrolling:O}),()=>{const{cache:Ne,cellProps:qe,estimatedRowHeight:Re,expandColumnKey:we,fixedData:Ve,headerHeight:Ge,headerClass:dt,headerProps:ze,headerCellProps:ee,sortBy:ye,sortState:Me,rowHeight:et,rowClass:at,rowEventHandlers:Ue,rowKey:Se,rowProps:Ie,scrollbarAlwaysOn:Xe,indentSize:it,iconSize:Tt,useIsScrolling:He,vScrollbarSize:ke,width:ot}=n,Ct=T(g),Gt={cache:Ne,class:i.e("main"),columns:T(a),data:Ct,fixedData:Ve,estimatedRowHeight:Re,bodyWidth:T(A)+ke,headerHeight:Ge,headerWidth:T(P),height:T(c),mainTableRef:C,rowKey:Se,rowHeight:et,scrollbarAlwaysOn:Xe,scrollbarStartGap:2,scrollbarEndGap:ke,useIsScrolling:He,width:ot,getRowHeight:K,onRowsRendered:ve,onScroll:Le},Ot=T(d),En=T(u),fe={cache:Ne,class:i.e("left"),columns:T(o),data:Ct,estimatedRowHeight:Re,leftTableRef:y,rowHeight:et,bodyWidth:Ot,headerWidth:Ot,headerHeight:Ge,height:En,rowKey:Se,scrollbarAlwaysOn:Xe,scrollbarStartGap:2,scrollbarEndGap:ke,useIsScrolling:He,width:Ot,getRowHeight:K,onScroll:Ee},le=T(f)+ke,Fe={cache:Ne,class:i.e("right"),columns:T(r),data:Ct,estimatedRowHeight:Re,rightTableRef:w,rowHeight:et,bodyWidth:le,headerWidth:le,headerHeight:Ge,height:En,rowKey:Se,scrollbarAlwaysOn:Xe,scrollbarStartGap:2,scrollbarEndGap:ke,width:le,style:`--${T(i.namespace)}-table-scrollbar-size: ${ke}px`,useIsScrolling:He,getRowHeight:K,onScroll:Ee},pe=T(s),je={ns:i,depthMap:T(p),columnsStyles:pe,expandColumnKey:we,expandedRowKeys:T(_),estimatedRowHeight:Re,hasFixedColumns:T(v),rowProps:Ie,rowClass:at,rowKey:Se,rowEventHandlers:Ue,onRowHovered:J,onRowExpanded:ge,onRowHeightChange:Z},Ae={cellProps:qe,expandColumnKey:we,indentSize:it,iconSize:Tt,rowKey:Se,expandedRowKeys:T(_),ns:i},Et={ns:i,headerClass:dt,headerProps:ze,columnsStyles:pe},Tn={ns:i,sortBy:ye,sortState:Me,headerCellProps:ee,onColumnSorted:re},Hn={row:Zn=>ce(Kut,hi(Zn,je),{row:e.row,cell:Hi=>{let ti;return e.cell?ce(Gde,hi(Hi,Ae,{style:pe[Hi.column.key]}),RN(ti=e.cell(Hi))?ti:{default:()=>[ti]}):ce(Gde,hi(Hi,Ae,{style:pe[Hi.column.key]}),null)}}),header:Zn=>ce(tdt,hi(Zn,Et),{header:e.header,cell:Hi=>{let ti;return e["header-cell"]?ce(zde,hi(Hi,Tn,{style:pe[Hi.column.key]}),RN(ti=e["header-cell"](Hi))?ti:{default:()=>[ti]}):ce(zde,hi(Hi,Tn,{style:pe[Hi.column.key]}),null)}})},Xn=[n.class,i.b(),i.e("root"),{[i.is("dynamic")]:T(I)}],vs={class:i.e("footer"),style:T(F)};return ce("div",{class:Xn,style:T(D)},[ce(Nut,Gt,RN(Hn)?Hn:{default:()=>[Hn]}),ce(xut,fe,RN(Hn)?Hn:{default:()=>[Hn]}),ce(But,Fe,RN(Hn)?Hn:{default:()=>[Hn]}),e.footer&&ce(rdt,vs,{default:e.footer}),T(V)&&ce(ldt,{class:i.e("empty"),style:T(N)},{default:e.empty}),e.overlay&&ce(adt,{class:i.e("overlay")},{default:e.overlay})])}}});var ddt=udt;const hdt=Lt({disableWidth:Boolean,disableHeight:Boolean,onResize:{type:Ke(Function)}}),fdt=n=>{const e=te(),t=te(0),i=te(0);let s;return $n(()=>{s=wo(e,([o])=>{const{width:r,height:a}=o.contentRect,{paddingLeft:c,paddingRight:u,paddingTop:d,paddingBottom:f}=getComputedStyle(o.target),g=Number.parseInt(c)||0,p=Number.parseInt(u)||0,_=Number.parseInt(d)||0,v=Number.parseInt(f)||0;t.value=r-g-p,i.value=a-_-v}).stop}),As(()=>{s==null||s()}),ht([t,i],([o,r])=>{var a;(a=n.onResize)==null||a.call(n,{width:o,height:r})}),{sizer:e,width:t,height:i}},gdt=$e({name:"ElAutoResizer",props:hdt,setup(n,{slots:e}){const t=vt("auto-resizer"),{height:i,width:s,sizer:o}=fdt(n),r={width:"100%",height:"100%"};return()=>{var a;return ce("div",{ref:o,class:t.b(),style:r},[(a=e.default)==null?void 0:a.call(e,{height:i.value,width:s.value})])}}});var pdt=gdt;const mdt=Nn(ddt),_dt=Nn(pdt),N8=Symbol("tabsRootContextKey"),vdt=Lt({tabs:{type:Ke(Array),default:()=>Ko([])}}),Awe="ElTabBar",bdt=$e({name:Awe}),Tdt=$e({...bdt,props:vdt,setup(n,{expose:e}){const t=n,i=Qn(),s=Kt(N8);s||Ll(Awe,"<el-tabs><el-tab-bar /></el-tabs>");const o=vt("tabs"),r=te(),a=te(),c=()=>{let p=0,_=0;const v=["top","bottom"].includes(s.props.tabPosition)?"width":"height",C=v==="width"?"x":"y",y=C==="x"?"left":"top";return t.tabs.every(w=>{var I,L;const O=(L=(I=i.parent)==null?void 0:I.refs)==null?void 0:L[`tab-${w.uid}`];if(!O)return!1;if(!w.active)return!0;p=O[`offset${bm(y)}`],_=O[`client${bm(v)}`];const A=window.getComputedStyle(O);return v==="width"&&(_-=Number.parseFloat(A.paddingLeft)+Number.parseFloat(A.paddingRight),p+=Number.parseFloat(A.paddingLeft)),!1}),{[v]:`${_}px`,transform:`translate${bm(C)}(${p}px)`}},u=()=>a.value=c(),d=[],f=()=>{var p;d.forEach(v=>v.stop()),d.length=0;const _=(p=i.parent)==null?void 0:p.refs;if(_){for(const v in _)if(v.startsWith("tab-")){const C=_[v];C&&d.push(wo(C,u))}}};ht(()=>t.tabs,async()=>{await cn(),u(),f()},{immediate:!0});const g=wo(r,()=>u());return As(()=>{d.forEach(p=>p.stop()),d.length=0,g.stop()}),e({ref:r,update:u}),(p,_)=>(G(),he("div",{ref_key:"barRef",ref:r,class:Y([T(o).e("active-bar"),T(o).is(T(s).props.tabPosition)]),style:on(a.value)},null,6))}});var Cdt=Rt(Tdt,[["__file","tab-bar.vue"]]);const ydt=Lt({panes:{type:Ke(Array),default:()=>Ko([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),Edt={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Kde="ElTabNav",Sdt=$e({name:Kde,props:ydt,emits:Edt,setup(n,{expose:e,emit:t}){const i=Kt(N8);i||Ll(Kde,"<el-tabs><tab-nav /></el-tabs>");const s=vt("tabs"),o=R7e(),r=V7e(),a=te(),c=te(),u=te(),d=te(),f=te(!1),g=te(0),p=te(!1),_=te(!0),v=W(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),C=W(()=>({transform:`translate${v.value==="width"?"X":"Y"}(-${g.value}px)`})),y=()=>{if(!a.value)return;const D=a.value[`offset${bm(v.value)}`],P=g.value;if(!P)return;const F=P>D?P-D:0;g.value=F},w=()=>{if(!a.value||!c.value)return;const D=c.value[`offset${bm(v.value)}`],P=a.value[`offset${bm(v.value)}`],F=g.value;if(D-F<=P)return;const V=D-F>P*2?F+P:D-P;g.value=V},I=async()=>{const D=c.value;if(!f.value||!u.value||!a.value||!D)return;await cn();const P=u.value.querySelector(".is-active");if(!P)return;const F=a.value,V=["top","bottom"].includes(i.props.tabPosition),U=P.getBoundingClientRect(),Q=F.getBoundingClientRect(),de=V?D.offsetWidth-Q.width:D.offsetHeight-Q.height,q=g.value;let K=q;V?(U.left<Q.left&&(K=q-(Q.left-U.left)),U.right>Q.right&&(K=q+U.right-Q.right)):(U.top<Q.top&&(K=q-(Q.top-U.top)),U.bottom>Q.bottom&&(K=q+(U.bottom-Q.bottom))),K=Math.max(K,0),g.value=Math.min(K,de)},L=()=>{var D;if(!c.value||!a.value)return;n.stretch&&((D=d.value)==null||D.update());const P=c.value[`offset${bm(v.value)}`],F=a.value[`offset${bm(v.value)}`],V=g.value;F<P?(f.value=f.value||{},f.value.prev=V,f.value.next=V+F<P,P-V<F&&(g.value=P-F)):(f.value=!1,V>0&&(g.value=0))},O=D=>{let P=0;switch(D.code){case zt.left:case zt.up:P=-1;break;case zt.right:case zt.down:P=1;break;default:return}const F=Array.from(D.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));let U=F.indexOf(D.target)+P;U<0?U=F.length-1:U>=F.length&&(U=0),F[U].focus({preventScroll:!0}),F[U].click(),A()},A=()=>{_.value&&(p.value=!0)},N=()=>p.value=!1;return ht(o,D=>{D==="hidden"?_.value=!1:D==="visible"&&setTimeout(()=>_.value=!0,50)}),ht(r,D=>{D?setTimeout(()=>_.value=!0,50):_.value=!1}),wo(u,L),$n(()=>setTimeout(()=>I(),0)),s_(()=>L()),e({scrollToActiveTab:I,removeFocus:N}),()=>{const D=f.value?[ce("span",{class:[s.e("nav-prev"),s.is("disabled",!f.value.prev)],onClick:y},[ce(tn,null,{default:()=>[ce(ZC,null,null)]})]),ce("span",{class:[s.e("nav-next"),s.is("disabled",!f.value.next)],onClick:w},[ce(tn,null,{default:()=>[ce(Au,null,null)]})])]:null,P=n.panes.map((F,V)=>{var U,Q,de,q;const K=F.uid,re=F.props.disabled,Z=(Q=(U=F.props.name)!=null?U:F.index)!=null?Q:`${V}`,J=!re&&(F.isClosable||n.editable);F.index=`${V}`;const ge=J?ce(tn,{class:"is-icon-close",onClick:Ee=>t("tabRemove",F,Ee)},{default:()=>[ce(Zg,null,null)]}):null,ve=((q=(de=F.slots).label)==null?void 0:q.call(de))||F.props.label,Le=!re&&F.active?0:-1;return ce("div",{ref:`tab-${K}`,class:[s.e("item"),s.is(i.props.tabPosition),s.is("active",F.active),s.is("disabled",re),s.is("closable",J),s.is("focus",p.value)],id:`tab-${Z}`,key:`tab-${K}`,"aria-controls":`pane-${Z}`,role:"tab","aria-selected":F.active,tabindex:Le,onFocus:()=>A(),onBlur:()=>N(),onClick:Ee=>{N(),t("tabClick",F,Z,Ee)},onKeydown:Ee=>{J&&(Ee.code===zt.delete||Ee.code===zt.backspace)&&t("tabRemove",F,Ee)}},[ve,ge])});return ce("div",{ref:u,class:[s.e("nav-wrap"),s.is("scrollable",!!f.value),s.is(i.props.tabPosition)]},[D,ce("div",{class:s.e("nav-scroll"),ref:a},[ce("div",{class:[s.e("nav"),s.is(i.props.tabPosition),s.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:c,style:C.value,role:"tablist",onKeydown:O},[n.type?null:ce(Cdt,{ref:d,tabs:[...n.panes]},null),P])])])}}}),wdt=Lt({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ke(Function),default:()=>!0},stretch:Boolean}),p9=n=>sn(n)||gn(n),Idt={[Kn]:n=>p9(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>p9(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>p9(n),tabAdd:()=>!0},Ldt=$e({name:"ElTabs",props:wdt,emits:Idt,setup(n,{emit:e,slots:t,expose:i}){var s;const o=vt("tabs"),r=W(()=>["left","right"].includes(n.tabPosition)),{children:a,addChild:c,removeChild:u}=Tte(Qn(),"ElTabPane"),d=te(),f=te((s=n.modelValue)!=null?s:"0"),g=async(y,w=!1)=>{var I,L,O;if(!(f.value===y||ys(y)))try{await((I=n.beforeLeave)==null?void 0:I.call(n,y,f.value))!==!1&&(f.value=y,w&&(e(Kn,y),e("tabChange",y)),(O=(L=d.value)==null?void 0:L.removeFocus)==null||O.call(L))}catch{}},p=(y,w,I)=>{y.props.disabled||(g(w,!0),e("tabClick",y,I))},_=(y,w)=>{y.props.disabled||ys(y.props.name)||(w.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},v=()=>{e("edit",void 0,"add"),e("tabAdd")};ht(()=>n.modelValue,y=>g(y)),ht(f,async()=>{var y;await cn(),(y=d.value)==null||y.scrollToActiveTab()}),pi(N8,{props:n,currentName:f,registerPane:y=>{a.value.push(y)},sortPane:c,unregisterPane:u}),i({currentName:f});const C=({render:y})=>y();return()=>{const y=t["add-icon"],w=n.editable||n.addable?ce("div",{class:[o.e("new-tab"),r.value&&o.e("new-tab-vertical")],tabindex:"0",onClick:v,onKeydown:O=>{[zt.enter,zt.numpadEnter].includes(O.code)&&v()}},[y?Ye(t,"add-icon"):ce(tn,{class:o.is("icon-plus")},{default:()=>[ce(FEe,null,null)]})]):null,I=ce("div",{class:[o.e("header"),r.value&&o.e("header-vertical"),o.is(n.tabPosition)]},[ce(C,{render:()=>{const O=a.value.some(A=>A.slots.label);return ce(Sdt,{ref:d,currentName:f.value,editable:n.editable,type:n.type,panes:a.value,stretch:n.stretch,onTabClick:p,onTabRemove:_},{$stable:!O})}},null),w]),L=ce("div",{class:o.e("content")},[Ye(t,"default")]);return ce("div",{class:[o.b(),o.m(n.tabPosition),{[o.m("card")]:n.type==="card",[o.m("border-card")]:n.type==="border-card"}]},[L,I])}}});var Odt=Ldt;const Rdt=Lt({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Nwe="ElTabPane",Mdt=$e({name:Nwe}),kdt=$e({...Mdt,props:Rdt,setup(n){const e=n,t=Qn(),i=dl(),s=Kt(N8);s||Ll(Nwe,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const o=vt("tab-pane"),r=te(),a=W(()=>e.closable||s.props.closable),c=pX(()=>{var p;return s.currentName.value===((p=e.name)!=null?p:r.value)}),u=te(c.value),d=W(()=>{var p;return(p=e.name)!=null?p:r.value}),f=pX(()=>!e.lazy||u.value||c.value);ht(c,p=>{p&&(u.value=!0)});const g=Ki({uid:t.uid,slots:i,props:e,paneName:d,active:c,index:r,isClosable:a});return s.registerPane(g),$n(()=>{s.sortPane(g)}),Cb(()=>{s.unregisterPane(g.uid)}),(p,_)=>T(f)?Un((G(),he("div",{key:0,id:`pane-${T(d)}`,class:Y(T(o).b()),role:"tabpanel","aria-hidden":!T(c),"aria-labelledby":`tab-${T(d)}`},[Ye(p.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[Gi,T(c)]]):Qe("v-if",!0)}});var Dwe=Rt(kdt,[["__file","tab-pane.vue"]]);const Adt=Nn(Odt,{TabPane:Dwe}),Ndt=Xo(Dwe),Ddt=Lt({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:l_,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),$dt=$e({name:"ElText"}),xdt=$e({...$dt,props:Ddt,setup(n){const e=n,t=jr(),i=vt("text"),s=W(()=>[i.b(),i.m(e.type),i.m(t.value),i.is("truncated",e.truncated),i.is("line-clamp",!ys(e.lineClamp))]);return(o,r)=>(G(),nt(ui(o.tag),{class:Y(T(s)),style:on({"-webkit-line-clamp":o.lineClamp})},{default:_e(()=>[Ye(o.$slots,"default")]),_:3},8,["class","style"]))}});var Pdt=Rt(xdt,[["__file","text.vue"]]);const Fdt=Nn(Pdt),Bdt=Lt({format:{type:String,default:"HH:mm"},modelValue:String,disabled:Boolean,editable:{type:Boolean,default:!0},effect:{type:Ke(String),default:"light"},clearable:{type:Boolean,default:!0},size:cl,placeholder:String,start:{type:String,default:"09:00"},end:{type:String,default:"18:00"},step:{type:String,default:"00:30"},minTime:String,maxTime:String,name:String,prefixIcon:{type:Ke([String,Object]),default:()=>PEe},clearIcon:{type:Ke([String,Object]),default:()=>Ob},...oM}),xv=n=>{const e=(n||"").split(":");if(e.length>=2){let t=Number.parseInt(e[0],10);const i=Number.parseInt(e[1],10),s=n.toUpperCase();return s.includes("AM")&&t===12?t=0:s.includes("PM")&&t!==12&&(t+=12),{hours:t,minutes:i}}return null},m9=(n,e)=>{const t=xv(n);if(!t)return-1;const i=xv(e);if(!i)return-1;const s=t.minutes+t.hours*60,o=i.minutes+i.hours*60;return s===o?0:s>o?1:-1},jde=n=>`${n}`.padStart(2,"0"),w1=n=>`${jde(n.hours)}:${jde(n.minutes)}`,Hdt=(n,e)=>{const t=xv(n);if(!t)return"";const i=xv(e);if(!i)return"";const s={hours:t.hours,minutes:t.minutes};return s.minutes+=i.minutes,s.hours+=i.hours,s.hours+=Math.floor(s.minutes/60),s.minutes=s.minutes%60,w1(s)},Vdt=$e({name:"ElTimeSelect"}),Udt=$e({...Vdt,props:Bdt,emits:["change","blur","focus","clear","update:modelValue"],setup(n,{expose:e}){const t=n;Mn.extend(Ste);const{Option:i}=V0,s=vt("input"),o=te(),r=gc(),{lang:a}=wi(),c=W(()=>t.modelValue),u=W(()=>{const y=xv(t.start);return y?w1(y):null}),d=W(()=>{const y=xv(t.end);return y?w1(y):null}),f=W(()=>{const y=xv(t.step);return y?w1(y):null}),g=W(()=>{const y=xv(t.minTime||"");return y?w1(y):null}),p=W(()=>{const y=xv(t.maxTime||"");return y?w1(y):null}),_=W(()=>{const y=[];if(t.start&&t.end&&t.step){let w=u.value,I;for(;w&&d.value&&m9(w,d.value)<=0;)I=Mn(w,"HH:mm").locale(a.value).format(t.format),y.push({value:I,disabled:m9(w,g.value||"-1:-1")<=0||m9(w,p.value||"100:100")>=0}),w=Hdt(w,f.value)}return y});return e({blur:()=>{var y,w;(w=(y=o.value)==null?void 0:y.blur)==null||w.call(y)},focus:()=>{var y,w;(w=(y=o.value)==null?void 0:y.focus)==null||w.call(y)}}),(y,w)=>(G(),nt(T(V0),{ref_key:"select",ref:o,"model-value":T(c),disabled:T(r),clearable:y.clearable,"clear-icon":y.clearIcon,size:y.size,effect:y.effect,placeholder:y.placeholder,"default-first-option":"",filterable:y.editable,"empty-values":y.emptyValues,"value-on-clear":y.valueOnClear,"onUpdate:modelValue":I=>y.$emit("update:modelValue",I),onChange:I=>y.$emit("change",I),onBlur:I=>y.$emit("blur",I),onFocus:I=>y.$emit("focus",I),onClear:()=>y.$emit("clear")},{prefix:_e(()=>[y.prefixIcon?(G(),nt(T(tn),{key:0,class:Y(T(s).e("prefix-icon"))},{default:_e(()=>[(G(),nt(ui(y.prefixIcon)))]),_:1},8,["class"])):Qe("v-if",!0)]),default:_e(()=>[(G(!0),he(Qt,null,fi(T(_),I=>(G(),nt(T(i),{key:I.value,label:I.value,value:I.value,disabled:I.disabled},null,8,["label","value","disabled"]))),128))]),_:1},8,["model-value","disabled","clearable","clear-icon","size","effect","placeholder","filterable","empty-values","value-on-clear","onUpdate:modelValue","onChange","onBlur","onFocus","onClear"]))}});var Wdt=Rt(Udt,[["__file","time-select.vue"]]);const Gdt=Nn(Wdt),zdt=$e({name:"ElTimeline",setup(n,{slots:e}){const t=vt("timeline");return pi("timeline",e),()=>hn("ul",{class:[t.b()]},[Ye(e,"default")])}}),Kdt=Lt({timestamp:{type:String,default:""},hideTimestamp:Boolean,center:Boolean,placement:{type:String,values:["top","bottom"],default:"bottom"},type:{type:String,values:["primary","success","warning","danger","info"],default:""},color:{type:String,default:""},size:{type:String,values:["normal","large"],default:"normal"},icon:{type:ks},hollow:Boolean}),jdt=$e({name:"ElTimelineItem"}),Xdt=$e({...jdt,props:Kdt,setup(n){const e=n,t=vt("timeline-item"),i=W(()=>[t.e("node"),t.em("node",e.size||""),t.em("node",e.type||""),t.is("hollow",e.hollow)]);return(s,o)=>(G(),he("li",{class:Y([T(t).b(),{[T(t).e("center")]:s.center}])},[oe("div",{class:Y(T(t).e("tail"))},null,2),s.$slots.dot?Qe("v-if",!0):(G(),he("div",{key:0,class:Y(T(i)),style:on({backgroundColor:s.color})},[s.icon?(G(),nt(T(tn),{key:0,class:Y(T(t).e("icon"))},{default:_e(()=>[(G(),nt(ui(s.icon)))]),_:1},8,["class"])):Qe("v-if",!0)],6)),s.$slots.dot?(G(),he("div",{key:1,class:Y(T(t).e("dot"))},[Ye(s.$slots,"dot")],2)):Qe("v-if",!0),oe("div",{class:Y(T(t).e("wrapper"))},[!s.hideTimestamp&&s.placement==="top"?(G(),he("div",{key:0,class:Y([T(t).e("timestamp"),T(t).is("top")])},st(s.timestamp),3)):Qe("v-if",!0),oe("div",{class:Y(T(t).e("content"))},[Ye(s.$slots,"default")],2),!s.hideTimestamp&&s.placement==="bottom"?(G(),he("div",{key:1,class:Y([T(t).e("timestamp"),T(t).is("bottom")])},st(s.timestamp),3)):Qe("v-if",!0)],2)],2))}});var $we=Rt(Xdt,[["__file","timeline-item.vue"]]);const Ydt=Nn(zdt,{TimelineItem:$we}),qdt=Xo($we),xwe=Lt({nowrap:Boolean});var Pwe=(n=>(n.top="top",n.bottom="bottom",n.left="left",n.right="right",n))(Pwe||{});const Jdt=Object.values(Pwe),ene=Lt({width:{type:Number,default:10},height:{type:Number,default:10},style:{type:Ke(Object),default:null}}),Qdt=Lt({side:{type:Ke(String),values:Jdt,required:!0}}),Zdt=["absolute","fixed"],eht=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],tne=Lt({arrowPadding:{type:Ke(Number),default:5},effect:{type:Ke(String),default:"light"},contentClass:String,placement:{type:Ke(String),values:eht,default:"bottom"},reference:{type:Ke(Object),default:null},offset:{type:Number,default:8},strategy:{type:Ke(String),values:Zdt,default:"absolute"},showArrow:Boolean,...Wa(["ariaLabel"])}),nne=Lt({delayDuration:{type:Number,default:300},defaultOpen:Boolean,open:{type:Boolean,default:void 0},onOpenChange:{type:Ke(Function)},"onUpdate:open":{type:Ke(Function)}}),qL={type:Ke(Function)},ine=Lt({onBlur:qL,onClick:qL,onFocus:qL,onMouseDown:qL,onMouseEnter:qL,onMouseLeave:qL}),tht=Lt({...nne,...ene,...ine,...tne,alwaysOn:Boolean,fullTransition:Boolean,transitionProps:{type:Ke(Object),default:null},teleported:Boolean,to:{type:Ke(String),default:"body"}}),D8=Symbol("tooltipV2"),Fwe=Symbol("tooltipV2Content"),_9="tooltip_v2.open",nht=$e({name:"ElTooltipV2Root"}),iht=$e({...nht,props:nne,setup(n,{expose:e}){const t=n,i=te(t.defaultOpen),s=te(null),o=W({get:()=>F0(t.open)?i.value:t.open,set:C=>{var y;i.value=C,(y=t["onUpdate:open"])==null||y.call(t,C)}}),r=W(()=>gn(t.delayDuration)&&t.delayDuration>0),{start:a,stop:c}=B0(()=>{o.value=!0},W(()=>t.delayDuration),{immediate:!1}),u=vt("tooltip-v2"),d=Va(),f=()=>{c(),o.value=!0},g=()=>{T(r)?a():f()},p=f,_=()=>{c(),o.value=!1};return ht(o,C=>{var y;C&&(document.dispatchEvent(new CustomEvent(_9)),p()),(y=t.onOpenChange)==null||y.call(t,C)}),$n(()=>{document.addEventListener(_9,_)}),As(()=>{c(),document.removeEventListener(_9,_)}),pi(D8,{contentId:d,triggerRef:s,ns:u,onClose:_,onDelayOpen:g,onOpen:p}),e({onOpen:p,onClose:_}),(C,y)=>Ye(C.$slots,"default",{open:T(o)})}});var sht=Rt(iht,[["__file","root.vue"]]);const oht=$e({name:"ElTooltipV2Arrow"}),rht=$e({...oht,props:{...ene,...Qdt},setup(n){const e=n,{ns:t}=Kt(D8),{arrowRef:i}=Kt(Fwe),s=W(()=>{const{style:o,width:r,height:a}=e,c=t.namespace.value;return{[`--${c}-tooltip-v2-arrow-width`]:`${r}px`,[`--${c}-tooltip-v2-arrow-height`]:`${a}px`,[`--${c}-tooltip-v2-arrow-border-width`]:`${r/2}px`,[`--${c}-tooltip-v2-arrow-cover-width`]:r/2-1,...o||{}}});return(o,r)=>(G(),he("span",{ref_key:"arrowRef",ref:i,style:on(T(s)),class:Y(T(t).e("arrow"))},null,6))}});var Xde=Rt(rht,[["__file","arrow.vue"]]);const oR=Math.min,u0=Math.max,RW=Math.round,$H=Math.floor,xm=n=>({x:n,y:n}),lht={left:"right",right:"left",bottom:"top",top:"bottom"},aht={start:"end",end:"start"};function rY(n,e,t){return u0(n,oR(e,t))}function hF(n,e){return typeof n=="function"?n(e):n}function W0(n){return n.split("-")[0]}function fF(n){return n.split("-")[1]}function Bwe(n){return n==="x"?"y":"x"}function sne(n){return n==="y"?"height":"width"}function rR(n){return["top","bottom"].includes(W0(n))?"y":"x"}function one(n){return Bwe(rR(n))}function cht(n,e,t){t===void 0&&(t=!1);const i=fF(n),s=one(n),o=sne(s);let r=s==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=MW(r)),[r,MW(r)]}function uht(n){const e=MW(n);return[lY(n),e,lY(e)]}function lY(n){return n.replace(/start|end/g,e=>aht[e])}function dht(n,e,t){const i=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(n){case"top":case"bottom":return t?e?s:i:e?i:s;case"left":case"right":return e?o:r;default:return[]}}function hht(n,e,t,i){const s=fF(n);let o=dht(W0(n),t==="start",i);return s&&(o=o.map(r=>r+"-"+s),e&&(o=o.concat(o.map(lY)))),o}function MW(n){return n.replace(/left|right|bottom|top/g,e=>lht[e])}function fht(n){return{top:0,right:0,bottom:0,left:0,...n}}function Hwe(n){return typeof n!="number"?fht(n):{top:n,right:n,bottom:n,left:n}}function kW(n){const{x:e,y:t,width:i,height:s}=n;return{width:i,height:s,top:t,left:e,right:e+i,bottom:t+s,x:e,y:t}}function Yde(n,e,t){let{reference:i,floating:s}=n;const o=rR(e),r=one(e),a=sne(r),c=W0(e),u=o==="y",d=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,g=i[a]/2-s[a]/2;let p;switch(c){case"top":p={x:d,y:i.y-s.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-s.width,y:f};break;default:p={x:i.x,y:i.y}}switch(fF(e)){case"start":p[r]-=g*(t&&u?-1:1);break;case"end":p[r]+=g*(t&&u?-1:1);break}return p}const ght=async(n,e,t)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=t,a=o.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let u=await r.getElementRects({reference:n,floating:e,strategy:s}),{x:d,y:f}=Yde(u,i,c),g=i,p={},_=0;for(let v=0;v<a.length;v++){const{name:C,fn:y}=a[v],{x:w,y:I,data:L,reset:O}=await y({x:d,y:f,initialPlacement:i,placement:g,strategy:s,middlewareData:p,rects:u,platform:r,elements:{reference:n,floating:e}});d=w??d,f=I??f,p={...p,[C]:{...p[C],...L}},O&&_<=50&&(_++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(u=O.rects===!0?await r.getElementRects({reference:n,floating:e,strategy:s}):O.rects),{x:d,y:f}=Yde(u,g,c)),v=-1)}return{x:d,y:f,placement:g,strategy:s,middlewareData:p}};async function rne(n,e){var t;e===void 0&&(e={});const{x:i,y:s,platform:o,rects:r,elements:a,strategy:c}=n,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=hF(e,n),_=Hwe(p),C=a[g?f==="floating"?"reference":"floating":f],y=kW(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(C)))==null||t?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),L=await(o.isElement==null?void 0:o.isElement(I))?await(o.getScale==null?void 0:o.getScale(I))||{x:1,y:1}:{x:1,y:1},O=kW(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:I,strategy:c}):w);return{top:(y.top-O.top+_.top)/L.y,bottom:(O.bottom-y.bottom+_.bottom)/L.y,left:(y.left-O.left+_.left)/L.x,right:(O.right-y.right+_.right)/L.x}}const pht=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:s,rects:o,platform:r,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=hF(n,e)||{};if(u==null)return{};const f=Hwe(d),g={x:t,y:i},p=one(s),_=sne(p),v=await r.getDimensions(u),C=p==="y",y=C?"top":"left",w=C?"bottom":"right",I=C?"clientHeight":"clientWidth",L=o.reference[_]+o.reference[p]-g[p]-o.floating[_],O=g[p]-o.reference[p],A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let N=A?A[I]:0;(!N||!await(r.isElement==null?void 0:r.isElement(A)))&&(N=a.floating[I]||o.floating[_]);const D=L/2-O/2,P=N/2-v[_]/2-1,F=oR(f[y],P),V=oR(f[w],P),U=F,Q=N-v[_]-V,de=N/2-v[_]/2+D,q=rY(U,de,Q),K=!c.arrow&&fF(s)!=null&&de!==q&&o.reference[_]/2-(de<U?F:V)-v[_]/2<0,re=K?de<U?de-U:de-Q:0;return{[p]:g[p]+re,data:{[p]:q,centerOffset:de-q-re,...K&&{alignmentOffset:re}},reset:K}}}),mht=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:v=!0,...C}=hF(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const y=W0(s),w=rR(a),I=W0(a)===a,L=await(c.isRTL==null?void 0:c.isRTL(u.floating)),O=g||(I||!v?[MW(a)]:uht(a)),A=_!=="none";!g&&A&&O.push(...hht(a,v,_,L));const N=[a,...O],D=await rne(e,C),P=[];let F=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&P.push(D[y]),f){const de=cht(s,r,L);P.push(D[de[0]],D[de[1]])}if(F=[...F,{placement:s,overflows:P}],!P.every(de=>de<=0)){var V,U;const de=(((V=o.flip)==null?void 0:V.index)||0)+1,q=N[de];if(q)return{data:{index:de,overflows:F},reset:{placement:q}};let K=(U=F.filter(re=>re.overflows[0]<=0).sort((re,Z)=>re.overflows[1]-Z.overflows[1])[0])==null?void 0:U.placement;if(!K)switch(p){case"bestFit":{var Q;const re=(Q=F.filter(Z=>{if(A){const J=rR(Z.placement);return J===w||J==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(J=>J>0).reduce((J,ge)=>J+ge,0)]).sort((Z,J)=>Z[1]-J[1])[0])==null?void 0:Q[0];re&&(K=re);break}case"initialPlacement":K=a;break}if(s!==K)return{reset:{placement:K}}}return{}}}};async function _ht(n,e){const{placement:t,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=W0(t),a=fF(t),c=rR(t)==="y",u=["left","top"].includes(r)?-1:1,d=o&&c?-1:1,f=hF(e,n);let{mainAxis:g,crossAxis:p,alignmentAxis:_}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof _=="number"&&(p=a==="end"?_*-1:_),c?{x:p*d,y:g*u}:{x:g*u,y:p*d}}const vht=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:s,y:o,placement:r,middlewareData:a}=e,c=await _ht(e,n);return r===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:r}}}}},bht=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:s}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:C=>{let{x:y,y:w}=C;return{x:y,y:w}}},...c}=hF(n,e),u={x:t,y:i},d=await rne(e,c),f=rR(W0(s)),g=Bwe(f);let p=u[g],_=u[f];if(o){const C=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=p+d[C],I=p-d[y];p=rY(w,p,I)}if(r){const C=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=_+d[C],I=_-d[y];_=rY(w,_,I)}const v=a.fn({...e,[g]:p,[f]:_});return{...v,data:{x:v.x-t,y:v.y-i,enabled:{[g]:o,[f]:r}}}}}};function $8(){return typeof window<"u"}function uM(n){return Vwe(n)?(n.nodeName||"").toLowerCase():"#document"}function _h(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function u_(n){var e;return(e=(Vwe(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Vwe(n){return $8()?n instanceof Node||n instanceof _h(n).Node:!1}function ep(n){return $8()?n instanceof Element||n instanceof _h(n).Element:!1}function jm(n){return $8()?n instanceof HTMLElement||n instanceof _h(n).HTMLElement:!1}function qde(n){return!$8()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof _h(n).ShadowRoot}function gF(n){const{overflow:e,overflowX:t,overflowY:i,display:s}=tp(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(s)}function Tht(n){return["table","td","th"].includes(uM(n))}function x8(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function lne(n){const e=ane(),t=ep(n)?tp(n):n;return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(t.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(t.contain||"").includes(i))}function Cht(n){let e=iy(n);for(;jm(e)&&!lR(e);){if(lne(e))return e;if(x8(e))return null;e=iy(e)}return null}function ane(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function lR(n){return["html","body","#document"].includes(uM(n))}function tp(n){return _h(n).getComputedStyle(n)}function P8(n){return ep(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function iy(n){if(uM(n)==="html")return n;const e=n.assignedSlot||n.parentNode||qde(n)&&n.host||u_(n);return qde(e)?e.host:e}function Uwe(n){const e=iy(n);return lR(e)?n.ownerDocument?n.ownerDocument.body:n.body:jm(e)&&gF(e)?e:Uwe(e)}function _x(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=Uwe(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),r=_h(s);if(o){const a=aY(r);return e.concat(r,r.visualViewport||[],gF(s)?s:[],a&&t?_x(a):[])}return e.concat(s,_x(s,[],t))}function aY(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Wwe(n){const e=tp(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=jm(n),o=s?n.offsetWidth:t,r=s?n.offsetHeight:i,a=RW(t)!==o||RW(i)!==r;return a&&(t=o,i=r),{width:t,height:i,$:a}}function cne(n){return ep(n)?n:n.contextElement}function hO(n){const e=cne(n);if(!jm(e))return xm(1);const t=e.getBoundingClientRect(),{width:i,height:s,$:o}=Wwe(e);let r=(o?RW(t.width):t.width)/i,a=(o?RW(t.height):t.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const yht=xm(0);function Gwe(n){const e=_h(n);return!ane()||!e.visualViewport?yht:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Eht(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==_h(n)?!1:e}function G0(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=n.getBoundingClientRect(),o=cne(n);let r=xm(1);e&&(i?ep(i)&&(r=hO(i)):r=hO(n));const a=Eht(o,t,i)?Gwe(o):xm(0);let c=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,d=s.width/r.x,f=s.height/r.y;if(o){const g=_h(o),p=i&&ep(i)?_h(i):i;let _=g,v=aY(_);for(;v&&i&&p!==_;){const C=hO(v),y=v.getBoundingClientRect(),w=tp(v),I=y.left+(v.clientLeft+parseFloat(w.paddingLeft))*C.x,L=y.top+(v.clientTop+parseFloat(w.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=I,u+=L,_=_h(v),v=aY(_)}}return kW({width:d,height:f,x:c,y:u})}function une(n,e){const t=P8(n).scrollLeft;return e?e.left+t:G0(u_(n)).left+t}function zwe(n,e,t){t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=i.left+e.scrollLeft-(t?0:une(n,i)),o=i.top+e.scrollTop;return{x:s,y:o}}function Sht(n){let{elements:e,rect:t,offsetParent:i,strategy:s}=n;const o=s==="fixed",r=u_(i),a=e?x8(e.floating):!1;if(i===r||a&&o)return t;let c={scrollLeft:0,scrollTop:0},u=xm(1);const d=xm(0),f=jm(i);if((f||!f&&!o)&&((uM(i)!=="body"||gF(r))&&(c=P8(i)),jm(i))){const p=G0(i);u=hO(i),d.x=p.x+i.clientLeft,d.y=p.y+i.clientTop}const g=r&&!f&&!o?zwe(r,c,!0):xm(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+d.x+g.x,y:t.y*u.y-c.scrollTop*u.y+d.y+g.y}}function wht(n){return Array.from(n.getClientRects())}function Iht(n){const e=u_(n),t=P8(n),i=n.ownerDocument.body,s=u0(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=u0(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-t.scrollLeft+une(n);const a=-t.scrollTop;return tp(i).direction==="rtl"&&(r+=u0(e.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:a}}function Lht(n,e){const t=_h(n),i=u_(n),s=t.visualViewport;let o=i.clientWidth,r=i.clientHeight,a=0,c=0;if(s){o=s.width,r=s.height;const u=ane();(!u||u&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:o,height:r,x:a,y:c}}function Oht(n,e){const t=G0(n,!0,e==="fixed"),i=t.top+n.clientTop,s=t.left+n.clientLeft,o=jm(n)?hO(n):xm(1),r=n.clientWidth*o.x,a=n.clientHeight*o.y,c=s*o.x,u=i*o.y;return{width:r,height:a,x:c,y:u}}function Jde(n,e,t){let i;if(e==="viewport")i=Lht(n,t);else if(e==="document")i=Iht(u_(n));else if(ep(e))i=Oht(e,t);else{const s=Gwe(n);i={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return kW(i)}function Kwe(n,e){const t=iy(n);return t===e||!ep(t)||lR(t)?!1:tp(t).position==="fixed"||Kwe(t,e)}function Rht(n,e){const t=e.get(n);if(t)return t;let i=_x(n,[],!1).filter(a=>ep(a)&&uM(a)!=="body"),s=null;const o=tp(n).position==="fixed";let r=o?iy(n):n;for(;ep(r)&&!lR(r);){const a=tp(r),c=lne(r);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||gF(r)&&!c&&Kwe(n,r))?i=i.filter(d=>d!==r):s=a,r=iy(r)}return e.set(n,i),i}function Mht(n){let{element:e,boundary:t,rootBoundary:i,strategy:s}=n;const r=[...t==="clippingAncestors"?x8(e)?[]:Rht(e,this._c):[].concat(t),i],a=r[0],c=r.reduce((u,d)=>{const f=Jde(e,d,s);return u.top=u0(f.top,u.top),u.right=oR(f.right,u.right),u.bottom=oR(f.bottom,u.bottom),u.left=u0(f.left,u.left),u},Jde(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function kht(n){const{width:e,height:t}=Wwe(n);return{width:e,height:t}}function Aht(n,e,t){const i=jm(e),s=u_(e),o=t==="fixed",r=G0(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=xm(0);if(i||!i&&!o)if((uM(e)!=="body"||gF(s))&&(a=P8(e)),i){const g=G0(e,!0,o,e);c.x=g.x+e.clientLeft,c.y=g.y+e.clientTop}else s&&(c.x=une(s));const u=s&&!i&&!o?zwe(s,a):xm(0),d=r.left+a.scrollLeft-c.x-u.x,f=r.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:r.width,height:r.height}}function v9(n){return tp(n).position==="static"}function Qde(n,e){if(!jm(n)||tp(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return u_(n)===t&&(t=t.ownerDocument.body),t}function jwe(n,e){const t=_h(n);if(x8(n))return t;if(!jm(n)){let s=iy(n);for(;s&&!lR(s);){if(ep(s)&&!v9(s))return s;s=iy(s)}return t}let i=Qde(n,e);for(;i&&Tht(i)&&v9(i);)i=Qde(i,e);return i&&lR(i)&&v9(i)&&!lne(i)?t:i||Cht(n)||t}const Nht=async function(n){const e=this.getOffsetParent||jwe,t=this.getDimensions,i=await t(n.floating);return{reference:Aht(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Dht(n){return tp(n).direction==="rtl"}const $ht={convertOffsetParentRelativeRectToViewportRelativeRect:Sht,getDocumentElement:u_,getClippingRect:Mht,getOffsetParent:jwe,getElementRects:Nht,getClientRects:wht,getDimensions:kht,getScale:hO,isElement:ep,isRTL:Dht};function xht(n,e){let t=null,i;const s=u_(n);function o(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const{left:u,top:d,width:f,height:g}=n.getBoundingClientRect();if(a||e(),!f||!g)return;const p=$H(d),_=$H(s.clientWidth-(u+f)),v=$H(s.clientHeight-(d+g)),C=$H(u),w={rootMargin:-p+"px "+-_+"px "+-v+"px "+-C+"px",threshold:u0(0,oR(1,c))||1};let I=!0;function L(O){const A=O[0].intersectionRatio;if(A!==c){if(!I)return r();A?r(!1,A):i=setTimeout(()=>{r(!1,1e-7)},1e3)}I=!1}try{t=new IntersectionObserver(L,{...w,root:s.ownerDocument})}catch{t=new IntersectionObserver(L,w)}t.observe(n)}return r(!0),o}function Pht(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=cne(n),d=s||o?[...u?_x(u):[],..._x(e)]:[];d.forEach(y=>{s&&y.addEventListener("scroll",t,{passive:!0}),o&&y.addEventListener("resize",t)});const f=u&&a?xht(u,t):null;let g=-1,p=null;r&&(p=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var I;(I=p)==null||I.observe(e)})),t()}),u&&!c&&p.observe(u),p.observe(e));let _,v=c?G0(n):null;c&&C();function C(){const y=G0(n);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&t(),v=y,_=requestAnimationFrame(C)}return t(),()=>{var y;d.forEach(w=>{s&&w.removeEventListener("scroll",t),o&&w.removeEventListener("resize",t)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(_)}}const Fht=rne,Xwe=vht,Bht=bht,Hht=mht,Ywe=pht,qwe=(n,e,t)=>{const i=new Map,s={platform:$ht,...t},o={...s.platform,_c:i};return ght(n,e,{...s,platform:o})},Vht=Lt({style:{type:Ke([String,Object,Array]),default:()=>({})}}),Uht=$e({name:"ElVisuallyHidden"}),Wht=$e({...Uht,props:Vht,setup(n){const e=n,t=W(()=>[e.style,{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}]);return(i,s)=>(G(),he("span",hi(i.$attrs,{style:T(t)}),[Ye(i.$slots,"default")],16))}});var Ght=Rt(Wht,[["__file","visual-hidden.vue"]]);Lt({});const zht=n=>{if(!Si)return;if(!n)return n;const e=Ou(n);return e||(Ss(n)?e:n)},Kht=({middleware:n,placement:e,strategy:t})=>{const i=te(),s=te(),o=te(),r=te(),a=te({}),c={x:o,y:r,placement:e,strategy:t,middlewareData:a},u=async()=>{if(!Si)return;const d=zht(i),f=Ou(s);if(!d||!f)return;const g=await qwe(d,f,{placement:T(e),strategy:T(t),middleware:T(n)});YO(c).forEach(p=>{c[p].value=g[p]})};return $n(()=>{Sl(()=>{u()})}),{...c,update:u,referenceRef:i,contentRef:s}},jht=({arrowRef:n,padding:e})=>({name:"arrow",options:{element:n,padding:e},fn(t){const i=T(n);return i?Ywe({element:i,padding:e}).fn(t):{}}}),Xht=$e({name:"ElTooltipV2Content"}),Yht=$e({...Xht,props:{...tne,...xwe},setup(n){const e=n,{triggerRef:t,contentId:i}=Kt(D8),s=te(e.placement),o=te(e.strategy),r=te(null),{referenceRef:a,contentRef:c,middlewareData:u,x:d,y:f,update:g}=Kht({placement:s,strategy:o,middleware:W(()=>{const I=[Xwe(e.offset)];return e.showArrow&&I.push(jht({arrowRef:r})),I})}),p=sM().nextZIndex(),_=vt("tooltip-v2"),v=W(()=>s.value.split("-")[0]),C=W(()=>({position:T(o),top:`${T(f)||0}px`,left:`${T(d)||0}px`,zIndex:p})),y=W(()=>{if(!e.showArrow)return{};const{arrow:I}=T(u);return{[`--${_.namespace.value}-tooltip-v2-arrow-x`]:`${I==null?void 0:I.x}px`||"",[`--${_.namespace.value}-tooltip-v2-arrow-y`]:`${I==null?void 0:I.y}px`||""}}),w=W(()=>[_.e("content"),_.is("dark",e.effect==="dark"),_.is(T(o)),e.contentClass]);return ht(r,()=>g()),ht(()=>e.placement,I=>s.value=I),$n(()=>{ht(()=>e.reference||t.value,I=>{a.value=I||void 0},{immediate:!0})}),pi(Fwe,{arrowRef:r}),(I,L)=>(G(),he("div",{ref_key:"contentRef",ref:c,style:on(T(C)),"data-tooltip-v2-root":""},[I.nowrap?Qe("v-if",!0):(G(),he("div",{key:0,"data-side":T(v),class:Y(T(w))},[Ye(I.$slots,"default",{contentStyle:T(C),contentClass:T(w)}),ce(T(Ght),{id:T(i),role:"tooltip"},{default:_e(()=>[I.ariaLabel?(G(),he(Qt,{key:0},[mn(st(I.ariaLabel),1)],64)):Ye(I.$slots,"default",{key:1})]),_:3},8,["id"]),Ye(I.$slots,"arrow",{style:on(T(y)),side:T(v)})],10,["data-side"]))],4))}});var Zde=Rt(Yht,[["__file","content.vue"]]);const qht=Lt({setRef:{type:Ke(Function),required:!0},onlyChild:Boolean});var Jht=$e({props:qht,setup(n,{slots:e}){const t=te(),i=R8(t,s=>{s?n.setRef(s.nextElementSibling):n.setRef(null)});return()=>{var s;const[o]=((s=e.default)==null?void 0:s.call(e))||[],r=n.onlyChild?iQe(o.children):o.children;return ce(Qt,{ref:i},[r])}}});const Qht=$e({name:"ElTooltipV2Trigger"}),Zht=$e({...Qht,props:{...xwe,...ine},setup(n){const e=n,{onClose:t,onOpen:i,onDelayOpen:s,triggerRef:o,contentId:r}=Kt(D8);let a=!1;const c=w=>{o.value=w},u=()=>{a=!1},d=pr(e.onMouseEnter,s),f=pr(e.onMouseLeave,t),g=pr(e.onMouseDown,()=>{t(),a=!0,document.addEventListener("mouseup",u,{once:!0})}),p=pr(e.onFocus,()=>{a||i()}),_=pr(e.onBlur,t),v=pr(e.onClick,w=>{w.detail===0&&t()}),C={blur:_,click:v,focus:p,mousedown:g,mouseenter:d,mouseleave:f},y=(w,I,L)=>{w&&Object.entries(I).forEach(([O,A])=>{w[L](O,A)})};return ht(o,(w,I)=>{y(w,C,"addEventListener"),y(I,C,"removeEventListener"),w&&w.setAttribute("aria-describedby",r.value)}),As(()=>{y(o.value,C,"removeEventListener"),document.removeEventListener("mouseup",u)}),(w,I)=>w.nowrap?(G(),nt(T(Jht),{key:0,"set-ref":c,"only-child":""},{default:_e(()=>[Ye(w.$slots,"default")]),_:3})):(G(),he("button",hi({key:1,ref_key:"triggerRef",ref:o},w.$attrs),[Ye(w.$slots,"default")],16))}});var eft=Rt(Zht,[["__file","trigger.vue"]]);const tft=$e({name:"ElTooltipV2"}),nft=$e({...tft,props:tht,setup(n){const t=Gl(n),i=Ki($g(t,Object.keys(ene))),s=Ki($g(t,Object.keys(tne))),o=Ki($g(t,Object.keys(nne))),r=Ki($g(t,Object.keys(ine)));return(a,c)=>(G(),nt(sht,wf(nb(o)),{default:_e(({open:u})=>[ce(eft,hi(r,{nowrap:""}),{default:_e(()=>[Ye(a.$slots,"trigger")]),_:3},16),ce(T(lM),{to:a.to,disabled:!a.teleported},{default:_e(()=>[a.fullTransition?(G(),nt(Ta,wf(hi({key:0},a.transitionProps)),{default:_e(()=>[a.alwaysOn||u?(G(),nt(Zde,wf(hi({key:0},s)),{arrow:_e(({style:d,side:f})=>[a.showArrow?(G(),nt(Xde,hi({key:0},i,{style:d,side:f}),null,16,["style","side"])):Qe("v-if",!0)]),default:_e(()=>[Ye(a.$slots,"default")]),_:3},16)):Qe("v-if",!0)]),_:2},1040)):(G(),he(Qt,{key:1},[a.alwaysOn||u?(G(),nt(Zde,wf(hi({key:0},s)),{arrow:_e(({style:d,side:f})=>[a.showArrow?(G(),nt(Xde,hi({key:0},i,{style:d,side:f}),null,16,["style","side"])):Qe("v-if",!0)]),default:_e(()=>[Ye(a.$slots,"default")]),_:3},16)):Qe("v-if",!0)],64))]),_:2},1032,["to","disabled"])]),_:3},16))}});var ift=Rt(nft,[["__file","tooltip.vue"]]);const sft=Nn(ift),Jwe="left-check-change",Qwe="right-check-change",I1=Lt({data:{type:Ke(Array),default:()=>[]},titles:{type:Ke(Array),default:()=>[]},buttonTexts:{type:Ke(Array),default:()=>[]},filterPlaceholder:String,filterMethod:{type:Ke(Function)},leftDefaultChecked:{type:Ke(Array),default:()=>[]},rightDefaultChecked:{type:Ke(Array),default:()=>[]},renderContent:{type:Ke(Function)},modelValue:{type:Ke(Array),default:()=>[]},format:{type:Ke(Object),default:()=>({})},filterable:Boolean,props:{type:Ke(Object),default:()=>Ko({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},validateEvent:{type:Boolean,default:!0}}),cY=(n,e)=>[n,e].every(yt)||yt(n)&&Ul(e),oft={[Ms]:(n,e,t)=>[n,t].every(yt)&&["left","right"].includes(e),[Kn]:n=>yt(n),[Jwe]:cY,[Qwe]:cY},uY="checked-change",rft=Lt({data:I1.data,optionRender:{type:Ke(Function)},placeholder:String,title:String,filterable:Boolean,format:I1.format,filterMethod:I1.filterMethod,defaultChecked:I1.leftDefaultChecked,props:I1.props}),lft={[uY]:cY},pF=n=>{const e={label:"label",key:"key",disabled:"disabled"};return W(()=>({...e,...n.props}))},aft=(n,e,t)=>{const i=pF(n),s=W(()=>n.data.filter(d=>ln(n.filterMethod)?n.filterMethod(e.query,d):String(d[i.value.label]||d[i.value.key]).toLowerCase().includes(e.query.toLowerCase()))),o=W(()=>s.value.filter(d=>!d[i.value.disabled])),r=W(()=>{const d=e.checked.length,f=n.data.length,{noChecked:g,hasChecked:p}=n.format;return g&&p?d>0?p.replace(/\${checked}/g,d.toString()).replace(/\${total}/g,f.toString()):g.replace(/\${total}/g,f.toString()):`${d}/${f}`}),a=W(()=>{const d=e.checked.length;return d>0&&d<o.value.length}),c=()=>{const d=o.value.map(f=>f[i.value.key]);e.allChecked=d.length>0&&d.every(f=>e.checked.includes(f))},u=d=>{e.checked=d?o.value.map(f=>f[i.value.key]):[]};return ht(()=>e.checked,(d,f)=>{if(c(),e.checkChangeByUser){const g=d.concat(f).filter(p=>!d.includes(p)||!f.includes(p));t(uY,d,g)}else t(uY,d),e.checkChangeByUser=!0}),ht(o,()=>{c()}),ht(()=>n.data,()=>{const d=[],f=s.value.map(g=>g[i.value.key]);e.checked.forEach(g=>{f.includes(g)&&d.push(g)}),e.checkChangeByUser=!1,e.checked=d}),ht(()=>n.defaultChecked,(d,f)=>{if(f&&d.length===f.length&&d.every(_=>f.includes(_)))return;const g=[],p=o.value.map(_=>_[i.value.key]);d.forEach(_=>{p.includes(_)&&g.push(_)}),e.checkChangeByUser=!1,e.checked=g},{immediate:!0}),{filteredData:s,checkableData:o,checkedSummary:r,isIndeterminate:a,updateAllChecked:c,handleAllCheckedChange:u}},cft=$e({name:"ElTransferPanel"}),uft=$e({...cft,props:rft,emits:lft,setup(n,{expose:e,emit:t}){const i=n,s=dl(),o=({option:I})=>I,{t:r}=wi(),a=vt("transfer"),c=Ki({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),u=pF(i),{filteredData:d,checkedSummary:f,isIndeterminate:g,handleAllCheckedChange:p}=aft(i,c,t),_=W(()=>!oh(c.query)&&oh(d.value)),v=W(()=>!oh(s.default()[0].children)),{checked:C,allChecked:y,query:w}=Gl(c);return e({query:w}),(I,L)=>(G(),he("div",{class:Y(T(a).b("panel"))},[oe("p",{class:Y(T(a).be("panel","header"))},[ce(T(Kf),{modelValue:T(y),"onUpdate:modelValue":O=>Ss(y)?y.value=O:null,indeterminate:T(g),"validate-event":!1,onChange:T(p)},{default:_e(()=>[mn(st(I.title)+" ",1),oe("span",null,st(T(f)),1)]),_:1},8,["modelValue","onUpdate:modelValue","indeterminate","onChange"])],2),oe("div",{class:Y([T(a).be("panel","body"),T(a).is("with-footer",T(v))])},[I.filterable?(G(),nt(T(Kc),{key:0,modelValue:T(w),"onUpdate:modelValue":O=>Ss(w)?w.value=O:null,class:Y(T(a).be("panel","filter")),size:"default",placeholder:I.placeholder,"prefix-icon":T(dje),clearable:"","validate-event":!1},null,8,["modelValue","onUpdate:modelValue","class","placeholder","prefix-icon"])):Qe("v-if",!0),Un(ce(T(NSe),{modelValue:T(C),"onUpdate:modelValue":O=>Ss(C)?C.value=O:null,"validate-event":!1,class:Y([T(a).is("filterable",I.filterable),T(a).be("panel","list")])},{default:_e(()=>[(G(!0),he(Qt,null,fi(T(d),O=>(G(),nt(T(Kf),{key:O[T(u).key],class:Y(T(a).be("panel","item")),value:O[T(u).key],disabled:O[T(u).disabled],"validate-event":!1},{default:_e(()=>{var A;return[ce(o,{option:(A=I.optionRender)==null?void 0:A.call(I,O)},null,8,["option"])]}),_:2},1032,["class","value","disabled"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","class"]),[[Gi,!T(_)&&!T(oh)(I.data)]]),Un(oe("div",{class:Y(T(a).be("panel","empty"))},[Ye(I.$slots,"empty",{},()=>[mn(st(T(_)?T(r)("el.transfer.noMatch"):T(r)("el.transfer.noData")),1)])],2),[[Gi,T(_)||T(oh)(I.data)]])],2),T(v)?(G(),he("p",{key:0,class:Y(T(a).be("panel","footer"))},[Ye(I.$slots,"default")],2)):Qe("v-if",!0)],2))}});var ehe=Rt(uft,[["__file","transfer-panel.vue"]]);const dft=n=>{const e=pF(n),t=W(()=>n.data.reduce((o,r)=>(o[r[e.value.key]]=r)&&o,{})),i=W(()=>n.data.filter(o=>!n.modelValue.includes(o[e.value.key]))),s=W(()=>n.targetOrder==="original"?n.data.filter(o=>n.modelValue.includes(o[e.value.key])):n.modelValue.reduce((o,r)=>{const a=t.value[r];return a&&o.push(a),o},[]));return{sourceData:i,targetData:s}},hft=(n,e,t)=>{const i=pF(n),s=(a,c,u)=>{t(Kn,a),t(Ms,a,c,u)};return{addToLeft:()=>{const a=n.modelValue.slice();e.rightChecked.forEach(c=>{const u=a.indexOf(c);u>-1&&a.splice(u,1)}),s(a,"left",e.rightChecked)},addToRight:()=>{let a=n.modelValue.slice();const c=n.data.filter(u=>{const d=u[i.value.key];return e.leftChecked.includes(d)&&!n.modelValue.includes(d)}).map(u=>u[i.value.key]);a=n.targetOrder==="unshift"?c.concat(a):a.concat(c),n.targetOrder==="original"&&(a=n.data.filter(u=>a.includes(u[i.value.key])).map(u=>u[i.value.key])),s(a,"right",e.leftChecked)}}},fft=(n,e)=>({onSourceCheckedChange:(s,o)=>{n.leftChecked=s,o&&e(Jwe,s,o)},onTargetCheckedChange:(s,o)=>{n.rightChecked=s,o&&e(Qwe,s,o)}}),gft=$e({name:"ElTransfer"}),pft=$e({...gft,props:I1,emits:oft,setup(n,{expose:e,emit:t}){const i=n,s=dl(),{t:o}=wi(),r=vt("transfer"),{formItem:a}=fc(),c=Ki({leftChecked:[],rightChecked:[]}),u=pF(i),{sourceData:d,targetData:f}=dft(i),{onSourceCheckedChange:g,onTargetCheckedChange:p}=fft(c,t),{addToLeft:_,addToRight:v}=hft(i,c,t),C=te(),y=te(),w=D=>{switch(D){case"left":C.value.query="";break;case"right":y.value.query="";break}},I=W(()=>i.buttonTexts.length===2),L=W(()=>i.titles[0]||o("el.transfer.titles.0")),O=W(()=>i.titles[1]||o("el.transfer.titles.1")),A=W(()=>i.filterPlaceholder||o("el.transfer.filterPlaceholder"));ht(()=>i.modelValue,()=>{var D;i.validateEvent&&((D=a==null?void 0:a.validate)==null||D.call(a,"change").catch(P=>void 0))});const N=W(()=>D=>{var P;if(i.renderContent)return i.renderContent(hn,D);const F=(((P=s.default)==null?void 0:P.call(s,{option:D}))||[]).filter(V=>V.type!==fa);return F.length?F:hn("span",D[u.value.label]||D[u.value.key])});return e({clearQuery:w,leftPanel:C,rightPanel:y}),(D,P)=>(G(),he("div",{class:Y(T(r).b())},[ce(ehe,{ref_key:"leftPanel",ref:C,data:T(d),"option-render":T(N),placeholder:T(A),title:T(L),filterable:D.filterable,format:D.format,"filter-method":D.filterMethod,"default-checked":D.leftDefaultChecked,props:i.props,onCheckedChange:T(g)},{empty:_e(()=>[Ye(D.$slots,"left-empty")]),default:_e(()=>[Ye(D.$slots,"left-footer")]),_:3},8,["data","option-render","placeholder","title","filterable","format","filter-method","default-checked","props","onCheckedChange"]),oe("div",{class:Y(T(r).e("buttons"))},[ce(T(_a),{type:"primary",class:Y([T(r).e("button"),T(r).is("with-texts",T(I))]),disabled:T(oh)(c.rightChecked),onClick:T(_)},{default:_e(()=>[ce(T(tn),null,{default:_e(()=>[ce(T(ZC))]),_:1}),T(ys)(D.buttonTexts[0])?Qe("v-if",!0):(G(),he("span",{key:0},st(D.buttonTexts[0]),1))]),_:1},8,["class","disabled","onClick"]),ce(T(_a),{type:"primary",class:Y([T(r).e("button"),T(r).is("with-texts",T(I))]),disabled:T(oh)(c.leftChecked),onClick:T(v)},{default:_e(()=>[T(ys)(D.buttonTexts[1])?Qe("v-if",!0):(G(),he("span",{key:0},st(D.buttonTexts[1]),1)),ce(T(tn),null,{default:_e(()=>[ce(T(Au))]),_:1})]),_:1},8,["class","disabled","onClick"])],2),ce(ehe,{ref_key:"rightPanel",ref:y,data:T(f),"option-render":T(N),placeholder:T(A),filterable:D.filterable,format:D.format,"filter-method":D.filterMethod,title:T(O),"default-checked":D.rightDefaultChecked,props:i.props,onCheckedChange:T(p)},{empty:_e(()=>[Ye(D.$slots,"right-empty")]),default:_e(()=>[Ye(D.$slots,"right-footer")]),_:3},8,["data","option-render","placeholder","filterable","format","filter-method","title","default-checked","props","onCheckedChange"])],2))}});var mft=Rt(pft,[["__file","transfer.vue"]]);const _ft=Nn(mft),fO="$treeNodeId",the=function(n,e){!e||e[fO]||Object.defineProperty(e,fO,{value:n.id,enumerable:!1,configurable:!1,writable:!1})},dne=function(n,e){return n?e[n]:e[fO]},dY=(n,e,t)=>{const i=n.value.currentNode;t();const s=n.value.currentNode;i!==s&&e("current-change",s?s.data:null,s)},hY=n=>{let e=!0,t=!0,i=!0;for(let s=0,o=n.length;s<o;s++){const r=n[s];(r.checked!==!0||r.indeterminate)&&(e=!1,r.disabled||(i=!1)),(r.checked!==!1||r.indeterminate)&&(t=!1)}return{all:e,none:t,allWithoutDisable:i,half:!e&&!t}},rD=function(n){if(n.childNodes.length===0||n.loading)return;const{all:e,none:t,half:i}=hY(n.childNodes);e?(n.checked=!0,n.indeterminate=!1):i?(n.checked=!1,n.indeterminate=!0):t&&(n.checked=!1,n.indeterminate=!1);const s=n.parent;!s||s.level===0||n.store.checkStrictly||rD(s)},xH=function(n,e){const t=n.store.props,i=n.data||{},s=t[e];if(ln(s))return s(i,n);if(sn(s))return i[s];if(ys(s)){const o=i[e];return o===void 0?"":o}};let vft=0,fY=class VU{constructor(e){this.id=vft++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const t in e)Wi(e,t)&&(this[t]=e[t]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const t=e.props;if(t&&typeof t.isLeaf<"u"){const o=xH(this,"isLeaf");Us(o)&&(this.isLeafByUser=o)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),yt(this.data)||the(this,this.data),!this.data)return;const i=e.defaultExpandedKeys,s=e.key;s&&i&&i.includes(this.key)&&this.expand(null,e.autoExpandParent),s&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){yt(e)||the(this,e),this.data=e,this.childNodes=[];let t;this.level===0&&yt(this.data)?t=this.data:t=xH(this,"children")||[];for(let i=0,s=t.length;i<s;i++)this.insertChild({data:t[i]})}get label(){return xH(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return xH(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}get previousSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}contains(e,t=!0){return(this.childNodes||[]).some(i=>i===e||t&&i.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,t,i){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof VU)){if(!i){const s=this.getChildren(!0);s.includes(e.data)||(ys(t)||t<0?s.push(e.data):s.splice(t,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=Ki(new VU(e)),e instanceof VU&&e.initialize()}e.level=this.level+1,ys(t)||t<0?this.childNodes.push(e):this.childNodes.splice(t,0,e),this.updateLeafState()}insertBefore(e,t){let i;t&&(i=this.childNodes.indexOf(t)),this.insertChild(e,i)}insertAfter(e,t){let i;t&&(i=this.childNodes.indexOf(t),i!==-1&&(i+=1)),this.insertChild(e,i)}removeChild(e){const t=this.getChildren()||[],i=t.indexOf(e.data);i>-1&&t.splice(i,1);const s=this.childNodes.indexOf(e);s>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(s,1)),this.updateLeafState()}removeChildByData(e){let t=null;for(let i=0;i<this.childNodes.length;i++)if(this.childNodes[i].data===e){t=this.childNodes[i];break}t&&this.removeChild(t)}expand(e,t){const i=()=>{if(t){let s=this.parent;for(;s.level>0;)s.expanded=!0,s=s.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(s=>{s.canFocus=!0})};this.shouldLoadData()?this.loadData(s=>{yt(s)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||rD(this),i())}):i()}doCreateChildren(e,t={}){e.forEach(i=>{this.insertChild(Object.assign({data:i},t),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,t,i,s){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:r,allWithoutDisable:a}=hY(this.childNodes);!this.isLeaf&&!r&&a&&(this.checked=!1,e=!1);const c=()=>{if(t){const u=this.childNodes;for(let g=0,p=u.length;g<p;g++){const _=u[g];s=s||e!==!1;const v=_.disabled?_.checked:s;_.setChecked(v,t,!0,s)}const{half:d,all:f}=hY(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),rD(this)},{checked:e!==!1});return}else c()}const o=this.parent;!o||o.level===0||i||rD(o)}getChildren(e=!1){if(this.level===0)return this.data;const t=this.data;if(!t)return null;const i=this.store.props;let s="children";return i&&(s=i.children||"children"),t[s]===void 0&&(t[s]=null),e&&!t[s]&&(t[s]=[]),t[s]}updateChildren(){const e=this.getChildren()||[],t=this.childNodes.map(o=>o.data),i={},s=[];e.forEach((o,r)=>{const a=o[fO];!!a&&t.findIndex(u=>u[fO]===a)>=0?i[a]={index:r,data:o}:s.push({index:r,data:o})}),this.store.lazy||t.forEach(o=>{i[o[fO]]||this.removeChildByData(o)}),s.forEach(({index:o,data:r})=>{this.insertChild({data:r},o)}),this.updateLeafState()}loadData(e,t={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(t).length)){this.loading=!0;const i=o=>{this.childNodes=[],this.doCreateChildren(o,t),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,o)},s=()=>{this.loading=!1};this.store.load(this,i,s)}else e&&e.call(this)}eachNode(e){const t=[this];for(;t.length;){const i=t.shift();t.unshift(...i.childNodes),e(i)}}reInitChecked(){this.store.checkStrictly||rD(this)}};class bft{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const t in e)Wi(e,t)&&(this[t]=e[t]);this.nodesMap={}}initialize(){if(this.root=new fY({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,t=>{this.root.doCreateChildren(t),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const t=this.filterNodeMethod,i=this.lazy,s=function(o){const r=o.root?o.root.childNodes:o.childNodes;if(r.forEach(a=>{a.visible=t.call(a,e,a.data,a),s(a)}),!o.visible&&r.length){let a=!0;a=!r.some(c=>c.visible),o.root?o.root.visible=a===!1:o.visible=a===!1}e&&o.visible&&!o.isLeaf&&(!i||o.loaded)&&o.expand()};s(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes(),this.setCurrentNodeKey(this.currentNodeKey)):this.root.updateChildren()}getNode(e){if(e instanceof fY)return e;const t=si(e)?dne(this.key,e):e;return this.nodesMap[t]||null}insertBefore(e,t){const i=this.getNode(t);i.parent.insertBefore({data:e},i)}insertAfter(e,t){const i=this.getNode(t);i.parent.insertAfter({data:e},i)}remove(e){const t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))}append(e,t){const i=F0(t)?this.root:this.getNode(t);i&&i.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],t=this.nodesMap;e.forEach(i=>{const s=t[i];s&&s.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const t=this.key;!e||!e.data||(t?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(i=>{this.deregisterNode(i)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,t=!1){const i=[],s=function(o){(o.root?o.root.childNodes:o.childNodes).forEach(a=>{(a.checked||t&&a.indeterminate)&&(!e||e&&a.isLeaf)&&i.push(a.data),s(a)})};return s(this),i}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(t=>(t||{})[this.key])}getHalfCheckedNodes(){const e=[],t=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(o=>{o.indeterminate&&e.push(o.data),t(o)})};return t(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],t=this.nodesMap;for(const i in t)Wi(t,i)&&e.push(t[i]);return e}updateChildren(e,t){const i=this.nodesMap[e];if(!i)return;const s=i.childNodes;for(let o=s.length-1;o>=0;o--){const r=s[o];this.remove(r.data)}for(let o=0,r=t.length;o<r;o++){const a=t[o];this.append(a,i.data)}}_setCheckedKeys(e,t=!1,i){const s=this._getAllNodes().sort((c,u)=>c.level-u.level),o=Object.create(null),r=Object.keys(i);s.forEach(c=>c.setChecked(!1,!1));const a=c=>{c.childNodes.forEach(u=>{var d;o[u.data[e]]=!0,(d=u.childNodes)!=null&&d.length&&a(u)})};for(let c=0,u=s.length;c<u;c++){const d=s[c],f=d.data[e].toString();if(!r.includes(f)){d.checked&&!o[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&a(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),t){d.setChecked(!1,!1);const p=function(_){_.childNodes.forEach(C=>{C.isLeaf||C.setChecked(!1,!1),p(C)})};p(d)}}}setCheckedNodes(e,t=!1){const i=this.key,s={};e.forEach(o=>{s[(o||{})[i]]=!0}),this._setCheckedKeys(i,t,s)}setCheckedKeys(e,t=!1){this.defaultCheckedKeys=e;const i=this.key,s={};e.forEach(o=>{s[o]=!0}),this._setCheckedKeys(i,t,s)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(t=>{const i=this.getNode(t);i&&i.expand(null,this.autoExpandParent)})}setChecked(e,t,i){const s=this.getNode(e);s&&s.setChecked(!!t,i)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,t=!0){const i=e[this.key],s=this.nodesMap[i];this.setCurrentNode(s),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,t=!0){if(this.currentNodeKey=e,e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const i=this.getNode(e);i&&(this.setCurrentNode(i),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const Tft=$e({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(n){const e=vt("tree"),t=Kt("NodeInstance"),i=Kt("RootTree");return()=>{const s=n.node,{data:o,store:r}=s;return n.renderContent?n.renderContent(hn,{_self:t,node:s,data:o,store:r}):Ye(i.ctx.slots,"default",{node:s,data:o},()=>[hn("span",{class:e.be("node","label")},[s.label])])}}});var Cft=Rt(Tft,[["__file","tree-node-content.vue"]]);function Zwe(n){const e=Kt("TreeNodeMap",null),t={treeNodeExpand:i=>{n.node!==i&&n.node.collapse()},children:[]};return e&&e.children.push(t),pi("TreeNodeMap",t),{broadcastExpanded:i=>{if(n.accordion)for(const s of t.children)s.treeNodeExpand(i)}}}const eIe=Symbol("dragEvents");function yft({props:n,ctx:e,el$:t,dropIndicator$:i,store:s}){const o=vt("tree"),r=te({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return pi(eIe,{treeNodeDragStart:({event:d,treeNode:f})=>{if(ln(n.allowDrag)&&!n.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}r.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},treeNodeDragOver:({event:d,treeNode:f})=>{const g=f,p=r.value.dropNode;p&&p.node.id!==g.node.id&&qc(p.$el,o.is("drop-inner"));const _=r.value.draggingNode;if(!_||!g)return;let v=!0,C=!0,y=!0,w=!0;ln(n.allowDrop)&&(v=n.allowDrop(_.node,g.node,"prev"),w=C=n.allowDrop(_.node,g.node,"inner"),y=n.allowDrop(_.node,g.node,"next")),d.dataTransfer.dropEffect=C||v||y?"move":"none",(v||C||y)&&(p==null?void 0:p.node.id)!==g.node.id&&(p&&e.emit("node-drag-leave",_.node,p.node,d),e.emit("node-drag-enter",_.node,g.node,d)),v||C||y?r.value.dropNode=g:r.value.dropNode=null,g.node.nextSibling===_.node&&(y=!1),g.node.previousSibling===_.node&&(v=!1),g.node.contains(_.node,!1)&&(C=!1),(_.node===g.node||_.node.contains(g.node))&&(v=!1,C=!1,y=!1);const I=g.$el.querySelector(`.${o.be("node","content")}`).getBoundingClientRect(),L=t.value.getBoundingClientRect();let O;const A=v?C?.25:y?.45:1:-1,N=y?C?.75:v?.55:0:1;let D=-9999;const P=d.clientY-I.top;P<I.height*A?O="before":P>I.height*N?O="after":C?O="inner":O="none";const F=g.$el.querySelector(`.${o.be("node","expand-icon")}`).getBoundingClientRect(),V=i.value;O==="before"?D=F.top-L.top:O==="after"&&(D=F.bottom-L.top),V.style.top=`${D}px`,V.style.left=`${F.right-L.left}px`,O==="inner"?Of(g.$el,o.is("drop-inner")):qc(g.$el,o.is("drop-inner")),r.value.showDropIndicator=O==="before"||O==="after",r.value.allowDrop=r.value.showDropIndicator||w,r.value.dropType=O,e.emit("node-drag-over",_.node,g.node,d)},treeNodeDragEnd:d=>{const{draggingNode:f,dropType:g,dropNode:p}=r.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&p){const _={data:f.node.data};g!=="none"&&f.node.remove(),g==="before"?p.node.parent.insertBefore(_,p.node):g==="after"?p.node.parent.insertAfter(_,p.node):g==="inner"&&p.node.insertChild(_),g!=="none"&&(s.value.registerNode(_),s.value.key&&f.node.eachNode(v=>{var C;(C=s.value.nodesMap[v.data[s.value.key]])==null||C.setChecked(v.checked,!s.value.checkStrictly)})),qc(p.$el,o.is("drop-inner")),e.emit("node-drag-end",f.node,p.node,g,d),g!=="none"&&e.emit("node-drop",f.node,p.node,g,d)}f&&!p&&e.emit("node-drag-end",f.node,null,g,d),r.value.showDropIndicator=!1,r.value.draggingNode=null,r.value.dropNode=null,r.value.allowDrop=!0}}),{dragState:r}}const Eft=$e({name:"ElTreeNode",components:{ElCollapseTransition:L8,ElCheckbox:Kf,NodeContent:Cft,ElIcon:tn,Loading:Gm},props:{node:{type:fY,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(n,e){const t=vt("tree"),{broadcastExpanded:i}=Zwe(n),s=Kt("RootTree"),o=te(!1),r=te(!1),a=te(null),c=te(null),u=te(null),d=Kt(eIe),f=Qn();pi("NodeInstance",f),n.node.expanded&&(o.value=!0,r.value=!0);const g=s.props.props.children||"children";ht(()=>{const P=n.node.data[g];return P&&[...P]},()=>{n.node.updateChildren()}),ht(()=>n.node.indeterminate,P=>{v(n.node.checked,P)}),ht(()=>n.node.checked,P=>{v(P,n.node.indeterminate)}),ht(()=>n.node.childNodes.length,()=>n.node.reInitChecked()),ht(()=>n.node.expanded,P=>{cn(()=>o.value=P),P&&(r.value=!0)});const p=P=>dne(s.props.nodeKey,P.data),_=P=>{const F=n.props.class;if(!F)return{};let V;if(ln(F)){const{data:U}=P;V=F(U,P)}else V=F;return sn(V)?{[V]:!0}:V},v=(P,F)=>{(a.value!==P||c.value!==F)&&s.ctx.emit("check-change",n.node.data,P,F),a.value=P,c.value=F},C=P=>{dY(s.store,s.ctx.emit,()=>{var F;if((F=s==null?void 0:s.props)==null?void 0:F.nodeKey){const U=p(n.node);s.store.value.setCurrentNodeKey(U)}else s.store.value.setCurrentNode(n.node)}),s.currentNode.value=n.node,s.props.expandOnClickNode&&w(),s.props.checkOnClickNode&&!n.node.disabled&&I(null,{target:{checked:!n.node.checked}}),s.ctx.emit("node-click",n.node.data,n.node,f,P)},y=P=>{s.instance.vnode.props.onNodeContextmenu&&(P.stopPropagation(),P.preventDefault()),s.ctx.emit("node-contextmenu",P,n.node.data,n.node,f)},w=()=>{n.node.isLeaf||(o.value?(s.ctx.emit("node-collapse",n.node.data,n.node,f),n.node.collapse()):n.node.expand(()=>{e.emit("node-expand",n.node.data,n.node,f)}))},I=(P,F)=>{n.node.setChecked(F.target.checked,!s.props.checkStrictly),cn(()=>{const V=s.store.value;s.ctx.emit("check",n.node.data,{checkedNodes:V.getCheckedNodes(),checkedKeys:V.getCheckedKeys(),halfCheckedNodes:V.getHalfCheckedNodes(),halfCheckedKeys:V.getHalfCheckedKeys()})})};return{ns:t,node$:u,tree:s,expanded:o,childNodeRendered:r,oldChecked:a,oldIndeterminate:c,getNodeKey:p,getNodeClass:_,handleSelectChange:v,handleClick:C,handleContextMenu:y,handleExpandIconClick:w,handleCheckChange:I,handleChildNodeExpand:(P,F,V)=>{i(F),s.ctx.emit("node-expand",P,F,V)},handleDragStart:P=>{s.props.draggable&&d.treeNodeDragStart({event:P,treeNode:n})},handleDragOver:P=>{P.preventDefault(),s.props.draggable&&d.treeNodeDragOver({event:P,treeNode:{$el:u.value,node:n.node}})},handleDrop:P=>{P.preventDefault()},handleDragEnd:P=>{s.props.draggable&&d.treeNodeDragEnd(P)},CaretRight:xEe}}});function Sft(n,e,t,i,s,o){const r=Bt("el-icon"),a=Bt("el-checkbox"),c=Bt("loading"),u=Bt("node-content"),d=Bt("el-tree-node"),f=Bt("el-collapse-transition");return Un((G(),he("div",{ref:"node$",class:Y([n.ns.b("node"),n.ns.is("expanded",n.expanded),n.ns.is("current",n.node.isCurrent),n.ns.is("hidden",!n.node.visible),n.ns.is("focusable",!n.node.disabled),n.ns.is("checked",!n.node.disabled&&n.node.checked),n.getNodeClass(n.node)]),role:"treeitem",tabindex:"-1","aria-expanded":n.expanded,"aria-disabled":n.node.disabled,"aria-checked":n.node.checked,draggable:n.tree.props.draggable,"data-key":n.getNodeKey(n.node),onClick:bn(n.handleClick,["stop"]),onContextmenu:n.handleContextMenu,onDragstart:bn(n.handleDragStart,["stop"]),onDragover:bn(n.handleDragOver,["stop"]),onDragend:bn(n.handleDragEnd,["stop"]),onDrop:bn(n.handleDrop,["stop"])},[oe("div",{class:Y(n.ns.be("node","content")),style:on({paddingLeft:(n.node.level-1)*n.tree.props.indent+"px"})},[n.tree.props.icon||n.CaretRight?(G(),nt(r,{key:0,class:Y([n.ns.be("node","expand-icon"),n.ns.is("leaf",n.node.isLeaf),{expanded:!n.node.isLeaf&&n.expanded}]),onClick:bn(n.handleExpandIconClick,["stop"])},{default:_e(()=>[(G(),nt(ui(n.tree.props.icon||n.CaretRight)))]),_:1},8,["class","onClick"])):Qe("v-if",!0),n.showCheckbox?(G(),nt(a,{key:1,"model-value":n.node.checked,indeterminate:n.node.indeterminate,disabled:!!n.node.disabled,onClick:bn(()=>{},["stop"]),onChange:n.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):Qe("v-if",!0),n.node.loading?(G(),nt(r,{key:2,class:Y([n.ns.be("node","loading-icon"),n.ns.is("loading")])},{default:_e(()=>[ce(c)]),_:1},8,["class"])):Qe("v-if",!0),ce(u,{node:n.node,"render-content":n.renderContent},null,8,["node","render-content"])],6),ce(f,null,{default:_e(()=>[!n.renderAfterExpand||n.childNodeRendered?Un((G(),he("div",{key:0,class:Y(n.ns.be("node","children")),role:"group","aria-expanded":n.expanded},[(G(!0),he(Qt,null,fi(n.node.childNodes,g=>(G(),nt(d,{key:n.getNodeKey(g),"render-content":n.renderContent,"render-after-expand":n.renderAfterExpand,"show-checkbox":n.showCheckbox,node:g,accordion:n.accordion,props:n.props,onNodeExpand:n.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[Gi,n.expanded]]):Qe("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[Gi,n.node.visible]])}var wft=Rt(Eft,[["render",Sft],["__file","tree-node.vue"]]);function Ift({el$:n},e){const t=vt("tree"),i=us([]),s=us([]);$n(()=>{r()}),s_(()=>{i.value=Array.from(n.value.querySelectorAll("[role=treeitem]")),s.value=Array.from(n.value.querySelectorAll("input[type=checkbox]"))}),ht(s,a=>{a.forEach(c=>{c.setAttribute("tabindex","-1")})}),Es(n,"keydown",a=>{const c=a.target;if(!c.className.includes(t.b("node")))return;const u=a.code;i.value=Array.from(n.value.querySelectorAll(`.${t.is("focusable")}[role=treeitem]`));const d=i.value.indexOf(c);let f;if([zt.up,zt.down].includes(u)){if(a.preventDefault(),u===zt.up){f=d===-1?0:d!==0?d-1:i.value.length-1;const p=f;for(;!e.value.getNode(i.value[f].dataset.key).canFocus;){if(f--,f===p){f=-1;break}f<0&&(f=i.value.length-1)}}else{f=d===-1?0:d<i.value.length-1?d+1:0;const p=f;for(;!e.value.getNode(i.value[f].dataset.key).canFocus;){if(f++,f===p){f=-1;break}f>=i.value.length&&(f=0)}}f!==-1&&i.value[f].focus()}[zt.left,zt.right].includes(u)&&(a.preventDefault(),c.click());const g=c.querySelector('[type="checkbox"]');[zt.enter,zt.numpadEnter,zt.space].includes(u)&&g&&(a.preventDefault(),g.click())});const r=()=>{var a;i.value=Array.from(n.value.querySelectorAll(`.${t.is("focusable")}[role=treeitem]`)),s.value=Array.from(n.value.querySelectorAll("input[type=checkbox]"));const c=n.value.querySelectorAll(`.${t.is("checked")}[role=treeitem]`);if(c.length){c[0].setAttribute("tabindex","0");return}(a=i.value[0])==null||a.setAttribute("tabindex","0")}}const Lft=$e({name:"ElTree",components:{ElTreeNode:wft},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:ks}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(n,e){const{t}=wi(),i=vt("tree"),s=Kt(cM,null),o=te(new bft({key:n.nodeKey,data:n.data,lazy:n.lazy,props:n.props,load:n.load,currentNodeKey:n.currentNodeKey,checkStrictly:n.checkStrictly,checkDescendants:n.checkDescendants,defaultCheckedKeys:n.defaultCheckedKeys,defaultExpandedKeys:n.defaultExpandedKeys,autoExpandParent:n.autoExpandParent,defaultExpandAll:n.defaultExpandAll,filterNodeMethod:n.filterNodeMethod}));o.value.initialize();const r=te(o.value.root),a=te(null),c=te(null),u=te(null),{broadcastExpanded:d}=Zwe(n),{dragState:f}=yft({props:n,ctx:e,el$:c,dropIndicator$:u,store:o});Ift({el$:c},o);const g=W(()=>{const{childNodes:Z}=r.value,J=s?s.hasFilteredOptions!==0:!1;return(!Z||Z.length===0||Z.every(({visible:ge})=>!ge))&&!J});ht(()=>n.currentNodeKey,Z=>{o.value.setCurrentNodeKey(Z)}),ht(()=>n.defaultCheckedKeys,Z=>{o.value.setDefaultCheckedKey(Z)}),ht(()=>n.defaultExpandedKeys,Z=>{o.value.setDefaultExpandedKeys(Z)}),ht(()=>n.data,Z=>{o.value.setData(Z)},{deep:!0}),ht(()=>n.checkStrictly,Z=>{o.value.checkStrictly=Z});const p=Z=>{if(!n.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");o.value.filter(Z)},_=Z=>dne(n.nodeKey,Z.data),v=Z=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const J=o.value.getNode(Z);if(!J)return[];const ge=[J.data];let ve=J.parent;for(;ve&&ve!==r.value;)ge.push(ve.data),ve=ve.parent;return ge.reverse()},C=(Z,J)=>o.value.getCheckedNodes(Z,J),y=Z=>o.value.getCheckedKeys(Z),w=()=>{const Z=o.value.getCurrentNode();return Z?Z.data:null},I=()=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const Z=w();return Z?Z[n.nodeKey]:null},L=(Z,J)=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");o.value.setCheckedNodes(Z,J)},O=(Z,J)=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");o.value.setCheckedKeys(Z,J)},A=(Z,J,ge)=>{o.value.setChecked(Z,J,ge)},N=()=>o.value.getHalfCheckedNodes(),D=()=>o.value.getHalfCheckedKeys(),P=(Z,J=!0)=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");dY(o,e.emit,()=>{d(Z),o.value.setUserCurrentNode(Z,J)})},F=(Z,J=!0)=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");dY(o,e.emit,()=>{d(),o.value.setCurrentNodeKey(Z,J)})},V=Z=>o.value.getNode(Z),U=Z=>{o.value.remove(Z)},Q=(Z,J)=>{o.value.append(Z,J)},de=(Z,J)=>{o.value.insertBefore(Z,J)},q=(Z,J)=>{o.value.insertAfter(Z,J)},K=(Z,J,ge)=>{d(J),e.emit("node-expand",Z,J,ge)},re=(Z,J)=>{if(!n.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");o.value.updateChildren(Z,J)};return pi("RootTree",{ctx:e,props:n,store:o,root:r,currentNode:a,instance:Qn()}),pi(zm,void 0),{ns:i,store:o,root:r,currentNode:a,dragState:f,el$:c,dropIndicator$:u,isEmpty:g,filter:p,getNodeKey:_,getNodePath:v,getCheckedNodes:C,getCheckedKeys:y,getCurrentNode:w,getCurrentKey:I,setCheckedNodes:L,setCheckedKeys:O,setChecked:A,getHalfCheckedNodes:N,getHalfCheckedKeys:D,setCurrentNode:P,setCurrentKey:F,t,getNode:V,remove:U,append:Q,insertBefore:de,insertAfter:q,handleNodeExpand:K,updateKeyChildren:re}}});function Oft(n,e,t,i,s,o){const r=Bt("el-tree-node");return G(),he("div",{ref:"el$",class:Y([n.ns.b(),n.ns.is("dragging",!!n.dragState.draggingNode),n.ns.is("drop-not-allow",!n.dragState.allowDrop),n.ns.is("drop-inner",n.dragState.dropType==="inner"),{[n.ns.m("highlight-current")]:n.highlightCurrent}]),role:"tree"},[(G(!0),he(Qt,null,fi(n.root.childNodes,a=>(G(),nt(r,{key:n.getNodeKey(a),node:a,props:n.props,accordion:n.accordion,"render-after-expand":n.renderAfterExpand,"show-checkbox":n.showCheckbox,"render-content":n.renderContent,onNodeExpand:n.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),n.isEmpty?(G(),he("div",{key:0,class:Y(n.ns.e("empty-block"))},[Ye(n.$slots,"empty",{},()=>{var a;return[oe("span",{class:Y(n.ns.e("empty-text"))},st((a=n.emptyText)!=null?a:n.t("el.tree.emptyText")),3)]})],2)):Qe("v-if",!0),Un(oe("div",{ref:"dropIndicator$",class:Y(n.ns.e("drop-indicator"))},null,2),[[Gi,n.dragState.showDropIndicator]])],2)}var Rft=Rt(Lft,[["render",Oft],["__file","tree.vue"]]);const AW=Nn(Rft),Mft=(n,{attrs:e,emit:t},{select:i,tree:s,key:o})=>{const r=vt("tree-select");return ht(()=>n.data,()=>{n.filterable&&cn(()=>{var c,u;(u=s.value)==null||u.filter((c=i.value)==null?void 0:c.states.inputValue)})},{flush:"post"}),{...$g(Gl(n),Object.keys(V0.props)),...e,"onUpdate:modelValue":c=>t(Kn,c),valueKey:o,popperClass:W(()=>{const c=[r.e("popper")];return n.popperClass&&c.push(n.popperClass),c.join(" ")}),filterMethod:(c="")=>{var u;n.filterMethod?n.filterMethod(c):n.remoteMethod?n.remoteMethod(c):(u=s.value)==null||u.filter(c)}}},kft=$e({extends:TW,setup(n,e){const t=TW.setup(n,e);delete t.selectOptionClick;const i=Qn().proxy;return cn(()=>{t.select.states.cachedOptions.get(i.value)||t.select.onOptionCreate(i)}),ht(()=>e.attrs.visible,s=>{t.states.visible=s},{immediate:!0}),t},methods:{selectOptionClick(){this.$el.parentElement.click()}}});function gY(n){return n||n===0}function hne(n){return yt(n)&&n.length}function JL(n){return yt(n)?n:gY(n)?[n]:[]}function UU(n,e,t,i,s){for(let o=0;o<n.length;o++){const r=n[o];if(e(r,o,n,s))return i?i(r,o,n,s):r;{const a=t(r);if(hne(a)){const c=UU(a,e,t,i,r);if(c)return c}}}}function WU(n,e,t,i){for(let s=0;s<n.length;s++){const o=n[s];e(o,s,n,i);const r=t(o);hne(r)&&WU(r,e,t,o)}}const Aft=(n,{attrs:e,slots:t,emit:i},{select:s,tree:o,key:r})=>{ht(()=>n.modelValue,()=>{n.showCheckbox&&cn(()=>{const g=o.value;g&&!Ha(g.getCheckedKeys(),JL(n.modelValue))&&g.setCheckedKeys(JL(n.modelValue))})},{immediate:!0,deep:!0});const a=W(()=>({value:r.value,label:"label",children:"children",disabled:"disabled",isLeaf:"isLeaf",...n.props})),c=(g,p)=>{var _;const v=a.value[g];return ln(v)?v(p,(_=o.value)==null?void 0:_.getNode(c("value",p))):p[v]},u=JL(n.modelValue).map(g=>UU(n.data||[],p=>c("value",p)===g,p=>c("children",p),(p,_,v,C)=>C&&c("value",C))).filter(g=>gY(g)),d=W(()=>{if(!n.renderAfterExpand&&!n.lazy)return[];const g=[];return WU(n.data.concat(n.cacheData),p=>{const _=c("value",p);g.push({value:_,currentLabel:c("label",p),isDisabled:c("disabled",p)})},p=>c("children",p)),g}),f=()=>{var g;return(g=o.value)==null?void 0:g.getCheckedKeys().filter(p=>{var _;const v=(_=o.value)==null?void 0:_.getNode(p);return!Ul(v)&&oh(v.childNodes)})};return{...$g(Gl(n),Object.keys(AW.props)),...e,nodeKey:r,expandOnClickNode:W(()=>!n.checkStrictly&&n.expandOnClickNode),defaultExpandedKeys:W(()=>n.defaultExpandedKeys?n.defaultExpandedKeys.concat(u):u),renderContent:(g,{node:p,data:_,store:v})=>g(kft,{value:c("value",_),label:c("label",_),disabled:c("disabled",_),visible:p.visible},n.renderContent?()=>n.renderContent(g,{node:p,data:_,store:v}):t.default?()=>t.default({node:p,data:_,store:v}):void 0),filterNodeMethod:(g,p,_)=>n.filterNodeMethod?n.filterNodeMethod(g,p,_):g?new RegExp(yte(g),"i").test(c("label",p)||""):!0,onNodeClick:(g,p,_)=>{var v,C,y,w;if((v=e.onNodeClick)==null||v.call(e,g,p,_),!(n.showCheckbox&&n.checkOnClickNode)){if(!n.showCheckbox&&(n.checkStrictly||p.isLeaf)){if(!c("disabled",g)){const I=(C=s.value)==null?void 0:C.states.options.get(c("value",g));(y=s.value)==null||y.handleOptionSelect(I)}}else n.expandOnClickNode&&_.proxy.handleExpandIconClick();(w=s.value)==null||w.focus()}},onCheck:(g,p)=>{var _;if(!n.showCheckbox)return;const v=c("value",g),C={};WU([o.value.store.root],L=>C[L.key]=L,L=>L.childNodes);const y=p.checkedKeys,w=n.multiple?JL(n.modelValue).filter(L=>!(L in C)&&!y.includes(L)):[],I=w.concat(y);if(n.checkStrictly)i(Kn,n.multiple?I:I.includes(v)?v:void 0);else if(n.multiple){const L=f();i(Kn,w.concat(L))}else{const L=UU([g],N=>!hne(c("children",N))&&!c("disabled",N),N=>c("children",N)),O=L?c("value",L):void 0,A=gY(n.modelValue)&&!!UU([g],N=>c("value",N)===n.modelValue,N=>c("children",N));i(Kn,O===n.modelValue||A?void 0:O)}cn(()=>{var L;const O=JL(n.modelValue);o.value.setCheckedKeys(O),(L=e.onCheck)==null||L.call(e,g,{checkedKeys:o.value.getCheckedKeys(),checkedNodes:o.value.getCheckedNodes(),halfCheckedKeys:o.value.getHalfCheckedKeys(),halfCheckedNodes:o.value.getHalfCheckedNodes()})}),(_=s.value)==null||_.focus()},onNodeExpand:(g,p,_)=>{var v;(v=e.onNodeExpand)==null||v.call(e,g,p,_),cn(()=>{if(!n.checkStrictly&&n.lazy&&n.multiple&&p.checked){const C={},y=o.value.getCheckedKeys();WU([o.value.store.root],L=>C[L.key]=L,L=>L.childNodes);const w=JL(n.modelValue).filter(L=>!(L in C)&&!y.includes(L)),I=f();i(Kn,w.concat(I))}})},cacheOptions:d}};var Nft=$e({props:{data:{type:Array,default:()=>[]}},setup(n){const e=Kt(cM);return ht(()=>n.data,()=>{var t;n.data.forEach(s=>{e.states.cachedOptions.has(s.value)||e.states.cachedOptions.set(s.value,s)});const i=((t=e.selectRef)==null?void 0:t.querySelectorAll("input"))||[];Si&&!Array.from(i).includes(document.activeElement)&&e.setSelected()},{flush:"post",immediate:!0}),()=>{}}});const Dft=$e({name:"ElTreeSelect",inheritAttrs:!1,props:{...V0.props,...AW.props,cacheData:{type:Array,default:()=>[]}},setup(n,e){const{slots:t,expose:i}=e,s=te(),o=te(),r=W(()=>n.nodeKey||n.valueKey||"value"),a=Mft(n,e,{select:s,tree:o,key:r}),{cacheOptions:c,...u}=Aft(n,e,{select:s,tree:o,key:r}),d=Ki({});return i(d),$n(()=>{Object.assign(d,{...$g(o.value,["filter","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter"]),...$g(s.value,["focus","blur","selectedLabel"])})}),()=>hn(V0,Ki({...a,ref:f=>s.value=f}),{...t,default:()=>[hn(Nft,{data:c.value}),hn(AW,Ki({...u,ref:f=>o.value=f}))]})}});var $ft=Rt(Dft,[["__file","tree-select.vue"]]);const xft=Nn($ft),fne=Symbol(),Pft={key:-1,level:-1,data:{}};var lD=(n=>(n.KEY="id",n.LABEL="label",n.CHILDREN="children",n.DISABLED="disabled",n.CLASS="",n))(lD||{}),pY=(n=>(n.ADD="add",n.DELETE="delete",n))(pY||{});const tIe={type:Number,default:26},Fft=Lt({data:{type:Ke(Array),default:()=>Ko([])},emptyText:{type:String},height:{type:Number,default:200},props:{type:Ke(Object),default:()=>Ko({children:"children",label:"label",disabled:"disabled",value:"id",class:""})},highlightCurrent:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},defaultCheckedKeys:{type:Ke(Array),default:()=>Ko([])},checkStrictly:{type:Boolean,default:!1},defaultExpandedKeys:{type:Ke(Array),default:()=>Ko([])},indent:{type:Number,default:16},itemSize:tIe,icon:{type:ks},expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!1},currentNodeKey:{type:Ke([String,Number])},accordion:{type:Boolean,default:!1},filterMethod:{type:Ke(Function)},perfMode:{type:Boolean,default:!0}}),Bft=Lt({node:{type:Ke(Object),default:()=>Ko(Pft)},expanded:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},current:{type:Boolean,default:!1},hiddenExpandIcon:{type:Boolean,default:!1},itemSize:tIe}),Hft=Lt({node:{type:Ke(Object),required:!0}}),nIe="node-click",iIe="node-drop",sIe="node-expand",oIe="node-collapse",rIe="current-change",lIe="check",aIe="check-change",cIe="node-contextmenu",Vft={[nIe]:(n,e,t)=>n&&e&&t,[iIe]:(n,e,t)=>n&&e&&t,[sIe]:(n,e)=>n&&e,[oIe]:(n,e)=>n&&e,[rIe]:(n,e)=>n&&e,[lIe]:(n,e)=>n&&e,[aIe]:(n,e)=>n&&Us(e),[cIe]:(n,e,t)=>n&&e&&t},Uft={click:(n,e)=>!!(n&&e),drop:(n,e)=>!!(n&&e),toggle:n=>!!n,check:(n,e)=>n&&Us(e)};function Wft(n,e){const t=te(new Set),i=te(new Set),{emit:s}=Qn();ht([()=>e.value,()=>n.defaultCheckedKeys],()=>cn(()=>{w(n.defaultCheckedKeys)}),{immediate:!0});const o=()=>{if(!e.value||!n.showCheckbox||n.checkStrictly)return;const{levelTreeNodeMap:I,maxLevel:L}=e.value,O=t.value,A=new Set;for(let N=L-1;N>=1;--N){const D=I.get(N);D&&D.forEach(P=>{const F=P.children;if(F){let V=!0,U=!1;for(const Q of F){const de=Q.key;if(O.has(de))U=!0;else if(A.has(de)){V=!1,U=!0;break}else V=!1}V?O.add(P.key):U?(A.add(P.key),O.delete(P.key)):(O.delete(P.key),A.delete(P.key))}})}i.value=A},r=I=>t.value.has(I.key),a=I=>i.value.has(I.key),c=(I,L,O=!0,A=!0)=>{const N=t.value,D=(P,F)=>{N[F?pY.ADD:pY.DELETE](P.key);const V=P.children;!n.checkStrictly&&V&&V.forEach(U=>{U.disabled||D(U,F)})};D(I,L),A&&o(),O&&u(I,L)},u=(I,L)=>{const{checkedNodes:O,checkedKeys:A}=_(),{halfCheckedNodes:N,halfCheckedKeys:D}=v();s(lIe,I.data,{checkedKeys:A,checkedNodes:O,halfCheckedKeys:D,halfCheckedNodes:N}),s(aIe,I.data,L)};function d(I=!1){return _(I).checkedKeys}function f(I=!1){return _(I).checkedNodes}function g(){return v().halfCheckedKeys}function p(){return v().halfCheckedNodes}function _(I=!1){const L=[],O=[];if(e!=null&&e.value&&n.showCheckbox){const{treeNodeMap:A}=e.value;t.value.forEach(N=>{const D=A.get(N);D&&(!I||I&&D.isLeaf)&&(O.push(N),L.push(D.data))})}return{checkedKeys:O,checkedNodes:L}}function v(){const I=[],L=[];if(e!=null&&e.value&&n.showCheckbox){const{treeNodeMap:O}=e.value;i.value.forEach(A=>{const N=O.get(A);N&&(L.push(A),I.push(N.data))})}return{halfCheckedNodes:I,halfCheckedKeys:L}}function C(I){t.value.clear(),i.value.clear(),cn(()=>{w(I)})}function y(I,L){if(e!=null&&e.value&&n.showCheckbox){const O=e.value.treeNodeMap.get(I);O&&c(O,L,!1)}}function w(I){if(e!=null&&e.value){const{treeNodeMap:L}=e.value;if(n.showCheckbox&&L&&(I==null?void 0:I.length)>0){for(const O of I){const A=L.get(O);A&&!r(A)&&c(A,!0,!1,!1)}o()}}}return{updateCheckedKeys:o,toggleCheckbox:c,isChecked:r,isIndeterminate:a,getCheckedKeys:d,getCheckedNodes:f,getHalfCheckedKeys:g,getHalfCheckedNodes:p,setChecked:y,setCheckedKeys:C}}function Gft(n,e){const t=te(new Set([])),i=te(new Set([])),s=W(()=>ln(n.filterMethod));function o(a){var c;if(!s.value)return;const u=new Set,d=i.value,f=t.value,g=[],p=((c=e.value)==null?void 0:c.treeNodes)||[],_=n.filterMethod;f.clear();function v(C){C.forEach(y=>{g.push(y),_!=null&&_(a,y.data,y)?g.forEach(I=>{u.add(I.key)}):y.isLeaf&&f.add(y.key);const w=y.children;if(w&&v(w),!y.isLeaf){if(!u.has(y.key))f.add(y.key);else if(w){let I=!0;for(const L of w)if(!f.has(L.key)){I=!1;break}I?d.add(y.key):d.delete(y.key)}}g.pop()})}return v(p),u}function r(a){return i.value.has(a.key)}return{hiddenExpandIconKeySet:i,hiddenNodeKeySet:t,doFilter:o,isForceHiddenExpandIcon:r}}function zft(n,e){const t=te(new Set(n.defaultExpandedKeys)),i=te(),s=us(),o=te();ht(()=>n.currentNodeKey,ee=>{i.value=ee},{immediate:!0}),ht(()=>n.data,ee=>{Ve(ee)},{immediate:!0});const{isIndeterminate:r,isChecked:a,toggleCheckbox:c,getCheckedKeys:u,getCheckedNodes:d,getHalfCheckedKeys:f,getHalfCheckedNodes:g,setChecked:p,setCheckedKeys:_}=Wft(n,s),{doFilter:v,hiddenNodeKeySet:C,isForceHiddenExpandIcon:y}=Gft(n,s),w=W(()=>{var ee;return((ee=n.props)==null?void 0:ee.value)||lD.KEY}),I=W(()=>{var ee;return((ee=n.props)==null?void 0:ee.children)||lD.CHILDREN}),L=W(()=>{var ee;return((ee=n.props)==null?void 0:ee.disabled)||lD.DISABLED}),O=W(()=>{var ee;return((ee=n.props)==null?void 0:ee.label)||lD.LABEL}),A=W(()=>{var ee;const ye=t.value,Me=C.value,et=[],at=((ee=s.value)==null?void 0:ee.treeNodes)||[],Ue=[];for(let Se=at.length-1;Se>=0;--Se)Ue.push(at[Se]);for(;Ue.length;){const Se=Ue.pop();if(!Me.has(Se.key)&&(et.push(Se),Se.children&&ye.has(Se.key)))for(let Ie=Se.children.length-1;Ie>=0;--Ie)Ue.push(Se.children[Ie])}return et}),N=W(()=>A.value.length>0);function D(ee){const ye=new Map,Me=new Map;let et=1;function at(Se,Ie=1,Xe=void 0){var it;const Tt=[];for(const He of Se){const ke=V(He),ot={level:Ie,key:ke,data:He};ot.label=Q(He),ot.parent=Xe;const Ct=F(He);ot.disabled=U(He),ot.isLeaf=!Ct||Ct.length===0,Ct&&Ct.length&&(ot.children=at(Ct,Ie+1,ot)),Tt.push(ot),ye.set(ke,ot),Me.has(Ie)||Me.set(Ie,[]),(it=Me.get(Ie))==null||it.push(ot)}return Ie>et&&(et=Ie),Tt}const Ue=at(ee);return{treeNodeMap:ye,levelTreeNodeMap:Me,maxLevel:et,treeNodes:Ue}}function P(ee){const ye=v(ee);ye&&(t.value=ye)}function F(ee){return ee[I.value]}function V(ee){return ee?ee[w.value]:""}function U(ee){return ee[L.value]}function Q(ee){return ee[O.value]}function de(ee){t.value.has(ee.key)?ve(ee):ge(ee)}function q(ee){const ye=new Set,Me=s.value.treeNodeMap;ee.forEach(et=>{let at=Me.get(et);for(;at&&!ye.has(at.key);)ye.add(at.key),at=at.parent}),t.value=ye}function K(ee,ye){e(nIe,ee.data,ee,ye),Z(ee),n.expandOnClickNode&&de(ee),n.showCheckbox&&n.checkOnClickNode&&!ee.disabled&&c(ee,!a(ee),!0)}function re(ee,ye){e(iIe,ee.data,ee,ye)}function Z(ee){Ne(ee)||(i.value=ee.key,e(rIe,ee.data,ee))}function J(ee,ye){c(ee,ye)}function ge(ee){const ye=t.value;if(s.value&&n.accordion){const{treeNodeMap:Me}=s.value;ye.forEach(et=>{const at=Me.get(et);ee&&ee.level===(at==null?void 0:at.level)&&ye.delete(et)})}ye.add(ee.key),e(sIe,ee.data,ee)}function ve(ee){t.value.delete(ee.key),e(oIe,ee.data,ee)}function Le(ee){return t.value.has(ee.key)}function Ee(ee){return!!ee.disabled}function Ne(ee){const ye=i.value;return ye!==void 0&&ye===ee.key}function qe(){var ee,ye;if(i.value)return(ye=(ee=s.value)==null?void 0:ee.treeNodeMap.get(i.value))==null?void 0:ye.data}function Re(){return i.value}function we(ee){i.value=ee}function Ve(ee){cn(()=>s.value=D(ee))}function Ge(ee){var ye;const Me=si(ee)?V(ee):ee;return(ye=s.value)==null?void 0:ye.treeNodeMap.get(Me)}function dt(ee,ye="auto"){const Me=Ge(ee);Me&&o.value&&o.value.scrollToItem(A.value.indexOf(Me),ye)}function ze(ee){var ye;(ye=o.value)==null||ye.scrollTo(ee)}return{tree:s,flattenTree:A,isNotEmpty:N,listRef:o,getKey:V,getChildren:F,toggleExpand:de,toggleCheckbox:c,isExpanded:Le,isChecked:a,isIndeterminate:r,isDisabled:Ee,isCurrent:Ne,isForceHiddenExpandIcon:y,handleNodeClick:K,handleNodeDrop:re,handleNodeCheck:J,getCurrentNode:qe,getCurrentKey:Re,setCurrentKey:we,getCheckedKeys:u,getCheckedNodes:d,getHalfCheckedKeys:f,getHalfCheckedNodes:g,setChecked:p,setCheckedKeys:_,filter:P,setData:Ve,getNode:Ge,expandNode:ge,collapseNode:ve,setExpandedKeys:q,scrollToNode:dt,scrollTo:ze}}var Kft=$e({name:"ElTreeNodeContent",props:Hft,setup(n){const e=Kt(fne),t=vt("tree");return()=>{const i=n.node,{data:s}=i;return e!=null&&e.ctx.slots.default?e.ctx.slots.default({node:i,data:s}):hn("span",{class:t.be("node","label")},[i==null?void 0:i.label])}}});const jft=$e({name:"ElTreeNode"}),Xft=$e({...jft,props:Bft,emits:Uft,setup(n,{emit:e}){const t=n,i=Kt(fne),s=vt("tree"),o=W(()=>{var p;return(p=i==null?void 0:i.props.indent)!=null?p:16}),r=W(()=>{var p;return(p=i==null?void 0:i.props.icon)!=null?p:xEe}),a=p=>{const _=i==null?void 0:i.props.props.class;if(!_)return{};let v;if(ln(_)){const{data:C}=p;v=_(C,p)}else v=_;return sn(v)?{[v]:!0}:v},c=p=>{e("click",t.node,p)},u=p=>{e("drop",t.node,p)},d=()=>{e("toggle",t.node)},f=p=>{e("check",t.node,p)},g=p=>{var _,v,C,y;(C=(v=(_=i==null?void 0:i.instance)==null?void 0:_.vnode)==null?void 0:v.props)!=null&&C.onNodeContextmenu&&(p.stopPropagation(),p.preventDefault()),i==null||i.ctx.emit(cIe,p,(y=t.node)==null?void 0:y.data,t.node)};return(p,_)=>{var v,C,y;return G(),he("div",{ref:"node$",class:Y([T(s).b("node"),T(s).is("expanded",p.expanded),T(s).is("current",p.current),T(s).is("focusable",!p.disabled),T(s).is("checked",!p.disabled&&p.checked),a(p.node)]),role:"treeitem",tabindex:"-1","aria-expanded":p.expanded,"aria-disabled":p.disabled,"aria-checked":p.checked,"data-key":(v=p.node)==null?void 0:v.key,onClick:bn(c,["stop"]),onContextmenu:g,onDragover:bn(()=>{},["prevent"]),onDragenter:bn(()=>{},["prevent"]),onDrop:bn(u,["stop"])},[oe("div",{class:Y(T(s).be("node","content")),style:on({paddingLeft:`${(p.node.level-1)*T(o)}px`,height:p.itemSize+"px"})},[T(r)?(G(),nt(T(tn),{key:0,class:Y([T(s).is("leaf",!!((C=p.node)!=null&&C.isLeaf)),T(s).is("hidden",p.hiddenExpandIcon),{expanded:!((y=p.node)!=null&&y.isLeaf)&&p.expanded},T(s).be("node","expand-icon")]),onClick:bn(d,["stop"])},{default:_e(()=>[(G(),nt(ui(T(r))))]),_:1},8,["class","onClick"])):Qe("v-if",!0),p.showCheckbox?(G(),nt(T(Kf),{key:1,"model-value":p.checked,indeterminate:p.indeterminate,disabled:p.disabled,onChange:f,onClick:bn(()=>{},["stop"])},null,8,["model-value","indeterminate","disabled","onClick"])):Qe("v-if",!0),ce(T(Kft),{node:p.node},null,8,["node"])],6)],42,["aria-expanded","aria-disabled","aria-checked","data-key","onClick","onDragover","onDragenter","onDrop"])}}});var Yft=Rt(Xft,[["__file","tree-node.vue"]]);const qft=$e({name:"ElTreeV2"}),Jft=$e({...qft,props:Fft,emits:Vft,setup(n,{expose:e,emit:t}){const i=n,s=dl(),o=W(()=>i.itemSize);pi(fne,{ctx:{emit:t,slots:s},props:i,instance:Qn()}),pi(zm,void 0);const{t:r}=wi(),a=vt("tree"),{flattenTree:c,isNotEmpty:u,listRef:d,toggleExpand:f,isExpanded:g,isIndeterminate:p,isChecked:_,isDisabled:v,isCurrent:C,isForceHiddenExpandIcon:y,handleNodeClick:w,handleNodeDrop:I,handleNodeCheck:L,toggleCheckbox:O,getCurrentNode:A,getCurrentKey:N,setCurrentKey:D,getCheckedKeys:P,getCheckedNodes:F,getHalfCheckedKeys:V,getHalfCheckedNodes:U,setChecked:Q,setCheckedKeys:de,filter:q,setData:K,getNode:re,expandNode:Z,collapseNode:J,setExpandedKeys:ge,scrollToNode:ve,scrollTo:Le}=zft(i,t);return e({toggleCheckbox:O,getCurrentNode:A,getCurrentKey:N,setCurrentKey:D,getCheckedKeys:P,getCheckedNodes:F,getHalfCheckedKeys:V,getHalfCheckedNodes:U,setChecked:Q,setCheckedKeys:de,filter:q,setData:K,getNode:re,expandNode:Z,collapseNode:J,setExpandedKeys:ge,scrollToNode:ve,scrollTo:Le}),(Ee,Ne)=>(G(),he("div",{class:Y([T(a).b(),{[T(a).m("highlight-current")]:Ee.highlightCurrent}]),role:"tree"},[T(u)?(G(),nt(T(K0e),{key:0,ref_key:"listRef",ref:d,"class-name":T(a).b("virtual-list"),data:T(c),total:T(c).length,height:Ee.height,"item-size":T(o),"perf-mode":Ee.perfMode},{default:_e(({data:qe,index:Re,style:we})=>[(G(),nt(Yft,{key:qe[Re].key,style:on(we),node:qe[Re],expanded:T(g)(qe[Re]),"show-checkbox":Ee.showCheckbox,checked:T(_)(qe[Re]),indeterminate:T(p)(qe[Re]),"item-size":T(o),disabled:T(v)(qe[Re]),current:T(C)(qe[Re]),"hidden-expand-icon":T(y)(qe[Re]),onClick:T(w),onToggle:T(f),onCheck:T(L),onDrop:T(I)},null,8,["style","node","expanded","show-checkbox","checked","indeterminate","item-size","disabled","current","hidden-expand-icon","onClick","onToggle","onCheck","onDrop"]))]),_:1},8,["class-name","data","total","height","item-size","perf-mode"])):(G(),he("div",{key:1,class:Y(T(a).e("empty-block"))},[Ye(Ee.$slots,"empty",{},()=>{var qe;return[oe("span",{class:Y(T(a).e("empty-text"))},st((qe=Ee.emptyText)!=null?qe:T(r)("el.tree.emptyText")),3)]})],2))],2))}});var Qft=Rt(Jft,[["__file","tree.vue"]]);const Zft=Nn(Qft),uIe=Symbol("uploadContextKey"),egt="ElUpload";class tgt extends Error{constructor(e,t,i,s){super(e),this.name="UploadAjaxError",this.status=t,this.method=i,this.url=s}}function nhe(n,e,t){let i;return t.response?i=`${t.response.error||t.response}`:t.responseText?i=`${t.responseText}`:i=`fail to ${e.method} ${n} ${t.status}`,new tgt(i,t.status,e.method,n)}function ngt(n){const e=n.responseText||n.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}const igt=n=>{typeof XMLHttpRequest>"u"&&Ll(egt,"XMLHttpRequest is undefined");const e=new XMLHttpRequest,t=n.action;e.upload&&e.upload.addEventListener("progress",o=>{const r=o;r.percent=o.total>0?o.loaded/o.total*100:0,n.onProgress(r)});const i=new FormData;if(n.data)for(const[o,r]of Object.entries(n.data))yt(r)&&r.length?i.append(o,...r):i.append(o,r);i.append(n.filename,n.file,n.file.name),e.addEventListener("error",()=>{n.onError(nhe(t,n,e))}),e.addEventListener("load",()=>{if(e.status<200||e.status>=300)return n.onError(nhe(t,n,e));n.onSuccess(ngt(e))}),e.open(n.method,t,!0),n.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const s=n.headers||{};if(s instanceof Headers)s.forEach((o,r)=>e.setRequestHeader(r,o));else for(const[o,r]of Object.entries(s))Ul(r)||e.setRequestHeader(o,String(r));return e.send(i),e},dIe=["text","picture","picture-card"];let sgt=1;const mY=()=>Date.now()+sgt++,hIe=Lt({action:{type:String,default:"#"},headers:{type:Ke(Object)},method:{type:String,default:"post"},data:{type:Ke([Object,Function,Promise]),default:()=>Ko({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:Ke(Array),default:()=>Ko([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:dIe,default:"text"},httpRequest:{type:Ke(Function),default:igt},disabled:Boolean,limit:Number}),ogt=Lt({...hIe,beforeUpload:{type:Ke(Function),default:ps},beforeRemove:{type:Ke(Function)},onRemove:{type:Ke(Function),default:ps},onChange:{type:Ke(Function),default:ps},onPreview:{type:Ke(Function),default:ps},onSuccess:{type:Ke(Function),default:ps},onProgress:{type:Ke(Function),default:ps},onError:{type:Ke(Function),default:ps},onExceed:{type:Ke(Function),default:ps},crossorigin:{type:Ke(String)}}),rgt=Lt({files:{type:Ke(Array),default:()=>Ko([])},disabled:{type:Boolean,default:!1},handlePreview:{type:Ke(Function),default:ps},listType:{type:String,values:dIe,default:"text"},crossorigin:{type:Ke(String)}}),lgt={remove:n=>!!n},agt=$e({name:"ElUploadList"}),cgt=$e({...agt,props:rgt,emits:lgt,setup(n,{emit:e}){const t=n,{t:i}=wi(),s=vt("upload"),o=vt("icon"),r=vt("list"),a=gc(),c=te(!1),u=W(()=>[s.b("list"),s.bm("list",t.listType),s.is("disabled",t.disabled)]),d=f=>{e("remove",f)};return(f,g)=>(G(),nt(Nve,{tag:"ul",class:Y(T(u)),name:T(r).b()},{default:_e(()=>[(G(!0),he(Qt,null,fi(f.files,(p,_)=>(G(),he("li",{key:p.uid||p.name,class:Y([T(s).be("list","item"),T(s).is(p.status),{focusing:c.value}]),tabindex:"0",onKeydown:xs(v=>!T(a)&&d(p),["delete"]),onFocus:v=>c.value=!0,onBlur:v=>c.value=!1,onClick:v=>c.value=!1},[Ye(f.$slots,"default",{file:p,index:_},()=>[f.listType==="picture"||p.status!=="uploading"&&f.listType==="picture-card"?(G(),he("img",{key:0,class:Y(T(s).be("list","item-thumbnail")),src:p.url,crossorigin:f.crossorigin,alt:""},null,10,["src","crossorigin"])):Qe("v-if",!0),p.status==="uploading"||f.listType!=="picture-card"?(G(),he("div",{key:1,class:Y(T(s).be("list","item-info"))},[oe("a",{class:Y(T(s).be("list","item-name")),onClick:bn(v=>f.handlePreview(p),["prevent"])},[ce(T(tn),{class:Y(T(o).m("document"))},{default:_e(()=>[ce(T(BKe))]),_:1},8,["class"]),oe("span",{class:Y(T(s).be("list","item-file-name")),title:p.name},st(p.name),11,["title"])],10,["onClick"]),p.status==="uploading"?(G(),nt(T(x0e),{key:0,type:f.listType==="picture-card"?"circle":"line","stroke-width":f.listType==="picture-card"?6:2,percentage:Number(p.percentage),style:on(f.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):Qe("v-if",!0)],2)):Qe("v-if",!0),oe("label",{class:Y(T(s).be("list","item-status-label"))},[f.listType==="text"?(G(),nt(T(tn),{key:0,class:Y([T(o).m("upload-success"),T(o).m("circle-check")])},{default:_e(()=>[ce(T(ete))]),_:1},8,["class"])):["picture-card","picture"].includes(f.listType)?(G(),nt(T(tn),{key:1,class:Y([T(o).m("upload-success"),T(o).m("check")])},{default:_e(()=>[ce(T(oF))]),_:1},8,["class"])):Qe("v-if",!0)],2),T(a)?Qe("v-if",!0):(G(),nt(T(tn),{key:2,class:Y(T(o).m("close")),onClick:v=>d(p)},{default:_e(()=>[ce(T(Zg))]),_:2},1032,["class","onClick"])),Qe(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),Qe(" This is a bug which needs to be fixed "),Qe(" TODO: Fix the incorrect navigation interaction "),T(a)?Qe("v-if",!0):(G(),he("i",{key:3,class:Y(T(o).m("close-tip"))},st(T(i)("el.upload.deleteTip")),3)),f.listType==="picture-card"?(G(),he("span",{key:4,class:Y(T(s).be("list","item-actions"))},[oe("span",{class:Y(T(s).be("list","item-preview")),onClick:v=>f.handlePreview(p)},[ce(T(tn),{class:Y(T(o).m("zoom-in"))},{default:_e(()=>[ce(T(HEe))]),_:1},8,["class"])],10,["onClick"]),T(a)?Qe("v-if",!0):(G(),he("span",{key:0,class:Y(T(s).be("list","item-delete")),onClick:v=>d(p)},[ce(T(tn),{class:Y(T(o).m("delete"))},{default:_e(()=>[ce(T($Ke))]),_:1},8,["class"])],10,["onClick"]))],2)):Qe("v-if",!0)])],42,["onKeydown","onFocus","onBlur","onClick"]))),128)),Ye(f.$slots,"append")]),_:3},8,["class","name"]))}});var ihe=Rt(cgt,[["__file","upload-list.vue"]]);const ugt=Lt({disabled:{type:Boolean,default:!1}}),dgt={file:n=>yt(n)},fIe="ElUploadDrag",hgt=$e({name:fIe}),fgt=$e({...hgt,props:ugt,emits:dgt,setup(n,{emit:e}){Kt(uIe)||Ll(fIe,"usage: <el-upload><el-upload-dragger /></el-upload>");const i=vt("upload"),s=te(!1),o=gc(),r=c=>{if(o.value)return;s.value=!1,c.stopPropagation();const u=Array.from(c.dataTransfer.files);e("file",u)},a=()=>{o.value||(s.value=!0)};return(c,u)=>(G(),he("div",{class:Y([T(i).b("dragger"),T(i).is("dragover",s.value)]),onDrop:bn(r,["prevent"]),onDragover:bn(a,["prevent"]),onDragleave:bn(d=>s.value=!1,["prevent"])},[Ye(c.$slots,"default")],42,["onDrop","onDragover","onDragleave"]))}});var ggt=Rt(fgt,[["__file","upload-dragger.vue"]]);const pgt=Lt({...hIe,beforeUpload:{type:Ke(Function),default:ps},onRemove:{type:Ke(Function),default:ps},onStart:{type:Ke(Function),default:ps},onSuccess:{type:Ke(Function),default:ps},onProgress:{type:Ke(Function),default:ps},onError:{type:Ke(Function),default:ps},onExceed:{type:Ke(Function),default:ps}}),mgt=$e({name:"ElUploadContent",inheritAttrs:!1}),_gt=$e({...mgt,props:pgt,setup(n,{expose:e}){const t=n,i=vt("upload"),s=gc(),o=us({}),r=us(),a=v=>{if(v.length===0)return;const{autoUpload:C,limit:y,fileList:w,multiple:I,onStart:L,onExceed:O}=t;if(y&&w.length+v.length>y){O(v,w);return}I||(v=v.slice(0,1));for(const A of v){const N=A;N.uid=mY(),L(N),C&&c(N)}},c=async v=>{if(r.value.value="",!t.beforeUpload)return d(v);let C,y={};try{const I=t.data,L=t.beforeUpload(v);y=w$(t.data)?gW(t.data):t.data,C=await L,w$(t.data)&&Ha(I,y)&&(y=gW(t.data))}catch{C=!1}if(C===!1){t.onRemove(v);return}let w=v;C instanceof Blob&&(C instanceof File?w=C:w=new File([C],v.name,{type:v.type})),d(Object.assign(w,{uid:v.uid}),y)},u=async(v,C)=>ln(v)?v(C):v,d=async(v,C)=>{const{headers:y,data:w,method:I,withCredentials:L,name:O,action:A,onProgress:N,onSuccess:D,onError:P,httpRequest:F}=t;try{C=await u(C??w,v)}catch{t.onRemove(v);return}const{uid:V}=v,U={headers:y||{},withCredentials:L,file:v,data:C,method:I,filename:O,action:A,onProgress:de=>{N(de,v)},onSuccess:de=>{D(de,v),delete o.value[V]},onError:de=>{P(de,v),delete o.value[V]}},Q=F(U);o.value[V]=Q,Q instanceof Promise&&Q.then(U.onSuccess,U.onError)},f=v=>{const C=v.target.files;C&&a(Array.from(C))},g=()=>{s.value||(r.value.value="",r.value.click())},p=()=>{g()};return e({abort:v=>{MEe(o.value).filter(v?([y])=>String(v.uid)===y:()=>!0).forEach(([y,w])=>{w instanceof XMLHttpRequest&&w.abort(),delete o.value[y]})},upload:c}),(v,C)=>(G(),he("div",{class:Y([T(i).b(),T(i).m(v.listType),T(i).is("drag",v.drag),T(i).is("disabled",T(s))]),tabindex:T(s)?"-1":"0",onClick:g,onKeydown:xs(bn(p,["self"]),["enter","space"])},[v.drag?(G(),nt(ggt,{key:0,disabled:T(s),onFile:a},{default:_e(()=>[Ye(v.$slots,"default")]),_:3},8,["disabled"])):Ye(v.$slots,"default",{key:1}),oe("input",{ref_key:"inputRef",ref:r,class:Y(T(i).e("input")),name:v.name,disabled:T(s),multiple:v.multiple,accept:v.accept,type:"file",onChange:f,onClick:bn(()=>{},["stop"])},null,42,["name","disabled","multiple","accept","onClick"])],42,["tabindex","onKeydown"]))}});var she=Rt(_gt,[["__file","upload-content.vue"]]);const ohe="ElUpload",rhe=n=>{var e;(e=n.url)!=null&&e.startsWith("blob:")&&URL.revokeObjectURL(n.url)},vgt=(n,e)=>{const t=yEe(n,"fileList",void 0,{passive:!0}),i=p=>t.value.find(_=>_.uid===p.uid);function s(p){var _;(_=e.value)==null||_.abort(p)}function o(p=["ready","uploading","success","fail"]){t.value=t.value.filter(_=>!p.includes(_.status))}function r(p){t.value=t.value.filter(_=>_!==p)}const a=(p,_)=>{const v=i(_);v&&(console.error(p),v.status="fail",r(v),n.onError(p,v,t.value),n.onChange(v,t.value))},c=(p,_)=>{const v=i(_);v&&(n.onProgress(p,v,t.value),v.status="uploading",v.percentage=Math.round(p.percent))},u=(p,_)=>{const v=i(_);v&&(v.status="success",v.response=p,n.onSuccess(p,v,t.value),n.onChange(v,t.value))},d=p=>{Ul(p.uid)&&(p.uid=mY());const _={name:p.name,percentage:0,status:"ready",size:p.size,raw:p,uid:p.uid};if(n.listType==="picture-card"||n.listType==="picture")try{_.url=URL.createObjectURL(p)}catch(v){v.message,n.onError(v,_,t.value)}t.value=[...t.value,_],n.onChange(_,t.value)},f=async p=>{const _=p instanceof File?i(p):p;_||Ll(ohe,"file to be removed not found");const v=C=>{s(C),r(C),n.onRemove(C,t.value),rhe(C)};n.beforeRemove?await n.beforeRemove(_,t.value)!==!1&&v(_):v(_)};function g(){t.value.filter(({status:p})=>p==="ready").forEach(({raw:p})=>{var _;return p&&((_=e.value)==null?void 0:_.upload(p))})}return ht(()=>n.listType,p=>{p!=="picture-card"&&p!=="picture"||(t.value=t.value.map(_=>{const{raw:v,url:C}=_;if(!C&&v)try{_.url=URL.createObjectURL(v)}catch(y){n.onError(y,_,t.value)}return _}))}),ht(t,p=>{for(const _ of p)_.uid||(_.uid=mY()),_.status||(_.status="success")},{immediate:!0,deep:!0}),{uploadFiles:t,abort:s,clearFiles:o,handleError:a,handleProgress:c,handleStart:d,handleSuccess:u,handleRemove:f,submit:g,revokeFileObjectURL:rhe}},bgt=$e({name:"ElUpload"}),Tgt=$e({...bgt,props:ogt,setup(n,{expose:e}){const t=n,i=gc(),s=us(),{abort:o,submit:r,clearFiles:a,uploadFiles:c,handleStart:u,handleError:d,handleRemove:f,handleSuccess:g,handleProgress:p,revokeFileObjectURL:_}=vgt(t,s),v=W(()=>t.listType==="picture-card"),C=W(()=>({...t,fileList:c.value,onStart:u,onProgress:p,onSuccess:g,onError:d,onRemove:f}));return As(()=>{c.value.forEach(_)}),pi(uIe,{accept:ds(t,"accept")}),e({abort:o,submit:r,clearFiles:a,handleStart:u,handleRemove:f}),(y,w)=>(G(),he("div",null,[T(v)&&y.showFileList?(G(),nt(ihe,{key:0,disabled:T(i),"list-type":y.listType,files:T(c),crossorigin:y.crossorigin,"handle-preview":y.onPreview,onRemove:T(f)},Hf({append:_e(()=>[ce(she,hi({ref_key:"uploadRef",ref:s},T(C)),{default:_e(()=>[y.$slots.trigger?Ye(y.$slots,"trigger",{key:0}):Qe("v-if",!0),!y.$slots.trigger&&y.$slots.default?Ye(y.$slots,"default",{key:1}):Qe("v-if",!0)]),_:3},16)]),_:2},[y.$slots.file?{name:"default",fn:_e(({file:I,index:L})=>[Ye(y.$slots,"file",{file:I,index:L})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):Qe("v-if",!0),!T(v)||T(v)&&!y.showFileList?(G(),nt(she,hi({key:1,ref_key:"uploadRef",ref:s},T(C)),{default:_e(()=>[y.$slots.trigger?Ye(y.$slots,"trigger",{key:0}):Qe("v-if",!0),!y.$slots.trigger&&y.$slots.default?Ye(y.$slots,"default",{key:1}):Qe("v-if",!0)]),_:3},16)):Qe("v-if",!0),y.$slots.trigger?Ye(y.$slots,"default",{key:2}):Qe("v-if",!0),Ye(y.$slots,"tip"),!T(v)&&y.showFileList?(G(),nt(ihe,{key:3,disabled:T(i),"list-type":y.listType,files:T(c),crossorigin:y.crossorigin,"handle-preview":y.onPreview,onRemove:T(f)},Hf({_:2},[y.$slots.file?{name:"default",fn:_e(({file:I,index:L})=>[Ye(y.$slots,"file",{file:I,index:L})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):Qe("v-if",!0)]))}});var Cgt=Rt(Tgt,[["__file","upload.vue"]]);const ygt=Nn(Cgt),Egt=Lt({zIndex:{type:Number,default:9},rotate:{type:Number,default:-22},width:Number,height:Number,image:String,content:{type:Ke([String,Array]),default:"Element Plus"},font:{type:Ke(Object)},gap:{type:Ke(Array),default:()=>[100,100]},offset:{type:Ke(Array)}});function Sgt(n){return n.replace(/([A-Z])/g,"-$1").toLowerCase()}function wgt(n){return Object.keys(n).map(e=>`${Sgt(e)}: ${n[e]};`).join(" ")}function Igt(){return window.devicePixelRatio||1}const Lgt=(n,e)=>{let t=!1;return n.removedNodes.length&&e&&(t=Array.from(n.removedNodes).includes(e)),n.type==="attributes"&&n.target===e&&(t=!0),t},gIe=3;function b9(n,e,t=1){const i=document.createElement("canvas"),s=i.getContext("2d"),o=n*t,r=e*t;return i.setAttribute("width",`${o}px`),i.setAttribute("height",`${r}px`),s.save(),[s,i,o,r]}function Ogt(){function n(e,t,i,s,o,r,a,c){const[u,d,f,g]=b9(s,o,i);if(e instanceof HTMLImageElement)u.drawImage(e,0,0,f,g);else{const{color:ve,fontSize:Le,fontStyle:Ee,fontWeight:Ne,fontFamily:qe,textAlign:Re,textBaseline:we}=r,Ve=Number(Le)*i;u.font=`${Ee} normal ${Ne} ${Ve}px/${o}px ${qe}`,u.fillStyle=ve,u.textAlign=Re,u.textBaseline=we;const Ge=yt(e)?e:[e];Ge==null||Ge.forEach((dt,ze)=>{u.fillText(dt??"",f/2,ze*(Ve+gIe*i))})}const p=Math.PI/180*Number(t),_=Math.max(s,o),[v,C,y]=b9(_,_,i);v.translate(y/2,y/2),v.rotate(p),f>0&&g>0&&v.drawImage(d,-f/2,-g/2);function w(ve,Le){const Ee=ve*Math.cos(p)-Le*Math.sin(p),Ne=ve*Math.sin(p)+Le*Math.cos(p);return[Ee,Ne]}let I=0,L=0,O=0,A=0;const N=f/2,D=g/2;[[0-N,0-D],[0+N,0-D],[0+N,0+D],[0-N,0+D]].forEach(([ve,Le])=>{const[Ee,Ne]=w(ve,Le);I=Math.min(I,Ee),L=Math.max(L,Ee),O=Math.min(O,Ne),A=Math.max(A,Ne)});const F=I+y/2,V=O+y/2,U=L-I,Q=A-O,de=a*i,q=c*i,K=(U+de)*2,re=Q+q,[Z,J]=b9(K,re);function ge(ve=0,Le=0){Z.drawImage(C,F,V,U,Q,ve,Le,U,Q)}return ge(),ge(U+de,-Q/2-q/2),ge(U+de,+Q/2+q/2),[J.toDataURL(),K/i,re/i]}return n}const Rgt=$e({name:"ElWatermark"}),Mgt=$e({...Rgt,props:Egt,setup(n){const e=n,t={position:"relative"},i=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.color)!=null?V:"rgba(0,0,0,.15)"}),s=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.fontSize)!=null?V:16}),o=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.fontWeight)!=null?V:"normal"}),r=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.fontStyle)!=null?V:"normal"}),a=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.fontFamily)!=null?V:"sans-serif"}),c=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.textAlign)!=null?V:"center"}),u=W(()=>{var F,V;return(V=(F=e.font)==null?void 0:F.textBaseline)!=null?V:"hanging"}),d=W(()=>e.gap[0]),f=W(()=>e.gap[1]),g=W(()=>d.value/2),p=W(()=>f.value/2),_=W(()=>{var F,V;return(V=(F=e.offset)==null?void 0:F[0])!=null?V:g.value}),v=W(()=>{var F,V;return(V=(F=e.offset)==null?void 0:F[1])!=null?V:p.value}),C=()=>{const F={zIndex:e.zIndex,position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",backgroundRepeat:"repeat"};let V=_.value-g.value,U=v.value-p.value;return V>0&&(F.left=`${V}px`,F.width=`calc(100% - ${V}px)`,V=0),U>0&&(F.top=`${U}px`,F.height=`calc(100% - ${U}px)`,U=0),F.backgroundPosition=`${V}px ${U}px`,F},y=us(null),w=us(),I=te(!1),L=()=>{w.value&&(w.value.remove(),w.value=void 0)},O=(F,V)=>{var U;y.value&&w.value&&(I.value=!0,w.value.setAttribute("style",wgt({...C(),backgroundImage:`url('${F}')`,backgroundSize:`${Math.floor(V)}px`})),(U=y.value)==null||U.append(w.value),setTimeout(()=>{I.value=!1}))},A=F=>{let V=120,U=64;const Q=e.image,de=e.content,q=e.width,K=e.height;if(!Q&&F.measureText){F.font=`${Number(s.value)}px ${a.value}`;const re=yt(de)?de:[de],Z=re.map(J=>{const ge=F.measureText(J);return[ge.width,ge.fontBoundingBoxAscent!==void 0?ge.fontBoundingBoxAscent+ge.fontBoundingBoxDescent:ge.actualBoundingBoxAscent+ge.actualBoundingBoxDescent]});V=Math.ceil(Math.max(...Z.map(J=>J[0]))),U=Math.ceil(Math.max(...Z.map(J=>J[1])))*re.length+(re.length-1)*gIe}return[q??V,K??U]},N=Ogt(),D=()=>{const V=document.createElement("canvas").getContext("2d"),U=e.image,Q=e.content,de=e.rotate;if(V){w.value||(w.value=document.createElement("div"));const q=Igt(),[K,re]=A(V),Z=J=>{const[ge,ve]=N(J||"",de,q,K,re,{color:i.value,fontSize:s.value,fontStyle:r.value,fontWeight:o.value,fontFamily:a.value,textAlign:c.value,textBaseline:u.value},d.value,f.value);O(ge,ve)};if(U){const J=new Image;J.onload=()=>{Z(J)},J.onerror=()=>{Z(Q)},J.crossOrigin="anonymous",J.referrerPolicy="no-referrer",J.src=U}else Z(Q)}};return $n(()=>{D()}),ht(()=>e,()=>{D()},{deep:!0,flush:"post"}),As(()=>{L()}),CEe(y,F=>{I.value||F.forEach(V=>{Lgt(V,w.value)&&(L(),D())})},{attributes:!0,subtree:!0,childList:!0}),(F,V)=>(G(),he("div",{ref_key:"containerRef",ref:y,style:on([t])},[Ye(F.$slots,"default")],4))}});var kgt=Rt(Mgt,[["__file","watermark.vue"]]);const Agt=Nn(kgt),Ngt=Lt({zIndex:{type:Number,default:1001},visible:Boolean,fill:{type:String,default:"rgba(0,0,0,0.5)"},pos:{type:Ke(Object)},targetAreaClickable:{type:Boolean,default:!0}}),Dgt=(n,e,t,i,s)=>{const o=te(null),r=()=>{let f;return sn(n.value)?f=document.querySelector(n.value):ln(n.value)?f=n.value():f=n.value,f},a=()=>{const f=r();if(!f||!e.value){o.value=null;return}$gt(f)||f.scrollIntoView(s.value);const{left:g,top:p,width:_,height:v}=f.getBoundingClientRect();o.value={left:g,top:p,width:_,height:v,radius:0}};$n(()=>{ht([e,n],()=>{a()},{immediate:!0}),window.addEventListener("resize",a)}),As(()=>{window.removeEventListener("resize",a)});const c=f=>{var g;return(g=yt(t.value.offset)?t.value.offset[f]:t.value.offset)!=null?g:6},u=W(()=>{var f;if(!o.value)return o.value;const g=c(0),p=c(1),_=((f=t.value)==null?void 0:f.radius)||2;return{left:o.value.left-g,top:o.value.top-p,width:o.value.width+g*2,height:o.value.height+p*2,radius:_}}),d=W(()=>{const f=r();return!i.value||!f||!window.DOMRect?f||void 0:{getBoundingClientRect(){var g,p,_,v;return window.DOMRect.fromRect({width:((g=u.value)==null?void 0:g.width)||0,height:((p=u.value)==null?void 0:p.height)||0,x:((_=u.value)==null?void 0:_.left)||0,y:((v=u.value)==null?void 0:v.top)||0})}}});return{mergedPosInfo:u,triggerTarget:d}},F8=Symbol("ElTour");function $gt(n){const e=window.innerWidth||document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight,{top:i,right:s,bottom:o,left:r}=n.getBoundingClientRect();return i>=0&&r>=0&&s<=e&&o<=t}const xgt=(n,e,t,i,s,o,r,a)=>{const c=te(),u=te(),d=te({}),f={x:c,y:u,placement:i,strategy:s,middlewareData:d},g=W(()=>{const y=[Xwe(T(o)),Hht(),Bht(),Pgt()];return T(a)&&T(t)&&y.push(Ywe({element:T(t)})),y}),p=async()=>{if(!Si)return;const y=T(n),w=T(e);if(!y||!w)return;const I=await qwe(y,w,{placement:T(i),strategy:T(s),middleware:T(g)});YO(f).forEach(L=>{f[L].value=I[L]})},_=W(()=>{if(!T(n))return{position:"fixed",top:"50%",left:"50%",transform:"translate3d(-50%, -50%, 0)",maxWidth:"100vw",zIndex:T(r)};const{overflow:y}=T(d);return{position:T(s),zIndex:T(r),top:T(u)!=null?`${T(u)}px`:"",left:T(c)!=null?`${T(c)}px`:"",maxWidth:y!=null&&y.maxWidth?`${y==null?void 0:y.maxWidth}px`:""}}),v=W(()=>{if(!T(a))return{};const{arrow:y}=T(d);return{left:(y==null?void 0:y.x)!=null?`${y==null?void 0:y.x}px`:"",top:(y==null?void 0:y.y)!=null?`${y==null?void 0:y.y}px`:""}});let C;return $n(()=>{const y=T(n),w=T(e);y&&w&&(C=Pht(y,w,p)),Sl(()=>{p()})}),As(()=>{C&&C()}),{update:p,contentStyle:_,arrowStyle:v}},Pgt=()=>({name:"overflow",async fn(n){const e=await Fht(n);let t=0;return e.left>0&&(t=e.left),e.right>0&&(t=e.right),{data:{maxWidth:n.rects.floating.width-t}}}}),Fgt=$e({name:"ElTourMask",inheritAttrs:!1}),Bgt=$e({...Fgt,props:Ngt,setup(n){const e=n,{ns:t}=Kt(F8),i=W(()=>{var a,c;return(c=(a=e.pos)==null?void 0:a.radius)!=null?c:2}),s=W(()=>{const a=i.value,c=`a${a},${a} 0 0 1`;return{topRight:`${c} ${a},${a}`,bottomRight:`${c} ${-a},${a}`,bottomLeft:`${c} ${-a},${-a}`,topLeft:`${c} ${a},${-a}`}}),o=W(()=>{const a=window.innerWidth,c=window.innerHeight,u=s.value,d=`M${a},0 L0,0 L0,${c} L${a},${c} L${a},0 Z`,f=i.value;return e.pos?`${d} M${e.pos.left+f},${e.pos.top} h${e.pos.width-f*2} ${u.topRight} v${e.pos.height-f*2} ${u.bottomRight} h${-e.pos.width+f*2} ${u.bottomLeft} v${-e.pos.height+f*2} ${u.topLeft} z`:d}),r=W(()=>({fill:e.fill,pointerEvents:"auto",cursor:"auto"}));return Dte(ds(e,"visible"),{ns:t}),(a,c)=>a.visible?(G(),he("div",hi({key:0,class:T(t).e("mask"),style:{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:a.zIndex,pointerEvents:a.pos&&a.targetAreaClickable?"none":"auto"}},a.$attrs),[(G(),he("svg",{style:{width:"100%",height:"100%"}},[oe("path",{class:Y(T(t).e("hollow")),style:on(T(r)),d:T(o)},null,14,["d"])]))],16)):Qe("v-if",!0)}});var Hgt=Rt(Bgt,[["__file","mask.vue"]]);const Vgt=["absolute","fixed"],Ugt=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],gne=Lt({placement:{type:Ke(String),values:Ugt,default:"bottom"},reference:{type:Ke(Object),default:null},strategy:{type:Ke(String),values:Vgt,default:"absolute"},offset:{type:Number,default:10},showArrow:Boolean,zIndex:{type:Number,default:2001}}),Wgt={close:()=>!0},Ggt=$e({name:"ElTourContent"}),zgt=$e({...Ggt,props:gne,emits:Wgt,setup(n,{emit:e}){const t=n,i=te(t.placement),s=te(t.strategy),o=te(null),r=te(null);ht(()=>t.placement,()=>{i.value=t.placement});const{contentStyle:a,arrowStyle:c}=xgt(ds(t,"reference"),o,r,i,s,ds(t,"offset"),ds(t,"zIndex"),ds(t,"showArrow")),u=W(()=>i.value.split("-")[0]),{ns:d}=Kt(F8),f=()=>{e("close")},g=p=>{p.detail.focusReason==="pointer"&&p.preventDefault()};return(p,_)=>(G(),he("div",{ref_key:"contentRef",ref:o,style:on(T(a)),class:Y(T(d).e("content")),"data-side":T(u),tabindex:"-1"},[ce(T(rM),{loop:"",trapped:"","focus-start-el":"container","focus-trap-el":o.value||void 0,onReleaseRequested:f,onFocusoutPrevented:g},{default:_e(()=>[Ye(p.$slots,"default")]),_:3},8,["focus-trap-el"]),p.showArrow?(G(),he("span",{key:0,ref_key:"arrowRef",ref:r,style:on(T(c)),class:Y(T(d).e("arrow"))},null,6)):Qe("v-if",!0)],14,["data-side"]))}});var Kgt=Rt(zgt,[["__file","content.vue"]]),jgt=$e({name:"ElTourSteps",props:{current:{type:Number,default:0}},emits:["update-total"],setup(n,{slots:e,emit:t}){let i=0;return()=>{var s,o;const r=(s=e.default)==null?void 0:s.call(e),a=[];let c=0;function u(d){yt(d)&&d.forEach(f=>{var g;((g=(f==null?void 0:f.type)||{})==null?void 0:g.name)==="ElTourStep"&&(a.push(f),c+=1)})}return r.length&&u(kC((o=r[0])==null?void 0:o.children)),i!==c&&(i=c,t("update-total",c)),a.length?a[n.current]:null}}});const Xgt=Lt({modelValue:Boolean,current:{type:Number,default:0},showArrow:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeIcon:{type:ks},placement:gne.placement,contentStyle:{type:Ke([Object])},mask:{type:Ke([Boolean,Object]),default:!0},gap:{type:Ke(Object),default:()=>({offset:6,radius:2})},zIndex:{type:Number},scrollIntoViewOptions:{type:Ke([Boolean,Object]),default:()=>({block:"center"})},type:{type:Ke(String)},appendTo:{type:Ke([String,Object]),default:"body"},closeOnPressEscape:{type:Boolean,default:!0},targetAreaClickable:{type:Boolean,default:!0}}),Ygt={[Kn]:n=>Us(n),"update:current":n=>gn(n),close:n=>gn(n),finish:()=>!0,change:n=>gn(n)},qgt=$e({name:"ElTour"}),Jgt=$e({...qgt,props:Xgt,emits:Ygt,setup(n,{emit:e}){const t=n,i=vt("tour"),s=te(0),o=te(),r=yEe(t,"current",e,{passive:!0}),a=W(()=>{var P;return(P=o.value)==null?void 0:P.target}),c=W(()=>[i.b(),C.value==="primary"?i.m("primary"):""]),u=W(()=>{var P;return((P=o.value)==null?void 0:P.placement)||t.placement}),d=W(()=>{var P,F;return(F=(P=o.value)==null?void 0:P.contentStyle)!=null?F:t.contentStyle}),f=W(()=>{var P,F;return(F=(P=o.value)==null?void 0:P.mask)!=null?F:t.mask}),g=W(()=>!!f.value&&t.modelValue),p=W(()=>Us(f.value)?void 0:f.value),_=W(()=>{var P,F;return!!a.value&&((F=(P=o.value)==null?void 0:P.showArrow)!=null?F:t.showArrow)}),v=W(()=>{var P,F;return(F=(P=o.value)==null?void 0:P.scrollIntoViewOptions)!=null?F:t.scrollIntoViewOptions}),C=W(()=>{var P,F;return(F=(P=o.value)==null?void 0:P.type)!=null?F:t.type}),{nextZIndex:y}=sM(),w=y(),I=W(()=>{var P;return(P=t.zIndex)!=null?P:w}),{mergedPosInfo:L,triggerTarget:O}=Dgt(a,ds(t,"modelValue"),ds(t,"gap"),f,v);ht(()=>t.modelValue,P=>{P||(r.value=0)});const A=()=>{t.closeOnPressEscape&&(e("update:modelValue",!1),e("close",r.value))},N=P=>{s.value=P},D=dl();return pi(F8,{currentStep:o,current:r,total:s,showClose:ds(t,"showClose"),closeIcon:ds(t,"closeIcon"),mergedType:C,ns:i,slots:D,updateModelValue(P){e("update:modelValue",P)},onClose(){e("close",r.value)},onFinish(){e("finish")},onChange(){e("change",r.value)}}),(P,F)=>(G(),he(Qt,null,[ce(T(lM),{to:P.appendTo},{default:_e(()=>{var V,U;return[oe("div",hi({class:T(c)},P.$attrs),[ce(Hgt,{visible:T(g),fill:(V=T(p))==null?void 0:V.color,style:on((U=T(p))==null?void 0:U.style),pos:T(L),"z-index":T(I),"target-area-clickable":P.targetAreaClickable},null,8,["visible","fill","style","pos","z-index","target-area-clickable"]),P.modelValue?(G(),nt(Kgt,{key:T(r),reference:T(O),placement:T(u),"show-arrow":T(_),"z-index":T(I),style:on(T(d)),onClose:A},{default:_e(()=>[ce(T(jgt),{current:T(r),onUpdateTotal:N},{default:_e(()=>[Ye(P.$slots,"default")]),_:3},8,["current"])]),_:3},8,["reference","placement","show-arrow","z-index","style"])):Qe("v-if",!0)],16)]}),_:3},8,["to"]),Qe(" just for IDE "),Qe("v-if",!0)],64))}});var Qgt=Rt(Jgt,[["__file","tour.vue"]]);const Zgt=Lt({target:{type:Ke([String,Object,Function])},title:String,description:String,showClose:{type:Boolean,default:void 0},closeIcon:{type:ks},showArrow:{type:Boolean,default:void 0},placement:gne.placement,mask:{type:Ke([Boolean,Object]),default:void 0},contentStyle:{type:Ke([Object])},prevButtonProps:{type:Ke(Object)},nextButtonProps:{type:Ke(Object)},scrollIntoViewOptions:{type:Ke([Boolean,Object]),default:void 0},type:{type:Ke(String)}}),ept={close:()=>!0},tpt=$e({name:"ElTourStep"}),npt=$e({...tpt,props:Zgt,emits:ept,setup(n,{emit:e}){const t=n,{Close:i}=ite,{t:s}=wi(),{currentStep:o,current:r,total:a,showClose:c,closeIcon:u,mergedType:d,ns:f,slots:g,updateModelValue:p,onClose:_,onFinish:v,onChange:C}=Kt(F8);ht(t,D=>{o.value=D},{immediate:!0});const y=W(()=>{var D;return(D=t.showClose)!=null?D:c.value}),w=W(()=>{var D,P;return(P=(D=t.closeIcon)!=null?D:u.value)!=null?P:i}),I=D=>{if(D)return e7e(D,["children","onClick"])},L=()=>{var D,P;r.value-=1,(D=t.prevButtonProps)!=null&&D.onClick&&((P=t.prevButtonProps)==null||P.onClick()),C()},O=()=>{var D;r.value>=a.value-1?A():r.value+=1,(D=t.nextButtonProps)!=null&&D.onClick&&t.nextButtonProps.onClick(),C()},A=()=>{N(),v()},N=()=>{p(!1),_(),e("close")};return(D,P)=>(G(),he(Qt,null,[T(y)?(G(),he("button",{key:0,"aria-label":"Close",class:Y(T(f).e("closebtn")),type:"button",onClick:N},[ce(T(tn),{class:Y(T(f).e("close"))},{default:_e(()=>[(G(),nt(ui(T(w))))]),_:1},8,["class"])],2)):Qe("v-if",!0),oe("header",{class:Y([T(f).e("header"),{"show-close":T(c)}])},[Ye(D.$slots,"header",{},()=>[oe("span",{role:"heading",class:Y(T(f).e("title"))},st(D.title),3)])],2),oe("div",{class:Y(T(f).e("body"))},[Ye(D.$slots,"default",{},()=>[oe("span",null,st(D.description),1)])],2),oe("footer",{class:Y(T(f).e("footer"))},[oe("div",{class:Y(T(f).b("indicators"))},[T(g).indicators?(G(),nt(ui(T(g).indicators),{key:0,current:T(r),total:T(a)},null,8,["current","total"])):(G(!0),he(Qt,{key:1},fi(T(a),(F,V)=>(G(),he("span",{key:F,class:Y([T(f).b("indicator"),V===T(r)?"is-active":""])},null,2))),128))],2),oe("div",{class:Y(T(f).b("buttons"))},[T(r)>0?(G(),nt(T(_a),hi({key:0,size:"small",type:T(d)},I(D.prevButtonProps),{onClick:L}),{default:_e(()=>{var F,V;return[mn(st((V=(F=D.prevButtonProps)==null?void 0:F.children)!=null?V:T(s)("el.tour.previous")),1)]}),_:1},16,["type"])):Qe("v-if",!0),T(r)<=T(a)-1?(G(),nt(T(_a),hi({key:1,size:"small",type:T(d)==="primary"?"default":"primary"},I(D.nextButtonProps),{onClick:O}),{default:_e(()=>{var F,V;return[mn(st((V=(F=D.nextButtonProps)==null?void 0:F.children)!=null?V:T(r)===T(a)-1?T(s)("el.tour.finish"):T(s)("el.tour.next")),1)]}),_:1},16,["type"])):Qe("v-if",!0)],2)],2)],64))}});var pIe=Rt(npt,[["__file","step.vue"]]);const ipt=Nn(Qgt,{TourStep:pIe}),spt=Xo(pIe),opt=Lt({container:{type:Ke([String,Object])},offset:{type:Number,default:0},bound:{type:Number,default:15},duration:{type:Number,default:300},marker:{type:Boolean,default:!0},type:{type:Ke(String),default:"default"},direction:{type:Ke(String),default:"vertical"}}),rpt={change:n=>sn(n),click:(n,e)=>n instanceof MouseEvent&&(sn(e)||ys(e))},mIe=Symbol("anchor"),PH=n=>{if(!Si||n==="")return null;if(sn(n))try{return document.querySelector(n)}catch{return null}return n};function lpt(n){let e=0;const t=(...i)=>{e&&H0(e),e=QC(()=>{n(...i),e=0})};return t.cancel=()=>{H0(e),e=0},t}const apt=$e({name:"ElAnchor"}),cpt=$e({...apt,props:opt,emits:rpt,setup(n,{expose:e,emit:t}){const i=n,s=te(""),o=te(null),r=te(null),a=te(),c={};let u=!1,d=0;const f=vt("anchor"),g=W(()=>[f.b(),i.type==="underline"?f.m("underline"):"",f.m(i.direction)]),p=D=>{c[D.href]=D.el},_=D=>{delete c[D]},v=D=>{s.value!==D&&(s.value=D,t("change",D))};let C=null;const y=D=>{if(!a.value)return;const P=PH(D);if(!P)return;C&&C(),u=!0;const F=lue(P,a.value),V=OX(P,F),U=F.scrollHeight-F.clientHeight,Q=Math.min(V-i.offset,U);C=iKe(a.value,d,Q,i.duration,()=>{setTimeout(()=>{u=!1},20)})},w=D=>{D&&(v(D),y(D))},I=(D,P)=>{t("click",D,P),w(P)},L=lpt(()=>{a.value&&(d=aue(a.value));const D=O();u||ys(D)||v(D)}),O=()=>{if(!a.value)return;const D=aue(a.value),P=[];for(const F of Object.keys(c)){const V=PH(F);if(!V)continue;const U=lue(V,a.value),Q=OX(V,U);P.push({top:Q-i.offset-i.bound,href:F})}P.sort((F,V)=>F.top-V.top);for(let F=0;F<P.length;F++){const V=P[F],U=P[F+1];if(F===0&&D===0)return"";if(V.top<=D&&(!U||U.top>D))return V.href}},A=()=>{const D=PH(i.container);!D||_8(D)?a.value=window:a.value=D};Es(a,"scroll",L);const N=W(()=>{if(!o.value||!r.value||!s.value)return{};const D=c[s.value];if(!D)return{};const P=o.value.getBoundingClientRect(),F=r.value.getBoundingClientRect(),V=D.getBoundingClientRect();return i.direction==="horizontal"?{left:`${V.left-P.left}px`,width:`${V.width}px`,opacity:1}:{top:`${V.top-P.top+(V.height-F.height)/2}px`,opacity:1}});return $n(()=>{A();const D=decodeURIComponent(window.location.hash);PH(D)?w(D):L()}),ht(()=>i.container,()=>{A()}),pi(mIe,{ns:f,direction:i.direction,currentAnchor:s,addLink:p,removeLink:_,handleClick:I}),e({scrollTo:w}),(D,P)=>(G(),he("div",{ref_key:"anchorRef",ref:o,class:Y(T(g))},[D.marker?(G(),he("div",{key:0,ref_key:"markerRef",ref:r,class:Y(T(f).e("marker")),style:on(T(N))},null,6)):Qe("v-if",!0),oe("div",{class:Y(T(f).e("list"))},[Ye(D.$slots,"default")],2)],2))}});var upt=Rt(cpt,[["__file","anchor.vue"]]);const dpt=Lt({title:String,href:String}),hpt=$e({name:"ElAnchorLink"}),fpt=$e({...hpt,props:dpt,setup(n){const e=n,t=te(null),{ns:i,direction:s,currentAnchor:o,addLink:r,removeLink:a,handleClick:c}=Kt(mIe),u=W(()=>[i.e("link"),i.is("active",o.value===e.href)]),d=f=>{c(f,e.href)};return ht(()=>e.href,(f,g)=>{cn(()=>{g&&a(g),f&&r({href:f,el:t.value})})}),$n(()=>{const{href:f}=e;f&&r({href:f,el:t.value})}),As(()=>{const{href:f}=e;f&&a(f)}),(f,g)=>(G(),he("div",{class:Y(T(i).e("item"))},[oe("a",{ref_key:"linkRef",ref:t,class:Y(T(u)),href:f.href,onClick:d},[Ye(f.$slots,"default",{},()=>[mn(st(f.title),1)])],10,["href"]),f.$slots["sub-link"]&&T(s)==="vertical"?(G(),he("div",{key:0,class:Y(T(i).e("list"))},[Ye(f.$slots,"sub-link")],2)):Qe("v-if",!0)],2))}});var _Ie=Rt(fpt,[["__file","anchor-link.vue"]]);const gpt=Nn(upt,{AnchorLink:_Ie}),ppt=Xo(_Ie),mpt=Lt({direction:{type:Ke(String),default:"horizontal"},options:{type:Ke(Array),default:()=>[]},modelValue:{type:[String,Number,Boolean],default:void 0},block:Boolean,size:cl,disabled:Boolean,validateEvent:{type:Boolean,default:!0},id:String,name:String,...Wa(["ariaLabel"])}),_pt={[Kn]:n=>sn(n)||gn(n)||Us(n),[Ms]:n=>sn(n)||gn(n)||Us(n)},vpt=$e({name:"ElSegmented"}),bpt=$e({...vpt,props:mpt,emits:_pt,setup(n,{emit:e}){const t=n,i=vt("segmented"),s=Va(),o=jr(),r=gc(),{formItem:a}=fc(),{inputId:c,isLabeledByFormItem:u}=Qf(t,{formItemContext:a}),d=te(null),f=I7e(),g=Ki({isInit:!1,width:0,height:0,translateX:0,translateY:0,focusVisible:!1}),p=P=>{const F=_(P);e(Kn,F),e(Ms,F)},_=P=>si(P)?P.value:P,v=P=>si(P)?P.label:P,C=P=>!!(r.value||si(P)&&P.disabled),y=P=>t.modelValue===_(P),w=P=>t.options.find(F=>_(F)===P),I=P=>[i.e("item"),i.is("selected",y(P)),i.is("disabled",C(P))],L=()=>{if(!d.value)return;const P=d.value.querySelector(".is-selected"),F=d.value.querySelector(".is-selected input");if(!P||!F){g.width=0,g.height=0,g.translateX=0,g.translateY=0,g.focusVisible=!1;return}const V=P.getBoundingClientRect();g.isInit=!0,t.direction==="vertical"?(g.height=V.height,g.translateY=P.offsetTop):(g.width=V.width,g.translateX=P.offsetLeft);try{g.focusVisible=F.matches(":focus-visible")}catch{}},O=W(()=>[i.b(),i.m(o.value),i.is("block",t.block)]),A=W(()=>({width:t.direction==="vertical"?"100%":`${g.width}px`,height:t.direction==="vertical"?`${g.height}px`:"100%",transform:t.direction==="vertical"?`translateY(${g.translateY}px)`:`translateX(${g.translateX}px)`,display:g.isInit?"block":"none"})),N=W(()=>[i.e("item-selected"),i.is("disabled",C(w(t.modelValue))),i.is("focus-visible",g.focusVisible)]),D=W(()=>t.name||s.value);return wo(d,L),ht(f,L),ht(()=>t.modelValue,()=>{var P;L(),t.validateEvent&&((P=a==null?void 0:a.validate)==null||P.call(a,"change").catch(F=>void 0))},{flush:"post"}),(P,F)=>P.options.length?(G(),he("div",{key:0,id:T(c),ref_key:"segmentedRef",ref:d,class:Y(T(O)),role:"radiogroup","aria-label":T(u)?void 0:P.ariaLabel||"segmented","aria-labelledby":T(u)?T(a).labelId:void 0},[oe("div",{class:Y([T(i).e("group"),T(i).m(t.direction)])},[oe("div",{style:on(T(A)),class:Y(T(N))},null,6),(G(!0),he(Qt,null,fi(P.options,(V,U)=>(G(),he("label",{key:U,class:Y(I(V))},[oe("input",{class:Y(T(i).e("item-input")),type:"radio",name:T(D),disabled:C(V),checked:y(V),onChange:Q=>p(V)},null,42,["name","disabled","checked","onChange"]),oe("div",{class:Y(T(i).e("item-label"))},[Ye(P.$slots,"default",{item:V},()=>[mn(st(v(V)),1)])],2)],2))),128))],2)],10,["id","aria-label","aria-labelledby"])):Qe("v-if",!0)}});var Tpt=Rt(bpt,[["__file","segmented.vue"]]);const Cpt=Nn(Tpt),ypt=(n,e)=>{const t=n.toLowerCase();return(e.label||e.value).toLowerCase().includes(t)},Ept=(n,e,t)=>{const{selectionEnd:i}=n;if(i===null)return;const s=n.value,o=Gc(e);let r=-1,a;for(let c=i-1;c>=0;--c){const u=s[c];if(u===t||u===`
- `||u==="\r"){r=c;continue}if(o.includes(u)){const d=r===-1?i:r;a={pattern:s.slice(c+1,d),start:c+1,end:d,prefix:u,prefixIndex:c,splitIndex:r,selectionEnd:i};break}}return a},Spt=(n,e={debug:!1,useSelectionEnd:!1})=>{const t=n.selectionStart!==null?n.selectionStart:0,i=n.selectionEnd!==null?n.selectionEnd:0,s=e.useSelectionEnd?i:t,o=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];if(e.debug){const g=document.querySelector("#input-textarea-caret-position-mirror-div");g!=null&&g.parentNode&&g.parentNode.removeChild(g)}const r=document.createElement("div");r.id="input-textarea-caret-position-mirror-div",document.body.appendChild(r);const a=r.style,c=window.getComputedStyle(n),u=n.nodeName==="INPUT";a.whiteSpace=u?"nowrap":"pre-wrap",u||(a.wordWrap="break-word"),a.position="absolute",e.debug||(a.visibility="hidden"),o.forEach(g=>{if(u&&g==="lineHeight")if(c.boxSizing==="border-box"){const p=Number.parseInt(c.height),_=Number.parseInt(c.paddingTop)+Number.parseInt(c.paddingBottom)+Number.parseInt(c.borderTopWidth)+Number.parseInt(c.borderBottomWidth),v=_+Number.parseInt(c.lineHeight);p>v?a.lineHeight=`${p-_}px`:p===v?a.lineHeight=c.lineHeight:a.lineHeight="0"}else a.lineHeight=c.height;else a[g]=c[g]}),E8()?n.scrollHeight>Number.parseInt(c.height)&&(a.overflowY="scroll"):a.overflow="hidden",r.textContent=n.value.slice(0,Math.max(0,s)),u&&r.textContent&&(r.textContent=r.textContent.replace(/\s/g," "));const d=document.createElement("span");d.textContent=n.value.slice(Math.max(0,s))||".",d.style.position="relative",d.style.left=`${-n.scrollLeft}px`,d.style.top=`${-n.scrollTop}px`,r.appendChild(d);const f={top:d.offsetTop+Number.parseInt(c.borderTopWidth),left:d.offsetLeft+Number.parseInt(c.borderLeftWidth),height:Number.parseInt(c.fontSize)*1.5};return e.debug?d.style.backgroundColor="#aaa":document.body.removeChild(r),f.left>=n.clientWidth&&(f.left=n.clientWidth),f},wpt=Lt({...ote,options:{type:Ke(Array),default:()=>[]},prefix:{type:Ke([String,Array]),default:"@",validator:n=>sn(n)?n.length===1:n.every(e=>sn(e)&&e.length===1)},split:{type:String,default:" ",validator:n=>n.length===1},filterOption:{type:Ke([Boolean,Function]),default:()=>ypt,validator:n=>n===!1?!0:ln(n)},placement:{type:Ke(String),default:"bottom"},showArrow:Boolean,offset:{type:Number,default:0},whole:Boolean,checkIsWhole:{type:Ke(Function)},modelValue:String,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ke(Object),default:()=>({})}}),Ipt={[Kn]:n=>sn(n),search:(n,e)=>sn(n)&&sn(e),select:(n,e)=>sn(n.value)&&sn(e),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent},Lpt=Lt({options:{type:Ke(Array),default:()=>[]},loading:Boolean,disabled:Boolean,contentId:String,ariaLabel:String}),Opt={select:n=>sn(n.value)},Rpt=$e({name:"ElMentionDropdown"}),Mpt=$e({...Rpt,props:Lpt,emits:Opt,setup(n,{expose:e,emit:t}){const i=n,s=vt("mention"),{t:o}=wi(),r=te(-1),a=te(),c=te(),u=te(),d=(I,L)=>[s.be("dropdown","item"),s.is("hovering",r.value===L),s.is("disabled",I.disabled||i.disabled)],f=I=>{I.disabled||i.disabled||t("select",I)},g=I=>{r.value=I},p=W(()=>i.disabled||i.options.every(I=>I.disabled)),_=W(()=>i.options[r.value]),v=()=>{_.value&&t("select",_.value)},C=I=>{const{options:L}=i;if(L.length===0||p.value)return;I==="next"?(r.value++,r.value===L.length&&(r.value=0)):I==="prev"&&(r.value--,r.value<0&&(r.value=L.length-1));const O=L[r.value];if(O.disabled){C(I);return}cn(()=>y(O))},y=I=>{var L,O,A,N;const{options:D}=i,P=D.findIndex(V=>V.value===I.value),F=(L=c.value)==null?void 0:L[P];if(F){const V=(A=(O=u.value)==null?void 0:O.querySelector)==null?void 0:A.call(O,`.${s.be("dropdown","wrap")}`);V&&Qee(V,F)}(N=a.value)==null||N.handleScroll()};return ht(()=>i.options,()=>{p.value||i.options.length===0?r.value=-1:r.value=0},{immediate:!0}),e({hoveringIndex:r,navigateOptions:C,selectHoverOption:v,hoverOption:_}),(I,L)=>(G(),he("div",{ref_key:"dropdownRef",ref:u,class:Y(T(s).b("dropdown"))},[I.$slots.header?(G(),he("div",{key:0,class:Y(T(s).be("dropdown","header"))},[Ye(I.$slots,"header")],2)):Qe("v-if",!0),Un(ce(T(a_),{id:I.contentId,ref_key:"scrollbarRef",ref:a,tag:"ul","wrap-class":T(s).be("dropdown","wrap"),"view-class":T(s).be("dropdown","list"),role:"listbox","aria-label":I.ariaLabel,"aria-orientation":"vertical"},{default:_e(()=>[(G(!0),he(Qt,null,fi(I.options,(O,A)=>(G(),he("li",{id:`${I.contentId}-${A}`,ref_for:!0,ref_key:"optionRefs",ref:c,key:A,class:Y(d(O,A)),role:"option","aria-disabled":O.disabled||I.disabled||void 0,"aria-selected":r.value===A,onMousemove:N=>g(A),onClick:bn(N=>f(O),["stop"])},[Ye(I.$slots,"label",{item:O,index:A},()=>{var N;return[oe("span",null,st((N=O.label)!=null?N:O.value),1)]})],42,["id","aria-disabled","aria-selected","onMousemove","onClick"]))),128))]),_:3},8,["id","wrap-class","view-class","aria-label"]),[[Gi,I.options.length>0&&!I.loading]]),I.loading?(G(),he("div",{key:1,class:Y(T(s).be("dropdown","loading"))},[Ye(I.$slots,"loading",{},()=>[mn(st(T(o)("el.mention.loading")),1)])],2)):Qe("v-if",!0),I.$slots.footer?(G(),he("div",{key:2,class:Y(T(s).be("dropdown","footer"))},[Ye(I.$slots,"footer")],2)):Qe("v-if",!0)],2))}});var kpt=Rt(Mpt,[["__file","mention-dropdown.vue"]]);const Apt=$e({name:"ElMention",inheritAttrs:!1}),Npt=$e({...Apt,props:wpt,emits:Ipt,setup(n,{expose:e,emit:t}){const i=n,s=W(()=>$g(i,Object.keys(ote))),o=vt("mention"),r=gc(),a=Va(),c=te(),u=te(),d=te(),f=te(!1),g=te(),p=te(),_=W(()=>i.showArrow?i.placement:`${i.placement}-start`),v=W(()=>i.showArrow?["bottom","top"]:["bottom-start","top-start"]),C=W(()=>{const{filterOption:U,options:Q}=i;return!p.value||!U?Q:Q.filter(de=>U(p.value.pattern,de))}),y=W(()=>f.value&&(!!C.value.length||i.loading)),w=W(()=>{var U;return`${a.value}-${(U=d.value)==null?void 0:U.hoveringIndex}`}),I=U=>{t("update:modelValue",U),P()},L=U=>{var Q,de,q,K;if(!(!("code"in U)||(Q=c.value)!=null&&Q.isComposing))switch(U.code){case zt.left:case zt.right:P();break;case zt.up:case zt.down:if(!f.value)return;U.preventDefault(),(de=d.value)==null||de.navigateOptions(U.code===zt.up?"prev":"next");break;case zt.enter:case zt.numpadEnter:if(!f.value)return;U.preventDefault(),(q=d.value)!=null&&q.hoverOption?(K=d.value)==null||K.selectHoverOption():f.value=!1;break;case zt.esc:if(!f.value)return;U.preventDefault(),f.value=!1;break;case zt.backspace:if(i.whole&&p.value){const{splitIndex:re,selectionEnd:Z,pattern:J,prefixIndex:ge,prefix:ve}=p.value,Le=D();if(!Le)return;const Ee=Le.value,Ne=i.options.find(Re=>Re.value===J);if((ln(i.checkIsWhole)?i.checkIsWhole(J,ve):Ne)&&re!==-1&&re+1===Z){U.preventDefault();const Re=Ee.slice(0,ge)+Ee.slice(re+1);t(Kn,Re);const we=ge;cn(()=>{Le.selectionStart=we,Le.selectionEnd=we,V()})}}}},{wrapperRef:O}=$y(c,{beforeFocus(){return r.value},afterFocus(){P()},beforeBlur(U){var Q;return(Q=u.value)==null?void 0:Q.isFocusInsideContent(U)},afterBlur(){f.value=!1}}),A=()=>{P()},N=U=>{if(!p.value)return;const Q=D();if(!Q)return;const de=Q.value,{split:q}=i,K=de.slice(p.value.end),re=K.startsWith(q),Z=`${U.value}${re?"":q}`,J=de.slice(0,p.value.start)+Z+K;t(Kn,J),t("select",U,p.value.prefix);const ge=p.value.start+Z.length+(re?1:0);cn(()=>{Q.selectionStart=ge,Q.selectionEnd=ge,Q.focus(),V()})},D=()=>{var U,Q;return i.type==="textarea"?(U=c.value)==null?void 0:U.textarea:(Q=c.value)==null?void 0:Q.input},P=()=>{setTimeout(()=>{F(),V(),cn(()=>{var U;return(U=u.value)==null?void 0:U.updatePopper()})},0)},F=()=>{const U=D();if(!U)return;const Q=Spt(U),de=U.getBoundingClientRect(),q=c.value.$el.getBoundingClientRect();g.value={position:"absolute",width:0,height:`${Q.height}px`,left:`${Q.left+de.left-q.left}px`,top:`${Q.top+de.top-q.top}px`}},V=()=>{const U=D();if(document.activeElement!==U){f.value=!1;return}const{prefix:Q,split:de}=i;if(p.value=Ept(U,Q,de),p.value&&p.value.splitIndex===-1){f.value=!0,t("search",p.value.pattern,p.value.prefix);return}f.value=!1};return e({input:c,tooltip:u,dropdownVisible:y}),(U,Q)=>(G(),he("div",{ref_key:"wrapperRef",ref:O,class:Y(T(o).b())},[ce(T(Kc),hi(hi(T(s),U.$attrs),{ref_key:"elInputRef",ref:c,"model-value":U.modelValue,disabled:T(r),role:T(y)?"combobox":void 0,"aria-activedescendant":T(y)?T(w)||"":void 0,"aria-controls":T(y)?T(a):void 0,"aria-expanded":T(y)||void 0,"aria-label":U.ariaLabel,"aria-autocomplete":T(y)?"none":void 0,"aria-haspopup":T(y)?"listbox":void 0,onInput:I,onKeydown:L,onMousedown:A}),Hf({_:2},[fi(U.$slots,(de,q)=>({name:q,fn:_e(K=>[Ye(U.$slots,q,wf(nb(K)))])}))]),1040,["model-value","disabled","role","aria-activedescendant","aria-controls","aria-expanded","aria-label","aria-autocomplete","aria-haspopup"]),ce(T(uc),{ref_key:"tooltipRef",ref:u,visible:T(y),"popper-class":[T(o).e("popper"),U.popperClass],"popper-options":U.popperOptions,placement:T(_),"fallback-placements":T(v),effect:"light",pure:"",offset:U.offset,"show-arrow":U.showArrow},{default:_e(()=>[oe("div",{style:on(g.value)},null,4)]),content:_e(()=>{var de;return[ce(kpt,{ref_key:"dropdownRef",ref:d,options:T(C),disabled:T(r),loading:U.loading,"content-id":T(a),"aria-label":U.ariaLabel,onSelect:N,onClick:bn((de=c.value)==null?void 0:de.focus,["stop"])},Hf({_:2},[fi(U.$slots,(q,K)=>({name:K,fn:_e(re=>[Ye(U.$slots,K,wf(nb(re)))])}))]),1032,["options","disabled","loading","content-id","aria-label","onClick"])]}),_:3},8,["visible","popper-class","popper-options","placement","fallback-placements","offset","show-arrow"])],2))}});var Dpt=Rt(Npt,[["__file","mention.vue"]]);const $pt=Nn(Dpt);var xpt=[aKe,Aje,Iqe,_dt,Aqe,Bqe,pSe,Jqe,Qqe,_a,ySe,KJe,JJe,gQe,pQe,pZe,USe,CZe,Kf,RQe,NSe,IZe,UZe,WZe,L8,met,bet,Aet,Net,Det,$et,xet,lnt,_nt,vnt,Mnt,g0e,Hnt,Rit,Mit,kit,E0e,Mst,kst,tn,Ust,I0e,Kc,L0e,sot,uot,Mot,kot,Aot,Not,Bot,Mrt,xrt,zrt,dSe,x0e,HSe,UQe,VQe,tlt,rlt,flt,a_,V0,TW,urt,Klt,tat,nat,Cat,Iat,Y0e,Pat,Kat,jat,Zat,lut,aut,mdt,Adt,Ndt,tR,Fdt,Ltt,Gdt,Ydt,qdt,uc,sft,_ft,AW,xft,Zft,ygt,Agt,ipt,spt,gpt,ppt,Cpt,$pt];const _f="ElInfiniteScroll",Ppt=50,Fpt=200,Bpt=0,Hpt={delay:{type:Number,default:Fpt},distance:{type:Number,default:Bpt},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},pne=(n,e)=>Object.entries(Hpt).reduce((t,[i,s])=>{var o,r;const{type:a,default:c}=s,u=n.getAttribute(`infinite-scroll-${i}`);let d=(r=(o=e[u])!=null?o:u)!=null?r:c;return d=d==="false"?!1:d,d=a(d),t[i]=Number.isNaN(d)?c:d,t},{}),vIe=n=>{const{observer:e}=n[_f];e&&(e.disconnect(),delete n[_f].observer)},Vpt=(n,e)=>{const{container:t,containerEl:i,instance:s,observer:o,lastScrollTop:r}=n[_f],{disabled:a,distance:c}=pne(n,s),{clientHeight:u,scrollHeight:d,scrollTop:f}=i,g=f-r;if(n[_f].lastScrollTop=f,o||a||g<0)return;let p=!1;if(t===n)p=d-(u+f)<=c;else{const{clientTop:_,scrollHeight:v}=n,C=OX(n,i);p=f+u>=C+_+v-c}p&&e.call(s)};function T9(n,e){const{containerEl:t,instance:i}=n[_f],{disabled:s}=pne(n,i);s||t.clientHeight===0||(t.scrollHeight<=t.clientHeight?e.call(i):vIe(n))}const Upt={async mounted(n,e){const{instance:t,value:i}=e;ln(i)||Ll(_f,"'v-infinite-scroll' binding value must be a function"),await cn();const{delay:s,immediate:o}=pne(n,t),r=Jee(n,!0),a=r===window?document.documentElement:r,c=l0(Vpt.bind(null,n,i),s);if(r){if(n[_f]={instance:t,container:r,containerEl:a,delay:s,cb:i,onScroll:c,lastScrollTop:a.scrollTop},o){const u=new MutationObserver(l0(T9.bind(null,n,i),Ppt));n[_f].observer=u,u.observe(n,{childList:!0,subtree:!0}),T9(n,i)}r.addEventListener("scroll",c)}},unmounted(n){if(!n[_f])return;const{container:e,onScroll:t}=n[_f];e==null||e.removeEventListener("scroll",t),vIe(n)},async updated(n){if(!n[_f])await cn();else{const{containerEl:e,cb:t,observer:i}=n[_f];e.clientHeight&&i&&T9(n,t)}}},_Y=Upt;_Y.install=n=>{n.directive("InfiniteScroll",_Y)};const Wpt=_Y;function Gpt(n){let e;const t=te(!1),i=Ki({...n,originalPosition:"",originalOverflow:"",visible:!1});function s(g){i.text=g}function o(){const g=i.parent,p=f.ns;if(!g.vLoadingAddClassList){let _=g.getAttribute("loading-number");_=Number.parseInt(_)-1,_?g.setAttribute("loading-number",_.toString()):(qc(g,p.bm("parent","relative")),g.removeAttribute("loading-number")),qc(g,p.bm("parent","hidden"))}r(),d.unmount()}function r(){var g,p;(p=(g=f.$el)==null?void 0:g.parentNode)==null||p.removeChild(f.$el)}function a(){var g;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(c,400),i.visible=!1,(g=n.closed)==null||g.call(n))}function c(){if(!t.value)return;const g=i.parent;t.value=!1,g.vLoadingAddClassList=void 0,o()}const d=Fve($e({name:"ElLoading",setup(g,{expose:p}){const{ns:_,zIndex:v}=T8("loading");return p({ns:_,zIndex:v}),()=>{const C=i.spinner||i.svg,y=hn("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...C?{innerHTML:C}:{}},[hn("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),w=i.text?hn("p",{class:_.b("text")},[i.text]):void 0;return hn(Ta,{name:_.b("fade"),onAfterLeave:c},{default:_e(()=>[Un(ce("div",{style:{backgroundColor:i.background||""},class:[_.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[hn("div",{class:_.b("spinner")},[y,w])]),[[Gi,i.visible]])])})}}})),f=d.mount(document.createElement("div"));return{...Gl(i),setText:s,removeElLoadingChild:r,close:a,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let FH;const vY=function(n={}){if(!Si)return;const e=zpt(n);if(e.fullscreen&&FH)return FH;const t=Gpt({...e,closed:()=>{var s;(s=e.closed)==null||s.call(e),e.fullscreen&&(FH=void 0)}});Kpt(e,e.parent,t),lhe(e,e.parent,t),e.parent.vLoadingAddClassList=()=>lhe(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),cn(()=>t.visible.value=e.visible),e.fullscreen&&(FH=t),t},zpt=n=>{var e,t,i,s;let o;return sn(n.target)?o=(e=document.querySelector(n.target))!=null?e:document.body:o=n.target||document.body,{parent:o===document.body||n.body?document.body:o,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:o===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(s=n.visible)!=null?s:!0,beforeClose:n.beforeClose,closed:n.closed,target:o}},Kpt=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,s={};if(n.fullscreen)t.originalPosition.value=$v(document.body,"position"),t.originalOverflow.value=$v(document.body,"overflow"),s.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=$v(document.body,"position"),await cn();for(const o of["top","left"]){const r=o==="top"?"scrollTop":"scrollLeft";s[o]=`${n.target.getBoundingClientRect()[o]+document.body[r]+document.documentElement[r]-Number.parseInt($v(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${n.target.getBoundingClientRect()[o]}px`}else t.originalPosition.value=$v(e,"position");for(const[o,r]of Object.entries(s))t.$el.style[o]=r},lhe=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?qc(e,i.bm("parent","relative")):Of(e,i.bm("parent","relative")),n.fullscreen&&n.lock?Of(e,i.bm("parent","hidden")):qc(e,i.bm("parent","hidden"))},GU=Symbol("ElLoading"),ahe=(n,e)=>{var t,i,s,o;const r=e.instance,a=g=>si(e.value)?e.value[g]:void 0,c=g=>{const p=sn(g)&&(r==null?void 0:r[g])||g;return p&&te(p)},u=g=>c(a(g)||n.getAttribute(`element-loading-${bb(g)}`)),d=(t=a("fullscreen"))!=null?t:e.modifiers.fullscreen,f={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(i=a("target"))!=null?i:d?void 0:n,body:(s=a("body"))!=null?s:e.modifiers.body,lock:(o=a("lock"))!=null?o:e.modifiers.lock};n[GU]={options:f,instance:vY(f)}},jpt=(n,e)=>{for(const t of Object.keys(e))Ss(e[t])&&(e[t].value=n[t])},che={mounted(n,e){e.value&&ahe(n,e)},updated(n,e){const t=n[GU];e.oldValue!==e.value&&(e.value&&!e.oldValue?ahe(n,e):e.value&&e.oldValue?si(e.value)&&jpt(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[GU])==null||e.instance.close(),n[GU]=null}},Xpt={install(n){n.directive("loading",che),n.config.globalProperties.$loading=vY},directive:che,service:vY},bIe=["success","info","warning","error"],Dc=Ko({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Si?document.body:void 0}),Ypt=Lt({customClass:{type:String,default:Dc.customClass},center:{type:Boolean,default:Dc.center},dangerouslyUseHTMLString:{type:Boolean,default:Dc.dangerouslyUseHTMLString},duration:{type:Number,default:Dc.duration},icon:{type:ks,default:Dc.icon},id:{type:String,default:Dc.id},message:{type:Ke([String,Object,Function]),default:Dc.message},onClose:{type:Ke(Function),default:Dc.onClose},showClose:{type:Boolean,default:Dc.showClose},type:{type:String,values:bIe,default:Dc.type},plain:{type:Boolean,default:Dc.plain},offset:{type:Number,default:Dc.offset},zIndex:{type:Number,default:Dc.zIndex},grouping:{type:Boolean,default:Dc.grouping},repeatNum:{type:Number,default:Dc.repeatNum}}),qpt={destroy:()=>!0},xg=IZ([]),Jpt=n=>{const e=xg.findIndex(s=>s.id===n),t=xg[e];let i;return e>0&&(i=xg[e-1]),{current:t,prev:i}},Qpt=n=>{const{prev:e}=Jpt(n);return e?e.vm.exposed.bottom.value:0},Zpt=(n,e)=>xg.findIndex(i=>i.id===n)>0?16:e,emt=$e({name:"ElMessage"}),tmt=$e({...emt,props:Ypt,emits:qpt,setup(n,{expose:e}){const t=n,{Close:i}=ste,{ns:s,zIndex:o}=T8("message"),{currentZIndex:r,nextZIndex:a}=o,c=te(),u=te(!1),d=te(0);let f;const g=W(()=>t.type?t.type==="error"?"danger":t.type:"info"),p=W(()=>{const N=t.type;return{[s.bm("icon",N)]:N&&ny[N]}}),_=W(()=>t.icon||ny[t.type]||""),v=W(()=>Qpt(t.id)),C=W(()=>Zpt(t.id,t.offset)+v.value),y=W(()=>d.value+C.value),w=W(()=>({top:`${C.value}px`,zIndex:r.value}));function I(){t.duration!==0&&({stop:f}=B0(()=>{O()},t.duration))}function L(){f==null||f()}function O(){u.value=!1}function A({code:N}){N===zt.esc&&O()}return $n(()=>{I(),a(),u.value=!0}),ht(()=>t.repeatNum,()=>{L(),I()}),Es(document,"keydown",A),wo(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:y,close:O}),(N,D)=>(G(),nt(Ta,{name:T(s).b("fade"),onBeforeLeave:N.onClose,onAfterLeave:P=>N.$emit("destroy"),persisted:""},{default:_e(()=>[Un(oe("div",{id:N.id,ref_key:"messageRef",ref:c,class:Y([T(s).b(),{[T(s).m(N.type)]:N.type},T(s).is("center",N.center),T(s).is("closable",N.showClose),T(s).is("plain",N.plain),N.customClass]),style:on(T(w)),role:"alert",onMouseenter:L,onMouseleave:I},[N.repeatNum>1?(G(),nt(T(pSe),{key:0,value:N.repeatNum,type:T(g),class:Y(T(s).e("badge"))},null,8,["value","type","class"])):Qe("v-if",!0),T(_)?(G(),nt(T(tn),{key:1,class:Y([T(s).e("icon"),T(p)])},{default:_e(()=>[(G(),nt(ui(T(_))))]),_:1},8,["class"])):Qe("v-if",!0),Ye(N.$slots,"default",{},()=>[N.dangerouslyUseHTMLString?(G(),he(Qt,{key:1},[Qe(" Caution here, message could've been compromised, never use user's input as message "),oe("p",{class:Y(T(s).e("content")),innerHTML:N.message},null,10,["innerHTML"])],2112)):(G(),he("p",{key:0,class:Y(T(s).e("content"))},st(N.message),3))]),N.showClose?(G(),nt(T(tn),{key:2,class:Y(T(s).e("closeBtn")),onClick:bn(O,["stop"])},{default:_e(()=>[ce(T(i))]),_:1},8,["class","onClick"])):Qe("v-if",!0)],46,["id"]),[[Gi,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var nmt=Rt(tmt,[["__file","message.vue"]]);let imt=1;const TIe=n=>{const e=!n||sn(n)||Oo(n)||ln(n)?{message:n}:n,t={...Dc,...e};if(!t.appendTo)t.appendTo=document.body;else if(sn(t.appendTo)){let i=document.querySelector(t.appendTo);mh(i)||(i=document.body),t.appendTo=i}return Us(yg.grouping)&&!t.grouping&&(t.grouping=yg.grouping),gn(yg.duration)&&t.duration===3e3&&(t.duration=yg.duration),gn(yg.offset)&&t.offset===16&&(t.offset=yg.offset),Us(yg.showClose)&&!t.showClose&&(t.showClose=yg.showClose),t},smt=n=>{const e=xg.indexOf(n);if(e===-1)return;xg.splice(e,1);const{handler:t}=n;t.close()},omt=({appendTo:n,...e},t)=>{const i=`message_${imt++}`,s=e.onClose,o=document.createElement("div"),r={...e,id:i,onClose:()=>{s==null||s(),smt(d)},onDestroy:()=>{GC(null,o)}},a=ce(nmt,r,ln(r.message)||Oo(r.message)?{default:ln(r.message)?r.message:()=>r.message}:null);a.appContext=t||aR._context,GC(a,o),n.appendChild(o.firstElementChild);const c=a.component,d={id:i,vnode:a,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:a.component.props};return d},aR=(n={},e)=>{if(!Si)return{close:()=>{}};const t=TIe(n);if(t.grouping&&xg.length){const s=xg.find(({vnode:o})=>{var r;return((r=o.props)==null?void 0:r.message)===t.message});if(s)return s.props.repeatNum+=1,s.props.type=t.type,s.handler}if(gn(yg.max)&&xg.length>=yg.max)return{close:()=>{}};const i=omt(t,e);return xg.push(i),i.handler};bIe.forEach(n=>{aR[n]=(e={},t)=>{const i=TIe(e);return aR({...i,type:n},t)}});function rmt(n){for(const e of xg)(!n||n===e.props.type)&&e.handler.close()}aR.closeAll=rmt;aR._context=null;const po=$Ee(aR,"$message"),bY="_trap-focus-children",jS=[],uhe=n=>{if(jS.length===0)return;const e=jS[jS.length-1][bY];if(e.length>0&&n.code===zt.tab){if(e.length===1){n.preventDefault(),document.activeElement!==e[0]&&e[0].focus();return}const t=n.shiftKey,i=n.target===e[0],s=n.target===e[e.length-1];i&&t&&(n.preventDefault(),e[e.length-1].focus()),s&&!t&&(n.preventDefault(),e[0].focus())}},lmt={beforeMount(n){n[bY]=fue(n),jS.push(n),jS.length<=1&&document.addEventListener("keydown",uhe)},updated(n){cn(()=>{n[bY]=fue(n)})},unmounted(){jS.shift(),jS.length===0&&document.removeEventListener("keydown",uhe)}},amt=$e({name:"ElMessageBox",directives:{TrapFocus:lmt},components:{ElButton:_a,ElFocusTrap:rM,ElInput:Kc,ElOverlay:Nte,ElIcon:tn,...ste},inheritAttrs:!1,props:{buttonSize:{type:String,validator:J0e},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(n,{emit:e}){const{locale:t,zIndex:i,ns:s,size:o}=T8("message-box",W(()=>n.buttonSize)),{t:r}=t,{nextZIndex:a}=i,c=te(!1),u=Ki({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:Nm(Gm),cancelButtonLoadingIcon:Nm(Gm),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=W(()=>{const K=u.type;return{[s.bm("icon",K)]:K&&ny[K]}}),f=Va(),g=Va(),p=W(()=>u.icon||ny[u.type]||""),_=W(()=>!!u.message),v=te(),C=te(),y=te(),w=te(),I=te(),L=W(()=>u.confirmButtonClass);ht(()=>u.inputValue,async K=>{await cn(),n.boxType==="prompt"&&K!==null&&U()},{immediate:!0}),ht(()=>c.value,K=>{var re,Z;K&&(n.boxType!=="prompt"&&(u.autofocus?y.value=(Z=(re=I.value)==null?void 0:re.$el)!=null?Z:v.value:y.value=v.value),u.zIndex=a()),n.boxType==="prompt"&&(K?cn().then(()=>{var J;w.value&&w.value.$el&&(u.autofocus?y.value=(J=Q())!=null?J:v.value:y.value=v.value)}):(u.editorErrorMessage="",u.validateError=!1))});const O=W(()=>n.draggable),A=W(()=>n.overflow);u0e(v,C,O,A),$n(async()=>{await cn(),n.closeOnHashChange&&window.addEventListener("hashchange",N)}),As(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",N)});function N(){c.value&&(c.value=!1,cn(()=>{u.action&&e("action",u.action)}))}const D=()=>{n.closeOnClickModal&&V(u.distinguishCancelAndClose?"close":"cancel")},P=Ate(D),F=K=>{if(u.inputType!=="textarea")return K.preventDefault(),V("confirm")},V=K=>{var re;n.boxType==="prompt"&&K==="confirm"&&!U()||(u.action=K,u.beforeClose?(re=u.beforeClose)==null||re.call(u,K,u,N):N())},U=()=>{if(n.boxType==="prompt"){const K=u.inputPattern;if(K&&!K.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||r("el.messagebox.error"),u.validateError=!0,!1;const re=u.inputValidator;if(ln(re)){const Z=re(u.inputValue);if(Z===!1)return u.editorErrorMessage=u.inputErrorMessage||r("el.messagebox.error"),u.validateError=!0,!1;if(sn(Z))return u.editorErrorMessage=Z,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},Q=()=>{const K=w.value.$refs;return K.input||K.textarea},de=()=>{V("close")},q=()=>{n.closeOnPressEscape&&de()};return n.lockScroll&&Dte(c),{...Gl(u),ns:s,overlayEvent:P,visible:c,hasMessage:_,typeClass:d,contentId:f,inputId:g,btnSize:o,iconComponent:p,confirmButtonClasses:L,rootRef:v,focusStartRef:y,headerRef:C,inputRef:w,confirmRef:I,doClose:N,handleClose:de,onCloseRequested:q,handleWrapperClick:D,handleInputEnter:F,handleAction:V,t:r}}});function cmt(n,e,t,i,s,o){const r=Bt("el-icon"),a=Bt("close"),c=Bt("el-input"),u=Bt("el-button"),d=Bt("el-focus-trap"),f=Bt("el-overlay");return G(),nt(Ta,{name:"fade-in-linear",onAfterLeave:g=>n.$emit("vanish"),persisted:""},{default:_e(()=>[Un(ce(f,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:_e(()=>[oe("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:Y(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[ce(d,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:_e(()=>[oe("div",{ref:"rootRef",class:Y([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:on(n.customStyle),tabindex:"-1",onClick:bn(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(G(),he("div",{key:0,ref:"headerRef",class:Y([n.ns.e("header"),{"show-close":n.showClose}])},[oe("div",{class:Y(n.ns.e("title"))},[n.iconComponent&&n.center?(G(),nt(r,{key:0,class:Y([n.ns.e("status"),n.typeClass])},{default:_e(()=>[(G(),nt(ui(n.iconComponent)))]),_:1},8,["class"])):Qe("v-if",!0),oe("span",null,st(n.title),1)],2),n.showClose?(G(),he("button",{key:0,type:"button",class:Y(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:g=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:xs(bn(g=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[ce(r,{class:Y(n.ns.e("close"))},{default:_e(()=>[ce(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):Qe("v-if",!0)],2)):Qe("v-if",!0),oe("div",{id:n.contentId,class:Y(n.ns.e("content"))},[oe("div",{class:Y(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(G(),nt(r,{key:0,class:Y([n.ns.e("status"),n.typeClass])},{default:_e(()=>[(G(),nt(ui(n.iconComponent)))]),_:1},8,["class"])):Qe("v-if",!0),n.hasMessage?(G(),he("div",{key:1,class:Y(n.ns.e("message"))},[Ye(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(G(),nt(ui(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(G(),nt(ui(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:_e(()=>[mn(st(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):Qe("v-if",!0)],2),Un(oe("div",{class:Y(n.ns.e("input"))},[ce(c,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":g=>n.inputValue=g,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:Y({invalid:n.validateError}),onKeydown:xs(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),oe("div",{class:Y(n.ns.e("errormsg")),style:on({visibility:n.editorErrorMessage?"visible":"hidden"})},st(n.editorErrorMessage),7)],2),[[Gi,n.showInput]])],10,["id"]),oe("div",{class:Y(n.ns.e("btns"))},[n.showCancelButton?(G(),nt(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:Y([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:g=>n.handleAction("cancel"),onKeydown:xs(bn(g=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:_e(()=>[mn(st(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):Qe("v-if",!0),Un(ce(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:Y([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:g=>n.handleAction("confirm"),onKeydown:xs(bn(g=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:_e(()=>[mn(st(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[Gi,n.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[Gi,n.visible]])]),_:3},8,["onAfterLeave"])}var umt=Rt(amt,[["render",cmt],["__file","index.vue"]]);const vx=new Map,dmt=n=>{let e=document.body;return n.appendTo&&(sn(n.appendTo)&&(e=document.querySelector(n.appendTo)),mh(n.appendTo)&&(e=n.appendTo),mh(e)||(e=document.body)),e},hmt=(n,e,t=null)=>{const i=ce(umt,n,ln(n.message)||Oo(n.message)?{default:ln(n.message)?n.message:()=>n.message}:null);return i.appContext=t,GC(i,e),dmt(n).appendChild(e.firstElementChild),i.component},fmt=()=>document.createElement("div"),gmt=(n,e)=>{const t=fmt();n.onVanish=()=>{GC(null,t),vx.delete(s)},n.onAction=o=>{const r=vx.get(s);let a;n.showInput?a={value:s.inputValue,action:o}:a=o,n.callback?n.callback(a,i.proxy):o==="cancel"||o==="close"?n.distinguishCancelAndClose&&o!=="cancel"?r.reject("close"):r.reject("cancel"):r.resolve(a)};const i=hmt(n,t,e),s=i.proxy;for(const o in n)Wi(n,o)&&!Wi(s.$props,o)&&(s[o]=n[o]);return s.visible=!0,s};function dM(n,e=null){if(!Si)return Promise.reject();let t;return sn(n)||Oo(n)?n={message:n}:t=n.callback,new Promise((i,s)=>{const o=gmt(n,e??dM._context);vx.set(o,{options:n,callback:t,resolve:i,reject:s})})}const pmt=["alert","confirm","prompt"],mmt={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};pmt.forEach(n=>{dM[n]=_mt(n)});function _mt(n){return(e,t,i,s)=>{let o="";return si(t)?(i=t,o=""):ys(t)?o="":o=t,dM(Object.assign({title:o,message:e,type:"",...mmt[n]},i,{boxType:n}),s)}}dM.close=()=>{vx.forEach((n,e)=>{e.doClose()}),vx.clear()};dM._context=null;const zT=dM;zT.install=n=>{zT._context=n._context,n.config.globalProperties.$msgbox=zT,n.config.globalProperties.$messageBox=zT,n.config.globalProperties.$alert=zT.alert,n.config.globalProperties.$confirm=zT.confirm,n.config.globalProperties.$prompt=zT.prompt};const vmt=zT,CIe=["success","info","warning","error"],bmt=Lt({customClass:{type:String,default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:ks},id:{type:String,default:""},message:{type:Ke([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:Ke(Function),default:()=>{}},onClose:{type:Ke(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...CIe,""],default:""},zIndex:Number}),Tmt={destroy:()=>!0},Cmt=$e({name:"ElNotification"}),ymt=$e({...Cmt,props:bmt,emits:Tmt,setup(n,{expose:e}){const t=n,{ns:i,zIndex:s}=T8("notification"),{nextZIndex:o,currentZIndex:r}=s,{Close:a}=ite,c=te(!1);let u;const d=W(()=>{const I=t.type;return I&&ny[t.type]?i.m(I):""}),f=W(()=>t.type&&ny[t.type]||t.icon),g=W(()=>t.position.endsWith("right")?"right":"left"),p=W(()=>t.position.startsWith("top")?"top":"bottom"),_=W(()=>{var I;return{[p.value]:`${t.offset}px`,zIndex:(I=t.zIndex)!=null?I:r.value}});function v(){t.duration>0&&({stop:u}=B0(()=>{c.value&&y()},t.duration))}function C(){u==null||u()}function y(){c.value=!1}function w({code:I}){I===zt.delete||I===zt.backspace?C():I===zt.esc?c.value&&y():v()}return $n(()=>{v(),o(),c.value=!0}),Es(document,"keydown",w),e({visible:c,close:y}),(I,L)=>(G(),nt(Ta,{name:T(i).b("fade"),onBeforeLeave:I.onClose,onAfterLeave:O=>I.$emit("destroy"),persisted:""},{default:_e(()=>[Un(oe("div",{id:I.id,class:Y([T(i).b(),I.customClass,T(g)]),style:on(T(_)),role:"alert",onMouseenter:C,onMouseleave:v,onClick:I.onClick},[T(f)?(G(),nt(T(tn),{key:0,class:Y([T(i).e("icon"),T(d)])},{default:_e(()=>[(G(),nt(ui(T(f))))]),_:1},8,["class"])):Qe("v-if",!0),oe("div",{class:Y(T(i).e("group"))},[oe("h2",{class:Y(T(i).e("title")),textContent:st(I.title)},null,10,["textContent"]),Un(oe("div",{class:Y(T(i).e("content")),style:on(I.title?void 0:{margin:0})},[Ye(I.$slots,"default",{},()=>[I.dangerouslyUseHTMLString?(G(),he(Qt,{key:1},[Qe(" Caution here, message could've been compromised, never use user's input as message "),oe("p",{innerHTML:I.message},null,8,["innerHTML"])],2112)):(G(),he("p",{key:0},st(I.message),1))])],6),[[Gi,I.message]]),I.showClose?(G(),nt(T(tn),{key:0,class:Y(T(i).e("closeBtn")),onClick:bn(y,["stop"])},{default:_e(()=>[ce(T(a))]),_:1},8,["class","onClick"])):Qe("v-if",!0)],2)],46,["id","onClick"]),[[Gi,c.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var Emt=Rt(ymt,[["__file","notification.vue"]]);const NW={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},TY=16;let Smt=1;const cR=function(n={},e){if(!Si)return{close:()=>{}};(sn(n)||Oo(n))&&(n={message:n});const t=n.position||"top-right";let i=n.offset||0;NW[t].forEach(({vm:d})=>{var f;i+=(((f=d.el)==null?void 0:f.offsetHeight)||0)+TY}),i+=TY;const s=`notification_${Smt++}`,o=n.onClose,r={...n,offset:i,id:s,onClose:()=>{wmt(s,t,o)}};let a=document.body;mh(n.appendTo)?a=n.appendTo:sn(n.appendTo)&&(a=document.querySelector(n.appendTo)),mh(a)||(a=document.body);const c=document.createElement("div"),u=ce(Emt,r,ln(r.message)?r.message:Oo(r.message)?()=>r.message:null);return u.appContext=ys(e)?cR._context:e,u.props.onDestroy=()=>{GC(null,c)},GC(u,c),NW[t].push({vm:u}),a.appendChild(c.firstElementChild),{close:()=>{u.component.exposed.visible.value=!1}}};CIe.forEach(n=>{cR[n]=(e={},t)=>((sn(e)||Oo(e))&&(e={message:e}),cR({...e,type:n},t))});function wmt(n,e,t){const i=NW[e],s=i.findIndex(({vm:u})=>{var d;return((d=u.component)==null?void 0:d.props.id)===n});if(s===-1)return;const{vm:o}=i[s];if(!o)return;t==null||t(o);const r=o.el.offsetHeight,a=e.split("-")[0];i.splice(s,1);const c=i.length;if(!(c<1))for(let u=s;u<c;u++){const{el:d,component:f}=i[u].vm,g=Number.parseInt(d.style[a],10)-r-TY;f.props.offset=g}}function Imt(){for(const n of Object.values(NW))n.forEach(({vm:e})=>{e.component.exposed.visible.value=!1})}cR.closeAll=Imt;cR._context=null;const Lmt=$Ee(cR,"$notify");var Omt=[Wpt,Xpt,po,vmt,Lmt,$0e],Rmt=Q7e([...xpt,...Omt]);const Mmt={class:"device"},kmt={span:24,class:"device_connect"},Amt={span:24,class:"device_connect"},Nmt={class:"device_connect"},Dmt={class:"device_connect device_connect_btn"},$mt={__name:"device",setup(n){const{t:e}=Jf(),t=te(e("message.software_not_connection")),i=te(0),s=te([{id:1,path:e("message.no_port_detected")}]);gU.useUploaders(),gU.usePrintData();const o=te(e("message.no_port_detected")),r=te(null),a=te("");gU.useDeveics(),Os.CancelToken.source();const u=Yc.useyPythonCodeStore();$n(()=>{a.value=localStorage.getItem("deviceType")});const d=async()=>{if(r.value&&r.value.id){if(u.pythonCode==""){po({message:e("message.running_code_error"),type:"error"});return}}else return;i.value=0;let p={comname:o.value,sid:r.value.id,code:u.pythonCode,type:!0};t.value=e("message.running_code"),await Os({url:`${r.value.io.uri}/pythonupload`,method:"post",data:p,onDownloadProgress:function(_){console.log(_),i.value=_.loaded/_.total*100,t.value=e("message.running_code_success")}})},f=async()=>{if(r.value&&r.value.id){if(u.pythonCode==""){po({message:e("message.uploading_error"),type:"error"});return}}else return;t.value=e("message.uploading");let p=a.value=="AI"?"sd/user_latest_code.py":"user_latest_code.py",_=`import os
- os.remove("${p}")`;(await Os({url:`${r.value.io.uri}/pythonupload`,method:"post",data:{comname:o.value,sid:r.value.id,code:_,type:!0}})).data=="success"?await Os({url:`${r.value.io.uri}/pythonuploadfile`,method:"post",data:{comname:o.value,sid:r.value.id,code:u.pythonCode,name:p},onDownloadProgress:function(C){console.log(C),i.value=C.loaded/C.total*100,t.value="上传成功"}}):t.value=e("message.uploading_error")},g=()=>{if(console.log("重置设备"),!(r.value&&r.value.id))return;let p={comname:o.value,sid:r.value.id};Os.post(`${r.value.io.uri}/pythonreset`,p).then(_=>{console.log(_),_.data=="success"?po({message:e("message.reset_device_success"),type:"success"}):po({message:e("message.reset_device_error"),type:"warning"})})};return(p,_)=>{const v=Bt("el-progress"),C=Bt("el-option"),y=Bt("el-select"),w=Bt("el-button");return G(),he("div",Mmt,[ce(r3e),oe("div",kmt,[oe("span",null,st(t.value),1)]),oe("div",Amt,[ce(v,{percentage:i.value},null,8,["percentage"])]),oe("div",Nmt,[ce(y,{modelValue:o.value,"onUpdate:modelValue":_[0]||(_[0]=I=>o.value=I),style:{width:"200px"}},{default:_e(()=>[(G(!0),he(Qt,null,fi(s.value,I=>(G(),nt(C,{disabled:!I.path,key:I.path,value:I.path},{default:_e(()=>[mn(st(I.path),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue"])]),oe("div",Dmt,[oe("div",null,[ce(w,{disabled:o.value==T(e)("message.no_port_detected"),type:o.value==T(e)("message.no_port_detected")?"":"primary",onClick:d},{default:_e(()=>[mn(st(p.$t("message.running")),1)]),_:1},8,["disabled","type"]),ce(w,{disabled:o.value==T(e)("message.no_port_detected"),type:o.value==T(e)("message.no_port_detected")?"":"primary",onClick:f},{default:_e(()=>[mn(st(p.$t("message.upload")),1)]),_:1},8,["disabled","type"]),a.value=="AI"?(G(),nt(w,{key:0,disabled:o.value==T(e)("message.no_port_detected"),type:o.value==T(e)("message.no_port_detected")?"":"primary"},{default:_e(()=>[mn(st(p.$t("message.initialization")),1)]),_:1},8,["disabled","type"])):Qe("",!0)]),oe("div",null,[ce(w,{disabled:o.value==T(e)("message.no_port_detected"),type:"primary",onClick:g},{default:_e(()=>[mn(st(p.$t("message.reset_device")),1)]),_:1},8,["disabled"])])])])}}},xmt=Oh($mt,[["__scopeId","data-v-3a194e22"]]),Pmt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADydJREFUeF7tXXuMHlUVP2d2VaJW64PwSIglNJIYLbtz74rQGLfykOIjApaoqOFhWsvDqIlo4A/xD4hiokYetY0gUVFDhRofVHnoGlMQ997ZBY0RUyKGRGlQrFQN6u4cv2l26ZZ9zL0z883Mne/3JU3a9Nx7z/md+7vnnDtz7zB1/KeUermIvJmZN4rIGDMfSUTZn5d03PSqzfsXET0lIk8x86SI7GbmX1pr/1H1QG3qj9ukTNW6aK0vF5Eriei4qvtGfwcReIKZrzfG3NhVPDpJEK31uIhcRURndNVxLbPrXma+zhgz0TK9SqvTOYIopbYS0c2lkUEHRRC41Fq7rUjDtrbpFEGUUlcQ0VfaCvaA6PVRa+0NXbG1MwRRSm0ioju64pjA7TjfWrszcBsOqt8JgsRxrJjZdMEhXbFBRHSSJDZ0ezpBEK31dhHZHLozuqQ/M+8wxmwJ3abgCYLo0d4p2IUo0gWCXMXM17Z3mgyuZiJydZIk14WMQPAE0VrfJyKnheyErurOzPcbY04P2b7gCaKUkpAd0HXdrbVBz7GglY/jeB0zP9z1SRayfSJyUpIkj4RqQ9AE0Vp/UES+ESr4g6A3M3/IGPPNUG0NmiBxHF/DzJ+pGPxpIpoWkYejKMr+3vlfmqYjzHwSEY3M/anMZhH5bJIk11TWYc0dgSCHAM/SgE9aa++p2QetGk4pdWbvKMAXiGhdFYqBIFWgWLCPqiJI74zITcaYywuq0clmWusbe2c/LitrHAhSFsES7asgCDN/2BhzSwk1OttUa32JiHytjIEgSBn0SratgCAT1toNJdXodHOl1M+JaLyokSBIUeQqaFeWIFEUrZ+cnHygAlU628XY2NipaZruKWogCFIUuQralSTILmvtuRWo0fkulFJ3EdE5RQwFQYqgVlGbMgQJ3XEVQejUzSDjPLDbvL2bOd5ujLnbaYYMuJDW+uzejTA/LgJD6AvRwBKEiFZ3/cqaIhN6qTbZ1UlEtL9IfyBIEdQqalMm9If+El1FEDp3U/SlUBDEGeLqBUGQ6jFdrkcQpD6sKxsJBKkMytyOQJBciNonAILU5xMQpD6sKxsJBKkMytyOQJBciNonAILU5xMQpD6sKxsJBKkMytyOQJBciNonAILU5xMQpD6sKxsJBKkMytyOQJBciNonAILU5xMQpD6sKxsJBKkMytyOQJBciNonAILU5xMQpD6sKxsJBKkMytyOQJBciNonAILU5xMQZA7rOI7fRkSnRFF0poicUp8LMBIQaAYBZn4wTdPsuqcHkyT56UItnjsPsnbt2hetXr16p4i8sxk1MSoQaB4BZv7h/v37N+3du/c/mTYHCaKUOoaI/ty8etAACLQGgWOttX+ZJ0ipq11aYxIUAQLVIXDwSiguU+hWpwt6AgLtQyA7DcllrnRpn0nQCAhUisCujCB7ieiESrtFZ0CgGwg8lhHkGSJa1Q17YAUQqBSBAxlBUKBXiik66xACE1mRfgMz4+r/DnkVplSDgIjcmBHkLGbeXU2X6AUIdAcBEdk4/xxkGxF9pDumwRIgUBqBr1prtz73qgmeh5QGFB10BIGFt0Eedjfv6Ojo66IoupaIziaiF3bEXpgBBFwQ+C8R3Z2m6dVTU1O/m2+w5OXVIyMjq4eGhsZFJPvqKX5AoNMIMPP07OzsxPT09KILuoO+3b3TXoNxrUAABGmFG6BEWxEAQdrqGejVCgRAkFa4AUq0FQEQpK2egV6tQAAEaYUboERbEQBB2uoZ6NUKBECQVrgBSrQVARCkrZ6BXq1AoFaCxHGsoijaLCJvJKI1RJQS0V4R2c3M27NbJFqBCpRoFIHslh0R2cLMG4loLRFFRPQ4M/86TdMdSZLYuhSsjSAOL0Nm1w59zFq7sy7jMU77EFBKbep9w/7LRHTsctrV+WnpWgjiQI6FWJwPkrRv4tah0Rw57nAZqy6S9J0gWutREUlcjJ6T+a219g0e8hDtCAJKqd8Q0etdzWHm2Bgz5SpfRK6vBNFaj6dpmuWS7/VRjpkvMcbc6tMGsmEjoLW+WERu8bFCRL4bRdF2Y8yETzsf2b4TRESySyG8f9bavurmrRAa9BWBorfHM/MGEKSvrkHnbUAABPH0AiKIJ2CBi4Mgng4EQTwBC1wcBPF0IAjiCVjg4iCIpwNBEE/AAhcHQTwdCIJ4Aha4OAji6UAQxBOwwMVBEE8HgiCegAUuDoJ4OrBpgmR3gw0PD5+VpumJURQpIsreNM5ehXjUGHOvpzmtENdan0FEJxJR9irPMWmaJlEU/X5mZuYnS90JVafSIIgn2k0SRCn1biL6IhEdv4za37HWvt/TpEbFlVLf7pH7fcso8Uci+oS19vtNKQmCeCLfFEHiOL6Amb/lom5TOrrotlDGdfKJyAeSJLndt/8q5F11fP5YeNWkCvQd+xgdHX1NFEWPO4oTM+8wxmxxlW9CTmu9XUQ2u46dpumaqampP7nKVyUHgngi2cTqrLW+U0TO9VG1rnMJPjrNy3qewznYjJnvMsacV2S8Mm1AEE/0miCIUupJIjrKU9Vd1lovUnn2X1i84BeM91lrjy48aMGGIIgncHUTZGRkZM3Q0FBWrPr+HrPWZuemW/cr+gXj2dnZ46enp51TzSoMB0E8UaybINnhrq6dXWnrpFtqKrRV174eSgpp0oWkq+ta09ZJB4LMIRDSpAtJVxDkEALY5nWdDSXlQJD6Jh0iCCJISbpW0xwpVnkcUYMESGZXt4MgrkgtLweCgCCLZke/83qkWAFOOtQgqEGWIi4iSIBkdk0ckGK5IoUUKxcpRBBEEESQFWgCgoAgIAgIkhtJMwEU6QsWCyfECgqFtCqHpKurO1CDuCKFGiQXKRAEKRZSLKRYuQsFUqzDIcI2L7Z58aBwhWUDBAFBQBAQJD+zQA2CGgQ1CGqQ/JUC27yHYYQUCykWUiykWPkLJ1IspFhIsZBi5a8USLGQYi01SxBBEEEQQRBBEEGcEFiwWHjKe4mHtCqHpKurE/AulitSy8thFwu7WNjFwi5W/kqCCIIaBDUIapD8lQK7WNjFwi7WyjzBgSkU6YtmCFIspFhIsZBiIcVyQgARBBFkpZ0b5g3GmAnPuVRKvK1b0tjmxTYvtnmxzZu/uKEGQQ2CGgQ1SP5KgW1ebPNimxfbvE4rRbZYuAoWkQspbQlJV1dftLXwXUr/tuoKgqBIR5GOIj1/zUUEQZGOIh1Fev5KgSIdRTqKdBTpTisFivRDMCHFQoqFFAspltPCibd5FywWTogVFAppVQ5JV1d3tHXrFNu8AW6dgiBIsZBiIcVyCj5IsZBiLZooiCCIIIggiCCIIE4IIIIggqwwUZBigSAgCAjiFEvwsmKAO25OniUibPO6IrW8HAgCgiyaHUixkGIhxUKK5RReEEEQQRBBVlosnGhUUCikZwsh6erqDtQgrkihBslFCgTBg0I8KMSDwtyFIhNAkY4iHUU6inS3xcJJqqBQSGlLSLq6ugM1iCtSqEFykQJBUIOgBkENkrtQoAY5HCI8B8FzEDwHwXOQ/IUTKRZSLKRYSLHyVwps8x6GEVIspFhIsZBi5S+cSLGQYiHFQoqVv1IgxUKKtdQsQQRBBEEEQQRBBHFCYMFi4SnvJR7SqhySrq5OwKsmrkgtL4ddLOxiYRcLu1j5KwkiCGoQ1CCoQfJXCuxiYRcLu1gr8wQHplCkL5ohSLGQYiHFQoqFFMsJAUQQRJCVdm6YNxhjJjznUinxtm5JY5t3zq1KqVcT0VMFvGyttbpAu743UUqZ7AbSAgMdaa39a4F2hZuAIJ7QWWv7St6l1FFKPUpEr/VRVURuTZLkEp82dcnGcXwLM1/sOd4frLUnerYpLQ6CeELYEEFuJqKtPqqKyEVJktzm06Yu2TiOL2Tmr3uOt81ae6lnm9LiIIgnhE0QJFNRKfU0Eb3CUd3brLUXOco2IqaUyghyoePgf7fWvtJRtlIxEMQTzqYIEsfxm5j5wTx1mfkuY8x5eXJt+H+t9Z0icm6eLiJySpIkv8qT68f/gyCeqDZFkLko8gJm/pKIXLaE2ntF5ONJkvzI06RGxeM4fkdmExGtfb4izHxTZpO19n9NKQmCeCLfJEHmVR0bGxuZnZ0dZ+a3MPPjIvKL3r8npqen93ua0wrxkZGR1UNDQwftEZE1mT29f09MTk5ON60gCOLpgTYQxFNliJdAAATxBA8E8QQscHEQxNOBIIgnYIGLgyCeDgRBPAELXBwE8XQgCOIJWODiIIinA0EQT8ACFwdBPB0IgngCFrg4COLpQBDEE7DAxUEQTweCIJ6ABS4Ogng68IgjjnjZnj17Dng2g3iACKxfv37Vs88++0wR1ft9fr6vZy7KnPMWkdOSJPlZEdDQJiwE4jh+KzPfX0TrgSUIEX3aWvv5IqChTVgIKKU+RUSfK6L1IBPke9baTUVAQ5uwEFBK7SSi9xTRepAJQm0+rVfEmWizGIGCpx6f62igCUJET1trX4WJ1V0ElFJ/I6LCpxgHnSCUFW/GmNO7O0UG1zKt9X3ZZkwZBAaeIHPg3b5q1aoLJyYmZsqAibbtQGB8fHz4wIED2UUXF5TVCAQ5hODTIrI1SZI7yoKK9s0hEMfx+cy8rUxatVB7EGSxLx8jokeY2RLRnuZcjZE9EFgvItkFduuI6ASPdrmiQRMkjuN1zPxwrpUQAAIFERCRk5IkeaRg89xmfX2SfvLJJx81MzPzZK4WEAACBREYHh4++qGHHtpXsHlus74SJBu96EtouZpDAAgQUb9fau07QbTW20VkM7wJBKpGgJl3GGO2VN3vYZsA/ew861trvVFE7u73OOh/8BBg5rONMbv7aXnfI8hcmlX0Gv5+2o6+w0agls9O1EKQOI43M/P2sP0B7duEgIhsSZJkR791qoUgiCL9duPA9V9L9MhQrY0gZQ5PDZz7YfCKCPT74WCtRfrCwUASzPyyCNRJjlojyDwwY2Njx6Vpuqvgt/PK4ov24SJgoyg6Z3Jy8ok6TagtxVpolFLqxSJyQ4Hv59WJDcZqCQLZdyCZ+Qpr7b/rVqkRgswbqbV+l4hcSUTr6zYc4wWBwB5mvt4Y84OmtG2UIPNGK6XO7L2Ze4aInNp7FfooIsr+vLQpUDBuIwj8s/cB1X29Iw37mPmB3qJ5r7X2nkY0WTDo/wGwoQBIAfhtyAAAAABJRU5ErkJggg==",Fmt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADtFJREFUeF7tnX2MXFUZh98zW6C0oW3k05AQREljS/iD1oBBTRs0BALxC0UUSYPJIpLde2Y3NBhJHCOmmNC978wmSxiDGol8qGiIH5sQYpuIBgz1g1DFSAxRMIAt7kK71G3nHvfCEJam7Jz33rP3nnvu7yb9g+x73vue5zcPszNzd64iHGIC27ZtW7lmzZotSqkrlVKbiegUpdTJxpi14mZYkIfAHBHtN8bsU0o9kyTJT48cObJ7amrqhTxNF69VrhrVoY/W+v0LgYwQ0VVEdGod9lzRPf5cKdWJ4/iRvPNDEEuCWuvb+nKssVyCsvIJfH/hWT1ut9tPZh0FgliQ01rvIqItFqUo8Y/A80R0LTPvzjIaBBlATWv9HBGdmQUu1nhFYGsWSSDIEhlqrf9LROu8ihnDZCYwNDS0cefOnX+RNIAg70BLa/0zIvqEBCZq/SZgjDm0YsWKTRJJIMgxMtVa30VEw37HjekyEtjDzOlb81YHBDkK0+jo6KZGo/GEFT0UVZXADczctRkeghxFCc8eNg+bytdYP4tAkEVZR1G0Xin1dOXjxwZsCFzHzPcMKoQgiwhprbcT0bcHQcPPq0/AGPNgu91Or4hY8oAgbxfkUSK6eBA0/DwIAofn5uZWd7vdw0vtBoL06QwPDx+3atWq+SCixyZsCVzOzNMQxAJXFEWnK6WcXQVqcUqUlE9glJknIYhFEP0rdUWfslq0RYnfBCaZeRSCWISktU5fe6SvQVwdzxJR+g+HIwLGmDOI6Gyl1EpHLaeZ+XIIYkFTa51erZtetZv3SK8a/UaWC+PynrgO65vN5vuMMR0iuszBfncz81YIYkHSlSBJkmzudDp7LE6JkhwEtNY/IKIv5miRLoUgtgBdCGKMub/dbl9je07UZSfg6FdiCGIbgQtBiOjzzHyf7TlRl53A9u3bT5qfn38le4fXV0IQW4COBMn0Rzm2M6Lu7QS01iYnEwhiCxCC2JLypw6CFJgFBCkQtqNTQRBHIG3aQBAbSn7VQJAC8xgfH9/Q6/X25jlllr95znO+uq+FIAU+Alqt1sqZmZnX8pxy3bp1J7ZarUN5emCtPQEIYs/KSaXW+iki2pix2V5mPi/jWizLQACCZICWZ4nWeoqIbszY405m/krGtViWgQAEyQAtz5KRkZEThoaGXiIi6deLvtLr9U6bnJz8X57zY62MAASR8XJSHUXR1Uqp+yXNjDGfa7fbD0jWoDY/AQiSn2GmDlEUXaiUeoiITh/Q4EVjzMfb7fbjmU6ERbkIQJBc+PItbrVaK2ZnZ283xlxBROuP6va3hfuC/GLt2rW3tFqtI/nOhNVZCUCQrOQcr2s2mycmSXJu2rbRaPw9juNcbwc7Hq+27SBIbaPHxm0IQBAbSqipLQEIUtvosXEbAhDEhhJqaksAgtQ2emzchgAEsaGEmtoSgCC1jR4btyFQaUGGh4fXrl69+mQiOsUYs8pmw6hxQ6DRaMwS0b4DBw7s73a7c266+telUoJordObXW4xxnxMKfUZIjrVP6S1nCj9I7Cf9L/BI9OtkH2lVglB0k+ZjTEjRJR+xylul+zro+mNudJrxtLvo/2h32PaTee9IFEUXaeUGiei8+22hCpPCEwrpXbEcfwbT+bJNIbXgizcLuDOhdsFfDnTzrDIBwKHjTE3tdvt7/gwTJYZvBWk2Ww+Yoy5JMumsMY7AukXbbe8m8piIC8F0VprIoot5kdJdQhcwsy/rs64b0zqnSBjY2PXJkky8M6gVQNd93mVUoeMMR9k5j9ViYVXgmitzyaixyz+yq5KjDHrWwQG3kzGN1i+CbKTiMZ8g4R5nBK4tkpvAXsjiNb6gv6zx3FO40Az3wg8zswX+TbUO83jkyDpuxxfrwo4zJmLwMBbI+fq7nCxT4Kkrz0udLg3tPKXwMA7v/oyuheCNJvNM40xz/kCBXMsO4FnFl6HvP4FFb4fXggyNjb26SRJ0ovdcNSEwNzc3OoqXAXshSBa668R0W01eWxgm298tdFZExMT//Idhi+CuLjdru+sMd8iAo1G44KJiYk/+g7FF0F2pX/n4QjWNBE9TESV+sTW0d6Xs02azycdXlVdiZuRhibIl5j5u8v5KKl774XL5Fy9HQ9B+g8mNehBpbV28QxyMzPfMehc+Hl+Alrr3xPRB3J2giBFCoJ79+V8uAqWR1E0oZRqCpYcqxSCFCkIMw98psoZKJb3CdTpbr3BvAaBIMX5C0FErHcz89alVgz8P7uL1yAQRBRarmIIIsIHQUS4AiiGIKIQIYgIVwDFEEQUIgQR4QqgGIKIQoQgIlwBFEMQUYgQRIQrgGIIIgoRgohwBVAMQUQhQhARrgCKIYgoRAgiwhVAMQQRhQhBRLgCKIYgohAhiAhXAMUQRBQiBBHhCqAYgohChCAiXAEUQxBRiBBEhCuAYggiChGCiHAFUAxBRCFCEBGuAIohiChECCLCFUAxBBGFCEFEuAIohiCiECGICFcAxRBEFCIEEeEKoBiCiEKEICJcARRDEFGIEESEK4BiCCIKEYKIcAVQDEFEIUIQEa4AiiGIKEQIIsIVQDEEEYUIQUS4AiiGIKIQIYgIVwDFEEQUIgQR4QqgGIKIQoQgIlwBFEMQUYgQRIQrgGIIIgoRgohwBVAMQUQhQhARrgCKIYgoRAgiwhVAMQQRhQhBRLgCKIYgohAhiAhXAMUQRBQiBBHhCqAYgohChCAiXAEUQxBRiBBEhCuAYggiChGCiHAFUAxBRCFCEBGuAIohiChECCLCFUAxBBGFCEFEuAIohiCiECGICFcAxRBEFCIEEeEKoBiCiEKEICJcARRDEFGIEESEK4BiCCIKEYKIcAVQDEFEIUIQEa4AiiGIKEQIIsIVQDEEEYUIQUS4AiiGIKIQIYgIVwDFEEQUIgQR4QqgGIKIQoQgIlwBFEMQUYgQRIQrgGIIIgoRgohwBVAMQUQhQhARrgCKIYgoRAgiwhVAMQQRhQhBRLgCKIYgohAhiAhXAMUQRBQiBBHhCqAYgohChCAiXAEUQxBRiBBEhCuAYggiChGCiHAFUAxBRCFCEBGuAIohiChECCLCFUAxBBGFCEFEuAIohiCiECGICFcAxRBEFCIEEeEKoBiCiEKEICJcARRDEFGIEESEK4BiCCIKEYKIcAVQDEFEIUIQEa4AiiGIKEQIIsIVQDEEEYUIQUS4AiiGIKIQIYgIVwDFdREkiqL1Sqmnc0YGQXICrNzyugjSbDZvMcbsyBkQBMkJsHLL6yCI1vp6IrrbQTgQxAHESrUoW5BWq7Xy1VdfPafX6522DOC2ENFFRHSpo94QxBHIyrQpQ5CRkZEThoaGYiL6CBFtrAwsonuY+bql5lWDNqO13kVEqbmZD2YeeJ7MzbHwbQSKFiSKoquVUl0iWlPBKG5l5m9BkAoml3XkIgWJouhCpdRjWWcte12j0bhqYmLiQQhSdhIFnr8oQVqt1oqZmZnniOj0Arfn9FTz8/PvnpqaegGCOMXqd7OiBGk2m3cYY8b9prHkdANfoKerB742wGuQaj0EihJEa51+SLe+WnTemjZJkq92Op3bB80PQQYRqtjPixCk2WyeaIyZqxiaxeMeTt8uZuY/DNoDBBlEqGI/L0KQKIrOV0r9uWJoFo87wcxWvx5CkAqnfKzRixBkfHx8Q6/X21tRdC/2nz2etZkfgthQqlBNEYKkn5bPzMy8ViEsi0cdZeZJ29khiC2pitQVIUiKQmv9VMU+NSel1L1xHH9BEiUEkdCqQG2BgkwR0Y0VQPLmiL9k5iuk80IQKTHP64sSpH/91UtVuMTEGHNTu91OhRYfEESMzO8FRQmSUuhfh3W/x0SeVErtiOM484wQxON0s4xWpCB9SdLrsR7y7JKT54moo5SajOM415sJECTLo9DjNUULkqJIr8uanZ293RiT/o5f1qfrLxPRdPpPKTUdx3H637kPCJIboV8NyhBkMYH0U/YkSc5VSr1ruckopdJP8/cdPHhwf7fbnV2O80GQ5aBaYs+yBSlx68tyagiyLFjLawpB3LKHIG55lt4NgriNAIK45Vl6NwjiNgII4pZn6d0giNsIIIhbnqV3gyBuI4AgbnmW3g2CuI0AgrjlWXo3COI2Agjilmfp3SCI2wggiFuepXeDIG4jgCBueZbeDYK4jQCCuOVZejcI4jYCCOKWZ+ndIIjbCCCIW56ld4MgbiOAIG55lt4NgriNAIK45Vl6NwjiNgII4pZn6d0giNsIIIhbnqV3gyBuI4AgbnmW3g2CuI0AgrjlWXo3COI2gkIEmZ+fP2lqauqA29HR7VgEtNafIqIlbytmQW4rM++2qAu+pBBBkiS5uNPp/C54mh5sUGv9PSLalnMUCNIHWIggRPQoM384Z2hYPoDA6Ojopkaj8YQDUBCkYEHIGBMnSbJjcnLyPw4CRIujCPTl+CYRXeYADgQRCPIrR9DTr58/RET/NMb820GIaPEWgXOI6CyHQD7EzL912K+yrWx+xeoQ0Uhld4jBsxDYwMx/zbIwtDU2gqRypJLgqAkBY8wZ7XY7vVVZ7Q8bQdLfadNfs3DUhMDc3Nzx3W43vRNs7Y+BgqTf3D0zM3OQiI6vPa16AHiYmS+tx1YH73KgIGkLrfXdCy+urx/cDhUBELiBmbsB7MPJFmwFuYaI7nVyRjTxmoBS6r1xHP/D6yELHM5KkP6zSPoB1KYCZ8OpiifQZeYbij+tv2eUCDJMRHf5uxVMlpdAkiSbO53Onrx9QlpvLQieRUKK/Zh7wbPHMbBIBdlCRA8T0XHBP1zqtcE9zLy5Xlu2261IkP6zSCrJLrv2qKoAgTlmXl2BOUsZUSxIOuX4+PiGXq+3t5SJcVKXBPYy83kuG4bWK5MgiyT5ERFtDA1KTfbzY2b+bE32mnmbmQVZJMnNDv5AJ/MGsFBM4BUimmTmW8Ura7gglyBv8mo2mx81xowS0ZU1ZFiVLb9MRA/05cCVupapORFkkShnGmPSixsvM8a8Ryl1ykIgJxPRKst5UOaAgFJq1hizn4j2EdGTRDStlJqO4/g1B+1r1eL/3tpyUNxge7wAAAAASUVORK5CYII=",Bmt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAABxBJREFUeF7t3OGRG0UUhVE5HwUBQeB0KNKBICAI5YNrKf8wrt0d3e6W1PPe4a96pra/q1M2UPaXi38UUODDAl+0UUCBjwsA4tuhwCcFAPH1UAAQ3wEFxgr4FWSsm6eaFACkydCuOVYAkLFunmpSAJAmQ7vmWAFAxrp5qkkBQJoM7ZpjBQAZ6+apJgUAaTK0a44VAGSsm6eaFACkydCuOVYAkLFunmpSAJAmQ7vmWAFAxrp5qkkBQJoM7ZpjBQAZ6+apJgUAaTK0a44VAGSsm6eaFACkydCuOVYAkLFunmpSAJAmQ7vmWAFAgm7X6/Xf4Pi2R2+3m93vXEeoO0O9HQMkiFXkKCDBkIAEsYocBSQYEpAgVpGjgARDAhLEKnIUkGBIQIJYRY4CEgwJSBCryFFAgiEBCWIVOQpIMCQgQawiRwEJhgQkiFXkKCDBkIAEsYocBSQYEpAgVpGjgARDAhLEKnIUkGBIQIJYRY4CEgwJSBCryFFAgiEBCWIVOQpIMCQgQawiRwEJhgQkiFXkKCDBkIAEsYocBSQYEpAgVpGjgARDAhLEKnIUkGBIQIJYRY4CEgwJSBCryFFAgiEBCWIVOQpIMCQgQawiRwEJhgQkiFXkKCDBkIAEsYocBSQYEpAgVpGjgARDAhLEKnIUkGBIQIJYRY4CEgwJSBCryFFAgiEBCWIVOQpIMCQgQawiRwEJhgQkiFXkKCDBkIAEsYocBSQYEpAgVpGjgARDAhLEKnIUkGBIQIJYRY4CEgwJSBCryFFAgiEBCWIVOQpIMCQgQawiRwEJhgQkiFXkKCDBkIAEsYocBSQYEpAgVpGjgARDAhLEKnIUkGBIQIJYRY4CEgwJSBCryFFAgiEBCWIVOQpIMCQgQawiRwEJhgQkiFXk6GmAXK/XPy+Xy29Fune/xl+32+3rGSKcBshbTEjO8JU6/BlPg+PtJqcCAsnhl2/3A6fCcUogkOxu4MOf73Q4TgsEktMhOSWOUwOB5DRITovj9EAg2R7JqXGUAALJtkhOj6MMEEi2Q1ICRykgkGyDpAyOckAgeTmSUjhKAoHkZUjK4SgLBJKnIymJozQQSJ6GpCyO8kAgeTiS0jhaAIHkYUjK42gDBJLlSFrgaAUEkmVI2uBoBwSSaSStcLQEAskwknY42gKBJEbSEkdrIJDcjaQtjvZAIDlE0hoHIN+/H/62lHehtMcByA/fC0j+hwSO7zlO99f+HP6mYOIAJP/Fg+OH7xAgP4FqjgSOn74PgLzzK05TJHC8810A5IPfkjVDAscH3wNAPvl3liZI4PjkOwDIwb/UF0cCx8H+gNzxX72KIoHjju0BuSNSwf/jDseduwNyZ6hCSOAINgckiFUACRzh3oCEwU6MBI6BrQEZiHZCJHAM7gzIYLgTIYFjYmNAJuKdAAkck/sCMhlwYyRwLNgWkAURN0QCx6JdAVkUciMkcCzcFJCFMTdAAsfiPQFZHPSFSOB4wJaAPCDqC5DA8aAdAXlQ2CcigeOBGwLywLhPQALHg/cD5MGBH4gEjidsB8gTIj8ACRxP2g2QJ4VeiASOJ24GyBNjL0ACx5P3AuTJwSeQwPGCrQB5QfQBJHC8aCdAXhQ+QALHCzcC5IXx70ACx4v3AeTFA3yCBI4NtgFkgxHeQQLHJrsAsskQPyC53G63rxv9WK1/FEBaz+/yRwUAOSrk89YFAGk9v8sfFQDkqJDPWxcApPX8Ln9UAJCjQj5vXQCQ1vO7/FEBQI4K+bx1AUBaz+/yRwUAOSrk89YFAGk9v8sfFQDkqJDPWxcApPX8Ln9UAJCjQj5vXQCQ1vO7/FEBQI4K+bx1AUBaz+/yRwVOAeR6vf5yuVz+PrqMz09V4Nfb7fbP7j8xILsvVPfnA2TVtn4FWVVyq/cAsmoOQFaV3Oo9gKyaA5BVJbd6DyCr5gBkVcmt3gPIqjkAWVVyq/cAsmoOQFaV3Oo9gKyaA5BVJbd6DyCr5gBkVcmt3gPIqjkAWVVyq/cAsmoOQFaV3Oo9gKyaA5BVJbd6DyCr5gBkVcmt3gPIqjkAWVVyq/cAsmoOQFaV3Oo9gKya4zuQ31e9z3u2KPCHPw+yxQ5+CAXGC5ziD0yNX8+TCswVAGSun6eLFwCk+MCuN1cAkLl+ni5eAJDiA7veXAFA5vp5ungBQIoP7HpzBQCZ6+fp4gUAKT6w680VAGSun6eLFwCk+MCuN1cAkLl+ni5eAJDiA7veXAFA5vp5ungBQIoP7HpzBQCZ6+fp4gUAKT6w680VAGSun6eLFwCk+MCuN1cAkLl+ni5eAJDiA7veXAFA5vp5ungBQIoP7HpzBQCZ6+fp4gUAKT6w680VAGSun6eLFwCk+MCuN1cAkLl+ni5eAJDiA7veXAFA5vp5ungBQIoP7HpzBQCZ6+fp4gW+AesDPuc4Ecc8AAAAAElFTkSuQmCC",Hmt="/assets/uploader_code-C8PB7N6J.png",Vmt={class:"python-header"},Umt=["alt"],Wmt=["alt"],Gmt=["alt"],zmt=["alt"],Kmt={__name:"header",emits:["getSwitchs","getCodemirror","getPythonCode"],setup(n,{emit:e}){const{t}=Jf(),i=te(!1),s=te(!0),o=e,r=Yc.useyPythonCodeStore(),a=()=>{console.log("复制代码",r.pythonCode),navigator.clipboard.writeText(r.pythonCode).then(()=>{po.success(t("message.copy_code_success"))}).catch(p=>{po.error(t("message.copy_code_error"))})},c=()=>{console.log("下载代码",r.pythonCode);const p=new Blob([r.pythonCode],{type:"text/plain"}),_=URL.createObjectURL(p),v=document.createElement("a");v.href=_,v.download="code.py",v.click(),URL.revokeObjectURL(_)},u=()=>{console.log("上传代码");const p=document.createElement("input");p.type="file",p.accept=".py",p.onchange=async _=>{const v=_.target.files[0];if(v){const C=await v.text();o("getPythonCode",C),po.success(t("message.upload_code_success"))}else po.error(t("message.upload_code_error"))},p.click()},d=()=>{document.getElementById("serialoutput").innerText=""},f=p=>{o("getSwitchs",p),s.value=p},g=p=>{o("getCodemirror",p)};return(p,_)=>{const v=Bt("el-tooltip"),C=Bt("el-col"),y=Bt("el-switch"),w=Bt("el-row");return G(),he("div",Vmt,[ce(w,null,{default:_e(()=>[ce(C,{span:12,class:"python-header-left"},{default:_e(()=>[ce(v,{content:p.$t("message.python_code")},{default:_e(()=>[oe("span",{class:Y(s.value?"active":""),onClick:_[0]||(_[0]=I=>f(!0))},st(p.$t("message.python_code")),3)]),_:1},8,["content"]),ce(v,{content:p.$t("message.serial_port")},{default:_e(()=>[oe("span",{class:Y(s.value?"":"active"),style:{"margin-left":"10px"},onClick:_[1]||(_[1]=I=>f(!1))},st(p.$t("message.serial_port")),3)]),_:1},8,["content"]),s.value?Qe("",!0):(G(),nt(v,{key:0,content:p.$t("message.clear_print_data")},{default:_e(()=>[oe("img",{onClick:d,style:{width:"20px",position:"absolute",top:"20px"},src:Pmt,alt:p.$t("message.clear_print_data")},null,8,Umt)]),_:1},8,["content"]))]),_:1}),ce(C,{span:12,class:"python-header-right"},{default:_e(()=>[ce(v,{content:p.$t("message.edit_mode")},{default:_e(()=>[ce(y,{modelValue:i.value,"onUpdate:modelValue":_[2]||(_[2]=I=>i.value=I),onChange:g},null,8,["modelValue"])]),_:1},8,["content"]),ce(v,{content:p.$t("message.copy_code")},{default:_e(()=>[oe("img",{src:Fmt,alt:p.$t("message.copy_code"),onClick:a},null,8,Wmt)]),_:1},8,["content"]),ce(v,{content:p.$t("message.download_code")},{default:_e(()=>[oe("img",{src:Bmt,alt:p.$t("message.download_code"),onClick:c},null,8,Gmt)]),_:1},8,["content"]),ce(v,{content:p.$t("message.upload_code")},{default:_e(()=>[oe("img",{src:Hmt,alt:p.$t("message.upload_code"),onClick:u},null,8,zmt)]),_:1},8,["content"])]),_:1})]),_:1})])}}},jmt=Oh(Kmt,[["__scopeId","data-v-c8905e2d"]]),Xmt={},Ymt={class:"serialoutput",id:"serialoutput"};function qmt(n,e){return G(),he("div",Ymt)}const Jmt=Oh(Xmt,[["render",qmt]]),Qmt="modulepreload",Zmt=function(n){return"/"+n},dhe={},On=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));s=Promise.allSettled(t.map(c=>{if(c=Zmt(c),c in dhe)return;dhe[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Qmt,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((g,p)=>{f.addEventListener("load",g),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return s.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};function e_t(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,function(i,s){const o=s[0];return typeof e[o]<"u"?e[o]:i}),t}function $(n,e,...t){return e_t(e,t)}var C9;const zU="en";let DW=!1,$W=!1,KU=!1,yIe=!1,EIe=!1,mne=!1,BH,y9=zU,t_t,KT;const Io=typeof self=="object"?self:typeof global=="object"?global:{};let Da;typeof Io.vscode<"u"&&typeof Io.vscode.process<"u"?Da=Io.vscode.process:typeof process<"u"&&(Da=process);const n_t=typeof((C9=Da==null?void 0:Da.versions)===null||C9===void 0?void 0:C9.electron)=="string"&&Da.type==="renderer";if(typeof navigator=="object"&&!n_t)KT=navigator.userAgent,DW=KT.indexOf("Windows")>=0,$W=KT.indexOf("Macintosh")>=0,mne=(KT.indexOf("Macintosh")>=0||KT.indexOf("iPad")>=0||KT.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,KU=KT.indexOf("Linux")>=0,EIe=!0,BH=navigator.language,y9=BH;else if(typeof Da=="object"){DW=Da.platform==="win32",$W=Da.platform==="darwin",KU=Da.platform==="linux",KU&&Da.env.SNAP&&Da.env.SNAP_REVISION,BH=zU,y9=zU;const n=Da.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];BH=e.locale,y9=t||zU,t_t=e._translationsConfigFile}catch{}yIe=!0}else console.error("Unable to resolve platform.");const zl=DW,ki=$W,Qc=KU,Ug=yIe,hM=EIe,Xm=mne,i_t=KT,CY=function(){if(Io.setImmediate)return Io.setImmediate.bind(Io);if(typeof Io.postMessage=="function"&&!Io.importScripts){let t=[];Io.addEventListener("message",s=>{if(s.data&&s.data.vscodeSetImmediateId)for(let o=0,r=t.length;o<r;o++){const a=t[o];if(a.id===s.data.vscodeSetImmediateId){t.splice(o,1),a.callback();return}}});let i=0;return s=>{const o=++i;t.push({id:o,callback:s}),Io.postMessage({vscodeSetImmediateId:o},"*")}}if(typeof(Da==null?void 0:Da.nextTick)=="function")return Da.nextTick.bind(Da);const e=Promise.resolve();return t=>e.then(t)}(),Tf=$W||mne?2:DW?1:3;let hhe=!0,fhe=!1;function SIe(){if(!fhe){fhe=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,hhe=new Uint16Array(n.buffer)[0]===513}return hhe}const wIe="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function s_t(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of wIe)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const IIe=s_t();function xW(n){let e=IIe;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const o_t={maxLen:1e3,windowSize:15,timeBudget:150};function PW(n,e,t,i,s=o_t){if(t.length>s.maxLen){let u=n-s.maxLen/2;return u<0?u=0:i+=u,t=t.substring(u,n+s.maxLen/2),PW(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,c=null;for(let u=1;!(Date.now()-o>=s.timeBudget);u++){const d=r-s.windowSize*u;e.lastIndex=Math.max(0,d);const f=r_t(e,t,r,a);if(!f&&c||(c=f,d<=0))break;a=d}if(c){let u={word:c[0],startColumn:i+1+c.index,endColumn:i+1+c.index+c[0].length};return e.lastIndex=0,u}return null}function r_t(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const jT=8;class LIe{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class l_t{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class OIe{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class hl{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}compute(e,t,i){return i}}class fM{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class $w{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function zn(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Bi extends $w{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return zn(e,this.defaultValue)}}function yY(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class ao extends $w{constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}static clampedInt(e,t,i,s){return yY(e,t,i,s)}validate(e){return ao.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class Mm extends $w{constructor(e,t,i,s,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=s}static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(Mm.float(e,this.defaultValue))}}class Cu extends $w{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Cu.string(e,this.defaultValue)}}function Hc(n,e,t){return typeof n!="string"||t.indexOf(n)===-1?e:n}class $r extends $w{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Hc(e,this.defaultValue,this._allowedValues)}}class MN extends hl{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function a_t(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class c_t extends hl{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[$("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),$("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),$("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:$("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class u_t extends hl{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(19,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:$("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:$("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:zn(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:zn(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function d_t(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Cl;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(Cl||(Cl={}));function h_t(n){switch(n){case"line":return Cl.Line;case"block":return Cl.Block;case"underline":return Cl.Underline;case"line-thin":return Cl.LineThin;case"block-outline":return Cl.BlockOutline;case"underline-thin":return Cl.UnderlineThin}}class f_t extends fM{constructor(){super(126,[65,33])}compute(e,t,i){const s=["monaco-editor"];return t.get(33)&&s.push(t.get(33)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(65)==="default"?s.push("mouse-default"):t.get(65)==="copy"&&s.push("mouse-copy"),t.get(99)&&s.push("showUnused"),t.get(124)&&s.push("showDeprecated"),s.join(" ")}}class g_t extends Bi{constructor(){super(32,"emptySelectionClipboard",!0,{description:$("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class p_t extends hl{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(35,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:$("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[$("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),$("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),$("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:$("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[$("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),$("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),$("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:$("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:$("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ki},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:$("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:$("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:zn(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Hc(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Hc(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:zn(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:zn(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:zn(t.loop,this.defaultValue.loop)}}}class gd extends hl{constructor(){super(44,"fontLigatures",gd.OFF,{anyOf:[{type:"boolean",description:$("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:$("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:$("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?gd.OFF:e==="true"?gd.ON:e:e?gd.ON:gd.OFF}}gd.OFF='"liga" off, "calt" off';gd.ON='"liga" on, "calt" on';class m_t extends fM{constructor(){super(43)}compute(e,t,i){return e.fontInfo}}class __t extends $w{constructor(){super(45,"fontSize",va.fontSize,{type:"number",minimum:6,maximum:100,default:va.fontSize,description:$("fontSize","Controls the font size in pixels.")})}validate(e){let t=Mm.float(e,this.defaultValue);return t===0?va.fontSize:Mm.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Tm extends hl{constructor(){super(46,"fontWeight",va.fontWeight,{anyOf:[{type:"number",minimum:Tm.MINIMUM_VALUE,maximum:Tm.MAXIMUM_VALUE,errorMessage:$("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Tm.SUGGESTION_VALUES}],default:va.fontWeight,description:$("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(ao.clampedInt(e,va.fontWeight,Tm.MINIMUM_VALUE,Tm.MAXIMUM_VALUE))}}Tm.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Tm.MINIMUM_VALUE=1;Tm.MAXIMUM_VALUE=1e3;class v_t extends hl{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[$("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),$("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),$("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(50,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:$("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:$("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:$("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:$("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:$("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:$("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:$("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:$("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:$("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:$("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:$("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Hc(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Hc(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Hc(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:Hc(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Hc(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Hc(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Cu.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Cu.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Cu.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Cu.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Cu.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class b_t extends hl{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(52,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:$("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:$("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:$("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:$("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:zn(t.enabled,this.defaultValue.enabled),delay:ao.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:zn(t.sticky,this.defaultValue.sticky),above:zn(t.above,this.defaultValue.above)}}}class gO extends fM{constructor(){super(129,[49,57,37,64,91,59,60,93,116,119,120,121,2])}compute(e,t,i){return gO.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,s=(e.viewLineCount+i)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:s,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,c=e.lineHeight,u=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,f=e.minimap.renderCharacters;let g=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const p=e.minimap.maxColumn,_=e.minimap.size,v=e.minimap.side,C=e.verticalScrollbarWidth,y=e.viewLineCount,w=e.remainingWidth,I=e.isViewportWrapping,L=f?2:3;let O=Math.floor(o*s);const A=O/o;let N=!1,D=!1,P=L*g,F=g/o,V=1;if(_==="fill"||_==="fit"){const{typicalViewportLineCount:Z,extraLinesBeyondLastLine:J,desiredRatio:ge,minimapLineCount:ve}=gO.computeContainedMinimapLineCount({viewLineCount:y,scrollBeyondLastLine:d,height:s,lineHeight:c,pixelRatio:o});if(y/ve>1)N=!0,D=!0,g=1,P=1,F=g/o;else{let Ee=!1,Ne=g+1;if(_==="fit"){const qe=Math.ceil((y+J)*P);I&&a&&w<=t.stableFitRemainingWidth?(Ee=!0,Ne=t.stableFitMaxMinimapScale):Ee=qe>O}if(_==="fill"||Ee){N=!0;const qe=g;P=Math.min(c*o,Math.max(1,Math.floor(1/ge))),I&&a&&w<=t.stableFitRemainingWidth&&(Ne=t.stableFitMaxMinimapScale),g=Math.min(Ne,Math.max(1,Math.floor(P/L))),g>qe&&(V=Math.min(2,g/qe)),F=g/o/V,O=Math.ceil(Math.max(Z,y+J)*P),I?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=w,t.stableFitMaxMinimapScale=g):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const U=Math.floor(p*F),Q=Math.min(U,Math.max(0,Math.floor((w-C-2)*F/(u+F)))+jT);let de=Math.floor(o*Q);const q=de/o;de=Math.floor(de*V);const K=f?1:2,re=v==="left"?0:i-Q-C;return{renderMinimap:K,minimapLeft:re,minimapWidth:Q,minimapHeightIsEditorHeight:N,minimapIsSampling:D,minimapScale:g,minimapLineHeight:P,minimapCanvasInnerWidth:de,minimapCanvasInnerHeight:O,minimapCanvasOuterWidth:q,minimapCanvasOuterHeight:A}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,c=t.maxDigitWidth,u=t.pixelRatio,d=t.viewLineCount,f=e.get(121),g=f==="inherit"?e.get(120):f,p=g==="inherit"?e.get(116):g,_=e.get(119),v=e.get(2),C=t.isDominatedByLongLines,y=e.get(49),w=e.get(59).renderType!==0,I=e.get(60),L=e.get(93),O=e.get(64),A=e.get(91),N=A.verticalScrollbarSize,D=A.verticalHasArrows,P=A.arrowSize,F=A.horizontalScrollbarSize,V=e.get(57),U=e.get(37);let Q;if(typeof V=="string"&&/^\d+(\.\d+)?ch$/.test(V)){const Ve=parseFloat(V.substr(0,V.length-2));Q=ao.clampedInt(Ve*a,0,0,1e3)}else Q=ao.clampedInt(V,0,0,1e3);U&&(Q+=16);let de=0;if(w){const Ve=Math.max(r,I);de=Math.round(Ve*c)}let q=0;y&&(q=o);let K=0,re=K+q,Z=re+de,J=Z+Q;const ge=i-q-de-Q;let ve=!1,Le=!1,Ee=-1;v!==2&&(g==="inherit"&&C?(ve=!0,Le=!0):p==="on"||p==="bounded"?Le=!0:p==="wordWrapColumn"&&(Ee=_));const Ne=gO._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:u,scrollBeyondLastLine:L,minimap:O,verticalScrollbarWidth:N,viewLineCount:d,remainingWidth:ge,isViewportWrapping:Le},t.memory||new OIe);Ne.renderMinimap!==0&&Ne.minimapLeft===0&&(K+=Ne.minimapWidth,re+=Ne.minimapWidth,Z+=Ne.minimapWidth,J+=Ne.minimapWidth);const qe=ge-Ne.minimapWidth,Re=Math.max(1,Math.floor((qe-N-2)/a)),we=D?P:0;return Le&&(Ee=Math.max(1,Re),p==="bounded"&&(Ee=Math.min(Ee,_))),{width:i,height:s,glyphMarginLeft:K,glyphMarginWidth:q,lineNumbersLeft:re,lineNumbersWidth:de,decorationsLeft:Z,decorationsWidth:Q,contentLeft:J,contentWidth:qe,minimap:Ne,viewportColumn:Re,isWordWrapMinified:ve,isViewportWrapping:Le,wrappingColumn:Ee,verticalScrollbarWidth:N,horizontalScrollbarHeight:F,overviewRuler:{top:we,width:N,height:s-2*we,right:0}}}}class T_t extends hl{constructor(){const e={enabled:!0};super(56,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:$("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:zn(e.enabled,this.defaultValue.enabled)}}}class C_t extends hl{constructor(){const e={enabled:!0,fontSize:0,fontFamily:""};super(125,"inlayHints",e,{"editor.inlayHints.enabled":{type:"boolean",default:e.enabled,description:$("inlayHints.enable","Enables the inlay hints in the editor.")},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:$("inlayHints.fontSize","Controls font size of inlay hints in the editor. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:$("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:zn(t.enabled,this.defaultValue.enabled),fontSize:ao.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Cu.string(t.fontFamily,this.defaultValue.fontFamily)}}}class y_t extends Mm{constructor(){super(58,"lineHeight",va.lineHeight,e=>Mm.clamp(e,0,150),{markdownDescription:$("lineHeight",`Controls the line height.
- - Use 0 to automatically compute the line height from the font size.
- - Values between 0 and 8 will be used as a multiplier with the font size.
- - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class E_t extends hl{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(64,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:$("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[$("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),$("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),$("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:$("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:$("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:$("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:$("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:$("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:$("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:zn(t.enabled,this.defaultValue.enabled),size:Hc(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Hc(t.side,this.defaultValue.side,["right","left"]),showSlider:Hc(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:zn(t.renderCharacters,this.defaultValue.renderCharacters),scale:ao.clampedInt(t.scale,1,1,3),maxColumn:ao.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function S_t(n){return n==="ctrlCmd"?ki?"metaKey":"ctrlKey":"altKey"}class w_t extends hl{constructor(){super(74,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:$("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:$("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:ao.clampedInt(t.top,0,0,1e3),bottom:ao.clampedInt(t.bottom,0,0,1e3)}}}class I_t extends hl{constructor(){const e={enabled:!0,cycle:!1};super(75,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:$("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:$("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:zn(t.enabled,this.defaultValue.enabled),cycle:zn(t.cycle,this.defaultValue.cycle)}}}class L_t extends fM{constructor(){super(127)}compute(e,t,i){return e.pixelRatio}}class O_t extends hl{constructor(){const e={other:!0,comments:!1,strings:!1};super(78,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:$("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:$("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:$("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:$("quickSuggestions","Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e,i={other:zn(t.other,this.defaultValue.other),comments:zn(t.comments,this.defaultValue.comments),strings:zn(t.strings,this.defaultValue.strings)};return i.other&&i.comments&&i.strings?!0:!i.other&&!i.comments&&!i.strings?!1:i}return this.defaultValue}}class R_t extends hl{constructor(){super(59,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[$("lineNumbers.off","Line numbers are not rendered."),$("lineNumbers.on","Line numbers are rendered as absolute number."),$("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),$("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:$("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function _ne(n){const e=n.get(86);return e==="editable"?n.get(80):e!=="on"}class M_t extends hl{constructor(){const e=[],t={type:"number",description:$("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(90,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:$("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:$("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="number")t.push({column:ao.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:ao.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}function ghe(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let k_t=class extends hl{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(91,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[$("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),$("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),$("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:$("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[$("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),$("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),$("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:$("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:$("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:$("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:$("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=ao.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=ao.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:ao.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:ghe(t.vertical,this.defaultValue.vertical),horizontal:ghe(t.horizontal,this.defaultValue.horizontal),useShadows:zn(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:zn(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:zn(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:zn(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:zn(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:ao.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:ao.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:zn(t.scrollByPage,this.defaultValue.scrollByPage)}}};class A_t extends hl{constructor(){const e={enabled:!0,mode:"subwordSmart"};super(54,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:$("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:zn(t.enabled,this.defaultValue.enabled),mode:Hc(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"])}}}class N_t extends hl{constructor(){const e={enabled:$a.bracketPairColorizationOptions.enabled};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,description:$("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:zn(e.enabled,this.defaultValue.enabled)}}}class D_t extends hl{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[$("editor.guides.bracketPairs.true","Enables bracket pair guides."),$("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),$("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:$("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[$("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),$("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),$("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:$("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:$("editor.guides.highlightActiveBracketPair","Controls whether bracket pair guides are enabled or not.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:$("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:"boolean",default:e.highlightActiveIndentation,description:$("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:phe(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:phe(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:zn(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:zn(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:zn(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation)}}}function phe(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class $_t extends hl{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(105,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[$("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),$("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:$("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:$("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:$("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:$("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:$("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:$("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:$("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:$("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:$("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:$("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:$("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:$("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Hc(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:zn(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:zn(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:zn(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:zn(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:zn(t.showIcons,this.defaultValue.showIcons),showStatusBar:zn(t.showStatusBar,this.defaultValue.showStatusBar),preview:zn(t.preview,this.defaultValue.preview),previewMode:Hc(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:zn(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:zn(t.showMethods,this.defaultValue.showMethods),showFunctions:zn(t.showFunctions,this.defaultValue.showFunctions),showConstructors:zn(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:zn(t.showDeprecated,this.defaultValue.showDeprecated),showFields:zn(t.showFields,this.defaultValue.showFields),showVariables:zn(t.showVariables,this.defaultValue.showVariables),showClasses:zn(t.showClasses,this.defaultValue.showClasses),showStructs:zn(t.showStructs,this.defaultValue.showStructs),showInterfaces:zn(t.showInterfaces,this.defaultValue.showInterfaces),showModules:zn(t.showModules,this.defaultValue.showModules),showProperties:zn(t.showProperties,this.defaultValue.showProperties),showEvents:zn(t.showEvents,this.defaultValue.showEvents),showOperators:zn(t.showOperators,this.defaultValue.showOperators),showUnits:zn(t.showUnits,this.defaultValue.showUnits),showValues:zn(t.showValues,this.defaultValue.showValues),showConstants:zn(t.showConstants,this.defaultValue.showConstants),showEnums:zn(t.showEnums,this.defaultValue.showEnums),showEnumMembers:zn(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:zn(t.showKeywords,this.defaultValue.showKeywords),showWords:zn(t.showWords,this.defaultValue.showWords),showColors:zn(t.showColors,this.defaultValue.showColors),showFiles:zn(t.showFiles,this.defaultValue.showFiles),showReferences:zn(t.showReferences,this.defaultValue.showReferences),showFolders:zn(t.showFolders,this.defaultValue.showFolders),showTypeParameters:zn(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:zn(t.showSnippets,this.defaultValue.showSnippets),showUsers:zn(t.showUsers,this.defaultValue.showUsers),showIssues:zn(t.showIssues,this.defaultValue.showIssues)}}}class x_t extends hl{constructor(){super(101,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:$("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:zn(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}}}class P_t extends fM{constructor(){super(128,[80])}compute(e,t,i){return t.get(80)?!0:e.tabFocusMode}}function F_t(n){switch(n){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class B_t extends fM{constructor(){super(130,[129])}compute(e,t,i){const s=t.get(129);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}const H_t="Consolas, 'Courier New', monospace",V_t="Menlo, Monaco, 'Courier New', monospace",U_t="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",va={fontFamily:ki?V_t:Qc?U_t:H_t,fontWeight:"normal",fontSize:ki?12:14,lineHeight:0,letterSpacing:0},$a={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}},B1=[];function jt(n){return B1[n.id]=n,n}const pp={acceptSuggestionOnCommitCharacter:jt(new Bi(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:$("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:jt(new $r(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",$("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:$("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:jt(new c_t),accessibilityPageSize:jt(new ao(3,"accessibilityPageSize",10,1,1073741824,{description:$("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:jt(new Cu(4,"ariaLabel",$("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:jt(new $r(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",$("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),$("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:$("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:jt(new $r(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",$("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:$("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:jt(new $r(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",$("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:$("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:jt(new $r(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",$("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),$("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:$("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:jt(new MN(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],a_t,{enumDescriptions:[$("editor.autoIndent.none","The editor will not insert indentation automatically."),$("editor.autoIndent.keep","The editor will keep the current line's indentation."),$("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),$("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),$("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:$("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:jt(new Bi(10,"automaticLayout",!1)),autoSurround:jt(new $r(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[$("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),$("editor.autoSurround.quotes","Surround with quotes but not brackets."),$("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:$("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:jt(new N_t),bracketPairGuides:jt(new D_t),stickyTabStops:jt(new Bi(103,"stickyTabStops",!1,{description:$("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:jt(new Bi(14,"codeLens",!0,{description:$("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:jt(new Cu(15,"codeLensFontFamily","",{description:$("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:jt(new ao(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:$("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:jt(new Bi(17,"colorDecorators",!0,{description:$("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:jt(new Bi(18,"columnSelection",!1,{description:$("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:jt(new u_t),contextmenu:jt(new Bi(20,"contextmenu",!0)),copyWithSyntaxHighlighting:jt(new Bi(21,"copyWithSyntaxHighlighting",!0,{description:$("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:jt(new MN(22,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],d_t,{description:$("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:jt(new Bi(23,"cursorSmoothCaretAnimation",!1,{description:$("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:jt(new MN(24,"cursorStyle",Cl.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],h_t,{description:$("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:jt(new ao(25,"cursorSurroundingLines",0,0,1073741824,{description:$("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:jt(new $r(26,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[$("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),$("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:$("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:jt(new ao(27,"cursorWidth",0,0,1073741824,{markdownDescription:$("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:jt(new Bi(28,"disableLayerHinting",!1)),disableMonospaceOptimizations:jt(new Bi(29,"disableMonospaceOptimizations",!1)),domReadOnly:jt(new Bi(30,"domReadOnly",!1)),dragAndDrop:jt(new Bi(31,"dragAndDrop",!0,{description:$("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:jt(new g_t),extraEditorClassName:jt(new Cu(33,"extraEditorClassName","")),fastScrollSensitivity:jt(new Mm(34,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:$("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:jt(new p_t),fixedOverflowWidgets:jt(new Bi(36,"fixedOverflowWidgets",!1)),folding:jt(new Bi(37,"folding",!0,{description:$("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:jt(new $r(38,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[$("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),$("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:$("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:jt(new Bi(39,"foldingHighlight",!0,{description:$("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:jt(new Bi(40,"foldingImportsByDefault",!1,{description:$("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),unfoldOnClickAfterEndOfLine:jt(new Bi(41,"unfoldOnClickAfterEndOfLine",!1,{description:$("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:jt(new Cu(42,"fontFamily",va.fontFamily,{description:$("fontFamily","Controls the font family.")})),fontInfo:jt(new m_t),fontLigatures2:jt(new gd),fontSize:jt(new __t),fontWeight:jt(new Tm),formatOnPaste:jt(new Bi(47,"formatOnPaste",!1,{description:$("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:jt(new Bi(48,"formatOnType",!1,{description:$("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:jt(new Bi(49,"glyphMargin",!0,{description:$("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:jt(new v_t),hideCursorInOverviewRuler:jt(new Bi(51,"hideCursorInOverviewRuler",!1,{description:$("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:jt(new b_t),inDiffEditor:jt(new Bi(53,"inDiffEditor",!1)),letterSpacing:jt(new Mm(55,"letterSpacing",va.letterSpacing,n=>Mm.clamp(n,-5,20),{description:$("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:jt(new T_t),lineDecorationsWidth:jt(new $w(57,"lineDecorationsWidth",10)),lineHeight:jt(new y_t),lineNumbers:jt(new R_t),lineNumbersMinChars:jt(new ao(60,"lineNumbersMinChars",5,1,300)),linkedEditing:jt(new Bi(61,"linkedEditing",!1,{description:$("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:jt(new Bi(62,"links",!0,{description:$("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:jt(new $r(63,"matchBrackets","always",["always","near","never"],{description:$("matchBrackets","Highlight matching brackets.")})),minimap:jt(new E_t),mouseStyle:jt(new $r(65,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:jt(new Mm(66,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:$("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:jt(new Bi(67,"mouseWheelZoom",!1,{markdownDescription:$("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:jt(new Bi(68,"multiCursorMergeOverlapping",!0,{description:$("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:jt(new MN(69,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],S_t,{markdownEnumDescriptions:[$("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),$("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:$({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:jt(new $r(70,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[$("multiCursorPaste.spread","Each cursor pastes a single line of the text."),$("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:$("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:jt(new Bi(71,"occurrencesHighlight",!0,{description:$("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:jt(new Bi(72,"overviewRulerBorder",!0,{description:$("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:jt(new ao(73,"overviewRulerLanes",3,0,3)),padding:jt(new w_t),parameterHints:jt(new I_t),peekWidgetDefaultFocus:jt(new $r(76,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[$("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),$("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:$("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:jt(new Bi(77,"definitionLinkOpensInPeek",!1,{description:$("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:jt(new O_t),quickSuggestionsDelay:jt(new ao(79,"quickSuggestionsDelay",10,0,1073741824,{description:$("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:jt(new Bi(80,"readOnly",!1)),renameOnType:jt(new Bi(81,"renameOnType",!1,{description:$("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:$("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:jt(new Bi(82,"renderControlCharacters",!0,{description:$("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:jt(new Bi(83,"renderFinalNewline",!0,{description:$("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:jt(new $r(84,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",$("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:$("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:jt(new Bi(85,"renderLineHighlightOnlyWhenFocus",!1,{description:$("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:jt(new $r(86,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:jt(new $r(87,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",$("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),$("renderWhitespace.selection","Render whitespace characters only on selected text."),$("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:$("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:jt(new ao(88,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:jt(new Bi(89,"roundedSelection",!0,{description:$("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:jt(new M_t),scrollbar:jt(new k_t),scrollBeyondLastColumn:jt(new ao(92,"scrollBeyondLastColumn",5,0,1073741824,{description:$("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:jt(new Bi(93,"scrollBeyondLastLine",!0,{description:$("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:jt(new Bi(94,"scrollPredominantAxis",!0,{description:$("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:jt(new Bi(95,"selectionClipboard",!0,{description:$("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Qc})),selectionHighlight:jt(new Bi(96,"selectionHighlight",!0,{description:$("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:jt(new Bi(97,"selectOnLineNumbers",!0)),showFoldingControls:jt(new $r(98,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[$("showFoldingControls.always","Always show the folding controls."),$("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:$("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:jt(new Bi(99,"showUnused",!0,{description:$("showUnused","Controls fading out of unused code.")})),showDeprecated:jt(new Bi(124,"showDeprecated",!0,{description:$("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:jt(new C_t),snippetSuggestions:jt(new $r(100,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[$("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),$("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),$("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),$("snippetSuggestions.none","Do not show snippet suggestions.")],description:$("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:jt(new x_t),smoothScrolling:jt(new Bi(102,"smoothScrolling",!1,{description:$("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:jt(new ao(104,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:jt(new $_t),inlineSuggest:jt(new A_t),suggestFontSize:jt(new ao(106,"suggestFontSize",0,0,1e3,{markdownDescription:$("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:jt(new ao(107,"suggestLineHeight",0,0,1e3,{markdownDescription:$("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:jt(new Bi(108,"suggestOnTriggerCharacters",!0,{description:$("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:jt(new $r(109,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[$("suggestSelection.first","Always select the first suggestion."),$("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),$("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:$("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:jt(new $r(110,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[$("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),$("tabCompletion.off","Disable tab completions."),$("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:$("tabCompletion","Enables tab completions.")})),tabIndex:jt(new ao(111,"tabIndex",0,-1,1073741824)),unusualLineTerminators:jt(new $r(112,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[$("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),$("unusualLineTerminators.off","Unusual line terminators are ignored."),$("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:$("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:jt(new Bi(113,"useShadowDOM",!0)),useTabStops:jt(new Bi(114,"useTabStops",!0,{description:$("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:jt(new Cu(115,"wordSeparators",wIe,{description:$("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:jt(new $r(116,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[$("wordWrap.off","Lines will never wrap."),$("wordWrap.on","Lines will wrap at the viewport width."),$({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),$({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:$({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:jt(new Cu(117,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:jt(new Cu(118,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:jt(new ao(119,"wordWrapColumn",80,1,1073741824,{markdownDescription:$({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:jt(new $r(120,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:jt(new $r(121,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:jt(new MN(122,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],F_t,{enumDescriptions:[$("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),$("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),$("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),$("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:$("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:jt(new $r(123,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[$("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),$("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],description:$("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:jt(new f_t),pixelRatio:jt(new L_t),tabFocusMode:jt(new P_t),layoutInfo:jt(new gO),wrappingInfo:jt(new B_t)};class W_t{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?new Error(e.message+`
- `+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const RIe=new W_t;function di(n){d_(n)||RIe.onUnexpectedError(n)}function Ol(n){d_(n)||RIe.onUnexpectedExternalError(n)}function mhe(n){if(n instanceof Error){let{name:e,message:t}=n;const i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i}}return n}const EY="Canceled";function d_(n){return n instanceof Error&&n.name===EY&&n.message===EY}function gM(){const n=new Error(EY);return n.name=n.message,n}function Wg(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function G_t(n){return new Error(`Illegal state: ${n}`)}class z_t extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}function ub(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}var zi;(function(n){function e(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(w){yield w}n.single=s;function o(w){return w||t}n.from=o;function r(w){return!w||w[Symbol.iterator]().next().done===!0}n.isEmpty=r;function a(w){return w[Symbol.iterator]().next().value}n.first=a;function c(w,I){for(const L of w)if(I(L))return!0;return!1}n.some=c;function u(w,I){for(const L of w)if(I(L))return L}n.find=u;function*d(w,I){for(const L of w)I(L)&&(yield L)}n.filter=d;function*f(w,I){let L=0;for(const O of w)yield I(O,L++)}n.map=f;function*g(...w){for(const I of w)for(const L of I)yield L}n.concat=g;function*p(w){for(const I of w)for(const L of I)yield L}n.concatNested=p;function _(w,I,L){let O=L;for(const A of w)O=I(O,A);return O}n.reduce=_;function*v(w,I,L=w.length){for(I<0&&(I+=w.length),L<0?L+=w.length:L>w.length&&(L=w.length);I<L;I++)yield w[I]}n.slice=v;function C(w,I=Number.POSITIVE_INFINITY){const L=[];if(I===0)return[L,w];const O=w[Symbol.iterator]();for(let A=0;A<I;A++){const N=O.next();if(N.done)return[L,n.empty()];L.push(N.value)}return[L,{[Symbol.iterator](){return O}}]}n.consume=C;function y(w,I,L=(O,A)=>O===A){const O=w[Symbol.iterator](),A=I[Symbol.iterator]();for(;;){const N=O.next(),D=A.next();if(N.done!==D.done)return!1;if(N.done)return!0;if(!L(N.value,D.value))return!1}}n.equals=y})(zi||(zi={}));class K_t extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function vne(n){return typeof n.dispose=="function"&&n.dispose.length===0}function Ji(n){if(zi.is(n)){let e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new K_t(e);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function AC(...n){return xi(()=>Ji(n))}function xi(n){return{dispose:ub(()=>{n()})}}class Wt{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){try{Ji(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Wt.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}Wt.DISABLE_DISPOSED_WARNING=!1;class wt{constructor(){this._store=new Wt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}wt.None=Object.freeze({dispose(){}});class pc{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e}}class j_t{constructor(e){this.object=e}dispose(){}}let yr=class SY{constructor(e){this.element=e,this.next=SY.Undefined,this.prev=SY.Undefined}};yr.Undefined=new yr(void 0);class Cd{constructor(){this._first=yr.Undefined,this._last=yr.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yr.Undefined}clear(){let e=this._first;for(;e!==yr.Undefined;){const t=e.next;e.prev=yr.Undefined,e.next=yr.Undefined,e=t}this._first=yr.Undefined,this._last=yr.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new yr(e);if(this._first===yr.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==yr.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yr.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==yr.Undefined&&e.next!==yr.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===yr.Undefined&&e.next===yr.Undefined?(this._first=yr.Undefined,this._last=yr.Undefined):e.next===yr.Undefined?(this._last=this._last.prev,this._last.next=yr.Undefined):e.prev===yr.Undefined&&(this._first=this._first.next,this._first.prev=yr.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yr.Undefined;)yield e.element,e=e.next}}const X_t=Io.performance&&typeof Io.performance.now=="function";class Ym{constructor(e){this._highResolution=X_t&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new Ym(e)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Io.performance.now():Date.now()}}var Ln;(function(n){n.None=()=>wt.None;function e(w){return(I,L=null,O)=>{let A=!1,N;return N=w(D=>{if(!A)return N?N.dispose():A=!0,I.call(L,D)},null,O),A&&N.dispose(),N}}n.once=e;function t(w,I){return c((L,O=null,A)=>w(N=>L.call(O,I(N)),null,A))}n.map=t;function i(w,I){return c((L,O=null,A)=>w(N=>{I(N),L.call(O,N)},null,A))}n.forEach=i;function s(w,I){return c((L,O=null,A)=>w(N=>I(N)&&L.call(O,N),null,A))}n.filter=s;function o(w){return w}n.signal=o;function r(...w){return(I,L=null,O)=>AC(...w.map(A=>A(N=>I.call(L,N),null,O)))}n.any=r;function a(w,I,L){let O=L;return t(w,A=>(O=I(O,A),O))}n.reduce=a;function c(w){let I;const L=new rt({onFirstListenerAdd(){I=w(L.fire,L)},onLastListenerRemove(){I.dispose()}});return L.event}function u(w,I,L=100,O=!1,A){let N,D,P,F=0;const V=new rt({leakWarningThreshold:A,onFirstListenerAdd(){N=w(U=>{F++,D=I(D,U),O&&!P&&(V.fire(D),D=void 0),clearTimeout(P),P=setTimeout(()=>{const Q=D;D=void 0,P=void 0,(!O||F>1)&&V.fire(Q),F=0},L)})},onLastListenerRemove(){N.dispose()}});return V.event}n.debounce=u;function d(w,I=(L,O)=>L===O){let L=!0,O;return s(w,A=>{const N=L||!I(A,O);return L=!1,O=A,N})}n.latch=d;function f(w,I){return[n.filter(w,I),n.filter(w,L=>!I(L))]}n.split=f;function g(w,I=!1,L=[]){let O=L.slice(),A=w(P=>{O?O.push(P):D.fire(P)});const N=()=>{O&&O.forEach(P=>D.fire(P)),O=null},D=new rt({onFirstListenerAdd(){A||(A=w(P=>D.fire(P)))},onFirstListenerDidAdd(){O&&(I?setTimeout(N):N())},onLastListenerRemove(){A&&A.dispose(),A=null}});return D.event}n.buffer=g;class p{constructor(I){this.event=I}map(I){return new p(t(this.event,I))}forEach(I){return new p(i(this.event,I))}filter(I){return new p(s(this.event,I))}reduce(I,L){return new p(a(this.event,I,L))}latch(){return new p(d(this.event))}debounce(I,L=100,O=!1,A){return new p(u(this.event,I,L,O,A))}on(I,L,O){return this.event(I,L,O)}once(I,L,O){return e(this.event)(I,L,O)}}function _(w){return new p(w)}n.chain=_;function v(w,I,L=O=>O){const O=(...P)=>D.fire(L(...P)),A=()=>w.on(I,O),N=()=>w.removeListener(I,O),D=new rt({onFirstListenerAdd:A,onLastListenerRemove:N});return D.event}n.fromNodeEventEmitter=v;function C(w,I,L=O=>O){const O=(...P)=>D.fire(L(...P)),A=()=>w.addEventListener(I,O),N=()=>w.removeEventListener(I,O),D=new rt({onFirstListenerAdd:A,onLastListenerRemove:N});return D.event}n.fromDOMEventEmitter=C;function y(w){return new Promise(I=>e(w)(I))}n.toPromise=y})(Ln||(Ln={}));class B8{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${B8._idPool++}`}start(e){this._stopWatch=new Ym(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}B8._idPool=0;let rt=class{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=!((t=this._options)===null||t===void 0)&&t._profName?new B8(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var s;this._listeners||(this._listeners=new Cd);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(t?[e,t]:e);o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const a=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),c=xi(()=>{a&&a(),this._disposed||(r(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return i instanceof Wt?i.add(c):Array.isArray(i)&&i.push(c),c}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Cd);for(let s of this._listeners)this._deliveryQueue.push([s,e]);for((t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,o]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,o):s[0].call(s[1],o)}catch(r){di(r)}}(i=this._perfMon)===null||i===void 0||i.stop()}}dispose(){var e,t,i,s,o;this._disposed||(this._disposed=!0,(e=this._listeners)===null||e===void 0||e.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(i=this._options)===null||i===void 0?void 0:i.onLastListenerRemove)===null||s===void 0||s.call(i),(o=this._leakageMon)===null||o===void 0||o.dispose())}};class FW extends rt{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Cd,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class Y_t extends FW{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class bne{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,s)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(s=>s()),i}}class _he{constructor(){this.listening=!1,this.inputEvent=Ln.None,this.inputEventListener=wt.None,this.emitter=new rt({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const MIe=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var Ai;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof jU?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ln.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:MIe})})(Ai||(Ai={}));class jU{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?MIe:(this._emitter||(this._emitter=new rt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class dc{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new jU),this._token}cancel(){this._token?this._token instanceof jU&&this._token.cancel():this._token=Ai.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof jU&&this._token.dispose():this._token=Ai.None}}class Tne{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const XU=new Tne,wY=new Tne,IY=new Tne,kIe=new Array(230),q_t=Object.create(null),J_t=Object.create(null),Cne=[];for(let n=0;n<=193;n++)Cne[n]=-1;(function(){const n="",e=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[0,1,1,"Hyper",0,n,0,n,n,n],[0,1,2,"Super",0,n,0,n,n,n],[0,1,3,"Fn",0,n,0,n,n,n],[0,1,4,"FnLock",0,n,0,n,n,n],[0,1,5,"Suspend",0,n,0,n,n,n],[0,1,6,"Resume",0,n,0,n,n,n],[0,1,7,"Turbo",0,n,0,n,n,n],[0,1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[0,1,9,"WakeUp",0,n,0,n,n,n],[31,0,10,"KeyA",31,"A",65,"VK_A",n,n],[32,0,11,"KeyB",32,"B",66,"VK_B",n,n],[33,0,12,"KeyC",33,"C",67,"VK_C",n,n],[34,0,13,"KeyD",34,"D",68,"VK_D",n,n],[35,0,14,"KeyE",35,"E",69,"VK_E",n,n],[36,0,15,"KeyF",36,"F",70,"VK_F",n,n],[37,0,16,"KeyG",37,"G",71,"VK_G",n,n],[38,0,17,"KeyH",38,"H",72,"VK_H",n,n],[39,0,18,"KeyI",39,"I",73,"VK_I",n,n],[40,0,19,"KeyJ",40,"J",74,"VK_J",n,n],[41,0,20,"KeyK",41,"K",75,"VK_K",n,n],[42,0,21,"KeyL",42,"L",76,"VK_L",n,n],[43,0,22,"KeyM",43,"M",77,"VK_M",n,n],[44,0,23,"KeyN",44,"N",78,"VK_N",n,n],[45,0,24,"KeyO",45,"O",79,"VK_O",n,n],[46,0,25,"KeyP",46,"P",80,"VK_P",n,n],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[48,0,27,"KeyR",48,"R",82,"VK_R",n,n],[49,0,28,"KeyS",49,"S",83,"VK_S",n,n],[50,0,29,"KeyT",50,"T",84,"VK_T",n,n],[51,0,30,"KeyU",51,"U",85,"VK_U",n,n],[52,0,31,"KeyV",52,"V",86,"VK_V",n,n],[53,0,32,"KeyW",53,"W",87,"VK_W",n,n],[54,0,33,"KeyX",54,"X",88,"VK_X",n,n],[55,0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[22,0,36,"Digit1",22,"1",49,"VK_1",n,n],[23,0,37,"Digit2",23,"2",50,"VK_2",n,n],[24,0,38,"Digit3",24,"3",51,"VK_3",n,n],[25,0,39,"Digit4",25,"4",52,"VK_4",n,n],[26,0,40,"Digit5",26,"5",53,"VK_5",n,n],[27,0,41,"Digit6",27,"6",54,"VK_6",n,n],[28,0,42,"Digit7",28,"7",55,"VK_7",n,n],[29,0,43,"Digit8",29,"8",56,"VK_8",n,n],[30,0,44,"Digit9",30,"9",57,"VK_9",n,n],[21,0,45,"Digit0",21,"0",48,"VK_0",n,n],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[10,1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,n,0,n,n,n],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[59,1,64,"F1",59,"F1",112,"VK_F1",n,n],[60,1,65,"F2",60,"F2",113,"VK_F2",n,n],[61,1,66,"F3",61,"F3",114,"VK_F3",n,n],[62,1,67,"F4",62,"F4",115,"VK_F4",n,n],[63,1,68,"F5",63,"F5",116,"VK_F5",n,n],[64,1,69,"F6",64,"F6",117,"VK_F6",n,n],[65,1,70,"F7",65,"F7",118,"VK_F7",n,n],[66,1,71,"F8",66,"F8",119,"VK_F8",n,n],[67,1,72,"F9",67,"F9",120,"VK_F9",n,n],[68,1,73,"F10",68,"F10",121,"VK_F10",n,n],[69,1,74,"F11",69,"F11",122,"VK_F11",n,n],[70,1,75,"F12",70,"F12",123,"VK_F12",n,n],[0,1,76,"PrintScreen",0,n,0,n,n,n],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",n,n],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[14,1,80,"Home",14,"Home",36,"VK_HOME",n,n],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[13,1,83,"End",13,"End",35,"VK_END",n,n],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",n,n],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",n,n],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",n,n],[3,1,94,"NumpadEnter",3,n,0,n,n,n],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",n,n],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",n,n],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",n,n],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",n,n],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",n,n],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",n,n],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",n,n],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",n,n],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",n,n],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",n,n],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",n,n],[58,1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[0,1,108,"Power",0,n,0,n,n,n],[0,1,109,"NumpadEqual",0,n,0,n,n,n],[71,1,110,"F13",71,"F13",124,"VK_F13",n,n],[72,1,111,"F14",72,"F14",125,"VK_F14",n,n],[73,1,112,"F15",73,"F15",126,"VK_F15",n,n],[74,1,113,"F16",74,"F16",127,"VK_F16",n,n],[75,1,114,"F17",75,"F17",128,"VK_F17",n,n],[76,1,115,"F18",76,"F18",129,"VK_F18",n,n],[77,1,116,"F19",77,"F19",130,"VK_F19",n,n],[0,1,117,"F20",0,n,0,"VK_F20",n,n],[0,1,118,"F21",0,n,0,"VK_F21",n,n],[0,1,119,"F22",0,n,0,"VK_F22",n,n],[0,1,120,"F23",0,n,0,"VK_F23",n,n],[0,1,121,"F24",0,n,0,"VK_F24",n,n],[0,1,122,"Open",0,n,0,n,n,n],[0,1,123,"Help",0,n,0,n,n,n],[0,1,124,"Select",0,n,0,n,n,n],[0,1,125,"Again",0,n,0,n,n,n],[0,1,126,"Undo",0,n,0,n,n,n],[0,1,127,"Cut",0,n,0,n,n,n],[0,1,128,"Copy",0,n,0,n,n,n],[0,1,129,"Paste",0,n,0,n,n,n],[0,1,130,"Find",0,n,0,n,n,n],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",n,n],[0,1,136,"KanaMode",0,n,0,n,n,n],[0,0,137,"IntlYen",0,n,0,n,n,n],[0,1,138,"Convert",0,n,0,n,n,n],[0,1,139,"NonConvert",0,n,0,n,n,n],[0,1,140,"Lang1",0,n,0,n,n,n],[0,1,141,"Lang2",0,n,0,n,n,n],[0,1,142,"Lang3",0,n,0,n,n,n],[0,1,143,"Lang4",0,n,0,n,n,n],[0,1,144,"Lang5",0,n,0,n,n,n],[0,1,145,"Abort",0,n,0,n,n,n],[0,1,146,"Props",0,n,0,n,n,n],[0,1,147,"NumpadParenLeft",0,n,0,n,n,n],[0,1,148,"NumpadParenRight",0,n,0,n,n,n],[0,1,149,"NumpadBackspace",0,n,0,n,n,n],[0,1,150,"NumpadMemoryStore",0,n,0,n,n,n],[0,1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[0,1,152,"NumpadMemoryClear",0,n,0,n,n,n],[0,1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[0,1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[0,1,155,"NumpadClear",0,n,0,n,n,n],[0,1,156,"NumpadClearEntry",0,n,0,n,n,n],[5,1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[4,1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[6,1,0,n,6,"Alt",18,"VK_MENU",n,n],[57,1,0,n,57,"Meta",0,"VK_COMMAND",n,n],[5,1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[4,1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[6,1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[57,1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[5,1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[4,1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[6,1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[57,1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[0,1,165,"BrightnessUp",0,n,0,n,n,n],[0,1,166,"BrightnessDown",0,n,0,n,n,n],[0,1,167,"MediaPlay",0,n,0,n,n,n],[0,1,168,"MediaRecord",0,n,0,n,n,n],[0,1,169,"MediaFastForward",0,n,0,n,n,n],[0,1,170,"MediaRewind",0,n,0,n,n,n],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",n,n],[0,1,174,"Eject",0,n,0,n,n,n],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[0,1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[0,1,180,"SelectTask",0,n,0,n,n,n],[0,1,181,"LaunchScreenSaver",0,n,0,n,n,n],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[0,1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[0,1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[0,1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[0,1,189,"ZoomToggle",0,n,0,n,n,n],[0,1,190,"MailReply",0,n,0,n,n,n],[0,1,191,"MailForward",0,n,0,n,n,n],[0,1,192,"MailSend",0,n,0,n,n,n],[109,1,0,n,109,"KeyInComposition",229,n,n,n],[111,1,0,n,111,"ABNT_C2",194,"VK_ABNT_C2",n,n],[91,1,0,n,91,"OEM_8",223,"VK_OEM_8",n,n],[0,1,0,n,0,n,0,"VK_CLEAR",n,n],[0,1,0,n,0,n,0,"VK_KANA",n,n],[0,1,0,n,0,n,0,"VK_HANGUL",n,n],[0,1,0,n,0,n,0,"VK_JUNJA",n,n],[0,1,0,n,0,n,0,"VK_FINAL",n,n],[0,1,0,n,0,n,0,"VK_HANJA",n,n],[0,1,0,n,0,n,0,"VK_KANJI",n,n],[0,1,0,n,0,n,0,"VK_CONVERT",n,n],[0,1,0,n,0,n,0,"VK_NONCONVERT",n,n],[0,1,0,n,0,n,0,"VK_ACCEPT",n,n],[0,1,0,n,0,n,0,"VK_MODECHANGE",n,n],[0,1,0,n,0,n,0,"VK_SELECT",n,n],[0,1,0,n,0,n,0,"VK_PRINT",n,n],[0,1,0,n,0,n,0,"VK_EXECUTE",n,n],[0,1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[0,1,0,n,0,n,0,"VK_HELP",n,n],[0,1,0,n,0,n,0,"VK_APPS",n,n],[0,1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[0,1,0,n,0,n,0,"VK_PACKET",n,n],[0,1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[0,1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[0,1,0,n,0,n,0,"VK_ATTN",n,n],[0,1,0,n,0,n,0,"VK_CRSEL",n,n],[0,1,0,n,0,n,0,"VK_EXSEL",n,n],[0,1,0,n,0,n,0,"VK_EREOF",n,n],[0,1,0,n,0,n,0,"VK_PLAY",n,n],[0,1,0,n,0,n,0,"VK_ZOOM",n,n],[0,1,0,n,0,n,0,"VK_NONAME",n,n],[0,1,0,n,0,n,0,"VK_PA1",n,n],[0,1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]];let t=[],i=[];for(const s of e){const[o,r,a,c,u,d,f,g,p,_]=s;if(i[a]||(i[a]=!0,q_t[c]=a,J_t[c.toLowerCase()]=a,r&&(Cne[a]=u)),!t[u]){if(t[u]=!0,!d)throw new Error(`String representation missing for key code ${u} around scan code ${c}`);XU.define(u,d),wY.define(u,p||d),IY.define(u,_||p||d)}f&&(kIe[f]=u)}})();var XS;(function(n){function e(a){return XU.keyCodeToStr(a)}n.toString=e;function t(a){return XU.strToKeyCode(a)}n.fromString=t;function i(a){return wY.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return IY.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return wY.strToKeyCode(a)||IY.strToKeyCode(a)}n.fromUserSettings=o;function r(a){if(a>=93&&a<=108)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return XU.keyCodeToStr(a)}n.toElectronAccelerator=r})(XS||(XS={}));function fl(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var vhe={};let pO;if(typeof Io.vscode<"u"&&typeof Io.vscode.process<"u"){const n=Io.vscode.process;pO={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()},nextTick(e){return CY(e)}}}else typeof process<"u"?pO={get platform(){return process.platform},get arch(){return process.arch},get env(){return vhe},cwd(){return vhe.VSCODE_CWD||process.cwd()},nextTick(n){return process.nextTick(n)}}:pO={get platform(){return zl?"win32":ki?"darwin":"linux"},get arch(){},nextTick(n){return CY(n)},get env(){return{}},cwd(){return"/"}};const LY=pO.cwd,Q_t=pO.env,xw=pO.platform,Z_t=65,evt=97,tvt=90,nvt=122,NC=46,Aa=47,ad=92,DT=58,ivt=63;class AIe extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${s} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function ol(n,e){if(typeof n!="string")throw new AIe(e,"string",n)}function cs(n){return n===Aa||n===ad}function OY(n){return n===Aa}function $T(n){return n>=Z_t&&n<=tvt||n>=evt&&n<=nvt}function BW(n,e,t,i){let s="",o=0,r=-1,a=0,c=0;for(let u=0;u<=n.length;++u){if(u<n.length)c=n.charCodeAt(u);else{if(i(c))break;c=Aa}if(i(c)){if(!(r===u-1||a===1))if(a===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==NC||s.charCodeAt(s.length-2)!==NC){if(s.length>2){const d=s.lastIndexOf(t);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(t)),r=u,a=0;continue}else if(s.length!==0){s="",o=0,r=u,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",o=2)}else s.length>0?s+=`${t}${n.slice(r+1,u)}`:s=n.slice(r+1,u),o=u-r-1;r=u,a=0}else c===NC&&a!==-1?++a:a=-1}return s}function NIe(n,e){if(e===null||typeof e!="object")throw new AIe("pathObject","Object",e);const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const Ru={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let o;if(s>=0){if(o=n[s],ol(o,"path"),o.length===0)continue}else e.length===0?o=LY():(o=Q_t[`=${e}`]||LY(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===ad)&&(o=`${e}\\`));const r=o.length;let a=0,c="",u=!1;const d=o.charCodeAt(0);if(r===1)cs(d)&&(a=1,u=!0);else if(cs(d))if(u=!0,cs(o.charCodeAt(1))){let f=2,g=f;for(;f<r&&!cs(o.charCodeAt(f));)f++;if(f<r&&f!==g){const p=o.slice(g,f);for(g=f;f<r&&cs(o.charCodeAt(f));)f++;if(f<r&&f!==g){for(g=f;f<r&&!cs(o.charCodeAt(f));)f++;(f===r||f!==g)&&(c=`\\\\${p}\\${o.slice(g,f)}`,a=f)}}}else a=1;else $T(d)&&o.charCodeAt(1)===DT&&(c=o.slice(0,2),a=2,r>2&&cs(o.charCodeAt(2))&&(u=!0,a=3));if(c.length>0)if(e.length>0){if(c.toLowerCase()!==e.toLowerCase())continue}else e=c;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=u,u&&e.length>0)break}return t=BW(t,!i,"\\",cs),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){ol(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const o=n.charCodeAt(0);if(e===1)return OY(o)?"\\":n;if(cs(o))if(s=!0,cs(n.charCodeAt(1))){let a=2,c=a;for(;a<e&&!cs(n.charCodeAt(a));)a++;if(a<e&&a!==c){const u=n.slice(c,a);for(c=a;a<e&&cs(n.charCodeAt(a));)a++;if(a<e&&a!==c){for(c=a;a<e&&!cs(n.charCodeAt(a));)a++;if(a===e)return`\\\\${u}\\${n.slice(c)}\\`;a!==c&&(i=`\\\\${u}\\${n.slice(c,a)}`,t=a)}}}else t=1;else $T(o)&&n.charCodeAt(1)===DT&&(i=n.slice(0,2),t=2,e>2&&cs(n.charCodeAt(2))&&(s=!0,t=3));let r=t<e?BW(n.slice(t),!s,"\\",cs):"";return r.length===0&&!s&&(r="."),r.length>0&&cs(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(n){ol(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return cs(t)||e>2&&$T(t)&&n.charCodeAt(1)===DT&&cs(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o<n.length;++o){const r=n[o];ol(r,"path"),r.length>0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&cs(t.charCodeAt(0))){++s;const o=t.length;o>1&&cs(t.charCodeAt(1))&&(++s,o>2&&(cs(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s<e.length&&cs(e.charCodeAt(s));)s++;s>=2&&(e=`\\${e.slice(s)}`)}return Ru.normalize(e)},relative(n,e){if(ol(n,"from"),ol(e,"to"),n===e)return"";const t=Ru.resolve(n),i=Ru.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;s<n.length&&n.charCodeAt(s)===ad;)s++;let o=n.length;for(;o-1>s&&n.charCodeAt(o-1)===ad;)o--;const r=o-s;let a=0;for(;a<e.length&&e.charCodeAt(a)===ad;)a++;let c=e.length;for(;c-1>a&&e.charCodeAt(c-1)===ad;)c--;const u=c-a,d=r<u?r:u;let f=-1,g=0;for(;g<d;g++){const _=n.charCodeAt(s+g);if(_!==e.charCodeAt(a+g))break;_===ad&&(f=g)}if(g!==d){if(f===-1)return i}else{if(u>d){if(e.charCodeAt(a+g)===ad)return i.slice(a+g+1);if(g===2)return i.slice(a+g)}r>d&&(n.charCodeAt(s+g)===ad?f=g:g===2&&(f=3)),f===-1&&(f=0)}let p="";for(g=s+f+1;g<=o;++g)(g===o||n.charCodeAt(g)===ad)&&(p+=p.length===0?"..":"\\..");return a+=f,p.length>0?`${p}${i.slice(a,c)}`:(i.charCodeAt(a)===ad&&++a,i.slice(a,c))},toNamespacedPath(n){if(typeof n!="string")return n;if(n.length===0)return"";const e=Ru.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===ad){if(e.charCodeAt(1)===ad){const t=e.charCodeAt(2);if(t!==ivt&&t!==NC)return`\\\\?\\UNC\\${e.slice(2)}`}}else if($T(e.charCodeAt(0))&&e.charCodeAt(1)===DT&&e.charCodeAt(2)===ad)return`\\\\?\\${e}`;return n},dirname(n){ol(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return cs(s)?n:".";if(cs(s)){if(t=i=1,cs(n.charCodeAt(1))){let a=2,c=a;for(;a<e&&!cs(n.charCodeAt(a));)a++;if(a<e&&a!==c){for(c=a;a<e&&cs(n.charCodeAt(a));)a++;if(a<e&&a!==c){for(c=a;a<e&&!cs(n.charCodeAt(a));)a++;if(a===e)return n;a!==c&&(t=i=a+1)}}}}else $T(s)&&n.charCodeAt(1)===DT&&(t=e>2&&cs(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(cs(n.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&ol(e,"ext"),ol(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&$T(n.charCodeAt(0))&&n.charCodeAt(1)===DT&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const c=n.charCodeAt(o);if(cs(c)){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(c===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(cs(n.charCodeAt(o))){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){ol(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===DT&&$T(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const c=n.charCodeAt(a);if(cs(c)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),c===NC?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:NIe.bind(null,"\\"),parse(n){ol(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return cs(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(cs(s)){if(i=1,cs(n.charCodeAt(1))){let f=2,g=f;for(;f<t&&!cs(n.charCodeAt(f));)f++;if(f<t&&f!==g){for(g=f;f<t&&cs(n.charCodeAt(f));)f++;if(f<t&&f!==g){for(g=f;f<t&&!cs(n.charCodeAt(f));)f++;f===t?i=f:f!==g&&(i=f+1)}}}}else if($T(s)&&n.charCodeAt(1)===DT){if(t<=2)return e.root=e.dir=n,e;if(i=2,cs(n.charCodeAt(2))){if(t===3)return e.root=e.dir=n,e;i=3}}i>0&&(e.root=n.slice(0,i));let o=-1,r=i,a=-1,c=!0,u=n.length-1,d=0;for(;u>=i;--u){if(s=n.charCodeAt(u),cs(s)){if(!c){r=u+1;break}continue}a===-1&&(c=!1,a=u+1),s===NC?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=n.slice(r,a):(e.name=n.slice(r,o),e.base=n.slice(r,a),e.ext=n.slice(o,a))),r>0&&r!==i?e.dir=n.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Kr={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:LY();ol(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===Aa)}return e=BW(e,!t,"/",OY),t?`/${e}`:e.length>0?e:"."},normalize(n){if(ol(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Aa,t=n.charCodeAt(n.length-1)===Aa;return n=BW(n,!e,"/",OY),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return ol(n,"path"),n.length>0&&n.charCodeAt(0)===Aa},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const i=n[t];ol(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Kr.normalize(e)},relative(n,e){if(ol(n,"from"),ol(e,"to"),n===e||(n=Kr.resolve(n),e=Kr.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,o=1,r=e.length-o,a=s<r?s:r;let c=-1,u=0;for(;u<a;u++){const f=n.charCodeAt(t+u);if(f!==e.charCodeAt(o+u))break;f===Aa&&(c=u)}if(u===a)if(r>a){if(e.charCodeAt(o+u)===Aa)return e.slice(o+u+1);if(u===0)return e.slice(o+u)}else s>a&&(n.charCodeAt(t+u)===Aa?c=u:u===0&&(c=0));let d="";for(u=t+c+1;u<=i;++u)(u===i||n.charCodeAt(u)===Aa)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+c)}`},toNamespacedPath(n){return n},dirname(n){if(ol(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Aa;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===Aa){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&ol(e,"ext"),ol(n,"path");let t=0,i=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const c=n.charCodeAt(o);if(c===Aa){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(c===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Aa){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){ol(n,"path");let e=-1,t=0,i=-1,s=!0,o=0;for(let r=n.length-1;r>=0;--r){const a=n.charCodeAt(r);if(a===Aa){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===NC?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:NIe.bind(null,"/"),parse(n){ol(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Aa;let i;t?(e.root="/",i=1):i=0;let s=-1,o=0,r=-1,a=!0,c=n.length-1,u=0;for(;c>=i;--c){const d=n.charCodeAt(c);if(d===Aa){if(!a){o=c+1;break}continue}r===-1&&(a=!1,r=c+1),d===NC?s===-1?s=c:u!==1&&(u=1):s!==-1&&(u=-1)}if(r!==-1){const d=o===0&&t?1:o;s===-1||u===0||u===1&&s===r-1&&s===o+1?e.base=e.name=n.slice(d,r):(e.name=n.slice(d,s),e.base=n.slice(d,r),e.ext=n.slice(s,r))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Kr.win32=Ru.win32=Ru;Kr.posix=Ru.posix=Kr;const yne=xw==="win32"?Ru.normalize:Kr.normalize,svt=xw==="win32"?Ru.resolve:Kr.resolve,ovt=xw==="win32"?Ru.relative:Kr.relative,DIe=xw==="win32"?Ru.dirname:Kr.dirname,d0=xw==="win32"?Ru.basename:Kr.basename,rvt=xw==="win32"?Ru.extname:Kr.extname,h0=xw==="win32"?Ru.sep:Kr.sep,lvt=/^\w[\w\d+.-]*$/,avt=/^\//,cvt=/^\/\//;function bhe(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!lvt.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!avt.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(cvt.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function uvt(n,e){return!n&&!e?"file":n}function dvt(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==Mg&&(e=Mg+e):e=Mg;break}return e}const Zo="",Mg="/",hvt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Jn{constructor(e,t,i,s,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||Zo,this.authority=e.authority||Zo,this.path=e.path||Zo,this.query=e.query||Zo,this.fragment=e.fragment||Zo):(this.scheme=uvt(e,r),this.authority=t||Zo,this.path=dvt(this.scheme,i||Zo),this.query=s||Zo,this.fragment=o||Zo,bhe(this,r))}static isUri(e){return e instanceof Jn?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}get fsPath(){return HW(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=Zo),i===void 0?i=this.authority:i===null&&(i=Zo),s===void 0?s=this.path:s===null&&(s=Zo),o===void 0?o=this.query:o===null&&(o=Zo),r===void 0?r=this.fragment:r===null&&(r=Zo),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new QL(t,i,s,o,r)}static parse(e,t=!1){const i=hvt.exec(e);return i?new QL(i[2]||Zo,HH(i[4]||Zo),HH(i[5]||Zo),HH(i[7]||Zo),HH(i[9]||Zo),t):new QL(Zo,Zo,Zo,Zo,Zo)}static file(e){let t=Zo;if(zl&&(e=e.replace(/\\/g,Mg)),e[0]===Mg&&e[1]===Mg){const i=e.indexOf(Mg,2);i===-1?(t=e.substring(2),e=Mg):(t=e.substring(2,i),e=e.substring(i)||Mg)}return new QL("file",t,e,Zo,Zo)}static from(e){const t=new QL(e.scheme,e.authority,e.path,e.query,e.fragment);return bhe(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return zl&&e.scheme==="file"?i=Jn.file(Ru.join(HW(e,!0),...t)).path:i=Kr.join(e.path,...t),e.with({path:i})}toString(e=!1){return RY(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Jn)return e;{const t=new QL(e);return t._formatted=e.external,t._fsPath=e._sep===$Ie?e.fsPath:null,t}}else return e}}const $Ie=zl?1:void 0;let QL=class extends Jn{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=HW(this,!1)),this._fsPath}toString(e=!1){return e?RY(this,!0):(this._formatted||(this._formatted=RY(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=$Ie),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const xIe={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function The(n,e){let t,i=-1;for(let s=0;s<n.length;s++){const o=n.charCodeAt(s);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47)i!==-1&&(t+=encodeURIComponent(n.substring(i,s)),i=-1),t!==void 0&&(t+=n.charAt(s));else{t===void 0&&(t=n.substr(0,s));const r=xIe[o];r!==void 0?(i!==-1&&(t+=encodeURIComponent(n.substring(i,s)),i=-1),t+=r):i===-1&&(i=s)}}return i!==-1&&(t+=encodeURIComponent(n.substring(i))),t!==void 0?t:n}function fvt(n){let e;for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);i===35||i===63?(e===void 0&&(e=n.substr(0,t)),e+=xIe[i]):e!==void 0&&(e+=n[t])}return e!==void 0?e:n}function HW(n,e){let t;return n.authority&&n.path.length>1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,zl&&(t=t.replace(/\//g,"\\")),t}function RY(n,e){const t=e?fvt:The;let i="",{scheme:s,authority:o,path:r,query:a,fragment:c}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=Mg,i+=Mg),o){let u=o.indexOf("@");if(u!==-1){const d=o.substr(0,u);o=o.substr(u+1),u=d.indexOf(":"),u===-1?i+=t(d,!1):(i+=t(d.substr(0,u),!1),i+=":",i+=t(d.substr(u+1),!1)),i+="@"}o=o.toLowerCase(),u=o.indexOf(":"),u===-1?i+=t(o,!1):(i+=t(o.substr(0,u),!1),i+=o.substr(u))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const u=r.charCodeAt(1);u>=65&&u<=90&&(r=`/${String.fromCharCode(u+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const u=r.charCodeAt(0);u>=65&&u<=90&&(r=`${String.fromCharCode(u+32)}:${r.substr(2)}`)}i+=t(r,!0)}return a&&(i+="?",i+=t(a,!1)),c&&(i+="#",i+=e?c:The(c,!1)),i}function PIe(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+PIe(n.substr(3)):n}}const Che=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function HH(n){return n.match(Che)?n.replace(Che,e=>PIe(e)):n}class ct{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new ct(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ct.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ct.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return ct.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){let i=e.lineNumber|0,s=t.lineNumber|0;if(i===s){let o=e.column|0,r=t.column|0;return o-r}return i-s}clone(){return new ct(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new ct(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}}let be=class ka{constructor(e,t,i,s){e>i||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return ka.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return ka.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}containsRange(e){return ka.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return ka.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return ka.plusRange(this,e)}static plusRange(e,t){let i,s,o,r;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,s=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,s=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,s=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new ka(i,s,o,r)}intersectRanges(e){return ka.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=t.startLineNumber,c=t.startColumn,u=t.endLineNumber,d=t.endColumn;return i<a?(i=a,s=c):i===a&&(s=Math.max(s,c)),o>u?(o=u,r=d):o===u&&(r=Math.min(r,d)),i>o||i===o&&s>r?null:new ka(i,s,o,r)}equalsRange(e){return ka.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return ka.getEndPosition(this)}static getEndPosition(e){return new ct(e.endLineNumber,e.endColumn)}getStartPosition(){return ka.getStartPosition(this)}static getStartPosition(e){return new ct(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new ka(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new ka(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return ka.collapseToStart(this)}static collapseToStart(e){return new ka(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new ka(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new ka(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const o=e.startLineNumber|0,r=t.startLineNumber|0;if(o===r){const a=e.startColumn|0,c=t.startColumn|0;if(a===c){const u=e.endLineNumber|0,d=t.endLineNumber|0;if(u===d){const f=e.endColumn|0,g=t.endColumn|0;return f-g}return u-d}return a-c}return o-r}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}};class fn extends be{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return fn.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new fn(this.startLineNumber,this.startColumn,e,t):new fn(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ct(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return this.getDirection()===0?new fn(e,t,this.endLineNumber,this.endColumn):new fn(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new fn(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new fn(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,i,s,o){return o===0?new fn(e,t,i,s):new fn(i,s,e,t)}}let H8=class{constructor(e,t,i){this._tokenBrand=void 0,this.offset=e|0,this.type=t,this.language=i}toString(){return"("+this.offset+", "+this.type+")"}};class Ene{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class V8{constructor(e,t){this._tokenizationResult2Brand=void 0,this.tokens=e,this.endState=t}}var MY;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(MY||(MY={}));var kY;(function(n){n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(kY||(kY={}));var AY;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(AY||(AY={}));var NY;(function(n){n[n.Deprecated=1]="Deprecated"})(NY||(NY={}));var DY;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(DY||(DY={}));var $Y;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})($Y||($Y={}));var xY;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(xY||(xY={}));var PY;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(PY||(PY={}));var FY;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(FY||(FY={}));var BY;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(BY||(BY={}));var HY;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.autoClosingBrackets=5]="autoClosingBrackets",n[n.autoClosingDelete=6]="autoClosingDelete",n[n.autoClosingOvertype=7]="autoClosingOvertype",n[n.autoClosingQuotes=8]="autoClosingQuotes",n[n.autoIndent=9]="autoIndent",n[n.automaticLayout=10]="automaticLayout",n[n.autoSurround=11]="autoSurround",n[n.bracketPairColorization=12]="bracketPairColorization",n[n.guides=13]="guides",n[n.codeLens=14]="codeLens",n[n.codeLensFontFamily=15]="codeLensFontFamily",n[n.codeLensFontSize=16]="codeLensFontSize",n[n.colorDecorators=17]="colorDecorators",n[n.columnSelection=18]="columnSelection",n[n.comments=19]="comments",n[n.contextmenu=20]="contextmenu",n[n.copyWithSyntaxHighlighting=21]="copyWithSyntaxHighlighting",n[n.cursorBlinking=22]="cursorBlinking",n[n.cursorSmoothCaretAnimation=23]="cursorSmoothCaretAnimation",n[n.cursorStyle=24]="cursorStyle",n[n.cursorSurroundingLines=25]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=26]="cursorSurroundingLinesStyle",n[n.cursorWidth=27]="cursorWidth",n[n.disableLayerHinting=28]="disableLayerHinting",n[n.disableMonospaceOptimizations=29]="disableMonospaceOptimizations",n[n.domReadOnly=30]="domReadOnly",n[n.dragAndDrop=31]="dragAndDrop",n[n.emptySelectionClipboard=32]="emptySelectionClipboard",n[n.extraEditorClassName=33]="extraEditorClassName",n[n.fastScrollSensitivity=34]="fastScrollSensitivity",n[n.find=35]="find",n[n.fixedOverflowWidgets=36]="fixedOverflowWidgets",n[n.folding=37]="folding",n[n.foldingStrategy=38]="foldingStrategy",n[n.foldingHighlight=39]="foldingHighlight",n[n.foldingImportsByDefault=40]="foldingImportsByDefault",n[n.unfoldOnClickAfterEndOfLine=41]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=42]="fontFamily",n[n.fontInfo=43]="fontInfo",n[n.fontLigatures=44]="fontLigatures",n[n.fontSize=45]="fontSize",n[n.fontWeight=46]="fontWeight",n[n.formatOnPaste=47]="formatOnPaste",n[n.formatOnType=48]="formatOnType",n[n.glyphMargin=49]="glyphMargin",n[n.gotoLocation=50]="gotoLocation",n[n.hideCursorInOverviewRuler=51]="hideCursorInOverviewRuler",n[n.hover=52]="hover",n[n.inDiffEditor=53]="inDiffEditor",n[n.inlineSuggest=54]="inlineSuggest",n[n.letterSpacing=55]="letterSpacing",n[n.lightbulb=56]="lightbulb",n[n.lineDecorationsWidth=57]="lineDecorationsWidth",n[n.lineHeight=58]="lineHeight",n[n.lineNumbers=59]="lineNumbers",n[n.lineNumbersMinChars=60]="lineNumbersMinChars",n[n.linkedEditing=61]="linkedEditing",n[n.links=62]="links",n[n.matchBrackets=63]="matchBrackets",n[n.minimap=64]="minimap",n[n.mouseStyle=65]="mouseStyle",n[n.mouseWheelScrollSensitivity=66]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=67]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=68]="multiCursorMergeOverlapping",n[n.multiCursorModifier=69]="multiCursorModifier",n[n.multiCursorPaste=70]="multiCursorPaste",n[n.occurrencesHighlight=71]="occurrencesHighlight",n[n.overviewRulerBorder=72]="overviewRulerBorder",n[n.overviewRulerLanes=73]="overviewRulerLanes",n[n.padding=74]="padding",n[n.parameterHints=75]="parameterHints",n[n.peekWidgetDefaultFocus=76]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=77]="definitionLinkOpensInPeek",n[n.quickSuggestions=78]="quickSuggestions",n[n.quickSuggestionsDelay=79]="quickSuggestionsDelay",n[n.readOnly=80]="readOnly",n[n.renameOnType=81]="renameOnType",n[n.renderControlCharacters=82]="renderControlCharacters",n[n.renderFinalNewline=83]="renderFinalNewline",n[n.renderLineHighlight=84]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=85]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=86]="renderValidationDecorations",n[n.renderWhitespace=87]="renderWhitespace",n[n.revealHorizontalRightPadding=88]="revealHorizontalRightPadding",n[n.roundedSelection=89]="roundedSelection",n[n.rulers=90]="rulers",n[n.scrollbar=91]="scrollbar",n[n.scrollBeyondLastColumn=92]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=93]="scrollBeyondLastLine",n[n.scrollPredominantAxis=94]="scrollPredominantAxis",n[n.selectionClipboard=95]="selectionClipboard",n[n.selectionHighlight=96]="selectionHighlight",n[n.selectOnLineNumbers=97]="selectOnLineNumbers",n[n.showFoldingControls=98]="showFoldingControls",n[n.showUnused=99]="showUnused",n[n.snippetSuggestions=100]="snippetSuggestions",n[n.smartSelect=101]="smartSelect",n[n.smoothScrolling=102]="smoothScrolling",n[n.stickyTabStops=103]="stickyTabStops",n[n.stopRenderingLineAfter=104]="stopRenderingLineAfter",n[n.suggest=105]="suggest",n[n.suggestFontSize=106]="suggestFontSize",n[n.suggestLineHeight=107]="suggestLineHeight",n[n.suggestOnTriggerCharacters=108]="suggestOnTriggerCharacters",n[n.suggestSelection=109]="suggestSelection",n[n.tabCompletion=110]="tabCompletion",n[n.tabIndex=111]="tabIndex",n[n.unusualLineTerminators=112]="unusualLineTerminators",n[n.useShadowDOM=113]="useShadowDOM",n[n.useTabStops=114]="useTabStops",n[n.wordSeparators=115]="wordSeparators",n[n.wordWrap=116]="wordWrap",n[n.wordWrapBreakAfterCharacters=117]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=118]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=119]="wordWrapColumn",n[n.wordWrapOverride1=120]="wordWrapOverride1",n[n.wordWrapOverride2=121]="wordWrapOverride2",n[n.wrappingIndent=122]="wrappingIndent",n[n.wrappingStrategy=123]="wrappingStrategy",n[n.showDeprecated=124]="showDeprecated",n[n.inlayHints=125]="inlayHints",n[n.editorClassName=126]="editorClassName",n[n.pixelRatio=127]="pixelRatio",n[n.tabFocusMode=128]="tabFocusMode",n[n.layoutInfo=129]="layoutInfo",n[n.wrappingInfo=130]="wrappingInfo"})(HY||(HY={}));var VY;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(VY||(VY={}));var UY;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(UY||(UY={}));var WY;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(WY||(WY={}));var GY;(function(n){n[n.Other=0]="Other",n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(GY||(GY={}));var zY;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(zY||(zY={}));var KY;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.NumLock=78]="NumLock",n[n.ScrollLock=79]="ScrollLock",n[n.Semicolon=80]="Semicolon",n[n.Equal=81]="Equal",n[n.Comma=82]="Comma",n[n.Minus=83]="Minus",n[n.Period=84]="Period",n[n.Slash=85]="Slash",n[n.Backquote=86]="Backquote",n[n.BracketLeft=87]="BracketLeft",n[n.Backslash=88]="Backslash",n[n.BracketRight=89]="BracketRight",n[n.Quote=90]="Quote",n[n.OEM_8=91]="OEM_8",n[n.IntlBackslash=92]="IntlBackslash",n[n.Numpad0=93]="Numpad0",n[n.Numpad1=94]="Numpad1",n[n.Numpad2=95]="Numpad2",n[n.Numpad3=96]="Numpad3",n[n.Numpad4=97]="Numpad4",n[n.Numpad5=98]="Numpad5",n[n.Numpad6=99]="Numpad6",n[n.Numpad7=100]="Numpad7",n[n.Numpad8=101]="Numpad8",n[n.Numpad9=102]="Numpad9",n[n.NumpadMultiply=103]="NumpadMultiply",n[n.NumpadAdd=104]="NumpadAdd",n[n.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=106]="NumpadSubtract",n[n.NumpadDecimal=107]="NumpadDecimal",n[n.NumpadDivide=108]="NumpadDivide",n[n.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",n[n.ABNT_C1=110]="ABNT_C1",n[n.ABNT_C2=111]="ABNT_C2",n[n.AudioVolumeMute=112]="AudioVolumeMute",n[n.AudioVolumeUp=113]="AudioVolumeUp",n[n.AudioVolumeDown=114]="AudioVolumeDown",n[n.BrowserSearch=115]="BrowserSearch",n[n.BrowserHome=116]="BrowserHome",n[n.BrowserBack=117]="BrowserBack",n[n.BrowserForward=118]="BrowserForward",n[n.MediaTrackNext=119]="MediaTrackNext",n[n.MediaTrackPrevious=120]="MediaTrackPrevious",n[n.MediaStop=121]="MediaStop",n[n.MediaPlayPause=122]="MediaPlayPause",n[n.LaunchMediaPlayer=123]="LaunchMediaPlayer",n[n.LaunchMail=124]="LaunchMail",n[n.LaunchApp2=125]="LaunchApp2",n[n.MAX_VALUE=126]="MAX_VALUE"})(KY||(KY={}));var jY;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(jY||(jY={}));var XY;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(XY||(XY={}));var YY;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(YY||(YY={}));var qY;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(qY||(qY={}));var JY;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(JY||(JY={}));var QY;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(QY||(QY={}));var ZY;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(ZY||(ZY={}));var eq;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(eq||(eq={}));var tq;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(tq||(tq={}));var nq;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(nq||(nq={}));var iq;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(iq||(iq={}));var sq;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(sq||(sq={}));var oq;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(oq||(oq={}));var rq;(function(n){n[n.Deprecated=1]="Deprecated"})(rq||(rq={}));var lq;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(lq||(lq={}));var aq;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(aq||(aq={}));var cq;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(cq||(cq={}));var uq;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(uq||(uq={}));class mF{static chord(e,t){return fl(e,t)}}mF.CtrlCmd=2048;mF.Shift=1024;mF.Alt=512;mF.WinCtrl=256;function FIe(){return{editor:void 0,languages:void 0,CancellationTokenSource:dc,Emitter:rt,KeyCode:KY,KeyMod:mF,Position:ct,Range:be,Selection:fn,SelectionDirection:iq,MarkerSeverity:jY,MarkerTag:XY,Uri:Jn,Token:H8}}var Pg;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Pg||(Pg={}));const Qi=ss("instantiationService");function BIe(n,e,t,i){e[Pg.DI_TARGET]===e?e[Pg.DI_DEPENDENCIES].push({id:n,index:t,optional:i}):(e[Pg.DI_DEPENDENCIES]=[{id:n,index:t,optional:i}],e[Pg.DI_TARGET]=e)}function ss(n){if(Pg.serviceIds.has(n))return Pg.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");BIe(e,t,s,!1)};return e.toString=()=>n,Pg.serviceIds.set(n,e),e}function gvt(n){return function(e,t,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");BIe(n,e,i,!0)}}const hs=ss("codeEditorService");class z0{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this._zoomFactor=1}getZoomLevel(){return this._zoomLevel}getTimeSinceLastZoomLevelChanged(){return Date.now()-this._lastZoomLevelChangeTime}getZoomFactor(){return this._zoomFactor}getPixelRatio(){let e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}z0.INSTANCE=new z0;function dq(){return z0.INSTANCE.getZoomLevel()}function pvt(){return z0.INSTANCE.getTimeSinceLastZoomLevelChanged()}function HIe(n){return z0.INSTANCE.onDidChangeZoomLevel(n)}function mvt(){return z0.INSTANCE.getZoomFactor()}function VW(){return z0.INSTANCE.getPixelRatio()}const _F=navigator.userAgent,ac=_F.indexOf("Firefox")>=0,f0=_F.indexOf("AppleWebKit")>=0,UW=_F.indexOf("Chrome")>=0,Mf=!UW&&_F.indexOf("Safari")>=0,_vt=!UW&&!Mf&&f0,aD=_F.indexOf("Android")>=0,VIe=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,U8={clipboard:{writeText:Ug||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Ug||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:Ug||VIe?0:navigator.keyboard||Mf?1:2,touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function hq(n,e){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new WW([E9(t,e),E9(i,e)]):new WW([E9(t,e)])}function E9(n,e){const t=!!(n&2048),i=!!(n&256),s=e===2?i:t,o=!!(n&1024),r=!!(n&512),a=e===2?t:i,c=n&255;return new K0(s,o,r,a,c)}class K0{constructor(e,t,i,s,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyCode=o}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toChord(){return new WW([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class WW{constructor(e){if(e.length===0)throw Wg("parts");this.parts=e}}class vvt{constructor(e,t,i,s,o,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyLabel=o,this.keyAriaLabel=r}}class bvt{}function Tvt(n){if(n.charCode){let t=String.fromCharCode(n.charCode).toUpperCase();return XS.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(ac){if(e===59)return 80;if(e===107)return 81;if(e===109)return 83;if(ki&&e===224)return 57}else if(f0){if(e===91)return 57;if(ki&&e===93)return 57;if(!ki&&e===92)return 57}return kIe[e]||0}const Cvt=ki?256:2048,yvt=512,Evt=1024,Svt=ki?2048:256;class Po{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.keyCode=Tvt(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asRuntimeKeybinding=this._computeRuntimeKeybinding()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeybinding(){return this._asRuntimeKeybinding}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Cvt),this.altKey&&(t|=yvt),this.shiftKey&&(t|=Evt),this.metaKey&&(t|=Svt),t|=e,t}_computeRuntimeKeybinding(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new K0(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let fq=!1,ZL=null;function wvt(n){if(!n.parent||n.parent===n)return null;try{let e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return fq=!0,null}catch{return fq=!0,null}return n.parent}class gq{static getSameOriginWindowChain(){if(!ZL){ZL=[];let e=window,t;do t=wvt(e),t?ZL.push({window:e,iframeElement:e.frameElement||null}):ZL.push({window:e,iframeElement:null}),e=t;while(e)}return ZL.slice(0)}static hasDifferentOriginAncestor(){return ZL||this.getSameOriginWindowChain(),fq}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,o=this.getSameOriginWindowChain();for(const r of o){if(i+=r.window.scrollY,s+=r.window.scrollX,r.window===t||!r.iframeElement)break;let a=r.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}}class fh{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=gq.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class uR{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){let s=e,o=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?ac&&!ki?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")Mf&&zl?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?ac&&!ki?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}var yhe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function Ivt(n){return!!n&&typeof n.then=="function"}function ul(n){const e=new dc,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(gM())});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),s(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(s,o){return i.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function Sne(n,e,t){return Promise.race([n,new Promise(i=>e.onCancellationRequested(()=>i(t)))])}class Lvt{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{this.queuedPromise=null;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}}class db{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,s)=>{this.doResolve=i,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const i=this.task;return this.task=null,i()}})),this.timeout=setTimeout(()=>{this.timeout=null,this.doResolve&&this.doResolve(null)},t),this.completionPromise}isTriggered(){return this.timeout!==null}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(gM()),this.completionPromise=null)}cancelTimeout(){this.timeout!==null&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancel()}}class Ovt{constructor(e){this.delayer=new db(e),this.throttler=new Lvt}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}dispose(){this.delayer.dispose()}}function sy(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(gM())})}):ul(t=>sy(n,t))}function j0(n,e=0){const t=setTimeout(n,e);return xi(()=>clearTimeout(t))}function UIe(n,e=i=>!!i,t=null){let i=0;const s=n.length,o=()=>{if(i>=s)return Promise.resolve(t);const r=n[i++];return Promise.resolve(r()).then(c=>e(c)?Promise.resolve(c):o())};return o()}class mc{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class vF{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class ho{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}let GW;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?GW=n=>{const e=setTimeout(()=>{const i=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0,clearTimeout(e))}}}:GW=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class mO{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=GW(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}var pq;(function(n){function e(i){return yhe(this,void 0,void 0,function*(){let s;const o=yield Promise.all(i.map(r=>r.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return o})}n.settled=e;function t(i){return new Promise((s,o)=>yhe(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(pq||(pq={}));var Ii;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.userData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebook="vscode-notebook",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractive="vscode-interactive",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp"})(Ii||(Ii={}));class Rvt{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&(i=`[${i}]`);const s=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&tkn=${encodeURIComponent(o)}`),Jn.from({scheme:hM?this._preferredWebSchema:Ii.vscodeRemoteResource,authority:`${i}:${s}`,path:"/vscode-remote-resource",query:r})}}const WIe=new Rvt;class bx{asBrowserUri(e,t){const i=this.toUri(e,t);return i.scheme===Ii.vscodeRemote?WIe.rewrite(i):i.scheme===Ii.file&&(Ug||typeof Io.importScripts=="function"&&Io.origin===`${Ii.vscodeFileResource}://${bx.FALLBACK_AUTHORITY}`)?i.with({scheme:Ii.vscodeFileResource,authority:i.authority||bx.FALLBACK_AUTHORITY,query:null,fragment:null}):i}toUri(e,t){return Jn.isUri(e)?e:Jn.parse(t.toUrl(e))}}bx.FALLBACK_AUTHORITY="vscode-app";const GIe=new bx;function wl(n){for(;n.firstChild;)n.firstChild.remove()}function wne(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Mvt{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function Pt(n,e,t,i){return new Mvt(n,e,t,i)}function zIe(n){return function(e){return n(new fh(e))}}function kvt(n){return function(e){return n(new Po(e))}}let Br=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=zIe(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=kvt(i)),Pt(e,t,o,s)},Avt=function(e,t,i){let s=zIe(t);return Ine(e,s,i)};function Ine(n,e,t){return Pt(n,Xm&&U8.pointerEvents?An.POINTER_DOWN:An.MOUSE_DOWN,e,t)}function KIe(n,e,t){return Pt(n,Xm&&U8.pointerEvents?An.POINTER_UP:An.MOUSE_UP,e,t)}function Lne(n,e){return Pt(n,"mouseout",t=>{let i=t.relatedTarget;for(;i&&i!==n;)i=i.parentNode;i!==n&&e(t)})}function Nvt(n,e){return Pt(n,"pointerout",t=>{let i=t.relatedTarget;for(;i&&i!==n;)i=i.parentNode;i!==n&&e(t)})}let S9=null;function Dvt(n){if(!S9){const e=t=>setTimeout(()=>t(new Date().getTime()),0);S9=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return S9.call(self,n)}let jIe,qm;class w9{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){di(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1,s=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(w9.sort),e.shift().execute();i=!1};qm=(o,r=0)=>{let a=new w9(o,r);return n.push(a),t||(t=!0,Dvt(s)),a},jIe=(o,r)=>{if(i){let a=new w9(o,r);return e.push(a),a}else return qm(o,r)}})();const $vt=8,xvt=function(n,e){return e};class Pvt extends wt{constructor(e,t,i,s=xvt,o=$vt){super();let r=null,a=0,c=this._register(new mc),u=()=>{a=new Date().getTime(),i(r),r=null};this._register(Pt(e,t,d=>{r=s(r,d);let f=new Date().getTime()-a;f>=o?(c.cancel(),u()):c.setIfNotSet(u,o-f)}))}}function One(n,e,t,i,s){return new Pvt(n,e,t,i,s)}function Rne(n){return document.defaultView.getComputedStyle(n,null)}function W8(n){if(n!==document.body)return new eo(n.clientWidth,n.clientHeight);if(Xm&&window.visualViewport)return new eo(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new eo(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new eo(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new eo(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Wo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let s=Rne(e),o="0";return s&&(s.getPropertyValue?o=s.getPropertyValue(t):o=s.getAttribute(i)),Wo.convertToPixels(e,o)}static getBorderLeftWidth(e){return Wo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Wo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Wo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Wo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Wo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Wo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Wo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Wo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Wo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Wo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Wo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Wo.getDimension(e,"margin-bottom","marginBottom")}}class eo{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new eo(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof eo?e:new eo(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}function XIe(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==document.body&&n!==document.documentElement;){t-=n.scrollTop;const s=qIe(n)?null:Rne(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=Wo.getBorderLeftWidth(n),t+=Wo.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Fvt(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function Bl(n){let e=n.getBoundingClientRect();return{left:e.left+Yv.scrollX,top:e.top+Yv.scrollY,width:e.width,height:e.height}}const Yv=new class{get scrollX(){return typeof window.scrollX=="number"?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return typeof window.scrollY=="number"?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function hf(n){let e=Wo.getMarginLeft(n)+Wo.getMarginRight(n);return n.offsetWidth+e}function I9(n){let e=Wo.getBorderLeftWidth(n)+Wo.getBorderRightWidth(n),t=Wo.getPaddingLeft(n)+Wo.getPaddingRight(n);return n.offsetWidth-e-t}function Bvt(n){let e=Wo.getBorderTopWidth(n)+Wo.getBorderBottomWidth(n),t=Wo.getPaddingTop(n)+Wo.getPaddingBottom(n);return n.offsetHeight-e-t}function mq(n){let e=Wo.getMarginTop(n)+Wo.getMarginBottom(n);return n.offsetHeight+e}function Pm(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function YIe(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function Ehe(n,e,t){return!!YIe(n,e,t)}function qIe(n){return n&&!!n.host&&!!n.mode}function G8(n){return!!Pw(n)}function Pw(n){for(;n.parentNode;){if(n===document.body)return null;n=n.parentNode}return qIe(n)?n:null}function _O(){let n=document.activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function kd(n=document.getElementsByTagName("head")[0]){let e=document.createElement("style");return e.type="text/css",e.media="screen",n.appendChild(e),e}let L9=null;function JIe(){return L9||(L9=kd()),L9}function Hvt(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function _q(n,e,t=JIe()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function zW(n,e=JIe()){if(!e)return;let t=Hvt(e),i=[];for(let s=0;s<t.length;s++)t[s].selectorText.indexOf(n)!==-1&&i.push(s);for(let s=i.length-1;s>=0;s--)e.sheet.deleteRule(i[s])}function QIe(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const An={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:f0?"webkitAnimationStart":"animationstart",ANIMATION_END:f0?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:f0?"webkitAnimationIteration":"animationiteration"},Rs={stop:function(n,e){n.preventDefault?n.preventDefault():n.returnValue=!1,e&&(n.stopPropagation?n.stopPropagation():n.cancelBubble=!0)}};function Vvt(n){let e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function Uvt(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class Wvt extends wt{constructor(e){super(),this._onDidFocus=this._register(new rt),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new rt),this.onDidBlur=this._onDidBlur.event;let t=Pm(document.activeElement,e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Pm(document.activeElement,e)!==t&&(t?o():s())},this._register(Pt(e,An.FOCUS,s,!0)),this._register(Pt(e,An.BLUR,o,!0))}}function dR(n){return new Wvt(n)}function Nt(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Gvt(n,e){return n.insertBefore(e,n.firstChild),e}function oy(n,...e){n.innerText="",Nt(n,...e)}const zvt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Tx;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(Tx||(Tx={}));function ZIe(n,e,t,...i){let s=zvt.exec(e);if(!s)throw new Error("Bad use of emmet");t=Object.assign({},t||{});let o=s[1]||"div",r;return n!==Tx.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),Object.keys(t).forEach(a=>{const c=t[a];typeof c>"u"||(/^on\w+$/.test(a)?r[a]=c:a==="selected"?c&&r.setAttribute(a,"true"):r.setAttribute(a,c))}),r.append(...i),r}function Vt(n,e,...t){return ZIe(Tx.HTML,n,e,...t)}Vt.SVG=function(n,e,...t){return ZIe(Tx.SVG,n,e,...t)};function pd(...n){for(let e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Vc(...n){for(let e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function Kvt(n){return Array.prototype.slice.call(document.getElementsByTagName(n),0)}function She(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function eLe(n){window.open(n,"_blank","noopener")}function jvt(n){const e=()=>{n(),t=qm(e)};let t=qm(e);return xi(()=>t.dispose())}WIe.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function hb(n){return n?`url('${GIe.asBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function whe(n){return`'${n.replace(/'/g,"%27")}'`}class YS extends rt{constructor(){super(),this._subscriptions=new Wt,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Pt(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Po(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(Pt(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(Pt(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(Pt(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(Pt(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(Pt(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return YS.instance||(YS.instance=new YS),YS.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function Xvt(n,e){const t=window.matchMedia(n);typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)}function tLe(n){return!n||typeof n!="string"?!0:n.trim().length===0}const Yvt=/{(\d+)}/g;function ha(n,...e){return e.length===0?n:n.replace(Yvt,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function Mne(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function jf(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function qvt(n,e=" "){const t=kne(n,e);return nLe(t,e)}function kne(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function nLe(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,o=-1;for(;o=n.lastIndexOf(e,s-1),!(o===-1||o+t!==s);){if(o===0)return"";s=o}return n.substring(0,s)}function Jvt(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Qvt(n){return n.replace(/\*/g,"")}function iLe(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=jf(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function Zvt(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function O9(n){return(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")}function Jm(n){return n.split(/\r\n|\r|\n/)}function cc(n){for(let e=0,t=n.length;e<t;e++){const i=n.charCodeAt(e);if(i!==32&&i!==9)return e}return-1}function Hs(n,e=0,t=n.length){for(let i=e;i<t;i++){const s=n.charCodeAt(i);if(s!==32&&s!==9)return n.substring(e,i)}return n.substring(e,t)}function Fm(n,e=n.length-1){for(let t=e;t>=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function Cx(n,e){return n<e?-1:n>e?1:0}function Ane(n,e,t=0,i=n.length,s=0,o=e.length){for(;t<i&&s<o;t++,s++){let c=n.charCodeAt(t),u=e.charCodeAt(s);if(c<u)return-1;if(c>u)return 1}const r=i-t,a=o-s;return r<a?-1:r>a?1:0}function vq(n,e){return bF(n,e,0,n.length,0,e.length)}function bF(n,e,t=0,i=n.length,s=0,o=e.length){for(;t<i&&s<o;t++,s++){let c=n.charCodeAt(t),u=e.charCodeAt(s);if(c===u)continue;if(c>=128||u>=128)return Ane(n.toLowerCase(),e.toLowerCase(),t,i,s,o);vC(c)&&(c-=32),vC(u)&&(u-=32);const d=c-u;if(d!==0)return d}const r=i-t,a=o-s;return r<a?-1:r>a?1:0}function vC(n){return n>=97&&n<=122}function hm(n){return n>=65&&n<=90}function cD(n,e){return n.length===e.length&&bF(n,e)===0}function sLe(n,e){const t=e.length;return e.length>n.length?!1:bF(n,e,0,t)===0}function hR(n,e){let t,i=Math.min(n.length,e.length);for(t=0;t<i;t++)if(n.charCodeAt(t)!==e.charCodeAt(t))return t;return i}function KW(n,e){let t,i=Math.min(n.length,e.length);const s=n.length-1,o=e.length-1;for(t=0;t<i;t++)if(n.charCodeAt(s-t)!==e.charCodeAt(o-t))return t;return i}function yl(n){return 55296<=n&&n<=56319}function fR(n){return 56320<=n&&n<=57343}function Nne(n,e){return(n-55296<<10)+(e-56320)+65536}function wv(n,e,t){const i=n.charCodeAt(t);if(yl(i)&&t+1<e){const s=n.charCodeAt(t+1);if(fR(s))return Nne(i,s)}return i}function vO(n,e){const t=n.charCodeAt(e-1);if(fR(t)&&e>1){const i=n.charCodeAt(e-2);if(yl(i))return Nne(i,t)}return t}function jW(n,e){const t=Wv.getInstance(),i=e,s=n.length,o=wv(n,s,e);e+=o>=65536?2:1;let r=t.getGraphemeBreakType(o);for(;e<s;){const a=wv(n,s,e),c=t.getGraphemeBreakType(a);if(WD(r,c))break;e+=a>=65536?2:1,r=c}return e-i}function ebt(n,e){const t=Wv.getInstance(),i=e,s=vO(n,e);e-=s>=65536?2:1;let o=t.getGraphemeBreakType(s);for(;e>0;){const r=vO(n,e),a=t.getGraphemeBreakType(r);if(WD(a,o))break;e-=r>=65536?2:1,o=a}return i-e}const tbt=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function z8(n){return tbt.test(n)}const nbt=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function ibt(n){return nbt.test(n)}const sbt=/^[\t\n\r\x20-\x7E]*$/;function Dne(n){return sbt.test(n)}const oLe=/[\u2028\u2029]/;function rLe(n){return oLe.test(n)}function obt(n){for(let e=0,t=n.length;e<t;e++)if(Gg(n.charCodeAt(e)))return!0;return!1}function Gg(n){return n=+n,n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function UD(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129003||n>=129280&&n<=129535||n>=129648&&n<=129750}const rbt="\uFEFF";function $ne(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function lbt(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function lLe(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function e1(n){return Wv.getInstance().getGraphemeBreakType(n)}function WD(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class Wv{constructor(){this._data=abt()}static getInstance(){return Wv._INSTANCE||(Wv._INSTANCE=new Wv),Wv._INSTANCE}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(e<t[3*s])s=2*s;else if(e>t[3*s+1])s=2*s+1;else return t[3*s+2];return 0}}Wv._INSTANCE=null;function abt(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function cbt(n,e){if(n===0)return 0;const t=ubt(n,e);if(t!==void 0)return t;const i=vO(e,n);return n-=YU(i),n}function ubt(n,e){let t=vO(e,n);for(n-=YU(t);dbt(t)||t===65039||t===8419;){if(n===0)return;t=vO(e,n),n-=YU(t)}if(UD(t)){if(n>=0){const i=vO(e,n);i===8205&&(n-=YU(i))}return n}}function YU(n){return n>=65536?2:1}function dbt(n){return 127995<=n&&n<=127999}var Ihe,Lhe;class hbt{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class fbt{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?Ane(e,this._value,0,e.length,this._from,this._to):bF(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class gbt{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){return this._value=e.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++){const t=this._value.charCodeAt(this._to);if(t===47||this._splitOnBackslash&&t===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?Ane(e,this._value,0,e.length,this._from,this._to):bF(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class pbt{constructor(e){this._ignorePathCasing=e,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new gbt(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return vq(e,this._value.scheme);if(this._states[this._stateIdx]===2)return vq(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return Cx(e,this._value.query);if(this._states[this._stateIdx]===5)return Cx(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}class VH{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return(t=(e=this.left)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}get heightRight(){var e,t;return(t=(e=this.right)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}}class bO{constructor(e){this._iter=e}static forUris(e=()=>!1){return new bO(new pbt(e))}static forStrings(){return new bO(new hbt)}static forConfigKeys(){return new bO(new fbt)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new VH,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new VH,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new VH,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new VH,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const c=o[a][1];c.updateHeight();const u=c.balanceFactor();if(u<-1||u>1){const d=o[a][0],f=o[a+1][0];if(d===1&&f===1)o[a][1]=c.rotateLeft();else if(d===-1&&f===-1)o[a][1]=c.rotateRight();else if(d===1&&f===-1)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===-1&&f===1)c.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=s.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(s.hasNext())s.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right),{key:c,value:u,segment:d}=a;this._delete(a.key,!1),r.key=c,r.value=u,r.segment=d}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[c,u]=o[o.length-1];switch(c){case-1:u.left=a;break;case 0:u.mid=a;break;case 1:u.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const c=o[a][1];c.updateHeight();const u=c.balanceFactor();if(u>1?(c.right.balanceFactor()>=0||(c.right=o[a+1][1]=o[a+1][1].rotateRight()),o[a][1]=c.rotateLeft()):u<-1&&(c.left.balanceFactor()<=0||(c.left=o[a+1][1]=o[a+1][1].rotateLeft()),o[a][1]=c.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else return i.mid?this._entries(i.mid):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){e&&(e.left&&(yield*this._entries(e.left)),e.value&&(yield[e.key,e.value]),e.mid&&(yield*this._entries(e.mid)),e.right&&(yield*this._entries(e.right)))}}class mbt{constructor(e,t){this.uri=e,this.value=t}}class Fa{constructor(e,t){this[Ihe]="ResourceMap",e instanceof Fa?(this.map=new Map(e.map),this.toKey=t??Fa.defaultToKey):(this.map=new Map,this.toKey=e??Fa.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new mbt(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Ihe=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}Fa.defaultToKey=n=>n.toString();class _bt{constructor(){this[Lhe]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}[(Lhe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class Py extends _bt{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}const Ohe=typeof Buffer<"u";let R9;class K8{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return Ohe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new K8(e)}toString(){return Ohe?this.buffer.toString():(R9||(R9=new TextDecoder),R9.decode(this.buffer))}}function vbt(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function bbt(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Eg(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function Sg(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function Rhe(n,e){return n[e]}function Mhe(n,e,t){n[t]=e}function bq(n){let e=JSON.parse(n);return e=Tq(e),e}function Tq(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return Jn.revive(n);case 2:return new RegExp(n.source,n.flags)}if(n instanceof K8||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t<n.length;++t)n[t]=Tq(n[t],e+1);else for(const t in n)Object.hasOwnProperty.call(n,t)&&(n[t]=Tq(n[t],e+1))}return n}function Tbt(n){return n.replace(/[\\/]/g,Kr.sep)}function Cbt(n){return n.indexOf("/")===-1&&(n=Tbt(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function ybt(n,e,t,i=h0){return n===e?!0:!n||!e||e.length>n.length?!1:(e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0)}function Ebt(n){return n>=65&&n<=90||n>=97&&n<=122}function Sbt(n){const e=yne(n);return zl?n.length>3?!1:aLe(e)&&(n.length===2||e.charCodeAt(2)===92):e===Kr.sep}function aLe(n){return zl?Ebt(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function qU(n){return HW(n,!0)}class wbt{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Cx(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}joinPath(e,...t){return Jn.joinPath(e,...t)}basenameOrAuthority(e){return Xf(e)||e.authority}basename(e){return Kr.basename(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Ii.file?t=Jn.file(DIe(qU(e))).path:(t=Kr.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===Ii.file?t=Jn.file(yne(qU(e))).path:t=Kr.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===Ii.file){const i=Jn.file(svt(qU(e),t));return e.with({authority:i.authority,path:i.path})}return t=Cbt(t),e.with({path:Kr.resolve(e.path,t)})}}const Zc=new wbt(()=>!1),cLe=Zc.isEqual.bind(Zc),uLe=Zc.basenameOrAuthority.bind(Zc),Xf=Zc.basename.bind(Zc),xne=Zc.dirname.bind(Zc),Ibt=Zc.joinPath.bind(Zc),Lbt=Zc.normalizePath.bind(Zc),khe=Zc.resolvePath.bind(Zc);var ry;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,c]=r.split(":");a&&c&&i.set(a,c)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(ry||(ry={}));function dLe(n){return Array.isArray(n)}function Yf(n){return typeof n=="string"}function jc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function X0(n){return typeof n=="number"&&!isNaN(n)}function hLe(n){return n===!0||n===!1}function oc(n){return typeof n>"u"}function Obt(n){return!md(n)}function md(n){return oc(n)||n===null}function Gs(n,e){if(!n)throw new Error("Unexpected type")}function UH(n){if(md(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function GD(n){return typeof n=="function"}function Rbt(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)Mbt(n[i],e[i])}function Mbt(n,e){if(Yf(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(GD(e)){try{if(n instanceof e)return}catch{}if(!md(n)&&n.constructor===e||e.length===1&&e.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function kbt(n){let e=[],t=Object.getPrototypeOf(n);for(;Object.prototype!==t;)e=e.concat(Object.getOwnPropertyNames(t)),t=Object.getPrototypeOf(t);return e}function Pne(n){const e=[];for(const t of kbt(n))typeof n[t]=="function"&&e.push(t);return e}function Abt(n,e){const t=s=>function(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)};let i={};for(const s of n)i[s]=t(s);return i}function yd(n){return n===null?void 0:n}function Nbt(n,e="Unreachable"){throw new Error(e)}const vr=ss("commandService"),ji=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new rt,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const r=[];for(let c of n.description.args)r.push(c.constraint);const a=n.handler;n.handler=function(c,...u){return Rbt(u,r),a(c,...u)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Cd,this._commands.set(t,i));let s=i.unshift(n),o=xi(()=>{s();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return ji.registerCommand(n,(t,...i)=>t.get(vr).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return zi.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};ji.registerCommand("noop",()=>{});var XW;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(XW||(XW={}));var Ahe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const np=ss("openerService"),Dbt=Object.freeze({_serviceBrand:void 0,registerOpener(){return wt.None},registerValidator(){return wt.None},registerExternalUriResolver(){return wt.None},setDefaultExternalOpener(){},registerExternalOpener(){return wt.None},open(){return Ahe(this,void 0,void 0,function*(){return!1})},resolveExternalUri(n){return Ahe(this,void 0,void 0,function*(){return{resolved:n,dispose(){}}})}});function L1(n,e){return Jn.isUri(n)?cD(n.scheme,e):sLe(n,e+":")}var Fne=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},YW=function(n,e){return function(t,i){e(t,i,n)}},LS=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let Cq=class{constructor(e){this._commandService=e}open(e,t){return LS(this,void 0,void 0,function*(){if(!L1(e,Ii.command))return!1;if(!(t!=null&&t.allowCommands))return!0;typeof e=="string"&&(e=Jn.parse(e));let i=[];try{i=bq(decodeURIComponent(e.query))}catch{try{i=bq(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};Cq=Fne([YW(0,vr)],Cq);let yq=class{constructor(e){this._editorService=e}open(e,t){return LS(this,void 0,void 0,function*(){typeof e=="string"&&(e=Jn.parse(e));let i;const s=/^L?(\d+)(?:,(\d+))?/.exec(e.fragment);return s&&(i={startLineNumber:parseInt(s[1]),startColumn:s[2]?parseInt(s[2]):1},e=e.with({fragment:""})),e.scheme===Ii.file&&(e=Lbt(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:t!=null&&t.fromUserGesture?XW.USER:XW.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};yq=Fne([YW(0,hs)],yq);let Eq=class{constructor(e,t){this._openers=new Cd,this._validators=new Cd,this._resolvers=new Cd,this._resolvedUriTargets=new Fa(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Cd,this._defaultExternalOpener={openExternal:i=>LS(this,void 0,void 0,function*(){return L1(i,Ii.http)||L1(i,Ii.https)?eLe(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>LS(this,void 0,void 0,function*(){return s!=null&&s.openExternal||L1(i,Ii.mailto)||L1(i,Ii.http)||L1(i,Ii.https)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new Cq(t)),this._openers.push(new yq(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}open(e,t){var i;return LS(this,void 0,void 0,function*(){const s=typeof e=="string"?Jn.parse(e):e,o=(i=this._resolvedUriTargets.get(s))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!(yield r.shouldOpen(o)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return LS(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const s=yield i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return LS(this,void 0,void 0,function*(){const i=typeof e=="string"?Jn.parse(e):e;let s;try{s=(yield this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},Ai.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Ai.None)})}dispose(){this._validators.clear()}};Eq=Fne([YW(0,hs),YW(1,vr)],Eq);function JU(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function lC(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.keys(n).forEach(t=>{n[t]&&typeof n[t]=="object"?e[t]=lC(n[t]):e[t]=n[t]}),e}function $bt(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(fLe.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&e.push(s)}}return n}const fLe=Object.prototype.hasOwnProperty;function xbt(n,e){return Sq(n,e,new Set)}function Sq(n,e,t){if(md(n))return n;const i=e(n);if(typeof i<"u")return i;if(dLe(n)){const s=[];for(const o of n)s.push(Sq(o,e,t));return s}if(jc(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(let o in n)fLe.call(n,o)&&(s[o]=Sq(n[o],e,t));return t.delete(n),s}return n}function mp(n,e,t=!0){return jc(n)?(jc(e)&&Object.keys(e).forEach(i=>{i in n?t&&(jc(n[i])&&jc(e[i])?mp(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function zg(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!zg(n[t],e[t]))return!1}else{const s=[];for(i in n)s.push(i);s.sort();const o=[];for(i in e)o.push(i);if(o.sort(),!zg(s,o))return!1;for(t=0;t<s.length;t++)if(!zg(n[s[t]],e[s[t]]))return!1}return!0}function Jp(n,e,t){const i=e(n);return typeof i>"u"?t:i}const Pbt={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class Fbt extends wt{constructor(e,t={}){super(),this._onDidUpdate=this._register(new rt),this._editor=e,this._options=mp(t,Pbt,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=!!this._options.alwaysRevealFirst,this._register(this._editor.onDidDispose(()=>this.dispose())),this._register(this._editor.onDidUpdateDiff(()=>this._onDiffUpdated())),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition(i=>{this.ignoreSelectionChange||(this.nextIdx=-1)})),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel(i=>{this.revealFirst=!0})),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&this._editor.getLineChanges()!==null&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach(t=>{!this._options.ignoreCharChanges&&t.charChanges?t.charChanges.forEach(i=>{this.ranges.push({rhs:!0,range:new be(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn)})}):t.modifiedEndLineNumber===0?this.ranges.push({rhs:!0,range:new be(t.modifiedStartLineNumber,1,t.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new be(t.modifiedStartLineNumber,1,t.modifiedEndLineNumber+1,1)})}),this.ranges.sort((t,i)=>be.compareRangesUsingStarts(t.range,i.range)),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1,i=this._editor.getPosition();if(!i){this.nextIdx=0;return}for(let s=0,o=this.ranges.length;s<o&&!t;s++){let r=this.ranges[s].range;i.isBeforeOrEqual(r.getStartPosition())&&(this.nextIdx=s+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}_move(e,t){if(JU(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;this.nextIdx===-1?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));let i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{let s=i.range.getStartPosition();this._editor.setPosition(s),this._editor.revealRangeInCenter(i.range,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}const fb=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},Bbt=ki?1.5:1.35,M9=8;class g0{constructor(e){this._bareFontInfoBrand=void 0,this.zoomLevel=e.zoomLevel,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i,s){const o=e.get(42),r=e.get(46),a=e.get(45),c=e.get(44),u=e.get(58),d=e.get(55);return g0._create(o,r,a,c,u,d,t,i,s)}static _create(e,t,i,s,o,r,a,c,u){o===0?o=Bbt*i:o<M9&&(o=o*i),o=Math.round(o),o<M9&&(o=M9);const d=1+(u?0:fb.getZoomLevel()*.1);return i*=d,o*=d,new g0({zoomLevel:a,pixelRatio:c,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:s,lineHeight:o,letterSpacing:r})}getId(){return this.zoomLevel+"-"+this.pixelRatio+"-"+this.fontFamily+"-"+this.fontWeight+"-"+this.fontSize+"-"+this.fontFeatureSettings+"-"+this.lineHeight+"-"+this.letterSpacing}getMassagedFontFamily(e){const t=g0._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const Hbt=1;class wq extends g0{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=Hbt,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}function Vbt(n){return n&&typeof n.id=="string"}const TF={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var Ad;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Ad||(Ad={}));var vh;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(vh||(vh={}));class QU{constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),this.indentSize=e.tabSize|0,this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&zg(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class yx{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}var p0;(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(p0||(p0={}));class H1{constructor(e,t,i){this.visibleColumn=e,this.className=t,this.horizontalLine=i}}class Iq{constructor(e,t){this.top=e,this.endColumn=t}}class k9{constructor(e,t,i,s,o,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class Ubt{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function Bne(n){return j8(n,0)}function j8(n,e){switch(typeof n){case"object":return n===null?Gv(349,e):Array.isArray(n)?Gbt(n,e):zbt(n,e);case"string":return Hne(n,e);case"boolean":return Wbt(n,e);case"number":return Gv(n,e);case"undefined":return Gv(937,e);default:return Gv(617,e)}}function Gv(n,e){return(e<<5)-e+n|0}function Wbt(n,e){return Gv(n?433:863,e)}function Hne(n,e){e=Gv(149417,e);for(let t=0,i=n.length;t<i;t++)e=Gv(n.charCodeAt(t),e);return e}function Gbt(n,e){return e=Gv(104579,e),n.reduce((t,i)=>j8(i,t),e)}function zbt(n,e){return e=Gv(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=Hne(i,t),j8(n[i],t)),e)}function A9(n,e,t=32){const i=t-e,s=~((1<<i)-1);return(n<<e|(s&n)>>>i)>>>0}function Nhe(n,e=0,t=n.byteLength,i=0){for(let s=0;s<t;s++)n[e+s]=i}function Kbt(n,e,t="0"){for(;n.length<e;)n=t+n;return n}function kN(n,e=32){return n instanceof ArrayBuffer?Array.from(new Uint8Array(n)).map(t=>t.toString(16).padStart(2,"0")).join(""):Kbt((n>>>0).toString(16),e/4)}class X8{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let c=r;if(yl(r))if(a+1<t){const u=e.charCodeAt(a+1);fR(u)?(a++,c=Nne(r,u)):c=65533}else{o=r;break}else fR(r)&&(c=65533);if(s=this._push(i,s,c),a++,a<t)r=e.charCodeAt(a);else break}this._buffLen=s,this._leftoverHighSurrogate=o}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(i&1984)>>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),kN(this._h0)+kN(this._h1)+kN(this._h2)+kN(this._h3)+kN(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Nhe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Nhe(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=X8._bigBlock32,t=this._buffDV;for(let f=0;f<64;f+=4)e.setUint32(f,t.getUint32(f,!1),!1);for(let f=64;f<320;f+=4)e.setUint32(f,A9(e.getUint32(f-12,!1)^e.getUint32(f-32,!1)^e.getUint32(f-56,!1)^e.getUint32(f-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,c,u,d;for(let f=0;f<80;f++)f<20?(c=s&o|~s&r,u=1518500249):f<40?(c=s^o^r,u=1859775393):f<60?(c=s&o|s&r|o&r,u=2400959708):(c=s^o^r,u=3395469782),d=A9(i,5)+c+a+u+e.getUint32(f*4,!1)&4294967295,a=r,r=o,o=A9(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}X8._bigBlock32=new DataView(new ArrayBuffer(320));function mf(n,e,t){return Math.min(Math.max(n,e),t)}class jbt{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this}get value(){return this._val}}const N9="**",Dhe="/",ZU="[/\\\\]",e4="[^/\\\\]",Xbt=/\//g;function $he(n){switch(n){case 0:return"";case 1:return`${e4}*?`;default:return`(?:${ZU}|${e4}+${ZU}|${ZU}${e4}+)*?`}}function xhe(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function gLe(n){if(!n)return"";let e="";const t=xhe(n,Dhe);if(t.every(i=>i===N9))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===N9){i||(e+=$he(2),i=!0);return}let r=!1,a="",c=!1,u="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!u)){let f;d==="-"?f=d:(d==="^"||d==="!")&&!u?f="^":d===Dhe?f="":f=jf(d),u+=f;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":const g=`(?:${xhe(a,",").map(p=>gLe(p)).join("|")})`;e+=g,r=!1,a="";break;case"]":e+="["+u+"]",c=!1,u="";break;case"?":e+=e4;continue;case"*":e+=$he(1);continue;default:e+=jf(d)}}o<t.length-1&&(t[o+1]!==N9||o+2<t.length)&&(e+=ZU),i=!1})}return e}const Ybt=/^\*\*\/\*\.[\w\.-]+$/,qbt=/^\*\*\/([\w\.-]+)\/?$/,Jbt=/^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/,Qbt=/^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/,Zbt=/^\*\*((\/[\w\.-]+)+)\/?$/,eTt=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,Phe=new Py(1e4),Fhe=function(){return!1},Bm=function(){return null};function Vne(n,e){if(!n)return Bm;let t;typeof n!="string"?t=n.pattern:t=n,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let s=Phe.get(i);if(s)return Bhe(s,n);let o;if(Ybt.test(t)){const r=t.substr(4);s=function(a,c){return typeof a=="string"&&a.endsWith(r)?t:null}}else(o=qbt.exec(D9(t,e)))?s=tTt(o[1],t):(e.trimForExclusions?Qbt:Jbt).test(t)?s=nTt(t,e):(o=Zbt.exec(D9(t,e)))?s=Hhe(o[1].substr(1),t,!0):(o=eTt.exec(D9(t,e)))?s=Hhe(o[1],t,!1):s=iTt(t);return Phe.set(i,s),Bhe(s,n)}function Bhe(n,e){return typeof e=="string"?n:function(t,i){return ybt(t,e.base)?n(ovt(e.base,t),i):null}}function D9(n,e){return e.trimForExclusions&&n.endsWith("/**")?n.substr(0,n.length-2):n}function tTt(n,e){const t=`/${n}`,i=`\\${n}`,s=function(r,a){return typeof r!="string"?null:a?a===n?e:null:r===n||r.endsWith(t)||r.endsWith(i)?e:null},o=[n];return s.basenames=o,s.patterns=[e],s.allBasenames=o,s}function nTt(n,e){const t=mLe(n.slice(1,-1).split(",").map(a=>Vne(a,e)).filter(a=>a!==Bm),n),i=t.length;if(!i)return Bm;if(i===1)return t[0];const s=function(a,c){for(let u=0,d=t.length;u<d;u++)if(t[u](a,c))return n;return null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function Hhe(n,e,t){const i=h0===Kr.sep,s=i?n:n.replace(Xbt,h0),o=h0+s,r=Kr.sep+n,a=t?function(c,u){return typeof c=="string"&&(c===s||c.endsWith(o)||!i&&(c===n||c.endsWith(r)))?e:null}:function(c,u){return typeof c=="string"&&(c===s||!i&&c===n)?e:null};return a.allPaths=[(t?"*/":"./")+n],a}function iTt(n){try{const e=new RegExp(`^${gLe(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Bm}}function sTt(n,e,t){return!n||typeof e!="string"?!1:pLe(n)(e,void 0,t)}function pLe(n,e={}){if(!n)return Fhe;if(typeof n=="string"||oTt(n)){const t=Vne(n,e);if(t===Bm)return Fhe;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return rTt(n,e)}function oTt(n){const e=n;return e&&typeof e.base=="string"&&typeof e.pattern=="string"}function rTt(n,e){const t=mLe(Object.getOwnPropertyNames(n).map(a=>lTt(a,n[a],e)).filter(a=>a!==Bm)),i=t.length;if(!i)return Bm;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,f){for(let g=0,p=t.length;g<p;g++){const _=t[g](d,f);if(_)return _}return null},c=t.find(d=>!!d.allBasenames);c&&(a.allBasenames=c.allBasenames);const u=t.reduce((d,f)=>f.allPaths?d.concat(f.allPaths):d,[]);return u.length&&(a.allPaths=u),a}const s=function(a,c,u){let d;for(let f=0,g=t.length;f<g;f++){const p=t[f];p.requiresSiblings&&u&&(c||(c=d0(a)),d||(d=c.substr(0,c.length-rvt(a).length)));const _=p(a,c,d,u);if(_)return _}return null},o=t.find(a=>!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function lTt(n,e,t){if(e===!1)return Bm;const i=Vne(n,t);if(i===Bm)return Bm;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,c,u)=>{if(!u||!i(r,a))return null;const d=s.replace("$(basename)",c),f=u(d);return Ivt(f)?f.then(g=>g?n:null):f?n:null};return o.requiresSiblings=!0,o}}return i}function mLe(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,c)=>{const u=c.basenames;return u?a.concat(u):a},[]);let s;if(e){s=[];for(let a=0,c=i.length;a<c;a++)s.push(e)}else s=t.reduce((a,c)=>{const u=c.patterns;return u?a.concat(u):a},[]);const o=function(a,c){if(typeof a!="string")return null;if(!c){let d;for(d=a.length;d>0;d--){const f=a.charCodeAt(d-1);if(f===47||f===92)break}c=a.substr(d)}const u=i.indexOf(c);return u!==-1?s[u]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function _Le(n,e,t,i){if(Array.isArray(n)){let s=0;for(const o of n){const r=_Le(o,e,t,i);if(r===10)return r;r>s&&(s=r)}return s}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:s,pattern:o,scheme:r,hasAccessToAllModels:a}=n;if(!i&&!a)return 0;let c=0;if(r)if(r===e.scheme)c=10;else if(r==="*")c=5;else return 0;if(s)if(s===t)c=10;else if(s==="*")c=Math.max(c,5);else return 0;if(o){let u;if(typeof o=="string"?u=o:u=Object.assign(Object.assign({},o),{base:yne(o.base)}),u===e.fsPath||sTt(u,e.fsPath))c=10;else return 0}return c}else return 0}}const Xr=ss("modelService");function aTt(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}function vLe(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(vLe):!!n.exclusive}class rr{constructor(){this._clock=0,this._entries=[],this._onDidChange=new rt}get onDidChange(){return this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),xi(()=>{if(i){let s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){if(e){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageId()};if(!(this._lastCandidate&&this._lastCandidate.language===t.language&&this._lastCandidate.uri===t.uri)){this._lastCandidate=t;for(let i of this._entries)if(i._score=_Le(i.selector,e.uri,e.getLanguageId(),aTt(e)),vLe(i.selector)&&i._score>0){for(let s of this._entries)s._score=0;i._score=1e3;break}this._entries.sort(rr._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:e._time<t._time?1:e._time>t._time?-1:0}}const Vhe=new WeakMap;let cTt=0;function uTt(n){let e=Vhe.get(n);return e===void 0&&(e=++cTt,Vhe.set(n,e)),e}class qW{constructor(e,t,i=Number.MAX_SAFE_INTEGER){this._registry=e,this.min=t,this.max=i,this._cache=new Py(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>j8(uTt(i),t),0)}_clamp(e){return e===void 0?this.min:Math.min(this.max,Math.max(this.min,Math.floor(e*1.3)))}get(e){const t=this._key(e),i=this._cache.get(t);return this._clamp(i==null?void 0:i.value)}update(e,t){const i=this._key(e);let s=this._cache.get(i);return s||(s=new jbt,this._cache.set(i,s)),s.update(t),this.get(e)}}class dTt{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),xi(()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))})}registerPromise(e,t){let i=null,s=!1;return this._promises.set(e,t.then(o=>{this._promises.delete(e),!(s||!o)&&(i=this.register(e,o))})),xi(()=>{s=!0,i&&i.dispose()})}getPromise(e){const t=this.get(e);if(t)return Promise.resolve(t);const i=this._promises.get(e);return i?i.then(s=>this.get(e)):null}get(e){return this._map.get(e)||null}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}let hTt=class{constructor(){this._icons=new Map,this._onDidRegister=new rt}add(e){const t=this._icons.get(e.id);t?e.description?t.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}};const bLe=new hTt,JW=bLe;function Zf(n,e){return new vn(n,e)}function fTt(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}class vn{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,bLe.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var Lu;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(o){if(o instanceof vn)return["codicon","codicon-"+o.id];const r=e.exec(o.id);if(!r)return t(vn.error);let[,a,c]=r;const u=["codicon","codicon-"+a];return c&&u.push("codicon-modifier-"+c.substr(1)),u}n.asClassNameArray=t;function i(o){return t(o).join(" ")}n.asClassName=i;function s(o){return"."+t(o).join(".")}n.asCSSSelector=s})(Lu||(Lu={}));(function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})})(vn);class Ba{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&1792)>>>8}static getFontStyle(e){return(e&14336)>>>11}static getForeground(e){return(e&8372224)>>>14}static getBackground(e){return(e&4286578688)>>>23}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e),s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${t[i]};`;return s&1&&(o+="font-style: italic;"),s&2&&(o+="font-weight: bold;"),s&4&&(o+="text-decoration: underline;"),o}}const gTt=function(){let n=Object.create(null);return n[0]="symbol-method",n[1]="symbol-function",n[2]="symbol-constructor",n[3]="symbol-field",n[4]="symbol-variable",n[5]="symbol-class",n[6]="symbol-struct",n[7]="symbol-interface",n[8]="symbol-module",n[9]="symbol-property",n[10]="symbol-event",n[11]="symbol-operator",n[12]="symbol-unit",n[13]="symbol-value",n[14]="symbol-constant",n[15]="symbol-enum",n[16]="symbol-enum-member",n[17]="symbol-keyword",n[27]="symbol-snippet",n[18]="symbol-text",n[19]="symbol-color",n[20]="symbol-file",n[21]="symbol-reference",n[22]="symbol-customcolor",n[23]="symbol-folder",n[24]="symbol-type-parameter",n[25]="account",n[26]="issues",function(e){const t=n[e];let i=t&&JW.get(t);return i||(console.info("No codicon found for CompletionItemKind "+e),i=vn.symbolProperty),i.classNames}}();let TLe=function(){let n=Object.create(null);return n.method=0,n.function=1,n.constructor=2,n.field=3,n.variable=4,n.class=5,n.struct=6,n.interface=7,n.module=8,n.property=9,n.event=10,n.operator=11,n.unit=12,n.value=13,n.constant=14,n.enum=15,n["enum-member"]=16,n.enumMember=16,n.keyword=17,n.snippet=27,n.text=18,n.color=19,n.file=20,n.reference=21,n.customcolor=22,n.folder=23,n["type-parameter"]=24,n.typeParameter=24,n.account=25,n.issue=26,function(e,t){let i=n[e];return typeof i>"u"&&!t&&(i=9),i}}();var rh;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(rh||(rh={}));var Hm;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Hm||(Hm={}));var Ex;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(Ex||(Ex={}));function pTt(n){return n&&Jn.isUri(n.uri)&&be.isIRange(n.range)&&(be.isIRange(n.originSelectionRange)||be.isIRange(n.targetSelectionRange))}var Lq;(function(n){const e=new Map;e.set("file",0),e.set("module",1),e.set("namespace",2),e.set("package",3),e.set("class",4),e.set("method",5),e.set("property",6),e.set("field",7),e.set("constructor",8),e.set("enum",9),e.set("interface",10),e.set("function",11),e.set("variable",12),e.set("constant",13),e.set("string",14),e.set("number",15),e.set("boolean",16),e.set("array",17),e.set("object",18),e.set("key",19),e.set("null",20),e.set("enum-member",21),e.set("struct",22),e.set("event",23),e.set("operator",24),e.set("type-parameter",25);const t=new Map;t.set(0,"file"),t.set(1,"module"),t.set(2,"namespace"),t.set(3,"package"),t.set(4,"class"),t.set(5,"method"),t.set(6,"property"),t.set(7,"field"),t.set(8,"constructor"),t.set(9,"enum"),t.set(10,"interface"),t.set(11,"function"),t.set(12,"variable"),t.set(13,"constant"),t.set(14,"string"),t.set(15,"number"),t.set(16,"boolean"),t.set(17,"array"),t.set(18,"object"),t.set(19,"key"),t.set(20,"null"),t.set(21,"enum-member"),t.set(22,"struct"),t.set(23,"event"),t.set(24,"operator"),t.set(25,"type-parameter");function i(r){return e.get(r)}n.fromString=i;function s(r){return t.get(r)}n.toString=s;function o(r,a){const c=t.get(r);let u=c&&JW.get("symbol-"+c);return u||(console.info("No codicon found for SymbolKind "+r),u=vn.symbolProperty),`${a?"inline":"block"} ${u.classNames}`}n.toCssClassName=o})(Lq||(Lq={}));class ip{constructor(e){this.value=e}}ip.Comment=new ip("comment");ip.Imports=new ip("imports");ip.Region=new ip("region");var QW;(function(n){n[n.Other=0]="Other",n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(QW||(QW={}));const ZW=new rr,e3=new rr,Ag=new rr,Une=new rr,m0=new rr,Sx=new rr,kf=new rr,gR=new rr,t3=new rr,wx=new rr,n3=new rr,i3=new rr,s3=new rr,Pv=new rr,bC=new rr,Vm=new rr,zD=new rr,Ng=new rr,o3=new rr,Ix=new rr,pR=new rr,Y8=new rr,Oq=new rr,mR=new rr,q8=new rr,$o=new dTt;class mTt{clone(){return this}equals(e){return this===e}}const CF=new mTt,ly="vs.editor.nullMode";function CLe(n,e,t,i){return new Ene([new H8(i,"",n)],t)}function Wne(n,e,t,i){let s=new Uint32Array(2);return s[0]=i,s[1]=(n<<0|0|0|16384|2<<23)>>>0,new V8(s,t===null?CF:t)}const _Tt="editorWorkerService",eg=ss(_Tt),Ga=ss("modeService"),Nd=ss("textModelService"),vTt="$initialize";let Uhe=!1;function Rq(n){hM&&(Uhe||(Uhe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class bTt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class Whe{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class TTt{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class CTt{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class yTt{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class ETt{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new bTt(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new rt({onFirstListenerAdd:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new TTt(this._workerId,i,e,t))},onLastListenerRemove:()=>{this._pendingEmitters.delete(i),this._send(new yTt(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}let t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){let t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new Whe(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=mhe(s.detail)),this._send(new Whe(this._workerId,t,void 0,mhe(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new CTt(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){let t=[];if(e.type===0)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else e.type===1&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class STt extends wt{constructor(e,t,i){super();let s=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",u=>{this._protocol.handleMessage(u)},u=>{s&&s(u)})),this._protocol=new ETt({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof i[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(i[u].apply(i,d))}catch(f){return Promise.reject(f)}},handleEvent:(u,d)=>{if(ELe(u)){const f=i[u].call(i,d);if(typeof f!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return f}if(yLe(u)){const f=i[u];if(typeof f!="function")throw new Error(`Missing event ${u} on main thread host.`);return f}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;typeof Io.require<"u"&&typeof Io.require.getConfig=="function"?o=Io.require.getConfig():typeof Io.requirejs<"u"&&(o=Io.requirejs.s.contexts._.config);const r=Pne(i);this._onModuleLoaded=this._protocol.sendMessage(vTt,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const a=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{s=d,this._onModuleLoaded.then(f=>{u(wTt(f,a,c))},f=>{d(f),this._onError("Worker failed to load "+t,f)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function yLe(n){return n[0]==="o"&&n[1]==="n"&&hm(n.charCodeAt(2))}function ELe(n){return/^onDynamic/.test(n)&&hm(n.charCodeAt(9))}function wTt(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)};let o={};for(const r of n){if(ELe(r)){o[r]=s(r);continue}if(yLe(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}var $9;const Ghe=($9=window.trustedTypes)===null||$9===void 0?void 0:$9.createPolicy("defaultWorkerFactory",{createScriptURL:n=>n});function ITt(n,e){if(Io.MonacoEnvironment){if(typeof Io.MonacoEnvironment.getWorker=="function")return Io.MonacoEnvironment.getWorker(n,e);if(typeof Io.MonacoEnvironment.getWorkerUrl=="function"){const t=Io.MonacoEnvironment.getWorkerUrl(n,e);return new Worker(Ghe?Ghe.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function LTt(n){return typeof n.then=="function"}class OTt{constructor(e,t,i,s,o){this.id=t;const r=ITt("workerMain.js",i);LTt(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){s(c.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then(i=>i.postMessage(e,t))}dispose(){this.worker&&this.worker.then(e=>e.terminate()),this.worker=null}}class J8{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let s=++J8.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new OTt(e,s,this._label||"anonymous"+s,t,o=>{Rq(o),this._webWorkerFailedBeforeError=o,i(o)})}}J8.LAST_WORKER_ID=0;var gr;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(gr||(gr={}));class x9{constructor(e){if(this._standardAutoClosingPairConditionalBrand=void 0,this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._standardTokenMask|=2;break;case"comment":this._standardTokenMask|=1;break;case"regex":this._standardTokenMask|=4;break}}isOK(e){return(this._standardTokenMask&e)===0}}class RTt{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)AN(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),AN(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),AN(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),AN(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&AN(this.autoClosingPairsCloseSingleChar,t.close,t)}}function AN(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}function WH(n,e){let t=n.getCount(),i=n.findTokenIndexAtOffset(e),s=n.getLanguageId(i),o=i;for(;o+1<t&&n.getLanguageId(o+1)===s;)o++;let r=i;for(;r>0&&n.getLanguageId(r-1)===s;)r--;return new MTt(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class MTt{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function sm(n){return(n&7)!==0}class _R{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new x9(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new x9({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.colorizedBracketPairs?this._colorizedBracketPairs=zhe(e.colorizedBracketPairs.map(t=>[t[0],t[1]])):e.brackets?this._colorizedBracketPairs=zhe(e.brackets.map(t=>[t[0],t[1]]).filter(t=>!(t[0]==="<"&&t[1]===">"))):this._colorizedBracketPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new x9({open:t.open,close:t.close||""}))}this._autoCloseBefore=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:_R.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}static shouldAutoClosePair(e,t,i){if(t.getTokenCount()===0)return!0;const s=t.findTokenIndexAtOffset(i-2),o=t.getStandardTokenType(s);return e.isOK(o)}getSurroundingPairs(){return this._surroundingPairs}getColorizedBrackets(){return this._colorizedBracketPairs}}_R.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=`;:.,=}])>
- `;function zhe(n){return n.filter(([e,t])=>e!==""&&t!=="")}let P9;function SLe(){return P9||(P9=new TextDecoder("UTF-16LE")),P9}let F9;function kTt(){return F9||(F9=new TextDecoder("UTF-16BE")),F9}let B9;function wLe(){return B9||(B9=SIe()?SLe():kTt()),B9}const ILe=typeof TextDecoder<"u";let Y0,Mq;ILe?(Y0=n=>new NTt(n),Mq=ATt):(Y0=n=>new DTt,Mq=LLe);function ATt(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?LLe(n,e,t):SLe().decode(i)}function LLe(n,e,t){let i=[],s=0;for(let o=0;o<t;o++){const r=vbt(n,e);e+=2,i[s++]=String.fromCharCode(r)}return i.join("")}class NTt{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return wLe().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||yl(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class DTt{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCII(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCIIString(e){this._pieces[this._piecesLen++]=e}}class r3{constructor(e,t,i,s,o,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=s,this.forwardRegex=o,this.reversedRegex=r,this._openSet=r3._toSet(this.open),this._closeSet=r3._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function $Tt(n){const e=n.length;n=n.map(r=>[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r<e;r++)t[r]=r;const i=(r,a)=>{const[c,u]=r,[d,f]=a;return c===d||c===f||u===d||u===f},s=(r,a)=>{const c=Math.min(r,a),u=Math.max(r,a);for(let d=0;d<e;d++)t[d]===u&&(t[d]=c)};for(let r=0;r<e;r++){const a=n[r];for(let c=r+1;c<e;c++){const u=n[c];i(a,u)&&s(t[r],t[c])}}const o=[];for(let r=0;r<e;r++){let a=[],c=[];for(let u=0;u<e;u++)if(t[u]===r){const[d,f]=n[u];a.push(d),c.push(f)}a.length>0&&o.push({open:a,close:c})}return o}class xTt{constructor(e,t){this._richEditBracketsBrand=void 0;const i=$Tt(t);this.brackets=i.map((s,o)=>new r3(e,o,s.open,s.close,PTt(s.open,s.close,i,o),FTt(s.open,s.close,i,o))),this.forwardRegex=BTt(this.brackets),this.reversedRegex=HTt(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function OLe(n,e,t,i){for(let s=0,o=e.length;s<o;s++){if(s===t)continue;const r=e[s];for(const a of r.open)a.indexOf(n)>=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function RLe(n,e){return n.length-e.length}function Q8(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function PTt(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o<r;o++)OLe(s[o],t,i,s);return s=Q8(s),s.sort(RLe),s.reverse(),Z8(s)}function FTt(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o<r;o++)OLe(s[o],t,i,s);return s=Q8(s),s.sort(RLe),s.reverse(),Z8(s.map(Gne))}function BTt(n){let e=[];for(const t of n){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=Q8(e),Z8(e)}function HTt(n){let e=[];for(const t of n){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=Q8(e),Z8(e.map(Gne))}function VTt(n){const e=/^[\w ]+$/.test(n);return n=jf(n),e?`\\b${n}\\b`:n}function Z8(n){let e=`(${n.map(VTt).join(")|(")})`;return iLe(e,!0)}const Gne=function(){function n(i){if(ILe){const s=new Uint16Array(i.length);let o=0;for(let r=i.length-1;r>=0;r--)s[o++]=i.charCodeAt(r);return wLe().decode(s)}else{let s=[],o=0;for(let r=i.length-1;r>=0;r--)s[o++]=i.charAt(r);return s.join("")}}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class df{static _findPrevBracketInText(e,t,i,s){let o=i.match(e);if(!o)return null;let r=i.length-(o.index||0),a=o[0].length,c=s+r;return new be(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,s,o){const a=Gne(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){let o=i.match(e);if(!o)return null;let r=o.index||0,a=o[0].length;if(a===0)return null;let c=s+r;return new be(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class UTt{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return e=e.filter((t,i,s)=>s.indexOf(t)===i),e}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(sm(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=df.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const c=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[c])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:c}:null}}function GH(n){return n.global&&(n.lastIndex=0),!0}class WTt{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&GH(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&GH(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&GH(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&GH(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class V1{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=V1._createOpenBracketRegExp(t[0]),s=V1._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let o=0,r=this._regExpRules.length;o<r;o++){let a=this._regExpRules[o];if([{reg:a.beforeText,text:i},{reg:a.afterText,text:s},{reg:a.previousLineText,text:t}].every(u=>u.reg?(u.reg.lastIndex=0,u.reg.test(u.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o<r;o++){let a=this._brackets[o];if(a.openRegExp.test(i)&&a.closeRegExp.test(s))return{indentAction:gr.IndentOutdent}}if(e>=2&&i.length>0){for(let o=0,r=this._brackets.length;o<r;o++)if(this._brackets[o].openRegExp.test(i))return{indentAction:gr.Indent}}return null}static _createOpenBracketRegExp(e){let t=jf(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",V1._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=jf(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,V1._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return di(t),null}}}class GTt{constructor(){this.data=new Map}add(e,t){JU(Yf(e)),JU(jc(t)),JU(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}const br=new GTt,e6={JSONContribution:"base.contributions.json"};function zTt(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class KTt{constructor(){this._onDidChangeSchema=new rt,this.schemasById={}}registerSchema(e,t){this.schemasById[zTt(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const jTt=new KTt;br.add(e6.JSONContribution,jTt);const Fw={Configuration:"base.contributions.configuration"},H9="vscode://schemas/settings/resourceLanguage",Khe=br.as(e6.JSONContribution);class XTt{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new rt,this._onDidUpdateConfiguration=new rt,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:$("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},Khe.registerSchema(H9,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=this.doRegisterConfigurations(e,t);Khe.registerSchema(H9,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t){const i=[];return e.forEach(s=>{i.push(...this.validateAndRegisterProperties(s,t,s.extensionInfo)),this.configurationContributors.push(s),this.registerJSONConfiguration(s)}),i}validateAndRegisterProperties(e,t=!0,i,s=3){var o;s=md(e.scope)?s:e.scope;let r=[],a=e.properties;if(a)for(let u in a){if(t&&QTt(u)){delete a[u];continue}const d=a[u];if(this.updatePropertyDefaultValue(u,d),zne.test(u)?d.scope=void 0:(d.scope=md(d.scope)?s:d.scope,d.restricted=md(d.restricted)?!!(!((o=i==null?void 0:i.restrictedConfigurations)===null||o===void 0)&&o.includes(u)):d.restricted),a[u].hasOwnProperty("included")&&!a[u].included){this.excludedConfigurationProperties[u]=a[u],delete a[u];continue}else this.configurationProperties[u]=a[u];!a[u].deprecationMessage&&a[u].markdownDeprecationMessage&&(a[u].deprecationMessage=a[u].markdownDeprecationMessage),r.push(u)}let c=e.allOf;if(c)for(let u of c)r.push(...this.validateAndRegisterProperties(u,t,i,s));return r}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=i=>{let s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);let o=i.allOf;o&&o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:$("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:$("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:H9};this.updatePropertyDefaultValue(t,i)}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];oc(i)&&(i=t.default),oc(i)&&(i=JTt(t.type)),t.default=i}}const YTt="\\[.*\\]$",zne=new RegExp(YTt);function qTt(n){return n.substring(1,n.length-1)}function JTt(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const MLe=new XTt;br.add(Fw.Configuration,MLe);function QTt(n){return n.trim()?zne.test(n)?$("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):MLe.getConfigurationProperties()[n]!==void 0?$("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):null:$("config.property.empty","Cannot register an empty property")}const Yo=ss("configurationService");function kLe(n,e){const t=Object.create(null);for(let i in n)Kne(t,i,n[i],e);return t}function Kne(n,e,t,i){const s=e.split("."),o=s.pop();let r=n;for(let a=0;a<s.length;a++){let c=s[a],u=r[c];switch(typeof u){case"undefined":u=r[c]=Object.create(null);break;case"object":break;default:i(`Ignoring ${e} as ${s.slice(0,a+1).join(".")} is ${JSON.stringify(u)}`);return}r=u}if(typeof r=="object"&&r!==null)try{r[o]=t}catch{i(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(r)}`)}else i(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(r)}`)}function ZTt(n,e){const t=e.split(".");ALe(n,t)}function ALe(n,e){const t=e.shift();if(e.length===0){delete n[t];return}if(Object.keys(n).indexOf(t)!==-1){const i=n[t];typeof i=="object"&&!Array.isArray(i)&&(ALe(i,e),Object.keys(i).length===0&&delete n[t])}}function eCt(n,e,t){function i(r,a){let c=r;for(const u of a){if(typeof c!="object"||c===null)return;c=c[u]}return c}const s=e.split("."),o=i(n,s);return typeof o>"u"?t:o}function tCt(){const n=br.as(Fw.Configuration).getConfigurationProperties();return Object.keys(n)}function nCt(){const n=Object.create(null),e=br.as(Fw.Configuration).getConfigurationProperties();for(let t in e){let i=e[t].default;Kne(n,t,i,s=>console.error(`Conflict in default settings: ${s}`))}return n}class nC{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const NLe=[];function Fy(n,e,t){e instanceof nC||(e=new nC(e,[],t)),NLe.push([n,e])}function iCt(){return NLe}var sCt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jhe=function(n,e){return function(t,i){e(t,i,n)}};class V9{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const yF=ss("languageConfigurationService");let l3=class extends wt{constructor(e,t){super(),this.configurationService=e,this.modeService=t,this.onDidChangeEmitter=this._register(new rt),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(kq));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,c])=>c.some(u=>i.has(u))).map(([a])=>this.modeService.validateLanguageId(a));if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new V9(void 0));else for(const a of r)a&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new V9(a)))})),this._register(ns.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new V9(s.languageId))}))}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=oCt(e,this.configurationService,this.modeService),this.configurations.set(e,t)),t}};l3=sCt([jhe(0,Yo),jhe(1,Ga)],l3);function oCt(n,e,t){let i=ns.getLanguageConfiguration(n);if(!i){const a=t.validateLanguageId(n);if(!a)throw new Error("Unexpected languageId");i=new Lx(a,{})}const s=rCt(i.languageId,e),o=DLe([i.underlyingConfig,s]);return new Lx(i.languageId,o)}const kq={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function rCt(n,e){const t=e.getValue(kq.brackets,{overrideIdentifier:n}),i=e.getValue(kq.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:Xhe(t),colorizedBracketPairs:Xhe(i)}}function Xhe(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}class Yhe{constructor(e){this.languageId=e}}class lCt{constructor(){this._entries=new Map,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event}register(e,t,i=0){let s=this._entries.get(e);s||(s=new aCt(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new Yhe(e)),xi(()=>{o.dispose(),this._onDidChange.fire(new Yhe(e))})}getLanguageConfiguration(e){let t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}getIndentationRules(e){const t=this.getLanguageConfiguration(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let s=WH(t,i-1),o=this._getElectricCharacterSupport(s.languageId);return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}getComments(e){let t=this.getLanguageConfiguration(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.characterPair||null}getAutoClosingPairs(e){const t=this._getCharacterPairSupport(e);return new RTt(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():_R.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const s=WH(t,i-1);return _R.shouldAutoClosePair(e,s,i-s.firstCharOffset)}getWordDefinition(e){let t=this.getLanguageConfiguration(e);return xW(t&&t.wordDefinition||null)}getFoldingRules(e){let t=this.getLanguageConfiguration(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){let s=e.getLanguageIdAtPosition(t,0);if(t>1){let o,r=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==s)return r;let a=e.getLineContent(o);if(i.shouldIgnore(a)||/^\s+$/.test(a)||a===""){r=o;continue}return o}}return-1}getInheritIndentForLine(e,t,i,s=!0){if(e<4)return null;const o=this.getIndentRulesSupport(t.getLanguageId());if(!o)return null;if(i<=1)return{indentation:"",action:null};const r=this.getPrecedingValidLine(t,i,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:Hs(a),action:gr.Indent,line:r};if(o.shouldDecrease(a))return{indentation:Hs(a),action:null,line:r};{if(r===1)return{indentation:Hs(t.getLineContent(r)),action:null,line:r};const c=r-1,u=o.getIndentMetadata(t.getLineContent(c));if(!(u&3)&&u&4){let d=0;for(let f=c-1;f>0;f--)if(!o.shouldIndentNextLine(t.getLineContent(f))){d=f;break}return{indentation:Hs(t.getLineContent(d+1)),action:null,line:d+1}}if(s)return{indentation:Hs(t.getLineContent(r)),action:null,line:r};for(let d=r;d>0;d--){const f=t.getLineContent(d);if(o.shouldIncrease(f))return{indentation:Hs(f),action:gr.Indent,line:d};if(o.shouldIndentNextLine(f)){let g=0;for(let p=d-1;p>0;p--)if(!o.shouldIndentNextLine(t.getLineContent(d))){g=p;break}return{indentation:Hs(t.getLineContent(g+1)),action:null,line:g+1}}else if(o.shouldDecrease(f))return{indentation:Hs(f),action:null,line:d}}return{indentation:Hs(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,s,o){if(e<4)return null;const r=this.getLanguageConfiguration(i);if(!r)return null;const a=this.getIndentRulesSupport(i);if(!a)return null;const c=this.getInheritIndentForLine(e,t,s),u=t.getLineContent(s);if(c){const d=c.line;if(d!==void 0){const f=r.onEnter(e,"",t.getLineContent(d),"");if(f){let g=Hs(t.getLineContent(d));return f.removeText&&(g=g.substring(0,g.length-f.removeText)),f.indentAction===gr.Indent||f.indentAction===gr.IndentOutdent?g=o.shiftIndent(g):f.indentAction===gr.Outdent&&(g=o.unshiftIndent(g)),a.shouldDecrease(u)&&(g=o.unshiftIndent(g)),f.appendText&&(g+=f.appendText),Hs(g)}}return a.shouldDecrease(u)?c.action===gr.Indent?c.indentation:o.unshiftIndent(c.indentation):c.action===gr.Indent?o.shiftIndent(c.indentation):c.indentation}return null}getIndentForEnter(e,t,i,s){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),r=WH(o,i.startColumn-1),a=r.getLineContent();let c=!1,u;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(c=!0,u=a.substr(0,i.startColumn-1-r.firstCharOffset)):u=o.getLineContent().substring(0,i.startColumn-1);let d;i.isEmpty()?d=a.substr(i.startColumn-1-r.firstCharOffset):d=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const f=this.getIndentRulesSupport(r.languageId);if(!f)return null;const g=u,p=Hs(u),_={getLineTokens:w=>t.getLineTokens(w),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(w,I)=>t.getLanguageIdAtPosition(w,I),getLineContent:w=>w===i.startLineNumber?g:t.getLineContent(w)},v=Hs(o.getLineContent()),C=this.getInheritIndentForLine(e,_,i.startLineNumber+1);if(!C){const w=c?v:p;return{beforeEnter:w,afterEnter:w}}let y=c?v:C.indentation;return C.action===gr.Indent&&(y=s.shiftIndent(y)),f.shouldDecrease(d)&&(y=s.unshiftIndent(y)),{beforeEnter:c?v:p,afterEnter:y}}getIndentActionForType(e,t,i,s,o){if(e<4)return null;const r=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn);if(r.firstCharOffset)return null;const a=this.getIndentRulesSupport(r.languageId);if(!a)return null;const c=r.getLineContent(),u=c.substr(0,i.startColumn-1-r.firstCharOffset);let d;if(i.isEmpty()?d=c.substr(i.startColumn-1-r.firstCharOffset):d=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset),!a.shouldDecrease(u+d)&&a.shouldDecrease(u+s+d)){const f=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!f)return null;let g=f.indentation;return f.action!==gr.Indent&&(g=o.unshiftIndent(g)),g}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageId());return!i||t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t))}getEnterAction(e,t,i){const s=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),o=this.getLanguageConfiguration(s.languageId);if(!o)return null;const r=s.getLineContent(),a=r.substr(0,i.startColumn-1-s.firstCharOffset);let c;i.isEmpty()?c=r.substr(i.startColumn-1-s.firstCharOffset):c=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset);let u="";if(i.startLineNumber>1&&s.firstCharOffset===0){const v=this.getScopedLineTokens(t,i.startLineNumber-1);v.languageId===s.languageId&&(u=v.getLineContent())}const d=o.onEnter(e,u,a,c);if(!d)return null;const f=d.indentAction;let g=d.appendText;const p=d.removeText||0;g?f===gr.Indent&&(g=" "+g):f===gr.Indent||f===gr.IndentOutdent?g=" ":g="";let _=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return p&&(_=_.substring(0,_.length-p)),{indentAction:f,appendText:g,removeText:p,indentation:_}}getIndentationAtPosition(e,t,i){const s=e.getLineContent(t);let o=Hs(s);return o.length>i-1&&(o=o.substring(0,i-1)),o}getScopedLineTokens(e,t,i){e.forceTokenization(t);const s=e.getLineTokens(t),o=typeof i>"u"?e.getLineMaxColumn(t)-1:i-1;return WH(s,o)}}const ns=new lCt;class aCt{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new qhe(e,t,++this._order);return this._entries.push(i),this._resolved=null,xi(()=>{for(let s=0;s<this._entries.length;s++)if(this._entries[s]===i){this._entries.splice(s,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new Lx(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(qhe.cmp),DLe(this._entries.map(e=>e.configuration)))}}function DLe(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class qhe{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Lx{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new V1(this.underlyingConfig):null,this.comments=Lx._handleComments(this.underlyingConfig),this.characterPair=new _R(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||IIe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new WTt(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{}}getWordDefinition(){return xW(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new xTt(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new UTt(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){let[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}Fy(yF,l3);class XT{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class Jhe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i<s;i++)t[i]=e.charCodeAt(i);return t}}function cCt(n,e,t){return new Cm(new Jhe(n),new Jhe(e)).ComputeDiff(t).changes}class t1{static Assert(e,t){if(!e)throw new Error(t)}}class n1{static Copy(e,t,i,s,o){for(let r=0;r<o;r++)i[s+r]=e[t+r]}static Copy2(e,t,i,s,o){for(let r=0;r<o;r++)i[s+r]=e[t+r]}}class Qhe{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new XT(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Cm{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=Cm._getElements(e),[a,c,u]=Cm._getElements(t);this._hasStrings=r&&u,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(Cm._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=Hne(t[s],0);return[t,i,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._modifiedStringElements[t]:!0}ElementsAreStrictEqual(e,t){if(!this.ElementsAreEqual(e,t))return!1;const i=Cm._getStrictElement(this._originalSequence,e),s=Cm._getStrictElement(this._modifiedSequence,t);return i===s}static _getStrictElement(e,t){return typeof e.getStrictElement=="function"?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._originalElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._originalStringElements[t]:!0}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._modifiedStringElements[e]===this._modifiedStringElements[t]:!0}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,s,o){const r=[!1];let a=this.ComputeDiffRecursive(e,t,i,s,r);return o&&(a=this.PrettifyChanges(a)),{quitEarly:r[0],changes:a}}ComputeDiffRecursive(e,t,i,s,o){for(o[0]=!1;e<=t&&i<=s&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let f;return i<=s?(t1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),f=[new XT(e,0,i,s-i+1)]):e<=t?(t1.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),f=[new XT(e,t-e+1,i,0)]):(t1.Assert(e===t+1,"originalStart should only be one more than originalEnd"),t1.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),f=[]),f}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,s,r,a,o),u=r[0],d=a[0];if(c!==null)return c;if(!o[0]){const f=this.ComputeDiffRecursive(e,u,i,d,o);let g=[];return o[0]?g=[new XT(u+1,t-(u+1)+1,d+1,s-(d+1)+1)]:g=this.ComputeDiffRecursive(u+1,t,d+1,s,o),this.ConcatenateChanges(f,g)}return[new XT(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v,C,y,w){let I=null,L=null,O=new Qhe,A=t,N=i,D=p[0]-C[0]-s,P=-1073741824,F=this.m_forwardHistory.length-1;do{const V=D+e;V===A||V<N&&u[V-1]<u[V+1]?(f=u[V+1],_=f-D-s,f<P&&O.MarkNextChange(),P=f,O.AddModifiedElement(f+1,_),D=V+1-e):(f=u[V-1]+1,_=f-D-s,f<P&&O.MarkNextChange(),P=f-1,O.AddOriginalElement(f,_+1),D=V-1-e),F>=0&&(u=this.m_forwardHistory[F],e=u[0],A=1,N=u.length-1)}while(--F>=-1);if(I=O.getReverseChanges(),w[0]){let V=p[0]+1,U=C[0]+1;if(I!==null&&I.length>0){const Q=I[I.length-1];V=Math.max(V,Q.getOriginalEnd()),U=Math.max(U,Q.getModifiedEnd())}L=[new XT(V,g-V+1,U,v-U+1)]}else{O=new Qhe,A=r,N=a,D=p[0]-C[0]-c,P=1073741824,F=y?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const V=D+o;V===A||V<N&&d[V-1]>=d[V+1]?(f=d[V+1]-1,_=f-D-c,f>P&&O.MarkNextChange(),P=f+1,O.AddOriginalElement(f+1,_+1),D=V+1-o):(f=d[V-1],_=f-D-c,f>P&&O.MarkNextChange(),P=f,O.AddModifiedElement(f+1,_+1),D=V-1-o),F>=0&&(d=this.m_reverseHistory[F],o=d[0],A=1,N=d.length-1)}while(--F>=-1);L=O.getChanges()}return this.ConcatenateChanges(I,L)}ComputeRecursionPoint(e,t,i,s,o,r,a){let c=0,u=0,d=0,f=0,g=0,p=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const _=t-e+(s-i),v=_+1,C=new Int32Array(v),y=new Int32Array(v),w=s-i,I=t-e,L=e-i,O=t-s,N=(I-w)%2===0;C[w]=e,y[I]=t,a[0]=!1;for(let D=1;D<=_/2+1;D++){let P=0,F=0;d=this.ClipDiagonalBound(w-D,D,w,v),f=this.ClipDiagonalBound(w+D,D,w,v);for(let U=d;U<=f;U+=2){U===d||U<f&&C[U-1]<C[U+1]?c=C[U+1]:c=C[U-1]+1,u=c-(U-w)-L;const Q=c;for(;c<t&&u<s&&this.ElementsAreEqual(c+1,u+1);)c++,u++;if(C[U]=c,c+u>P+F&&(P=c,F=u),!N&&Math.abs(U-I)<=D-1&&c>=y[U])return o[0]=c,r[0]=u,Q<=y[U]&&D<=1448?this.WALKTRACE(w,d,f,L,I,g,p,O,C,y,c,t,o,u,s,r,N,a):null}const V=(P-e+(F-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(P,V))return a[0]=!0,o[0]=P,r[0]=F,V>0&&D<=1448?this.WALKTRACE(w,d,f,L,I,g,p,O,C,y,c,t,o,u,s,r,N,a):(e++,i++,[new XT(e,t-e+1,i,s-i+1)]);g=this.ClipDiagonalBound(I-D,D,I,v),p=this.ClipDiagonalBound(I+D,D,I,v);for(let U=g;U<=p;U+=2){U===g||U<p&&y[U-1]>=y[U+1]?c=y[U+1]-1:c=y[U-1],u=c-(U-I)-O;const Q=c;for(;c>e&&u>i&&this.ElementsAreEqual(c,u);)c--,u--;if(y[U]=c,N&&Math.abs(U-w)<=D&&c<=C[U])return o[0]=c,r[0]=u,Q>=C[U]&&D<=1448?this.WALKTRACE(w,d,f,L,I,g,p,O,C,y,c,t,o,u,s,r,N,a):null}if(D<=1447){let U=new Int32Array(f-d+2);U[0]=w-d+1,n1.Copy2(C,d,U,1,f-d+1),this.m_forwardHistory.push(U),U=new Int32Array(p-g+2),U[0]=I-g+1,n1.Copy2(y,g,U,1,p-g+1),this.m_reverseHistory.push(U)}}return this.WALKTRACE(w,d,f,L,I,g,p,O,C,y,c,t,o,u,s,r,N,a)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],s=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,r=i.originalLength>0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength<s&&i.modifiedStart+i.modifiedLength<o&&(!r||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!a||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const u=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!u)break;i.originalStart++,i.modifiedStart++}let c=[null];if(t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],c)){e[t]=c[0],e.splice(t+1,1),t--;continue}}for(let t=e.length-1;t>=0;t--){const i=e[t];let s=0,o=0;if(t>0){const f=e[t-1];s=f.originalStart+f.originalLength,o=f.modifiedStart+f.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let c=0,u=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let f=1;;f++){const g=i.originalStart-f,p=i.modifiedStart-f;if(g<s||p<o||r&&!this.OriginalElementsAreEqual(g,g+i.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+i.modifiedLength))break;const v=(g===s&&p===o?5:0)+this._boundaryScore(g,i.originalLength,p,i.modifiedLength);v>u&&(u=v,c=f)}i.originalStart-=c,i.modifiedStart-=c;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const s=e[t-1],o=e[t],r=o.originalStart-s.originalStart-s.originalLength,a=s.originalStart,c=o.originalStart+o.originalLength,u=c-a,d=s.modifiedStart,f=o.modifiedStart+o.modifiedLength,g=f-d;if(r<5&&u<20&&g<20){const p=this._findBetterContiguousSequence(a,u,d,g,r);if(p){const[_,v]=p;(_!==s.originalStart+s.originalLength||v!==s.modifiedStart+s.modifiedLength)&&(s.originalLength=_-s.originalStart,s.modifiedLength=v-s.modifiedStart,o.originalStart=_+r,o.modifiedStart=v+r,o.originalLength=c-o.originalStart,o.modifiedLength=f-o.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,s,o){if(t<o||s<o)return null;const r=e+t-o+1,a=i+s-o+1;let c=0,u=0,d=0;for(let f=e;f<r;f++)for(let g=i;g<a;g++){const p=this._contiguousSequenceScore(f,g,o);p>0&&p>c&&(c=p,u=f,d=g)}return c>0?[u,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;s+=this._originalStringElements[e+o].length}return s}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){let i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return n1.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],n1.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return n1.Copy(e,0,s,0,e.length),n1.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(t1.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),t1.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new XT(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e<s)return e;const o=i,r=s-i-1,a=t%2===0;if(e<0){const c=o%2===0;return a===c?0:1}else{const c=r%2===0;return a===c?s-1:s-2}}}const uCt=3;function $Le(n,e,t,i){return new Cm(n,e,t).ComputeDiff(i)}class Zhe{constructor(e){const t=[],i=[];for(let s=0,o=e.length;s<o;s++)t[s]=Aq(e[s],1),i[s]=Nq(e[s],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const s=[],o=[],r=[];let a=0;for(let c=t;c<=i;c++){const u=this.lines[c],d=e?this._startColumns[c]:1,f=e?this._endColumns[c]:u.length+1;for(let g=d;g<f;g++)s[a]=u.charCodeAt(g-1),o[a]=c+1,r[a]=g,a++}return new dCt(s,o,r)}}class dCt{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}getElements(){return this._charCodes}getStartLineNumber(e){return this._lineNumbers[e]}getStartColumn(e){return this._columns[e]}getEndLineNumber(e){return this._lineNumbers[e]}getEndColumn(e){return this._columns[e]+1}}class Ox{constructor(e,t,i,s,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){let s,o,r,a,c,u,d,f;return e.originalLength===0?(s=0,o=0,r=0,a=0):(s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1)),e.modifiedLength===0?(c=0,u=0,d=0,f=0):(c=i.getStartLineNumber(e.modifiedStart),u=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),f=i.getEndColumn(e.modifiedStart+e.modifiedLength-1)),new Ox(s,o,r,a,c,u,d,f)}}function hCt(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i<s;i++){const o=n[i],r=o.originalStart-(t.originalStart+t.originalLength),a=o.modifiedStart-(t.modifiedStart+t.modifiedLength);Math.min(r,a)<uCt?(t.originalLength=o.originalStart+o.originalLength-t.originalStart,t.modifiedLength=o.modifiedStart+o.modifiedLength-t.modifiedStart):(e.push(o),t=o)}return e}class KD{constructor(e,t,i,s,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=s,this.charChanges=o}static createFromDiffResult(e,t,i,s,o,r,a){let c,u,d,f,g;if(t.originalLength===0?(c=i.getStartLineNumber(t.originalStart)-1,u=0):(c=i.getStartLineNumber(t.originalStart),u=i.getEndLineNumber(t.originalStart+t.originalLength-1)),t.modifiedLength===0?(d=s.getStartLineNumber(t.modifiedStart)-1,f=0):(d=s.getStartLineNumber(t.modifiedStart),f=s.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),r&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const p=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),_=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let v=$Le(p,_,o,!0).changes;a&&(v=hCt(v)),g=[];for(let C=0,y=v.length;C<y;C++)g.push(Ox.createFromDiffChange(v[C],p,_))}return new KD(c,u,d,f,g)}}class fCt{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new Zhe(e),this.modified=new Zhe(t),this.continueLineDiff=efe(i.maxComputationTime),this.continueCharDiff=efe(i.maxComputationTime===0?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(this.original.lines.length===1&&this.original.lines[0].length===0)return this.modified.lines.length===1&&this.modified.lines[0].length===0?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};if(this.modified.lines.length===1&&this.modified.lines[0].length===0)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};const e=$Le(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const a=[];for(let c=0,u=t.length;c<u;c++)a.push(KD.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[c],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:a}}const s=[];let o=0,r=0;for(let a=-1,c=t.length;a<c;a++){const u=a+1<c?t[a+1]:null,d=u?u.originalStart:this.originalLines.length,f=u?u.modifiedStart:this.modifiedLines.length;for(;o<d&&r<f;){const g=this.originalLines[o],p=this.modifiedLines[r];if(g!==p){{let _=Aq(g,1),v=Aq(p,1);for(;_>1&&v>1;){const C=g.charCodeAt(_-2),y=p.charCodeAt(v-2);if(C!==y)break;_--,v--}(_>1||v>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,_,r+1,1,v)}{let _=Nq(g,1),v=Nq(p,1);const C=g.length+1,y=p.length+1;for(;_<C&&v<y;){const w=g.charCodeAt(_-1),I=g.charCodeAt(v-1);if(w!==I)break;_++,v++}(_<C||v<y)&&this._pushTrimWhitespaceCharChange(s,o+1,_,C,r+1,v,y)}}o++,r++}u&&(s.push(KD.createFromDiffResult(this.shouldIgnoreTrimWhitespace,u,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=u.originalLength,r+=u.modifiedLength)}return{quitEarly:i,changes:s}}_pushTrimWhitespaceCharChange(e,t,i,s,o,r,a){if(this._mergeTrimWhitespaceCharChange(e,t,i,s,o,r,a))return;let c;this.shouldComputeCharChanges&&(c=[new Ox(t,i,t,s,o,r,o,a)]),e.push(new KD(t,t,o,o,c))}_mergeTrimWhitespaceCharChange(e,t,i,s,o,r,a){const c=e.length;if(c===0)return!1;const u=e[c-1];return u.originalEndLineNumber===0||u.modifiedEndLineNumber===0?!1:u.originalEndLineNumber+1===t&&u.modifiedEndLineNumber+1===o?(u.originalEndLineNumber=t,u.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&u.charChanges&&u.charChanges.push(new Ox(t,i,t,s,o,r,o,a)),!0):!1}}function Aq(n,e){const t=cc(n);return t===-1?e:t+1}function Nq(n,e){const t=Fm(n);return t===-1?e:t+2}function efe(n){if(n===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<n}function a3(n){return n<0?0:n>255?255:n|0}function i1(n){return n<0?0:n>4294967295?4294967295:n|0}class xLe{constructor(e,t){this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class gCt{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=i1(e);const i=this.values,s=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=i1(e),t=i1(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=i1(e),t=i1(t);const i=this.values,s=this.prefixSum;if(e>=i.length)return!1;let o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=i1(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e<r)i=s-1;else if(e>=o)t=s+1;else break;return new xLe(s,e-r)}}class pCt{constructor(e,t,i,s){this._uri=e,this._lines=t,this._eol=i,this._versionId=s,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new ct(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let s=0;s<t;s++)i[s]=this._lines[s].length+e;this._lineStarts=new gCt(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.changeValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){if(t.length===0)return;let i=Jm(t);if(i.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);let s=new Uint32Array(i.length-1);for(let o=1;o<i.length;o++)this._lines.splice(e.lineNumber+o-1,0,i[o]),s[o-1]=i[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,s)}}class pM{constructor(e){let t=a3(e);this._defaultValue=t,this._asciiMap=pM._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let i=0;i<256;i++)t[i]=e;return t}set(e,t){let i=a3(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class U1{constructor(){this._actual=new pM(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}}class mCt{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;o<r;o++)s[o]=i;this._data=s,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class _Ct{constructor(e){let t=0,i=0;for(let o=0,r=e.length;o<r;o++){let[a,c,u]=e[o];c>t&&(t=c),a>i&&(i=a),u>i&&(i=u)}t++,i++;let s=new mCt(i,t,0);for(let o=0,r=e.length;o<r;o++){let[a,c,u]=e[o];s.set(a,c,u)}this._states=s,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let U9=null;function vCt(){return U9===null&&(U9=new _Ct([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),U9}let NN=null;function bCt(){if(NN===null){NN=new pM(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)NN.set(n.charCodeAt(t),1);const e=".,;";for(let t=0;t<e.length;t++)NN.set(e.charCodeAt(t),2)}return NN}class c3{static _createLink(e,t,i,s,o){let r=o-1;do{const a=t.charCodeAt(r);if(e.get(a)!==2)break;r--}while(r>s);if(s>0){const a=t.charCodeAt(s-1),c=t.charCodeAt(r);(a===40&&c===41||a===91&&c===93||a===123&&c===125)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=vCt()){const i=bCt();let s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),c=a.length;let u=0,d=0,f=0,g=1,p=!1,_=!1,v=!1,C=!1;for(;u<c;){let y=!1;const w=a.charCodeAt(u);if(g===13){let I;switch(w){case 40:p=!0,I=0;break;case 41:I=p?0:1;break;case 91:v=!0,_=!0,I=0;break;case 93:v=!1,I=_?0:1;break;case 123:C=!0,I=0;break;case 125:I=C?0:1;break;case 39:I=f===34||f===96?0:1;break;case 34:I=f===39||f===96?0:1;break;case 96:I=f===39||f===34?0:1;break;case 42:I=f===42?1:0;break;case 124:I=f===124?1:0;break;case 32:I=v?0:1;break;default:I=i.get(w)}I===1&&(s.push(c3._createLink(i,a,o,d,u)),y=!0)}else if(g===12){let I;w===91?(_=!0,I=0):I=i.get(w),I===1?y=!0:g=13}else g=t.nextState(g,w),g===0&&(y=!0);y&&(g=1,p=!1,_=!1,C=!1,d=u+1,f=w),u++}g===13&&s.push(c3._createLink(i,a,o,d,c))}return s}}function TCt(n){return!n||typeof n.getLineCount!="function"||typeof n.getLineContent!="function"?[]:c3.computeLinks(n)}class Dq{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,s,o){if(e&&t){let r=this.doNavigateValueSet(t,o);if(r)return{range:e,value:r}}if(i&&s){let r=this.doNavigateValueSet(s,o);if(r)return{range:i,value:r}}return null}doNavigateValueSet(e,t){let i=this.numberReplace(e,t);return i!==null?i:this.textReplace(e,t)}numberReplace(e,t){let i=Math.pow(10,e.length-(e.lastIndexOf(".")+1)),s=Number(e),o=parseFloat(e);return!isNaN(s)&&!isNaN(o)&&s===o?s===0&&!t?null:(s=Math.floor(s*i),s+=t?i:-i,String(s/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let s=null;for(let o=0,r=e.length;s===null&&o<r;o++)s=this.valueSetReplace(e[o],t,i);return s}valueSetReplace(e,t,i){let s=e.indexOf(t);return s>=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}}Dq.INSTANCE=new Dq;var s1=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class CCt extends pCt{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let i=PW(e.column,xW(t),this._lines[e.lineNumber-1],0);return i?new be(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let s=0,o="",r=0,a=[];return{*[Symbol.iterator](){for(;;)if(r<a.length){const c=o.substring(a[r].start,a[r].end);r+=1,yield c}else if(s<t.length)o=t[s],a=i(o,e),r=0,s+=1;else break}}}getLineWords(e,t){let i=this._lines[e-1],s=this._wordenize(i,t),o=[];for(const r of s)o.push({word:i.substring(r.start,r.end),startColumn:r.start+1,endColumn:r.end+1});return o}_wordenize(e,t){const i=[];let s;for(t.lastIndex=0;(s=t.exec(e))&&s[0].length!==0;)i.push({start:s.index,end:s.index+s[0].length});return i}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);let t=this._eol,i=e.startLineNumber-1,s=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let r=i+1;r<s;r++)o.push(this._lines[r]);return o.push(this._lines[s].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();let t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!ct.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,s=!1;if(t<1)t=1,i=1,s=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{let o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}class q0{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new CCt(Jn.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,s){return s1(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);if(!o||!r)return null;const a=o.getLinesContent(),c=r.getLinesContent(),d=new fCt(a,c,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:s}).computeDiff(),f=d.changes.length>0?!1:this._modelsAreIdentical(o,r);return{quitEarly:d.quitEarly,identical:f,changes:d.changes}})}_modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}computeMoreMinimalEdits(e,t){return s1(this,void 0,void 0,function*(){const i=this._getModel(e);if(!i)return t;const s=[];let o;t=t.slice(0).sort((r,a)=>{if(r.range&&a.range)return be.compareRangesUsingStarts(r.range,a.range);let c=r.range?0:1,u=a.range?0:1;return c-u});for(let{range:r,text:a,eol:c}of t){if(typeof c=="number"&&(o=c),be.isEmpty(r)&&!a)continue;const u=i.getValueInRange(r);if(a=a.replace(/\r\n|\n|\r/g,i.eol),u===a)continue;if(Math.max(a.length,u.length)>q0._diffLimit){s.push({range:r,text:a});continue}const d=cCt(u,a,!1),f=i.offsetAt(be.lift(r).getStartPosition());for(const g of d){const p=i.positionAt(f+g.originalStart),_=i.positionAt(f+g.originalStart+g.originalLength),v={text:a.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};i.getValueInRange(v.range)!==v.text&&s.push(v)}}return typeof o=="number"&&s.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s})}computeLinks(e){return s1(this,void 0,void 0,function*(){let t=this._getModel(e);return t?TCt(t):null})}textualSuggest(e,t,i,s){return s1(this,void 0,void 0,function*(){const o=new Ym(!0),r=new RegExp(i,s),a=new Set;e:for(let c of e){const u=this._getModel(c);if(u){for(let d of u.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>q0._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return s1(this,void 0,void 0,function*(){let o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let c=t.startLineNumber;c<t.endLineNumber;c++){let u=o.getLineWords(c,r);for(const d of u){if(!isNaN(Number(d.word)))continue;let f=a[d.word];f||(f=[],a[d.word]=f),f.push({startLineNumber:c,startColumn:d.startColumn,endLineNumber:c,endColumn:d.endColumn})}}return a})}navigateValueSet(e,t,i,s,o){return s1(this,void 0,void 0,function*(){let r=this._getModel(e);if(!r)return null;let a=new RegExp(s,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});let c=r.getValueInRange(t),u=r.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},a);if(!u)return null;let d=r.getValueInRange(u);return Dq.INSTANCE.navigateValueSet(t,c,u,d,i)})}loadForeignModule(e,t,i){let r={host:Abt(i,(a,c)=>this._host.fhr(a,c)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(Pne(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}q0._diffLimit=1e5;q0._suggestionsLimit=1e4;typeof importScripts=="function"&&(Io.monaco=FIe());const jne=ss("textResourceConfigurationService"),PLe=ss("textResourcePropertiesService");function eh(n,e=0){return n[n.length-(1+e)]}function yCt(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function xf(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;i<s;i++)if(!t(n[i],e[i]))return!1;return!0}function Xne(n,e,t){let i=0,s=n.length-1;for(;i<=s;){const o=(i+s)/2|0,r=t(n[o],e);if(r<0)i=o+1;else if(r>0)s=o-1;else return o}return-(i+1)}function FLe(n,e){let t=0,i=n.length;if(i===0)return 0;for(;t<i;){const s=Math.floor((t+i)/2);e(n[s])?i=s:t=s+1}return t}function $q(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");let i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(let a of e){const c=t(a,i);c<0?s.push(a):c>0?o.push(a):r.push(a)}return n<s.length?$q(n,s,t):n<s.length+r.length?r[0]:$q(n-(s.length+r.length),o,t)}function tfe(n,e){const t=[];let i;for(const s of n.slice(0).sort(e))!i||e(i[0],s)!==0?(i=[s],t.push(i)):i.push(s);return t}function Bw(n){return n.filter(e=>!!e)}function BLe(n){return!Array.isArray(n)||n.length===0}function Nu(n){return Array.isArray(n)&&n.length>0}function u3(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function ECt(n,e){const t=SCt(n,e);if(t!==-1)return n[t]}function SCt(n,e){for(let t=n.length-1;t>=0;t--){const i=n[t];if(e(i))return t}return-1}function xq(n,e){return n.length>0?n[0]:e}function Yne(n){return[].concat(...n)}function Za(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;s<e;s++)i.push(s);else for(let s=t;s>e;s--)i.push(s);return i}function Rx(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function W9(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function zH(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function qne(n){return Array.isArray(n)?n:[n]}function wCt(n,e,t){const i=HLe(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r<o;r++)n[r+i]=t[r]}function nfe(n,e,t,i){const s=HLe(n,e),o=n.splice(s,t);return wCt(n,s,i),o}function HLe(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}class jD{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){return this.items[this.firstIdx]}}const h_=ss("logService");var Fg;(function(n){n[n.Trace=0]="Trace",n[n.Debug=1]="Debug",n[n.Info=2]="Info",n[n.Warning=3]="Warning",n[n.Error=4]="Error",n[n.Critical=5]="Critical",n[n.Off=6]="Off"})(Fg||(Fg={}));const VLe=Fg.Info;class ICt extends wt{constructor(){super(...arguments),this.level=VLe,this._onDidChangeLogLevel=this._register(new rt)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class LCt extends ICt{constructor(e=VLe){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=Fg.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=Fg.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=Fg.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=Fg.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class OCt extends wt{constructor(e){super(),this.logger=e,this._register(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}var RCt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},G9=function(n,e){return function(t,i){e(t,i,n)}},Pq=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const ife=60*1e3,sfe=5*60*1e3;function W1(n,e){let t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Fq=class extends wt{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new kCt(this._modelService)),this._logService=i,this._register(Ix.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,o)=>W1(this._modelService,s.uri)?this._workerManager.withWorker().then(r=>r.computeLinks(s.uri)).then(r=>r&&{links:r}):Promise.resolve({links:[]})})),this._register(Ag.register("*",new MCt(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}computeDiff(e,t,i,s){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,s))}computeMoreMinimalEdits(e,t){if(Nu(t)){if(!W1(this._modelService,e))return Promise.resolve(t);const i=Ym.create(!0),s=this._workerManager.withWorker().then(o=>o.computeMoreMinimalEdits(e,t));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())),Promise.race([s,sy(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return W1(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return W1(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};Fq=RCt([G9(0,Xr),G9(1,jne),G9(2,h_)],Fq);class MCt{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return Pq(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const s=[];if(i.wordBasedSuggestionsMode==="currentDocument")W1(this._modelService,e.uri)&&s.push(e.uri);else for(const f of this._modelService.getModels())W1(this._modelService,f.uri)&&(f===e?s.unshift(f.uri):(i.wordBasedSuggestionsMode==="allDocuments"||f.getLanguageId()===e.getLanguageId())&&s.push(f.uri));if(s.length===0)return;const o=ns.getWordDefinition(e.getLanguageId()),r=e.getWordAtPosition(t),a=r?new be(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):be.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(s,r==null?void 0:r.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(f=>({kind:18,label:f,insertText:f,range:{insert:c,replace:a}}))}})}}class kCt extends wt{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new vF).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(sfe/2)),this._register(this._modelService.onModelRemoved(i=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>sfe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new ULe(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class ACt extends wt{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){let s=new vF;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(ife/2)),this._register(s)}}dispose(){for(let e in this._syncedModels)Ji(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){let s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){let e=new Date().getTime(),t=[];for(let i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>ife&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){let i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;let s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new Wt;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(xi(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Ji(t)}}class ofe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class z9{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class ULe extends wt{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new J8(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new STt(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new z9(this)))}catch(e){Rq(e),this._worker=new ofe(new q0(new z9(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Rq(e),this._worker=new ofe(new q0(new z9(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new ACt(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return Pq(this,void 0,void 0,function*(){return this._disposed?Promise.reject(gM()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then(i=>i.computeMoreMinimalEdits(e.toString(),t))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}textualSuggest(e,t,i){return Pq(this,void 0,void 0,function*(){const s=yield this._withSyncedResources(e),o=i.source,r=O9(i);return s.textualSuggest(e.map(a=>a.toString()),t,o,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{let s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);let o=ns.getWordDefinition(s.getLanguageId()),r=o.source,a=O9(o);return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{let o=this._modelService.getModel(e);if(!o)return null;let r=ns.getWordDefinition(o.getLanguageId()),a=r.source,c=O9(r);return s.navigateValueSet(e.toString(),t,i,a,c)})}dispose(){super.dispose(),this._disposed=!0}}function NCt(n,e){return new DCt(n,e)}class DCt extends ULe{constructor(e,t){super(e,t.keepIdleModels||!1,t.label),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Pne(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,c)=>e.fmr(a,c),o=(a,c)=>function(){const u=Array.prototype.slice.call(arguments,0);return c(a,u)};let r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}class El{constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}static createEmpty(e,t){const i=El.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new El(s,e,t)}equals(e){return e instanceof El?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r<o;r++)if(this._tokens[r]!==e._tokens[r])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Ba.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Ba.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Ba.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Ba.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Ba.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return El.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new Jne(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o<s;o++)e[o<<1]=e[o+1<<1];e[s<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,s=(e.length>>>1)-1;for(;i<s;){const o=i+Math.floor((s-i)/2),r=e[o<<1];if(r===t)return o+1;r<t?i=o+1:r>t&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){let a=t<this._tokensCount?this._tokens[t<<1]:-1,c=i<e.length?e[i]:null;if(a!==-1&&(c===null||a<=c.offset)){s+=this._text.substring(r,a);const u=this._tokens[(t<<1)+1];o.push(s.length,u),t++,r=a}else if(c){if(c.offset>r){s+=this._text.substring(r,c.offset);const u=this._tokens[(t<<1)+1];o.push(s.length,u),r=c.offset}s+=c.text,o.push(s.length,c.tokenMetadata),i++}else break}return new El(new Uint32Array(o),s,this._languageIdCodec)}}El.defaultTokenMetadata=(16384|2<<23)>>>0;class Jne{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o<r&&!(e.getStartOffset(o)>=i);o++)this._tokensCount++}equals(e){return e instanceof Jne?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class Ed{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o<i;o++)if(!Ed._equals(e[o],t[o]))return!1;return!0}static extractWrapped(e,t,i){if(e.length===0)return e;const s=t+1,o=i+1,r=i-t,a=[];let c=0;for(const u of e)u.endColumn<=s||u.startColumn>=o||(a[c++]=new Ed(Math.max(1,u.startColumn-s+1),Math.min(r+1,u.endColumn-s+1),u.className,u.type));return a}static filter(e,t,i,s){if(e.length===0)return[];let o=[],r=0;for(let a=0,c=e.length;a<c;a++){const u=e[a],d=u.range;if(d.endLineNumber<t||d.startLineNumber>t||d.isEmpty()&&(u.type===0||u.type===3))continue;const f=d.startLineNumber===t?d.startColumn:i,g=d.endLineNumber===t?d.endColumn:s;o[r++]=new Ed(f,g,u.inlineClassName,u.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=Ed._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className<t.className?-1:1:0}}class rfe{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=s}}class d3{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,s=e.length;i<s;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let s=0;for(;s+1<this.count&&this.stopOffsets[s]===this.stopOffsets[s+1];)s++;i.push(new rfe(t,this.stopOffsets[s],this.classNames.join(" "),d3._metadata(this.metadata))),t=this.stopOffsets[s]+1,this.stopOffsets.splice(0,s+1),this.classNames.splice(0,s+1),this.metadata.splice(0,s+1),this.count-=s+1}return this.count>0&&t<e&&(i.push(new rfe(t,e-1,this.classNames.join(" "),d3._metadata(this.metadata))),t=e),t}insert(e,t,i){if(this.count===0||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let s=0;s<this.count;s++)if(this.stopOffsets[s]>=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class $Ct{static normalize(e,t){if(t.length===0)return[];let i=[];const s=new d3;let o=0;for(let r=0,a=t.length;r<a;r++){const c=t[r];let u=c.startColumn,d=c.endColumn;const f=c.className,g=c.type===1?2:c.type===2?4:0;if(u>1){const v=e.charCodeAt(u-2);yl(v)&&u--}if(d>1){const v=e.charCodeAt(d-2);yl(v)&&d--}const p=u-1,_=d-2;o=s.consumeLowerThan(p,o,i),s.count===0&&(o=p),s.insert(_,f,g)}return s.consumeLowerThan(1073741824,o,i),i}}class ll{constructor(e,t,i){this._linePartBrand=void 0,this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class xCt{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Hw{constructor(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v,C,y,w,I){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=u.sort(Ed.compare),this.tabSize=d,this.startVisibleColumn=f,this.spaceWidth=g,this.stopRenderingLineAfter=v,this.renderWhitespace=C==="all"?4:C==="boundary"?1:C==="selection"?2:C==="trailing"?3:0,this.renderControlCharacters=y,this.fontLigatures=w,this.selectionsOnLine=I&&I.sort((A,N)=>A.startOffset<N.startOffset?-1:1);const L=Math.abs(_-g),O=Math.abs(p-g);L<O?(this.renderSpaceWidth=_,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=p,this.renderSpaceCharCode=183)}sameSelection(e){if(this.selectionsOnLine===null)return e===null;if(e===null||e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&Ed.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class Qne{constructor(e,t){this.partIndex=e,this.charIndex=t}}class fm{constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._absoluteOffsets=new Uint32Array(this.length)}static getPartIndex(e){return(e&4294901760)>>>16}static getCharIndex(e){return(e&65535)>>>0}setColumnInfo(e,t,i,s){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._absoluteOffsets[e-1]=s+i}getAbsoluteOffset(e){return this._absoluteOffsets.length===0?0:this._absoluteOffsets[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=fm.getPartIndex(t),s=fm.getCharIndex(t);return new Qne(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;let s=(e<<16|i<<0)>>>0,o=0,r=this.length-1;for(;o+1<r;){let v=o+r>>>1,C=this._data[v];if(C===s)return v;C>s?r=v:o=v}if(o===r)return o;let a=this._data[o],c=this._data[r];if(a===s)return o;if(c===s)return r;let u=fm.getPartIndex(a),d=fm.getCharIndex(a),f=fm.getPartIndex(c),g;u!==f?g=t:g=fm.getCharIndex(c);let p=i-d,_=g-i;return p<=_?o:r}}class Bq{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function t6(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendASCIIString("<span>");let t=0,i=0,s=0;for(const r of n.lineDecorations)(r.type===1||r.type===2)&&(e.appendASCIIString('<span class="'),e.appendASCIIString(r.className),e.appendASCIIString('"></span>'),r.type===1&&(s|=1,t++),r.type===2&&(s|=2,i++));e.appendASCIIString("</span>");const o=new fm(1,t+i);return o.setColumnInfo(1,t,0,0),new Bq(o,!1,s)}return e.appendASCIIString("<span><span></span></span>"),new Bq(new fm(0,0),!1,0)}return zCt(BCt(n),e)}class PCt{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function n6(n){let e=Y0(1e4),t=t6(n,e);return new PCt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class FCt{constructor(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=f,this.spaceWidth=g,this.renderSpaceCharCode=p,this.renderWhitespace=_,this.renderControlCharacters=v}}function BCt(n){const e=n.lineContent;let t,i;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter<e.length?(t=!0,i=n.stopRenderingLineAfter):(t=!1,i=e.length);let s=HCt(n.lineTokens,n.fauxIndentLength,i);(n.renderWhitespace===4||n.renderWhitespace===1||n.renderWhitespace===2&&n.selectionsOnLine||n.renderWhitespace===3)&&(s=WCt(n,e,i,s));let o=0;if(n.lineDecorations.length>0){for(let r=0,a=n.lineDecorations.length;r<a;r++){const c=n.lineDecorations[r];c.type===3||c.type===1?o|=1:c.type===2&&(o|=2)}s=GCt(e,i,s,n.lineDecorations)}return n.containsRTL||(s=VCt(e,s,!n.isBasicASCII||n.fontLigatures)),n.renderControlCharacters&&!n.isBasicASCII&&(s=UCt(e,s)),new FCt(n.useMonospaceOptimizations,n.canUseHalfwidthRightwardsArrow,e,i,t,s,o,n.fauxIndentLength,n.tabSize,n.startVisibleColumn,n.containsRTL,n.spaceWidth,n.renderSpaceCharCode,n.renderWhitespace,n.renderControlCharacters)}function HCt(n,e,t){let i=[],s=0;e>0&&(i[s++]=new ll(e,"",0));for(let o=0,r=n.getCount();o<r;o++){const a=n.getEndOffset(o);if(a<=e)continue;const c=n.getClassName(o);if(a>=t){i[s++]=new ll(t,c,0);break}i[s++]=new ll(a,c,0)}return i}function VCt(n,e,t){let i=0,s=[],o=0;if(t)for(let r=0,a=e.length;r<a;r++){const c=e[r],u=c.endIndex;if(i+50<u){const d=c.type,f=c.metadata;let g=-1,p=i;for(let _=i;_<u;_++)n.charCodeAt(_)===32&&(g=_),g!==-1&&_-p>=50&&(s[o++]=new ll(g+1,d,f),p=g+1,g=-1);p!==u&&(s[o++]=new ll(u,d,f))}else s[o++]=c;i=u}else for(let r=0,a=e.length;r<a;r++){const c=e[r],u=c.endIndex;let d=u-i;if(d>50){const f=c.type,g=c.metadata,p=Math.ceil(d/50);for(let _=1;_<p;_++){let v=i+_*50;s[o++]=new ll(v,f,g)}s[o++]=new ll(u,f,g)}else s[o++]=c;i=u}return s}function WLe(n){return n<32?n!==9:n===127||n>=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function UCt(n,e){let t=[],i=new ll(0,"",0),s=0;for(const o of e){const r=o.endIndex;for(;s<r;s++){const a=n.charCodeAt(s);WLe(a)&&(s>i.endIndex&&(i=new ll(s,o.type,o.metadata),t.push(i)),i=new ll(s+1,"mtkcontrol",o.metadata),t.push(i))}s>i.endIndex&&(i=new ll(r,o.type,o.metadata),t.push(i))}return t}function WCt(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,c=n.useMonospaceOptimizations,u=n.selectionsOnLine,d=n.renderWhitespace===1,f=n.renderWhitespace===3,g=n.renderSpaceWidth!==n.spaceWidth;let p=[],_=0,v=0,C=i[v].type,y=i[v].endIndex;const w=i.length;let I=!1,L=cc(e),O;L===-1?(I=!0,L=t,O=t):O=Fm(e);let A=!1,N=0,D=u&&u[N],P=a%r;for(let V=o;V<t;V++){const U=e.charCodeAt(V);D&&V>=D.endOffset&&(N++,D=u&&u[N]);let Q;if(V<L||V>O)Q=!0;else if(U===9)Q=!0;else if(U===32)if(d)if(A)Q=!0;else{const de=V+1<t?e.charCodeAt(V+1):0;Q=de===32||de===9}else Q=!0;else Q=!1;if(Q&&u&&(Q=!!D&&D.startOffset<=V&&D.endOffset>V),Q&&f&&(Q=I||V>O),A){if(!Q||!c&&P>=r){if(g){const de=_>0?p[_-1].endIndex:o;for(let q=de+1;q<=V;q++)p[_++]=new ll(q,"mtkw",1)}else p[_++]=new ll(V,"mtkw",1);P=P%r}}else(V===y||Q&&V>o)&&(p[_++]=new ll(V,C,0),P=P%r);for(U===9?P=r:Gg(U)?P+=2:P++,A=Q;V===y&&(v++,v<w);)C=i[v].type,y=i[v].endIndex}let F=!1;if(A)if(s&&d){let V=t>0?e.charCodeAt(t-1):0,U=t>1?e.charCodeAt(t-2):0;V===32&&U!==32&&U!==9||(F=!0)}else F=!0;if(F)if(g){const V=_>0?p[_-1].endIndex:o;for(let U=V+1;U<=t;U++)p[_++]=new ll(U,"mtkw",1)}else p[_++]=new ll(t,"mtkw",1);else p[_++]=new ll(t,C,0);return p}function GCt(n,e,t,i){i.sort(Ed.compare);const s=$Ct.normalize(n,i),o=s.length;let r=0,a=[],c=0,u=0;for(let f=0,g=t.length;f<g;f++){const p=t[f],_=p.endIndex,v=p.type,C=p.metadata;for(;r<o&&s[r].startOffset<_;){const y=s[r];if(y.startOffset>u&&(u=y.startOffset,a[c++]=new ll(u,v,C)),y.endOffset+1<=_)u=y.endOffset+1,a[c++]=new ll(u,v+" "+y.className,C|y.metadata),r++;else{u=_,a[c++]=new ll(u,v+" "+y.className,C|y.metadata);break}}_>u&&(u=_,a[c++]=new ll(u,v,C))}const d=t[t.length-1].endIndex;if(r<o&&s[r].startOffset===d)for(;r<o&&s[r].startOffset===d;){const f=s[r];a[c++]=new ll(u,f.className,f.metadata),r++}return a}function zCt(n,e){const t=n.fontIsMonospace,i=n.canUseHalfwidthRightwardsArrow,s=n.containsForeignElements,o=n.lineContent,r=n.len,a=n.isOverflowing,c=n.parts,u=n.fauxIndentLength,d=n.tabSize,f=n.startVisibleColumn,g=n.containsRTL,p=n.spaceWidth,_=n.renderSpaceCharCode,v=n.renderWhitespace,C=n.renderControlCharacters,y=new fm(r+1,c.length);let w=!1,I=0,L=f,O=0,A=0,N=0,D=0;g?e.appendASCIIString('<span dir="ltr">'):e.appendASCIIString("<span>");for(let P=0,F=c.length;P<F;P++){D+=N;const V=c[P],U=V.endIndex,Q=V.type,de=v!==0&&V.isWhitespace(),q=de&&!t&&(Q==="mtkw"||!s),K=I===U&&V.isPseudoAfter();if(O=0,e.appendASCIIString('<span class="'),e.appendASCIIString(q?"mtkz":Q),e.appendASCII(34),de){let re=0;{let Z=I,J=L;for(;Z<U;Z++){const ve=(o.charCodeAt(Z)===9?d-J%d:1)|0;re+=ve,Z>=u&&(J+=ve)}}for(q&&(e.appendASCIIString(' style="width:'),e.appendASCIIString(String(p*re)),e.appendASCIIString('px"')),e.appendASCII(62);I<U;I++){y.setColumnInfo(I+1,P-A,O,D),A=0;const Z=o.charCodeAt(I);let J;if(Z===9){J=d-L%d|0,!i||J>1?e.write1(8594):e.write1(65515);for(let ge=2;ge<=J;ge++)e.write1(160)}else J=1,e.write1(_);O+=J,I>=u&&(L+=J)}N=re}else{let re=0;for(e.appendASCII(62);I<U;I++){y.setColumnInfo(I+1,P-A,O,D),A=0;const Z=o.charCodeAt(I);let J=1,ge=1;switch(Z){case 9:J=d-L%d,ge=J;for(let ve=1;ve<=J;ve++)e.write1(160);break;case 32:e.write1(160);break;case 60:e.appendASCIIString("<");break;case 62:e.appendASCIIString(">");break;case 38:e.appendASCIIString("&");break;case 0:C?e.write1(9216):e.appendASCIIString("�");break;case 65279:case 8232:case 8233:case 133:e.write1(65533);break;default:Gg(Z)&&ge++,C&&Z<32?e.write1(9216+Z):C&&Z===127?e.write1(9249):C&&WLe(Z)?(e.appendASCIIString("[U+"),e.appendASCIIString(KCt(Z)),e.appendASCIIString("]"),J=8):e.write1(Z)}O+=J,re+=J,I>=u&&(L+=ge)}N=re}K?A++:A=0,I>=r&&!w&&V.isPseudoAfter()&&(w=!0,y.setColumnInfo(I+1,P,O,D)),e.appendASCIIString("</span>")}return w||y.setColumnInfo(r+1,c.length-1,O,D),a&&e.appendASCIIString("<span>…</span>"),e.appendASCIIString("</span>"),new Bq(y,g,s)}function KCt(n){return n.toString(16).toUpperCase().padStart(4,"0")}class lfe{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class jCt{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e,t){const i=this.outputLineIndex>0?t:0;return new ct(e+this.outputLineIndex,i+this.outputOffset+1)}}class XD{constructor(e,t,i,s,o){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i,this.injectionOffsets=s,this.injectionOptions=o}getInputOffsetOfOutputPosition(e,t){let i=0;if(e===0?i=t:i=this.breakOffsets[e-1]+t,this.injectionOffsets!==null)for(let s=0;s<this.injectionOffsets.length&&i>this.injectionOffsets[s];s++)i<this.injectionOffsets[s]+this.injectionOptions[s].content.length?i=this.injectionOffsets[s]:i-=this.injectionOptions[s].content.length;return i}getOutputPositionOfInputOffset(e,t=2){let i=0;if(this.injectionOffsets!==null)for(let s=0;s<this.injectionOffsets.length&&!(e<this.injectionOffsets[s]||t!==1&&e===this.injectionOffsets[s]);s++)i+=this.injectionOptions[s].content.length;return e+=i,this.getOutputPositionOfOffsetInUnwrappedLine(e,t)}getOutputPositionOfOffsetInUnwrappedLine(e,t=2){let i=0,s=this.breakOffsets.length-1,o=0,r=0;for(;i<=s;){o=i+(s-i)/2|0;const a=this.breakOffsets[o];if(r=o>0?this.breakOffsets[o-1]:0,t===0)if(e<=r)s=o-1;else if(e>a)i=o+1;else break;else if(e<r)s=o-1;else if(e>=a)i=o+1;else break}return new jCt(o,e-r)}outputPositionToOffsetInUnwrappedLine(e,t){let i=(e>0?this.breakOffsets[e-1]:0)+t;return e>0&&(i-=this.wrappedTextIndentLength),i}normalizeOffsetAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2)return e===i.offsetInUnwrappedLine+i.length?i.offsetInUnwrappedLine+i.length:i.offsetInUnwrappedLine;if(t===1){let r=i.offsetInUnwrappedLine+i.length,a=i.injectedTextIndex;for(;a+1<this.injectionOffsets.length&&this.injectionOffsets[a+1]===this.injectionOffsets[a];)r+=this.injectionOptions[a+1].content.length,a++;return r}let s=i.offsetInUnwrappedLine,o=i.injectedTextIndex;for(;o-1>=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o++;return s}getInjectedText(e,t){const i=this.outputPositionToOffsetInUnwrappedLine(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;o<t.length;o++){const r=i[o].content.length,a=t[o]+s,c=t[o]+s+r;if(a>e)break;if(e<=c)return{injectedTextIndex:o,offsetInUnwrappedLine:a,length:r};s+=r}}}}class XCt{constructor(e,t){this.tabSize=e,this.data=t}}class Zne{constructor(e,t,i,s,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class Dd{constructor(e,t,i,s,o,r,a,c,u,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=Dd.isBasicASCII(i,r),this.containsRTL=Dd.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=c,this.tabSize=u,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?Dne(e):!0}static containsRTL(e,t,i){return!t&&i?z8(e):!1}}class YD{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class YCt{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new YD(new be(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class GLe{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class zLe{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}}function qCt(n){return Array.isArray(n)}function JCt(n){return!qCt(n)}function KLe(n){return typeof n=="string"}function afe(n){return!KLe(n)}function O1(n){return!n}function DC(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function cfe(n){return n.replace(/[&<>'"_]/g,"-")}function QCt(n,e){console.log(`${n.languageId}: ${e}`)}function Qs(n,e){return new Error(`${n.languageId}: ${e}`)}function aC(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,c,u,d,f,g,p,_,v){return O1(u)?O1(d)?!O1(f)&&f<i.length?DC(n,i[f]):!O1(p)&&n&&typeof n[p]=="string"?n[p]:(r===null&&(r=s.split("."),r.unshift(s)),!O1(g)&&g<r.length?DC(n,r[g]):""):DC(n,t):"$"})}function KH(n,e){let t=e;for(;t&&t.length>0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function ZCt(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}const jLe=5;class Mx{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new TO(e,t);let i=TO.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new TO(e,t),this._entries[i]=s,s)}}Mx._INSTANCE=new Mx(jLe);class TO{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return TO._equals(this,e)}push(e){return Mx.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Mx.create(this.parent,e)}}class qD{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new qD(this.languageId,this.state)}}class cC{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(t!==null)return new JD(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new JD(e,t);let i=TO.getStackElementId(e),s=this._entries[i];return s||(s=new JD(e,null),this._entries[i]=s,s)}}cC._INSTANCE=new cC(jLe);class JD{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:cC.create(this.stack,this.embeddedModeData)}equals(e){return!(e instanceof JD)||!this.stack.equals(e.stack)?!1:this.embeddedModeData===null&&e.embeddedModeData===null?!0:this.embeddedModeData===null||e.embeddedModeData===null?!1:this.embeddedModeData.equals(e.embeddedModeData)}}class eyt{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterMode(e,t){this._languageId=t}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new H8(e,t,this._languageId)))}nestedModeTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=$o.get(o);if(!a)return this.enterMode(s,o),this.emit(s,""),r;let c=a.tokenize(e,t,r,s);return this._tokens=this._tokens.concat(c.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,c.endState}finalize(e){return new Ene(this._tokens,e)}}class h3{constructor(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterMode(e,t){this._currentLanguageId=this._modeService.languageIdCodec.encodeLanguageId(t)}emit(e,t){let i=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){let s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;let a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let c=0;c<o;c++)a[s+c]=t[c];return i!==null&&a.set(i,s+o),a}nestedModeTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=$o.get(o);if(!a)return this.enterMode(s,o),this.emit(s,""),r;let c=a.tokenize2(e,t,r,s);return this._prependTokens=h3._merge(this._prependTokens,this._tokens,c.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,c.endState}finalize(e){return new V8(h3._merge(this._prependTokens,this._tokens,null),e)}}class i6{constructor(e,t,i,s){this._modeService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=s,this._embeddedModes=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._tokenizationRegistryListener=$o.onDidChange(r=>{if(o)return;let a=!1;for(let c=0,u=r.changedLanguages.length;c<u;c++){let d=r.changedLanguages[c];if(this._embeddedModes[d]){a=!0;break}}a&&(o=!0,$o.fire([this._languageId]),o=!1)})}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){let e=[];for(let t in this._embeddedModes){const i=$o.get(t);if(i){if(i instanceof i6){const o=i.getLoadStatus();o.loaded===!1&&e.push(o.promise)}continue}const s=$o.getPromise(t);s&&e.push(s)}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){let e=Mx.create(null,this._lexer.start);return cC.create(e,null)}tokenize(e,t,i,s){let o=new eyt,r=this._tokenize(e,t,i,s,o);return o.finalize(r)}tokenize2(e,t,i,s){let o=new h3(this._modeService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,i,s,o);return o.finalize(r)}_tokenize(e,t,i,s,o){return i.embeddedModeData?this._nestedTokenize(e,t,i,s,o):this._myTokenize(e,t,i,s,o)}_findLeavingNestedModeOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=KH(this._lexer,t.stack.state),!i))throw Qs(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!afe(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.regex,c=r.regex.source;if(c.substr(0,4)==="^(?:"&&c.substr(c.length-1,1)===")"){let d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(c.substr(4,c.length-5),d)}let u=e.search(a);u===-1||u!==0&&r.matchOnlyAtLineStart||(s===-1||u<s)&&(s=u)}if(!o)throw Qs(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return s}_nestedTokenize(e,t,i,s,o){let r=this._findLeavingNestedModeOffset(e,i);if(r===-1){let u=o.nestedModeTokenize(e,t,i.embeddedModeData,s);return cC.create(i.stack,new qD(i.embeddedModeData.languageId,u))}let a=e.substring(0,r);a.length>0&&o.nestedModeTokenize(a,!1,i.embeddedModeData,s);let c=e.substring(r);return this._myTokenize(c,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterMode(s,this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+`
- `:e,c=a.length;let u=i.embeddedModeData,d=i.stack,f=0,g=null,p=!0;for(;p||f<c;){const _=f,v=d.depth,C=g?g.groups.length:0,y=d.state;let w=null,I=null,L=null,O=null,A=null;if(g){w=g.matches;const P=g.groups.shift();I=P.matched,L=P.action,O=g.rule,g.groups.length===0&&(g=null)}else{if(!p&&f>=c)break;p=!1;let P=this._lexer.tokenizer[y];if(!P&&(P=KH(this._lexer,y),!P))throw Qs(this._lexer,"tokenizer state is not defined: "+y);let F=a.substr(f);for(const V of P)if((f===0||!V.matchOnlyAtLineStart)&&(w=F.match(V.regex),w)){I=w[0],L=V.action;break}}if(w||(w=[""],I=""),L||(f<c&&(w=[a.charAt(f)],I=w[0]),L=this._lexer.defaultToken),I===null)break;for(f+=I.length;JCt(L)&&afe(L)&&L.test;)L=L.test(I,w,y,f===c);let N=null;if(typeof L=="string"||Array.isArray(L))N=L;else if(L.group)N=L.group;else if(L.token!==null&&L.token!==void 0){if(L.tokenSubst?N=aC(this._lexer,L.token,I,w,y):N=L.token,L.nextEmbedded)if(L.nextEmbedded==="@pop"){if(!u)throw Qs(this._lexer,"cannot pop embedded mode if not inside one");u=null}else{if(u)throw Qs(this._lexer,"cannot enter embedded mode from within an embedded mode");A=aC(this._lexer,L.nextEmbedded,I,w,y)}if(L.goBack&&(f=Math.max(0,f-L.goBack)),L.switchTo&&typeof L.switchTo=="string"){let P=aC(this._lexer,L.switchTo,I,w,y);if(P[0]==="@"&&(P=P.substr(1)),KH(this._lexer,P))d=d.switchTo(P);else throw Qs(this._lexer,"trying to switch to a state '"+P+"' that is undefined in rule: "+this._safeRuleName(O))}else{if(L.transform&&typeof L.transform=="function")throw Qs(this._lexer,"action.transform not supported");if(L.next)if(L.next==="@push"){if(d.depth>=this._lexer.maxStack)throw Qs(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(y)}else if(L.next==="@pop"){if(d.depth<=1)throw Qs(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(O));d=d.pop()}else if(L.next==="@popall")d=d.popall();else{let P=aC(this._lexer,L.next,I,w,y);if(P[0]==="@"&&(P=P.substr(1)),KH(this._lexer,P))d=d.push(P);else throw Qs(this._lexer,"trying to set a next state '"+P+"' that is undefined in rule: "+this._safeRuleName(O))}}L.log&&typeof L.log=="string"&&QCt(this._lexer,this._lexer.languageId+": "+aC(this._lexer,L.log,I,w,y))}if(N===null)throw Qs(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(O));const D=P=>{let F=this._modeService.getModeIdForLanguageName(P);F&&(P=F);const V=this._getNestedEmbeddedModeData(P);if(f<c){const U=e.substr(f);return this._nestedTokenize(U,t,cC.create(d,V),s+f,o)}else return cC.create(d,V)};if(Array.isArray(N)){if(g&&g.groups.length>0)throw Qs(this._lexer,"groups cannot be nested: "+this._safeRuleName(O));if(w.length!==N.length+1)throw Qs(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(O));let P=0;for(let F=1;F<w.length;F++)P+=w[F].length;if(P!==I.length)throw Qs(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(O));g={rule:O,matches:w,groups:[]};for(let F=0;F<N.length;F++)g.groups[F]={action:N[F],matched:w[F+1]};f-=I.length;continue}else{if(N==="@rematch"&&(f-=I.length,I="",w=null,N="",A!==null))return D(A);if(I.length===0){if(c===0||v!==d.depth||y!==d.state||(g?g.groups.length:0)!==C)continue;throw Qs(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(O))}let P=null;if(KLe(N)&&N.indexOf("@brackets")===0){let F=N.substr(9),V=tyt(this._lexer,I);if(!V)throw Qs(this._lexer,"@brackets token returned but no bracket defined as: "+I);P=cfe(V.token+F)}else{let F=N===""?"":N+this._lexer.tokenPostfix;P=cfe(F)}_<r&&o.emit(_+s,P)}if(A!==null)return D(A)}return cC.create(d,u)}_getNestedEmbeddedModeData(e){let t=this._locateMode(e);if(t){let i=$o.get(t);if(i)return new qD(t,i.getInitialState())}return new qD(t||ly,CF)}_locateMode(e){if(!e||!this._modeService.isRegisteredMode(e))return null;if(e===this._languageId)return e;const t=this._modeService.getModeId(e);return t&&(this._modeService.triggerMode(t),this._embeddedModes[t]=!0),t}}function tyt(n,e){if(!e)return null;e=DC(n,e);let t=n.brackets;for(const i of t){if(i.open===e)return{token:i.token,bracketType:1};if(i.close===e)return{token:i.token,bracketType:-1}}return null}function nyt(n,e,t,i){return new i6(n,e,t,i)}var K9;const j9=(K9=window.trustedTypes)===null||K9===void 0?void 0:K9.createPolicy("standaloneColorizer",{createHTML:n=>n});class eie{static colorizeElement(e,t,i,s){s=s||{};let o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();e.setTheme(o);let a=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;let c=u=>{var d;const f=(d=j9==null?void 0:j9.createHTML(u))!==null&&d!==void 0?d:u;i.innerHTML=f};return this.colorize(t,a||"",r,s).then(c,u=>console.error(u))}static colorize(e,t,i,s){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),$ne(t)&&(t=t.substr(1));let a=Jm(t),c=e.getModeId(i);if(!c)return Promise.resolve(ufe(a,r,o));e.triggerMode(c);const u=$o.get(c);if(u)return X9(a,r,u,o);const d=$o.getPromise(c);return d?new Promise((f,g)=>{d.then(p=>{X9(a,r,p,o).then(f,g)},g)}):new Promise((f,g)=>{let p=null,_=null;const v=()=>{p&&(p.dispose(),p=null),_&&(_.dispose(),_=null);const C=$o.get(c);if(C){X9(a,r,C,o).then(f,g);return}f(ufe(a,r,o))};_=new mc,_.cancelAndSet(v,500),p=$o.onDidChange(C=>{C.changedLanguages.indexOf(c)>=0&&v()})})}static colorizeLine(e,t,i,s,o=4){const r=Dd.isBasicASCII(e,t),a=Dd.containsRTL(e,r,i);return n6(new Hw(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){let s=e.getLineContent(t);e.forceTokenization(t);let r=e.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function X9(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=iyt(n,e,t,i);if(t instanceof i6){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}s(a)};r()})}function ufe(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=16793600;for(let r=0,a=n.length;r<a;r++){let c=n[r];o[0]=c.length;const u=new El(o,c,t),d=Dd.isBasicASCII(c,!0),f=Dd.containsRTL(c,d,!0);let g=n6(new Hw(!1,!0,c,!1,d,f,0,u,[],e,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(g.html),i.push("<br/>")}return i.join("")}function iyt(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r<a;r++){let c=n[r],u=t.tokenize2(c,!0,o,0);El.convertToEndOffset(u.tokens,c.length);let d=new El(u.tokens,c,i);const f=Dd.isBasicASCII(c,!0),g=Dd.containsRTL(c,f,!0);let p=n6(new Hw(!1,!0,c,!1,f,g,0,d.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));s=s.concat(p.html),s.push("<br/>"),o=u.endState}return s.join("")}var kx;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(kx||(kx={}));(function(n){const e="error",t="warning",i="warn",s="info",o="ignore";function r(c){return c?cD(e,c)?n.Error:cD(t,c)||cD(i,c)?n.Warning:cD(s,c)?n.Info:n.Ignore:n.Ignore}n.fromValue=r;function a(c){switch(c){case n.Error:return e;case n.Warning:return t;case n.Info:return s;default:return o}}n.toString=a})(kx||(kx={}));const Go=kx;function Qm(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===TF.ICodeEditor:!1}function XLe(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===TF.IDiffEditor:!1}function YLe(n){return Qm(n)?n:XLe(n)?n.getModifiedEditor():null}const tie=ss("IWorkspaceEditService");function syt(n){return jc(n)&&(!!n.newUri||!!n.oldUri)}function oyt(n){return jc(n)&&Jn.isUri(n.resource)&&jc(n.edit)}class s6{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(oyt(t))return new qLe(t.resource,t.edit,t.modelVersionId,t.metadata);if(syt(t))return new ryt(t.oldUri,t.newUri,t.options,t.metadata);throw new Error("Unsupported edit")})}}class qLe extends s6{constructor(e,t,i,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class ryt extends s6{constructor(e,t,i,s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const lyt=Object.prototype.hasOwnProperty;function ayt(n,e){for(let t in n)if(lyt.call(n,t)&&e({key:t,value:n[t]},function(){delete n[t]})===!1)return}class cyt{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}const f3=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new rt,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(n){this._tabFocus!==n&&(this._tabFocus=n,this._onDidChangeTabFocus.fire(this._tabFocus))}},JLe=Object.hasOwnProperty;class uyt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class dyt{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Iv{static readOptions(e){const t=e,i=new dyt;for(const s of B1){const o=s.name==="_never_"?void 0:t[s.name];i._write(s.id,o)}return i}static validateOptions(e){const t=new l_t;for(const i of B1)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new uyt;for(const s of B1)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object")return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?xf(e,t):!1;for(let i in e)if(!Iv._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of B1){const r=!Iv._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new LIe(i):null}}function hyt(n){const e=n.wordWrap;e===!0?n.wordWrap="on":e===!1&&(n.wordWrap="off");const t=n.lineNumbers;t===!0?n.lineNumbers="on":t===!1&&(n.lineNumbers="off"),n.autoClosingBrackets===!1&&(n.autoClosingBrackets="never",n.autoClosingQuotes="never",n.autoSurround="never"),n.cursorBlinking==="visible"&&(n.cursorBlinking="solid");const o=n.renderWhitespace;o===!0?n.renderWhitespace="boundary":o===!1&&(n.renderWhitespace="none");const r=n.renderLineHighlight;r===!0?n.renderLineHighlight="line":r===!1&&(n.renderLineHighlight="none");const a=n.acceptSuggestionOnEnter;a===!0?n.acceptSuggestionOnEnter="on":a===!1&&(n.acceptSuggestionOnEnter="off");const c=n.tabCompletion;c===!1?n.tabCompletion="off":c===!0&&(n.tabCompletion="onlySnippets");const u=n.suggest;if(u&&typeof u.filteredTypes=="object"&&u.filteredTypes){const C={};C.method="showMethods",C.function="showFunctions",C.constructor="showConstructors",C.deprecated="showDeprecated",C.field="showFields",C.variable="showVariables",C.class="showClasses",C.struct="showStructs",C.interface="showInterfaces",C.module="showModules",C.property="showProperties",C.event="showEvents",C.operator="showOperators",C.unit="showUnits",C.value="showValues",C.constant="showConstants",C.enum="showEnums",C.enumMember="showEnumMembers",C.keyword="showKeywords",C.text="showWords",C.color="showColors",C.file="showFiles",C.reference="showReferences",C.folder="showFolders",C.typeParameter="showTypeParameters",C.snippet="showSnippets",ayt(C,y=>{const w=u.filteredTypes[y.key];w===!1&&(u[y.value]=w)})}const d=n.hover;d===!0?n.hover={enabled:!0}:d===!1&&(n.hover={enabled:!1});const f=n.parameterHints;f===!0?n.parameterHints={enabled:!0}:f===!1&&(n.parameterHints={enabled:!1});const g=n.autoIndent;g===!0?n.autoIndent="full":g===!1&&(n.autoIndent="advanced");const p=n.matchBrackets;p===!0?n.matchBrackets="always":p===!1&&(n.matchBrackets="never");const{renderIndentGuides:_,highlightActiveIndentGuide:v}=n;n.guides||(n.guides={}),_!==void 0&&(n.guides.indentation=!!_),v!==void 0&&(n.guides.highlightActiveIndentation=!!v)}function dfe(n){const e=lC(n);return hyt(e),e}class g3 extends wt{constructor(e,t){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new rt),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new OIe,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=dfe(t),this._readOptions=Iv.readOptions(this._rawOptions),this._validatedOptions=Iv.validateOptions(this._readOptions),this._register(fb.onDidChangeZoomLevel(i=>this._recomputeOptions())),this._register(f3.onDidChangeTabFocus(i=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(!e)this.options=t;else{const i=Iv.checkEquals(e,t);if(i===null)return;this.options=t,this._onDidChangeFast.fire(i),this._onDidChange.fire(i)}}getRawOptions(){return this._rawOptions}_computeInternalOptions(){const e=this._getEnvConfiguration(),t=g0.createFromValidatedSettings(this._validatedOptions,e.zoomLevel,e.pixelRatio,this.isSimpleWidget),i={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,fontInfo:this.readConfiguration(t),extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:f3.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return Iv.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(JLe.call(t,i)){const s=t[i],o=e[i];if(o===s)continue;if(Array.isArray(o)&&Array.isArray(s)){if(!xf(o,s))return!1;continue}if(o&&typeof o=="object"&&s&&typeof s=="object"){if(!this._subsetEquals(o,s))return!1;continue}return!1}return!0}updateOptions(e){if(typeof e>"u")return;const t=dfe(e);g3._subsetEquals(this._rawOptions,t)||(this._rawOptions=mp(this._rawOptions,t||{}),this._readOptions=Iv.readOptions(this._rawOptions),this._validatedOptions=Iv.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=g3._digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}static _digitCount(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}}const fyt=Object.freeze({id:"editor",order:5,type:"object",title:$("editorConfigurationTitle","Editor"),scope:5}),gyt=br.as(Fw.Configuration),p3=Object.assign(Object.assign({},fyt),{properties:{"editor.tabSize":{type:"number",default:$a.tabSize,minimum:1,markdownDescription:$("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:$a.insertSpaces,markdownDescription:$("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:$a.detectIndentation,markdownDescription:$("detectIndentation","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:$a.trimAutoWhitespace,description:$("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:$a.largeFileOptimizations,description:$("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:$("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[$("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),$("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),$("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:$("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[$("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),$("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),$("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:$("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:$("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:$("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:"array",default:!1,description:$("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:$("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:$("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:"array",default:!1,description:$("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:$("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:$("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:$("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:$("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:$("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:$("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:$("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:$("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[$("wordWrap.off","Lines will never wrap."),$("wordWrap.on","Lines will wrap at the viewport width."),$("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function pyt(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of B1){const e=n.schema;if(typeof e<"u")if(pyt(e))p3.properties[`editor.${n.name}`]=e;else for(let t in e)JLe.call(e,t)&&(p3.properties[t]=e[t])}let jH=null;function QLe(){return jH===null&&(jH=Object.create(null),Object.keys(p3.properties).forEach(n=>{jH[n]=!0})),jH}function myt(n){return QLe()[`editor.${n}`]||!1}function _yt(n){return QLe()[`diffEditor.${n}`]||!1}gyt.registerConfiguration(p3);class ir{static insert(e,t){return{range:new be(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class sh{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1,this.overrideConfigurations=new Map}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?eCt(this.contents,e):this.contents}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=lC(this.contents),i=lC(this.overrides),s=[...this.keys];for(const o of e){this.mergeContents(t,o.contents);for(const r of o.overrides){const[a]=i.filter(c=>xf(c.identifiers,r.identifiers));a?this.mergeContents(a.contents,r.contents):i.push(lC(r))}for(const r of o.keys)s.indexOf(r)===-1&&s.push(r)}return new sh(t,s,i)}freeze(){return this.isFrozen=!0,this}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;let i={};for(const s of u3([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s],r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=lC(o),this.mergeContents(o,r)):o=r),i[s]=o}return new sh(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&jc(e[i])&&jc(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=lC(t[i])}}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?$bt(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(t.identifiers.indexOf(e)!==-1)return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),Kne(this.contents,e,t,i=>{throw new Error(i)})}removeValue(e){this.removeKey(e)&&ZTt(this.contents,e)}addKey(e){let t=this.keys.length;for(let i=0;i<t;i++)e.indexOf(this.keys[i])===0&&(t=i);this.keys.splice(t,1,e)}removeKey(e){let t=this.keys.indexOf(e);return t!==-1?(this.keys.splice(t,1),!0):!1}}class vyt extends sh{constructor(){const e=nCt(),t=tCt(),i=[];for(const s of Object.keys(e))zne.test(s)&&i.push({identifiers:[qTt(s).trim()],keys:Object.keys(e[s]),contents:kLe(e[s],o=>console.error(`Conflict in default settings file: ${o}`))});super(e,t,i)}}let ZLe=class e1e{constructor(e,t,i=new sh,s=new sh,o=new Fa,r=new sh,a=new Fa,c=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=i,this._workspaceConfiguration=s,this._folderConfigurations=o,this._memoryConfiguration=r,this._memoryConfigurationByResource=a,this._freeze=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Fa,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidateConfigurationModel(t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=new sh,this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}getConsolidateConfigurationModel(e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?i.override(e.overrideIdentifier):i}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),o=e.folders.reduce((r,a)=>(r.set(Jn.revive(a[0]),this.parseConfigurationModel(a[1])),r),new Fa);return new e1e(t,i,new sh,s,o,new sh,new Fa,!1)}static parseConfigurationModel(e){return new sh(e.contents,e.keys,e.overrides).freeze()}};class byt{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach(a=>o.add(a)),e.overrides.forEach(([,a])=>a.forEach(c=>o.add(c))),this.affectedKeys=[...o.values()];const r=new sh;this.affectedKeys.forEach(a=>r.setValue(a,{})),this.affectedKeysTree=r.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=ZLe.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){const s=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,o=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!zg(s,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i=kLe({[t]:!0},()=>{}),s;for(;typeof i=="object"&&(s=Object.keys(i)[0]);){if(e=e[s],!e)return!1;i=i[s]}return!0}}const Tyt=/^(cursor|delete)/;class Cyt extends wt{constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new rt),this._currentChord=null,this._currentChordChecker=new vF,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=G1.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new mc,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Ln.None}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){const i=this.resolveKeyboardEvent(e);if(i.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),null;const[s]=i.getDispatchParts();if(s===null)return null;const o=this._contextKeyService.getContext(t),r=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,r,s)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status($("first.chord","({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-i>5e3&&this._leaveChordMode()},500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchParts();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=G1.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=G1.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getParts();return this._ignoreSingleModifiers=new G1(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchParts();o=d,r=d}else[o]=e.getDispatchParts(),r=this._currentChord?this._currentChord.keypress:null;if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(a,r,o);return this._logService.trace("KeybindingService#dispatch",c,u==null?void 0:u.commandId),u&&u.enterChord?(s=!0,this._enterChordMode(o,c),s):(this._currentChord&&(!u||!u.commandId)&&(this._notificationService.status($("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,c),{hideAfter:10*1e3}),s=!0),this._leaveChordMode(),u&&u.commandId&&(u.bubble||(s=!0),typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d)),Tyt.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding"})),s)}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class G1{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}G1.EMPTY=new G1(null);let o6=i_t||"";const ya=new Map;ya.set("false",!1);ya.set("true",!0);ya.set("isMac",ki);ya.set("isLinux",Qc);ya.set("isWindows",zl);ya.set("isWeb",hM);ya.set("isMacNative",ki&&!hM);ya.set("isEdge",o6.indexOf("Edg/")>=0);ya.set("isFirefox",o6.indexOf("Firefox")>=0);ya.set("isChrome",o6.indexOf("Chrome")>=0);ya.set("isSafari",o6.indexOf("Safari")>=0);const yyt=Object.prototype.hasOwnProperty;class dn{static has(e){return ay.create(e)}static equals(e,t){return vR.create(e,t)}static regex(e,t){return m3.create(e,t)}static not(e){return J0.create(e)}static and(...e){return TC.create(e,null)}static or(...e){return zv.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return zv.create(i.map(s=>this._deserializeAndExpression(s,t)),null,!0)}static _deserializeAndExpression(e,t){let i=e.split("&&");return TC.create(i.map(s=>this._deserializeOne(s,t)),null)}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return r6.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return vR.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return m3.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let i=e.split(" in ");return nie.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const i=e.split(">=");return c6.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const i=e.split(">");return a6.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const i=e.split("<=");return d6.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const i=e.split("<");return u6.create(i[0].trim(),i[1].trim())}return/^\!\s*/.test(e)?J0.create(e.substr(1).trim()):ay.create(e)}static _deserializeValue(e,t){if(e=e.trim(),e==="true")return!0;if(e==="false")return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(tLe(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let i=e.indexOf("/"),s=e.lastIndexOf("/");if(i===s||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let o=e.slice(i+1,s),r=e[s+1]==="i"?"i":"";try{return new RegExp(o,r)}catch(a){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${a}`);return console.warn(`bad regexp-value '${e}', parse error: ${a}`),null}}}function Eyt(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function CO(n,e){return n.cmp(e)}class $d{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return wh.INSTANCE}}$d.INSTANCE=new $d;class wh{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return $d.INSTANCE}}wh.INSTANCE=new wh;class ay{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const i=ya.get(e);return typeof i=="boolean"?i?wh.INSTANCE:$d.INSTANCE:new ay(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:n1e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=ya.get(this.key);return typeof e=="boolean"?e?wh.INSTANCE:$d.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=J0.create(this.key,this)),this.negated}}class vR{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}static create(e,t,i=null){if(typeof t=="boolean")return t?ay.create(e,i):J0.create(e,i);const s=ya.get(e);return typeof s=="boolean"?t===(s?"true":"false")?wh.INSTANCE:$d.INSTANCE:new vR(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=ya.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?wh.INSTANCE:$d.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r6.create(this.key,this.value,this)),this.negated}}class nie{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new nie(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:typeof i=="string"&&typeof t=="object"&&t!==null?yyt.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=iie.create(this)),this.negated}}class iie{constructor(e){this._actual=e,this.type=11}static create(e){return new iie(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class r6{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}static create(e,t,i=null){if(typeof t=="boolean")return t?J0.create(e,i):ay.create(e,i);const s=ya.get(e);return typeof s=="boolean"?t===(s?"true":"false")?$d.INSTANCE:wh.INSTANCE:new r6(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=ya.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?$d.INSTANCE:wh.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=vR.create(this.key,this.value,this)),this.negated}}class J0{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const i=ya.get(e);return typeof i=="boolean"?i?$d.INSTANCE:wh.INSTANCE:new J0(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:n1e(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=ya.get(this.key);return typeof e=="boolean"?e?$d.INSTANCE:wh.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ay.create(this.key,this)),this.negated}}function l6(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):$d.INSTANCE}class a6{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}static create(e,t,i=null){return l6(t,s=>new a6(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d6.create(this.key,this.value,this)),this.negated}}class c6{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}static create(e,t,i=null){return l6(t,s=>new c6(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u6.create(this.key,this.value,this)),this.negated}}class u6{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}static create(e,t,i=null){return l6(t,s=>new u6(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c6.create(this.key,this.value,this)),this.negated}}class d6{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}static create(e,t,i=null){return l6(t,s=>new d6(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Vw(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a6.create(this.key,this.value,this)),this.negated}}class m3{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new m3(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=sie.create(this)),this.negated}}class sie{constructor(e){this._actual=e,this.type=8}static create(e){return new sie(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function t1e(n){let e=null;for(let t=0,i=n.length;t<i;t++){const s=n[t].substituteConstants();if(n[t]!==s&&e===null){e=[];for(let o=0;o<t;o++)e[o]=n[o]}e!==null&&(e[t]=s)}return e===null?n:e}class TC{constructor(e,t){this.expr=e,this.negated=t,this.type=6}static create(e,t){return TC._normalizeArr(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const s=CO(this.expr[t],e.expr[t]);if(s!==0)return s}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=t1e(this.expr);return e===this.expr?this:TC.create(e,this.negated)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t){const i=[];let s=!1;for(const o of e)if(o){if(o.type===1){s=!0;continue}if(o.type===0)return $d.INSTANCE;if(o.type===6){i.push(...o.expr);continue}i.push(o)}if(i.length===0&&s)return wh.INSTANCE;if(i.length!==0){if(i.length===1)return i[0];i.sort(CO);for(let o=1;o<i.length;o++)i[o-1].equals(i[o])&&(i.splice(o,1),o--);if(i.length===1)return i[0];for(;i.length>1;){const o=i[i.length-1];if(o.type!==9)break;i.pop();const r=i.pop(),a=i.length===0,c=zv.create(o.expr.map(u=>TC.create([u,r],null)),null,a);c&&(i.push(c),i.sort(CO))}return i.length===1?i[0]:new TC(i,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=zv.create(e,this,!0)}return this.negated}}class zv{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,i){return zv._normalizeArr(e,t,i)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const s=CO(this.expr[t],e.expr[t]);if(s!==0)return s}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=t1e(this.expr);return e===this.expr?this:zv.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let s=[],o=!1;if(e){for(let r=0,a=e.length;r<a;r++){const c=e[r];if(c){if(c.type===0){o=!0;continue}if(c.type===1)return wh.INSTANCE;if(c.type===9){s=s.concat(c.expr);continue}s.push(c)}}if(s.length===0&&o)return $d.INSTANCE;s.sort(CO)}if(s.length!==0){if(s.length===1)return s[0];for(let r=1;r<s.length;r++)s[r-1].equals(s[r])&&(s.splice(r,1),r--);if(s.length===1)return s[0];if(i){for(let r=0;r<s.length;r++)for(let a=r+1;a<s.length;a++)i1e(s[r],s[a])&&(s.splice(a,1),a--);if(s.length===1)return s[0]}return new zv(s,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const r of _3(t))for(const a of _3(i))s.push(TC.create([r,a],null));const o=e.length===0;e.unshift(zv.create(s,null,o))}this.negated=e[0]}return this.negated}}class Sn extends ay{constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?Sn._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&Sn._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}static all(){return Sn._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return vR.create(this.key,e)}}Sn._info=[];const ai=ss("contextKeyService"),Syt="setContext";function n1e(n,e){return n<e?-1:n>e?1:0}function Vw(n,e,t,i){return n<t?-1:n>t?1:e<i?-1:e>i?1:0}function i1e(n,e){if(e.type===6&&n.type!==9&&n.type!==6){for(const s of e.expr)if(n.equals(s))return!0}const t=n.negate(),i=_3(t).concat(_3(e));i.sort(CO);for(let s=0;s<i.length;s++){const r=i[s].negate();for(let a=s+1;a<i.length;a++){const c=i[a];if(r.equals(c))return!0}}return!1}function _3(n){return n.type===9?n.expr:[n]}class yO{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let s=0,o=e.length;s<o;s++){const r=e[s].command;r&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=yO.combine(e,t);for(let s=0,o=this._keybindings.length;s<o;s++){let r=this._keybindings[s];r.keypressParts.length!==0&&(r.when&&r.when.type===0||this._addKeyPress(r.keypressParts[0],r))}}static _isTargetedForRemoval(e,t,i,s,o){return!(e.command!==s||t&&e.keypressParts[0]!==t||i&&e.keypressParts[1]!==i||o&&(!e.when||!Eyt(o,e.when)))}static combine(e,t){e=e.slice(0);let i=[];for(const s of t){if(!s.command||s.command.length===0||s.command.charAt(0)!=="-"){i.push(s);continue}const o=s.command.substr(1),r=s.keypressParts[0],a=s.keypressParts[1],c=s.when;for(let u=e.length-1;u>=0;u--)this._isTargetedForRemoval(e[u],r,a,o,c)&&e.splice(u,1)}return e.concat(i)}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){let o=i[s];if(o.command===t.command)continue;const r=o.keypressParts.length>1,a=t.keypressParts.length>1;r&&a&&o.keypressParts[1]!==t.keypressParts[1]||yO.whenIsEntirelyIncluded(o.when,t.when)&&this._removeFromLookupMap(o)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i<s;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:i1e(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?` chorded from ${t}`:""}`);let s=null;if(t!==null){const r=this._map.get(t);if(typeof r>"u")return this._log("\\ No keybinding entries."),null;s=[];for(let a=0,c=r.length;a<c;a++){let u=r[a];u.keypressParts[1]===i&&s.push(u)}}else{const r=this._map.get(i);if(typeof r>"u")return this._log("\\ No keybinding entries."),null;s=r}let o=this._findCommand(e,s);return o?t===null&&o.keypressParts.length>1&&o.keypressParts[1]!==null?(this._log(`\\ From ${s.length} keybinding entries, matched chord, when: ${hfe(o.when)}, source: ${ffe(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${s.length} keybinding entries, matched ${o.command}, when: ${hfe(o.when)}, source: ${ffe(o)}.`),{enterChord:!1,leaveChord:o.keypressParts.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){let s=t[i];if(yO.contextMatchesRules(e,s.when))return s}return null}static contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function hfe(n){return n?`${n.serialize()}`:"no when condition"}function ffe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}class v3{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(Tf===1){if(e&&e.win)return e.win}else if(Tf===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=v3.bindToCurrentPlatform(e);if(t&&t.primary){const i=hq(t.primary,Tf);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,s=t.secondary.length;i<s;i++){const o=t.secondary[i],r=hq(o,Tf);r&&this._registerDefaultKeybinding(r,e.id,e.args,e.weight,-i-1,e.when)}}registerCommandAndKeybindingRule(e){this.registerKeybindingRule(e),ji.registerCommand(e)}static _mightProduceChar(e){return e>=21&&e<=30||e>=31&&e<=56?!0:e===80||e===81||e===82||e===83||e===84||e===85||e===86||e===110||e===111||e===87||e===88||e===89||e===90||e===91||e===92}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&v3._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",t)}_registerDefaultKeybinding(e,t,i,s,o,r){Tf===1&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e.parts,command:t,commandArgs:i,when:r,weight1:s,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Iyt)),this._cachedMergedKeybindings.slice(0)}}const _c=new v3,wyt={EditorModes:"platform.keybindingsRegistry"};br.add(wyt.EditorModes,_c);function Iyt(n,e){return n.weight1!==e.weight1?n.weight1-e.weight1:n.command<e.command?-1:n.command>e.command?1:n.weight2-e.weight2}class gfe{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.keypressParts=e?Hq(e.getDispatchParts()):[],e&&this.keypressParts.length===0&&(this.keypressParts=Hq(e.getSingleModifierDispatchParts())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function Hq(n){let e=[];for(let t=0,i=n.length;t<i;t++){const s=n[t];if(!s)return e;e.push(s)}return e}class oie{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=i(a);if(c===null)return null;s[o]=Ryt(a,c,this.modifierLabels[e])}return s.join(" ")}}const rie=new oie({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:$({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:$({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:$({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:$({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:$({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:$({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:$({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:$({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),Lyt=new oie({ctrlKey:$({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:$({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:$({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:$({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:$({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:$({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:$({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:$({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:$({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:$({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:$({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:$({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),Oyt=new oie({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"});function Ryt(n,e,t){if(e===null)return"";const i=[];return n.ctrlKey&&i.push(t.ctrlKey),n.shiftKey&&i.push(t.shiftKey),n.altKey&&i.push(t.altKey),n.metaKey&&i.push(t.metaKey),e!==""&&i.push(e),i.join(t.separator)}class Myt extends bvt{constructor(e,t){if(super(),t.length===0)throw Wg("parts");this._os=e,this._parts=t}getLabel(){return rie.toLabel(this._os,this._parts,e=>this._getLabel(e))}getAriaLabel(){return Lyt.toLabel(this._os,this._parts,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._parts.length>1||this._parts[0].isDuplicateModifierCase()?null:Oyt.toLabel(this._os,this._parts,e=>this._getElectronAccelerator(e))}isChord(){return this._parts.length>1}getParts(){return this._parts.map(e=>this._getPart(e))}_getPart(e){return new vvt(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map(e=>this._getDispatchPart(e))}getSingleModifierDispatchParts(){return this._parts.map(e=>this._getSingleModifierDispatchPart(e))}}class Ax extends Myt{constructor(e,t){super(t,e.parts)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return XS.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":XS.toString(e.keyCode)}_getElectronAccelerator(e){return XS.toElectronAccelerator(e.keyCode)}_getDispatchPart(e){return Ax.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=XS.toString(e.keyCode),t}_getSingleModifierDispatchPart(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=Cne[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _resolveSimpleUserBinding(e){if(!e)return null;if(e instanceof K0)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new K0(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveUserBinding(e,t){const i=Hq(e.map(s=>this._resolveSimpleUserBinding(s)));return i.length>0?[new Ax(new WW(i),t)]:[]}}const Hr=ss("notificationService");class kyt{}const s1e=ss("contextService");class Ayt{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}var Er;(function(n){n.noSelection=$("noSelection","No selection"),n.singleSelectionRange=$("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),n.singleSelection=$("singleSelection","Line {0}, Column {1}"),n.multiSelectionRange=$("multiSelectionRange","{0} selections ({1} characters selected)"),n.multiSelection=$("multiSelection","{0} selections"),n.emergencyConfOn=$("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),n.openingDocs=$("openingDocs","Now opening the Editor Accessibility documentation page."),n.readonlyDiffEditor=$("readonlyDiffEditor"," in a read-only pane of a diff editor."),n.editableDiffEditor=$("editableDiffEditor"," in a pane of a diff editor."),n.readonlyEditor=$("readonlyEditor"," in a read-only code editor"),n.editableEditor=$("editableEditor"," in a code editor"),n.changeConfigToOnMac=$("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),n.changeConfigToOnWinLinux=$("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),n.auto_on=$("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),n.auto_off=$("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),n.tabFocusModeOnMsg=$("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),n.tabFocusModeOnMsgNoKb=$("tabFocusModeOnMsgNoKb","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),n.tabFocusModeOffMsg=$("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),n.tabFocusModeOffMsgNoKb=$("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),n.openDocMac=$("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),n.openDocWinLinux=$("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),n.outroMsg=$("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),n.showAccessibilityHelpAction=$("showAccessibilityHelpAction","Show Accessibility Help")})(Er||(Er={}));var Vq;(function(n){n.inspectTokensAction=$("inspectTokens","Developer: Inspect Tokens")})(Vq||(Vq={}));var b3;(function(n){n.gotoLineActionLabel=$("gotoLineActionLabel","Go to Line/Column...")})(b3||(b3={}));var Uq;(function(n){n.helpQuickAccessActionLabel=$("helpQuickAccess","Show all Quick Access Providers")})(Uq||(Uq={}));var T3;(function(n){n.quickCommandActionLabel=$("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=$("quickCommandActionHelp","Show And Run Commands")})(T3||(T3={}));var Nx;(function(n){n.quickOutlineActionLabel=$("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=$("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(Nx||(Nx={}));var C3;(function(n){n.editorViewAccessibleLabel=$("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=$("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(C3||(C3={}));var Wq;(function(n){n.toggleHighContrast=$("toggleHighContrast","Toggle High Contrast Theme")})(Wq||(Wq={}));var Gq;(function(n){n.bulkEditServiceSummary=$("bulkEditServiceSummary","Made {0} edits in {1} files")})(Gq||(Gq={}));var o1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},r1e=function(n,e){return function(t,i){e(t,i,n)}},l1e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class Nyt{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new rt}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}function Dyt(n,e,t){return Qm(n)?e(n):t(n)}let zq=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;return this.editor&&(t=Dyt(this.editor,i=>this.findModel(i,e),i=>this.findModel(i.getOriginalEditor(),e)||this.findModel(i.getModifiedEditor(),e))),t?Promise.resolve(new j_t(new Nyt(t))):Promise.reject(new Error("Model not found"))}findModel(e,t){let i=this.modelService.getModel(t);return i&&i.uri.toString()!==t.toString()?null:i}};zq=o1e([r1e(0,Xr)],zq);class h6{show(){return h6.NULL_PROGRESS_RUNNER}showWhile(e,t){return l1e(this,void 0,void 0,function*(){yield e})}}h6.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class $yt{confirm(e){return this.doConfirm(e).then(t=>({confirmed:t,checkboxChecked:!1}))}doConfirm(e){let t=e.message;return e.detail&&(t=t+`
- `+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,s){return Promise.resolve({choice:0})}}class f6{info(e){return this.notify({severity:Go.Info,message:e})}warn(e){return this.notify({severity:Go.Warning,message:e})}error(e){return this.notify({severity:Go.Error,message:e})}notify(e){switch(e.severity){case Go.Error:console.error(e.message);break;case Go.Warning:console.warn(e.message);break;default:console.log(e.message);break}return f6.NO_OP}status(e,t){return wt.None}}f6.NO_OP=new kyt;class xyt{constructor(e){this._onWillExecuteCommand=new rt,this._onDidExecuteCommand=new rt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=ji.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}}class a1e extends Cyt{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(Pt(r,An.KEY_DOWN,a=>{const c=new Po(a);this._dispatch(c,c.target)&&(c.preventDefault(),c.stopPropagation())})),this._register(Pt(window,An.KEY_UP,a=>{const c=new Po(a);this._singleModifierDispatch(c,c.target)&&c.preventDefault()}))}addDynamicKeybinding(e,t,i,s){const o=hq(t,Tf),r=new Wt;return o&&(this._dynamicKeybindings.push({keybinding:o.parts,command:e,when:s,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(xi(()=>{for(let a=0;a<this._dynamicKeybindings.length;a++)if(this._dynamicKeybindings[a].command===e){this._dynamicKeybindings.splice(a,1),this.updateResolver({source:1});return}}))),r.add(ji.registerCommand(e,i)),this.updateResolver({source:1}),r}updateResolver(e){this._cachedResolver=null,this._onDidUpdateKeybindings.fire(e)}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(_c.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new yO(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new gfe(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=Ax.resolveUserBinding(a,Tf);for(const u of c)i[s++]=new gfe(u,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){let t=new K0(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Ax(t,Tf)}}function pfe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof Jn)}class c1e{constructor(){this._onDidChangeConfiguration=new rt,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new ZLe(new vyt,new sh)}getValue(e,t){const i=typeof e=="string"?e:void 0,s=pfe(e)?e:pfe(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new byt({keys:i,overrides:[]},t,this._configuration);s.source=7,s.sourceConfig=null,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}}class Pyt{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new rt,this.configurationService.onDidChangeConfiguration(t=>{this._onDidChangeConfiguration.fire({affectedKeys:t.affectedKeys,affectsConfiguration:(i,s)=>t.affectsConfiguration(s)})})}getValue(e,t,i){const o=(ct.isIPosition(t)?t:null)?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0;return typeof o>"u"?this.configurationService.getValue():this.configurationService.getValue(o)}}let Kq=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Qc||ki?`
- `:`\r
- `}};Kq=o1e([r1e(0,Yo)],Kq);class Fyt{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class g6{constructor(){const e=Jn.from({scheme:g6.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new Ayt({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}g6.SCHEME="inmemory";function y3(n,e,t){if(!e||!(n instanceof c1e))return;let i=[];Object.keys(e).forEach(s=>{myt(s)&&i.push([`editor.${s}`,e[s]]),t&&_yt(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}class Byt{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return l1e(this,void 0,void 0,function*(){const i=new Map;for(let r of e){if(!(r instanceof qLe))throw new Error("bad edit - only text edits are supported");const a=this._modelService.getModel(r.resource);if(!a)throw new Error("bad edit - model not found");if(typeof r.versionId=="number"&&a.getVersionId()!==r.versionId)throw new Error("bad state - model changed in the meantime");let c=i.get(a);c||(c=[],i.set(a,c)),c.push(ir.replaceMove(be.lift(r.textEdit.range),r.textEdit.text))}let s=0,o=0;for(const[r,a]of i)r.pushStackElement(),r.pushEditOperations([],a,()=>[]),r.pushStackElement(),o+=1,s+=a.length;return{ariaSummary:ha(Gq.bulkEditServiceSummary,s,o)}})}}class Hyt{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}}class Vyt{constructor(e,t){this._codeEditorService=e,this._container=t,this.onDidLayout=Ln.None}get dimension(){return this._dimension||(this._dimension=W8(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}}const mfe=2e4;let OS,t4,jq,n4,Xq;function Uyt(n){OS=document.createElement("div"),OS.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),OS.appendChild(i),i};t4=e(),jq=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("role","complementary"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),OS.appendChild(i),i};n4=t(),Xq=t(),n.appendChild(OS)}function Hl(n){OS&&(t4.textContent!==n?(wl(jq),S3(t4,n)):(wl(t4),S3(jq,n)))}function E3(n){OS&&(ki?Hl(n):n4.textContent!==n?(wl(Xq),S3(n4,n)):(wl(n4),S3(Xq,n)))}function S3(n,e){wl(n),e.length>mfe&&(e=e.substr(0,mfe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const lie=ss("markerDecorationsService");var w3=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class Pf extends wt{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return w3(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class bR extends wt{constructor(){super(...arguments),this._onBeforeRun=this._register(new rt),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new rt),this.onDidRun=this._onDidRun.event}run(e,t){return w3(this,void 0,void 0,function*(){if(!e.enabled)return;this._onBeforeRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return w3(this,void 0,void 0,function*(){yield e.run(t)})}}class Ff extends Pf{constructor(e){super(Ff.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Ff.ID="vs.actions.separator";class p6{constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=e,this.label=t,this.class=s,this._actions=i}get actions(){return this._actions}dispose(){}run(){return w3(this,void 0,void 0,function*(){})}}class m6 extends Pf{constructor(){super(m6.ID,$("submenu.empty","(empty)"),void 0,!1)}}m6.ID="vs.actions.empty";var bh;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST="hc"})(bh||(bh={}));const fo=ss("themeService");var Yq;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(Yq||(Yq={}));function sr(n){return{id:n}}var mo;(function(n){function e(a){return a&&typeof a=="object"&&typeof a.id=="string"&&(typeof a.color>"u"||Yq.isThemeColor(a.color))}n.isThemeIcon=e;const t=new RegExp(`^\\$\\((${Lu.iconNameExpression}(?:${Lu.iconModifierExpression})?)\\)$`);function i(a){const c=t.exec(a);if(!c)return;let[,u]=c;return{id:u}}n.fromString=i;function s(a,c){let u=a.id;const d=u.lastIndexOf("~");return d!==-1&&(u=u.substring(0,d)),c&&(u=`${u}~${c}`),{id:u}}n.modify=s;function o(a,c){var u,d;return a.id===c.id&&((u=a.color)===null||u===void 0?void 0:u.id)===((d=c.color)===null||d===void 0?void 0:d.id)}n.isEqual=o;function r(a,c){return{id:a.id,color:c?sr(c):void 0}}n.asThemeIcon=r,n.asClassNameArray=Lu.asClassNameArray,n.asClassName=Lu.asClassName,n.asCSSSelector=Lu.asCSSSelector})(mo||(mo={}));function I3(n){switch(n){case bh.DARK:return"vs-dark";case bh.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const u1e={ThemingContribution:"base.contributions.theming"};class Wyt{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new rt}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),xi(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let d1e=new Wyt;br.add(u1e.ThemingContribution,d1e);function ws(n){return d1e.onColorThemeChange(n)}class Gyt extends wt{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}var zyt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_fe=function(n,e){return function(t,i){e(t,i,n)}};function uD(n){return n.command!==void 0}class wn{constructor(e){this.id=wn._idPool++,this._debugName=e}}wn._idPool=0;wn.CommandPalette=new wn("CommandPalette");wn.EditorContext=new wn("EditorContext");wn.SimpleEditorContext=new wn("SimpleEditorContext");wn.EditorContextCopy=new wn("EditorContextCopy");wn.EditorContextPeek=new wn("EditorContextPeek");wn.MenubarEditMenu=new wn("MenubarEditMenu");wn.MenubarCopy=new wn("MenubarCopy");wn.MenubarGoMenu=new wn("MenubarGoMenu");wn.MenubarSelectionMenu=new wn("MenubarSelectionMenu");wn.InlineCompletionsActions=new wn("InlineCompletionsActions");const Uw=ss("menuService"),Th=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new rt,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:n=>n===wn.CommandPalette}}addCommand(n){return this.addCommands(zi.single(n))}addCommands(n){for(const e of n)this._commands.set(e.id,e);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),xi(()=>{let e=!1;for(const t of n)e=this._commands.delete(t.id)||e;e&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){return this.appendMenuItems(zi.single({id:n,item:e}))}appendMenuItems(n){const e=new Set,t=new Cd;for(const{id:i,item:s}of n){let o=this._menuItems.get(i);o||(o=new Cd,this._menuItems.set(i,o)),t.push(o.push(s)),e.add(i)}return this._onDidChangeMenu.fire(e),xi(()=>{if(t.size>0){for(let i of t)i();this._onDidChangeMenu.fire(e),t.clear()}})}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===wn.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)uD(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class aie extends p6{constructor(e,t,i,s){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=i,this._options=s}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),i=t.getActions(this._options);t.dispose();for(const[,s]of i)s.length>0&&(e.push(...s),e.push(new Ff));return e.length&&e.pop(),e}}let Q0=class h1e{constructor(e,t,i,s,o){var r,a;if(this._commandService=o,this.id=e.id,this.label=i!=null&&i.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value,this.tooltip=(a=typeof e.tooltip=="string"?e.tooltip:(r=e.tooltip)===null||r===void 0?void 0:r.value)!==null&&a!==void 0?a:"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const c=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}this.item=e,this.alt=t?new h1e(t,void 0,i,s,o):void 0,this._options=i,mo.isThemeIcon(e.icon)&&(this.class=Lu.asClassName(e.icon))}dispose(){}run(...e){var t,i;let s=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(s=[...s,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};Q0=zyt([_fe(3,ai),_fe(4,vr)],Q0);const By=ss("telemetryService");class _6{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=dn.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};_c.registerKeybindingRule(s)}}ji.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Th.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class mM extends _6{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort((s,o)=>o.priority-s.priority),{dispose:()=>{for(let s=0;s<this._implementations.length;s++)if(this._implementations[s].implementation===i){this._implementations.splice(s,1);return}}}}runCommand(e,t){const i=e.get(h_);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const s of this._implementations){const o=s.implementation(e,t);if(o)return i.trace(`Command '${this.id}' was handled by '${s.name}'.`),typeof o=="boolean"?void 0:o}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class f1e extends _6{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class jl extends _6{static bindToContribution(e){return class extends jl{constructor(i){super(i),this._callback=i.handler}runEditorCommand(i,s,o){e(s)&&this._callback(e(s),o)}}}runCommand(e,t){const i=e.get(hs),s=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(s)return s.invokeWithinContext(o=>{if(o.get(ai).contextMatchesRules(yd(this.precondition)))return this.runEditorCommand(o,s,t)})}}class yn extends jl{constructor(e){super(yn.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=wn.EditorContext),s.title||(s.title=e.label),s.when=dn.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(By).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class g1e extends yn{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i<this._implementations.length;i++)if(this._implementations[i][1]===t){this._implementations.splice(i,1);return}}}}run(e,t,i){for(const s of this._implementations){const o=s[1](e,t,i);if(o)return typeof o=="boolean"?void 0:o}}}function f_(n,e){ji.registerCommand(n,function(t,...i){const[s,o]=i;Gs(Jn.isUri(s)),Gs(ct.isIPosition(o));const r=t.get(Xr).getModel(s);if(r){const a=ct.lift(o);return e(r,a,...i.slice(2))}return t.get(Nd).createModelReference(s).then(a=>new Promise((c,u)=>{try{const d=e(a.object.textEditorModel,ct.lift(o),i.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{a.dispose()}))})}function Kyt(n,e){ji.registerCommand(n,function(t,...i){const[s]=i;Gs(Jn.isUri(s));const o=t.get(Xr).getModel(s);return o?e(o,...i.slice(1)):t.get(Nd).createModelReference(s).then(r=>new Promise((a,c)=>{try{const u=e(r.object.textEditorModel,i.slice(1));a(u)}catch(u){c(u)}}).finally(()=>{r.dispose()}))})}function Xt(n){return lh.INSTANCE.registerEditorCommand(n),n}function qt(n){const e=new n;return lh.INSTANCE.registerEditorAction(e),e}function p1e(n){return lh.INSTANCE.registerEditorAction(n),n}function m1e(n){lh.INSTANCE.registerEditorAction(n)}function _s(n,e){lh.INSTANCE.registerEditorContribution(n,e)}var EO;(function(n){function e(r){return lh.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return lh.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return lh.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return lh.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return lh.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(EO||(EO={}));const jyt={EditorCommonContributions:"editor.contributions"};class lh{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}lh.INSTANCE=new lh;br.add(jyt.EditorCommonContributions,lh.INSTANCE);function EF(n){return n.register(),n}const cie=EF(new mM({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:wn.MenubarEditMenu,group:"1_do",title:$({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:wn.CommandPalette,group:"",title:$("undo","Undo"),order:1}]}));EF(new f1e(cie,{id:"default:undo",precondition:void 0}));const uie=EF(new mM({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:wn.MenubarEditMenu,group:"1_do",title:$({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:wn.CommandPalette,group:"",title:$("redo","Redo"),order:1}]}));EF(new f1e(uie,{id:"default:redo",precondition:void 0}));const Xyt=EF(new mM({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:wn.MenubarSelectionMenu,group:"1_basic",title:$({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:wn.CommandPalette,group:"",title:$("selectAll","Select All"),order:1}]}));var Yyt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qyt=function(n,e){return function(t,i){e(t,i,n)}};let Dx=class{constructor(e,t){}dispose(){}};Dx.ID="editor.contrib.markerDecorations";Dx=Yyt([qyt(1,lie)],Dx);_s(Dx.ID,Dx);class Jyt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class die{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=this._bareFontInfo.getMassagedFontFamily(Mf?va.fontFamily:null),t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("div");i.style.fontFamily=e,i.style.fontWeight=this._bareFontInfo.fontWeight,i.style.fontSize=this._bareFontInfo.fontSize+"px",i.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,i.style.lineHeight=this._bareFontInfo.lineHeight+"px",i.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",t.appendChild(i);const s=document.createElement("div");s.style.fontFamily=e,s.style.fontWeight="bold",s.style.fontSize=this._bareFontInfo.fontSize+"px",s.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,s.style.lineHeight=this._bareFontInfo.lineHeight+"px",s.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",t.appendChild(s);const o=document.createElement("div");o.style.fontFamily=e,o.style.fontWeight=this._bareFontInfo.fontWeight,o.style.fontSize=this._bareFontInfo.fontSize+"px",o.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,o.style.lineHeight=this._bareFontInfo.lineHeight+"px",o.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",o.style.fontStyle="italic",t.appendChild(o);const r=[];for(const a of this._requests){let c;a.type===0&&(c=i),a.type===2&&(c=s),a.type===1&&(c=o),c.appendChild(document.createElement("br"));const u=document.createElement("span");die._render(u,a),c.appendChild(u),r.push(u)}this._container=t,this._testElements=r}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const i=this._requests[e],s=this._testElements[e];i.fulfill(s.offsetWidth/256)}}}function Qyt(n,e){new die(n,e).read()}class _1e extends wt{constructor(e,t,i){super(),this.referenceDomElement=e,this.changeCallback=i,this.width=-1,this.height=-1,this.resizeObserver=null,this.measureReferenceDomElementToken=-1,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this.width}getHeight(){return this.height}startObserving(){typeof ResizeObserver<"u"?!this.resizeObserver&&this.referenceDomElement&&(this.resizeObserver=new ResizeObserver(e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()}),this.resizeObserver.observe(this.referenceDomElement)):this.measureReferenceDomElementToken===-1&&(this.measureReferenceDomElementToken=setInterval(()=>this.observe(),100))}stopObserving(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.measureReferenceDomElementToken!==-1&&(clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this.referenceDomElement&&(i=this.referenceDomElement.clientWidth,s=this.referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this.width!==i||this.height!==s)&&(this.width=i,this.height=s,e&&this.changeCallback())}}class vfe{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}function Zyt(){Z0.INSTANCE.clearCache()}class Z0 extends wt{constructor(){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._cache=new vfe,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new vfe,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),!t.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readConfiguration(e){if(!this._cache.has(e)){let t=Z0._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new wq({zoomLevel:dq(),pixelRatio:VW(),fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}static createRequest(e,t,i,s){const o=new Jyt(e,t);return i.push(o),s&&s.push(o),o}static _actualReadConfiguration(e){const t=[],i=[],s=this.createRequest("n",0,t,i),o=this.createRequest("m",0,t,null),r=this.createRequest(" ",0,t,i),a=this.createRequest("0",0,t,i),c=this.createRequest("1",0,t,i),u=this.createRequest("2",0,t,i),d=this.createRequest("3",0,t,i),f=this.createRequest("4",0,t,i),g=this.createRequest("5",0,t,i),p=this.createRequest("6",0,t,i),_=this.createRequest("7",0,t,i),v=this.createRequest("8",0,t,i),C=this.createRequest("9",0,t,i),y=this.createRequest("→",0,t,i),w=this.createRequest("→",0,t,null),I=this.createRequest("·",0,t,i),L=this.createRequest("⸱",0,t,null),O="|/-_ilm%";for(let V=0,U=O.length;V<U;V++)this.createRequest(O.charAt(V),0,t,i),this.createRequest(O.charAt(V),1,t,i),this.createRequest(O.charAt(V),2,t,i);Qyt(e,t);const A=Math.max(a.width,c.width,u.width,d.width,f.width,g.width,p.width,_.width,v.width,C.width);let N=e.fontFeatureSettings===gd.OFF;const D=i[0].width;for(let V=1,U=i.length;N&&V<U;V++){const Q=D-i[V].width;if(Q<-.001||Q>.001){N=!1;break}}let P=!0;N&&w.width!==D&&(P=!1),w.width>y.width&&(P=!1);const F=pvt()>2e3;return new wq({zoomLevel:dq(),pixelRatio:VW(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:N,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:P,spaceWidth:r.width,middotWidth:I.width,wsmiddotWidth:L.width,maxDigitWidth:A},F)}}Z0.INSTANCE=new Z0;class Ea extends g3{constructor(e,t,i=null,s){super(e,t),this.accessibilityService=s,this._elementSizeObserver=this._register(new _1e(i,t.dimension,()=>this._recomputeOptions())),this._register(Z0.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(10)&&this._elementSizeObserver.startObserving(),this._register(HIe(o=>this._recomputeOptions())),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(Mf?va.fontFamily:null),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"}static applyFontInfo(e,t){e.setFontFamily(t.getMassagedFontFamily(Mf?va.fontFamily:null)),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)}observeReferenceElement(e){this._elementSizeObserver.observe(e)}updatePixelRatio(){this._recomputeOptions()}static _getExtraEditorClassName(){let e="";return!Mf&&!_vt&&(e+="no-user-select "),Mf&&(e+="no-minimap-shadow "),ki&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:Ea._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:f0||ac,pixelRatio:VW(),zoomLevel:dq(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return Z0.INSTANCE.readConfiguration(e)}}class v1e{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontFeatureSettings="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){this._top!==-1&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function qi(n){return new v1e(n)}function Vr(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}var eEt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},so;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(so||(so={}));class Ds extends wt{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(Pt(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(Pt(document,"touchend",e=>this.onTouchEnd(e))),this._register(Pt(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return Ds.isTouchDevice()?(Ds.INSTANCE||(Ds.INSTANCE=new Ds),Ds.INSTANCE.targets.push(e),{dispose:()=>{Ds.INSTANCE.targets=Ds.INSTANCE.targets.filter(t=>t!==e)}}):wt.None}static ignoreTarget(e){return Ds.isTouchDevice()?(Ds.INSTANCE||(Ds.INSTANCE=new Ds),Ds.INSTANCE.ignoreTargets.push(e),{dispose:()=>{Ds.INSTANCE.ignoreTargets=Ds.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):wt.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i<s;i++){let o=e.targetTouches.item(i);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:t,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[t],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let r=this.newGestureEvent(so.Start,o.target);r.pageX=o.pageX,r.pageY=o.pageY,this.dispatchEvent(r)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){let t=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,o=e.changedTouches.length;s<o;s++){let r=e.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("move of an UNKNOWN touch",r);continue}let a=this.activeTouches[r.identifier],c=Date.now()-a.initialTimeStamp;if(c<Ds.HOLD_DELAY&&Math.abs(a.initialPageX-eh(a.rollingPageX))<30&&Math.abs(a.initialPageY-eh(a.rollingPageY))<30){let u=this.newGestureEvent(so.Tap,a.initialTarget);u.pageX=eh(a.rollingPageX),u.pageY=eh(a.rollingPageY),this.dispatchEvent(u)}else if(c>=Ds.HOLD_DELAY&&Math.abs(a.initialPageX-eh(a.rollingPageX))<30&&Math.abs(a.initialPageY-eh(a.rollingPageY))<30){let u=this.newGestureEvent(so.Contextmenu,a.initialTarget);u.pageX=eh(a.rollingPageX),u.pageY=eh(a.rollingPageY),this.dispatchEvent(u)}else if(i===1){let u=eh(a.rollingPageX),d=eh(a.rollingPageY),f=eh(a.rollingTimestamps)-a.rollingTimestamps[0],g=u-a.rollingPageX[0],p=d-a.rollingPageY[0];const _=this.targets.filter(v=>a.initialTarget instanceof Node&&v.contains(a.initialTarget));this.inertia(_,t,Math.abs(g)/f,g>0?1:-1,u,Math.abs(p)/f,p>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(so.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===so.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Ds.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===so.Change||e.type===so.Contextmenu)&&(this._lastSetTapCountTime=0);for(let t=0;t<this.ignoreTargets.length;t++)if(e.initialTarget instanceof Node&&this.ignoreTargets[t].contains(e.initialTarget))return;this.targets.forEach(t=>{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)})}inertia(e,t,i,s,o,r,a,c){this.handle=qm(()=>{let u=Date.now(),d=u-t,f=0,g=0,p=!0;i+=Ds.SCROLL_FRICTION*d,r+=Ds.SCROLL_FRICTION*d,i>0&&(p=!1,f=s*i*d),r>0&&(p=!1,g=a*r*d);let _=this.newGestureEvent(so.Change);_.translationX=f,_.translationY=g,e.forEach(v=>v.dispatchEvent(_)),p||this.inertia(e,u,i,s,o+f,r,a,c+g)})}onTouchMove(e){let t=Date.now();for(let i=0,s=e.changedTouches.length;i<s;i++){let o=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let r=this.activeTouches[o.identifier],a=this.newGestureEvent(so.Change,r.initialTarget);a.translationX=o.pageX-eh(r.rollingPageX),a.translationY=o.pageY-eh(r.rollingPageY),a.pageX=o.pageX,a.pageY=o.pageY,this.dispatchEvent(a),r.rollingPageX.length>3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Ds.SCROLL_FRICTION=-.005;Ds.HOLD_DELAY=700;Ds.CLEAR_TAP_COUNT_TIME=400;eEt([Vr],Ds,"isTouchDevice",null);function _M(n,e){let t=new fh(e);return t.preventDefault(),{leftButton:t.leftButton,buttons:t.buttons,posx:t.posx,posy:t.posy}}class Ww{constructor(){this._hooks=new Wt,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,i,s,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=s,this._onStopCallback=o;const r=gq.getSameOriginWindowChain(),a=Xm?"pointermove":"mousemove",c="mouseup",u=r.map(f=>f.window.document),d=Pw(e);d&&u.unshift(d);for(const f of u)this._hooks.add(One(f,a,g=>{if(g.buttons!==t){this.stopMonitoring(!0);return}this._mouseMoveCallback(g)},(g,p)=>this._mouseMoveEventMerger(g,p))),this._hooks.add(Pt(f,c,g=>this.stopMonitoring(!0)));if(gq.hasDifferentOriginAncestor()){let f=r[r.length-1];this._hooks.add(Pt(f.window.document,"mouseout",g=>{new fh(g).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(Pt(f.window.document,"mouseover",g=>{new fh(g).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(Pt(f.window.document.body,"mouseleave",g=>{this.stopMonitoring(!0)}))}}}class hie{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new b1e(this.x-Yv.scrollX,this.y-Yv.scrollY)}}class b1e{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new hie(this.clientX+Yv.scrollX,this.clientY+Yv.scrollY)}}class tEt{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}function T1e(n){const e=Bl(n);return new tEt(e.left,e.top,e.width,e.height)}class ew extends fh{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new hie(this.posx,this.posy),this.editorPos=T1e(t)}}class nEt{constructor(e){this._editorViewDomNode=e}_create(e){return new ew(e,this._editorViewDomNode)}onContextMenu(e,t){return Pt(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return Pt(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return Pt(e,"mousedown",i=>{t(this._create(i))})}onMouseLeave(e,t){return Lne(e,i=>{t(this._create(i))})}onMouseMoveThrottled(e,t,i,s){return One(e,"mousemove",t,(r,a)=>i(r,this._create(a)),s)}}class iEt{constructor(e){this._editorViewDomNode=e}_create(e){return new ew(e,this._editorViewDomNode)}onPointerUp(e,t){return Pt(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return Pt(e,"pointerdown",i=>{t(this._create(i))})}onPointerLeave(e,t){return Nvt(e,i=>{t(this._create(i))})}onPointerMoveThrottled(e,t,i,s){return One(e,"pointermove",t,(r,a)=>i(r,this._create(a)),s)}}class sEt extends wt{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new Ww),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Br(document,"keydown",a=>{a.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,a.browserEvent)},!0);const r=(a,c)=>i(a,new ew(c,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,r,s,a=>{this._keydownListener.dispose(),o(a)})}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class SF extends wt{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;i<s;i++){let o=e[i];switch(o.type){case 0:this.onCompositionStart(o)&&(t=!0);break;case 1:this.onCompositionEnd(o)&&(t=!0);break;case 2:this.onConfigurationChanged(o)&&(t=!0);break;case 3:this.onCursorStateChanged(o)&&(t=!0);break;case 4:this.onDecorationsChanged(o)&&(t=!0);break;case 5:this.onFlushed(o)&&(t=!0);break;case 6:this.onFocusChanged(o)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(o)&&(t=!0);break;case 8:this.onLineMappingChanged(o)&&(t=!0);break;case 9:this.onLinesChanged(o)&&(t=!0);break;case 10:this.onLinesDeleted(o)&&(t=!0);break;case 11:this.onLinesInserted(o)&&(t=!0);break;case 12:this.onRevealRangeRequest(o)&&(t=!0);break;case 13:this.onScrollChanged(o)&&(t=!0);break;case 15:this.onTokensChanged(o)&&(t=!0);break;case 14:this.onThemeChanged(o)&&(t=!0);break;case 16:this.onTokensColorsChanged(o)&&(t=!0);break;case 17:this.onZonesChanged(o)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(o)}}t&&(this._shouldRender=!0)}}class Rh extends SF{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Zm{static write(e,t){e instanceof v1e,e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){let i=[],s=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[s++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(s);for(let r=0;r<s;r++)o[r]=i[s-r-1];return o}}class oEt{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class rEt extends oEt{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class lEt{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class v6{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}static from(e){const t=new Array(e.length);for(let i=0,s=e.length;i<s;i++){const o=e[i];t[i]=new v6(o.left,o.width)}return t}toString(){return`[${this.left},${this.width}]`}}class SO{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class aEt{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class cEt{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class Y9{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,s,o){const r=this._createRange();try{return r.setStart(e,t),r.setEnd(i,s),r.getClientRects()}catch{return null}finally{this._detachRange(r,o)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(SO.compare);let t=[],i=0,s=e[0];for(let o=1,r=e.length;o<r;o++){const a=e[o];s.left+s.width+.9>=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t){if(!e||e.length===0)return null;const i=[];for(let s=0,o=e.length;s<o;s++){const r=e[s];i[s]=new SO(Math.max(0,r.left-t),r.width)}return this._mergeAdjacentRanges(i)}static readHorizontalRanges(e,t,i,s,o,r,a){const u=e.children.length-1;if(0>u)return null;if(t=Math.min(u,Math.max(0,t)),s=Math.min(u,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const p=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(p,r)}t!==s&&s>0&&o===0&&(s--,o=1073741824);let d=e.children[t].firstChild,f=e.children[s].firstChild;if((!d||!f)&&(!d&&i===0&&t>0&&(d=e.children[t-1].firstChild,i=1073741824),!f&&o===0&&s>0&&(f=e.children[s-1].firstChild,o=1073741824)),!d||!f)return null;i=Math.min(d.textContent.length,Math.max(0,i)),o=Math.min(f.textContent.length,Math.max(0,o));const g=this._readClientRects(d,i,f,o,a);return this._createHorizontalRangesFromClientRects(g,r)}}const uEt=function(){return Ug?!0:!(Qc||ac||Mf)}();let wO=!0;class bfe{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}get clientRectDeltaLeft(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft}}class Tfe{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(43);this.renderWhitespace=i.get(87),this.renderControlCharacters=i.get(82),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(29),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(58),this.stopRenderingLineAfter=i.get(104),this.fontLigatures=i.get(44)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class ym{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=qi(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return this._options.themeType===bh.HIGH_CONTRAST||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),r=this._options,a=Ed.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let c=null;if(r.themeType===bh.HIGH_CONTRAST||this._options.renderWhitespace==="selection"){const g=i.selections;for(const p of g){if(p.endLineNumber<e||p.startLineNumber>e)continue;const _=p.startLineNumber===e?p.startColumn:o.minColumn,v=p.endLineNumber===e?p.endColumn:o.maxColumn;_<v&&(r.themeType===bh.HIGH_CONTRAST||this._options.renderWhitespace!=="selection"?a.push(new Ed(_,v,"inline-selected-text",0)):(c||(c=[]),c.push(new xCt(_-1,v-1))))}}const u=new Hw(r.useMonospaceOptimizations,r.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,a,o.tabSize,o.startVisibleColumn,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==gd.OFF,c);if(this._renderedViewLine&&this._renderedViewLine.input.equals(u))return!1;s.appendASCIIString('<div style="top:'),s.appendASCIIString(String(t)),s.appendASCIIString("px;height:"),s.appendASCIIString(String(this._options.lineHeight)),s.appendASCIIString('px;" class="'),s.appendASCIIString(ym.CLASS_NAME),s.appendASCIIString('">');const d=t6(u,s);s.appendASCIIString("</div>");let f=null;return wO&&uEt&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&o.content.length<300&&u.lineTokens.getCount()<100&&(f=new XH(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping)),f||(f=y1e(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=f,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof XH:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof XH?this._renderedViewLine.monospaceAssumptionsAreValid():wO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof XH&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=t|0,i=i|0,t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter|0;let r=!1;o!==-1&&t>o+1&&i>o+1&&(r=!0),o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const a=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return a&&a.length>0?new cEt(r,a):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}ym.CLASS_NAME="view-line";class XH{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return wO;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),wO=!1),wO}toSlowRenderedLine(){return y1e(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const o=this._getCharPosition(t),r=this._getCharPosition(i);return[new SO(o,r-o)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return this._charWidth*t}getColumnOfNodeOffset(e,t,i){const s=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new Qne(o,i),s)}}class C1e{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new SO(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new SO(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth();const o=this._getReadingTarget(e);return o.firstChild?o.firstChild.offsetWidth:0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const c=Y9.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s.clientRectDeltaLeft,s.endNode);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth();const o=this._characterMapping.getDomPosition(i),r=Y9.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s.clientRectDeltaLeft,s.endNode);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const c=this._characterMapping.getAbsoluteOffset(i),u=Math.round(this.input.spaceWidth*c);if(Math.abs(u-a)<=1)return u}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new SO(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Y9.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s.clientRectDeltaLeft,s.endNode)}getColumnOfNodeOffset(e,t,i){const s=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new Qne(o,i),s)}}class dEt extends C1e{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const c=r[r.length-1];c.left<a&&(c.width=a-c.left)}}return r}}const y1e=function(){return f0?hEt:fEt}();function hEt(n,e,t,i,s){return new dEt(n,e,t,i,s)}function fEt(n,e,t,i,s){return new C1e(n,e,t,i,s)}function YH(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class $l{constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${YH(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${YH(this.oldText)}")`:`(replace@${this.oldPosition} "${YH(this.oldText)}" with "${YH(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Sg(e,s,i),i+=4;for(let o=0;o<s;o++)bbt(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Eg(e,t);return t+=4,Mq(e,t,i)}writeSize(){return 8+$l._writeStringSize(this.oldText)+$l._writeStringSize(this.newText)}write(e,t){return Sg(e,this.oldPosition,t),t+=4,Sg(e,this.newPosition,t),t+=4,t=$l._writeString(e,this.oldText,t),t=$l._writeString(e,this.newText,t),t}static read(e,t,i){const s=Eg(e,t);t+=4;const o=Eg(e,t);t+=4;const r=$l._readString(e,t);t+=$l._writeStringSize(r);const a=$l._readString(e,t);return t+=$l._writeStringSize(a),i.push(new $l(s,r,o,a)),t}}function gEt(n,e){return n===null||n.length===0?e:new am(n,e).compress()}class am{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),s=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(i===null){this._acceptCurr(s),s=this._getCurr(++t);continue}if(s===null){this._acceptPrev(i),i=this._getPrev(++e);continue}if(s.oldEnd<=i.newPosition){this._acceptCurr(s),s=this._getCurr(++t);continue}if(i.newEnd<=s.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(s.oldPosition<i.newPosition){const[u,d]=am._splitCurr(s,i.newPosition-s.oldPosition);this._acceptCurr(u),s=d;continue}if(i.newPosition<s.oldPosition){const[u,d]=am._splitPrev(i,s.oldPosition-i.newPosition);this._acceptPrev(u),i=d;continue}let a,c;if(s.oldEnd===i.newEnd)a=i,c=s,i=this._getPrev(++e),s=this._getCurr(++t);else if(s.oldEnd<i.newEnd){const[u,d]=am._splitPrev(i,s.oldLength);a=u,c=s,i=d,s=this._getCurr(++t)}else{const[u,d]=am._splitCurr(s,i.newLength);a=i,c=u,i=this._getPrev(++e),s=d}this._result[this._resultLen++]=new $l(a.oldPosition,a.oldText,c.newPosition,c.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=c.newLength-c.oldLength}const o=am._merge(this._result);return am._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=am._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=am._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new $l(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new $l(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),s=e.newText.substr(t);return[new $l(e.oldPosition,e.oldText,e.newPosition,i),new $l(e.oldEnd,"",e.newPosition+t,s)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),s=e.oldText.substr(t);return[new $l(e.oldPosition,i,e.newPosition,e.newText),new $l(e.oldPosition+t,s,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;let t=[],i=0,s=e[0];for(let o=1;o<e.length;o++){const r=e[o];s.oldEnd===r.oldPosition?s=new $l(s.oldPosition,s.oldText+r.oldText,s.newPosition,s.newText+r.newText):(t[i++]=s,s=r)}return t[i++]=s,t}static _removeNoOps(e){if(e.length===0)return e;let t=[],i=0;for(let s=0;s<e.length;s++){const o=e[s];o.oldText!==o.newText&&(t[i++]=o)}return t}}function o1(n){return n.toString()}class sl{constructor(e,t,i,s,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=s,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}static create(e,t){const i=e.getAlternativeVersionId(),s=qq(e);return new sl(i,i,s,s,t,t,[])}append(e,t,i,s,o){t.length>0&&(this.changes=gEt(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Sg(e,t?t.length:0,i),i+=4,t)for(const s of t)Sg(e,s.selectionStartLineNumber,i),i+=4,Sg(e,s.selectionStartColumn,i),i+=4,Sg(e,s.positionLineNumber,i),i+=4,Sg(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Eg(e,t);t+=4;for(let o=0;o<s;o++){const r=Eg(e,t);t+=4;const a=Eg(e,t);t+=4;const c=Eg(e,t);t+=4;const u=Eg(e,t);t+=4,i.push(new fn(r,a,c,u))}return t}serialize(){let e=10+sl._writeSelectionsSize(this.beforeCursorState)+sl._writeSelectionsSize(this.afterCursorState)+4;for(const s of this.changes)e+=s.writeSize();const t=new Uint8Array(e);let i=0;Sg(t,this.beforeVersionId,i),i+=4,Sg(t,this.afterVersionId,i),i+=4,Mhe(t,this.beforeEOL,i),i+=1,Mhe(t,this.afterEOL,i),i+=1,i=sl._writeSelections(t,this.beforeCursorState,i),i=sl._writeSelections(t,this.afterCursorState,i),Sg(t,this.changes.length,i),i+=4;for(const s of this.changes)i=s.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const s=Eg(t,i);i+=4;const o=Eg(t,i);i+=4;const r=Rhe(t,i);i+=1;const a=Rhe(t,i);i+=1;const c=[];i=sl._readSelections(t,i,c);const u=[];i=sl._readSelections(t,i,u);const d=Eg(t,i);i+=4;const f=[];for(let g=0;g<d;g++)i=$l.read(t,i,f);return new sl(s,o,r,a,c,u,f)}}class E1e{constructor(e,t){this.model=e,this._data=sl.create(e,t)}get type(){return 0}get resource(){return Jn.isUri(this.model)?this.model:this.model.uri}get label(){return $("edit","Typing")}toString(){return(this._data instanceof sl?this._data:sl.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(Jn.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof sl}append(e,t,i,s,o){this._data instanceof sl&&this._data.append(e,t,i,s,o)}close(){this._data instanceof sl&&(this._data=this._data.serialize())}open(){this._data instanceof sl||(this._data=sl.deserialize(this._data))}undo(){if(Jn.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof sl&&(this._data=this._data.serialize());const e=sl.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Jn.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof sl&&(this._data=this._data.serialize());const e=sl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof sl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class pEt{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const s=o1(i.resource);this._editStackElementsMap.set(s,i)}this._delegate=null}get resources(){return this._editStackElementsArr.map(e=>e.resource)}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=o1(e);return this._editStackElementsMap.has(t)}setModel(e){const t=o1(Jn.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=o1(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=o1(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=o1(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${Xf(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function qq(n){return n.getEOL()===`
- `?0:1}function Lv(n){return n?n instanceof E1e||n instanceof pEt:!1}class fie{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Lv(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Lv(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(Lv(t)&&t.canAppend(this._model))return t;const i=new E1e(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],qq(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const s=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),r=fie._computeCursorState(i,o),a=o.map((c,u)=>({index:u,textChange:c.textChange}));return a.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),s.append(this._model,a.map(c=>c.textChange),qq(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return di(i),null}}}class mEt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function _Et(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){let g=n.charCodeAt(o),p=t.charCodeAt(o);if(g!==p)break}let r=0,a=0;for(let g=o;g<e;g++)n.charCodeAt(g)===32?r++:a++;let c=0,u=0;for(let g=o;g<i;g++)t.charCodeAt(g)===32?c++:u++;if(r>0&&a>0||c>0&&u>0)return;let d=Math.abs(a-u),f=Math.abs(r-c);if(d===0){s.spacesDiff=f,f>0&&0<=c-1&&c-1<n.length&&c<t.length&&t.charCodeAt(c)!==32&&n.charCodeAt(c-1)===32&&n.charCodeAt(n.length-1)===44&&(s.looksLikeAlignment=!0);return}if(f%d===0){s.spacesDiff=f/d;return}}function Cfe(n,e,t){const i=Math.min(n.getLineCount(),1e4);let s=0,o=0,r="",a=0;const c=[2,4,6,8,3,5,7],u=8;let d=[0,0,0,0,0,0,0,0,0],f=new mEt;for(let _=1;_<=i;_++){let v=n.getLineLength(_),C=n.getLineContent(_);const y=v<=65536;let w=!1,I=0,L=0,O=0;for(let N=0,D=v;N<D;N++){let P=y?C.charCodeAt(N):n.getLineCharCode(_,N);if(P===9)O++;else if(P===32)L++;else{w=!0,I=N;break}}if(!w||(O>0?s++:L>1&&o++,_Et(r,a,C,I,f),f.looksLikeAlignment&&!(t&&e===f.spacesDiff)))continue;let A=f.spacesDiff;A<=u&&d[A]++,r=C,a=I}let g=t;s!==o&&(g=s<o);let p=e;if(g){let _=g?0:.1*i;c.forEach(v=>{let C=d[v];C>_&&(_=C,p=v)}),p===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(p=2)}return{insertSpaces:g,tabSize:p}}function $c(n){return(n.metadata&1)>>>0}function Js(n,e){n.metadata=n.metadata&254|e<<0}function Wl(n){return(n.metadata&2)>>>1===1}function Xs(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function S1e(n){return(n.metadata&4)>>>2===1}function yfe(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function vEt(n){return(n.metadata&24)>>>3}function Efe(n,e){n.metadata=n.metadata&231|e<<3}function bEt(n){return(n.metadata&32)>>>5===1}function Sfe(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class w1e{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Js(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,yfe(this,!1),Efe(this,1),Sfe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Xs(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;let t=this.options.className;yfe(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),Efe(this,this.options.stickiness),Sfe(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const mi=new w1e(null,0,0);mi.parent=mi;mi.left=mi;mi.right=mi;Js(mi,0);class q9{constructor(){this.root=mi,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o){return this.root===mi?[]:LEt(this,e,t,i,s,o)}search(e,t,i){return this.root===mi?[]:IEt(this,e,t,i)}collectNodesFromOwner(e){return SEt(this,e)}collectNodesPostOrder(){return wEt(this)}insert(e){wfe(this,e),this._normalizeDeltaIfNecessary()}delete(e){Ife(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const o=i.start+s,r=i.end+s;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,s){const o=yEt(this,e,e+t);for(let r=0,a=o.length;r<a;r++){const c=o[r];Ife(this,c)}this._normalizeDeltaIfNecessary(),EEt(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let r=0,a=o.length;r<a;r++){const c=o[r];c.start=c.cachedAbsoluteStart,c.end=c.cachedAbsoluteEnd,CEt(c,e,e+t,i,s),c.maxEnd=c.end,wfe(this,c)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,TEt(this))}}function TEt(n){let e=n.root,t=0;for(;e!==mi;){if(e.left!==mi&&!Wl(e.left)){e=e.left;continue}if(e.right!==mi&&!Wl(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,cy(e),Xs(e,!0),Xs(e.left,!1),Xs(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}Xs(n.root,!1)}function r1(n,e,t,i){return n<t?!0:n>t||i===1?!1:i===2?!0:e}function CEt(n,e,t,i,s){const o=vEt(n),r=o===0||o===2,a=o===1||o===2,c=t-e,u=i,d=Math.min(c,u),f=n.start;let g=!1;const p=n.end;let _=!1;e<=f&&p<=t&&bEt(n)&&(n.start=e,g=!0,n.end=e,_=!0);{const C=s?1:c>0?2:0;!g&&r1(f,r,e,C)&&(g=!0),!_&&r1(p,a,e,C)&&(_=!0)}if(d>0&&!s){const C=c>u?2:0;!g&&r1(f,r,e+d,C)&&(g=!0),!_&&r1(p,a,e+d,C)&&(_=!0)}{const C=s?1:0;!g&&r1(f,r,t,C)&&(n.start=e+u,g=!0),!_&&r1(p,a,t,C)&&(n.end=e+u,_=!0)}const v=u-c;g||(n.start=Math.max(0,f+v)),_||(n.end=Math.max(0,p+v)),n.start>n.end&&(n.end=n.start)}function yEt(n,e,t){let i=n.root,s=0,o=0,r=0,a=0,c=[],u=0;for(;i!==mi;){if(Wl(i)){Xs(i.left,!1),Xs(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!Wl(i.left)){if(o=s+i.maxEnd,o<e){Xs(i,!0);continue}if(i.left!==mi){i=i.left;continue}}if(r=s+i.start,r>t){Xs(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[u++]=i),Xs(i,!0),i.right!==mi&&!Wl(i.right)){s+=i.delta,i=i.right;continue}}return Xs(n.root,!1),c}function EEt(n,e,t,i){let s=n.root,o=0,r=0,a=0;const c=i-(t-e);for(;s!==mi;){if(Wl(s)){Xs(s.left,!1),Xs(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),cy(s),s=s.parent;continue}if(!Wl(s.left)){if(r=o+s.maxEnd,r<e){Xs(s,!0);continue}if(s.left!==mi){s=s.left;continue}}if(a=o+s.start,a>t){s.start+=c,s.end+=c,s.delta+=c,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),Xs(s,!0);continue}if(Xs(s,!0),s.right!==mi&&!Wl(s.right)){o+=s.delta,s=s.right;continue}}Xs(n.root,!1)}function SEt(n,e){let t=n.root,i=[],s=0;for(;t!==mi;){if(Wl(t)){Xs(t.left,!1),Xs(t.right,!1),t=t.parent;continue}if(t.left!==mi&&!Wl(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Xs(t,!0),t.right!==mi&&!Wl(t.right)){t=t.right;continue}}return Xs(n.root,!1),i}function wEt(n){let e=n.root,t=[],i=0;for(;e!==mi;){if(Wl(e)){Xs(e.left,!1),Xs(e.right,!1),e=e.parent;continue}if(e.left!==mi&&!Wl(e.left)){e=e.left;continue}if(e.right!==mi&&!Wl(e.right)){e=e.right;continue}t[i++]=e,Xs(e,!0)}return Xs(n.root,!1),t}function IEt(n,e,t,i){let s=n.root,o=0,r=0,a=0,c=[],u=0;for(;s!==mi;){if(Wl(s)){Xs(s.left,!1),Xs(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),s=s.parent;continue}if(s.left!==mi&&!Wl(s.left)){s=s.left;continue}r=o+s.start,a=o+s.end,s.setCachedOffsets(r,a,i);let d=!0;if(e&&s.ownerId&&s.ownerId!==e&&(d=!1),t&&S1e(s)&&(d=!1),d&&(c[u++]=s),Xs(s,!0),s.right!==mi&&!Wl(s.right)){o+=s.delta,s=s.right;continue}}return Xs(n.root,!1),c}function LEt(n,e,t,i,s,o){let r=n.root,a=0,c=0,u=0,d=0,f=[],g=0;for(;r!==mi;){if(Wl(r)){Xs(r.left,!1),Xs(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(!Wl(r.left)){if(c=a+r.maxEnd,c<e){Xs(r,!0);continue}if(r.left!==mi){r=r.left;continue}}if(u=a+r.start,u>t){Xs(r,!0);continue}if(d=a+r.end,d>=e){r.setCachedOffsets(u,d,o);let p=!0;i&&r.ownerId&&r.ownerId!==i&&(p=!1),s&&S1e(r)&&(p=!1),p&&(f[g++]=r)}if(Xs(r,!0),r.right!==mi&&!Wl(r.right)){a+=r.delta,r=r.right;continue}}return Xs(n.root,!1),f}function wfe(n,e){if(n.root===mi)return e.parent=mi,e.left=mi,e.right=mi,Js(e,0),n.root=e,n.root;OEt(n,e),YT(e.parent);let t=e;for(;t!==n.root&&$c(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;$c(i)===1?(Js(t.parent,0),Js(i,0),Js(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,QD(n,t)),Js(t.parent,0),Js(t.parent.parent,1),ZD(n,t.parent.parent))}else{const i=t.parent.parent.left;$c(i)===1?(Js(t.parent,0),Js(i,0),Js(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,ZD(n,t)),Js(t.parent,0),Js(t.parent.parent,1),QD(n,t.parent.parent))}return Js(n.root,0),e}function OEt(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(MEt(s,o,i.start+t,i.end+t)<0)if(i.left===mi){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===mi){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=mi,e.right=mi,Js(e,1)}function Ife(n,e){let t,i;if(e.left===mi?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===mi?(t=e.left,i=e):(i=REt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,Js(t,0),e.detach(),J9(),cy(t),n.root.parent=mi;return}let s=$c(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Js(i,$c(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==mi&&(i.left.parent=i),i.right!==mi&&(i.right.parent=i)),e.detach(),s){YT(t.parent),i!==e&&(YT(i),YT(i.parent)),J9();return}YT(t),YT(t.parent),i!==e&&(YT(i),YT(i.parent));let o;for(;t!==n.root&&$c(t)===0;)t===t.parent.left?(o=t.parent.right,$c(o)===1&&(Js(o,0),Js(t.parent,1),QD(n,t.parent),o=t.parent.right),$c(o.left)===0&&$c(o.right)===0?(Js(o,1),t=t.parent):($c(o.right)===0&&(Js(o.left,0),Js(o,1),ZD(n,o),o=t.parent.right),Js(o,$c(t.parent)),Js(t.parent,0),Js(o.right,0),QD(n,t.parent),t=n.root)):(o=t.parent.left,$c(o)===1&&(Js(o,0),Js(t.parent,1),ZD(n,t.parent),o=t.parent.left),$c(o.left)===0&&$c(o.right)===0?(Js(o,1),t=t.parent):($c(o.left)===0&&(Js(o.right,0),Js(o,1),QD(n,o),o=t.parent.left),Js(o,$c(t.parent)),Js(t.parent,0),Js(o.left,0),ZD(n,t.parent),t=n.root));Js(t,0),J9()}function REt(n){for(;n.left!==mi;)n=n.left;return n}function J9(){mi.parent=mi,mi.delta=0,mi.start=0,mi.end=0}function QD(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==mi&&(t.left.parent=e),t.parent=e.parent,e.parent===mi?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,cy(e),cy(t)}function ZD(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==mi&&(t.right.parent=e),t.parent=e.parent,e.parent===mi?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,cy(e),cy(t)}function I1e(n){let e=n.end;if(n.left!==mi){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==mi){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function cy(n){n.maxEnd=I1e(n)}function YT(n){for(;n!==mi;){const e=I1e(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function MEt(n,e,t,i){return n===t?e-i:n-t}class Jq{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==li)return gie(this.right);let e=this;for(;e.parent!==li&&e.parent.left!==e;)e=e.parent;return e.parent===li?li:e.parent}prev(){if(this.left!==li)return L1e(this.left);let e=this;for(;e.parent!==li&&e.parent.right!==e;)e=e.parent;return e.parent===li?li:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const li=new Jq(null,0);li.parent=li;li.left=li;li.right=li;li.color=0;function gie(n){for(;n.left!==li;)n=n.left;return n}function L1e(n){for(;n.right!==li;)n=n.right;return n}function pie(n){return n===li?0:n.size_left+n.piece.length+pie(n.right)}function mie(n){return n===li?0:n.lf_left+n.piece.lineFeedCnt+mie(n.right)}function Q9(){li.parent=li}function e$(n,e){let t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==li&&(t.left.parent=e),t.parent=e.parent,e.parent===li?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function t$(n,e){let t=e.left;e.left=t.right,t.right!==li&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===li?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function qH(n,e){let t,i;if(e.left===li?(i=e,t=i.right):e.right===li?(i=e,t=i.left):(i=gie(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),Q9(),n.root.parent=li;return}let s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,dD(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,dD(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==li&&(i.left.parent=i),i.right!==li&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,dD(n,i)),e.detach(),t.parent.left===t){let r=pie(t),a=mie(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){let c=r-t.parent.size_left,u=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,mv(n,t.parent,c,u)}}if(dD(n,t.parent),s){Q9();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,e$(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,t$(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,e$(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,t$(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,e$(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,t$(n,t.parent),t=n.root));t.color=0,Q9()}function Lfe(n,e){for(dD(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,e$(n,e)),e.parent.color=0,e.parent.parent.color=1,t$(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,t$(n,e)),e.parent.color=0,e.parent.parent.color=1,e$(n,e.parent.parent))}n.root.color=0}function mv(n,e,t,i){for(;e!==n.root&&e!==li;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function dD(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=pie(e.left)-e.size_left,i=mie(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}class kEt extends pM{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}function AEt(n){let e={};return t=>(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const Ih=AEt(n=>new kEt(n)),NEt=999;class vS{constructor(e,t,i,s){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=DEt(this.searchString):e=this.searchString.indexOf(`
- `)>=0;let t=null;try{t=iLe(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new $Et(t,this.wordSeparators?Ih(this.wordSeparators):null,i?this.searchString:null)}}function DEt(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e<t;e++)if(n.charCodeAt(e)===92){if(e++,e>=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}return!1}class $Et{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function RS(n,e,t){if(!t)return new yx(n,null);let i=[];for(let s=0,o=e.length;s<o;s++)i[s]=e[s];return new yx(n,i)}class Ofe{constructor(e){let t=[],i=0;for(let s=0,o=e.length;s<o;s++)e.charCodeAt(s)===10&&(t[i++]=s);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,s=t.length-1;if(s===-1||e<=t[0])return 0;for(;i<s;){const o=i+((s-i)/2>>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class JH{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new hD(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,c=0;s?(c=s.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let u;if(s){let p=s.findLineFeedCountBeforeOffset(o+r.length)-c;u=a+r.length+p}else u=a+r.length;const d=e.getPositionAt(a),f=e.getPositionAt(u);return new be(d.lineNumber,d.column,f.lineNumber,f.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),c=e.getEOL()===`\r
- `?new Ofe(a):null,u=[];let d=0,f;for(i.reset(0);f=i.next(a);)if(u[d++]=RS(this._getMultilineMatchRange(e,r,a,c,f.index,f[0]),f,s),d>=o)return u;return u}static _doFindMatchesLineByLine(e,t,i,s,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const u=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,u,t.startLineNumber,t.startColumn-1,a,r,s,o),r}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let u=t.startLineNumber+1;u<t.endLineNumber&&a<o;u++)a=this._findMatchesInLine(i,e.getLineContent(u),u,0,a,r,s,o);if(a<o){const u=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,u,t.endLineNumber,0,a,r,s,o)}return r}static _findMatchesInLine(e,t,i,s,o,r,a,c){const u=e.wordSeparators;if(!a&&e.simpleSearch){const g=e.simpleSearch,p=g.length,_=t.length;let v=-p;for(;(v=t.indexOf(g,v+p))!==-1;)if((!u||_ie(u,t,_,v,p))&&(r[o++]=new yx(new be(i,v+1+s,i,v+1+p+s),null),o>=c))return o;return o}const d=new hD(e.wordSeparators,e.regex);let f;d.reset(0);do if(f=d.next(t),f&&(r[o++]=RS(new be(i,f.index+1+s,i,f.index+1+f[0].length+s),f,a),o>=c))return o;while(f);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new hD(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new ct(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),c=e.getValueInRange(new be(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),u=e.getEOL()===`\r
- `?new Ofe(c):null;i.reset(t.column-1);let d=i.next(c);return d?RS(this._getMultilineMatchRange(e,r,c,u,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new ct(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,s);if(c)return c;for(let u=1;u<=o;u++){const d=(r+u-1)%o,f=e.getLineContent(d+1),g=this._findFirstMatchInLine(i,f,d+1,1,s);if(g)return g}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?RS(new be(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new hD(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new be(1,1,t.lineNumber,t.column),i,s,10*NEt);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new ct(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,s);if(c)return c;for(let u=1;u<=o;u++){const d=(o+r-u-1)%o,f=e.getLineContent(d+1),g=this._findLastMatchInLine(i,f,d+1,s);if(g)return g}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=RS(new be(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function xEt(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==0)return!0}return!1}function PEt(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==0)return!0}return!1}function _ie(n,e,t,i,s){return xEt(n,e,t,i,s)&&PEt(n,e,t,i,s)}class hD{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){wv(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||_ie(this._wordSeparators,e,t,s,o))return i}while(i);return null}}const av=65535;function O1e(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class FEt{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function vv(n,e=!0){let t=[0],i=1;for(let s=0,o=n.length;s<o;s++){const r=n.charCodeAt(s);r===13?s+1<o&&n.charCodeAt(s+1)===10?(t[i++]=s+2,s++):t[i++]=s+1:r===10&&(t[i++]=s+1)}return e?O1e(t):t}function BEt(n,e){n.length=0,n[0]=0;let t=1,i=0,s=0,o=0,r=!0;for(let c=0,u=e.length;c<u;c++){const d=e.charCodeAt(c);d===13?c+1<u&&e.charCodeAt(c+1)===10?(o++,n[t++]=c+2,c++):(i++,n[t++]=c+1):d===10?(s++,n[t++]=c+1):r&&d!==9&&(d<32||d>126)&&(r=!1)}const a=new FEt(O1e(n),i,s,o,r);return n.length=0,a}class gu{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class MS{constructor(e,t){this.buffer=e,this.lineStarts=t}}class HEt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==li&&e.iterate(e.root,i=>(i!==li&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class VEt{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let s=0;s<i.length;s++){let o=i[s];if(o.node.parent===null||o.nodeStartOffset>=e){i[s]=null,t=!0;continue}}if(t){let s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class UEt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new MS("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=li,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o<r;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=vv(e[o].buffer));let a=new gu(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new VEt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=av,i=t-Math.floor(t/3),s=i*2,o="",r=0,a=[];if(this.iterate(this.root,c=>{let u=this.getNodeContent(c),d=u.length;if(r<=i||r+d<s)return o+=u,r+=d,!0;let f=o.replace(/\r\n|\r|\n/g,e);return a.push(new MS(f,vv(f))),o=u,r=d,!0}),r>0){let c=o.replace(/\r\n|\r|\n/g,e);a.push(new MS(c,vv(c)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new HEt(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==li;)if(s.left!==li&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;let o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0,s=e;for(;t!==li;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){let r=this.getOffsetAt(i+1,1),a=s-r;return new ct(i+1,a+1)}return new ct(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===li){let o=this.getOffsetAt(i+1,1),r=s-e-o;return new ct(i+1,r+1)}else t=t.right;return new ct(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){let a=e.node,c=this._buffers[a.piece.bufferIndex].buffer,u=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return c.substring(u+e.remainder,u+t.remainder)}let i=e.node,s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==li;){let a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(c,c+t.remainder);break}else r+=a.substr(c,i.piece.length);i=i.next()}return r}getLinesContent(){let e=[],t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===li)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const c=this._buffers[r.bufferIndex].buffer,u=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,f=r.end.line;let g=u[d]+r.start.column;if(s&&(c.charCodeAt(g)===10&&(g++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===f)return!this._EOLNormalized&&c.charCodeAt(g+a-1)===13?(s=!0,i+=c.substr(g,a-1)):i+=c.substr(g,a),!0;i+=this._EOLNormalized?c.substring(g,Math.max(g,u[d+1]-this._EOLLength)):c.substring(g,u[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let p=d+1;p<f;p++)i=this._EOLNormalized?c.substring(u[p],u[p+1]-this._EOLLength):c.substring(u[p],u[p+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return!this._EOLNormalized&&c.charCodeAt(u[f]+r.end.column-1)===13?(s=!0,r.end.column===0?t--:i=c.substr(u[f],r.end.column-1)):i=c.substr(u[f],r.end.column),!0}),s&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let i=this._buffers[t.piece.bufferIndex],s=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(s)}else{let t=this._buffers[e.node.piece.bufferIndex],s=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(s)}}getLineCharCode(e,t){let i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,s,o,r,a,c,u,d,f){let g=this._buffers[e.piece.bufferIndex],p=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),_=this.offsetInBuffer(e.piece.bufferIndex,o),v=this.offsetInBuffer(e.piece.bufferIndex,r),C,y={line:0,column:0},w,I;t._wordSeparators?(w=g.buffer.substring(_,v),I=L=>L+_,t.reset(0)):(w=g.buffer,I=L=>L,t.reset(_));do if(C=t.next(w),C){if(I(C.index)>=v)return d;this.positionInBuffer(e,I(C.index)-p,y);let L=this.getLineFeedCnt(e.piece.bufferIndex,o,y),O=y.line===o.line?y.column-o.column+s:y.column+1,A=O+C[0].length;if(f[d++]=RS(new be(i+L,O,i+L,A),C,c),I(C.index)+C[0].length>=v||d>=u)return d}while(C);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new hD(t.wordSeparators,t.regex);let c=this.nodeAt2(e.startLineNumber,e.startColumn);if(c===null)return[];let u=this.nodeAt2(e.endLineNumber,e.endColumn);if(u===null)return[];let d=this.positionInBuffer(c.node,c.remainder),f=this.positionInBuffer(u.node,u.remainder);if(c.node===u.node)return this.findMatchesInNode(c.node,a,e.startLineNumber,e.startColumn,d,f,t,i,s,r,o),o;let g=e.startLineNumber,p=c.node;for(;p!==u.node;){let v=this.getLineFeedCnt(p.piece.bufferIndex,d,p.piece.end);if(v>=1){let y=this._buffers[p.piece.bufferIndex].lineStarts,w=this.offsetInBuffer(p.piece.bufferIndex,p.piece.start),I=y[d.line+v],L=g===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(p,a,g,L,d,this.positionInBuffer(p,I-w),t,i,s,r,o),r>=s)return o;g+=v}let C=g===e.startLineNumber?e.startColumn-1:0;if(g===e.endLineNumber){const y=this.getLineContent(g).substring(C,e.endColumn-1);return r=this._findMatchesInLine(t,a,y,e.endLineNumber,C,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(g).substr(C),g,C,r,o,i,s),r>=s)return o;g++,c=this.nodeAt2(g,1),p=c.node,d=this.positionInBuffer(c.node,c.remainder)}if(g===e.endLineNumber){let v=g===e.startLineNumber?e.startColumn-1:0;const C=this.getLineContent(g).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,C,e.endLineNumber,v,r,o,i,s),o}let _=g===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(u.node,a,g,_,d,f,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,c,u){const d=e.wordSeparators;if(!c&&e.simpleSearch){const g=e.simpleSearch,p=g.length,_=i.length;let v=-p;for(;(v=i.indexOf(g,v+p))!==-1;)if((!d||_ie(d,i,_,v,p))&&(a[r++]=new yx(new be(s,v+1+o,s,v+1+p+o),null),r>=u))return r;return r}let f;t.reset(0);do if(f=t.next(i),f&&(a[r++]=RS(new be(s,f.index+1+o,s,f.index+1+f[0].length+o),f,c),r>=u))return r;while(f);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==li){let{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,c=a.bufferIndex,u=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.length<av){this.appendToNode(s,t),this.computeBufferMetadata();return}if(r===e)this.insertContentToNodeLeft(t,s),this._searchCache.validate(e);else if(r+s.piece.length>e){let d=[],f=new gu(a.bufferIndex,u,a.end,this.getLineFeedCnt(a.bufferIndex,u,a.end),this.offsetInBuffer(c,a.end)-this.offsetInBuffer(c,u));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){let v={line:f.start.line+1,column:0};f=new gu(f.bufferIndex,v,f.end,this.getLineFeedCnt(f.bufferIndex,v,f.end),f.length-1),t+=`
- `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){let v=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,v),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,u);else this.deleteNodeTail(s,u);let g=this.createNewPieces(t);f.length>0&&this.rbInsertRight(s,f);let p=s;for(let _=0;_<g.length;_++)p=this.rbInsertRight(p,g[_]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,s)}else{let s=this.createNewPieces(t),o=this.rbInsertLeft(null,s[0]);for(let r=1;r<s.length;r++)o=this.rbInsertRight(o,s[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===li)return;let i=this.nodeAt(e),s=this.nodeAt(e+t),o=i.node,r=s.node;if(o===r){let g=this.positionInBuffer(o,i.remainder),p=this.positionInBuffer(o,s.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){let _=o.next();qH(this,o),this.validateCRLFWithPrevNode(_),this.computeBufferMetadata();return}this.deleteNodeHead(o,p),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(i.nodeStartOffset+o.piece.length===e+t){this.deleteNodeTail(o,g),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,g,p),this.computeBufferMetadata();return}let a=[],c=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,c),this._searchCache.validate(e),o.piece.length===0&&a.push(o);let u=this.positionInBuffer(r,s.remainder);this.deleteNodeHead(r,u),r.piece.length===0&&a.push(r);let d=o.next();for(let g=d;g!==li&&g!==r;g=g.next())a.push(g);let f=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(f),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let r=t.piece,a={line:r.start.line+1,column:0},c=new gu(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=c,e+=`
- `,mv(this,t,-1,-1),t.piece.length===0&&i.push(t)}let s=this.createNewPieces(e),o=this.rbInsertLeft(t,s[s.length-1]);for(let r=s.length-2;r>=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
- `);let i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]),o=s;for(let r=1;r<i.length;r++)o=this.rbInsertRight(o,i[r]);this.validateCRLFWithPrevNode(s)}positionInBuffer(e,t,i){let s=e.piece,o=e.piece.bufferIndex,r=this._buffers[o].lineStarts,c=r[s.start.line]+s.start.column+t,u=s.start.line,d=s.end.line,f=0,g=0,p=0;for(;u<=d&&(f=u+(d-u)/2|0,p=r[f],f!==d);)if(g=r[f+1],c<p)d=f-1;else if(c>=g)u=f+1;else break;return i?(i.line=f,i.column=c-p,null):{line:f,column:c-p}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;let s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;let o=s[i.line+1],r=s[i.line]+i.column;if(o>r+1)return i.line-t.line;let a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)qH(this,e[t])}createNewPieces(e){if(e.length>av){let d=[];for(;e.length>av;){const g=e.charCodeAt(av-1);let p;g===13||g>=55296&&g<=56319?(p=e.substring(0,av-1),e=e.substring(av-1)):(p=e.substring(0,av),e=e.substring(av));let _=vv(p);d.push(new gu(this._buffers.length,{line:0,column:0},{line:_.length-1,column:p.length-_[_.length-1]},_.length-1,p.length)),this._buffers.push(new MS(p,_))}let f=vv(e);return d.push(new gu(this._buffers.length,{line:0,column:0},{line:f.length-1,column:e.length-f[f.length-1]},f.length-1,e.length)),this._buffers.push(new MS(e,f)),d}let t=this._buffers[0].buffer.length;const i=vv(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d<i.length;d++)i[d]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let d=0;d<i.length;d++)i[d]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length;let r=this._buffers[0].lineStarts.length-1,a=o-this._buffers[0].lineStarts[r],c={line:r,column:a},u=new gu(0,s,c,this.getLineFeedCnt(0,s,c),o-t);return this._lastChangeBufferPos=c,[u]}getLineRawContent(e,t=0){let i=this.root,s="",o=this._searchCache.get2(e);if(o){i=o.node;let r=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt===e)s=a.substring(c+r,c+i.piece.length);else{let u=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return a.substring(c+r,c+u-t)}}else{let r=0;const a=e;for(;i!==li;)if(i.left!==li&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let c=this.getAccumulatedValue(i,e-i.lf_left-2),u=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,f=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(f+c,f+u-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let c=this.getAccumulatedValue(i,e-i.lf_left-2),u=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=u.substring(d+c,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==li;){let r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let a=this.getAccumulatedValue(i,0),c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=r.substring(c,c+a-t),s}else{let a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==li;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){let i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),c=this.getLineFeedCnt(i.bufferIndex,i.start,r),u=c-s,d=a-o,f=i.length+d;e.piece=new gu(i.bufferIndex,i.start,r,c,f),mv(this,e,d,u)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),c=this.offsetInBuffer(i.bufferIndex,r),u=a-s,d=o-c,f=i.length+d;e.piece=new gu(i.bufferIndex,r,i.end,a,f),mv(this,e,d,u)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,c=s.lineFeedCnt,u=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,u),f=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new gu(s.bufferIndex,s.start,u,d,f),mv(this,e,f-a,d-c);let g=new gu(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),p=this.rbInsertRight(e,g);this.validateCRLFWithPrevNode(p)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
- `);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=vv(t,!1);for(let p=0;p<o.length;p++)o[p]+=s;if(i){let p=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:s-p}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],c={line:r,column:a},u=e.piece.length+t.length,d=e.piece.lineFeedCnt,f=this.getLineFeedCnt(0,e.piece.start,c),g=f-d;e.piece=new gu(e.piece.bufferIndex,e.piece.start,c,f,u),this._lastChangeBufferPos=c,mv(this,e,t.length,g)}nodeAt(e){let t=this.root,i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let s=0;for(;t!==li;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;let o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==li;)if(i.left!==li&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==li;){if(i.piece.lineFeedCnt>0){let o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){let o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
- `)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===li||e.piece.lineFeedCnt===0)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===li||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i=[],s=this._buffers[e.piece.bufferIndex].lineStarts,o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new gu(e.piece.bufferIndex,e.piece.start,o,a,r),mv(this,e,-1,-1),e.piece.length===0&&i.push(e);let c={line:t.piece.start.line+1,column:0};const u=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,c,t.piece.end);t.piece=new gu(t.piece.bufferIndex,c,t.piece.end,d,u),mv(this,t,-1,-1),t.piece.length===0&&i.push(t);let f=this.createNewPieces(`\r
- `);this.rbInsertRight(e,f[0]);for(let g=0;g<i.length;g++)qH(this,i[g])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let i=t.next();if(this.startWithLF(i)){if(e+=`
- `,i.piece.length===1)qH(this,i);else{const s=i.piece,o={line:s.start.line+1,column:0},r=s.length-1,a=this.getLineFeedCnt(s.bufferIndex,o,s.end);i.piece=new gu(s.bufferIndex,o,s.end,a,r),mv(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===li)return t(li);let i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===li)return"";let t=this._buffers[e.piece.bufferIndex],i,s=e.piece,o=this.offsetInBuffer(s.bufferIndex,s.start),r=this.offsetInBuffer(s.bufferIndex,s.end);return i=t.buffer.substring(o,r),i}getPieceContent(e){let t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),s=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,s)}rbInsertRight(e,t){let i=new Jq(t,1);if(i.left=li,i.right=li,i.parent=li,i.size_left=0,i.lf_left=0,this.root===li)this.root=i,i.color=0;else if(e.right===li)e.right=i,i.parent=e;else{let o=gie(e.right);o.left=i,i.parent=o}return Lfe(this,i),i}rbInsertLeft(e,t){let i=new Jq(t,1);if(i.left=li,i.right=li,i.parent=li,i.size_left=0,i.lf_left=0,this.root===li)this.root=i,i.color=0;else if(e.left===li)e.left=i,i.parent=e;else{let s=L1e(e.left);s.right=i,i.parent=s}return Lfe(this,i),i}}function TR(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o<r;o++){const a=n.charCodeAt(o);a===13?(e===0&&(t=o),e++,o+1<r&&n.charCodeAt(o+1)===10?(s|=2,o++):s|=3,i=o+1):a===10&&(s|=1,e===0&&(t=o),e++,i=o+1)}return e===0&&(t=n.length),[e,t,n.length-i,s]}function Rfe(n){return(n<<0|0|0|16384|2<<23)>>>0}const cv=new Uint32Array(0).buffer;class Z9{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1];if(i.startLineNumber+i.tokens.length-1+1===e){i.tokens.push(t);return}}this.tokens.push(new WEt(e,[t]))}}class L3{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return e===0?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(e===0)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),s=this._getEndCharacter(e-1);return new be(0,t+1,i,s+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return this._getTokenCount()===0}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const s=t+Math.floor((i-t)/2),o=this._getDeltaLine(s);if(o<e)t=s+1;else if(o>e)i=s-1;else{let r=s;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=s;for(;a<i&&this._getDeltaLine(a+1)===e;)a++;return new Mfe(this._tokens.subarray(4*r,4*a+4))}}return this._getDeltaLine(t)===e?new Mfe(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,s){const o=this._tokens,r=this._tokenCount;let a=0,c=!1,u=0;for(let d=0;d<r;d++){const f=4*d,g=o[f],p=o[f+1],_=o[f+2],v=o[f+3];if((g>e||g===e&&_>=t)&&(g<i||g===i&&p<=s))c=!0;else{if(a===0&&(u=g),c){const C=4*a;o[C]=g-u,o[C+1]=p,o[C+2]=_,o[C+3]=v}a++}}return this._tokenCount=a,u}split(e,t,i,s){const o=this._tokens,r=this._tokenCount;let a=[],c=[],u=a,d=0,f=0;for(let g=0;g<r;g++){const p=4*g,_=o[p],v=o[p+1],C=o[p+2],y=o[p+3];if(_>e||_===e&&C>=t){if(_<i||_===i&&v<=s)continue;u!==c&&(u=c,d=0,f=_)}u[d++]=_-f,u[d++]=v,u[d++]=C,u[d++]=y}return[new L3(new Uint32Array(a)),new L3(new Uint32Array(c)),f]}acceptDeleteRange(e,t,i,s,o){const r=this._tokens,a=this._tokenCount,c=s-t;let u=0,d=!1;for(let f=0;f<a;f++){const g=4*f;let p=r[g],_=r[g+1],v=r[g+2];const C=r[g+3];if(p<t||p===t&&v<=i){u++;continue}else if(p===t&&_<i)p===s&&v>o?v-=o-i:v=i;else if(p===t&&_===i)if(p===s&&v>o)v-=o-i;else{d=!0;continue}else if(p<s||p===s&&_<o)if(p===s&&v>o)p===t?(_=i,v=_+(v-o)):(_=0,v=_+(v-o));else{d=!0;continue}else if(p>s){if(c===0&&!d){u=a;break}p-=c}else if(p===s&&_>=o)e&&p===0&&(_+=e,v+=e),p-=c,_-=o-i,v-=o-i;else throw new Error("Not possible!");const y=4*u;r[y]=p,r[y+1]=_,r[y+2]=v,r[y+3]=C,u++}this._tokenCount=u}acceptInsertText(e,t,i,s,o,r){const a=i===0&&s===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),c=this._tokens,u=this._tokenCount;for(let d=0;d<u;d++){const f=4*d;let g=c[f],p=c[f+1],_=c[f+2];if(!(g<e||g===e&&_<t)){if(g===e&&_===t)if(a)_+=1;else continue;else if(g===e&&p<t&&t<_)i===0?_+=s:_=t;else{if(g===e&&p===t&&a)continue;if(g===e)if(g+=i,i===0)p+=s,_+=s;else{const v=_-p;p=o+(p-t),_=p+v}else g+=i}c[f]=g,c[f+1]=p,c[f+2]=_}}}}class Mfe{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}class O3{constructor(e,t){this.startLineNumber=e,this.tokens=t,this.endLineNumber=this.startLineNumber+this.tokens.getMaxDeltaLine()}toString(){return this.tokens.toString(this.startLineNumber)}_updateEndLineNumber(){this.endLineNumber=this.startLineNumber+this.tokens.getMaxDeltaLine()}isEmpty(){return this.tokens.isEmpty()}getLineTokens(e){return this.startLineNumber<=e&&e<=this.endLineNumber?this.tokens.getLineTokens(e-this.startLineNumber):null}getRange(){const e=this.tokens.getRange();return e&&new be(this.startLineNumber+e.startLineNumber,e.startColumn,this.startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;this.startLineNumber+=this.tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber,[s,o,r]=this.tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new O3(this.startLineNumber,s),new O3(this.startLineNumber+r,o)]}applyEdit(e,t){const[i,s,o]=TR(t);this.acceptEdit(e,i,s,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new ct(e.startLineNumber,e.startColumn),t,i,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const o=i-t;this.startLineNumber-=o;return}const s=this.tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this.startLineNumber=0,this.tokens.clear();return}if(t<0){const o=-t;this.startLineNumber-=o,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,o){if(t===0&&i===0)return;const r=e.lineNumber-this.startLineNumber;if(r<0){this.startLineNumber+=t;return}const a=this.tokens.getMaxDeltaLine();r>=a+1||this.tokens.acceptInsertText(r,e.column-1,t,i,s,o)}}class WEt{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function uv(n){return n instanceof Uint32Array?n:new Uint32Array(n)}class vie{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;o<r;o++){const a=this._pieces[o];if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){s=s||{index:o};continue}const[c,u]=a.split(i);if(c.isEmpty()){s=s||{index:o};continue}u.isEmpty()||(this._pieces.splice(o,1,c,u),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=Rx(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(i.length===0)return t;const s=vie._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let c=0,u=[],d=0,f=0;const g=(p,_)=>{p!==f&&(f=p,u[d++]=p,u[d++]=_)};for(let p=0;p<a;p++){const _=o.getStartCharacter(p),v=o.getEndCharacter(p),C=o.getMetadata(p),y=((C&1?2048:0)|(C&2?4096:0)|(C&4?8192:0)|(C&8?8372224:0)|(C&16?4286578688:0))>>>0,w=~y>>>0;for(;c<r&&t.getEndOffset(c)<=_;)g(t.getEndOffset(c),t.getMetadata(c)),c++;for(c<r&&t.getStartOffset(c)<_&&g(_,t.getMetadata(c));c<r&&t.getEndOffset(c)<v;)g(t.getEndOffset(c),t.getMetadata(c)&w|C&y),c++;if(c<r)g(v,t.getMetadata(c)&w|C&y),t.getEndOffset(c)===v&&c++;else{const I=Math.min(Math.max(0,c-1),r-1);g(v,t.getMetadata(I)&w|C&y)}}for(;c<r;)g(t.getEndOffset(c),t.getMetadata(c)),c++;return new El(new Uint32Array(u),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,s=e.length-1;for(;i<s;){let o=i+Math.floor((s-i)/2);if(e[o].endLineNumber<t)i=o+1;else if(e[o].startLineNumber>t)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class nh{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let s=null;if(t<this._len&&(s=this._lineTokens[t]),s!==null&&s!==cv)return new El(uv(s),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=Rfe(this._languageIdCodec.encodeLanguageId(e)),new El(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const s=i?uv(i):null;if(t===0){let o=!1;if(s&&s.length>1&&(o=Ba.getLanguageId(s[1])!==e),!o)return cv}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=Rfe(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;let i=[];for(let s=0;s<t;s++)i[s]=null;this._lineTokens=Rx(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,s,o){const r=nh._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,s);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=r,o?!nh._equals(a,r):!1}static _equals(e,t){if(!e||!t)return!e&&!t;const i=uv(e),s=uv(t);if(i.length!==s.length)return!1;for(let o=0,r=i.length;o<r;o++)if(i[o]!==s[o])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new ct(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=nh._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=nh._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i<this._len&&(s=nh._deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=nh._append(this._lineTokens[t],s),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(t===0&&i===0)return;const s=e.lineNumber-1;if(!(s>=this._len)){if(t===0){this._lineTokens[s]=nh._insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=nh._deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=nh._insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}static _deleteBeginning(e,t){return e===null||e===cv?e:nh._delete(e,0,t)}static _deleteEnding(e,t){if(e===null||e===cv)return e;const i=uv(e),s=i[i.length-2];return nh._delete(e,t,s)}static _delete(e,t,i){if(e===null||e===cv||t===i)return e;const s=uv(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return cv;const r=El.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,c=s[r<<1];if(i<c){const p=i-t;for(let _=r;_<o;_++)s[_<<1]-=p;return e}let u,d;a!==t?(s[r<<1]=t,u=r+1<<1,d=t):(u=r<<1,d=a);const f=i-t;for(let p=r+1;p<o;p++){const _=s[p<<1]-f;_>d&&(s[u++]=_,s[u++]=s[(p<<1)+1],d=_)}if(u===s.length)return e;let g=new Uint32Array(u);return g.set(s.subarray(0,u),0),g.buffer}static _append(e,t){if(t===cv)return e;if(e===cv)return t;if(e===null)return e;if(t===null)return null;const i=uv(e),s=uv(t),o=s.length>>>1;let r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let u=0;u<o;u++)r[a++]=s[u<<1]+c,r[a++]=s[(u<<1)+1];return r.buffer}static _insert(e,t,i){if(e===null||e===cv)return e;const s=uv(e),o=s.length>>>1;let r=El.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a<o;a++)s[a<<1]+=i;return e}}class IO extends wt{constructor(e,t,i,s,o,r,a){super(),this._onDidChangeContent=this._register(new rt),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._pieceTree=new UEt(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){let i=e+t;const s=this.getPositionAt(e),o=this.getPositionAt(i);return new be(s.lineNumber,s.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;let i=this.getOffsetAt(e.startLineNumber,e.startColumn);return this.getOffsetAt(e.endLineNumber,e.endColumn)-i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const s=e.startLineNumber,o=e.endLineNumber;for(let r=s;r<=o;r++){const a=this.getLineContent(r),c=r===s?e.startColumn-1:0,u=r===o?e.endColumn-1:a.length;for(let d=c;d<u;d++)yl(a.charCodeAt(d))?(i=i+1,d=d+1):i=i+1}return i+=this._getEndOfLine(t).length*(o-s),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=cc(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Fm(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
- `;case 2:return`\r
- `;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let s=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,c=[];for(let v=0;v<e.length;v++){let C=e[v];a&&C._isTracked&&(a=!1);let y=C.range;if(C.text){let A=!0;r||(A=!Dne(C.text),r=A),!s&&A&&(s=z8(C.text)),!o&&A&&(o=rLe(C.text))}let w="",I=0,L=0,O=0;if(C.text){let A;[I,L,O,A]=TR(C.text);const N=this.getEOL();A===0||A===(N===`\r
- `?2:1)?w=C.text:w=C.text.replace(/\r\n|\r|\n/g,N)}c[v]={sortIndex:v,identifier:C.identifier||null,range:y,rangeOffset:this.getOffsetAt(y.startLineNumber,y.startColumn),rangeLength:this.getValueLengthInRange(y),text:w,eolCount:I,firstLineLength:L,lastLineLength:O,forceMoveMarkers:!!C.forceMoveMarkers,isAutoWhitespaceEdit:C.isAutoWhitespaceEdit||!1}}c.sort(IO._sortOpsAscending);let u=!1;for(let v=0,C=c.length-1;v<C;v++){let y=c[v].range.getEndPosition(),w=c[v+1].range.getStartPosition();if(w.isBeforeOrEqual(y)){if(w.isBefore(y))throw new Error("Overlapping ranges are not allowed!");u=!0}}a&&(c=this._reduceOperations(c));let d=i||t?IO._getInverseEditRanges(c):[],f=[];if(t)for(let v=0;v<c.length;v++){let C=c[v],y=d[v];if(C.isAutoWhitespaceEdit&&C.range.isEmpty())for(let w=y.startLineNumber;w<=y.endLineNumber;w++){let I="";w===y.startLineNumber&&(I=this.getLineContent(C.range.startLineNumber),cc(I)!==-1)||f.push({lineNumber:w,oldContent:I})}}let g=null;if(i){let v=0;g=[];for(let C=0;C<c.length;C++){const y=c[C],w=d[C],I=this.getValueInRange(y.range),L=y.rangeOffset+v;v+=y.text.length-I.length,g[C]={sortIndex:y.sortIndex,identifier:y.identifier,range:w,text:I,textChange:new $l(y.rangeOffset,I,L,y.text)}}u||g.sort((C,y)=>C.sortIndex-y.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const p=this._doApplyEdits(c);let _=null;if(t&&f.length>0){f.sort((v,C)=>C.lineNumber-v.lineNumber),_=[];for(let v=0,C=f.length;v<C;v++){let y=f[v].lineNumber;if(v>0&&f[v-1].lineNumber===y)continue;let w=f[v].oldContent,I=this.getLineContent(y);I.length===0||I===w||cc(I)!==-1||_.push(y)}}return this._onDidChangeContent.fire(),new Ubt(g,p,_)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,o=new be(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let r=i.startLineNumber,a=i.startColumn;const c=[];for(let p=0,_=e.length;p<_;p++){const v=e[p],C=v.range;t=t||v.forceMoveMarkers,c.push(this.getValueInRange(new be(r,a,C.startLineNumber,C.startColumn))),v.text.length>0&&c.push(v.text),r=C.endLineNumber,a=C.endColumn}const u=c.join(""),[d,f,g]=TR(u);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:u,eolCount:d,firstLineLength:f,lastLineLength:g,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(IO._sortOpsDescending);let t=[];for(let i=0;i<e.length;i++){let s=e[i];const o=s.range.startLineNumber,r=s.range.startColumn,a=s.range.endLineNumber,c=s.range.endColumn;if(o===a&&r===c&&s.text.length===0)continue;s.text?(this._pieceTree.delete(s.rangeOffset,s.rangeLength),this._pieceTree.insert(s.rangeOffset,s.text,!0)):this._pieceTree.delete(s.rangeOffset,s.rangeLength);const u=new be(o,r,a,c);t.push({range:u,rangeLength:s.rangeLength,text:s.text,rangeOffset:s.rangeOffset,forceMoveMarkers:s.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,s){return this._pieceTree.findMatchesLineByLine(e,t,i,s)}static _getInverseEditRanges(e){let t=[],i=0,s=0,o=null;for(let r=0,a=e.length;r<a;r++){let c=e[r],u,d;o?o.range.endLineNumber===c.range.startLineNumber?(u=i,d=s+(c.range.startColumn-o.range.endColumn)):(u=i+(c.range.startLineNumber-o.range.endLineNumber),d=c.range.startColumn):(u=c.range.startLineNumber,d=c.range.startColumn);let f;if(c.text.length>0){const g=c.eolCount+1;g===1?f=new be(u,d,u,d+c.firstLineLength):f=new be(u,d,u+g-1,c.lastLineLength+1)}else f=new be(u,d,u,d);i=f.endLineNumber,s=f.endColumn,t.push(f),o=c}return t}static _sortOpsAscending(e,t){let i=be.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=be.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class GEt{constructor(e,t,i,s,o,r,a,c,u){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=c,this._normalizeEOL=u}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?`
- `:`\r
- `:i>t/2?`\r
- `:`
- `}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&(t===`\r
- `&&(this._cr>0||this._lf>0)||t===`
- `&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o<r;o++){let a=i[o].buffer.replace(/\r\n|\r|\n/g,t),c=vv(a);i[o]=new MS(a,c)}const s=new IO(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:s,disposable:s}}}class zEt{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&$ne(e)&&(this.BOM=rbt,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=BEt(this._tmpLineStarts,e);this.chunks.push(new MS(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),!this.isBasicASCII&&!this.containsRTL&&(this.containsRTL=z8(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=rLe(e))}finish(e=!0){return this._finish(),new GEt(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=vv(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class KEt{constructor(){this.changeType=1}}class sp{constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new sp(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new sp(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}}class kfe{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class jEt{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class XEt{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class YEt{constructor(){this.changeType=5}}class _0{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),s=t.versionId,o=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing;return new _0(i,s,o,r)}}class R1e{constructor(e){this.changes=e}}class R3{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=_0.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=R3._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new R3(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),s=t.eol,o=t.versionId,r=e.isUndoing||t.isUndoing,a=e.isRedoing||t.isRedoing,c=e.isFlush||t.isFlush;return{changes:i,eol:s,versionId:o,isUndoing:r,isRedoing:a,isFlush:c}}}class qEt{constructor(){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0}_reset(e){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0,e&&this._setBeginState(0,e)}flush(e){this._reset(e)}get invalidLineStartIndex(){return this._invalidLineStartIndex}_invalidateLine(e){e<this._len&&(this._valid[e]=!1),e<this._invalidLineStartIndex&&(this._invalidLineStartIndex=e)}_isValid(e){return e<this._len?this._valid[e]:!1}getBeginState(e){return e<this._len?this._beginState[e]:null}_ensureLine(e){for(;e>=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[],s=[];for(let o=0;o<t;o++)i[o]=null,s[o]=!1;this._beginState=Rx(this._beginState,e,i),this._valid=Rx(this._valid,e,s),this._len+=t}_setValid(e,t){this._ensureLine(e),this._valid[e]=t}_setBeginState(e,t){this._ensureLine(e),this._beginState[e]=t}setEndState(e,t,i){if(this._setValid(t,!0),this._invalidLineStartIndex=t+1,t===e-1)return;const s=this.getBeginState(t+1);if(s===null||!i.equals(s)){this._setBeginState(t+1,i),this._invalidateLine(t+1);return}let o=t+1;for(;o<e&&this._isValid(o);)o++;this._invalidLineStartIndex=o}setFakeTokens(e){this._setValid(e,!1)}applyEdits(e,t){const i=e.endLineNumber-e.startLineNumber,o=Math.min(i,t);for(let r=o;r>=0;r--)this._invalidateLine(e.startLineNumber+r-1);this._acceptDeleteRange(e),this._acceptInsertText(new ct(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)}}class JEt extends wt{constructor(e,t){super(),this._textModel=e,this._languageIdCodec=t,this._isDisposed=!1,this._tokenizationStateStore=new qEt,this._tokenizationSupport=null,this._register($o.onDidChange(i=>{const s=this._textModel.getLanguageId();i.changedLanguages.indexOf(s)!==-1&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeContentFast(i=>{if(i.isFlush){this._resetTokenizationState();return}for(let s=0,o=i.changes.length;s<o;s++){const r=i.changes[s],[a]=TR(r.text);this._tokenizationStateStore.applyEdits(r.range,a)}this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeAttached(()=>{this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeLanguage(()=>{this._resetTokenizationState(),this._textModel.clearTokens()})),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=QEt(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&CY(()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(){const e=this._textModel.getLineCount(),t=1,i=new Z9,s=Ym.create(!1);let o=-1;for(;this._hasLinesToTokenize()&&!(s.elapsed()>t||(o=this._tokenizeOneInvalidLine(i),o>=e)););this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}tokenizeViewport(e,t){const i=new Z9;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new Z9;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens,!this._hasLinesToTokenize())}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return e>t?!1:e<t||this._textModel.getLineLength(e)<2048}_hasLinesToTokenize(){return this._tokenizationSupport?this._tokenizationStateStore.invalidLineStartIndex<this._textModel.getLineCount():!1}_tokenizeOneInvalidLine(e){if(!this._hasLinesToTokenize())return this._textModel.getLineCount()+1;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t),t}_updateTokensUntilLine(e,t){if(!this._tokenizationSupport)return;const i=this._textModel.getLanguageId(),s=this._textModel.getLineCount(),o=t-1;for(let r=this._tokenizationStateStore.invalidLineStartIndex;r<=o;r++){const a=this._textModel.getLineContent(r+1),c=this._tokenizationStateStore.getBeginState(r),u=e7(this._languageIdCodec,i,this._tokenizationSupport,a,!0,c);e.add(r+1,u.tokens),this._tokenizationStateStore.setEndState(s,r,u.endState),r=this._tokenizationStateStore.invalidLineStartIndex-1}}_tokenizeViewport(e,t,i){if(!this._tokenizationSupport||i<=this._tokenizationStateStore.invalidLineStartIndex)return;if(t<=this._tokenizationStateStore.invalidLineStartIndex){this._updateTokensUntilLine(e,i);return}let s=this._textModel.getLineFirstNonWhitespaceColumn(t);const o=[];let r=null;for(let u=t-1;s>1&&u>=1;u--){const d=this._textModel.getLineFirstNonWhitespaceColumn(u);if(d!==0&&d<s){if(r=this._tokenizationStateStore.getBeginState(u-1),r)break;o.push(this._textModel.getLineContent(u)),s=d}}r||(r=this._tokenizationSupport.getInitialState());const a=this._textModel.getLanguageId();let c=r;for(let u=o.length-1;u>=0;u--)c=e7(this._languageIdCodec,a,this._tokenizationSupport,o[u],!1,c).endState;for(let u=t;u<=i;u++){const d=this._textModel.getLineContent(u),f=e7(this._languageIdCodec,a,this._tokenizationSupport,d,!0,c);e.add(u,f.tokens),this._tokenizationStateStore.setFakeTokens(u-1),c=f.endState}}}function QEt(n){const e=n.getLanguageId();let t=n.isTooLargeForTokenization()?null:$o.get(e),i=null;if(t)try{i=t.getInitialState()}catch(s){di(s),t=null}return[t,i]}function e7(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenize2(i,s,o.clone(),0)}catch(a){di(a)}return r||(r=Wne(n.encodeLanguageId(e),i,o,0)),El.convertToEndOffset(r.tokens,i.length),r}function $C(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class Di{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=$C(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class kg{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=$C(Math.max(Math.min(1,t),0),3),this.l=$C(Math.max(Math.min(1,i),0),3),this.a=$C(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let c=0,u=0;const d=(a+r)/2,f=r-a;if(f>0){switch(u=Math.min(d<=.5?f/(2*d):f/(2-2*d),1),r){case t:c=(i-s)/f+(i<s?6:0);break;case i:c=(s-t)/f+2;break;case s:c=(t-i)/f+4;break}c*=60,c=Math.round(c)}return new kg(c,u,d,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,c;if(i===0)r=a=c=s;else{const u=s<.5?s*(1+i):s+i-s*i,d=2*s-u;r=kg._hue2rgb(d,u,t+1/3),a=kg._hue2rgb(d,u,t),c=kg._hue2rgb(d,u,t-1/3)}return new Di(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class km{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=$C(Math.max(Math.min(1,t),0),3),this.v=$C(Math.max(Math.min(1,i),0),3),this.a=$C(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,c=o===0?0:a/o;let u;return a===0?u=0:o===t?u=((i-s)/a%6+6)%6:o===i?u=(s-t)/a+2:u=(t-i)/a+4,new km(Math.round(u*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),c=s-r;let[u,d,f]=[0,0,0];return t<60?(u=r,d=a):t<120?(u=a,d=r):t<180?(d=r,f=a):t<240?(d=a,f=r):t<300?(u=a,f=r):t<=360&&(u=r,f=a),u=Math.round((u+c)*255),d=Math.round((d+c)*255),f=Math.round((f+c)*255),new Di(u,d,f,o)}}class mt{constructor(e){if(e)if(e instanceof Di)this.rgba=e;else if(e instanceof kg)this._hsla=e,this.rgba=kg.toRGBA(e);else if(e instanceof km)this._hsva=e,this.rgba=km.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}static fromHex(e){return mt.Format.CSS.parseHex(e)||mt.red}get hsla(){return this._hsla?this._hsla:kg.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:km.fromRGBA(this.rgba)}equals(e){return!!e&&Di.equals(this.rgba,e.rgba)&&kg.equals(this.hsla,e.hsla)&&km.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=mt._relativeLuminanceForComponent(this.rgba.r),t=mt._relativeLuminanceForComponent(this.rgba.g),i=mt._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return $C(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t<i}lighten(e){return new mt(new kg(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new mt(new kg(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:s,a:o}=this.rgba;return new mt(new Di(t,i,s,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new mt(new Di(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return this._toString||(this._toString=mt.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-s)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const s=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(s-o)/s,e.darken(i)}}mt.white=new mt(new Di(255,255,255,1));mt.black=new mt(new Di(0,0,0,1));mt.red=new mt(new Di(255,0,0,1));mt.blue=new mt(new Di(0,0,255,1));mt.cyan=new mt(new Di(0,255,255,1));mt.lightgrey=new mt(new Di(211,211,211,1));mt.transparent=new mt(new Di(0,0,0,0));(function(n){(function(e){(function(t){function i(p){return p.rgba.a===1?`rgb(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b})`:n.Format.CSS.formatRGBA(p)}t.formatRGB=i;function s(p){return`rgba(${p.rgba.r}, ${p.rgba.g}, ${p.rgba.b}, ${+p.rgba.a.toFixed(2)})`}t.formatRGBA=s;function o(p){return p.hsla.a===1?`hsl(${p.hsla.h}, ${(p.hsla.s*100).toFixed(2)}%, ${(p.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(p)}t.formatHSL=o;function r(p){return`hsla(${p.hsla.h}, ${(p.hsla.s*100).toFixed(2)}%, ${(p.hsla.l*100).toFixed(2)}%, ${p.hsla.a.toFixed(2)})`}t.formatHSLA=r;function a(p){const _=p.toString(16);return _.length!==2?"0"+_:_}function c(p){return`#${a(p.rgba.r)}${a(p.rgba.g)}${a(p.rgba.b)}`}t.formatHex=c;function u(p,_=!1){return _&&p.rgba.a===1?n.Format.CSS.formatHex(p):`#${a(p.rgba.r)}${a(p.rgba.g)}${a(p.rgba.b)}${a(Math.round(p.rgba.a*255))}`}t.formatHexA=u;function d(p){return p.isOpaque()?n.Format.CSS.formatHex(p):n.Format.CSS.formatRGBA(p)}t.format=d;function f(p){const _=p.length;if(_===0||p.charCodeAt(0)!==35)return null;if(_===7){const v=16*g(p.charCodeAt(1))+g(p.charCodeAt(2)),C=16*g(p.charCodeAt(3))+g(p.charCodeAt(4)),y=16*g(p.charCodeAt(5))+g(p.charCodeAt(6));return new n(new Di(v,C,y,1))}if(_===9){const v=16*g(p.charCodeAt(1))+g(p.charCodeAt(2)),C=16*g(p.charCodeAt(3))+g(p.charCodeAt(4)),y=16*g(p.charCodeAt(5))+g(p.charCodeAt(6)),w=16*g(p.charCodeAt(7))+g(p.charCodeAt(8));return new n(new Di(v,C,y,w/255))}if(_===4){const v=g(p.charCodeAt(1)),C=g(p.charCodeAt(2)),y=g(p.charCodeAt(3));return new n(new Di(16*v+v,16*C+C,16*y+y))}if(_===5){const v=g(p.charCodeAt(1)),C=g(p.charCodeAt(2)),y=g(p.charCodeAt(3)),w=g(p.charCodeAt(4));return new n(new Di(16*v+v,16*C+C,16*y+y,(16*w+w)/255))}return null}t.parseHex=f;function g(p){switch(p){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(mt);const wF=ss("undoRedoService");class M1e{constructor(e,t){this.resource=e,this.elements=t}}class CR{constructor(){this.id=CR._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}CR._ID=0;CR.None=new CR;class Em{constructor(){this.id=Em._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Em._ID=0;Em.None=new Em;class Afe{constructor(e,t,i){this.range=e,this.nestingLevel=t,this.isInvalid=i}}class ZEt{constructor(e,t,i,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=s}}class eSt extends ZEt{constructor(e,t,i,s,o){super(e,t,i,s),this.minVisibleColumnIndentation=o}}class tSt{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}function nSt(n,e,t,i){return n!==t?tr(t-n,i):tr(0,i-e)}const gb=0;function iSt(n){return n===0}const Sd=Math.pow(2,26);function tr(n,e){return n*Sd+e}function xC(n){const e=n,t=Math.floor(e/Sd),i=e-t*Sd;return new tSt(t,i)}function sSt(n){return Math.floor(n/Sd)}function Vl(n,e){return e<Sd?n+e:n-n%Sd+e}function oSt(n,e){const t=n,i=e;if(i-t<=0)return gb;const o=Math.floor(t/Sd),r=Math.floor(i/Sd),a=i-r*Sd;if(o===r){const c=t-o*Sd;return tr(0,a-c)}else return tr(r-o,a)}function i4(n,e){return n<e}function qS(n,e){return n<=e}function QH(n,e){return n>=e}function ZH(n){return tr(n.lineNumber-1,n.column-1)}function n$(n,e){const t=n,i=Math.floor(t/Sd),s=t-i*Sd,o=e,r=Math.floor(o/Sd),a=o-r*Sd;return new be(i+1,s+1,r+1,a+1)}function rSt(n){const e=Jm(n);return tr(e.length-1,e[e.length-1].length)}class Nfe{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class lSt{constructor(e,t){this.documentLength=t,this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(i=>bie.from(i))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):this.documentLength;return oSt(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?tr(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):tr(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=xC(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?tr(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):tr(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(qS(i,e)){this.nextEditIdx++;const s=xC(i),o=xC(this.translateOldToCur(t.endOffsetBeforeObj)),r=s.lineCount-o.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,c=s.columnCount-o.columnCount;this.deltaOldToNewColumnCount=a+c,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class bie{constructor(e,t,i){this.endOffsetBeforeObj=xC(t),this.endOffsetAfterObj=xC(Vl(e,i)),this.offsetObj=xC(e)}static from(e){return new bie(e.startOffset,e.endOffset,e.newLength)}}class Vs{static visibleColumnFromColumn(e,t,i){const s=e.length,o=t-1<s?t-1:s;let r=0,a=0;for(;a<o;){const c=wv(e,o,a);if(a+=c>=65536?2:1,c===9)r=Vs.nextRenderTabStop(r,i);else{let u=e1(c);for(;a<o;){const d=wv(e,o,a),f=e1(d);if(WD(u,f))break;a+=d>=65536?2:1,u=f}Gg(c)||UD(c)?r=r+2:r=r+1}}return r}static visibleColumnsByColumns(e,t){const i=e.length;let s=new Array;s.push(-1);let o=0,r=0;for(;r<i;){const a=wv(e,i,r);if(r+=a>=65536?2:1,s.push(o),a>=65536&&s.push(o),a===9)o=Vs.nextRenderTabStop(o,t);else{let c=e1(a);for(;r<i;){const u=wv(e,i,r),d=e1(u);if(WD(c,d))break;r+=u>=65536?2:1,s.push(o),a>=65536&&s.push(o),c=d}Gg(a)||UD(a)?o=o+2:o=o+1}}return s.push(o),s}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const s=e.length;let o=0,r=1,a=0;for(;a<s;){const c=wv(e,s,a);a+=c>=65536?2:1;let u;if(c===9)u=Vs.nextRenderTabStop(o,i);else{let f=e1(c);for(;a<s;){const g=wv(e,s,a),p=e1(g);if(WD(f,p))break;a+=g>=65536?2:1,f=p}Gg(c)||UD(c)?u=o+2:u=o+1}const d=a+1;if(u>=t){const f=t-o;return u-t<f?d:r}o=u,r=d}return s+1}static columnFromVisibleColumn2(e,t,i,s){let o=this.columnFromVisibleColumn(t.getLineContent(i),s,e.tabSize),r=t.getLineMinColumn(i);if(o<r)return r;let a=t.getLineMaxColumn(i);return o>a?a:o}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}const s4=new Array;class Lr{constructor(e,t){this.items=e,this.additionalItems=t}static create(e,t){if(e<=128&&t.length===0){let i=Lr.cache[e];return i||(i=new Lr(e,t),Lr.cache[e]=i),i}return new Lr(e,t)}static getEmpty(){return this.empty}add(e,t){const i=t.getKey(e);let s=i>>5;if(s===0){const r=1<<i|this.items;return r===this.items?this:Lr.create(r,this.additionalItems)}s--;const o=this.additionalItems.slice(0);for(;o.length<s;)o.push(0);return o[s]|=1<<(i&31),Lr.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===s4&&e.additionalItems===s4)return t===this.items?this:t===e.items?e:Lr.create(t,s4);const i=new Array;for(let s=0;s<Math.max(this.additionalItems.length,e.additionalItems.length);s++){const o=this.additionalItems[s]||0,r=e.additionalItems[s]||0;i.push(o|r)}return Lr.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}}Lr.cache=new Array(129);Lr.empty=Lr.create(0,s4);const Dfe={getKey(n){return n}};class aSt{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class Tie{constructor(e){this._length=e}get length(){return this._length}}class $x extends Tie{constructor(e,t,i,s,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=s,this.missingOpeningBracketIds=o}static create(e,t,i){let s=e.length;return t&&(s=Vl(s,t.length)),i&&(s=Vl(s,i.length)),new $x(s,e,t,i,t?t.missingOpeningBracketIds:Lr.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=new Array;return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new $x(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Vl(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class e_ extends Tie{constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}static create23(e,t,i,s=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Vl(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Vl(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return s?new cSt(o,e.listHeight+1,e,t,i,r):new xx(o,e.listHeight+1,e,t,i,r)}static getEmpty(){return new uSt(gb,0,[],Lr.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;let t=this,i;for(;t.kind===4&&(i=t.childrenLength)>0;)t=t.getChild(i-1);return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let s=1;s<e;s++){const o=this.getChild(s);t=Vl(t,o.length),i=i.merge(o.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,s=e;for(let o=0;o<this.childrenLength;o++){const r=this.getChild(o);r&&(i=Math.min(i,r.computeMinIndentation(s,t)),s=Vl(s,r.length))}return this.cachedMinIndentation=i,i}}class xx extends e_{constructor(e,t,i,s,o,r){super(e,t,r),this._item1=i,this._item2=s,this._item3=o}get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}deepClone(){return new xx(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class cSt extends xx{toMutable(){return new xx(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class M3 extends e_{constructor(e,t,i,s){super(e,t,s),this._children=i}get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new M3(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class uSt extends M3{toMutable(){return new M3(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const dSt=[];class Cie extends Tie{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return dSt}deepClone(){return this}}class R1 extends Cie{get kind(){return 0}get missingOpeningBracketIds(){return Lr.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=xC(e),s=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=sSt(Vl(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let a=s;a<=o;a++){const c=t.getLineFirstNonWhitespaceColumn(a),u=t.getLineContent(a);if(c===0)continue;const d=Vs.visibleColumnFromColumn(u,c,t.getOptions().tabSize);r=Math.min(r,d)}return r}}class v0 extends Cie{constructor(e){super(e)}static create(e){const t=e,i=v0.cacheByLength.get(t);if(i)return i;const s=new v0(e);return v0.cacheByLength.set(t,s),s}get kind(){return 1}get missingOpeningBracketIds(){return Lr.getEmpty()}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}v0.cacheByLength=new Map;class hSt extends Cie{constructor(e,t){super(t),this.missingOpeningBracketIds=e}get kind(){return 3}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class uC{constructor(e,t,i,s,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=s,this.astNode=o}}class fSt{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new gSt(this.textModel,this.bracketTokens),this._offset=gb,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return tr(this.textBufferLineCount,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Vl(this._offset,e);const t=xC(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Vl(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class gSt{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset)):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset<r){const c=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<r&&c===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const u=Ba.getTokenType(c)===0,d=o.getEndOffset(this.lineTokenOffset);if(u&&d!==this.lineCharOffset){const f=o.getLanguageId(this.lineTokenOffset),g=this.line.substring(this.lineCharOffset,d),p=this.bracketTokens.getSingleLanguageBracketTokens(f),_=p.regExpGlobal;if(_){_.lastIndex=0;const v=_.exec(g);v&&(a=p.getToken(v[0]),a&&(this.lineCharOffset+=v.index))}}if(i+=d-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=d}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const s=nSt(e,t,this.lineIdx,this.lineCharOffset);return new uC(s,0,-1,Lr.getEmpty(),new R1(s))}}class pSt{constructor(e,t){this.text=e,this._offset=gb,this.idx=0;const s=t.getRegExpStr()?new RegExp(t.getRegExpStr()+`|
- `,"g"):null,o=[];let r,a=0,c=0,u=0,d=0;const f=new Array;for(let _=0;_<60;_++)f.push(new uC(tr(0,_),0,-1,Lr.getEmpty(),new R1(tr(0,_))));const g=new Array;for(let _=0;_<60;_++)g.push(new uC(tr(1,_),0,-1,Lr.getEmpty(),new R1(tr(1,_))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const _=r.index,v=r[0];if(v===`
- `)a++,c=_+1;else{if(u!==_){let C;if(d===a){const y=_-u;if(y<f.length)C=f[y];else{const w=tr(0,y);C=new uC(w,0,-1,Lr.getEmpty(),new R1(w))}}else{const y=a-d,w=_-c;if(y===1&&w<g.length)C=g[w];else{const I=tr(y,w);C=new uC(I,0,-1,Lr.getEmpty(),new R1(I))}}o.push(C)}o.push(t.getToken(v)),u=_+v.length,d=a}}const p=e.length;if(u!==p){const _=d===a?tr(0,p-u):tr(a-d,p-c);o.push(new uC(_,0,-1,Lr.getEmpty(),new R1(_)))}this.length=tr(a,p-c),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new z_t}}class k3{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function i(c,u){return t.getKey(`${c}:::${u}`)}const s=e.characterPair.getColorizedBrackets(),o=new Map,r=new Set;for(const[c,u]of s){r.add(c);let d=o.get(u);const f=i(e.languageId,c);d||(d={openingBrackets:Lr.getEmpty(),first:f},o.set(u,d)),d.openingBrackets=d.openingBrackets.add(f,Dfe)}const a=new Map;for(const[c,u]of o){const d=tr(0,c.length);a.set(c,new uC(d,2,u.first,u.openingBrackets,v0.create(d)))}for(const c of r){const u=tr(0,c.length),d=i(e.languageId,c);a.set(c,new uC(u,1,d,Lr.getEmpty().add(d,Dfe),v0.create(u)))}return new k3(a)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>mSt(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}get isEmpty(){return this.map.size===0}}function mSt(n){const e=jf(n);return/^[\w ]+$/.test(n)?`\\b${e}\\b`:e}class _St{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const i=k3.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==i}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=k3.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function vSt(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e<n.length&&n[e].listHeight===a;)e++;return e-r>=2?k1e(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())$fe(i,s)<=$fe(s,r)?(i=t7(i,s),s=r):s=t7(s,r);return t7(i,s)}function k1e(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s<i;s++){const o=s<<1;n[s]=e_.create23(n[o],n[o+1],o+3===t?n[o+2]:null,e)}t=i}return e_.create23(n[0],n[1],t>=3?n[2]:null,e)}function $fe(n,e){return Math.abs(n.listHeight-e.listHeight)}function t7(n,e){return n.listHeight===e.listHeight?e_.create23(n,e,null,!1):n.listHeight>e.listHeight?bSt(n,e):TSt(e,n)}function bSt(n,e){n=n.toMutable();let t=n;const i=new Array;let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=e_.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?e_.create23(n,s,null,!1):n}function TSt(n,e){n=n.toMutable();let t=n;const i=new Array;for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=e_.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?e_.create23(s,n,null,!1):n}class CSt{constructor(e){this.lastOffset=gb,this.nextNodes=[e],this.offsets=[gb],this.idxs=[]}readLongestNodeAt(e,t){if(i4(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=DN(this.nextNodes);if(!i)return;const s=DN(this.offsets);if(i4(e,s))return;if(i4(s,e))if(Vl(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=n7(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=n7(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=DN(this.offsets),t=DN(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=DN(this.nextNodes),s=n7(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(Vl(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function n7(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function DN(n){return n.length>0?n[n.length-1]:void 0}function xfe(n,e,t,i){return new ySt(n,e,t,i).parseDocument()}class ySt{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new CSt(i):void 0,this.positionMapper=new lSt(t,e.length)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Lr.getEmpty());return e||(e=e_.getEmpty()),e}parseList(e){const t=new Array;for(;;){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;const o=this.parseChild(e);o.kind===4&&o.childrenLength===0||t.push(o)}return this.oldNodeReader?vSt(t):k1e(t,this.createImmutableLists)}parseChild(e){if(this.oldNodeReader){const i=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(!iSt(i)){const s=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),o=>i4(o.length,i)?o.canBeReused(e):!1);if(s)return this._itemsFromCache++,this.tokenizer.skip(s.length),s}}this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new hSt(t.bracketIds,t.length);case 0:return t.astNode;case 1:const i=e.merge(t.bracketIds),s=this.parseList(i),o=this.tokenizer.peek();return o&&o.kind===2&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),$x.create(t.astNode,s,o.astNode)):$x.create(t.astNode,s,null);default:throw new Error("unexpected")}}}class ESt extends wt{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.cache=this._register(new pc),this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(e.onDidChangeOptions(i=>{this.cache.clear(),this.updateCache()})),this._register(e.onDidChangeLanguage(i=>{this.cache.clear(),this.updateCache()})),this._register(this.languageConfigurationService.onDidChange(i=>{var s;(!i.languageId||!((s=this.cache.value)===null||s===void 0)&&s.object.didLanguageChange(i.languageId))&&(this.cache.clear(),this.updateCache())}))}get isDocumentSupported(){return this.textModel.getValueLength()<=5e6}updateCache(){if(this.bracketsRequested&&this.isDocumentSupported){if(!this.cache.value){const e=new Wt;this.cache.value=SSt(e.add(new wSt(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.cache.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.cache.clear(),this.onDidChangeEmitter.fire()}handleContentChanged(e){var t;(t=this.cache.value)===null||t===void 0||t.object.handleContentChanged(e)}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||[]}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||[]}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketsInRange(e))||[]}}function SSt(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}class wSt extends wt{constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new rt,this.denseKeyProvider=new aSt,this.brackets=new _St(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this._register(e.onBackgroundTokenizationStateChanged(()=>{if(e.backgroundTokenizationState===2){const i=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,i||this.didChangeEmitter.fire()}})),this._register(e.onDidChangeTokens(({ranges:i})=>{const s=i.map(o=>new Nfe(tr(o.fromLineNumber-1,0),tr(o.toLineNumber,0),tr(o.toLineNumber-o.fromLineNumber+1,0)));this.astWithTokens=this.parseDocumentFromTextBuffer(s,this.astWithTokens,!1),this.initialAstWithoutTokens||this.didChangeEmitter.fire()})),e.backgroundTokenizationState===0){const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new pSt(this.textModel.getValue(),i);this.initialAstWithoutTokens=xfe(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else e.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):e.backgroundTokenizationState===1&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}didLanguageChange(e){return this.brackets.didLanguageChange(e)}handleContentChanged(e){const t=e.changes.map(i=>{const s=be.lift(i.range);return new Nfe(ZH(s.getStartPosition()),ZH(s.getEndPosition()),rSt(i.text))}).reverse();this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(t,this.initialAstWithoutTokens,!1))}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new fSt(this.textModel,this.brackets);return xfe(o,e,s,i)}getBracketsInRange(e){const t=tr(e.startLineNumber-1,e.startColumn-1),i=tr(e.endLineNumber-1,e.endColumn-1),s=new Array,o=this.initialAstWithoutTokens||this.astWithTokens;return fD(o,gb,o.length,t,i,s),s}getBracketPairsInRange(e,t){const i=new Array,s=ZH(e.getStartPosition()),o=ZH(e.getEndPosition()),r=this.initialAstWithoutTokens||this.astWithTokens,a=new ISt(i,t,this.textModel);return A1e(r,gb,r.length,s,o,a),i}}function fD(n,e,t,i,s,o,r=0){if(n.kind===1){const a=n$(e,t);o.push(new Afe(a,r-1,!1))}else if(n.kind===3){const a=n$(e,t);o.push(new Afe(a,r-1,!0))}else if(n.kind===4)for(const a of n.children)t=Vl(e,a.length),qS(e,s)&&QH(t,i)&&fD(a,e,t,i,s,o,r),e=t;else if(n.kind===2){r++;{const a=n.openingBracket;t=Vl(e,a.length),qS(e,s)&&QH(t,i)&&fD(a,e,t,i,s,o,r),e=t}if(n.child){const a=n.child;t=Vl(e,a.length),qS(e,s)&&QH(t,i)&&fD(a,e,t,i,s,o,r),e=t}if(n.closingBracket){const a=n.closingBracket;t=Vl(e,a.length),qS(e,s)&&QH(t,i)&&fD(a,e,t,i,s,o,r),e=t}}}class ISt{constructor(e,t,i){this.result=e,this.includeMinIndentation=t,this.textModel=i}}function A1e(n,e,t,i,s,o,r=0){var a;if(n.kind===2){const u=Vl(e,n.openingBracket.length);let d=-1;o.includeMinIndentation&&(d=n.computeMinIndentation(e,o.textModel)),o.result.push(new eSt(n$(e,t),n$(e,u),n.closingBracket?n$(Vl(u,((a=n.child)===null||a===void 0?void 0:a.length)||gb),t):void 0,r,d)),r++}let c=e;for(const u of n.children){const d=c;c=Vl(c,u.length),qS(d,s)&&qS(i,c)&&A1e(u,d,c,i,s,o,r)}}const N1e={ColorContribution:"base.contributions.colors"};class LSt{constructor(){this._onDidChangeSchema=new rt,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){let r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;let a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return bv(s,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(t,i)=>{let s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(`
- `)}}const b6=new LSt;br.add(N1e.ColorContribution,b6);function Ze(n,e,t,i,s){return b6.registerColor(n,e,t,i,s)}const Bn=Ze("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},$("foreground","Overall foreground color. This color is only used if not overridden by a component.")),OSt=Ze("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},$("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),i7=Ze("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},$("iconForeground","The default color for icons in the workbench.")),uy=Ze("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},$("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),_r=Ze("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},$("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Ua=Ze("contrastActiveBorder",{light:null,dark:null,hc:uy},$("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),IF=Ze("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},$("textLinkForeground","Foreground color for links in text.")),LF=Ze("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},$("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),yie=Ze("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:mt.black},$("textCodeBlockBackground","Background color for code blocks in text.")),dy=Ze("widget.shadow",{dark:ro(mt.black,.36),light:ro(mt.black,.16),hc:null},$("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Eie=Ze("input.background",{dark:"#3C3C3C",light:mt.white,hc:mt.black},$("inputBoxBackground","Input box background.")),Sie=Ze("input.foreground",{dark:Bn,light:Bn,hc:Bn},$("inputBoxForeground","Input box foreground.")),wie=Ze("input.border",{dark:null,light:null,hc:_r},$("inputBoxBorder","Input box border.")),Qq=Ze("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:_r},$("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),Zq=Ze("inputOption.activeBackground",{dark:ro(uy,.4),light:ro(uy,.2),hc:mt.transparent},$("inputOption.activeBackground","Background color of activated options in input fields.")),eJ=Ze("inputOption.activeForeground",{dark:mt.white,light:mt.black,hc:null},$("inputOption.activeForeground","Foreground color of activated options in input fields.")),Iie=Ze("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:mt.black},$("inputValidationInfoBackground","Input validation background color for information severity.")),Lie=Ze("inputValidation.infoForeground",{dark:null,light:null,hc:null},$("inputValidationInfoForeground","Input validation foreground color for information severity.")),Oie=Ze("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:_r},$("inputValidationInfoBorder","Input validation border color for information severity.")),D1e=Ze("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:mt.black},$("inputValidationWarningBackground","Input validation background color for warning severity.")),$1e=Ze("inputValidation.warningForeground",{dark:null,light:null,hc:null},$("inputValidationWarningForeground","Input validation foreground color for warning severity.")),x1e=Ze("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:_r},$("inputValidationWarningBorder","Input validation border color for warning severity.")),P1e=Ze("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:mt.black},$("inputValidationErrorBackground","Input validation background color for error severity.")),F1e=Ze("inputValidation.errorForeground",{dark:null,light:null,hc:null},$("inputValidationErrorForeground","Input validation foreground color for error severity.")),B1e=Ze("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:_r},$("inputValidationErrorBorder","Input validation border color for error severity.")),s7=Ze("dropdown.background",{dark:"#3C3C3C",light:mt.white,hc:mt.black},$("dropdownBackground","Dropdown background.")),Pfe=Ze("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:mt.white},$("dropdownForeground","Dropdown foreground.")),RSt=Ze("button.foreground",{dark:mt.white,light:mt.white,hc:mt.white},$("buttonForeground","Button foreground color.")),tJ=Ze("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},$("buttonBackground","Button background color.")),MSt=Ze("button.hoverBackground",{dark:K1e(tJ,.2),light:z1e(tJ,.2),hc:null},$("buttonHoverBackground","Button background color when hovering.")),i$=Ze("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:mt.black},$("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),s$=Ze("badge.foreground",{dark:mt.white,light:"#333",hc:mt.white},$("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),OF=Ze("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},$("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),o$=Ze("scrollbarSlider.background",{dark:mt.fromHex("#797979").transparent(.4),light:mt.fromHex("#646464").transparent(.4),hc:ro(_r,.6)},$("scrollbarSliderBackground","Scrollbar slider background color.")),r$=Ze("scrollbarSlider.hoverBackground",{dark:mt.fromHex("#646464").transparent(.7),light:mt.fromHex("#646464").transparent(.7),hc:ro(_r,.8)},$("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),l$=Ze("scrollbarSlider.activeBackground",{dark:mt.fromHex("#BFBFBF").transparent(.4),light:mt.fromHex("#000000").transparent(.6),hc:_r},$("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),kSt=Ze("progressBar.background",{dark:mt.fromHex("#0E70C0"),light:mt.fromHex("#0E70C0"),hc:_r},$("progressBarBackground","Background color of the progress bar that can show for long running operations.")),ASt=Ze("editorError.background",{dark:null,light:null,hc:null},$("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),a$=Ze("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hc:null},$("editorError.foreground","Foreground color of error squigglies in the editor.")),H1e=Ze("editorError.border",{dark:null,light:null,hc:mt.fromHex("#E47777").transparent(.8)},$("errorBorder","Border color of error boxes in the editor.")),NSt=Ze("editorWarning.background",{dark:null,light:null,hc:null},$("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),qv=Ze("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},$("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),T6=Ze("editorWarning.border",{dark:null,light:null,hc:mt.fromHex("#FFCC00").transparent(.8)},$("warningBorder","Border color of warning boxes in the editor.")),DSt=Ze("editorInfo.background",{dark:null,light:null,hc:null},$("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Kg=Ze("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},$("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Rie=Ze("editorInfo.border",{dark:null,light:null,hc:mt.fromHex("#3794FF").transparent(.8)},$("infoBorder","Border color of info boxes in the editor.")),$St=Ze("editorHint.foreground",{dark:mt.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},$("editorHint.foreground","Foreground color of hint squigglies in the editor.")),xSt=Ze("editorHint.border",{dark:null,light:null,hc:mt.fromHex("#eeeeee").transparent(.8)},$("hintBorder","Border color of hint boxes in the editor.")),Ch=Ze("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:mt.black},$("editorBackground","Editor background color.")),PC=Ze("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:mt.white},$("editorForeground","Editor default foreground color.")),Od=Ze("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},$("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Jv=Ze("editorWidget.foreground",{dark:Bn,light:Bn,hc:Bn},$("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),b0=Ze("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:_r},$("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),PSt=Ze("editorWidget.resizeBorder",{light:null,dark:null,hc:null},$("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),Ffe=Ze("quickInput.background",{dark:Od,light:Od,hc:Od},$("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),FSt=Ze("quickInput.foreground",{dark:Jv,light:Jv,hc:Jv},$("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),BSt=Ze("quickInputTitle.background",{dark:new mt(new Di(255,255,255,.105)),light:new mt(new Di(0,0,0,.06)),hc:"#000000"},$("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),HSt=Ze("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:mt.white},$("pickerGroupForeground","Quick picker color for grouping labels.")),VSt=Ze("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:mt.white},$("pickerGroupBorder","Quick picker color for grouping borders.")),USt=Ze("keybindingLabel.background",{dark:new mt(new Di(128,128,128,.17)),light:new mt(new Di(221,221,221,.4)),hc:mt.transparent},$("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),WSt=Ze("keybindingLabel.foreground",{dark:mt.fromHex("#CCCCCC"),light:mt.fromHex("#555555"),hc:mt.white},$("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),GSt=Ze("keybindingLabel.border",{dark:new mt(new Di(51,51,51,.6)),light:new mt(new Di(204,204,204,.4)),hc:new mt(new Di(111,195,223))},$("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),zSt=Ze("keybindingLabel.bottomBorder",{dark:new mt(new Di(68,68,68,.6)),light:new mt(new Di(187,187,187,.4)),hc:new mt(new Di(111,195,223))},$("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),FC=Ze("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},$("editorSelectionBackground","Color of the editor selection.")),KSt=Ze("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},$("editorSelectionForeground","Color of the selected text for high contrast.")),Mie=Ze("editor.inactiveSelectionBackground",{light:ro(FC,.5),dark:ro(FC,.5),hc:ro(FC,.5)},$("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),kie=Ze("editor.selectionHighlightBackground",{light:Vfe(FC,Ch,.3,.6),dark:Vfe(FC,Ch,.3,.6),hc:null},$("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),jSt=Ze("editor.selectionHighlightBorder",{light:null,dark:null,hc:Ua},$("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),XSt=Ze("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},$("editorFindMatch","Color of the current search match.")),nJ=Ze("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},$("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),YSt=Ze("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},$("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),qSt=Ze("editor.findMatchBorder",{light:null,dark:null,hc:Ua},$("editorFindMatchBorder","Border color of the current search match.")),JSt=Ze("editor.findMatchHighlightBorder",{light:null,dark:null,hc:Ua},$("findMatchHighlightBorder","Border color of the other search matches.")),QSt=Ze("editor.findRangeHighlightBorder",{dark:null,light:null,hc:ro(Ua,.4)},$("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ZSt=Ze("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},$("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),tw=Ze("editorHoverWidget.background",{light:Od,dark:Od,hc:Od},$("hoverBackground","Background color of the editor hover.")),Aie=Ze("editorHoverWidget.foreground",{light:Jv,dark:Jv,hc:Jv},$("hoverForeground","Foreground color of the editor hover.")),Nie=Ze("editorHoverWidget.border",{light:b0,dark:b0,hc:b0},$("hoverBorder","Border color of the editor hover.")),e0t=Ze("editorHoverWidget.statusBarBackground",{dark:K1e(tw,.2),light:z1e(tw,.05),hc:Od},$("statusBarBackground","Background color of the editor hover status bar.")),Die=Ze("editorLink.activeForeground",{dark:"#4E94CE",light:mt.blue,hc:mt.cyan},$("activeLinkForeground","Color of active links.")),T0=Ze("editorInlayHint.foreground",{dark:ro(s$,.8),light:ro(s$,.8),hc:s$},$("editorInlayHintForeground","Foreground color of inline hints")),C0=Ze("editorInlayHint.background",{dark:ro(i$,.6),light:ro(i$,.3),hc:i$},$("editorInlayHintBackground","Background color of inline hints")),t0t=Ze("editorInlayHint.typeForeground",{dark:T0,light:T0,hc:T0},$("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),n0t=Ze("editorInlayHint.typeBackground",{dark:C0,light:C0,hc:C0},$("editorInlayHintBackgroundTypes","Background color of inline hints for types")),i0t=Ze("editorInlayHint.parameterForeground",{dark:T0,light:T0,hc:T0},$("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),s0t=Ze("editorInlayHint.parameterBackground",{dark:C0,light:C0,hc:C0},$("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),o0t=Ze("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},$("editorLightBulbForeground","The color used for the lightbulb actions icon.")),r0t=Ze("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},$("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),iJ=new mt(new Di(155,185,85,.2)),sJ=new mt(new Di(255,0,0,.2)),V1e=Ze("diffEditor.insertedTextBackground",{dark:iJ,light:iJ,hc:null},$("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),U1e=Ze("diffEditor.removedTextBackground",{dark:sJ,light:sJ,hc:null},$("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),l0t=Ze("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},$("diffEditorInsertedOutline","Outline color for the text that got inserted.")),a0t=Ze("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},$("diffEditorRemovedOutline","Outline color for text that got removed.")),c0t=Ze("diffEditor.border",{dark:null,light:null,hc:_r},$("diffEditorBorder","Border color between the two text editors.")),u0t=Ze("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},$("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),d0t=Ze("list.focusBackground",{dark:null,light:null,hc:null},$("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),h0t=Ze("list.focusForeground",{dark:null,light:null,hc:null},$("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),f0t=Ze("list.focusOutline",{dark:uy,light:uy,hc:Ua},$("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),BC=Ze("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},$("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),HC=Ze("list.activeSelectionForeground",{dark:mt.white,light:mt.white,hc:null},$("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),o4=Ze("list.activeSelectionIconForeground",{dark:null,light:null,hc:null},$("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),g0t=Ze("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},$("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),p0t=Ze("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},$("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),m0t=Ze("list.inactiveSelectionIconForeground",{dark:null,light:null,hc:null},$("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_0t=Ze("list.inactiveFocusBackground",{dark:null,light:null,hc:null},$("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),v0t=Ze("list.inactiveFocusOutline",{dark:null,light:null,hc:null},$("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),b0t=Ze("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},$("listHoverBackground","List/Tree background when hovering over items using the mouse.")),T0t=Ze("list.hoverForeground",{dark:null,light:null,hc:null},$("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),C0t=Ze("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},$("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),Qv=Ze("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:uy},$("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),o7=Ze("list.focusHighlightForeground",{dark:Qv,light:q0t(BC,Qv,"#9DDDFF"),hc:Qv},$("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),y0t=Ze("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:mt.black},$("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),E0t=Ze("listFilterWidget.outline",{dark:mt.transparent,light:mt.transparent,hc:"#f38518"},$("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),S0t=Ze("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:_r},$("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),w0t=Ze("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},$("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),I0t=Ze("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},$("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Bfe=Ze("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,$("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),r4=Ze("quickInputList.focusForeground",{dark:HC,light:HC,hc:HC},$("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),l4=Ze("quickInputList.focusIconForeground",{dark:o4,light:o4,hc:o4},$("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),a4=Ze("quickInputList.focusBackground",{dark:Px(Bfe,BC),light:Px(Bfe,BC),hc:null},$("quickInput.listFocusBackground","Quick picker background color for the focused item.")),L0t=Ze("menu.border",{dark:null,light:null,hc:_r},$("menuBorder","Border color of menus.")),O0t=Ze("menu.foreground",{dark:Pfe,light:Bn,hc:Pfe},$("menuForeground","Foreground color of menu items.")),R0t=Ze("menu.background",{dark:s7,light:s7,hc:s7},$("menuBackground","Background color of menu items.")),M0t=Ze("menu.selectionForeground",{dark:HC,light:HC,hc:HC},$("menuSelectionForeground","Foreground color of the selected menu item in menus.")),k0t=Ze("menu.selectionBackground",{dark:BC,light:BC,hc:BC},$("menuSelectionBackground","Background color of the selected menu item in menus.")),A0t=Ze("menu.selectionBorder",{dark:null,light:null,hc:Ua},$("menuSelectionBorder","Border color of the selected menu item in menus.")),N0t=Ze("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:_r},$("menuSeparatorBackground","Color of a separator menu item in menus.")),D0t=Ze("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hc:null},$("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse")),$0t=Ze("editor.snippetTabstopHighlightBackground",{dark:new mt(new Di(124,124,124,.3)),light:new mt(new Di(10,50,100,.2)),hc:new mt(new Di(124,124,124,.3))},$("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),x0t=Ze("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},$("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),P0t=Ze("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},$("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),F0t=Ze("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new mt(new Di(10,50,100,.5)),hc:"#525252"},$("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),$ie=Ze("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},$("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),W1e=Ze("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},$("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),G1e=Ze("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},$("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),C6=Ze("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hc:"#ffffff"},$("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Hfe=Ze("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},$("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),B0t=Ze("minimap.errorHighlight",{dark:new mt(new Di(255,18,18,.7)),light:new mt(new Di(255,18,18,.7)),hc:new mt(new Di(255,50,50,1))},$("minimapError","Minimap marker color for errors.")),H0t=Ze("minimap.warningHighlight",{dark:qv,light:qv,hc:T6},$("overviewRuleWarning","Minimap marker color for warnings.")),V0t=Ze("minimap.background",{dark:null,light:null,hc:null},$("minimapBackground","Minimap background color.")),U0t=Ze("minimap.foregroundOpacity",{dark:mt.fromHex("#000f"),light:mt.fromHex("#000f"),hc:mt.fromHex("#000f")},$("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),W0t=Ze("minimapSlider.background",{light:ro(o$,.5),dark:ro(o$,.5),hc:ro(o$,.5)},$("minimapSliderBackground","Minimap slider background color.")),G0t=Ze("minimapSlider.hoverBackground",{light:ro(r$,.5),dark:ro(r$,.5),hc:ro(r$,.5)},$("minimapSliderHoverBackground","Minimap slider background color when hovering.")),z0t=Ze("minimapSlider.activeBackground",{light:ro(l$,.5),dark:ro(l$,.5),hc:ro(l$,.5)},$("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),K0t=Ze("problemsErrorIcon.foreground",{dark:a$,light:a$,hc:a$},$("problemsErrorIconForeground","The color used for the problems error icon.")),j0t=Ze("problemsWarningIcon.foreground",{dark:qv,light:qv,hc:qv},$("problemsWarningIconForeground","The color used for the problems warning icon.")),X0t=Ze("problemsInfoIcon.foreground",{dark:Kg,light:Kg,hc:Kg},$("problemsInfoIconForeground","The color used for the problems info icon."));function Y0t(n,e){var t,i,s;switch(n.op){case 0:return(t=bv(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=bv(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=bv(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:for(const a of n.values){const c=bv(a,e);if(c)return c}return;case 5:return bv(e.defines(n.if)?n.then:n.else,e);case 4:const o=bv(n.value,e);if(!o)return;const r=bv(n.background,e);return r?o.isDarkerThan(r)?mt.getLighterColor(o,r,n.factor).transparent(n.transparency):mt.getDarkerColor(o,r,n.factor).transparent(n.transparency):o.transparent(n.factor*n.transparency);default:throw Nbt()}}function z1e(n,e){return{op:0,value:n,factor:e}}function K1e(n,e){return{op:1,value:n,factor:e}}function ro(n,e){return{op:2,value:n,factor:e}}function Px(...n){return{op:3,values:n}}function q0t(n,e,t){return{op:5,if:n,then:e,else:t}}function Vfe(n,e,t,i){return{op:4,value:n,background:e,factor:t,transparency:i}}function bv(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?mt.fromHex(n):e.getColor(n);if(n instanceof mt)return n;if(typeof n=="object")return Y0t(n,e)}}const j1e="vscode://schemas/workbench-colors";let X1e=br.as(e6.JSONContribution);X1e.registerSchema(j1e,b6.getColorSchema());const Ufe=new ho(()=>X1e.notifySchemaChanged(j1e),200);b6.onDidChangeSchema(()=>{Ufe.isScheduled()||Ufe.schedule()});const J0t=Ze("editor.lineHighlightBackground",{dark:null,light:null,hc:null},$("lineHighlight","Background color for the highlight of line at the cursor position.")),Wfe=Ze("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},$("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),Q0t=Ze("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},$("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),Z0t=Ze("editor.rangeHighlightBorder",{dark:null,light:null,hc:Ua},$("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),ewt=Ze("editor.symbolHighlightBackground",{dark:nJ,light:nJ,hc:null},$("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),twt=Ze("editor.symbolHighlightBorder",{dark:null,light:null,hc:Ua},$("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),Y1e=Ze("editorCursor.foreground",{dark:"#AEAFAD",light:mt.black,hc:mt.white},$("caret","Color of the editor cursor.")),nwt=Ze("editorCursor.background",null,$("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),y0=Ze("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},$("editorWhitespaces","Color of whitespace characters in the editor.")),y6=Ze("editorIndentGuide.background",{dark:y0,light:y0,hc:y0},$("editorIndentGuides","Color of the editor indentation guides.")),E6=Ze("editorIndentGuide.activeBackground",{dark:y0,light:y0,hc:y0},$("editorActiveIndentGuide","Color of the active editor indentation guides.")),q1e=Ze("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:mt.white},$("editorLineNumbers","Color of editor line numbers.")),r7=Ze("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:Ua},$("editorActiveLineNumber","Color of editor active line number"),!1,$("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),iwt=Ze("editorLineNumber.activeForeground",{dark:r7,light:r7,hc:r7},$("editorActiveLineNumber","Color of editor active line number")),swt=Ze("editorRuler.foreground",{dark:"#5A5A5A",light:mt.lightgrey,hc:mt.white},$("editorRuler","Color of the editor rulers.")),owt=Ze("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},$("editorCodeLensForeground","Foreground color of editor CodeLens")),rwt=Ze("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},$("editorBracketMatchBackground","Background color behind matching brackets")),J1e=Ze("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:_r},$("editorBracketMatchBorder","Color for matching brackets boxes")),lwt=Ze("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},$("editorOverviewRulerBorder","Color of the overview ruler border.")),awt=Ze("editorOverviewRuler.background",null,$("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),cwt=Ze("editorGutter.background",{dark:Ch,light:Ch,hc:Ch},$("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),uwt=Ze("editorUnnecessaryCode.border",{dark:null,light:null,hc:mt.fromHex("#fff").transparent(.8)},$("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),dwt=Ze("editorUnnecessaryCode.opacity",{dark:mt.fromHex("#000a"),light:mt.fromHex("#0007"),hc:null},$("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`)),Q1e=Ze("editorGhostText.border",{dark:null,light:null,hc:mt.fromHex("#fff").transparent(.8)},$("editorGhostTextBorder","Border color of ghost text in the editor.")),Z1e=Ze("editorGhostText.foreground",{dark:mt.fromHex("#ffffff56"),light:mt.fromHex("#0007"),hc:null},$("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),l7=new mt(new Di(0,122,204,.6)),hwt=Ze("editorOverviewRuler.rangeHighlightForeground",{dark:l7,light:l7,hc:l7},$("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),fwt=Ze("editorOverviewRuler.errorForeground",{dark:new mt(new Di(255,18,18,.7)),light:new mt(new Di(255,18,18,.7)),hc:new mt(new Di(255,50,50,1))},$("overviewRuleError","Overview ruler marker color for errors.")),gwt=Ze("editorOverviewRuler.warningForeground",{dark:qv,light:qv,hc:T6},$("overviewRuleWarning","Overview ruler marker color for warnings.")),pwt=Ze("editorOverviewRuler.infoForeground",{dark:Kg,light:Kg,hc:Rie},$("overviewRuleInfo","Overview ruler marker color for infos.")),eOe=Ze("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hc:"#FFD700"},$("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),tOe=Ze("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hc:"#DA70D6"},$("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),nOe=Ze("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hc:"#87CEFA"},$("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),iOe=Ze("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),sOe=Ze("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),oOe=Ze("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),mwt=Ze("editorBracketHighlight.unexpectedBracket.foreground",{dark:new mt(new Di(255,18,18,.8)),light:new mt(new Di(255,18,18,.8)),hc:new mt(new Di(255,50,50,1))},$("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),_wt=Ze("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),vwt=Ze("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),bwt=Ze("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Twt=Ze("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Cwt=Ze("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),ywt=Ze("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Ewt=Ze("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Swt=Ze("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),wwt=Ze("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Iwt=Ze("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Lwt=Ze("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Owt=Ze("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));ws((n,e)=>{const t=n.getColor(Ch);t&&e.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${t}; }`);const i=n.getColor(PC);i&&e.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${i}; }`);const s=n.getColor(cwt);s&&e.addRule(`.monaco-editor .margin { background-color: ${s}; }`);const o=n.getColor(Q0t);o&&e.addRule(`.monaco-editor .rangeHighlight { background-color: ${o}; }`);const r=n.getColor(Z0t);r&&e.addRule(`.monaco-editor .rangeHighlight { border: 1px ${n.type==="hc"?"dotted":"solid"} ${r}; }`);const a=n.getColor(ewt);a&&e.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const c=n.getColor(twt);c&&e.addRule(`.monaco-editor .symbolHighlight { border: 1px ${n.type==="hc"?"dotted":"solid"} ${c}; }`);const u=n.getColor(y0);u&&(e.addRule(`.monaco-editor .mtkw { color: ${u} !important; }`),e.addRule(`.monaco-editor .mtkz { color: ${u} !important; }`))});class Rwt extends wt{constructor(e){super(),this.textModel=e,this.colorProvider=new rOe,this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.onDidChangeOptions(t=>{this.colorizationOptions=e.getOptions().bracketPairColorizationOptions})),this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}getDecorationsInRange(e,t,i){if(t===void 0)return[];if(!this.colorizationOptions.enabled)return[];const s=new Array,o=this.textModel.bracketPairs.getBracketsInRange(e);for(const r of o)s.push({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r)},ownerId:0,range:r.range});return s}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new be(1,1,this.textModel.getLineCount(),1),e,t):[]}}class rOe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}ws((n,e)=>{const t=[eOe,tOe,nOe,iOe,sOe,oOe],i=new rOe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(mwt)}; }`);let s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var Mwt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},a7=function(n,e){return function(t,i){e(t,i,n)}};function kwt(){return new zEt}function Awt(n){const e=kwt();return e.acceptChunk(n),e.finish()}function Gfe(n,e){return(typeof n=="string"?Awt(n):n).create(e)}let eV=0;const Nwt=999,Dwt=1e4;class $wt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;do{let s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const $N=()=>{throw new Error("Invalid change accessor")};class Ov{constructor(){this._searchCanceledBrand=void 0}}Ov.INSTANCE=new Ov;function tV(n){return n instanceof Ov?null:n}let xd=class om extends wt{constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._modeService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new rt),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Bwt(g=>this.handleBeforeFireDecorationsChangedEvent(g))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new rt),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new rt),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new rt),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new rt),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new rt),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeContentOrInjectedText=this._register(new rt),this.onDidChangeContentOrInjectedText=this._onDidChangeContentOrInjectedText.event,this._eventEmitter=this._register(new Hwt),this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new rt),this.onBackgroundTokenizationStateChanged=this._onBackgroundTokenizationStateChanged.event,this._register(this._eventEmitter.fastEvent(g=>{this._onDidChangeContentOrInjectedText.fire(g.rawContentChangedEvent)})),eV++,this.id="$model"+eV,this.isForSimpleWidget=t.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=Jn.parse("inmemory://model/"+eV):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:c,disposable:u}=Gfe(e,t.defaultEOL);this._buffer=c,this._bufferDisposable=u,this._options=om.resolveOptions(this._buffer,t);const d=this._buffer.getLineCount(),f=this._buffer.getValueLengthInRange(new be(1,1,d,this._buffer.getLineLength(d)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=f>om.LARGE_FILE_SIZE_THRESHOLD||d>om.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=f>om.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageId=i||ly,this._languageRegistryListener=this._languageConfigurationService.onDidChange(g=>{g.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=lLe(eV),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new zfe,this._commandManager=new fie(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new nh(this._modeService.languageIdCodec),this._tokens2=new vie(this._modeService.languageIdCodec),this._tokenization=new JEt(this,this._modeService.languageIdCodec),this._bracketPairColorizer=this._register(new ESt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Rwt(this)),this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()}))}static resolveOptions(e,t){if(t.detectIndentation){const i=Cfe(e,t.tabSize,t.insertSpaces);return new QU({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new QU({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}get bracketPairs(){return this._bracketPairColorizer}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(this._backgroundTokenizationState===2)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this._onBackgroundTokenizationStateChanged.fire())}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new IO([],"",`
- `,!1,!1,!0,!0);e.dispose(),this._buffer=e}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._bracketPairColorizer.handleContentChanged(t),!this._isDisposing&&this._eventEmitter.fire(new R3(e,t))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=Gfe(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new zfe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new _0([new KEt],this._versionId,!1,!1),this._createContentChanged2(new be(1,1,o,r),0,s,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
- `:`
- `;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new _0([new YEt],this._versionId,!1,!1),this._createContentChanged2(new be(1,1,o,r),0,s,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i<s;i++){const o=t[i],r=o.range,a=o.cachedAbsoluteStart-o.start,c=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),u=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);o.cachedAbsoluteStart=c,o.cachedAbsoluteEnd=u,o.cachedVersionId=e,o.start=c-a,o.end=u-a,cy(o)}}onBeforeAttached(){this._attachedEditorCount++,this._attachedEditorCount===1&&this._onDidChangeAttached.fire(void 0)}onBeforeDetached(){this._attachedEditorCount--,this._attachedEditorCount===0&&this._onDidChangeAttached.fire(void 0)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=Dwt?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();let t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.indentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new QU({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;let c=this._options.createChangeEvent(a);this._options=a,this._onDidChangeOptions.fire(c)}detectIndentation(e,t){this._assertNotDisposed();let i=Cfe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let s=0;for(let r=0;r<e.length;r++)e.charAt(r)===" "?s+=t:s++;let o="";if(!i){let r=Math.floor(s/t);s=s%t;for(let a=0;a<r;a++)o+=" "}for(let r=0;r<s;r++)o+=" ";return o}static normalizeIndentation(e,t,i){let s=cc(e);return s===-1&&(s=e.length),om._normalizeIndentationFromWhitespace(e.substring(0,s),t,i)+e.substring(s)}normalizeIndentation(e){return this._assertNotDisposed(),om.normalizeIndentation(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(oLe.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new $wt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===`
- `?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const f=this.getLineMaxColumn(o);r>=f&&(r=f)}const a=e.endLineNumber,c=e.endColumn;let u=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof c=="number"&&!isNaN(c)?c:1);if(u<1)u=1,d=1;else if(u>t)u=t,d=this.getLineMaxColumn(u);else if(d<=1)d=1;else{const f=this.getLineMaxColumn(u);d>=f&&(d=f)}return i===o&&s===r&&a===u&&c===d&&e instanceof be&&!(e instanceof fn)?e:new be(o,r,u,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(yl(r))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(s<1)return new ct(1,1);if(s>r)return new ct(r,this.getLineMaxColumn(r));if(o<=1)return new ct(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new ct(s,a);if(i===1){const c=this._buffer.getLineCharCode(s,o-2);if(yl(c))return new ct(s,o-1)}return new ct(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof ct&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,c=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,u=yl(a),d=yl(c);return!u&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof be&&!(e instanceof fn)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=s.lineNumber,c=s.column;{const u=r>1?this._buffer.getLineCharCode(o,r-2):0,d=c>1&&c<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,c-2):0,f=yl(u),g=yl(d);return!f&&!g?new be(o,r,a,c):o===a&&r===c?new be(o,r-1,a,c-1):f&&g?new be(o,r-1,a,c+1):f?new be(o,r-1,a,c):new be(o,r,a,c+1)}}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new be(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,o,r,a=Nwt){this._assertNotDisposed();let c=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(f=>be.isIRange(f))&&(c=t.map(f=>this.validateRange(f)))),c===null&&(c=[this.getFullModelRange()]),c=c.sort((f,g)=>f.startLineNumber-g.startLineNumber||f.startColumn-g.startColumn);const u=[];u.push(c.reduce((f,g)=>be.areIntersecting(f,g)?f.plusRange(g):(u.push(f),g)));let d;if(!i&&e.indexOf(`
- `)<0){const g=new vS(e,i,s,o).parseSearchRequest();if(!g)return[];d=p=>this.findMatchesLineByLine(p,g,r,a)}else d=f=>JH.findMatches(this,new vS(e,i,s,o),f,r,a);return u.map(d).reduce((f,g)=>f.concat(g),[])}findNextMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
- `)<0){const u=new vS(e,i,s,o).parseSearchRequest();if(!u)return null;const d=this.getLineCount();let f=new be(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),g=this.findMatchesLineByLine(f,u,r,1);return JH.findNextMatch(this,new vS(e,i,s,o),a,r),g.length>0||(f=new be(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),g=this.findMatchesLineByLine(f,u,r,1),g.length>0)?g[0]:null}return JH.findNextMatch(this,new vS(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return JH.findPreviousMatch(this,new vS(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
- `?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof k9?e:new k9(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i<s;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){let s=t.map(r=>({range:this.validateRange(r.range),text:r.text})),o=!0;if(e)for(let r=0,a=e.length;r<a;r++){let c=e[r],u=!1;for(let d=0,f=s.length;d<f;d++){let g=s[d].range,p=g.startLineNumber>c.endLineNumber,_=c.startLineNumber>g.endLineNumber;if(!p&&!_){u=!0;break}}if(!u){o=!1;break}}if(o)for(let r=0,a=this._trimAutoWhitespaceLines.length;r<a;r++){let c=this._trimAutoWhitespaceLines[r],u=this.getLineMaxColumn(c),d=!0;for(let f=0,g=s.length;f<g;f++){let p=s[f].range,_=s[f].text;if(!(c<p.startLineNumber||c>p.endLineNumber)&&!(c===p.startLineNumber&&p.startColumn===u&&p.isEmpty()&&_&&_.length>0&&_.charAt(0)===`
- `)&&!(c===p.startLineNumber&&p.startColumn===1&&p.isEmpty()&&_&&_.length>0&&_.charAt(_.length-1)===`
- `)){d=!1;break}}if(d){const f=new be(c,1,c,u);t.push(new k9(null,f,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new be(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new be(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let u=0,d=r.length;u<d;u++){const f=r[u],[g,p,_]=TR(f.text);this._tokens.acceptEdit(f.range,g,p),this._tokens2.acceptEdit(f.range,g,p,_,f.text.length>0?f.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(f.rangeOffset,f.rangeLength,f.text.length,f.forceMoveMarkers)}let a=[];this._increaseVersionId();let c=i;for(let u=0,d=r.length;u<d;u++){const f=r[u],[g]=TR(f.text);this._onDidChangeDecorations.fire();const p=f.range.startLineNumber,_=f.range.endLineNumber,v=_-p,C=g,y=Math.min(v,C),w=C-v,I=o-c-w+p,L=I,O=I+C,A=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new ct(L,1)),this.getOffsetAt(new ct(O,this.getLineMaxColumn(O))),0),N=sp.fromDecorations(A),D=new jD(N);for(let P=y;P>=0;P--){const F=p+P,V=I+P;D.takeFromEndWhile(Q=>Q.lineNumber>V);const U=D.takeFromEndWhile(Q=>Q.lineNumber===V);a.push(new kfe(F,this.getLineContent(V),U))}if(y<v){const P=p+y;a.push(new jEt(P+1,_))}if(y<C){const P=new jD(N),F=p+y,V=C-y,U=o-c-V+F+1;let Q=[],de=[];for(let q=0;q<V;q++){let K=U+q;de[q]=this.getLineContent(K),P.takeWhile(re=>re.lineNumber<K),Q[q]=P.takeWhile(re=>re.lineNumber===K)}a.push(new XEt(F+1,p+C,de,Q))}c+=w}this._emitContentChangedEvent(new _0(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=[...e].map(s=>new kfe(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeContentOrInjectedText.fire(new R1e(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,jfe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)},s=null;try{s=t(i)}catch(o){di(o)}return i.addDecoration=$N,i.changeDecoration=$N,i.changeDecorationOptions=$N,i.removeDecoration=$N,i.deltaDecorations=$N,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:Kfe[i]}])[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(Kfe[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;i<s;i++){const o=t[i];this._decorationsTree.delete(o),delete this._decorations[o.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1){let o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),a=Math.min(o,Math.max(1,t)),c=this.getLineMaxColumn(a);const u=new be(r,1,a,c),d=this._getDecorationsInRange(u,i,s);return d.push(...this._decorationProvider.getDecorationsInRange(u,i,s)),d}getDecorationsInRange(e,t=0,i=!1){let s=this.validateRange(e);const o=this._getDecorationsInRange(s,t,i);return o.push(...this._decorationProvider.getDecorationsInRange(s,t,i)),o}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return sp.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,o,t,i)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber)}if(i.options.before||t.before){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}s!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const s=this.getVersionId(),o=t.length;let r=0;const a=i.length;let c=0,u=new Array(a);for(;r<o||c<a;){let d=null;if(r<o){do d=this._decorations[t[r++]];while(!d&&r<o);if(d){if(d.options.after){const f=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.endLineNumber)}if(d.options.before){const f=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(f.startLineNumber)}this._decorationsTree.delete(d),this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(c<a){if(!d){const C=++this._lastDecorationId,y=`${this._instanceId};${C}`;d=new w1e(y,0,0),this._decorations[y]=d}const f=i[c],g=this._validateRangeRelaxedNoAllocations(f.range),p=jfe(f.options),_=this._buffer.getOffsetAt(g.startLineNumber,g.startColumn),v=this._buffer.getOffsetAt(g.endLineNumber,g.endColumn);d.ownerId=e,d.reset(s,_,v,g),d.setOptions(p),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(p),this._decorationsTree.insert(d),u[c]=d.id,c++}else d&&delete this._decorations[d.id]}return u}setTokens(e,t=!1){if(e.length!==0){let i=[];for(let s=0,o=e.length;s<o;s++){const r=e[s];let a=0,c=0,u=!1;for(let d=0,f=r.tokens.length;d<f;d++){const g=r.startLineNumber+d;u?(this._tokens.setTokens(this._languageId,g-1,this._buffer.getLineLength(g),r.tokens[d],!1),c=g):this._tokens.setTokens(this._languageId,g-1,this._buffer.getLineLength(g),r.tokens[d],!0)&&(u=!0,a=g,c=g)}u&&i.push({fromLineNumber:a,toLineNumber:c})}i.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:i})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._tokens2.isComplete()}hasSomeSemanticTokens(){return!this._tokens2.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageId,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageId(){return this._languageId}setMode(e){if(this._languageId===e)return;let t={oldLanguage:this._languageId,newLanguage:e};this._languageId=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new ct(e,t)),s=this.getLineTokens(i.lineNumber);return s.getLanguageId(s.findTokenIndexAtOffset(i.column-1))}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(e){this._assertNotDisposed();const t=this.validatePosition(e),i=this.getLineContent(t.lineNumber),s=this._getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=om._findLanguageBoundaries(s,o),c=PW(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&r===t.column-1){const[u,d]=om._findLanguageBoundaries(s,o-1),f=PW(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(u,d),u);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn)return f}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r<a&&e.getLanguageId(r)===i;r++)o=e.getEndOffset(r);return[s,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}findMatchingBracketUp(e,t){let i=e.toLowerCase(),s=this.validatePosition(t),o=this._getLineTokens(s.lineNumber),r=o.getLanguageId(o.findTokenIndexAtOffset(s.column-1)),a=this.getLanguageConfiguration(r).brackets;if(!a)return null;let c=a.textIsBracket[i];return c?tV(this._findMatchingBracketUp(c,s,null)):null}matchBracket(e){return this._matchBracket(this.validatePosition(e))}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let u=s-1;u>=0;u--){const d=t.getEndOffset(u);if(d<=a)break;if(sm(t.getStandardTokenType(u))||t.getLanguageId(u)!==r){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let u=s+1;u<o;u++){const d=t.getStartOffset(u);if(d>=c)break;if(sm(t.getStandardTokenType(u))||t.getLanguageId(u)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e){const t=e.lineNumber,i=this._getLineTokens(t),s=this._buffer.getLineContent(t),o=i.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const r=this.getLanguageConfiguration(i.getLanguageId(o)).brackets;if(r&&!sm(i.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:c}=this._establishBracketSearchOffsets(e,i,r,o),u=null;for(;;){const d=df.findNextBracketInRange(r.forwardRegex,t,s,a,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const f=s.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),g=this._matchFoundBracket(d,r.textIsBracket[f],r.textIsOpenBracket[f],null);if(g){if(g instanceof Ov)return null;u=g}}a=d.endColumn-1}if(u)return u}if(o>0&&i.getStartOffset(o)===e.column-1){const a=o-1,c=this.getLanguageConfiguration(i.getLanguageId(a)).brackets;if(c&&!sm(i.getStandardTokenType(a))){let{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,i,c,a);const f=df.findPrevBracketInRange(c.reversedRegex,t,s,u,d);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn){const g=s.substring(f.startColumn-1,f.endColumn-1).toLowerCase(),p=this._matchFoundBracket(f,c.textIsBracket[g],c.textIsOpenBracket[g],null);if(p)return p instanceof Ov?null:p}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof Ov?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(u,d,f,g)=>{for(;;){if(i&&++a%100===0&&!i())return Ov.INSTANCE;const p=df.findPrevBracketInRange(o,u,d,f,g);if(!p)break;const _=d.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(_)?r++:e.isClose(_)&&r--,r===0)return p;g=p.startColumn-1}return null};for(let u=t.lineNumber;u>=1;u--){const d=this._getLineTokens(u),f=d.getCount(),g=this._buffer.getLineContent(u);let p=f-1,_=g.length,v=g.length;u===t.lineNumber&&(p=d.findTokenIndexAtOffset(t.column-1),_=t.column-1,v=t.column-1);let C=!0;for(;p>=0;p--){const y=d.getLanguageId(p)===s&&!sm(d.getStandardTokenType(p));if(y)C?_=d.getStartOffset(p):(_=d.getStartOffset(p),v=d.getEndOffset(p));else if(C&&_!==v){const w=c(u,g,_,v);if(w)return w}C=y}if(C&&_!==v){const y=c(u,g,_,v);if(y)return y}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,f,g,p)=>{for(;;){if(i&&++a%100===0&&!i())return Ov.INSTANCE;const _=df.findNextBracketInRange(o,d,f,g,p);if(!_)break;const v=f.substring(_.startColumn-1,_.endColumn-1).toLowerCase();if(e.isOpen(v)?r++:e.isClose(v)&&r--,r===0)return _;g=_.endColumn-1}return null},u=this.getLineCount();for(let d=t.lineNumber;d<=u;d++){const f=this._getLineTokens(d),g=f.getCount(),p=this._buffer.getLineContent(d);let _=0,v=0,C=0;d===t.lineNumber&&(_=f.findTokenIndexAtOffset(t.column-1),v=t.column-1,C=t.column-1);let y=!0;for(;_<g;_++){const w=f.getLanguageId(_)===s&&!sm(f.getStandardTokenType(_));if(w)y||(v=f.getStartOffset(_)),C=f.getEndOffset(_);else if(y&&v!==C){const I=c(d,p,v,C);if(I)return I}y=w}if(y&&v!==C){const w=c(d,p,v,C);if(w)return w}}return null}findPrevBracket(e){const t=this.validatePosition(e);let i=null,s=null;for(let o=t.lineNumber;o>=1;o--){const r=this._getLineTokens(o),a=r.getCount(),c=this._buffer.getLineContent(o);let u=a-1,d=c.length,f=c.length;if(o===t.lineNumber){u=r.findTokenIndexAtOffset(t.column-1),d=t.column-1,f=t.column-1;const p=r.getLanguageId(u);i!==p&&(i=p,s=this.getLanguageConfiguration(i).brackets)}let g=!0;for(;u>=0;u--){const p=r.getLanguageId(u);if(i!==p){if(s&&g&&d!==f){const v=df.findPrevBracketInRange(s.reversedRegex,o,c,d,f);if(v)return this._toFoundBracket(s,v);g=!1}i=p,s=this.getLanguageConfiguration(i).brackets}const _=!!s&&!sm(r.getStandardTokenType(u));if(_)g?d=r.getStartOffset(u):(d=r.getStartOffset(u),f=r.getEndOffset(u));else if(s&&g&&d!==f){const v=df.findPrevBracketInRange(s.reversedRegex,o,c,d,f);if(v)return this._toFoundBracket(s,v)}g=_}if(s&&g&&d!==f){const p=df.findPrevBracketInRange(s.reversedRegex,o,c,d,f);if(p)return this._toFoundBracket(s,p)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let s=null,o=null;for(let r=t.lineNumber;r<=i;r++){const a=this._getLineTokens(r),c=a.getCount(),u=this._buffer.getLineContent(r);let d=0,f=0,g=0;if(r===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),f=t.column-1,g=t.column-1;const _=a.getLanguageId(d);s!==_&&(s=_,o=this.getLanguageConfiguration(s).brackets)}let p=!0;for(;d<c;d++){const _=a.getLanguageId(d);if(s!==_){if(o&&p&&f!==g){const C=df.findNextBracketInRange(o.forwardRegex,r,u,f,g);if(C)return this._toFoundBracket(o,C);p=!1}s=_,o=this.getLanguageConfiguration(s).brackets}const v=!!o&&!sm(a.getStandardTokenType(d));if(v)p||(f=a.getStartOffset(d)),g=a.getEndOffset(d);else if(o&&p&&f!==g){const C=df.findNextBracketInRange(o.forwardRegex,r,u,f,g);if(C)return this._toFoundBracket(o,C)}p=v}if(o&&p&&f!==g){const _=df.findNextBracketInRange(o.forwardRegex,r,u,f,g);if(_)return this._toFoundBracket(o,_)}}return null}findEnclosingBrackets(e,t){let i;if(typeof t>"u")i=null;else{const p=Date.now();i=()=>Date.now()-p<=t}const s=this.validatePosition(e),o=this.getLineCount(),r=new Map;let a=[];const c=(p,_)=>{if(!r.has(p)){let v=[];for(let C=0,y=_?_.brackets.length:0;C<y;C++)v[C]=0;r.set(p,v)}a=r.get(p)};let u=0;const d=(p,_,v,C,y)=>{for(;;){if(i&&++u%100===0&&!i())return Ov.INSTANCE;const w=df.findNextBracketInRange(p.forwardRegex,_,v,C,y);if(!w)break;const I=v.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),L=p.textIsBracket[I];if(L&&(L.isOpen(I)?a[L.index]++:L.isClose(I)&&a[L.index]--,a[L.index]===-1))return this._matchFoundBracket(w,L,!1,i);C=w.endColumn-1}return null};let f=null,g=null;for(let p=s.lineNumber;p<=o;p++){const _=this._getLineTokens(p),v=_.getCount(),C=this._buffer.getLineContent(p);let y=0,w=0,I=0;if(p===s.lineNumber){y=_.findTokenIndexAtOffset(s.column-1),w=s.column-1,I=s.column-1;const O=_.getLanguageId(y);f!==O&&(f=O,g=this.getLanguageConfiguration(f).brackets,c(f,g))}let L=!0;for(;y<v;y++){const O=_.getLanguageId(y);if(f!==O){if(g&&L&&w!==I){const N=d(g,p,C,w,I);if(N)return tV(N);L=!1}f=O,g=this.getLanguageConfiguration(f).brackets,c(f,g)}const A=!!g&&!sm(_.getStandardTokenType(y));if(A)L||(w=_.getStartOffset(y)),I=_.getEndOffset(y);else if(g&&L&&w!==I){const N=d(g,p,C,w,I);if(N)return tV(N)}L=A}if(g&&L&&w!==I){const O=d(g,p,C,w,I);if(O)return tV(O)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.getValueInRange(t);i=i.toLowerCase();let s=e.textIsBracket[i];return s?{range:t,open:s.open,close:s.close,isOpen:e.textIsOpenBracket[i]}:null}static computeIndentLevel(e,t){let i=0,s=0,o=e.length;for(;s<o;){let r=e.charCodeAt(s);if(r===32)i++;else if(r===9)i=i-i%t+t;else break;s++}return s===o?-1:i}_computeIndentLevel(e){return om.computeIndentLevel(this._buffer.getLineContent(e+1),this._options.tabSize)}getActiveIndentGuide(e,t,i){this._assertNotDisposed();const s=this.getLineCount();if(e<1||e>s)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this._languageId).foldingRules,r=!!(o&&o.offSide);let a=-2,c=-1,u=-2,d=-1;const f=N=>{if(a!==-1&&(a===-2||a>N-1)){a=-1,c=-1;for(let D=N-2;D>=0;D--){let P=this._computeIndentLevel(D);if(P>=0){a=D,c=P;break}}}if(u===-2){u=-1,d=-1;for(let D=N;D<s;D++){let P=this._computeIndentLevel(D);if(P>=0){u=D,d=P;break}}}};let g=-2,p=-1,_=-2,v=-1;const C=N=>{if(g===-2){g=-1,p=-1;for(let D=N-2;D>=0;D--){let P=this._computeIndentLevel(D);if(P>=0){g=D,p=P;break}}}if(_!==-1&&(_===-2||_<N-1)){_=-1,v=-1;for(let D=N;D<s;D++){let P=this._computeIndentLevel(D);if(P>=0){_=D,v=P;break}}}};let y=0,w=!0,I=0,L=!0,O=0,A=0;for(let N=0;w||L;N++){const D=e-N,P=e+N;N>1&&(D<1||D<t)&&(w=!1),N>1&&(P>s||P>i)&&(L=!1),N>5e4&&(w=!1,L=!1);let F=-1;if(w){const U=this._computeIndentLevel(D-1);U>=0?(u=D-1,d=U,F=Math.ceil(U/this._options.indentSize)):(f(D),F=this._getIndentLevelForWhitespaceLine(r,c,d))}let V=-1;if(L){const U=this._computeIndentLevel(P-1);U>=0?(g=P-1,p=U,V=Math.ceil(U/this._options.indentSize)):(C(P),V=this._getIndentLevelForWhitespaceLine(r,p,v))}if(N===0){A=F;continue}if(N===1){if(P<=s&&V>=0&&A+1===V){w=!1,y=P,I=P,O=V;continue}if(D>=1&&F>=0&&F-1===A){L=!1,y=D,I=D,O=F;continue}if(y=e,I=e,O=A,O===0)return{startLineNumber:y,endLineNumber:I,indent:O}}w&&(F>=O?y=D:w=!1),L&&(V>=O?I=P:L=!1)}return{startLineNumber:y,endLineNumber:I,indent:O}}getLinesBracketGuides(e,t,i,s){var o,r,a,c,u;const d=[],f=this._bracketPairColorizer.getBracketPairsInRangeWithMinIndentation(new be(e,1,t,this.getLineMaxColumn(t)));let g;if(i&&f.length>0){const y=e<=i.lineNumber&&i.lineNumber<=t?f.filter(w=>w.range.containsPosition(i)):this._bracketPairColorizer.getBracketPairsInRange(be.fromPositions(i));g=(o=ECt(y,w=>w.range.startLineNumber!==w.range.endLineNumber))===null||o===void 0?void 0:o.range}const p=new jD(f),_=new Array,v=new Array,C=new lOe;for(let y=e;y<=t;y++){let w=new Array;v.length>0&&(w=w.concat(v),v.length=0),d.push(w);for(const L of p.takeWhile(O=>O.openingBracketRange.startLineNumber<=y)||[]){if(L.range.startLineNumber===L.range.endLineNumber)continue;const O=Math.min(this.getVisibleColumnFromPosition(L.openingBracketRange.getStartPosition()),this.getVisibleColumnFromPosition((a=(r=L.closingBracketRange)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:L.range.getEndPosition()),L.minVisibleColumnIndentation+1);let A=!1;L.closingBracketRange&&cc(this.getLineContent(L.closingBracketRange.startLineNumber))<L.closingBracketRange.startColumn-1&&(A=!0);const N=L.openingBracketRange.getStartPosition(),D=(u=(c=L.closingBracketRange)===null||c===void 0?void 0:c.getStartPosition())!==null&&u!==void 0?u:L.range.getEndPosition();L.closingBracketRange===void 0?_[L.nestingLevel]=null:_[L.nestingLevel]={nestingLevel:L.nestingLevel,guideVisibleColumn:O,start:N,visibleStartColumn:this.getVisibleColumnFromPosition(N),end:D,visibleEndColumn:this.getVisibleColumnFromPosition(D),bracketPair:L,renderHorizontalEndLineAtTheBottom:A}}for(const L of _){if(!L)continue;const O=g&&L.bracketPair.range.equalsRange(g),A=C.getInlineClassNameOfLevel(L.nestingLevel)+(s.highlightActive&&O?" "+C.activeClassName:"");(O&&s.horizontalGuides!==p0.Disabled||s.includeInactive&&s.horizontalGuides===p0.Enabled)&&(L.start.lineNumber===y&&L.guideVisibleColumn<L.visibleStartColumn&&w.push(new H1(L.guideVisibleColumn,A,new Iq(!1,L.start.column))),L.end.lineNumber===y+1&&L.guideVisibleColumn<L.visibleEndColumn&&v.push(new H1(L.guideVisibleColumn,A,new Iq(!L.renderHorizontalEndLineAtTheBottom,L.end.column))))}let I=Number.MAX_SAFE_INTEGER;for(let L=_.length-1;L>=0;L--){const O=_[L];if(!O)continue;const A=s.highlightActive&&g&&O.bracketPair.range.equalsRange(g),N=C.getInlineClassNameOfLevel(O.nestingLevel)+(A?" "+C.activeClassName:"");(A||s.includeInactive)&&O.renderHorizontalEndLineAtTheBottom&&O.end.lineNumber===y+1&&v.push(new H1(O.guideVisibleColumn,N,null)),!(O.end.lineNumber<=y||O.start.lineNumber>=y)&&(O.guideVisibleColumn>=I&&!A||(I=O.guideVisibleColumn,(A||s.includeInactive)&&w.push(new H1(O.guideVisibleColumn,N,null))))}w.sort((L,O)=>L.visibleColumn-O.visibleColumn)}return d}getVisibleColumnFromPosition(e){return Vs.visibleColumnFromColumn(this.getLineContent(e.lineNumber),e.column,this._options.tabSize)+1}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.getLanguageConfiguration(this._languageId).foldingRules,o=!!(s&&s.offSide);let r=new Array(t-e+1),a=-2,c=-1,u=-2,d=-1;for(let f=e;f<=t;f++){let g=f-e;const p=this._computeIndentLevel(f-1);if(p>=0){a=f-1,c=p,r[g]=Math.ceil(p/this._options.indentSize);continue}if(a===-2){a=-1,c=-1;for(let _=f-2;_>=0;_--){let v=this._computeIndentLevel(_);if(v>=0){a=_,c=v;break}}}if(u!==-1&&(u===-2||u<f-1)){u=-1,d=-1;for(let _=f;_<i;_++){let v=this._computeIndentLevel(_);if(v>=0){u=_,d=v;break}}}r[g]=this._getIndentLevelForWhitespaceLine(o,c,d)}return r}_getIndentLevelForWhitespaceLine(e,t,i){return t===-1||i===-1?0:t<i?1+Math.floor(t/this._options.indentSize):t===i?Math.ceil(i/this._options.indentSize):e?Math.ceil(i/this._options.indentSize):1+Math.floor(i/this._options.indentSize)}normalizePosition(e,t){return e}getLineIndentColumn(e){return xwt(this.getLineContent(e))+1}};xd.MODEL_SYNC_LIMIT=50*1024*1024;xd.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;xd.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;xd.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:$a.tabSize,indentSize:$a.indentSize,insertSpaces:$a.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:$a.trimAutoWhitespace,largeFileOptimizations:$a.largeFileOptimizations,bracketPairColorizationOptions:$a.bracketPairColorizationOptions};xd=Mwt([a7(4,wF),a7(5,Ga),a7(6,yF)],xd);function xwt(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}class lOe{constructor(){this.activeClassName="indent-active"}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}function c7(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function u7(n){return!!n.options.after||!!n.options.before}class zfe{constructor(){this._decorationsTree0=new q9,this._decorationsTree1=new q9,this._injectedTextDecorationsTree=new q9}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o){const r=e.getVersionId(),a=this._intervalSearch(t,i,s,o,r);return this._ensureNodesHaveRanges(e,a)}_intervalSearch(e,t,i,s,o){const r=this._decorationsTree0.intervalSearch(e,t,i,s,o),a=this._decorationsTree1.intervalSearch(e,t,i,s,o),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o);return r.concat(a).concat(c)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s){const o=e.getVersionId(),r=this._search(t,i,s,o);return this._ensureNodesHaveRanges(e,r)}_search(e,t,i,s){if(i)return this._decorationsTree1.search(e,t,s);{const o=this._decorationsTree0.search(e,t,s),r=this._decorationsTree1.search(e,t,s),a=this._injectedTextDecorationsTree.search(e,t,s);return o.concat(r).concat(a)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){u7(e)?this._injectedTextDecorationsTree.insert(e):c7(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){u7(e)?this._injectedTextDecorationsTree.delete(e):c7(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){u7(e)?this._injectedTextDecorationsTree.resolveNode(e,t):c7(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function xT(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class aOe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Pwt extends aOe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Ad.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;let i=e?t.getColor(e.id):null;return i?i.toString():""}}class Fwt extends aOe{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?mt.fromHex(e):t.getColor(e.id)}}class Fx{constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1}static from(e){return e instanceof Fx?e:new Fx(e)}}class Ci{constructor(e){this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?xT(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Pwt(e.overviewRuler):null,this.minimap=e.minimap?new Fwt(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?xT(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?xT(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?xT(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?xT(e.marginClassName):null,this.inlineClassName=e.inlineClassName?xT(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?xT(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?xT(e.afterContentClassName):null,this.after=e.after?Fx.from(e.after):null,this.before=e.before?Fx.from(e.before):null}static register(e){return new Ci(e)}static createDynamic(e){return new Ci(e)}}Ci.EMPTY=Ci.register({description:"empty"});const Kfe=[Ci.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Ci.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Ci.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Ci.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function jfe(n){return n instanceof Ci?n:Ci.createDynamic(n)}class Bwt extends wt{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new rt),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;if(this._deferredCnt--,this._deferredCnt===0){if(this._shouldFire){this.handleBeforeFire(this._affectedInjectedTextLines);const t={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(t)}(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null}}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._shouldFire=!0}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._shouldFire=!0}}class Hwt extends wt{constructor(){super(),this._fastEmitter=this._register(new rt),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new rt),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}const Vwt=()=>!0,Xfe=()=>!1,Uwt=n=>n===" "||n===" ";class bf{constructor(e,t,i){this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,o=s.get(129);this.readOnly=s.get(80),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(103),this.lineHeight=s.get(58),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=s.get(114),this.wordSeparators=s.get(115),this.emptySelectionClipboard=s.get(32),this.copyWithSyntaxHighlighting=s.get(21),this.multiCursorMergeOverlapping=s.get(68),this.multiCursorPaste=s.get(70),this.autoClosingBrackets=s.get(5),this.autoClosingQuotes=s.get(8),this.autoClosingDelete=s.get(6),this.autoClosingOvertype=s.get(7),this.autoSurround=s.get(11),this.autoIndent=s.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:bf._getShouldAutoClose(e,this.autoClosingQuotes),bracket:bf._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=ns.getAutoClosingPairs(e);let r=bf._getSurroundingPairs(e);if(r)for(const a of r)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(129)||e.hasChanged(115)||e.hasChanged(32)||e.hasChanged(68)||e.hasChanged(70)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(114)||e.hasChanged(58)||e.hasChanged(80)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=bf._getElectricCharacters(this._languageId);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return xd.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return ns.getElectricCharacters(e)}catch(t){return di(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return Uwt;case"languageDefined":return bf._getLanguageDefinedShouldAutoClose(e);case"always":return Vwt;case"never":return Xfe}}static _getLanguageDefinedShouldAutoClose(e){try{const t=ns.getAutoCloseBeforeSet(e);return i=>t.indexOf(i)!==-1}catch(t){return di(t),Xfe}}static _getSurroundingPairs(e){try{return ns.getSurroundingPairs(e)}catch(t){return di(t),null}}}class Tl{constructor(e,t,i,s){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=s,this.selection=Tl._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,s){return e?new Tl(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new ct(t,i),s):new Tl(new be(t,i,t,i),s,new ct(t,i),s)}static _computeSelection(e,t){let i,s,o,r;return e.isEmpty()?(i=e.startLineNumber,s=e.startColumn,o=t.lineNumber,r=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,s=e.endColumn,o=t.lineNumber,r=t.column):(i=e.startLineNumber,s=e.startColumn,o=t.lineNumber,r=t.column),new fn(i,s,o,r)}}class Yfe{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class Wwt{constructor(e){this.modelState=e,this.viewState=null}}class Gwt{constructor(e){this.modelState=null,this.viewState=e}}let Ri=class cOe{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new Wwt(e)}static fromViewState(e){return new Gwt(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,s=e.positionLineNumber,o=e.positionColumn,r=new Tl(new be(t,i,t,i),0,new ct(s,o),0);return cOe.fromModelState(r)}static fromModelSelections(e){let t=[];for(let i=0,s=e.length;i<s;i++)t[i]=this.fromModelSelection(e[i]);return t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}};class _u{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function M1(n){return n==="'"||n==='"'||n==="`"}class Bx{static whitespaceVisibleColumn(e,t,i){const s=e.length;let o=0,r=-1,a=-1;for(let c=0;c<s;c++){if(c===t)return[r,a,o];switch(o%i===0&&(r=c,a=o),e.charCodeAt(c)){case 32:o+=1;break;case 9:o=Vs.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===s?[r,a,o]:[-1,-1,-1]}static atomicPosition(e,t,i,s){const o=e.length,[r,a,c]=Bx.whitespaceVisibleColumn(e,t,i);if(c===-1)return-1;let u;switch(s){case 0:u=!0;break;case 1:u=!1;break;case 2:if(c%i===0)return t;u=c%i<=i/2;break}if(u){if(r===-1)return-1;let g=a;for(let p=r;p<o;++p){if(g===a+i)return r;switch(e.charCodeAt(p)){case 32:g+=1;break;case 9:g=Vs.nextRenderTabStop(g,i);break;default:return-1}}return g===a+i?r:-1}const d=Vs.nextRenderTabStop(c,i);let f=c;for(let g=t;g<o;g++){if(f===d)return g;switch(e.charCodeAt(g)){case 32:f+=1;break;case 9:f=Vs.nextRenderTabStop(f,i);break;default:return-1}}return f===d?o:-1}}class qT{constructor(e=null){this.hitTarget=e,this.type=0}}class oJ{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var kS;(function(n){function e(t,i,s){const o=t.getPositionFromDOMInfo(i,s);return o?new oJ(o,i,null):new qT(i)}n.createFromDOMInfo=e})(kS||(kS={}));class zwt{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class Ig{constructor(e,t,i=0,s=null,o=null,r=null){this.element=e,this.type=t,this.mouseColumn=i,this.position=s,!o&&s&&(o=new be(s.lineNumber,s.column,s.lineNumber,s.column)),this.range=o,this.detail=r}static _typeToString(e){return e===1?"TEXTAREA":e===2?"GUTTER_GLYPH_MARGIN":e===3?"GUTTER_LINE_NUMBERS":e===4?"GUTTER_LINE_DECORATIONS":e===5?"GUTTER_VIEW_ZONE":e===6?"CONTENT_TEXT":e===7?"CONTENT_EMPTY":e===8?"CONTENT_VIEW_ZONE":e===9?"CONTENT_WIDGET":e===10?"OVERVIEW_RULER":e===11?"SCROLLBAR":e===12?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+e.detail}toString(){return Ig.toString(this)}}class af{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===6}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class yR{constructor(e,t,i){this.model=e.model;const s=e.configuration.options;this.layoutInfo=s.get(129),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(58),this.stickyTabStops=s.get(103),this.typicalHalfwidthCharacterWidth=s.get(43).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return yR.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.model.getLineCount();let r=null,a,c=null;return i.afterLineNumber!==o&&(c=new ct(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new ct(i.afterLineNumber,e.model.getLineMaxColumn(i.afterLineNumber))),c===null?a=r:r===null?a=c:t<s?a=r:a=c,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:c,position:a}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const s=this._context.model.getLineCount(),o=this._context.model.getLineMaxColumn(s);return{range:new be(s,o,s,o),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.model.getLineMaxColumn(t);return{range:new be(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return yR._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==document.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class Kwt{constructor(e,t,i){this.editorPos=t,this.pos=i,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+i.y-t.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+i.x-t.x-e.layoutInfo.contentLeft,this.isInMarginArea=i.x-t.x<e.layoutInfo.contentLeft&&i.x-t.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,la._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class xie extends Kwt{constructor(e,t,i,s){super(e,t,i),this._ctx=e,s?(this.target=s,this.targetPath=Zm.collect(s,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
- target: ${this.target?this.target.outerHTML:null}`}fulfill(e,t=null,i=null,s=null){let o=this.mouseColumn;return t&&t.column<this._ctx.model.getLineMaxColumn(t.lineNumber)&&(o=Vs.visibleColumnFromColumn(this._ctx.model.getLineContent(t.lineNumber),t.column,this._ctx.model.getTextModelOptions().tabSize)+1),new Ig(this.target,e,o,t,i,s)}withTarget(e){return new xie(this._ctx,this.editorPos,this.pos,e)}}const qfe={isAfterLines:!0};function d7(n){return{isAfterLines:!1,horizontalDistanceToText:n}}class la{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Zm.collect(t,this._viewHelper.viewDomNode);return!!(af.isChildOfContentWidgets(i)||af.isChildOfOverflowingContentWidgets(i)||af.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,s){const o=new yR(this._context,this._viewHelper,e),r=new xie(o,t,i,s);try{return la._createMouseTarget(o,r,!1)}catch{return r.fulfill(0)}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfill(0);const r=la._doHitTest(e,t);return r.type===1?la.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}const s=t;let o=null;return o=o||la._hitTestContentWidget(e,s),o=o||la._hitTestOverlayWidget(e,s),o=o||la._hitTestMinimap(e,s),o=o||la._hitTestScrollbarSlider(e,s),o=o||la._hitTestViewZone(e,s),o=o||la._hitTestMargin(e,s),o=o||la._hitTestViewCursor(e,s),o=o||la._hitTestTextArea(e,s),o=o||la._hitTestViewLines(e,s,i),o=o||la._hitTestScrollbar(e,s),o||t.fulfill(0)}static _hitTestContentWidget(e,t){if(af.isChildOfContentWidgets(t.targetPath)||af.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfill(9,null,null,i):t.fulfill(0)}return null}static _hitTestOverlayWidget(e,t){if(af.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfill(12,null,null,i):t.fulfill(0)}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const s of i)if(t.target===s.domNode)return t.fulfill(6,s.position,null,{mightBeForeignElement:!1})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,s=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const r of i){if(s<r.contentLeft||s>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfill(6,r.position,null,{mightBeForeignElement:!1})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?8:5;return t.fulfill(s,i.position,null,i)}return null}static _hitTestTextArea(e,t){return af.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfill(6,e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1}):t.fulfill(1,e.lastRenderData.lastTextareaPosition):null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.pos.x-t.editorPos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,s,i.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,s,i.range,r)))}return null}static _hitTestViewLines(e,t,i){if(!af.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new ct(1,1),null,qfe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.model.getLineCount(),r=e.model.getLineMaxColumn(o);return t.fulfill(7,new ct(o,r),null,qfe)}if(i){if(af.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.model.getLineLength(o)===0){const a=e.getLineWidth(o),c=d7(t.mouseContentHorizontalOffset-a);return t.fulfill(7,new ct(o,1),null,c)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=d7(t.mouseContentHorizontalOffset-r),c=new ct(o,e.model.getLineMaxColumn(o));return t.fulfill(7,c,null,a)}}return t.fulfill(0)}const s=la._doHitTest(e,t);return s.type===1?la.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(af.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.model.getLineMaxColumn(i);return t.fulfill(11,new ct(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(af.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.model.getLineMaxColumn(s);return t.fulfill(11,new ct(s,o))}}return null}static _hitTestScrollbar(e,t){if(af.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.model.getLineMaxColumn(i);return t.fulfill(11,new ct(i,s))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,s=i.get(129),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-s.contentLeft;return la._getMouseColumn(o,i.get(43).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const C=d7(t.mouseContentHorizontalOffset-c);return t.fulfill(7,s,null,C)}const u=e.visibleRangeForPosition(r,a);if(!u)return t.fulfill(0,s);const d=u.left;if(t.mouseContentHorizontalOffset===d)return t.fulfill(6,s,null,{mightBeForeignElement:!!o});const f=[];if(f.push({offset:u.left,column:a}),a>1){const C=e.visibleRangeForPosition(r,a-1);C&&f.push({offset:C.left,column:a-1})}const g=e.model.getLineMaxColumn(r);if(a<g){const C=e.visibleRangeForPosition(r,a+1);C&&f.push({offset:C.left,column:a+1})}f.sort((C,y)=>C.offset-y.offset);const p=t.pos.toClientCoordinates(),_=i.getBoundingClientRect(),v=_.left<=p.clientX&&p.clientX<=_.right;for(let C=1;C<f.length;C++){const y=f[C-1],w=f[C];if(y.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=w.offset){const I=new be(r,y.column,r,w.column);return t.fulfill(6,s,I,{mightBeForeignElement:!v||!!o})}}return t.fulfill(6,s,null,{mightBeForeignElement:!v||!!o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.getVerticalOffsetForLineNumber(i)+Math.floor(e.lineHeight/2);let r=t.pos.y+(o-t.mouseVerticalOffset);r<=t.editorPos.y&&(r=t.editorPos.y+1),r>=t.editorPos.y+e.layoutInfo.height&&(r=t.editorPos.y+e.layoutInfo.height-1);const a=new hie(t.pos.x,r),c=this._actualDoHitTestWithCaretRangeFromPoint(e,a.toClientCoordinates());return c.type===1?c:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Pw(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=jwt(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=document.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new qT;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===ym.CLASS_NAME?kS.createFromDOMInfo(e,r,s.startOffset):new qT(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===ym.CLASS_NAME?kS.createFromDOMInfo(e,o,o.textContent.length):new qT(o)}return new qT}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===ym.CLASS_NAME?kS.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new qT(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===ym.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return kS.createFromDOMInfo(e,c,0)}else if(a===ym.CLASS_NAME)return kS.createFromDOMInfo(e,i.offsetNode,0)}return new qT(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.getTextModelOptions(),o=Bx.atomicPosition(i,e.column-1,s,2);return o!==-1?new ct(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new qT;if(typeof document.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const s=e.model.getInjectedTextAt(i.position),o=e.model.normalizePosition(i.position,2);(s||!o.equals(i.position))&&(i=new oJ(o,i.spanNode,s))}return i.type===1&&e.stickyTabStops&&(i=new oJ(this._snapToSoftTabBoundary(i.position,e.model),i.spanNode,i.injectedText)),i}}function jwt(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=window.getComputedStyle(s,null).getPropertyValue("font"),a=s.innerText;let c=o.left,u=0,d;if(e>o.left+o.width)u=a.length;else{const f=JS.getInstance();for(let g=0;g<a.length+1;g++){if(d=f.getCharWidth(a.charAt(g),r)/2,c+=d,e<c){u=g;break}c+=d}}i.setStart(s.firstChild,u),i.setEnd(s.firstChild,u)}return i}class JS{constructor(){this._cache={},this._canvas=document.createElement("canvas")}static getInstance(){return JS._INSTANCE||(JS._INSTANCE=new JS),JS._INSTANCE}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const s=this._canvas.getContext("2d");s.font=t;const r=s.measureText(e).width;return this._cache[i]=r,r}}JS._INSTANCE=null;function A3(n){return function(e,t){let i=!1;return n&&(i=n.mouseTargetIsWidget(t)),i||t.preventDefault(),t}}class nw extends SF{constructor(e,t,i){super(),this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new la(this._context,i),this._mouseDownOperation=this._register(new Xwt(this._context,this.viewController,this.viewHelper,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(129).height;const s=new nEt(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMoveThrottled(this.viewHelper.viewDomNode,r=>this._onMouseMove(r),A3(this.mouseTargetFactory),nw.MOUSE_MOVE_MINIMUM_TIME)),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r)));const o=r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(67))return;const a=new uR(r);if(ki?(r.metaKey||r.ctrlKey)&&!r.shiftKey&&!r.altKey:r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey){const u=fb.getZoomLevel(),d=a.deltaY>0?1:-1;fb.setZoomLevel(u+d),a.preventDefault(),a.stopPropagation()}};this._register(Pt(this.viewHelper.viewDomNode,An.MOUSE_WHEEL,o,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(129)){const t=this._context.configuration.options.get(129).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const s=new b1e(e,t).toPageCoordinates(),o=T1e(this.viewHelper.viewDomNode);return s.y<o.y||s.y>o.y+o.height||s.x<o.x||s.x>o.x+o.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=Pw(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e){const t=this._createMouseTarget(e,!0),i=t.type===6||t.type===7,s=t.type===2||t.type===3||t.type===4,o=t.type===3,r=this._context.configuration.options.get(97),a=t.type===8||t.type===5,c=t.type===9;let u=e.leftButton||e.middleButton;ki&&e.leftButton&&e.ctrlKey&&(u=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(i||o&&r))d(),this._mouseDownOperation.start(t.type,e);else if(s)e.preventDefault();else if(a){const f=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(f.viewZoneId)&&(d(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}nw.MOUSE_MOVE_MINIMUM_TIME=100;class Xwt extends wt{constructor(e,t,i,s,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=s,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new sEt(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new mc),this._mouseState=new S6,this._currentSelection=new fn(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const s=this._context.configuration.options;if(!s.get(80)&&s.get(31)&&!s.get(18)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&i.type===6&&i.position&&this._currentSelection.containsPosition(i.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,A3(null),o=>this._onMouseDownThenMove(o),o=>{const r=this._findMousePosition(this._lastMouseEvent,!0);o&&o instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:r?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,A3(null),o=>this._onMouseDownThenMove(o),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet(()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))},10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.model,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const a=Math.max(s.getCurrentScrollTop()-(t.y-e.posy),0),c=yR.getZoneAtCoord(this._context,a);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return new Ig(null,13,o,d)}const u=s.getLineNumberAtVerticalOffset(a);return new Ig(null,13,o,new ct(u,1))}if(e.posy>t.y+t.height){const a=s.getCurrentScrollTop()+(e.posy-t.y),c=yR.getZoneAtCoord(this._context,a);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return new Ig(null,13,o,d)}const u=s.getLineNumberAtVerticalOffset(a);return new Ig(null,13,o,new ct(u,i.getLineMaxColumn(u)))}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+(e.posy-t.y));return e.posx<t.x?new Ig(null,13,o,new ct(r,1)):e.posx>t.x+t.width?new Ig(null,13,o,new ct(r,i.getLineMaxColumn(r))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return new Ig(s.element,s.type,s.mouseColumn,r,null,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new ct(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})}}class S6{constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>S6.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}S6.CLEAR_MOUSE_DOWN_COUNT_TIME=400;var Cf;(function(n){n.text="text/plain",n.binary="application/octet-stream",n.unknown="application/unknown",n.markdown="text/markdown",n.latex="text/latex"})(Cf||(Cf={}));let Hx=[],Pie=[],Fie=[];function nV(n,e=!1){const t=Ywt(n);Hx.push(t),t.userConfigured?Fie.push(t):Pie.push(t),e&&!t.userConfigured&&Hx.forEach(i=>{i.mime===t.mime||i.userConfigured||(t.extension&&i.extension===t.extension&&console.warn(`Overwriting extension <<${t.extension}>> to now point to mime <<${t.mime}>>`),t.filename&&i.filename===t.filename&&console.warn(`Overwriting filename <<${t.filename}>> to now point to mime <<${t.mime}>>`),t.filepattern&&i.filepattern===t.filepattern&&console.warn(`Overwriting filepattern <<${t.filepattern}>> to now point to mime <<${t.mime}>>`),t.firstline&&i.firstline===t.firstline&&console.warn(`Overwriting firstline <<${t.firstline}>> to now point to mime <<${t.mime}>>`))})}function Ywt(n){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:n.userConfigured,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?pLe(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Kr.sep)>=0:!1}}function qwt(n){Hx=[],Pie=[],Fie=[]}function Jwt(n,e){let t;if(n)switch(n.scheme){case Ii.file:t=n.fsPath;break;case Ii.data:t=ry.parseMetaData(n).get(ry.META_DATA_LABEL);break;default:t=n.path}if(!t)return[Cf.unknown];t=t.toLowerCase();const i=d0(t),s=Jfe(t,i,Fie);if(s)return[s,Cf.text];const o=Jfe(t,i,Pie);if(o)return[o,Cf.text];if(e){const r=Qwt(e);if(r)return[r,Cf.text]}return[Cf.unknown]}function Jfe(n,e,t){var i;let s=null,o=null,r=null;for(let a=t.length-1;a>=0;a--){const c=t[a];if(e===c.filenameLowercase){s=c;break}if(c.filepattern&&(!o||c.filepattern.length>o.filepattern.length)){const u=c.filepatternOnPath?n:e;!((i=c.filepatternLowercase)===null||i===void 0)&&i.call(c,u)&&(o=c)}c.extension&&(!r||c.extension.length>r.extension.length)&&e.endsWith(c.extensionLowercase)&&(r=c)}return s?s.mime:o?o.mime:r?r.mime:null}function Qwt(n){if($ne(n)&&(n=n.substr(1)),n.length>0)for(let e=Hx.length-1;e>=0;e--){const t=Hx[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t.mime}return null}class rl{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=s,this.selectionEndPosition=o}toString(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"}static readFromTextArea(e){return new rl(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new rl(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const s=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,s,-1)}if(e>=this.selectionEnd){const s=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,s,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf("…")===-1)return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(`
- `,o+1))!==-1;)s++;return[e,i*t.length,s]}static selectedText(e){return new rl(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let s=e.value,o=e.selectionStart,r=e.selectionEnd,a=t.value,c=t.selectionStart,u=t.selectionEnd;const d=s.substring(r),f=a.substring(u),g=KW(d,f);a=a.substring(0,a.length-g),s=s.substring(0,s.length-g);const p=s.substring(0,o),_=a.substring(0,c),v=hR(p,_);if(a=a.substring(v),s=s.substring(v),c-=v,o-=v,u-=v,r-=v,i&&c===u&&s.length>0){let y=null;if(c===a.length?a.startsWith(s)&&(y=a.substring(s.length)):a.endsWith(s)&&(y=a.substring(0,a.length-s.length)),y!==null&&y.length>0&&(/\uFE0F/.test(y)||ibt(y)))return{text:y,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}}if(c===u){if(s===a&&o===0&&r===s.length&&c===a.length&&a.indexOf(`
- `)===-1&&obt(a))return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const y=p.length-v;return{text:a,replacePrevCharCnt:y,replaceNextCharCnt:0,positionDelta:0}}const C=r-o;return{text:a,replacePrevCharCnt:C,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(hR(e.value,t.value),e.selectionEnd),s=Math.min(KW(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const c=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-r.length}}}rl.EMPTY=new rl("",0,0,null,null);class z1{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new be(s,1,o+1,1)}static fromEditorSelection(e,t,i,s,o){const r=z1._getPageOfLine(i.startLineNumber,s),a=z1._getRangeForPage(r,s),c=z1._getPageOfLine(i.endLineNumber,s),u=z1._getRangeForPage(c,s),d=a.intersectRanges(new be(1,1,i.startLineNumber,i.startColumn));let f=t.getValueInRange(d,1);const g=t.getLineCount(),p=t.getLineMaxColumn(g),_=u.intersectRanges(new be(i.endLineNumber,i.endColumn,g,p));let v=t.getValueInRange(_,1),C;if(r===c||r+1===c)C=t.getValueInRange(i,1);else{const y=a.intersectRanges(i),w=u.intersectRanges(i);C=t.getValueInRange(y,1)+"…"+t.getValueInRange(w,1)}return o&&(f.length>500&&(f=f.substring(f.length-500,f.length)),v.length>500&&(v=v.substring(0,500)),C.length>2*500&&(C=C.substring(0,500)+"…"+C.substring(C.length-500,C.length))),new rl(f+C+v,f.length,f.length+C.length,new ct(i.startLineNumber,i.startColumn),new ct(i.endLineNumber,i.endColumn))}}var N3;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(N3||(N3={}));const rJ={forceCopyWithSyntaxHighlighting:!1};class Vx{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}Vx.INSTANCE=new Vx;class Zwt extends wt{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new rt),this.onFocus=this._onFocus.event,this._onBlur=this._register(new rt),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new rt),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new rt),this.onCut=this._onCut.event,this._onPaste=this._register(new rt),this.onPaste=this._onPaste.event,this._onType=this._register(new rt),this.onType=this._onType.event,this._onCompositionStart=this._register(new rt),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new rt),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new rt),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new rt),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new eIt(t)),this._asyncTriggerCut=this._register(new ho(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new ho(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=rl.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(Br(t.domNode,"keydown",a=>{(a.keyCode===109||this._isDoingComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),i=a,this._onKeyDown.fire(a)})),this._register(Br(t.domNode,"keyup",a=>{this._onKeyUp.fire(a)})),this._register(Pt(t.domNode,"compositionstart",a=>{if(!this._isDoingComposition){if(this._isDoingComposition=!0,ki&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===a.data&&(i&&i.equals(109)&&(i.code==="ArrowRight"||i.code==="ArrowLeft")||ac)){this._textAreaState=new rl(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new ct(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition),this._onCompositionStart.fire({revealDeltaColumns:-1});return}if(aD){this._onCompositionStart.fire({revealDeltaColumns:-this._textAreaState.selectionStart});return}this._setAndWriteTextAreaState("compositionstart",rl.EMPTY),this._onCompositionStart.fire({revealDeltaColumns:0})}}));const s=a=>{const c=this._textAreaState,u=rl.readFromTextArea(this._textArea);return[u,rl.deduceInput(c,u,a)]},o=()=>{const a=this._textAreaState,c=rl.readFromTextArea(this._textArea);return[c,rl.deduceAndroidCompositionInput(a,c)]},r=a=>{const c=this._textAreaState,u=rl.selectedText(a),d={text:u.value,replacePrevCharCnt:c.selectionEnd-c.selectionStart,replaceNextCharCnt:0,positionDelta:0};return[u,d]};this._register(Pt(t.domNode,"compositionupdate",a=>{if(aD){const[d,f]=o();this._textAreaState=d,this._onType.fire(f),this._onCompositionUpdate.fire(a);return}const[c,u]=r(a.data||"");this._textAreaState=c,this._onType.fire(u),this._onCompositionUpdate.fire(a)})),this._register(Pt(t.domNode,"compositionend",a=>{if(!this._isDoingComposition)return;if(this._isDoingComposition=!1,aD){const[d,f]=o();this._textAreaState=d,this._onType.fire(f),this._onCompositionEnd.fire();return}const[c,u]=r(a.data||"");this._textAreaState=c,this._onType.fire(u),(UW||ac)&&(this._textAreaState=rl.readFromTextArea(this._textArea)),this._onCompositionEnd.fire()})),this._register(Pt(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[a,c]=s(ki);c.replacePrevCharCnt===0&&c.text.length===1&&yl(c.text.charCodeAt(0))||(this._textAreaState=a,this._nextCommand===0?(c.text!==""||c.replacePrevCharCnt!==0)&&this._onType.fire(c):((c.text!==""||c.replacePrevCharCnt!==0)&&this._firePaste(c.text,null),this._nextCommand=0))})),this._register(Pt(t.domNode,"cut",a=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(a),this._asyncTriggerCut.schedule()})),this._register(Pt(t.domNode,"copy",a=>{this._ensureClipboardGetsEditorSelection(a)})),this._register(Pt(t.domNode,"paste",a=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),xN.canUseTextData(a)){const[c,u]=xN.getTextData(a);c!==""&&this._firePaste(c,u)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",rl.EMPTY),this._nextCommand=1})),this._register(Pt(t.domNode,"focus",()=>{const a=this._hasFocus;this._setHasFocus(!0),Mf&&!a&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(Pt(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(Pt(t.domNode,N3.Tap,()=>{aD&&this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return Pt(document,"selectionchange",t=>{if(!this._hasFocus||this._isDoingComposition||!UW)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),c=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===c)return;const u=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(u[0],u[1],u[2]),f=this._textAreaState.deduceEditorPosition(c),g=this._host.deduceModelPosition(f[0],f[1],f[2]),p=new fn(d.lineNumber,d.column,g.lineNumber,g.column);this._onSelectionChangeRequest.fire(p)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){const e=Pw(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):wne(this.textArea.domNode)?this._setHasFocus(document.activeElement===this.textArea.domNode):this._setHasFocus(!1)}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(xN.canUseTextData(e)),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};if(Vx.INSTANCE.set(ac?t.text.replace(/\r\n/g,`
- `):t.text,i),!xN.canUseTextData(e)){this._setAndWriteTextAreaState("copy or cut",rl.selectedText(t.text));return}xN.setTextData(e,t.text,t.html,i)}_firePaste(e,t){t||(t=Vx.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class xN{static canUseTextData(e){return!!e.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const t=e.clipboardData.getData(Cf.text);let i=null;const s=e.clipboardData.getData("vscode-editor-data");if(typeof s=="string")try{i=JSON.parse(s),i.version!==1&&(i=null)}catch{}return[t,i]}throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,s){if(e.clipboardData){e.clipboardData.setData(Cf.text,t),typeof i=="string"&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(s)),e.preventDefault();return}throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class eIt extends wt{constructor(e){super(),this._actual=e,this._ignoreSelectionChangeTime=0}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.domNode.value}setValue(e,t){const i=this._actual.domNode;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.domNode.selectionDirection==="backward"?this._actual.domNode.selectionEnd:this._actual.domNode.selectionStart}getSelectionEnd(){return this._actual.domNode.selectionDirection==="backward"?this._actual.domNode.selectionStart:this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const s=this._actual.domNode;let o=null;const r=Pw(s);r?o=r.activeElement:o=document.activeElement;const a=o===s,c=s.selectionStart,u=s.selectionEnd;if(a&&c===t&&u===i){ac&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),ac&&window.parent!==window&&s.focus();return}try{const d=Vvt(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),Uvt(s,d)}catch{}}}class tIt extends nw{constructor(e,t,i){super(e,t,i),this._register(Ds.addTarget(this.viewHelper.linesContentDomNode)),this._register(Pt(this.viewHelper.linesContentDomNode,so.Tap,o=>this.onTap(o))),this._register(Pt(this.viewHelper.linesContentDomNode,so.Change,o=>this.onChange(o))),this._register(Pt(this.viewHelper.linesContentDomNode,so.Contextmenu,o=>this._onContextMenu(new ew(o,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(Pt(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new iEt(this.viewHelper.viewDomNode);this._register(s.onPointerMoveThrottled(this.viewHelper.viewDomNode,o=>this._onMouseMove(o),A3(this.mouseTargetFactory),nw.MOUSE_MOVE_MINIMUM_TIME)),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,o=>this._onMouseDown(o)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ew(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1})}onChange(e){this._lastPointerType==="touch"&&this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e)}}class nIt extends nw{constructor(e,t,i){super(e,t,i),this._register(Ds.addTarget(this.viewHelper.linesContentDomNode)),this._register(Pt(this.viewHelper.linesContentDomNode,so.Tap,s=>this.onTap(s))),this._register(Pt(this.viewHelper.linesContentDomNode,so.Change,s=>this.onChange(s))),this._register(Pt(this.viewHelper.linesContentDomNode,so.Contextmenu,s=>this._onContextMenu(new ew(s,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ew(e,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(N3.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position)}}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class iIt extends wt{constructor(e,t,i){super(),Xm&&U8.pointerEvents?this.handler=this._register(new tIt(e,t,i)):window.TouchEvent?this.handler=this._register(new nIt(e,t,i)):this.handler=this._register(new nw(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class vM extends SF{}class ER extends vM{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ct(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(58);const t=e.get(59);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(83);const i=e.get(129);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ct(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?'<span class="relative-current-line-number">'+i+"</span>":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Qc?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o='<div class="'+ER.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">',r=this._context.model.getLineCount(),a=[];for(let c=i;c<=s;c++){const u=c-i;if(!this._renderFinalNewline&&c===r&&this._context.model.getLineLength(c)===0){a[u]="";continue}const d=this._getLineRenderLineNumber(c);d?c===this._activeLineNumber?a[u]='<div class="active-line-number '+ER.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">'+d+"</div>":a[u]=o+d+"</div>":a[u]=""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}ER.CLASS_NAME="line-numbers";ws((n,e)=>{const t=n.getColor(q1e);t&&e.addRule(`.monaco-editor .line-numbers { color: ${t}; }`);const i=n.getColor(iwt);i&&e.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${i}; }`)});class iw extends Rh{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=qi(document.createElement("div")),this._domNode.setClassName(iw.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=qi(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(iw.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}iw.CLASS_NAME="glyph-margin";iw.OUTER_CLASS_NAME="margin";const E0="monaco-mouse-cursor-text";class Bie{constructor(e,t,i){this._visibleTextAreaBrand=void 0,this.top=e,this.left=t,this.width=i}setWidth(e){return new Bie(this.top,this.left,e)}}const PN=ac;class sIt extends Rh{constructor(e,t,i){super(e),this._primaryCursorPosition=new ct(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,o=s.get(129);this._setAccessibilityOptions(s),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=s.get(43),this._lineHeight=s.get(58),this._emptySelectionClipboard=s.get(32),this._copyWithSyntaxHighlighting=s.get(21),this._visibleTextArea=null,this._selections=[new fn(1,1,1,1)],this._modelSelections=[new fn(1,1,1,1)],this._lastRenderPosition=null,this.textArea=qi(document.createElement("textarea")),Zm.write(this.textArea,6),this.textArea.setClassName(`inputarea ${E0}`),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(s)),this.textArea.setAttribute("tabindex",String(s.get(111))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",$("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),s.get(30)&&s.get(80)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=qi(document.createElement("div")),this.textAreaCover.setPosition("absolute");const r={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:c=>this._context.model.getLineMaxColumn(c),getValueInRange:(c,u)=>this._context.model.getValueInRange(c,u)},a={getDataToCopy:c=>{const u=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,zl),d=this._context.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(u)?u:null,p=Array.isArray(u)?u.join(d):u;let _,v=null;if(c&&(rJ.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&p.length<65536)){const C=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);C&&(_=C.html,v=C.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:_,mode:v}},getScreenReaderContent:c=>{if(this._accessibilitySupport===1){if(ki){const u=this._selections[0];if(u.isEmpty()){const d=u.getStartPosition();let f=this._getWordBeforePosition(d);if(f.length===0&&(f=this._getCharacterBeforePosition(d)),f.length>0)return new rl(f,f.length,f.length,d,d)}}return rl.EMPTY}if(aD){const u=this._selections[0];if(u.isEmpty()){const d=u.getStartPosition(),[f,g]=this._getAndroidWordAtPosition(d);if(f.length>0)return new rl(f,g,g,d,d)}return rl.EMPTY}return z1.fromEditorSelection(c,r,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(c,u,d)=>this._context.model.deduceModelPositionRelativeToViewPosition(c,u,d)};this._textAreaInput=this._register(new Zwt(a,this.textArea)),this._register(this._textAreaInput.onKeyDown(c=>{this._viewController.emitKeyDown(c)})),this._register(this._textAreaInput.onKeyUp(c=>{this._viewController.emitKeyUp(c)})),this._register(this._textAreaInput.onPaste(c=>{let u=!1,d=null,f=null;c.metadata&&(u=this._emptySelectionClipboard&&!!c.metadata.isFromEmptySelection,d=typeof c.metadata.multicursorText<"u"?c.metadata.multicursorText:null,f=c.metadata.mode),this._viewController.paste(c.text,u,d,f)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(c=>{c.replacePrevCharCnt||c.replaceNextCharCnt||c.positionDelta?this._viewController.compositionType(c.text,c.replacePrevCharCnt,c.replaceNextCharCnt,c.positionDelta):this._viewController.type(c.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(c=>{this._viewController.setSelection(c)})),this._register(this._textAreaInput.onCompositionStart(c=>{const u=this._selections[0].startLineNumber,d=this._selections[0].startColumn+c.revealDeltaColumns;this._context.model.revealRange("keyboard",!0,new be(u,d,u,d),0,1);const f=this._viewHelper.visibleRangeForPositionRelativeToEditor(u,d);f&&(this._visibleTextArea=new Bie(this._context.viewLayout.getVerticalOffsetForLineNumber(u),f.left,PN?0:1),this._render()),this.textArea.setClassName(`inputarea ${E0} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(c=>{this._visibleTextArea&&(this._visibleTextArea=this._visibleTextArea.setWidth(oIt(c.data,this._fontInfo)),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${E0}`),this._viewController.compositionEnd(),this._context.model.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.model.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.model.setHasFocus(!1)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.model.getLineContent(e.lineNumber),s=Ih(t);let o=!0,r=e.column,a=!0,c=e.column,u=0;for(;u<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==0?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);s.get(d)!==0?a=!1:c++}u++}return[i.substring(r-1,c-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=Ih(this._context.configuration.options.get(115));let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==0||o>50)return t.substring(s-1,e.column-1);o++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2);if(!yl(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){return e.get(2)===1?$("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",Qc?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===pp.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(43),this._lineHeight=t.get(58),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(111))),(e.hasChanged(30)||e.hasChanged(80))&&(t.get(30)&&t.get(80)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new ct(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea){this._renderInsideEditor(null,this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight);return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(ki){this._renderInsideEditor(this._primaryCursorPosition,t,e,PN?0:1,this._lineHeight);return}this._renderInsideEditor(this._primaryCursorPosition,t,e,PN?0:1,PN?0:1)}_renderInsideEditor(e,t,i,s,o){this._lastRenderPosition=e;const r=this.textArea,a=this.textAreaCover;Ea.applyFontInfo(r,this._fontInfo),r.setTop(t),r.setLeft(i),r.setWidth(s),r.setHeight(o),a.setTop(0),a.setLeft(0),a.setWidth(0),a.setHeight(0)}_renderAtTopLeft(){this._lastRenderPosition=null;const e=this.textArea,t=this.textAreaCover;if(Ea.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),PN){e.setWidth(0),e.setHeight(0),t.setWidth(0),t.setHeight(0);return}e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1);const i=this._context.configuration.options;i.get(49)?t.setClassName("monaco-editor-background textAreaCover "+iw.OUTER_CLASS_NAME):i.get(59).renderType!==0?t.setClassName("monaco-editor-background textAreaCover "+ER.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function oIt(n,e){const i=document.createElement("canvas").getContext("2d");i.font=rIt(e);const s=i.measureText(n);return ac?s.width+2:s.width}function rIt(n){return lIt("normal",n.fontWeight,n.fontSize,n.lineHeight,n.fontFamily)}function lIt(n,e,t,i,s){return`${n} normal ${e} ${t}px / ${i}px ${s}`}class AS{static columnSelect(e,t,i,s,o,r){let a=Math.abs(o-i)+1,c=i>o,u=s>r,d=s<r,f=[];for(let g=0;g<a;g++){let p=i+(c?-g:g),_=Vs.columnFromVisibleColumn2(e,t,p,s),v=Vs.columnFromVisibleColumn2(e,t,p,r),C=Vs.visibleColumnFromColumn2(e,t,new ct(p,_)),y=Vs.visibleColumnFromColumn2(e,t,new ct(p,v));d&&(C>r||y<s)||u&&(y>s||C<r)||f.push(new Tl(new be(p,_,p,_),0,new ct(p,v),0))}if(f.length===0)for(let g=0;g<a;g++){const p=i+(c?-g:g),_=t.getLineMaxColumn(p);f.push(new Tl(new be(p,_,p,_),0,new ct(p,_),0))}return{viewStates:f,reversed:c,fromLineNumber:i,fromVisualColumn:s,toLineNumber:o,toVisualColumn:r}}static columnSelectLeft(e,t,i){let s=i.toViewVisualColumn;return s>0&&s--,AS.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=o;c<=r;c++){const u=t.getLineMaxColumn(c),d=Vs.visibleColumnFromColumn2(e,t,new ct(c,u));s=Math.max(s,d)}let a=i.toViewVisualColumn;return a<s&&a++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,a)}static columnSelectUp(e,t,i,s){const o=s?e.pageSize:1,r=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}static columnSelectDown(e,t,i,s){const o=s?e.pageSize:1,r=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}}class Dl{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let s=t.getInverseEditOperations()[0].range;return new fn(s.endLineNumber,s.endColumn,s.endLineNumber,s.endColumn)}}class aIt{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const s=t.getInverseEditOperations()[0].range;return new fn(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn)}}class iV{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let s=t.getInverseEditOperations()[0].range;return new fn(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn)}}class c4{constructor(e,t,i,s,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=s,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let s=t.getInverseEditOperations()[0].range;return new fn(s.endLineNumber+this._lineNumberDeltaOffset,s.endColumn+this._columnDeltaOffset,s.endLineNumber+this._lineNumberDeltaOffset,s.endColumn+this._columnDeltaOffset)}}class Hie{constructor(e,t,i,s=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=s,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class h7{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class ts{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-ebt(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new ct(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=Bx.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new ct(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?ts.leftPositionAtomicSoftTabs(t,i,e.tabSize):ts.leftPosition(t,i);return new h7(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),u=t.normalizePosition(ts.clipPositionColumn(c,t),0),d=ts.left(e,t,u);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new ct(e.lineNumber,ts.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i=i+jW(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new ct(t,i)}static rightPositionAtomicSoftTabs(e,t,i,s,o){if(i<e.getLineIndentColumn(t)){const r=e.getLineContent(t),a=Bx.atomicPosition(r,i-1,s,1);if(a!==-1)return new ct(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const s=e.stickyTabStops?ts.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):ts.rightPosition(t,i.lineNumber,i.column);return new h7(s.lineNumber,s.column,0)}static moveRight(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.endLineNumber,a=i.selection.endColumn;else{const c=i.position.delta(void 0,o-1),u=t.normalizePosition(ts.clipPositionColumn(c,t),1),d=ts.right(e,t,u);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static vertical(e,t,i,s,o,r,a){const c=Vs.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize)+o,u=t.getLineCount(),d=i===1&&s===1,f=i===u&&s===t.getLineMaxColumn(i),g=r<i?d:f;return i=r,i<1?(i=1,a?s=t.getLineMinColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):i>u?(i=u,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=Vs.columnFromVisibleColumn2(e,t,i,c),g?o=0:o=c-Vs.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),new h7(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=ts.down(e,t,r,a,i.leftoverVisibleColumns,o,!0);return i.move(s,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateDown(e,t,i){let s=i.selection,o=ts.down(e,t,s.selectionStartLineNumber,s.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=ts.down(e,t,s.positionLineNumber,s.positionColumn,i.leftoverVisibleColumns,1,!1);return new Tl(new be(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new ct(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i-r,a)}static moveUp(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.startLineNumber,a=i.selection.startColumn):(r=i.position.lineNumber,a=i.position.column);let c=ts.up(e,t,r,a,i.leftoverVisibleColumns,o,!0);return i.move(s,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateUp(e,t,i){let s=i.selection,o=ts.up(e,t,s.selectionStartLineNumber,s.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=ts.up(e,t,s.positionLineNumber,s.positionColumn,i.leftoverVisibleColumns,1,!1);return new Tl(new be(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new ct(r.lineNumber,r.column),r.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,i,s){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r<o&&this._isBlankLine(t,r);)r++;for(;r<o&&!this._isBlankLine(t,r);)r++;return i.move(s,r,t.getLineMinColumn(r),0)}static moveToBeginningOfLine(e,t,i,s){let o=i.position.lineNumber,r=t.getLineMinColumn(o),a=t.getLineFirstNonWhitespaceColumn(o)||r,c;return i.position.column===a?c=r:c=a,i.move(s,o,c,0)}static moveToEndOfLine(e,t,i,s,o){let r=i.position.lineNumber,a=t.getLineMaxColumn(r);return i.move(s,r,a,o?1073741824-a:0)}static moveToBeginningOfBuffer(e,t,i,s){return i.move(s,1,1,0)}static moveToEndOfBuffer(e,t,i,s){let o=t.getLineCount(),r=t.getLineMaxColumn(o);return i.move(s,o,r,0)}}class sw{static deleteRight(e,t,i,s){let o=[],r=e!==3;for(let a=0,c=s.length;a<c;a++){const u=s[a];let d=u;if(d.isEmpty()){let f=u.getPosition(),g=ts.right(t,i,f);d=new be(g.lineNumber,g.column,f.lineNumber,f.column)}if(d.isEmpty()){o[a]=null;continue}d.startLineNumber!==d.endLineNumber&&(r=!0),o[a]=new Dl(d,"")}return[r,o]}static isAutoClosingPairDelete(e,t,i,s,o,r,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let c=0,u=r.length;c<u;c++){const d=r[c],f=d.getPosition();if(!d.isEmpty())return!1;const g=o.getLineContent(f.lineNumber);if(f.column<2||f.column>=g.length+1)return!1;const p=g.charAt(f.column-2),_=s.get(p);if(!_)return!1;if(M1(p)){if(i==="never")return!1}else if(t==="never")return!1;const v=g.charAt(f.column-1);let C=!1;for(const y of _)y.open===p&&y.close===v&&(C=!0);if(!C)return!1;if(e==="auto"){let y=!1;for(let w=0,I=a.length;w<I;w++){const L=a[w];if(f.lineNumber===L.startLineNumber&&f.column===L.startColumn){y=!0;break}}if(!y)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){let s=[];for(let o=0,r=i.length;o<r;o++){const a=i[o].getPosition(),c=new be(a.lineNumber,a.column-1,a.lineNumber,a.column+1);s[o]=new Dl(c,"")}return[!0,s]}static deleteLeft(e,t,i,s,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,s,o))return this._runAutoClosingPairDelete(t,i,s);const r=[];let a=e!==2;for(let c=0,u=s.length;c<u;c++){let d=sw.getDeleteRange(s[c],i,t);if(d.isEmpty()){r[c]=null;continue}d.startLineNumber!==d.endLineNumber&&(a=!0),r[c]=new Dl(d,"")}return[a,r]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const s=e.getPosition();if(i.useTabStops&&s.column>1){const o=t.getLineContent(s.lineNumber),r=cc(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const c=Vs.visibleColumnFromColumn2(i,t,s),u=Vs.prevIndentTabStop(c,i.indentSize),d=Vs.columnFromVisibleColumn2(i,t,s.lineNumber,u);return new be(s.lineNumber,d,s.lineNumber,s.column)}}return be.fromPositions(sw.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=cbt(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new ct(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){let s=[],o=null;i.sort((r,a)=>ct.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r<a;r++){const c=i[r];if(c.isEmpty())if(e.emptySelectionClipboard){let u=c.getPosition(),d,f,g,p;u.lineNumber<t.getLineCount()?(d=u.lineNumber,f=1,g=u.lineNumber+1,p=1):u.lineNumber>1&&(o==null?void 0:o.endLineNumber)!==u.lineNumber?(d=u.lineNumber-1,f=t.getLineMaxColumn(u.lineNumber-1),g=u.lineNumber,p=t.getLineMaxColumn(u.lineNumber)):(d=u.lineNumber,f=1,g=u.lineNumber,p=t.getLineMaxColumn(u.lineNumber));let _=new be(d,f,g,p);o=_,_.isEmpty()?s[r]=null:s[r]=new Dl(_,"")}else s[r]=null;else s[r]=new Dl(c,"")}return new _u(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Yi{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){let s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;for(let o=i.column-2;o>=0;o--){let r=e.charCodeAt(o),a=t.get(r);if(a===0){if(s===2)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=1}else if(a===2){if(s===1)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=2}else if(a===1&&s!==0)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){let o=e.length;for(let r=s;r<o;r++){let a=e.charCodeAt(r),c=t.get(a);if(c===1||i===1&&c===2||i===2&&c===0)return r}return o}static _findNextWordOnLine(e,t,i){let s=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(s,e,i)}static _doFindNextWordOnLine(e,t,i){let s=0,o=e.length;for(let r=i.column-1;r<o;r++){let a=e.charCodeAt(r),c=t.get(a);if(c===0){if(s===2)return this._createWord(e,s,c,this._findStartOfWord(e,t,s,r-1),r);s=1}else if(c===2){if(s===1)return this._createWord(e,s,c,this._findStartOfWord(e,t,s,r-1),r);s=2}else if(c===1&&s!==0)return this._createWord(e,s,c,this._findStartOfWord(e,t,s,r-1),r)}return s!==0?this._createWord(e,s,1,this._findStartOfWord(e,t,s,o-1),o):null}static _findStartOfWord(e,t,i,s){for(let o=s;o>=0;o--){let r=e.charCodeAt(o),a=t.get(r);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=Yi._findPreviousWordOnLine(e,t,new ct(o,r));if(s===0)return new ct(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Yi._findPreviousWordOnLine(e,t,new ct(o,a.start+1))),new ct(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=Yi._findPreviousWordOnLine(e,t,new ct(o,a.start+1));return new ct(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Yi._findPreviousWordOnLine(e,t,new ct(o,a.start+1))),new ct(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new ct(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),c=o.charCodeAt(r-1);if(a===95&&c!==95)return new ct(i,r);if(vC(a)&&hm(c))return new ct(i,r);if(hm(a)&&hm(c)&&r+1<s){const u=o.charCodeAt(r);if(vC(u))return new ct(i,r)}}return new ct(i,1)}static moveWordRight(e,t,i,s){let o=i.lineNumber,r=i.column,a=!1;r===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(a=!0,o=o+1,r=1);let c=Yi._findNextWordOnLine(e,t,new ct(o,r));if(s===2)c&&c.wordType===2&&c.end-c.start===1&&c.nextCharClass===0&&(c=Yi._findNextWordOnLine(e,t,new ct(o,c.end+1))),c?r=c.end+1:r=t.getLineMaxColumn(o);else if(s===3){for(a&&(r=0);c&&(c.wordType===2||c.start+1<=r);)c=Yi._findNextWordOnLine(e,t,new ct(o,c.end+1));c?r=c.start+1:r=t.getLineMaxColumn(o)}else c&&!a&&r>=c.start+1&&(c=Yi._findNextWordOnLine(e,t,new ct(o,c.end+1))),c?r=c.start+1:r=t.getLineMaxColumn(o);return new ct(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i<e.getLineCount()?new ct(i+1,1):t;const o=e.getLineContent(i);for(let r=t.column+1;r<s;r++){const a=o.charCodeAt(r-2),c=o.charCodeAt(r-1);if(a!==95&&c===95)return new ct(i,r);if(vC(a)&&hm(c))return new ct(i,r);if(hm(a)&&hm(c)&&r+1<s){const u=o.charCodeAt(r);if(vC(u))return new ct(i,r)}}return new ct(i,s)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=t.column-2,o=Fm(i,s);return o+1<s?new be(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,s=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(sw.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const f=e.selection.getPosition();return new be(f.lineNumber,f.column-1,f.lineNumber,f.column+1)}const a=new ct(o.positionLineNumber,o.positionColumn);let c=a.lineNumber,u=a.column;if(c===1&&u===1)return null;if(r){let f=this._deleteWordLeftWhitespace(s,a);if(f)return f}let d=Yi._findPreviousWordOnLine(i,s,a);return t===0?d?u=d.start+1:u>1?u=1:(c--,u=s.getLineMaxColumn(c)):(d&&u<=d.end+1&&(d=Yi._findPreviousWordOnLine(i,s,new ct(c,d.start+1))),d?u=d.end+1:u>1?u=1:(c--,u=s.getLineMaxColumn(c))),new be(c,u,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new ct(i.positionLineNumber,i.positionColumn);let o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+1<s&&this._charAtIsWhitespace(i,r+1);)r++;return new be(t.lineNumber,o+1,t.lineNumber,r+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const s=t.getLineContent(i.lineNumber),o=s.length;if(o===0)return i.lineNumber>1?new be(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new be(i.lineNumber,1,i.lineNumber+1,1):new be(i.lineNumber,1,i.lineNumber,1);const r=f=>f.start+1<=i.column&&i.column<=f.end+1,a=(f,g)=>(f=Math.min(f,i.column),g=Math.max(g,i.column),new be(i.lineNumber,f,i.lineNumber,g)),c=f=>{let g=f.start+1,p=f.end+1,_=!1;for(;p-1<o&&this._charAtIsWhitespace(s,p-1);)_=!0,p++;if(!_)for(;g>1&&this._charAtIsWhitespace(s,g-2);)g--;return a(g,p)},u=Yi._findPreviousWordOnLine(e,t,i);if(u&&r(u))return c(u);const d=Yi._findNextWordOnLine(e,t,i);return d&&r(d)?c(d):u&&d?a(u.end+1,d.start+1):u?a(u.start+1,u.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=Yi._moveWordPartLeft(e,i);return new be(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let s=t;s<i;s++){let o=e.charAt(s);if(o!==" "&&o!==" ")return s}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=t.column-1,o=this._findFirstNonWhitespaceChar(i,s);return s+1<o?new be(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,s=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;const a=new ct(o.positionLineNumber,o.positionColumn);let c=a.lineNumber,u=a.column;const d=s.getLineCount(),f=s.getLineMaxColumn(c);if(c===d&&u===f)return null;if(r){let p=this._deleteWordRightWhitespace(s,a);if(p)return p}let g=Yi._findNextWordOnLine(i,s,a);return t===2?g?u=g.end+1:u<f||c===d?u=f:(c++,g=Yi._findNextWordOnLine(i,s,new ct(c,1)),g?u=g.start+1:u=s.getLineMaxColumn(c)):(g&&u>=g.start+1&&(g=Yi._findNextWordOnLine(i,s,new ct(c,g.end+1))),g?u=g.start+1:u<f||c===d?u=f:(c++,g=Yi._findNextWordOnLine(i,s,new ct(c,1)),g?u=g.start+1:u=s.getLineMaxColumn(c))),new be(c,u,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=Yi._moveWordPartRight(e,i);return new be(i.lineNumber,i.column,s.lineNumber,s.column)}static _createWordAtPosition(e,t,i){const s=new be(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(s),startColumn:s.startColumn,endColumn:s.endColumn}}static getWordAtPosition(e,t,i){const s=Ih(t),o=Yi._findPreviousWordOnLine(s,e,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return Yi._createWordAtPosition(e,i.lineNumber,o);const r=Yi._findNextWordOnLine(s,e,i);return r&&r.wordType===1&&r.start<=i.column-1&&i.column-1<=r.end?Yi._createWordAtPosition(e,i.lineNumber,r):null}static word(e,t,i,s,o){const r=Ih(e.wordSeparators);let a=Yi._findPreviousWordOnLine(r,t,o),c=Yi._findNextWordOnLine(r,t,o);if(!s){let p,_;return a&&a.wordType===1&&a.start<=o.column-1&&o.column-1<=a.end?(p=a.start+1,_=a.end+1):c&&c.wordType===1&&c.start<=o.column-1&&o.column-1<=c.end?(p=c.start+1,_=c.end+1):(a?p=a.end+1:p=1,c?_=c.start+1:_=t.getLineMaxColumn(o.lineNumber)),new Tl(new be(o.lineNumber,p,o.lineNumber,_),0,new ct(o.lineNumber,_),0)}let u,d;a&&a.wordType===1&&a.start<o.column-1&&o.column-1<a.end?(u=a.start+1,d=a.end+1):c&&c.wordType===1&&c.start<o.column-1&&o.column-1<c.end?(u=c.start+1,d=c.end+1):(u=o.column,d=o.column);let f=o.lineNumber,g;if(i.selectionStart.containsPosition(o))g=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){g=u;let p=new ct(f,g);i.selectionStart.containsPosition(p)&&(g=i.selectionStart.endColumn)}else{g=d;let p=new ct(f,g);i.selectionStart.containsPosition(p)&&(g=i.selectionStart.startColumn)}return i.move(!0,f,g,0)}}class w6 extends Yi{static deleteWordPartLeft(e){const t=sV([Yi.deleteWordLeft(e,0),Yi.deleteWordLeft(e,2),Yi._deleteWordPartLeft(e.model,e.selection)]);return t.sort(be.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=sV([Yi.deleteWordRight(e,0),Yi.deleteWordRight(e,2),Yi._deleteWordPartRight(e.model,e.selection)]);return t.sort(be.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const s=sV([Yi.moveWordLeft(e,t,i,0),Yi.moveWordLeft(e,t,i,2),Yi._moveWordPartLeft(t,i)]);return s.sort(ct.compare),s[2]}static moveWordPartRight(e,t,i){const s=sV([Yi.moveWordRight(e,t,i,0),Yi.moveWordRight(e,t,i,2),Yi._moveWordPartRight(t,i)]);return s.sort(ct.compare),s[0]}}function sV(n){return n.filter(e=>!!e)}class vl{static addCursorDown(e,t,i){let s=[],o=0;for(let r=0,a=t.length;r<a;r++){const c=t[r];s[o++]=new Ri(c.modelState,c.viewState),i?s[o++]=Ri.fromModelState(ts.translateDown(e.cursorConfig,e.model,c.modelState)):s[o++]=Ri.fromViewState(ts.translateDown(e.cursorConfig,e,c.viewState))}return s}static addCursorUp(e,t,i){let s=[],o=0;for(let r=0,a=t.length;r<a;r++){const c=t[r];s[o++]=new Ri(c.modelState,c.viewState),i?s[o++]=Ri.fromModelState(ts.translateUp(e.cursorConfig,e.model,c.modelState)):s[o++]=Ri.fromViewState(ts.translateUp(e.cursorConfig,e,c.viewState))}return s}static moveToBeginningOfLine(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o];s[o]=this._moveToLineStart(e,a,i)}return s}static _moveToLineStart(e,t,i){const s=t.viewState.position.column,o=t.modelState.position.column,r=s===o,a=t.viewState.position.lineNumber,c=e.getLineFirstNonWhitespaceColumn(a);return!r&&!(s===c)?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return Ri.fromViewState(ts.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return Ri.fromModelState(ts.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,s){let o=[];for(let r=0,a=t.length;r<a;r++){const c=t[r];o[r]=this._moveToLineEnd(e,c,i,s)}return o}static _moveToLineEnd(e,t,i,s){const o=t.viewState.position,r=e.getLineMaxColumn(o.lineNumber),a=o.column===r,c=t.modelState.position,u=e.model.getLineMaxColumn(c.lineNumber),d=r-o.column===u-c.column;return a||d?this._moveToLineEndByModel(e,t,i,s):this._moveToLineEndByView(e,t,i,s)}static _moveToLineEndByView(e,t,i,s){return Ri.fromViewState(ts.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,s))}static _moveToLineEndByModel(e,t,i,s){return Ri.fromModelState(ts.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,s))}static expandLineSelection(e,t){let i=[];for(let s=0,o=t.length;s<o;s++){const r=t[s],a=r.modelState.selection.startLineNumber,c=e.model.getLineCount();let u=r.modelState.selection.endLineNumber,d;u===c?d=e.model.getLineMaxColumn(c):(u++,d=1),i[s]=Ri.fromModelState(new Tl(new be(a,1,a,1),0,new ct(u,d),0))}return i}static moveToBeginningOfBuffer(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o];s[o]=Ri.fromModelState(ts.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return s}static moveToEndOfBuffer(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o];s[o]=Ri.fromModelState(ts.moveToEndOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return s}static selectAll(e,t){const i=e.model.getLineCount(),s=e.model.getLineMaxColumn(i);return Ri.fromModelState(new Tl(new be(1,1,1,1),0,new ct(i,s),0))}static line(e,t,i,s,o){const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new ct(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!i||!t.modelState.hasSelection()){const u=e.model.getLineCount();let d=r.lineNumber+1,f=1;return d>u&&(d=u,f=e.model.getLineMaxColumn(d)),Ri.fromModelState(new Tl(new be(r.lineNumber,1,d,f),0,new ct(d,f),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<c)return Ri.fromViewState(t.viewState.move(t.modelState.hasSelection(),a.lineNumber,1,0));if(r.lineNumber>c){const u=e.getLineCount();let d=a.lineNumber+1,f=1;return d>u&&(d=u,f=e.getLineMaxColumn(d)),Ri.fromViewState(t.viewState.move(t.modelState.hasSelection(),d,f,0))}else{const u=t.modelState.selectionStart.getEndPosition();return Ri.fromModelState(t.modelState.move(t.modelState.hasSelection(),u.lineNumber,u.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return Ri.fromModelState(Yi.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Ri(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return Ri.fromViewState(new Tl(new be(i,s,i,s),0,new ct(i,s),0))}static moveTo(e,t,i,s,o){const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new ct(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Ri.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case 1:return r===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case 2:return r===2?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case 3:return r===2?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case 4:return r===2?t.map(a=>Ri.fromViewState(ts.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>Ri.fromModelState(ts.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>Ri.fromViewState(ts.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>Ri.fromModelState(ts.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const c=this._firstLineNumberInRange(e.model,a,o),u=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,u)]}case 13:{const c=this._lastLineNumberInRange(e.model,a,o),u=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,u)]}case 12:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],s,c,u)]}case 14:{let c=[];for(let u=0,d=t.length;u<d;u++){const f=t[u];c[u]=this.findPositionInViewportIfOutside(e,f,r,s)}return c}default:return null}}static findPositionInViewportIfOutside(e,t,i,s){let o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new Ri(t.modelState,t.viewState);{let r;o>i.endLineNumber-1?r=i.endLineNumber-1:o<i.startLineNumber?r=i.startLineNumber:r=o;const a=ts.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,r,!1);return Ri.fromViewState(t.viewState.move(s,a.lineNumber,a.column,a.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let s=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(s)&&s++,Math.min(t.endLineNumber,s+i-1)}static _lastLineNumberInRange(e,t,i){let s=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(s)&&s++,Math.max(s,t.endLineNumber-i+1)}static _moveLeft(e,t,i,s){return t.map(o=>Ri.fromViewState(ts.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=Math.round(e.getLineContent(c).length/2);s[o]=Ri.fromViewState(ts.moveLeft(e.cursorConfig,e,a.viewState,i,u))}return s}static _moveRight(e,t,i,s){return t.map(o=>Ri.fromViewState(ts.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=Math.round(e.getLineContent(c).length/2);s[o]=Ri.fromViewState(ts.moveRight(e.cursorConfig,e,a.viewState,i,u))}return s}static _moveDownByViewLines(e,t,i,s){let o=[];for(let r=0,a=t.length;r<a;r++){const c=t[r];o[r]=Ri.fromViewState(ts.moveDown(e.cursorConfig,e,c.viewState,i,s))}return o}static _moveDownByModelLines(e,t,i,s){let o=[];for(let r=0,a=t.length;r<a;r++){const c=t[r];o[r]=Ri.fromModelState(ts.moveDown(e.cursorConfig,e.model,c.modelState,i,s))}return o}static _moveUpByViewLines(e,t,i,s){let o=[];for(let r=0,a=t.length;r<a;r++){const c=t[r];o[r]=Ri.fromViewState(ts.moveUp(e.cursorConfig,e,c.viewState,i,s))}return o}static _moveUpByModelLines(e,t,i,s){let o=[];for(let r=0,a=t.length;r<a;r++){const c=t[r];o[r]=Ri.fromModelState(ts.moveUp(e.cursorConfig,e.model,c.modelState,i,s))}return o}static _moveToViewPosition(e,t,i,s,o){return Ri.fromViewState(t.viewState.move(i,s,o,0))}static _moveToModelPosition(e,t,i,s,o){return Ri.fromModelState(t.modelState.move(i,s,o,0))}static _moveToViewMinColumn(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=e.getLineMinColumn(c);s[o]=this._moveToViewPosition(e,a,i,c,u)}return s}static _moveToViewFirstNonWhitespaceColumn(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=e.getLineFirstNonWhitespaceColumn(c);s[o]=this._moveToViewPosition(e,a,i,c,u)}return s}static _moveToViewCenterColumn(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=Math.round((e.getLineMaxColumn(c)+e.getLineMinColumn(c))/2);s[o]=this._moveToViewPosition(e,a,i,c,u)}return s}static _moveToViewMaxColumn(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=e.getLineMaxColumn(c);s[o]=this._moveToViewPosition(e,a,i,c,u)}return s}static _moveToViewLastNonWhitespaceColumn(e,t,i){let s=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.viewState.position.lineNumber,u=e.getLineLastNonWhitespaceColumn(c);s[o]=this._moveToViewPosition(e,a,i,c,u)}return s}}var D3;(function(n){const e=function(i){if(!jc(i))return!1;let s=i;return!(!Yf(s.to)||!oc(s.select)&&!hLe(s.select)||!oc(s.by)&&!Yf(s.by)||!oc(s.value)&&!X0(s.value))};n.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:`Property-value pairs that can be passed through this argument:
- * 'to': A mandatory logical position value providing where to move the cursor.
- \`\`\`
- 'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
- 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
- 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
- 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
- \`\`\`
- * 'by': Unit to move. Default is computed based on 'to' value.
- \`\`\`
- 'line', 'wrappedLine', 'character', 'halfLine'
- \`\`\`
- * 'value': Number of units to move. Default is '1'.
- * 'select': If 'true' makes the selection. Default is 'false'.
- `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},n.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let s;switch(i.to){case n.RawDirection.Left:s=0;break;case n.RawDirection.Right:s=1;break;case n.RawDirection.Up:s=2;break;case n.RawDirection.Down:s=3;break;case n.RawDirection.PrevBlankLine:s=4;break;case n.RawDirection.NextBlankLine:s=5;break;case n.RawDirection.WrappedLineStart:s=6;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:s=7;break;case n.RawDirection.WrappedLineColumnCenter:s=8;break;case n.RawDirection.WrappedLineEnd:s=9;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:s=10;break;case n.RawDirection.ViewPortTop:s=11;break;case n.RawDirection.ViewPortBottom:s=13;break;case n.RawDirection.ViewPortCenter:s=12;break;case n.RawDirection.ViewPortIfOutside:s=14;break;default:return null}let o=0;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Character:o=3;break;case n.RawUnit.HalfLine:o=4;break}return{direction:s,unit:o,select:!!i.select,value:i.value||1}}n.parse=t})(D3||(D3={}));const f7=Object.create(null);function cS(n,e){if(e<=0)return"";f7[n]||(f7[n]=["",n]);const t=f7[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}class _d{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,s,o){const r=Vs.visibleColumnFromColumn(e,t,i);if(o){const a=cS(" ",s),u=Vs.prevIndentTabStop(r,s)/s;return cS(a,u)}else{const a=" ",u=Vs.prevRenderTabStop(r,i)/i;return cS(a,u)}}static shiftIndent(e,t,i,s,o){const r=Vs.visibleColumnFromColumn(e,t,i);if(o){const a=cS(" ",s),u=Vs.nextIndentTabStop(r,s)/s;return cS(a,u)}else{const a=" ",u=Vs.nextRenderTabStop(r,i)/i;return cS(a,u)}}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let u=0,d=0;for(let f=i;f<=s;f++,u=d){d=0;let g=e.getLineContent(f),p=cc(g);if(this._opts.isUnshift&&(g.length===0||p===0)||!c&&!this._opts.isUnshift&&g.length===0)continue;if(p===-1&&(p=g.length),f>1&&Vs.visibleColumnFromColumn(g,p+1,o)%r!==0&&e.isCheapToTokenize(f-1)){let C=ns.getEnterAction(this._opts.autoIndent,e,new be(f-1,e.getLineMaxColumn(f-1),f-1,e.getLineMaxColumn(f-1)));if(C){if(d=u,C.appendText)for(let y=0,w=C.appendText.length;y<w&&d<r&&C.appendText.charCodeAt(y)===32;y++)d++;C.removeText&&(d=Math.max(0,d-C.removeText));for(let y=0;y<d&&!(p===0||g.charCodeAt(p-1)!==32);y++)p--}}if(this._opts.isUnshift&&p===0)continue;let _;this._opts.isUnshift?_=_d.unshiftIndent(g,p+1,o,r,a):_=_d.shiftIndent(g,p+1,o,r,a),this._addEditOperation(t,new be(f,1,f,p+1),_),f===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=p+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(i)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const u=a?cS(" ",r):" ";for(let d=i;d<=s;d++){const f=e.getLineContent(d);let g=cc(f);if(!(this._opts.isUnshift&&(f.length===0||g===0))&&!(!c&&!this._opts.isUnshift&&f.length===0)&&(g===-1&&(g=f.length),!(this._opts.isUnshift&&g===0)))if(this._opts.isUnshift){g=Math.min(g,r);for(let p=0;p<g;p++)if(f.charCodeAt(p)===9){g=p+1;break}this._addEditOperation(t,new be(d,1,d,g+1),"")}else this._addEditOperation(t,new be(d,1,d,1),u),d===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn===1)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){let s=t.getInverseEditOperations()[0];return new fn(s.range.endLineNumber,s.range.endColumn,s.range.endLineNumber,s.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){let s=this._selection.startColumn;return i.startColumn<=s?i:i.getDirection()===0?new fn(i.startLineNumber,s,i.endLineNumber,i.endColumn):new fn(i.endLineNumber,i.endColumn,i.startLineNumber,s)}return i}}class cIt{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new be(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new be(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){let i=t.getInverseEditOperations(),s=i[0].range,o=i[1].range;return new fn(s.endLineNumber,s.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class yo{static indent(e,t,i){if(t===null||i===null)return[];let s=[];for(let o=0,r=i.length;o<r;o++)s[o]=new _d(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return s}static outdent(e,t,i){let s=[];for(let o=0,r=i.length;o<r;o++)s[o]=new _d(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return s}static shiftIndent(e,t,i){return i=i||1,_d.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,_d.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,s){let o=[];for(let r=0,a=i.length;r<a;r++)o[r]=new Dl(i[r],s[r]);return new _u(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,s,o){let r=[];for(let a=0,c=i.length;a<c;a++){const u=i[a];let d=u.getPosition();if(o&&!u.isEmpty()&&(o=!1),o&&s.indexOf(`
- `)!==s.length-1&&(o=!1),o){let f=new be(d.lineNumber,1,d.lineNumber,1);r[a]=new Hie(f,s,u,!0)}else r[a]=new Dl(u,s)}return new _u(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,s,o){if(s||t.length===1)return null;if(o&&o.length===t.length)return o;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));let r=Jm(i);if(r.length===t.length)return r}return null}static paste(e,t,i,s,o,r){const a=this._distributePasteToCursors(e,i,s,o,r);return a?(i=i.sort(be.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,s,o)}static _goodIndentForLine(e,t,i){let s=null,o="";const r=ns.getInheritIndentForLine(e.autoIndent,t,i,!1);if(r)s=r.action,o=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Fm(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),u=ns.getEnterAction(e.autoIndent,t,new be(a,c,a,c));u&&(o=u.indentation+u.appendText)}return s&&(s===gr.Indent&&(o=yo.shiftIndent(e,o)),s===gr.Outdent&&(o=yo.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="",r=i.getStartPosition();if(e.insertSpaces){let a=Vs.visibleColumnFromColumn2(e,t,r),c=e.indentSize,u=c-a%c;for(let d=0;d<u;d++)o+=" "}else o=" ";return new Dl(i,o,s)}static tab(e,t,i){let s=[];for(let o=0,r=i.length;o<r;o++){const a=i[o];if(a.isEmpty()){let c=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(c)&&t.isCheapToTokenize(a.startLineNumber)){let u=this._goodIndentForLine(e,t,a.startLineNumber);u=u||" ";let d=e.normalizeIndentation(u);if(!c.startsWith(d)){s[o]=new Dl(new be(a.startLineNumber,1,a.startLineNumber,c.length+1),d,!0);continue}}s[o]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){let c=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==c){s[o]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}s[o]=new _d(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent})}}return s}static compositionType(e,t,i,s,o,r,a,c){const u=s.map(d=>this._compositionType(i,d,o,r,a,c));return new _u(4,u,{shouldPushStackElementBefore:oV(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-s),u=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new be(a.lineNumber,c,a.lineNumber,u);return e.getValueInRange(d)===i&&r===0?null:new c4(d,i,0,r)}static _typeCommand(e,t,i){return i?new iV(e,t,!0):new Dl(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return yo._typeCommand(s,`
- `,i);if(!t.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){let c=t.getLineContent(s.startLineNumber),u=Hs(c).substring(0,s.startColumn-1);return yo._typeCommand(s,`
- `+e.normalizeIndentation(u),i)}const o=ns.getEnterAction(e.autoIndent,t,s);if(o){if(o.indentAction===gr.None)return yo._typeCommand(s,`
- `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===gr.Indent)return yo._typeCommand(s,`
- `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===gr.IndentOutdent){const c=e.normalizeIndentation(o.indentation),u=e.normalizeIndentation(o.indentation+o.appendText),d=`
- `+u+`
- `+c;return i?new iV(s,d,!0):new c4(s,d,-1,u.length-c.length,!0)}else if(o.indentAction===gr.Outdent){const c=yo.unshiftIndent(e,o.indentation);return yo._typeCommand(s,`
- `+e.normalizeIndentation(c+o.appendText),i)}}const r=t.getLineContent(s.startLineNumber),a=Hs(r).substring(0,s.startColumn-1);if(e.autoIndent>=4){const c=ns.getIndentForEnter(e.autoIndent,t,s,{unshiftIndent:u=>yo.unshiftIndent(e,u),shiftIndent:u=>yo.shiftIndent(e,u),normalizeIndentation:u=>e.normalizeIndentation(u)});if(c){let u=Vs.visibleColumnFromColumn2(e,t,s.getEndPosition());const d=s.endColumn,f=t.getLineContent(s.endLineNumber),g=cc(f);if(g>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,g+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new iV(s,`
- `+e.normalizeIndentation(c.afterEnter),!0);{let p=0;return d<=g+1&&(e.insertSpaces||(u=Math.ceil(u/e.indentSize)),p=Math.min(u+1-e.normalizeIndentation(c.afterEnter).length-1,0)),new c4(s,`
- `+e.normalizeIndentation(c.afterEnter),0,p,!0)}}}return yo._typeCommand(s,`
- `+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;s<o;s++)if(!t.isCheapToTokenize(i[s].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,s){const o=ns.getIndentationAtPosition(t,i.startLineNumber,i.startColumn),r=ns.getIndentActionForType(e.autoIndent,t,i,s,{shiftIndent:a=>yo.shiftIndent(e,a),unshiftIndent:a=>yo.unshiftIndent(e,a)});if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?yo._typeCommand(new be(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):yo._typeCommand(new be(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r<a;r++){const c=i[r];if(!c.isEmpty())return!1;const u=c.getPosition(),d=t.getLineContent(u.lineNumber);if(d.charAt(u.column-1)!==o)return!1;const g=M1(o);if((u.column>2?d.charCodeAt(u.column-2):0)===92&&g)return!1;if(e.autoClosingOvertype==="auto"){let _=!1;for(let v=0,C=s.length;v<C;v++){const y=s[v];if(u.lineNumber===y.startLineNumber&&u.column===y.startColumn){_=!0;break}}if(!_)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,s,o){let r=[];for(let a=0,c=s.length;a<c;a++){const d=s[a].getPosition(),f=new be(d.lineNumber,d.column,d.lineNumber,d.column+1);r[a]=new Dl(f,o)}return new _u(4,r,{shouldPushStackElementBefore:oV(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),s=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=s.some(c=>t.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let c=!0;for(const u of i)if(t.getValueInRange(new be(u.lineNumber,u.column-a.open.length+1,u.lineNumber,u.column))+s!==a.open){c=!1;break}c&&(r=a)}return r}static _findSubAutoClosingPairClose(e,t){if(t.open.length<=1)return"";const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o?o.close:""}static _getAutoClosingPairClose(e,t,i,s,o){const r=M1(s),a=r?e.autoClosingQuotes:e.autoClosingBrackets;if(a==="never")return null;const c=this._findAutoClosingPairOpen(e,t,i.map(g=>g.getPosition()),s);if(!c)return null;const u=this._findSubAutoClosingPairClose(e,c);let d=!0;const f=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let g=0,p=i.length;g<p;g++){const _=i[g];if(!_.isEmpty())return null;const v=_.getPosition(),C=t.getLineContent(v.lineNumber),y=C.substring(v.column-1);if(y.startsWith(u)||(d=!1),C.length>v.column-1){const L=C.charAt(v.column-1);if(!yo._isBeforeClosingBrace(e,y)&&!f(L))return null}if(!t.isCheapToTokenize(v.lineNumber))return null;if(c.open.length===1&&(s==="'"||s==='"')&&a!=="always"){const L=Ih(e.wordSeparators);if(o&&v.column>1&&L.get(C.charCodeAt(v.column-2))===0||!o&&v.column>2&&L.get(C.charCodeAt(v.column-3))===0)return null}t.forceTokenization(v.lineNumber);const w=t.getLineTokens(v.lineNumber);let I=!1;try{I=ns.shouldAutoClosePair(c,w,o?v.column:v.column-1)}catch(L){di(L)}if(!I)return null}return d?c.close.substring(0,c.close.length-u.length):c.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){let c=[];for(let u=0,d=s.length;u<d;u++){const f=s[u];c[u]=new uOe(f,o,r,a)}return new _u(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return M1(t)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,t,i,s){if(!yo._shouldSurroundChar(e,s)||!e.surroundingPairs.hasOwnProperty(s))return!1;const o=M1(s);for(let r=0,a=i.length;r<a;r++){const c=i[r];if(c.isEmpty())return!1;let u=!0;for(let d=c.startLineNumber;d<=c.endLineNumber;d++){const f=t.getLineContent(d),g=d===c.startLineNumber?c.startColumn-1:0,p=d===c.endLineNumber?c.endColumn-1:f.length,_=f.substring(g,p);if(/[^ \t]/.test(_)){u=!1;break}}if(u)return!1;if(o&&c.startLineNumber===c.endLineNumber&&c.startColumn+1===c.endColumn){const d=t.getValueInRange(c);if(M1(d))return!1}}return!0}static _runSurroundSelectionType(e,t,i,s,o){let r=[];for(let a=0,c=s.length;a<c;a++){const u=s[a],d=t.surroundingPairs[o];r[a]=new cIt(u,o,d)}return new _u(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!!(i.length===1&&t.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,s,o){if(!t.electricChars.hasOwnProperty(o)||!s.isEmpty())return null;let r=s.getPosition();i.forceTokenization(r.lineNumber);let a=i.getLineTokens(r.lineNumber),c;try{c=ns.onElectricCharacter(o,a,r.column)}catch(u){return di(u),null}if(!c)return null;if(c.matchOpenBracket){let u=(a.getLineContent()+o).lastIndexOf(c.matchOpenBracket)+1,d=i.findMatchingBracketUp(c.matchOpenBracket,{lineNumber:r.lineNumber,column:u});if(d){if(d.startLineNumber===r.lineNumber)return null;let f=i.getLineContent(d.startLineNumber),g=Hs(f),p=t.normalizeIndentation(g),_=i.getLineContent(r.lineNumber),v=i.getLineFirstNonWhitespaceColumn(r.lineNumber)||r.column,C=_.substring(v-1,r.column-1),y=p+C+o,w=new be(r.lineNumber,1,r.lineNumber,r.column);const I=new Dl(w,y);return new _u(g7(y,e),[I],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,s,o,r){if(!s||fn.selectionsArrEqual(s,o))return null;let a=null;for(const u of o){if(!u.isEmpty())return null;const d=u.getPosition(),f=i.getValueInRange(new be(d.lineNumber,d.column-1,d.lineNumber,d.column));if(a===null)a=f;else if(a!==f)return null}if(!a)return null;if(this._isAutoClosingOvertype(t,i,o,r,a)){const u=o.map(d=>new Dl(new be(d.positionLineNumber,d.positionColumn,d.positionLineNumber,d.positionColumn+1),"",!1));return new _u(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const c=this._getAutoClosingPairClose(t,i,o,a,!1);return c!==null?this._runAutoClosingOpenCharType(e,t,i,o,a,!1,c):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===`
- `){let d=[];for(let f=0,g=o.length;f<g;f++)d[f]=yo._enter(i,s,!1,o[f]);return new _u(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,s,o)){let d=[],f=!1;for(let g=0,p=o.length;g<p;g++)if(d[g]=this._runAutoIndentType(i,s,o[g],a),!d[g]){f=!0;break}if(!f)return new _u(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoClosingOvertype(i,s,o,r,a))return this._runAutoClosingOvertype(t,i,s,o,a);if(!e){const d=this._getAutoClosingPairClose(i,s,o,a,!0);if(d)return this._runAutoClosingOpenCharType(t,i,s,o,a,!0,d)}if(this._isSurroundSelectionType(i,s,o,a))return this._runSurroundSelectionType(t,i,s,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,s,o)){const d=this._typeInterceptorElectricChar(t,i,s,o[0],a);if(d)return d}let c=[];for(let d=0,f=o.length;d<f;d++)c[d]=new Dl(o[d],a);const u=g7(a,t);return new _u(u,c,{shouldPushStackElementBefore:oV(t,u),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,s,o){let r=[];for(let c=0,u=s.length;c<u;c++)r[c]=new Dl(s[c],o);const a=g7(o,e);return new _u(a,r,{shouldPushStackElementBefore:oV(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];let s=[];for(let o=0,r=i.length;o<r;o++){let a=i[o].positionLineNumber;if(a===1)s[o]=new iV(new be(1,1,1,1),`
- `);else{a--;let c=t.getLineMaxColumn(a);s[o]=this._enter(e,t,!1,new be(a,c,a,c))}}return s}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];let s=[];for(let o=0,r=i.length;o<r;o++){const a=i[o].positionLineNumber;let c=t.getLineMaxColumn(a);s[o]=this._enter(e,t,!1,new be(a,c,a,c))}return s}static lineBreakInsert(e,t,i){let s=[];for(let o=0,r=i.length;o<r;o++)s[o]=this._enter(e,t,!0,i[o]);return s}}class uOe extends c4{constructor(e,t,i,s){super(e,(i?t:"")+s,0,-s.length),this._openCharacter=t,this._closeCharacter=s,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){let s=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new be(s.startLineNumber,s.endColumn-this._closeCharacter.length,s.endLineNumber,s.endColumn),this.enclosingRange=new be(s.startLineNumber,s.endColumn-this._openCharacter.length-this._closeCharacter.length,s.endLineNumber,s.endColumn),super.computeCursorState(e,t)}}function g7(n,e){return n===" "?e===5||e===6?6:5:4}function oV(n,e){return Zfe(n)&&!Zfe(e)?!0:n===5?!1:Qfe(n)!==Qfe(e)}function Qfe(n){return n===6||n===5?"space":n}function Zfe(n){return n===4||n===5||n===6}var We;(function(n){n.editorSimpleInput=new Sn("editorSimpleInput",!1,!0),n.editorTextFocus=new Sn("editorTextFocus",!1,$("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),n.focus=new Sn("editorFocus",!1,$("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new Sn("textInputFocus",!1,$("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new Sn("editorReadonly",!1,$("editorReadonly","Whether the editor is read only")),n.inDiffEditor=new Sn("inDiffEditor",!1,$("inDiffEditor","Whether the context is a diff editor")),n.columnSelection=new Sn("editorColumnSelection",!1,$("editorColumnSelection","Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new Sn("editorHasSelection",!1,$("editorHasSelection","Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new Sn("editorHasMultipleSelections",!1,$("editorHasMultipleSelections","Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new Sn("editorTabMovesFocus",!1,$("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInWalkThroughSnippet=new Sn("isInEmbeddedEditor",!1,!0),n.canUndo=new Sn("canUndo",!1,!0),n.canRedo=new Sn("canRedo",!1,!0),n.hoverVisible=new Sn("editorHoverVisible",!1,$("editorHoverVisible","Whether the editor hover is visible")),n.inCompositeEditor=new Sn("inCompositeEditor",void 0,$("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new Sn("editorLangId","",$("editorLangId","The language identifier of the editor")),n.hasCompletionItemProvider=new Sn("editorHasCompletionItemProvider",!1,$("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new Sn("editorHasCodeActionsProvider",!1,$("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),n.hasCodeLensProvider=new Sn("editorHasCodeLensProvider",!1,$("editorHasCodeLensProvider","Whether the editor has a code lens provider")),n.hasDefinitionProvider=new Sn("editorHasDefinitionProvider",!1,$("editorHasDefinitionProvider","Whether the editor has a definition provider")),n.hasDeclarationProvider=new Sn("editorHasDeclarationProvider",!1,$("editorHasDeclarationProvider","Whether the editor has a declaration provider")),n.hasImplementationProvider=new Sn("editorHasImplementationProvider",!1,$("editorHasImplementationProvider","Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new Sn("editorHasTypeDefinitionProvider",!1,$("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),n.hasHoverProvider=new Sn("editorHasHoverProvider",!1,$("editorHasHoverProvider","Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new Sn("editorHasDocumentHighlightProvider",!1,$("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new Sn("editorHasDocumentSymbolProvider",!1,$("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),n.hasReferenceProvider=new Sn("editorHasReferenceProvider",!1,$("editorHasReferenceProvider","Whether the editor has a reference provider")),n.hasRenameProvider=new Sn("editorHasRenameProvider",!1,$("editorHasRenameProvider","Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new Sn("editorHasSignatureHelpProvider",!1,$("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new Sn("editorHasInlayHintsProvider",!1,$("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new Sn("editorHasDocumentFormattingProvider",!1,$("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new Sn("editorHasDocumentSelectionFormattingProvider",!1,$("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new Sn("editorHasMultipleDocumentFormattingProvider",!1,$("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new Sn("editorHasMultipleDocumentSelectionFormattingProvider",!1,$("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(We||(We={}));const es=0;class cr extends jl{runEditorCommand(e,t,i){const s=t._getViewModel();s&&this.runCoreEditorCommand(s,i||{})}}var $3;(function(n){const e=function(i){if(!jc(i))return!1;const s=i;return!(!Yf(s.to)||!oc(s.by)&&!Yf(s.by)||!oc(s.value)&&!X0(s.value)||!oc(s.revealCursor)&&!hLe(s.revealCursor))};n.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},n.RawDirection={Up:"up",Down:"down"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"};function t(i){let s;switch(i.to){case n.RawDirection.Up:s=1;break;case n.RawDirection.Down:s=2;break;default:return null}let o;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Page:o=3;break;case n.RawUnit.HalfPage:o=4;break;default:o=2}const r=Math.floor(i.value||1),a=!!i.revealCursor;return{direction:s,unit:o,value:r,revealCursor:a,select:!!i.select}}n.parse=t})($3||($3={}));var K1;(function(n){const e=function(t){if(!jc(t))return!1;const i=t;return!(!X0(i.lineNumber)&&!Yf(i.lineNumber)||!oc(i.at)&&!Yf(i.at))};n.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:e,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},n.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}})(K1||(K1={}));class lJ{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(hs).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=document.activeElement;return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(hs).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var il;(function(n){class e extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,[vl.moveTo(w,w.getPrimaryCursorState(),this._inSelectionMode,I.position,I.viewPosition)]),w.revealPrimaryCursor(I.source,!0)}}n.MoveTo=Xt(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Xt(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends cr{runCoreEditorCommand(w,I){w.model.pushStackElement();const L=this._getColumnSelectResult(w,w.getPrimaryCursorState(),w.getCursorColumnSelectData(),I);w.setCursorStates(I.source,3,L.viewStates.map(O=>Ri.fromViewState(O))),w.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:L.fromLineNumber,fromViewVisualColumn:L.fromVisualColumn,toViewLineNumber:L.toLineNumber,toViewVisualColumn:L.toVisualColumn}),L.reversed?w.revealTopMostCursor(I.source):w.revealBottomMostCursor(I.source)}}n.ColumnSelect=Xt(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(y,w,I,L){const O=y.model.validatePosition(L.position),A=y.coordinatesConverter.validateViewPosition(new ct(L.viewPosition.lineNumber,L.viewPosition.column),O);let N=L.doColumnSelect?I.fromViewLineNumber:A.lineNumber,D=L.doColumnSelect?I.fromViewVisualColumn:L.mouseColumn-1;return AS.columnSelect(y.cursorConfig,y,N,D,A.lineNumber,L.mouseColumn-1)}}),n.CursorColumnSelectLeft=Xt(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(y,w,I,L){return AS.columnSelectLeft(y.cursorConfig,y,I)}}),n.CursorColumnSelectRight=Xt(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(y,w,I,L){return AS.columnSelectRight(y.cursorConfig,y,I)}});class i extends t{constructor(w){super(w),this._isPaged=w.isPaged}_getColumnSelectResult(w,I,L,O){return AS.columnSelectUp(w.cursorConfig,w,L,this._isPaged)}}n.CursorColumnSelectUp=Xt(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Xt(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(w){super(w),this._isPaged=w.isPaged}_getColumnSelectResult(w,I,L,O){return AS.columnSelectDown(w.cursorConfig,w,L,this._isPaged)}}n.CursorColumnSelectDown=Xt(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Xt(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends cr{constructor(){super({id:"cursorMove",precondition:void 0,description:D3.description})}runCoreEditorCommand(w,I){const L=D3.parse(I);L&&this._runCursorMove(w,I.source,L)}_runCursorMove(w,I,L){w.model.pushStackElement(),w.setCursorStates(I,3,o._move(w,w.getCursorStates(),L)),w.revealPrimaryCursor(I,!0)}static _move(w,I,L){const O=L.select,A=L.value;switch(L.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return vl.simpleMove(w,I,L.direction,O,A,L.unit);case 11:case 13:case 12:case 14:return vl.viewportMove(w,I,L.direction,O,A);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Xt(new o);class r extends cr{constructor(w){super(w),this._staticArgs=w.args}runCoreEditorCommand(w,I){let L=this._staticArgs;this._staticArgs.value===-1&&(L={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.cursorConfig.pageSize}),w.model.pushStackElement(),w.setCursorStates(I.source,3,vl.simpleMove(w,w.getCursorStates(),L.direction,L.select,L.value,L.unit)),w.revealPrimaryCursor(I.source,!0)}}n.CursorLeft=Xt(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Xt(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1039}})),n.CursorRight=Xt(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Xt(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1041}})),n.CursorUp=Xt(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Xt(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Xt(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:11}})),n.CursorPageUpSelect=Xt(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1035}})),n.CursorDown=Xt(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Xt(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Xt(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:12}})),n.CursorPageDownSelect=Xt(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1036}})),n.CreateCursor=Xt(new class extends cr{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(y,w){let I;w.wholeLine?I=vl.line(y,y.getPrimaryCursorState(),!1,w.position,w.viewPosition):I=vl.moveTo(y,y.getPrimaryCursorState(),!1,w.position,w.viewPosition);const L=y.getCursorStates();if(L.length>1){const O=I.modelState?I.modelState.position:null,A=I.viewState?I.viewState.position:null;for(let N=0,D=L.length;N<D;N++){const P=L[N];if(!(O&&!P.modelState.selection.containsPosition(O))&&!(A&&!P.viewState.selection.containsPosition(A))){L.splice(N,1),y.model.pushStackElement(),y.setCursorStates(w.source,3,L);return}}}L.push(I),y.model.pushStackElement(),y.setCursorStates(w.source,3,L)}}),n.LastCursorMoveToSelect=Xt(new class extends cr{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(y,w){const I=y.getLastAddedCursorIndex(),L=y.getCursorStates(),O=L.slice(0);O[I]=vl.moveTo(y,L[I],!0,w.position,w.viewPosition),y.model.pushStackElement(),y.setCursorStates(w.source,3,O)}});class a extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,vl.moveToBeginningOfLine(w,w.getCursorStates(),this._inSelectionMode)),w.revealPrimaryCursor(I.source,!0)}}n.CursorHome=Xt(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),n.CursorHomeSelect=Xt(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class c extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,this._exec(w.getCursorStates())),w.revealPrimaryCursor(I.source,!0)}_exec(w){const I=[];for(let L=0,O=w.length;L<O;L++){const A=w[L],N=A.modelState.position.lineNumber;I[L]=Ri.fromModelState(A.modelState.move(this._inSelectionMode,N,1,0))}return I}}n.CursorLineStart=Xt(new c({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:0,mac:{primary:287}}})),n.CursorLineStartSelect=Xt(new c({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:0,mac:{primary:1311}}}));class u extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,vl.moveToEndOfLine(w,w.getCursorStates(),this._inSelectionMode,I.sticky||!1)),w.revealPrimaryCursor(I.source,!0)}}n.CursorEnd=Xt(new u({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:es,kbExpr:We.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:$("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),n.CursorEndSelect=Xt(new u({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:es,kbExpr:We.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:$("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,this._exec(w,w.getCursorStates())),w.revealPrimaryCursor(I.source,!0)}_exec(w,I){const L=[];for(let O=0,A=I.length;O<A;O++){const N=I[O],D=N.modelState.position.lineNumber,P=w.model.getLineMaxColumn(D);L[O]=Ri.fromModelState(N.modelState.move(this._inSelectionMode,D,P,0))}return L}}n.CursorLineEnd=Xt(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:0,mac:{primary:291}}})),n.CursorLineEndSelect=Xt(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:0,mac:{primary:1315}}}));class f extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,vl.moveToBeginningOfBuffer(w,w.getCursorStates(),this._inSelectionMode)),w.revealPrimaryCursor(I.source,!0)}}n.CursorTop=Xt(new f({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2062,mac:{primary:2064}}})),n.CursorTopSelect=Xt(new f({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3086,mac:{primary:3088}}}));class g extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,vl.moveToEndOfBuffer(w,w.getCursorStates(),this._inSelectionMode)),w.revealPrimaryCursor(I.source,!0)}}n.CursorBottom=Xt(new g({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2061,mac:{primary:2066}}})),n.CursorBottomSelect=Xt(new g({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends cr{constructor(){super({id:"editorScroll",precondition:void 0,description:$3.description})}runCoreEditorCommand(w,I){const L=$3.parse(I);L&&this._runEditorScroll(w,I.source,L)}_runEditorScroll(w,I,L){const O=this._computeDesiredScrollTop(w,L);if(L.revealCursor){const A=w.getCompletelyVisibleViewRangeAtScrollTop(O);w.setCursorStates(I,3,[vl.findPositionInViewportIfOutside(w,w.getPrimaryCursorState(),A,L.select)])}w.setScrollTop(O,0)}_computeDesiredScrollTop(w,I){if(I.unit===1){const A=w.getCompletelyVisibleViewRange(),N=w.coordinatesConverter.convertViewRangeToModelRange(A);let D;I.direction===1?D=Math.max(1,N.startLineNumber-I.value):D=Math.min(w.model.getLineCount(),N.startLineNumber+I.value);const P=w.coordinatesConverter.convertModelPositionToViewPosition(new ct(D,1));return w.getVerticalOffsetForLineNumber(P.lineNumber)}let L;I.unit===3?L=w.cursorConfig.pageSize*I.value:I.unit===4?L=Math.round(w.cursorConfig.pageSize/2)*I.value:L=I.value;const O=(I.direction===1?-1:1)*L;return w.getScrollTop()+O*w.cursorConfig.lineHeight}}n.EditorScrollImpl=p,n.EditorScroll=Xt(new p),n.ScrollLineUp=Xt(new class extends cr{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(y,w){n.EditorScroll._runEditorScroll(y,w.source,{direction:1,unit:2,value:1,revealCursor:!1,select:!1})}}),n.ScrollPageUp=Xt(new class extends cr{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(y,w){n.EditorScroll._runEditorScroll(y,w.source,{direction:1,unit:3,value:1,revealCursor:!1,select:!1})}}),n.ScrollLineDown=Xt(new class extends cr{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(y,w){n.EditorScroll._runEditorScroll(y,w.source,{direction:2,unit:2,value:1,revealCursor:!1,select:!1})}}),n.ScrollPageDown=Xt(new class extends cr{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(y,w){n.EditorScroll._runEditorScroll(y,w.source,{direction:2,unit:3,value:1,revealCursor:!1,select:!1})}});class _ extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,[vl.word(w,w.getPrimaryCursorState(),this._inSelectionMode,I.position)]),w.revealPrimaryCursor(I.source,!0)}}n.WordSelect=Xt(new _({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),n.WordSelectDrag=Xt(new _({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),n.LastCursorWordSelect=Xt(new class extends cr{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(y,w){const I=y.getLastAddedCursorIndex(),L=y.getCursorStates(),O=L.slice(0),A=L[I];O[I]=vl.word(y,A,A.modelState.hasSelection(),w.position),y.model.pushStackElement(),y.setCursorStates(w.source,3,O)}});class v extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){w.model.pushStackElement(),w.setCursorStates(I.source,3,[vl.line(w,w.getPrimaryCursorState(),this._inSelectionMode,I.position,I.viewPosition)]),w.revealPrimaryCursor(I.source,!1)}}n.LineSelect=Xt(new v({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),n.LineSelectDrag=Xt(new v({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class C extends cr{constructor(w){super(w),this._inSelectionMode=w.inSelectionMode}runCoreEditorCommand(w,I){const L=w.getLastAddedCursorIndex(),O=w.getCursorStates(),A=O.slice(0);A[L]=vl.line(w,O[L],this._inSelectionMode,I.position,I.viewPosition),w.model.pushStackElement(),w.setCursorStates(I.source,3,A)}}n.LastCursorLineSelect=Xt(new C({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),n.LastCursorLineSelectDrag=Xt(new C({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),n.ExpandLineSelection=Xt(new class extends cr{constructor(){super({id:"expandLineSelection",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:2090}})}runCoreEditorCommand(y,w){y.model.pushStackElement(),y.setCursorStates(w.source,3,vl.expandLineSelection(y,y.getCursorStates())),y.revealPrimaryCursor(w.source,!0)}}),n.CancelSelection=Xt(new class extends cr{constructor(){super({id:"cancelSelection",precondition:We.hasNonEmptySelection,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(y,w){y.model.pushStackElement(),y.setCursorStates(w.source,3,[vl.cancelSelection(y,y.getPrimaryCursorState())]),y.revealPrimaryCursor(w.source,!0)}}),n.RemoveSecondaryCursors=Xt(new class extends cr{constructor(){super({id:"removeSecondaryCursors",precondition:We.hasMultipleSelections,kbOpts:{weight:es+1,kbExpr:We.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(y,w){y.model.pushStackElement(),y.setCursorStates(w.source,3,[y.getPrimaryCursorState()]),y.revealPrimaryCursor(w.source,!0),E3($("removedCursor","Removed secondary cursors"))}}),n.RevealLine=Xt(new class extends cr{constructor(){super({id:"revealLine",precondition:void 0,description:K1.description})}runCoreEditorCommand(y,w){const I=w,L=I.lineNumber||0;let O=typeof L=="number"?L+1:parseInt(L)+1;O<1&&(O=1);const A=y.model.getLineCount();O>A&&(O=A);const N=new be(O,1,O,y.model.getLineMaxColumn(O));let D=0;if(I.at)switch(I.at){case K1.RawAtArgument.Top:D=3;break;case K1.RawAtArgument.Center:D=1;break;case K1.RawAtArgument.Bottom:D=4;break}const P=y.coordinatesConverter.convertModelRangeToViewRange(N);y.revealRange(w.source,!1,P,D,0)}}),n.SelectAll=new class extends lJ{constructor(){super(Xyt)}runDOMCommand(){ac&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(y,w,I){const L=w._getViewModel();L&&this.runCoreEditorCommand(L,I)}runCoreEditorCommand(y,w){y.model.pushStackElement(),y.setCursorStates("keyboard",3,[vl.selectAll(y,y.getPrimaryCursorState())])}},n.SetSelection=Xt(new class extends cr{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(y,w){y.model.pushStackElement(),y.setCursorStates(w.source,3,[Ri.fromModelSelection(w.selection)])}})})(il||(il={}));const uIt=dn.and(We.textInputFocus,We.columnSelection);function bM(n,e){_c.registerKeybindingRule({id:n,primary:e,when:uIt,weight:es+1})}bM(il.CursorColumnSelectLeft.id,1039);bM(il.CursorColumnSelectRight.id,1041);bM(il.CursorColumnSelectUp.id,1040);bM(il.CursorColumnSelectPageUp.id,1035);bM(il.CursorColumnSelectDown.id,1042);bM(il.CursorColumnSelectPageDown.id,1036);function ege(n){return n.register(),n}var LO;(function(n){class e extends jl{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Xt(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:We.writable,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,yo.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Xt(new class extends e{constructor(){super({id:"outdent",precondition:We.writable,kbOpts:{weight:es,kbExpr:dn.and(We.editorTextFocus,We.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,yo.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Xt(new class extends e{constructor(){super({id:"tab",precondition:We.writable,kbOpts:{weight:es,kbExpr:dn.and(We.editorTextFocus,We.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,yo.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Xt(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=sw.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),n.DeleteRight=Xt(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:es,kbExpr:We.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=sw.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),n.Undo=new class extends lJ{constructor(){super(cie)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(80)===!0))return i.getModel().undo()}},n.Redo=new class extends lJ{constructor(){super(uie)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(80)===!0))return i.getModel().redo()}}})(LO||(LO={}));class tge extends _6{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(hs).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Gw(n,e){ege(new tge("default:"+n,n)),ege(new tge(n,n,e))}Gw("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Gw("replacePreviousChar");Gw("compositionType");Gw("compositionStart");Gw("compositionEnd");Gw("paste");Gw("cut");class dIt{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){il.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new ct(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(69)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(69)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=Qc&&t.get(95),s=t.get(18);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount===2?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){il.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){il.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),il.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),il.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){il.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){il.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){il.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){il.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){il.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){il.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){il.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){il.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){il.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class I6{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return I6.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new hIt(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class hIt{constructor(e,t,i,s,o,r){this.element=e,this.type=t,this.mouseColumn=i,this.position=s,this.range=o,this.detail=r}toString(){return Ig.toString(this)}}var p7;class dOe{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(t<i){const c=t-e+1;return this._rendLineNumberStart-=c,null}if(e>s)return null;let o=0,r=0;for(let c=i;c<=s;c++){const u=c-this._rendLineNumberStart;e<=c&&c<=t&&(r===0?(o=u,r=1):r++)}if(e<i){let c=0;t<i?c=t-e+1:c=i-e,this._rendLineNumberStart-=c}return this._lines.splice(o,r)}onLinesChanged(e,t){if(this.getCount()===0)return!1;const i=this.getStartLineNumber(),s=this.getEndLineNumber();let o=!1;for(let r=e;r<=t;r++)r>=i&&r<=s&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let f=0;f<i;f++)r[f]=this._createLine();const a=e-this._rendLineNumberStart,c=this._lines.slice(0,a),u=this._lines.slice(a,this._lines.length-i),d=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=c.concat(r).concat(u),d}onTokensChanged(e){if(this.getCount()===0)return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let s=!1;for(let o=0,r=e.length;o<r;o++){const a=e[o];if(a.toLineNumber<t||a.fromLineNumber>i)continue;const c=Math.max(t,a.fromLineNumber),u=Math.min(i,a.toLineNumber);for(let d=c;d<=u;d++){const f=d-this._rendLineNumberStart;this._lines[f].onTokensChanged(),s=!0}}return s}}class hOe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new dOe(()=>this._host.createVisibleLine())}_createDomNode(){const e=qi(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(129)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;i<s;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;i<s;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new Fv(this.domNode.domNode,this._host,e),s={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(s,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class Fv{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,s){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let r=t;r<=i;r++)o.lines[r-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,s),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),s,t),o.rendLineNumberStart>t){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart<t){const r=Math.min(o.linesLength,t-o.rendLineNumberStart);r>0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const r=o.rendLineNumberStart+o.linesLength,a=i;r<=a&&(this._insertLinesAfter(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const r=Math.max(0,i-o.rendLineNumberStart+1),c=o.linesLength-1-r+1;c>0&&(this._removeLinesAfter(o,c),o.linesLength-=c)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const u=r+c;a[c].layoutLine(u,s[u-o])}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let c=t;c<=i;c++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const s=e.lines[i].getDomNode();s&&this.domNode.removeChild(s)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,s,o){const r=[];let a=0;for(let c=t;c<=i;c++)r[a++]=this.host.createVisibleLine();e.lines=e.lines.concat(r)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let s=0;s<t;s++){const o=e.lines[i+s].getDomNode();o&&this.domNode.removeChild(o)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,s){Fv._ttPolicy&&(i=Fv._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let r=this.domNode.lastChild;for(let a=e.linesLength-1;a>=0;a--){const c=e.lines[a];s[a]&&(c.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");Fv._ttPolicy&&(t=Fv._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;o<e.linesLength;o++){const r=e.lines[o];if(i[o]){const a=s.firstChild,c=r.getDomNode();c.parentNode.replaceChild(a,c),r.setDomNode(a)}}}_finishRendering(e,t,i){const s=Fv._sb,o=e.linesLength,r=e.lines,a=e.rendLineNumberStart,c=[];{s.reset();let u=!1;for(let d=0;d<o;d++){const f=r[d];c[d]=!1,!(f.getDomNode()||!f.renderLine(d+a,i[d],this.viewportData,s))&&(c[d]=!0,u=!0)}u&&this._finishRenderingNewLines(e,t,s.build(),c)}{s.reset();let u=!1;const d=[];for(let f=0;f<o;f++){const g=r[f];d[f]=!1,!(c[f]||!g.renderLine(f+a,i[f],this.viewportData,s))&&(d[f]=!0,u=!0)}u&&this._finishRenderingInvalidLines(e,s.build(),d)}}}Fv._ttPolicy=(p7=window.trustedTypes)===null||p7===void 0?void 0:p7.createPolicy("editorViewLayer",{createHTML:n=>n});Fv._sb=Y0(1e5);class fOe extends Rh{constructor(e){super(e),this._visibleLines=new hOe(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new fIt(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onConfigurationChanged(e);return!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter(i=>i.shouldRender());for(let i=0,s=t.length;i<s;i++){const o=t[i];o.prepareRender(e),o.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class fIt{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(58),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=qi(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(58)}renderLine(e,t,i,s){let o="";for(let r=0,a=this._dynamicOverlays.length;r<a;r++){const c=this._dynamicOverlays[r];o+=c.render(i.startLineNumber,e)}return this._renderedContent===o?!1:(this._renderedContent=o,s.appendASCIIString('<div style="position:absolute;top:'),s.appendASCIIString(String(t)),s.appendASCIIString("px;width:100%;height:"),s.appendASCIIString(String(this._lineHeight)),s.appendASCIIString('px;">'),s.appendASCIIString(o),s.appendASCIIString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class gIt extends fOe{constructor(e){super(e);const i=this._context.configuration.options.get(129);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class pIt extends fOe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Ea.applyFontInfo(this.domNode,t.get(43))}onConfigurationChanged(e){const t=this._context.configuration.options;Ea.applyFontInfo(this.domNode,t.get(43));const i=t.get(129);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class FN{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class mIt extends Rh{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=qi(document.createElement("div")),Zm.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=qi(document.createElement("div")),Zm.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new _It(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i){this._widgets[e.getId()].setPosition(t,i),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const s=i.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}let _It=class{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=qi(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,o=s.get(129);this._fixedOverflowWidgets=s.get(36),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=s.get(58),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(58),e.hasChanged(129)){const i=t.get(129);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const t=this._context.model.validateModelRange(this._range);(this._context.model.coordinatesConverter.modelPositionIsVisible(t.getStartPosition())||this._context.model.coordinatesConverter.modelPositionIsVisible(t.getEndPosition()))&&(this._viewRange=this._context.model.coordinatesConverter.convertModelRangeToViewRange(t))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1}_layoutBoxInViewport(e,t,i,s,o){const r=e.top,a=r,c=t.top+this._lineHeight,u=o.viewportHeight-c,d=r-s,f=a>=s,g=c,p=u>=s;let _=e.left,v=t.left;return _+i>o.scrollLeft+o.viewportWidth&&(_=o.scrollLeft+o.viewportWidth-i),v+i>o.scrollLeft+o.viewportWidth&&(v=o.scrollLeft+o.viewportWidth-i),_<o.scrollLeft&&(_=o.scrollLeft),v<o.scrollLeft&&(v=o.scrollLeft),{fitsAbove:f,aboveTop:d,aboveLeft:_,fitsBelow:p,belowTop:g,belowLeft:v}}_layoutHorizontalSegmentInPage(e,t,i,s){const o=Math.max(0,t.left-s),r=Math.min(t.left+t.width+s,e.width);let a=t.left+i-Yv.scrollX;if(a+s>r){const c=a-(r-s);a-=c,i-=c}if(a<o){const c=a-o;a-=c,i-=c}return[i,a]}_layoutBoxInPage(e,t,i,s,o){const r=e.top-s,a=t.top+this._lineHeight,c=Bl(this._viewDomNode.domNode),u=c.top+r-Yv.scrollY,d=c.top+a-Yv.scrollY,f=W8(document.body),[g,p]=this._layoutHorizontalSegmentInPage(f,c,e.left-o.scrollLeft+this._contentLeft,i),[_,v]=this._layoutHorizontalSegmentInPage(f,c,t.left-o.scrollLeft+this._contentLeft,i),C=22,y=22,w=u>=C,I=d+s<=f.height-y;return this._fixedOverflowWidgets?{fitsAbove:w,aboveTop:Math.max(u,C),aboveLeft:p,fitsBelow:I,belowTop:d,belowLeft:v}:{fitsAbove:w,aboveTop:r,aboveLeft:g,fitsBelow:I,belowTop:a,belowLeft:_}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new FN(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||t.length===0)return[null,null];let i=t[0],s=t[0];for(const f of t)f.lineNumber<i.lineNumber&&(i=f),f.lineNumber>s.lineNumber&&(s=f);let o=1073741824;for(const f of i.ranges)f.left<o&&(o=f.left);let r=1073741824;for(const f of s.ranges)f.left<r&&(r=f.left);const a=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.scrollTop,c=new FN(a,o),u=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.scrollTop,d=new FN(u,r);return[c,d]}_prepareRenderWidget(e){const[t,i]=this._getTopAndBottomLeft(e);if(!t||!i)return null;if(this._cachedDomNodeClientWidth===-1||this._cachedDomNodeClientHeight===-1){let o=null;if(typeof this._actual.beforeRender=="function"&&(o=m7(this._actual.beforeRender,this._actual)),o)this._cachedDomNodeClientWidth=o.width,this._cachedDomNodeClientHeight=o.height;else{const r=this.domNode.domNode;this._cachedDomNodeClientWidth=r.clientWidth,this._cachedDomNodeClientHeight=r.clientHeight}}let s;if(this.allowEditorOverflow?s=this._layoutBoxInPage(t,i,this._cachedDomNodeClientWidth,this._cachedDomNodeClientHeight,e):s=this._layoutBoxInViewport(t,i,this._cachedDomNodeClientWidth,this._cachedDomNodeClientHeight,e),this._preference)for(let o=1;o<=2;o++)for(const r of this._preference)if(r===1){if(!s)return null;if(o===2||s.fitsAbove)return{coordinate:new FN(s.aboveTop,s.aboveLeft),position:1}}else if(r===2){if(!s)return null;if(o===2||s.fitsBelow)return{coordinate:new FN(s.belowTop,s.belowLeft),position:2}}else return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(t),position:0}:{coordinate:t,position:0};return null}onBeforeRender(e){!this._viewRange||!this._preference||this._viewRange.endLineNumber<e.startLineNumber||this._viewRange.startLineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&m7(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&m7(this._actual.afterRender,this._actual,this._renderData.position)}};function m7(n,e,...t){try{return n.call(e,...t)}catch{return null}}let aJ=!0;class gOe extends vM{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new fn(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=aJ?this._selections.slice(0,1):this._selections,i=t.map(o=>o.positionLineNumber);i.sort((o,r)=>o-r),xf(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const s=t.every(o=>o.isEmpty());return this._selectionIsEmpty!==s&&(this._selectionIsEmpty=s,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const a=[];for(let c=i;c<=s;c++){const u=c-i;for(;r<o&&this._cursorLineNumbers[r]<c;)r++;r<o&&this._cursorLineNumbers[r]===c?a[u]=t:a[u]=""}this._renderData=a}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}}class vIt extends gOe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class bIt extends gOe{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderThis(){return!0}_shouldRenderOther(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}ws((n,e)=>{aJ=!1;const t=n.getColor(J0t);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(Wfe)){const i=n.getColor(Wfe);i&&(aJ=!0,e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),n.type==="hc"&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class TIt extends vM{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let c=0,u=t.length;c<u;c++){const d=t[c];d.options.className&&(i[s++]=d)}i=i.sort((c,u)=>{if(c.options.zIndex<u.options.zIndex)return-1;if(c.options.zIndex>u.options.zIndex)return 1;const d=c.options.className,f=u.options.className;return d<f?-1:d>f?1:be.compareRangesUsingStarts(c.range,u.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let c=o;c<=r;c++){const u=c-o;a[u]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let a=0,c=t.length;a<c;a++){const u=t[a];if(!u.options.isWholeLine)continue;const d='<div class="cdr '+u.options.className+'" style="left:0;width:100%;height:'+s+'px;"></div>',f=Math.max(u.range.startLineNumber,o),g=Math.min(u.range.endLineNumber,r);for(let p=f;p<=g;p++){const _=p-o;i[_]+=d}}}_renderNormalDecorations(e,t,i){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,a=!1,c=null;for(let u=0,d=t.length;u<d;u++){const f=t[u];if(f.options.isWholeLine)continue;const g=f.options.className,p=!!f.options.showIfCollapsed;let _=f.range;if(p&&_.endColumn===1&&_.endLineNumber!==_.startLineNumber&&(_=new be(_.startLineNumber,_.startColumn,_.endLineNumber-1,this._context.model.getLineMaxColumn(_.endLineNumber-1))),r===g&&a===p&&be.areIntersectingOrTouching(c,_)){c=be.plusRange(c,_);continue}r!==null&&this._renderNormalDecoration(e,c,r,a,s,o,i),r=g,a=p,c=_}r!==null&&this._renderNormalDecoration(e,c,r,a,s,o,i)}_renderNormalDecoration(e,t,i,s,o,r,a){const c=e.linesVisibleRangesForRange(t,i==="findMatch");if(c)for(let u=0,d=c.length;u<d;u++){const f=c[u];if(f.outsideRenderedLine)continue;const g=f.lineNumber-r;if(s&&f.ranges.length===1){const p=f.ranges[0];p.width===0&&(f.ranges[0]=new v6(p.left,this._typicalHalfwidthCharacterWidth))}for(let p=0,_=f.ranges.length;p<_;p++){const v=f.ranges[p],C='<div class="cdr '+i+'" style="left:'+String(v.left)+"px;width:"+String(v.width)+"px;height:"+o+'px;"></div>';a[g]+=C}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Bd extends wt{onclick(e,t){this._register(Pt(e,An.CLICK,i=>t(new fh(i))))}onmousedown(e,t){this._register(Pt(e,An.MOUSE_DOWN,i=>t(new fh(i))))}onmouseover(e,t){this._register(Pt(e,An.MOUSE_OVER,i=>t(new fh(i))))}onnonbubblingmouseout(e,t){this._register(Lne(e,i=>t(new fh(i))))}onkeydown(e,t){this._register(Pt(e,An.KEY_DOWN,i=>t(new Po(i))))}onkeyup(e,t){this._register(Pt(e,An.KEY_UP,i=>t(new Po(i))))}oninput(e,t){this._register(Pt(e,An.INPUT,t))}onblur(e,t){this._register(Pt(e,An.BLUR,t))}onfocus(e,t){this._register(Pt(e,An.FOCUS,t))}ignoreGesture(e){Ds.ignoreTarget(e)}}const SR=11;class CIt extends Bd{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width=SR+"px",this.domNode.style.height=SR+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new Ww),this.onmousedown(this.bgDomNode,t=>this._arrowMouseDown(t)),this.onmousedown(this.domNode,t=>this._arrowMouseDown(t)),this._mousedownRepeatTimer=this._register(new vF),this._mousedownScheduleRepeatTimer=this._register(new mc)}_arrowMouseDown(e){const t=()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),41.666666666666664)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(t,200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,_M,i=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class yIt extends wt{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new mc)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}const EIt=140;class pOe extends Bd{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new yIt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new Ww),this._shouldRender=!0,this.domNode=qi(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,t=>this._domNodeMouseDown(t))}_createArrow(e){const t=this._register(new CIt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=qi(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,o=>{o.leftButton&&(o.preventDefault(),this._sliderMouseDown(o,()=>{}))}),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);i<=o&&o<=s?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{})):this._onMouseDown(e)}_onMouseDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.browserEvent.offsetX=="number"&&typeof e.browserEvent.offsetY=="number")t=e.browserEvent.offsetX,i=e.browserEvent.offsetY;else{const o=Bl(this.domNode.domNode);t=e.posx-o.left,i=e.posy-o.top}const s=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{}))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),s=this._sliderOrthogonalMousePosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,_M,r=>{const a=this._sliderOrthogonalMousePosition(r),c=Math.abs(a-s);if(zl&&c>EIt){this._setDesiredScrollPositionNow(o.getScrollPosition());return}const d=this._sliderMousePosition(r)-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(d))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const SIt=20;class Ux{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ux(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=s>0&&s>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const u=Math.round(Math.max(SIt,Math.floor(i*a/s))),d=(a-u)/(s-i),f=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(u),computedSliderRatio:d,computedSliderPosition:Math.round(f)}}_refreshComputedValues(){const e=Ux._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}const wIt=Zf("scrollbar-button-left",vn.triangleLeft),IIt=Zf("scrollbar-button-right",vn.triangleRight);class LIt extends pOe{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Ux(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const r=(t.arrowSize-SR)/2,a=(t.horizontalScrollbarSize-SR)/2;this._createArrow({className:"scra",icon:wIt,top:a,left:r,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new uR(null,1,0))}),this._createArrow({className:"scra",icon:IIt,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new uR(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}const OIt=Zf("scrollbar-button-up",vn.triangleUp),RIt=Zf("scrollbar-button-down",vn.triangleDown);class MIt extends pOe{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Ux(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-SR)/2,a=(t.verticalScrollbarSize-SR)/2;this._createArrow({className:"scra",icon:OIt,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new uR(null,0,1))}),this._createArrow({className:"scra",icon:RIt,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new uR(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class x3{constructor(e,t,i,s,o,r){this._scrollStateBrand=void 0,e=e|0,t=t|0,i=i|0,s=s|0,o=o|0,r=r|0,this.rawScrollLeft=i,this.rawScrollTop=r,e<0&&(e=0),i+e>t&&(i=t-e),i<0&&(i=0),s<0&&(s=0),r+s>o&&(r=o-s),r<0&&(r=0),this.width=e,this.scrollWidth=t,this.scrollLeft=i,this.height=s,this.scrollHeight=o,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new x3(typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new x3(this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,c=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:c}}}class L6 extends wt{constructor(e,t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new rt),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new x3(0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Wx(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=Wx.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class nge{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function _7(n,e){const t=e-n;return function(i){return n+t*NIt(i)}}function kIt(n,e,t){return function(i){return i<t?n(i/t):e((i-t)/(1-t))}}class Wx{constructor(e,t,i,s){this.from=e,this.to=t,this.duration=s,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let o,r;return e<t?(o=e+.75*i,r=t-.75*i):(o=e-.75*i,r=t+.75*i),kIt(_7(e,o),_7(r,t),.33)}return _7(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const i=this.scrollLeft(t),s=this.scrollTop(t);return new nge(i,s,!1)}return new nge(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return Wx.start(e,t,i)}static start(e,t,i){i=i+10;const s=Date.now()-10;return new Wx(e,t,s,i)}}function AIt(n){return Math.pow(n,3)}function NIt(n){return 1-AIt(1-n)}const DIt=500,ige=50;class $It{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class cJ{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,s=this._rear;do{const o=s===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}while(!0);return t<=.5}accept(e,t,i){const s=new $It(e,t,i);s.score=this._computeScore(s),this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}cJ.INSTANCE=new cJ;class mOe extends Bd{constructor(e,t,i){super(),this._onScroll=this._register(new rt),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new rt),e.style.overflow="hidden",this._options=xIt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new MIt(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new LIt(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=qi(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=qi(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=qi(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onnonbubblingmouseout(this._listenOnDomNode,o=>this._onMouseOut(o)),this._hideTimeout=this._register(new mc),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Ji(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ki&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ji(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new uR(s))};this._mouseWheelToDispose.push(Pt(this._listenOnDomNode,An.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){const t=cJ.INSTANCE;{const o=window.devicePixelRatio/mvt();zl||Qc?t.accept(Date.now(),e.deltaX/o,e.deltaY/o):t.accept(Date.now(),e.deltaX,e.deltaY)}let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(o)>=Math.abs(r)?r=0:o=0),this._options.flipAxes&&([o,r]=[r,o]);const a=!ki&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(o){const d=ige*o,f=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,f)}if(r){const d=ige*r,f=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,f)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),DIt)}}class Vie extends mOe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new L6(0,s=>qm(s));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class Uie extends mOe{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class RF extends Vie{constructor(e,t){super(e,t),this._element=e,this.onScroll(i=>{i.scrollTopChanged&&(this._element.scrollTop=i.scrollTop),i.scrollLeftChanged&&(this._element.scrollLeft=i.scrollLeft)}),this.scanDomNode()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function xIt(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,ki&&(e.className+=" mac"),e}class PIt extends Rh{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(91),a=o.get(66),c=o.get(34),u=o.get(94),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+I3(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:u,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new Uie(t.domNode,d,this._context.viewLayout.getScrollable())),Zm.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=qi(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const f=(g,p,_)=>{const v={};{const C=g.scrollTop;C&&(v.scrollTop=this._context.viewLayout.getCurrentScrollTop()+C,g.scrollTop=0)}if(_){const C=g.scrollLeft;C&&(v.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+C,g.scrollLeft=0)}this._context.model.setScrollPosition(v,1)};this._register(Pt(i.domNode,"scroll",g=>f(i.domNode,!0,!0))),this._register(Pt(t.domNode,"scroll",g=>f(t.domNode,!0,!1))),this._register(Pt(s.domNode,"scroll",g=>f(s.domNode,!0,!1))),this._register(Pt(this.scrollbarDomNode.domNode,"scroll",g=>f(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(129);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(64).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(91)||e.hasChanged(66)||e.hasChanged(34)){const t=this._context.configuration.options,i=t.get(91),s=t.get(66),o=t.get(34),r=t.get(94),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(129)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+I3(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}ws((n,e)=>{const t=n.getColor(OF);t&&e.addRule(`
- .monaco-scrollable-element > .shadow.top {
- box-shadow: ${t} 0 6px 6px -6px inset;
- }
- .monaco-scrollable-element > .shadow.left {
- box-shadow: ${t} 6px 0 6px -6px inset;
- }
- .monaco-scrollable-element > .shadow.top.left {
- box-shadow: ${t} 6px 6px 6px -6px inset;
- }
- `);const i=n.getColor(o$);i&&e.addRule(`
- .monaco-scrollable-element > .scrollbar > .slider {
- background: ${i};
- }
- `);const s=n.getColor(r$);s&&e.addRule(`
- .monaco-scrollable-element > .scrollbar > .slider:hover {
- background: ${s};
- }
- `);const o=n.getColor(l$);o&&e.addRule(`
- .monaco-scrollable-element > .scrollbar > .slider.active {
- background: ${o};
- }
- `)});class P3{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class Wie extends vM{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const c=a-e;s[c]=[]}if(i.length===0)return s;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.className<c.className?-1:1);let o=null,r=0;for(let a=0,c=i.length;a<c;a++){const u=i[a],d=u.className;let f=Math.max(u.startLineNumber,e)-e;const g=Math.min(u.endLineNumber,t)-e;o===d?(f=Math.max(r+1,f),r=Math.max(r,g)):(o=d,r=g);for(let p=f;p<=r;p++)s[p].push(o)}return s}}class FIt extends Wie{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._glyphMargin=t.get(49),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._lineHeight=t.get(58),this._glyphMargin=t.get(49),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.options.glyphMarginClassName;c&&(i[s++]=new P3(a.range.startLineNumber,a.range.endLineNumber,c))}return i}prepareRender(e){if(!this._glyphMargin){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),r=this._glyphMarginLeft.toString(),a=this._glyphMarginWidth.toString(),c='" style="left:'+r+"px;width:"+a+"px;height:"+o+'px;"></div>',u=[];for(let d=t;d<=i;d++){const f=d-t,g=s[f];g.length===0?u[f]="":u[f]='<div class="cgmr codicon '+g.join(" ")+c}this._renderResult=u}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class BIt extends vM{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(130),s=t.get(43);this._lineHeight=t.get(58),this._spaceWidth=s.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(130),s=t.get(43);return this._lineHeight=t.get(58),this._spaceWidth=s.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const s=e.selections[0].getPosition();return!((t=this._primaryPosition)===null||t===void 0)&&t.equals(s)?!1:(this._primaryPosition=s,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,s,o;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const r=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,c=e.scrollWidth,u=this._lineHeight,d=this._primaryPosition,f=this.getGuidesByLine(r,a,d),g=[];for(let p=r;p<=a;p++){const _=p-r,v=f[_];let C="";const y=(i=(t=e.visibleRangeForPosition(new ct(p,1)))===null||t===void 0?void 0:t.left)!==null&&i!==void 0?i:0;for(const w of v){const I=y+(w.visibleColumn-1)*this._spaceWidth;if(I>c||this._maxIndentLeft>0&&I>this._maxIndentLeft)break;const L=w.horizontalLine?w.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",O=w.horizontalLine?((o=(s=e.visibleRangeForPosition(new ct(p,w.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:I+this._spaceWidth)-I:this._spaceWidth;C+=`<div class="core-guide ${w.className} ${L}" style="left:${I}px;height:${u}px;width:${O}px"></div>`}g[_]=C}this._renderResult=g}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.model.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?p0.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?p0.EnabledForActive:p0.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.model.getLinesIndentGuides(e,t):null;let r=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation&&i){const f=this._context.model.getActiveIndentGuide(i.lineNumber,e,t);r=f.startLineNumber,a=f.endLineNumber,c=f.indent}const{indentSize:u}=this._context.model.getTextModelOptions(),d=[];for(let f=e;f<=t;f++){const g=new Array;d.push(g);const p=s?s[f-e]:[],_=new jD(p),v=o?o[f-e]:[];for(let C=1;C<=v;C++){const y=(C-1)*u+1,w=p.length===0&&r<=f&&f<=a&&C===c;g.push(..._.takeWhile(L=>L.visibleColumn<y)||[]);const I=_.peek();(!I||I.visibleColumn!==y||I.horizontalLine)&&g.push(new H1(y,w?"core-guide-indent-active":"core-guide-indent",null))}g.push(..._.takeWhile(C=>!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function rV(n){if(!(n&&n.isTransparent()))return n}ws((n,e)=>{const t=n.getColor(y6);t&&e.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${t} inset; }`);const i=n.getColor(E6)||t;i&&e.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${i} inset; }`);const s=[{bracketColor:eOe,guideColor:_wt,guideColorActive:Ewt},{bracketColor:tOe,guideColor:vwt,guideColorActive:Swt},{bracketColor:nOe,guideColor:bwt,guideColorActive:wwt},{bracketColor:iOe,guideColor:Twt,guideColorActive:Iwt},{bracketColor:sOe,guideColor:Cwt,guideColorActive:Lwt},{bracketColor:oOe,guideColor:ywt,guideColorActive:Owt}],o=new lOe;let r=s.map(a=>{var c,u;const d=n.getColor(a.bracketColor),f=n.getColor(a.guideColor),g=n.getColor(a.guideColorActive),p=rV((c=rV(f))!==null&&c!==void 0?c:d==null?void 0:d.transparent(.3)),_=rV((u=rV(g))!==null&&u!==void 0?u:d);if(!(!p||!_))return{guideColor:p,guideColorActive:_}}).filter(Obt);if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.length];e.addRule(`.monaco-editor .${o.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${c.guideColor}; --guide-color-active: ${c.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${o.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${o.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${o.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}});class HIt{constructor(){this._currentVisibleRange=new be(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class VIt{constructor(e,t,i,s,o,r){this.lineNumber=e,this.startColumn=t,this.endColumn=i,this.startScrollTop=s,this.stopScrollTop=o,this.scrollType=r,this.type="range",this.minLineNumber=e,this.maxLineNumber=e}}class UIt{constructor(e,t,i,s){this.selections=e,this.startScrollTop=t,this.stopScrollTop=i,this.scrollType=s,this.type="selections";let o=e[0].startLineNumber,r=e[0].endLineNumber;for(let a=1,c=e.length;a<c;a++){const u=e[a];o=Math.min(o,u.startLineNumber),r=Math.max(r,u.endLineNumber)}this.minLineNumber=o,this.maxLineNumber=r}}class O6 extends Rh{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new hOe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,s=this._context.configuration.options,o=s.get(43),r=s.get(130);this._lineHeight=s.get(58),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=s.get(88),this._cursorSurroundingLines=s.get(25),this._cursorSurroundingLinesStyle=s.get(26),this._canUseLayerHinting=!s.get(28),this._viewLineOptions=new Tfe(i,this._context.theme.type),Zm.write(this.domNode,7),this.domNode.setClassName(`view-lines ${E0}`),Ea.applyFontInfo(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new ho(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new ho(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new HIt,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new ym(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(130)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(43),s=t.get(130);return this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(88),this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),Ea.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(129)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Tfe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new VIt(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new UIt(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.model.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.model.getLineCount())return null;if(this._context.model.getLineMaxColumn(s)===1)return new ct(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(s<o||s>r)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(s,e,t);const c=this._context.model.getLineMinColumn(s);return a<c&&(a=c),new ct(s,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===ym.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++){const o=this._visibleLines.getVisibleLine(s);if(e===o.getDomNode())return s}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();return e<t||e>i?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=be.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;let o=[],r=0;const a=new bfe(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ct(s.startLineNumber,1)).lineNumber);const u=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let f=s.startLineNumber;f<=s.endLineNumber;f++){if(f<u||f>d)continue;const g=f===s.startLineNumber?s.startColumn:1,p=f===s.endLineNumber?s.endColumn:this._context.model.getLineMaxColumn(f),_=this._visibleLines.getVisibleLine(f).getVisibleRangesForRange(f,g,p,a);if(_){if(t&&f<i){const v=c;c=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ct(f+1,1)).lineNumber,v!==c&&(_.ranges[_.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[r++]=new lEt(_.outsideRenderedLine,f,v6.from(_.ranges))}}return r===0?null:o}_visibleRangesForLineRange(e,t,i){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new bfe(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new aEt(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth())}return o&&t===1&&i===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth();a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.model.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),Qc&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.model.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,s,o){const r=e.top,a=e.height,c=r+a;let u,d,f;if(s&&s.length>0){let _=s[0].startLineNumber,v=s[0].endLineNumber;for(let C=1,y=s.length;C<y;C++){const w=s[C];_=Math.min(_,w.startLineNumber),v=Math.max(v,w.endLineNumber)}u=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(_),f=this._context.viewLayout.getVerticalOffsetForLineNumber(v)+this._lineHeight}else if(i)u=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),f=this._context.viewLayout.getVerticalOffsetForLineNumber(i.endLineNumber)+this._lineHeight;else return-1;if(!(t==="mouse"&&this._cursorSurroundingLinesStyle==="default")){const _=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);d-=_*this._lineHeight,f+=Math.max(0,_-1)*this._lineHeight}(o===0||o===4)&&(f+=this._lineHeight);let p;if(f-d>a){if(!u)return-1;p=d}else if(o===5||o===6)if(o===6&&r<=d&&f<=c)p=r;else{const _=Math.max(5*this._lineHeight,a*.2),v=d-_,C=f-a;p=Math.max(C,v)}else if(o===1||o===2)if(o===2&&r<=d&&f<=c)p=r;else{const _=(d+f)/2;p=Math.max(0,_-a/2)}else p=this._computeMinimumScrolling(r,c,d,f,o===3,o===4);return p}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,s=i+t.width;let o=1073741824,r=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)o=Math.min(o,Math.round(u.left)),r=Math.max(r,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)o=Math.min(o,Math.round(d.left)),r=Math.max(r,Math.round(d.left+d.width))}return o=Math.max(0,o-O6.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding,e.type==="selections"&&r-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(i,s,o,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-i<a){if(o)return i;if(r)return Math.max(0,s-a);if(i<e)return i;if(s>t)return Math.max(0,s-a)}else return i;return e}}O6.HORIZONTAL_EXTRA_PX=30;class WIt extends Wie{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(129);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.options.linesDecorationsClassName;c&&(i[s++]=new P3(a.range.startLineNumber,a.range.endLineNumber,c));const u=a.options.firstLineDecorationClassName;u&&(i[s++]=new P3(a.range.startLineNumber,a.range.startLineNumber,u))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=this._render(t,i,this._getDecorations(e)),o=this._decorationsLeft.toString(),r=this._decorationsWidth.toString(),a='" style="left:'+o+"px;width:"+r+'px;"></div>',c=[];for(let u=t;u<=i;u++){const d=u-t,f=s[d];let g="";for(let p=0,_=f.length;p<_;p++)g+='<div class="cldr '+f[p]+a;c[d]=g}this._renderResult=c}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class GIt extends Wie{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],c=a.options.marginClassName;c&&(i[s++]=new P3(a.range.startLineNumber,a.range.endLineNumber,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=this._render(t,i,this._getDecorations(e)),o=[];for(let r=t;r<=i;r++){const a=r-t,c=s[a];let u="";for(let d=0,f=c.length;d<f;d++)u+='<div class="cmdr '+c[d]+'" style=""></div>';o[a]=u}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class gh{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=gh._clamp(e),this.g=gh._clamp(t),this.b=gh._clamp(i),this.a=gh._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}gh.Empty=new gh(0,0,0,0);class MF extends wt{constructor(){super(),this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register($o.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}static getInstance(){return this._INSTANCE||(this._INSTANCE=new MF),this._INSTANCE}_updateColorMap(){const e=$o.getColorMap();if(!e){this._colors=[gh.Empty],this._backgroundIsLight=!0;return}this._colors=[gh.Empty];for(let i=1;i<e.length;i++){const s=e[i].rgba;this._colors[i]=new gh(s.r,s.g,s.b,Math.round(s.a*255))}let t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}MF._INSTANCE=null;const zIt=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),KIt=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:95:n);class Gx{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Gx.soften(e,12/15),this.charDataLight=Gx.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;s<o;s++)i[s]=a3(e[s]*t);return i}renderChar(e,t,i,s,o,r,a,c,u,d,f){const g=1*this.scale,p=2*this.scale,_=f?1:p;if(t+g>e.width||i+_>e.height){console.warn("bad render request outside image data");return}const v=d?this.charDataLight:this.charDataNormal,C=KIt(s,u),y=e.width*4,w=a.r,I=a.g,L=a.b,O=o.r-w,A=o.g-I,N=o.b-L,D=Math.max(r,c),P=e.data;let F=C*g*p,V=i*y+t*4;for(let U=0;U<_;U++){let Q=V;for(let de=0;de<g;de++){const q=v[F++]/255*(r/255);P[Q++]=w+O*q,P[Q++]=I+A*q,P[Q++]=L+N*q,P[Q++]=D}V+=y}}blockRenderChar(e,t,i,s,o,r,a,c){const u=1*this.scale,d=2*this.scale,f=c?1:d;if(t+u>e.width||i+f>e.height){console.warn("bad render request outside image data");return}const g=e.width*4,p=.5*(o/255),_=r.r,v=r.g,C=r.b,y=s.r-_,w=s.g-v,I=s.b-C,L=_+y*p,O=v+w*p,A=C+I*p,N=Math.max(o,a),D=e.data;let P=i*g+t*4;for(let F=0;F<f;F++){let V=P;for(let U=0;U<u;U++)D[V++]=L,D[V++]=O,D[V++]=A,D[V++]=N;P+=g}}}const sge={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},oge=n=>{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t<n.length;t+=2)e[t>>1]=sge[n[t]]<<4|sge[n[t+1]]&15;return e},rge={1:ub(()=>oge("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:ub(()=>oge("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class c${static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return rge[e]?i=new Gx(rge[e](),e):i=c$.createFromSampleData(c$.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let s=0;for(const o of zIt)i.fillText(String.fromCharCode(o),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");let s=c$._downsample(e,t);return new Gx(s,t)}static _downsampleChar(e,t,i,s,o){const r=1*o,a=2*o;let c=s,u=0;for(let d=0;d<a;d++){const f=d/a*16,g=(d+1)/a*16;for(let p=0;p<r;p++){const _=p/r*10,v=(p+1)/r*10;let C=0,y=0;for(let I=f;I<g;I++){const L=t+Math.floor(I)*3840,O=1-(I-Math.floor(I));for(let A=_;A<v;A++){const N=1-(A-Math.floor(A)),D=L+Math.floor(A)*4,P=N*O;y+=P,C+=e[D]*e[D+3]/255*P}}const w=C/y;u=Math.max(u,w),i[c++]=a3(w)}}return u}static _downsample(e,t){const i=2*t*1*t,s=i*96,o=new Uint8ClampedArray(s);let r=0,a=0,c=0;for(let u=0;u<96;u++)c=Math.max(c,this._downsampleChar(e,a,o,r,t)),r+=i,a+=10*4;if(c>0){const u=255/c;for(let d=0;d<s;d++)o[d]*=u}return o}}const jIt=140,XIt=2;class zx{constructor(e,t,i){const s=e.options,o=s.get(127),r=s.get(129),a=r.minimap,c=s.get(43),u=s.get(64);this.renderMinimap=a.renderMinimap,this.size=u.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=s.get(93),this.showSlider=u.showSlider,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=c.typicalHalfwidthCharacterWidth,this.lineHeight=s.get(58),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=r.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=ub(()=>c$.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=zx._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=zx._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(V0t);return i?new gh(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(U0t);return t?gh._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class u${constructor(e,t,i,s,o,r,a,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.startLineNumber=a,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,s,o,r,a,c,u,d,f){const g=e.pixelRatio,p=e.minimapLineHeight,_=Math.floor(e.canvasInnerHeight/p),v=e.lineHeight;if(e.minimapHeightIsEditorHeight){const O=c*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),A=Math.max(1,Math.floor(o*o/O)),N=Math.max(0,e.minimapHeight-A),D=N/(d-o),P=u*D,F=N>0,V=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new u$(u,d,F,D,P,A,1,Math.min(a,V))}let C;if(r&&i!==a){const O=i-t+1;C=Math.floor(O*p/g)}else{const O=o/v;C=Math.floor(O*p/g)}let y;e.scrollBeyondLastLine?y=(a-1)*p/g:y=Math.max(0,a*p/g-C),y=Math.min(e.minimapHeight-C,y);const w=y/(d-o),I=u*w;let L=0;if(e.scrollBeyondLastLine&&(L=o/v-1),_>=a+L){const A=a,N=y>0;return new u$(u,d,N,w,I,C,1,A)}else{let O=Math.max(1,Math.floor(t-I*g/p));f&&f.scrollHeight===d&&(f.scrollTop>u&&(O=Math.min(O,f.startLineNumber)),f.scrollTop<u&&(O=Math.max(O,f.startLineNumber)));const A=Math.min(a,O+_-1),N=(u-s)/v,D=(t-O+N)*p/g;return new u$(u,d,!0,w,D,C,O,A)}}}class F3{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}F3.INVALID=new F3(-1);class lge{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new dOe(()=>F3.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s<o;s++)if(i[s].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class Gie{constructor(e,t,i,s){this._backgroundFillData=Gie._createBackgroundFillData(t,i,s),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const s=i.r,o=i.g,r=i.b,a=i.a,c=new Uint8ClampedArray(e*t*4);let u=0;for(let d=0;d<t;d++)for(let f=0;f<e;f++)c[u]=s,c[u+1]=o,c[u+2]=r,c[u+3]=a,u+=4;return c}}class Kx{constructor(e,t){this.samplingRatio=e,this.minimapLines=t}static compute(e,t,i){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const s=e.pixelRatio,o=e.lineHeight,r=e.scrollBeyondLastLine,{minimapLineCount:a}=gO.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:r,height:e.editorHeight,lineHeight:o,pixelRatio:s}),c=t/a,u=c/2;if(!i||i.minimapLines.length===0){let I=[];if(I[0]=1,a>1){for(let L=0,O=a-1;L<O;L++)I[L]=Math.round(L*c+u);I[a-1]=t}return[new Kx(c,I),[]]}const d=i.minimapLines,f=d.length;let g=[],p=0,_=0,v=1;const C=10;let y=[],w=null;for(let I=0;I<a;I++){const L=Math.max(v,Math.round(I*c)),O=Math.max(L,Math.round((I+1)*c));for(;p<f&&d[p]<L;){if(y.length<C){const N=p+1+_;w&&w.type==="deleted"&&w._oldIndex===p-1?w.deleteToLineNumber++:(w={type:"deleted",_oldIndex:p,deleteFromLineNumber:N,deleteToLineNumber:N},y.push(w)),_--}p++}let A;if(p<f&&d[p]<=O)A=d[p],p++;else if(I===0?A=1:I+1===a?A=t:A=Math.round(I*c+u),y.length<C){const N=p+1+_;w&&w.type==="inserted"&&w._i===I-1?w.insertToLineNumber++:(w={type:"inserted",_i:I,insertFromLineNumber:N,insertToLineNumber:N},y.push(w)),_++}g[I]=A,v=A}if(y.length<C)for(;p<f;){const I=p+1+_;w&&w.type==="deleted"&&w._oldIndex===p-1?w.deleteToLineNumber++:(w={type:"deleted",_oldIndex:p,deleteFromLineNumber:I,deleteToLineNumber:I},y.push(w)),_--,p++}else y=[{type:"flush"}];return[new Kx(c,g),y]}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1<this.minimapLines.length&&this.minimapLines[s+1]<=t;)s++;if(i===s){const o=this.minimapLines[i];if(o<e||o>t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),s=Math.max(s,o)):this.minimapLines[o]-=t;return[i,s]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class YIt extends Rh{constructor(e){super(e),this.tokensColorTracker=MF.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new zx(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=Kx.compute(this.options,this._context.model.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new B3(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new zx(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return e.affectsMinimap?this._actual.onDecorationsChanged():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.toLineNumber);return t?this._actual.onLinesChanged(t[0],t[1]):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i+1),this._shouldCheckSampling=!0,!0}else return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._context.model.invalidateMinimapColorCache(),this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){let t=[];for(const i of e.ranges){const s=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);s&&t.push({fromLineNumber:s[0],toLineNumber:s[1]})}return t.length?this._actual.onTokensChanged(t):!1}else return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const s={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Kx.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.model.getLineCount()}getRealLineCount(){return this._context.model.getLineCount()}getLineContent(e){return this._samplingState?this._context.model.getLineContent(this._samplingState.minimapLines[e-1]):this._context.model.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.model.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.model.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let s=[];for(let o=0,r=t-e+1;o<r;o++)i[o]?s[o]=this._context.model.getViewLineData(this._samplingState.minimapLines[e+o-1]):s[o]=null;return s}return this._context.model.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new fn(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const o=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new be(o,1,r,this._context.model.getLineMaxColumn(r))}else i=new be(e,1,t,this._context.model.getLineMaxColumn(t));const s=this._context.model.getDecorationsInViewport(i);if(this._samplingState){let o=[];for(const r of s){if(!r.options.minimap)continue;const a=r.range,c=this._samplingState.modelLineToMinimapLine(a.startLineNumber),u=this._samplingState.modelLineToMinimapLine(a.endLineNumber);o.push(new GLe(new be(c,a.startColumn,u,a.endColumn),r.options))}return o}return s}getOptions(){return this._context.model.getTextModelOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.model.revealRange("mouse",!1,new be(e,1,e,1),1,0)}setScrollTop(e){this._context.model.setScrollPosition({scrollTop:e},1)}}class B3 extends wt{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Hfe),this._domNode=qi(document.createElement("div")),Zm.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=qi(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=qi(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=qi(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=qi(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=qi(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._mouseDownListener=Br(this._domNode.domNode,"mousedown",i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.leftButton&&this._lastRenderData){const u=Bl(this._slider.domNode),d=u.top+u.height/2;this._startSliderDragging(i.buttons,i.posx,d,i.posy,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.browserEvent.offsetY;let c=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderMouseMoveMonitor=new Ww,this._sliderMouseDownListener=Br(this._slider.domNode,"mousedown",i=>{i.preventDefault(),i.stopPropagation(),i.leftButton&&this._lastRenderData&&this._startSliderDragging(i.buttons,i.posx,i.posy,i.posy,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ds.addTarget(this._domNode.domNode),this._sliderTouchStartListener=Pt(this._domNode.domNode,so.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=Pt(this._domNode.domNode,so.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Br(this._domNode.domNode,so.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i,s,o){this._slider.toggleClassName("active",!0);const r=(a,c)=>{const u=Math.abs(c-t);if(zl&&u>jIt){this._model.setScrollTop(o.scrollTop);return}const d=a-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(d))};s!==i&&r(s,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,_M,a=>r(a.posy,a.posx),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return this._model.options.showSlider==="always"?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new Gie(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Hfe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=u$.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(be.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((g,p)=>(g.options.zIndex||0)-(p.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,c=this._model.getOptions().tabSize,u=this._decorationsCanvas.domNode.getContext("2d");u.clearRect(0,0,s,o);const d=new age(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(u,t,d,e,r),this._renderDecorationsLineHighlights(u,i,d,e,r);const f=new age(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(u,t,f,e,r,c,a,s),this._renderDecorationsHighlights(u,i,f,e,r,c,a,s)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const c of t){const u=Math.max(s.startLineNumber,c.startLineNumber),d=Math.min(s.endLineNumber,c.endLineNumber);if(u>d)continue;for(let p=u;p<=d;p++)i.set(p,!0);const f=(u-s.startLineNumber)*o,g=(d-s.startLineNumber)*o+o;a>=f||(a>r&&e.fillRect(jT,r,e.canvas.width,a-r),r=f),a=g}a>r&&e.fillRect(jT,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],u=c.options.minimap;if(!u||u.position!==vh.Inline)continue;const d=Math.max(s.startLineNumber,c.range.startLineNumber),f=Math.min(s.endLineNumber,c.range.endLineNumber);if(d>f)continue;const g=u.getColor(this._theme);if(!g||g.isTransparent())continue;let p=r.get(g.toString());p||(p=g.transparent(.5).toString(),r.set(g.toString(),p)),e.fillStyle=p;for(let _=d;_<=f;_++){if(i.has(_))continue;i.set(_,!0);const v=(d-s.startLineNumber)*o;e.fillRect(jT,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const u of t){const d=Math.max(s.startLineNumber,u.startLineNumber),f=Math.min(s.endLineNumber,u.endLineNumber);if(!(d>f))for(let g=d;g<=f;g++)this.renderDecorationOnLine(e,i,u,this._selectionColor,s,g,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,c){for(const u of t){const d=u.options.minimap;if(!d)continue;const f=Math.max(s.startLineNumber,u.range.startLineNumber),g=Math.min(s.endLineNumber,u.range.endLineNumber);if(f>g)continue;const p=d.getColor(this._theme);if(!(!p||p.isTransparent()))for(let _=f;_<=g;_++)switch(d.position){case vh.Inline:this.renderDecorationOnLine(e,i,u.range,p,s,_,o,o,r,a,c);continue;case vh.Gutter:const v=(_-s.startLineNumber)*o;this.renderDecoration(e,p,2,v,XIt,o);continue}}}renderDecorationOnLine(e,t,i,s,o,r,a,c,u,d,f){const g=(r-o.startLineNumber)*c;if(g+a<0||g>this._model.options.canvasInnerHeight)return;const{startLineNumber:p,endLineNumber:_}=i,v=p===r?i.startColumn:1,C=_===r?i.endColumn:this._model.getLineMaxColumn(r),y=this.getXOffsetForPosition(t,r,v,u,d,f),w=this.getXOffsetForPosition(t,r,C,u,d,f);this.renderDecoration(e,s,y,g,w-y,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return jT;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const u=this._model.getLineContent(t);c=[jT];let d=jT;for(let f=1;f<u.length+1;f++){const g=u.charCodeAt(f-1),p=g===9?s*o:Gg(g)?2*o:o,_=d+p;if(_>=r){c[f]=r;break}c[f]=_,d=_}e.set(t,c)}return i-1<c.length?c[i-1]:r}renderDecoration(e,t,i,s,o,r){e.fillStyle=t&&t.toString()||"",e.fillRect(i,s,o,r)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,s=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const q=this._lastRenderData._get();return new lge(e,q.imageData,q.lines)}const o=this._getBuffer();if(!o)return null;let[r,a,c]=B3._renderUntouchedLines(o,t,i,s,this._lastRenderData);const u=this._model.getMinimapLinesRenderingData(t,i,c),d=this._model.getOptions().tabSize,f=this._model.options.defaultBackgroundColor,g=this._model.options.backgroundColor,p=this._model.options.foregroundAlpha,_=this._model.tokensColorTracker,v=_.backgroundIsLight(),C=this._model.options.renderMinimap,y=this._model.options.charRenderer(),w=this._model.options.fontScale,I=this._model.options.minimapCharWidth,O=(C===1?2:3)*w,A=s>O?Math.floor((s-O)/2):0,N=g.a/255,D=new gh(Math.round((g.r-f.r)*N+f.r),Math.round((g.g-f.g)*N+f.g),Math.round((g.b-f.b)*N+f.b),255);let P=0;const F=[];for(let q=0,K=i-t+1;q<K;q++)c[q]&&B3._renderLine(o,D,g.a,v,C,I,_,p,y,P,A,d,u[q],w,s),F[q]=new F3(P),P+=s;const V=r===-1?0:r,Q=(a===-1?o.height:a)-V;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,V,o.width,Q),new lge(e,o,F)}static _renderUntouchedLines(e,t,i,s,o){const r=[];if(!o){for(let D=0,P=i-t+1;D<P;D++)r[D]=!0;return[-1,-1,r]}const a=o._get(),c=a.imageData.data,u=a.rendLineNumberStart,d=a.lines,f=d.length,g=e.width,p=e.data,_=(i-t+1)*s*g*4;let v=-1,C=-1,y=-1,w=-1,I=-1,L=-1,O=0;for(let D=t;D<=i;D++){const P=D-t,F=D-u,V=F>=0&&F<f?d[F].dy:-1;if(V===-1){r[P]=!0,O+=s;continue}const U=V*g*4,Q=(V+s)*g*4,de=O*g*4,q=(O+s)*g*4;w===U&&L===de?(w=Q,L=q):(y!==-1&&(p.set(c.subarray(y,w),I),v===-1&&y===0&&y===I&&(v=w),C===-1&&w===_&&y===I&&(C=y)),y=U,w=Q,I=de,L=q),r[P]=!1,O+=s}y!==-1&&(p.set(c.subarray(y,w),I),v===-1&&y===0&&y===I&&(v=w),C===-1&&w===_&&y===I&&(C=y));const A=v===-1?-1:v/(g*4),N=C===-1?-1:C/(g*4);return[A,N,r]}static _renderLine(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v){const C=p.content,y=p.tokens,w=e.width-r,I=v===1;let L=jT,O=0,A=0;for(let N=0,D=y.getCount();N<D;N++){const P=y.getEndOffset(N),F=y.getForeground(N),V=a.getColor(F);for(;O<P;O++){if(L>w)return;const U=C.charCodeAt(O);if(U===9){const Q=g-(O+A)%g;A+=Q-1,L+=Q*r}else if(U===32)L+=r;else{const Q=Gg(U)?2:1;for(let de=0;de<Q;de++)if(o===2?u.blockRenderChar(e,L,d+f,V,c,t,i,I):u.renderChar(e,L,d+f,U,V,c,t,i,_,s,I),L+=r,L>w)return}}}}}class age{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;s<o;s++)this._values[s]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}ws((n,e)=>{const t=n.getColor(W0t);t&&e.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${t}; }`);const i=n.getColor(G0t);i&&e.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${i}; }`);const s=n.getColor(z0t);s&&e.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${s}; }`);const o=n.getColor(OF);o&&e.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${o} -6px 0 6px -6px inset; }`)});class qIt extends Rh{constructor(e){super(e);const i=this._context.configuration.options.get(129);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=qi(document.createElement("div")),Zm.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=qi(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?!1:(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.parentNode.removeChild(s),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(e.preference===null){t.unsetTop();return}if(e.preference===0)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(e.preference===1){const i=t.domNode.clientHeight;t.setTop(this._editorHeight-i-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else e.preference===2&&(t.setTop(0),t.domNode.style.right="50%")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,s=t.length;i<s;i++){const o=t[i];this._renderWidget(this._widgets[o])}}}class JIt{constructor(e,t){const i=e.options;this.lineHeight=i.get(58),this.pixelRatio=i.get(127),this.overviewRulerLanes=i.get(73),this.renderBorder=i.get(72);const s=t.getColor(lwt);this.borderColor=s?s.toString():null,this.hideCursor=i.get(51);const o=t.getColor(Y1e);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const r=i.get(64),a=r.enabled,c=r.side,u=a?t.getColor(awt)||$o.getDefaultBackground():null;u===null||c==="left"?this.backgroundColor=null:this.backgroundColor=mt.Format.CSS.formatHex(u);const f=i.get(129).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[g,p]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=p}_initLanes(e,t,i){const s=t-e;if(i>=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,c=e,u=c+o,d=c+o+a;return[[0,c,u,c,d,c,u,c],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,c=a+o;return[[0,a,a,a,c,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class QIt extends Rh{constructor(e){super(e),this._domNode=qi(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=$o.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new JIt(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(ct.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._context.model.invalidateOverviewRulerColorCache(),this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(this._settings.backgroundColor?this._settings.backgroundColor:"");return}const e=this._settings.canvasWidth,t=this._settings.canvasHeight,i=this._settings.lineHeight,s=this._context.viewLayout,o=this._context.viewLayout.getScrollHeight(),r=t/o,a=this._context.model.getAllOverviewRulerDecorations(this._context.theme),c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");this._settings.backgroundColor===null?d.clearRect(0,0,e,t):(d.fillStyle=this._settings.backgroundColor,d.fillRect(0,0,e,t));const f=this._settings.x,g=this._settings.w;a.sort(zLe.cmp);for(const p of a){const _=p.color,v=p.data;d.fillStyle=_;let C=0,y=0,w=0;for(let I=0,L=v.length/3;I<L;I++){const O=v[3*I],A=v[3*I+1],N=v[3*I+2];let D=s.getVerticalOffsetForLineNumber(A)*r|0,P=(s.getVerticalOffsetForLineNumber(N)+i)*r|0;if(P-D<c){let V=(D+P)/2|0;V<u?V=u:V+u>t&&(V=t-u),D=V-u,P=V+u}D>w+1||O!==C?(I!==0&&d.fillRect(f[C],y,g[C],w-y),C=O,y=D,w=P):P>w&&(w=P)}d.fillRect(f[C],y,g[C],w-y)}if(!this._settings.hideCursor&&this._settings.cursorColor){const p=2*this._settings.pixelRatio|0,_=p/2|0,v=this._settings.x[7],C=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let y=-100,w=-100;for(let I=0,L=this._cursorPositions.length;I<L;I++){const O=this._cursorPositions[I];let A=s.getVerticalOffsetForLineNumber(O.lineNumber)*r|0;A<_?A=_:A+_>t&&(A=t-_);const N=A-_,D=N+p;N>w+1?(I!==0&&d.fillRect(v,y,C,w-y),y=N,w=D):D>w&&(w=D)}d.fillRect(v,y,C,w-y)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,t),d.stroke(),d.moveTo(0,0),d.lineTo(e,0),d.stroke())}}class cge{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class jx{constructor(e,t,i){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class ZIt{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(jx.compare)}setLineHeight(e){return this._lineHeight===e?!1:(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth===e?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),s=Math.floor(this._outerHeight),o=i/s,r=Math.floor(4*this._pixelRatio/2);let a=[];for(let c=0,u=this._zones.length;c<u;c++){const d=this._zones[c];if(!e){const w=d.getColorZones();if(w){a.push(w);continue}}const f=Math.floor(o*this._getVerticalOffsetForLine(d.startLineNumber)),g=Math.floor(o*(this._getVerticalOffsetForLine(d.endLineNumber)+t));let p=Math.floor((f+g)/2),_=g-p;_<r&&(_=r),p-_<0&&(p=_),p+_>i&&(p=i-_);const v=d.color;let C=this._color2Id[v];C||(C=++this._lastAssignedId,this._color2Id[v]=C,this._id2Color[C]=v);const y=new cge(p-_,p+_,C);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(cge.compare),a}}class eLt extends SF{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=qi(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new ZIt(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(58)),this._zoneManager.setPixelRatio(i.get(127)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(58)&&(this._zoneManager.setLineHeight(t.get(58)),this._render()),e.hasChanged(127)&&(this._zoneManager.setPixelRatio(t.get(127)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const c of t){const u=c.colorId,d=c.from,f=c.to;u!==o?(e.fillRect(0,r,s,a-r),o=u,e.fillStyle=i[o],r=d,a=f):a>=d?a=Math.max(a,f):(e.fillRect(0,r,s,a-r),r=d,a=f)}e.fillRect(0,r,s,a-r)}}class tLt extends Rh{constructor(e){super(e),this.domNode=qi(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:s}=this._context.model.getTextModelOptions(),o=s;let r=t-e;for(;r>0;){const a=qi(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const s=this._renderedRulers[t],o=this._rulers[t];s.setBoxShadow(o.color?`1px 0 0 0 ${o.color} inset`:""),s.setHeight(Math.min(e.scrollHeight,1e6)),s.setLeft(o.column*this._typicalHalfwidthCharacterWidth)}}}ws((n,e)=>{const t=n.getColor(swt);t&&e.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${t} inset; }`)});class nLt extends Rh{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(91);this._useShadows=i.useShadows,this._domNode=qi(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(129);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(91);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}ws((n,e)=>{const t=n.getColor(OF);t&&e.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${t} 0 6px 6px -6px inset; }`)});class iLt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class sLt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function oLt(n){return new iLt(n)}function rLt(n){return new sLt(n.lineNumber,n.ranges.map(oLt))}class Uo extends vM{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let u=0;!o&&u<i.length;u++)i[u].lineNumber===a&&(o=i[u].ranges[0]);const c=t[t.length-1].lineNumber;if(c===e.endLineNumber)for(let u=i.length-1;!r&&u>=0;u--)i[u].lineNumber===c&&(r=i[u].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,c=t.length;a<c;a++){const u=t[a].ranges[0],d=u.left,f=u.left+u.width,g={top:0,bottom:0},p={top:0,bottom:0};if(a>0){const _=t[a-1].ranges[0].left,v=t[a-1].ranges[0].left+t[a-1].ranges[0].width;lV(d-_)<s?g.top=2:d>_&&(g.top=1),lV(f-v)<s?p.top=2:_<f&&f<v&&(p.top=1)}else o&&(g.top=o.startStyle.top,p.top=o.endStyle.top);if(a+1<c){const _=t[a+1].ranges[0].left,v=t[a+1].ranges[0].left+t[a+1].ranges[0].width;lV(d-_)<s?g.bottom=2:_<d&&d<v&&(g.bottom=1),lV(f-v)<s?p.bottom=2:f<v&&(p.bottom=1)}else r&&(g.bottom=r.startStyle.bottom,p.bottom=r.endStyle.bottom);u.startStyle=g,u.endStyle=p}}_getVisibleRangesWithStyle(e,t,i){const o=(t.linesVisibleRangesForRange(e,!0)||[]).map(rLt);return!this._visibleRangesHaveGaps(o)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,o,i),o}_createSelectionPiece(e,t,i,s,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+s.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),c=s[0].lineNumber,u=s[s.length-1].lineNumber;for(let d=0,f=s.length;d<f;d++){const g=s[d],p=g.lineNumber,_=p-t,v=i&&(p===u||p===c)?a:r,C=i&&p===c?1:0;let y="",w="";for(let I=0,L=g.ranges.length;I<L;I++){const O=g.ranges[I];if(o){const N=O.startStyle,D=O.endStyle;if(N.top===1||N.bottom===1){y+=this._createSelectionPiece(C,v,Uo.SELECTION_CLASS_NAME,O.left-Uo.ROUNDED_PIECE_WIDTH,Uo.ROUNDED_PIECE_WIDTH);let P=Uo.EDITOR_BACKGROUND_CLASS_NAME;N.top===1&&(P+=" "+Uo.SELECTION_TOP_RIGHT),N.bottom===1&&(P+=" "+Uo.SELECTION_BOTTOM_RIGHT),y+=this._createSelectionPiece(C,v,P,O.left-Uo.ROUNDED_PIECE_WIDTH,Uo.ROUNDED_PIECE_WIDTH)}if(D.top===1||D.bottom===1){y+=this._createSelectionPiece(C,v,Uo.SELECTION_CLASS_NAME,O.left+O.width,Uo.ROUNDED_PIECE_WIDTH);let P=Uo.EDITOR_BACKGROUND_CLASS_NAME;D.top===1&&(P+=" "+Uo.SELECTION_TOP_LEFT),D.bottom===1&&(P+=" "+Uo.SELECTION_BOTTOM_LEFT),y+=this._createSelectionPiece(C,v,P,O.left+O.width,Uo.ROUNDED_PIECE_WIDTH)}}let A=Uo.SELECTION_CLASS_NAME;if(o){const N=O.startStyle,D=O.endStyle;N.top===0&&(A+=" "+Uo.SELECTION_TOP_LEFT),N.bottom===0&&(A+=" "+Uo.SELECTION_BOTTOM_LEFT),D.top===0&&(A+=" "+Uo.SELECTION_TOP_RIGHT),D.bottom===0&&(A+=" "+Uo.SELECTION_BOTTOM_RIGHT)}w+=this._createSelectionPiece(C,v,A,O.left,O.width)}e[_][0]+=y,e[_][1]+=w}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=i;r<=s;r++){const a=r-i;t[a]=["",""]}const o=[];for(let r=0,a=this._selections.length;r<a;r++){const c=this._selections[r];if(c.isEmpty()){o[r]=null;continue}const u=this._getVisibleRangesWithStyle(c,e,this._previousFrameVisibleRangesWithStyle[r]);o[r]=u,this._actualRenderOneSelection(t,i,this._selections.length>1,u)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Uo.SELECTION_CLASS_NAME="selected-text";Uo.SELECTION_TOP_LEFT="top-left-radius";Uo.SELECTION_BOTTOM_LEFT="bottom-left-radius";Uo.SELECTION_TOP_RIGHT="top-right-radius";Uo.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Uo.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Uo.ROUNDED_PIECE_WIDTH=10;ws((n,e)=>{const t=n.getColor(FC);t&&e.addRule(`.monaco-editor .focused .selected-text { background-color: ${t}; }`);const i=n.getColor(Mie);i&&e.addRule(`.monaco-editor .selected-text { background-color: ${i}; }`);const s=n.getColor(KSt);s&&!s.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${s}; }`)});function lV(n){return n<0?-n:n}class uge{constructor(e,t,i,s,o,r){this.top=e,this.left=t,this.width=i,this.height=s,this.textContent=o,this.textContentClassName=r}}class dge{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(43);this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=qi(document.createElement("div")),this._domNode.setClassName(`cursor ${E0}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Ea.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new ct(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(43);return this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),Ea.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===Cl.Line||this._cursorStyle===Cl.LineThin){const g=e.visibleRangeForPosition(this._position);if(!g||g.outsideRenderedLine)return null;let p;if(this._cursorStyle===Cl.Line){if(p=She(this._lineCursorWidth>0?this._lineCursorWidth:2),p>2){const C=this._context.model.getLineContent(this._position.lineNumber),y=jW(C,this._position.column-1);t=C.substr(this._position.column-1,y)}}else p=She(1);let _=g.left;p>=2&&_>=1&&(_-=1);const v=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new uge(v,_,p,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),s=jW(i,this._position.column-1),o=e.linesVisibleRangesForRange(new be(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+s),!1);if(!o||o.length===0)return null;const r=o[0];if(r.outsideRenderedLine||r.ranges.length===0)return null;const a=r.ranges[0],c=a.width<1?this._typicalHalfwidthCharacterWidth:a.width;let u="";if(this._cursorStyle===Cl.Block){const g=this._context.model.getViewLineData(this._position.lineNumber);t=i.substr(this._position.column-1,s);const p=g.tokens.findTokenIndexAtOffset(this._position.column-1);u=g.tokens.getClassName(p)}let d=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,f=this._lineHeight;return(this._cursorStyle===Cl.Underline||this._cursorStyle===Cl.UnderlineThin)&&(d+=this._lineHeight-2,f=2),new uge(d,a.left,c,f,t,u)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${E0} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class Xx extends Rh{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new dge(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=qi(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new mc,this._cursorFlatBlinkInterval=new vF,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;i<s;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t){if(this._primaryCursor.onCursorPositionChanged(e),this._updateBlinking(),this._secondaryCursors.length<t.length){const i=t.length-this._secondaryCursors.length;for(let s=0;s<i;s++){const o=new dge(this._context);this._domNode.domNode.insertBefore(o.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(o)}}else if(this._secondaryCursors.length>t.length){const i=this._secondaryCursors.length-t.length;for(let s=0;s<i;s++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let i=0;i<t.length;i++)this._secondaryCursors[i].onCursorPositionChanged(t[i])}onCursorStateChanged(e){const t=[];for(let s=0,o=e.selections.length;s<o;s++)t[s]=e.selections[s].getPosition();this._onCursorPositionChanged(t[0],t.slice(1));const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=i=>{for(let s=0,o=e.ranges.length;s<o;s++)if(e.ranges[s].fromLineNumber<=i.lineNumber&&i.lineNumber<=e.ranges[s].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const i of this._secondaryCursors)if(t(i.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=e===0,i=e===5;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!t&&!i&&(e===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},Xx.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Xx.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Cl.Line:e+=" cursor-line-style";break;case Cl.Block:e+=" cursor-block-style";break;case Cl.Underline:e+=" cursor-underline-style";break;case Cl.LineThin:e+=" cursor-line-thin-style";break;case Cl.BlockOutline:e+=" cursor-block-outline-style";break;case Cl.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],i=0;const s=this._primaryCursor.render(e);s&&(t[i++]=s);for(let o=0,r=this._secondaryCursors.length;o<r;o++){const a=this._secondaryCursors[o].render(e);a&&(t[i++]=a)}this._renderData=t}getLastRenderData(){return this._renderData}}Xx.BLINK_INTERVAL=500;ws((n,e)=>{const t=n.getColor(Y1e);if(t){let i=n.getColor(nwt);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),n.type==="hc"&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const v7=()=>{throw new Error("Invalid change accessor")};class lLt extends Rh{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=qi(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=qi(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.model.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r<a;r++){const c=o[r],u=this._zones[c],d=this._computeWhitespaceProps(u.delegate);u.isInHiddenArea=d.isInHiddenArea;const f=t.get(c);f&&(f.afterLineNumber!==d.afterViewLineNumber||f.height!==d.heightInPx)&&(s.changeOneWhitespace(c,d.afterViewLineNumber,d.heightInPx),this._safeCallOnComputedHeight(u.delegate,d.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(58)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return typeof e.afterColumn<"u"?e.afterColumn:1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(typeof e.afterColumn<"u")t=this._context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const r=this._context.model.validateModelPosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new ct(r,this._context.model.getModelLineMaxColumn(r))}let i;t.column===this._context.model.getModelLineMaxColumn(t.lineNumber)?i=this._context.model.validateModelPosition({lineNumber:t.lineNumber+1,column:1}):i=this._context.model.validateModelPosition({lineNumber:t.lineNumber,column:t.column+1});const s=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(t),o=this._context.model.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:s.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.model.changeWhitespace(i=>{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};aLt(e,s),s.addZone=v7,s.removeZone=v7,s.layoutZone=v7}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:qi(t.domNode),marginDomNode:t.marginDomNode?qi(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){di(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){di(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;r<a;r++){const c=o[r],u=this._zones[c];let d=0,f=0,g="none";i.hasOwnProperty(c)?(d=i[c].verticalOffset-e.bigNumbersDelta,f=i[c].height,g="block",u.isVisible||(u.domNode.setAttribute("monaco-visible-view-zone","true"),u.isVisible=!0),this._safeCallOnDomNodeTop(u.delegate,e.getScrolledTopFromAbsoluteTop(i[c].verticalOffset))):(u.isVisible&&(u.domNode.removeAttribute("monaco-visible-view-zone"),u.isVisible=!1),this._safeCallOnDomNodeTop(u.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),u.domNode.setTop(d),u.domNode.setHeight(f),u.domNode.setDisplay(g),u.marginDomNode&&(u.marginDomNode.setTop(d),u.marginDomNode.setHeight(f),u.marginDomNode.setDisplay(g))}s&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function aLt(n,e){try{return n(e)}catch(t){di(t)}}class cLt{constructor(e){this._theme=e}get type(){return this._theme.type}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class uLt{constructor(e,t,i){this.configuration=e,this.theme=new cLt(t),this.model=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.model.addViewEventHandler(e)}removeEventHandler(e){this.model.removeViewEventHandler(e)}}class dLt{constructor(e,t,i,s){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=i,this._model=s,this.visibleRange=new be(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class hLt extends SF{constructor(e,t,i,s,o,r){super(),this._selections=[new fn(1,1,1,1)],this._renderAnimationFrame=null;const a=new dIt(t,s,o,e);this._context=new uLt(t,i.getColorTheme(),s),this._configPixelRatio=this._context.configuration.options.get(127),this._context.addEventHandler(this),this._register(i.onDidColorThemeChange(v=>{this._context.theme.update(v),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new sIt(this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=qi(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=qi(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=qi(document.createElement("div")),Zm.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new PIt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new O6(this._context,this._linesContent),this._viewZones=new lLt(this._context),this._viewParts.push(this._viewZones);const c=new QIt(this._context);this._viewParts.push(c);const u=new nLt(this._context);this._viewParts.push(u);const d=new gIt(this._context);this._viewParts.push(d),d.addDynamicOverlay(new vIt(this._context)),d.addDynamicOverlay(new Uo(this._context)),d.addDynamicOverlay(new BIt(this._context)),d.addDynamicOverlay(new TIt(this._context));const f=new pIt(this._context);this._viewParts.push(f),f.addDynamicOverlay(new bIt(this._context)),f.addDynamicOverlay(new FIt(this._context)),f.addDynamicOverlay(new GIt(this._context)),f.addDynamicOverlay(new WIt(this._context)),f.addDynamicOverlay(new ER(this._context));const g=new iw(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(f.getDomNode()),this._viewParts.push(g),this._contentWidgets=new mIt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Xx(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new qIt(this._context),this._viewParts.push(this._overlayWidgets);const p=new tLt(this._context);this._viewParts.push(p);const _=new YIt(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new iIt(this._context,a,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new zwt(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ct(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ct(e,t)))}}_applyLayout(){const t=this._context.configuration.options.get(129);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(126)+" "+I3(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(127),this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=jIe(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){fLt(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!wne(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.model.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new dLt(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.model);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new rEt(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(s);for(const o of e)o.render(s),o.onDidRender();Math.abs(VW()-this._configPixelRatio)>.001&&this._context.configuration.updatePixelRatio()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.model.setScrollPosition({scrollTop:e.scrollTop},1),this._context.model.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const i=this._context.model.validateModelPosition({lineNumber:e,column:t}),s=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new ct(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?I6.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new eLt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){let t=e.position&&e.position.range||null;if(t===null){const s=e.position?e.position.position:null;s!==null&&(t=new be(s.lineNumber,s.column,s.lineNumber,s.column))}const i=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,i),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function fLt(n){try{return n()}catch(e){di(e)}}class H3{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Tl(new be(1,1,1,1),0,new ct(1,1),0),new Tl(new be(1,1,1,1),0,new ct(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Ri(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.getDirection()===0?new fn(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new fn(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,r),c=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(c)?t:new Tl(be.fromPositions(a,c),t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=H3._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new Tl(s,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Tl(s,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Tl(s,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new ct(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ct(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new be(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Tl(r,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class hge{constructor(e){this.context=e,this.primaryCursor=new H3(e),this.secondaryCursors=[],this.lastAddedCursorIndex=0}dispose(){this.primaryCursor.dispose(this.context),this.killSecondaryCursors()}startTrackingSelections(){this.primaryCursor.startTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].startTrackingSelection(this.context)}stopTrackingSelections(){this.primaryCursor.stopTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){this.primaryCursor.ensureValidState(this.context);for(let e=0,t=this.secondaryCursors.length;e<t;e++)this.secondaryCursors[e].ensureValidState(this.context)}readSelectionFromMarkers(){let e=[];e[0]=this.primaryCursor.readSelectionFromMarkers(this.context);for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].readSelectionFromMarkers(this.context);return e}getAll(){let e=[];e[0]=this.primaryCursor.asCursorState();for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].asCursorState();return e}getViewPositions(){let e=[];e[0]=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].viewState.position;return e}getTopMostViewPosition(){let e=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++){const s=this.secondaryCursors[t].viewState.position;s.isBefore(e)&&(e=s)}return e}getBottomMostViewPosition(){let e=this.primaryCursor.viewState.position;for(let t=0,i=this.secondaryCursors.length;t<i;t++){const s=this.secondaryCursors[t].viewState.position;e.isBeforeOrEqual(s)&&(e=s)}return e}getSelections(){let e=[];e[0]=this.primaryCursor.modelState.selection;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].modelState.selection;return e}getViewSelections(){let e=[];e[0]=this.primaryCursor.viewState.selection;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t].viewState.selection;return e}setSelections(e){this.setStates(Ri.fromModelSelections(e))}getPrimaryCursor(){return this.primaryCursor.asCursorState()}setStates(e){e!==null&&(this.primaryCursor.setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.secondaryCursors.length,i=e.length;if(t<i){let s=i-t;for(let o=0;o<s;o++)this._addSecondaryCursor()}else if(t>i){let s=t-i;for(let o=0;o<s;o++)this._removeSecondaryCursor(this.secondaryCursors.length-1)}for(let s=0;s<i;s++)this.secondaryCursors[s].setState(this.context,e[s].modelState,e[s].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.secondaryCursors.push(new H3(this.context)),this.lastAddedCursorIndex=this.secondaryCursors.length}getLastAddedCursorIndex(){return this.secondaryCursors.length===0||this.lastAddedCursorIndex===0?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;t<i;t++)e[t+1]=this.secondaryCursors[t];return e}normalize(){if(this.secondaryCursors.length===0)return;let e=this._getAll(),t=[];for(let i=0,s=e.length;i<s;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort((i,s)=>i.selection.startLineNumber===s.selection.startLineNumber?i.selection.startColumn-s.selection.startColumn:i.selection.startLineNumber-s.selection.startLineNumber);for(let i=0;i<t.length-1;i++){const s=t[i],o=t[i+1],r=s.selection,a=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let c;if(a.isEmpty()||r.isEmpty()?c=a.getStartPosition().isBeforeOrEqual(r.getEndPosition()):c=a.getStartPosition().isBefore(r.getEndPosition()),c){const u=s.index<o.index?i:i+1,d=s.index<o.index?i+1:i,f=t[d].index,g=t[u].index,p=t[d].selection,_=t[u].selection;if(!p.equalsSelection(_)){const v=p.plusRange(_),C=p.selectionStartLineNumber===p.startLineNumber&&p.selectionStartColumn===p.startColumn,y=_.selectionStartLineNumber===_.startLineNumber&&_.selectionStartColumn===_.startColumn;let w;f===this.lastAddedCursorIndex?(w=C,this.lastAddedCursorIndex=g):w=y;let I;w?I=new fn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):I=new fn(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn),t[u].selection=I;const L=Ri.fromModelSelection(I);e[g].setState(this.context,L.modelState,L.viewState)}for(const v of t)v.index>f&&v.index--;e.splice(f,1),t.splice(d,1),this._removeSecondaryCursor(f-1),i--}}}}class gLt{constructor(){this.type=0}}class pLt{constructor(){this.type=1}}class mLt{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class _Lt{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class l1{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class aV{constructor(){this.type=5}}class vLt{constructor(e){this.type=6,this.isFocused=e}}class bLt{constructor(){this.type=7}}class cV{constructor(){this.type=8}}class _Oe{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class uJ{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class dJ{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class u4{constructor(e,t,i,s,o,r){this.type=12,this.source=e,this.range=t,this.selections=i,this.verticalType=s,this.revealHorizontal=o,this.scrollType=r}}class TLt{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class CLt{constructor(){this.type=14}}class yLt{constructor(e){this.type=15,this.ranges=e}}class ELt{constructor(){this.type=16}}let SLt=class{constructor(){this.type=17}};class wLt extends wt{constructor(){super(),this._onEvent=this._register(new rt),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++)if(this._outgoingEvents[t].kind===e.kind){this._outgoingEvents[t]=this._outgoingEvents[t].merge(e);return}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,this._collectorCnt===1&&(this._collector=new ILt),this._collector}endEmitViewEvents(){if(this._collectorCnt--,this._collectorCnt===0){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const i of e)this._addOutgoingEvent(i);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class ILt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class zie{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return e.kind!==0?this:new zie(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class Kie{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return e.kind!==1?this:new Kie(this.oldHasFocus,e.hasFocus)}}class jie{constructor(e,t,i,s,o,r,a,c){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=c,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}merge(e){return e.kind!==2?this:new jie(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class fge{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class V3{constructor(e,t,i,s,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o<i;o++)if(!e[o].equalsSelection(t[o]))return!1;return!0}isNoOp(){return V3._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}merge(e){return e.kind!==6?this:new V3(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class LLt{constructor(){this.kind=5}isNoOp(){return!1}merge(e){return this}}class b7{constructor(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getCursorStates()}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class gge{constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){let e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){let t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const s=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(s&&(t.push(s),s.startLineNumber!==s.endLineNumber))return!1}t.sort(be.compareRangesUsingStarts),e.sort(be.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class wR extends wt{constructor(e,t,i,s){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new Yfe(this._model,this._viewModel,this._coordinatesConverter,s),this._cursors=new hge(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Ji(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new Yfe(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,s){let o=!1;s!==null&&s.length>wR.MAX_CURSOR_COUNT&&(s=s.slice(0,wR.MAX_CURSOR_COUNT),o=!0);const r=new b7(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,s){const o=this._cursors.getViewPositions();if(o.length>1){this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,s);return}else{const r=o[0],a=new be(r.lineNumber,r.column,r.lineNumber,r.column);this._emitCursorRevealRange(e,t,a,null,0,i,s)}}_revealPrimaryCursor(e,t,i,s,o){const r=this._cursors.getViewPositions();if(r.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,s,o);else{const a=r[0],c=new be(a.lineNumber,a.column,a.lineNumber,a.column);this._emitCursorRevealRange(e,t,c,null,i,s,o)}}_emitCursorRevealRange(e,t,i,s,o,r,a){e.emitViewEvent(new u4(t,i,s,o,r,a))}saveState(){let e=[];const t=this._cursors.getSelections();for(let i=0,s=t.length;i<s;i++){const o=t[i];e.push({inSelectionMode:!o.isEmpty(),selectionStart:{lineNumber:o.selectionStartLineNumber,column:o.selectionStartColumn},position:{lineNumber:o.positionLineNumber,column:o.positionColumn}})}return e}restoreState(e,t){let i=[];for(let s=0,o=t.length;s<o;s++){const r=t[s];let a=1,c=1;r.position&&r.position.lineNumber&&(a=r.position.lineNumber),r.position&&r.position.column&&(c=r.position.column);let u=a,d=c;r.selectionStart&&r.selectionStart.lineNumber&&(u=r.selectionStart.lineNumber),r.selectionStart&&r.selectionStart.column&&(d=r.selectionStart.column),i.push({selectionStartLineNumber:u,selectionStartColumn:d,positionLineNumber:a,positionColumn:c})}this.setStates(e,"restoreState",0,Ri.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!0,1)}onModelContentChanged(e,t){if(t instanceof R1e){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{if(this._knownModelVersionId=t.versionId,this._isHandling)return;const i=t.containsEvent(1);if(this._prevEditOperationType=0,i)this._cursors.dispose(),this._cursors=new hge(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&t.resultingSelection&&t.resultingSelection.length>0){const s=Ri.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,s)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const s=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Ri.fromModelSelections(s))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:Vs.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:Vs.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,Ri.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],s=[];for(let a=0,c=e.length;a<c;a++)i.push({range:e[a],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),s.push({range:t[a],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),r=this._model.deltaDecorations([],s);this._autoClosedActions.push(new gge(this._model,o,r))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=OLt.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);let i=[],s=[];for(let o=0;o<e.commands.length;o++){const r=e.commands[o];r instanceof uOe&&r.enclosingRange&&r.closeCharacterRange&&(i.push(r.closeCharacterRange),s.push(r.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=new b7(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new _Lt(c,a)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((u,d)=>!u.modelState.equals(s.cursorState[d].modelState))){const u=s?s.cursorState.map(f=>f.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new V3(u,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,s=e.length;i<s;i++){const o=e[i];if(!o.text||o.text.indexOf(`
- `)>=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!c||c.length!==1)return null;const u=c[0].open,d=o.text.length-r[2].length-1,f=o.text.lastIndexOf(u,d-1);if(f===-1)return null;t.push([f,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);let r=[],a=[];const c=this._model.pushEditOperations(this.getSelections(),i,u=>{if(o)for(let f=0,g=o.length;f<g;f++){const[p,_]=o[f],v=u[f],C=v.range.startLineNumber,y=v.range.startColumn-1+p,w=v.range.startColumn-1+_;r.push(new be(C,w+1,C,w+2)),a.push(new be(C,y+1,C,w+2))}const d=s(u);return d&&(this._isHandling=!0),d});c&&(this._isHandling=!1,this.setSelections(e,t,c,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const o=new b7(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){di(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this._revealPrimaryCursor(t,i,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return gge.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{t==="keyboard"&&(this._executeEditOperation(yo.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let o=0;for(;o<s;){const r=jW(t,o),a=t.substr(o,r);this._executeEditOperation(yo.typeWithInterceptors(this._isDoingComposition,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=r}}else this._executeEditOperation(yo.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,s,o,r){if(t.length===0&&i===0&&s===0){if(o!==0){const a=this.getSelections().map(c=>{const u=c.getPosition();return new fn(u.lineNumber,u.column+o,u.lineNumber,u.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(yo.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(yo.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(sw.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new _u(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new _u(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}wR.MAX_CURSOR_COUNT=1e4;class OLt{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r<a;r++)s.model._setTrackedRange(s.trackedRanges[r],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(i.operations.length===0)return null;const s=i.operations,o=this._getLoserCursorMap(s);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;let r=[];for(let u=0,d=s.length;u<d;u++)o.hasOwnProperty(s[u].identifier.major.toString())||r.push(s[u]);i.hadTrackedEditOperation&&r.length>0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,u=>{let d=[];for(let p=0;p<e.selectionsBefore.length;p++)d[p]=[];for(const p of u)p.identifier&&d[p.identifier.major].push(p);const f=(p,_)=>p.identifier.minor-_.identifier.minor;let g=[];for(let p=0;p<e.selectionsBefore.length;p++)d[p].length>0?(d[p].sort(f),g[p]=t[p].computeCursorState(e.model,{getInverseEditOperations:()=>d[p],getTrackedSelection:_=>{const v=parseInt(_,10),C=e.model._getTrackedRange(e.trackedRanges[v]);return e.trackedRangesDirection[v]===0?new fn(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn):new fn(C.endLineNumber,C.endColumn,C.startLineNumber,C.startColumn)}})):g[p]=e.selectionsBefore[p];return g});a||(a=e.selectionsBefore);let c=[];for(let u in o)o.hasOwnProperty(u)&&c.push(parseInt(u,10));c.sort((u,d)=>d-u);for(const u of c)a.splice(u,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],s=!1;for(let o=0,r=t.length;o<r;o++){const a=t[o];if(a){const c=this._getEditOperationsFromCommand(e,o,a);i=i.concat(c.operations),s=s||c.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:s}}static _getEditOperationsFromCommand(e,t,i){let s=[],o=0;const r=(f,g,p=!1)=>{be.isEmpty(f)&&g===""||s.push({identifier:{major:t,minor:o++},range:f,text:g,forceMoveMarkers:p,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(f,g,p)=>{a=!0,r(f,g,p)},trackSelection:(f,g)=>{const p=fn.liftSelection(f);let _;if(p.isEmpty())if(typeof g=="boolean")g?_=2:_=3;else{const y=e.model.getLineMaxColumn(p.startLineNumber);p.startColumn===y?_=2:_=3}else _=1;const v=e.trackedRanges.length,C=e.model._setTrackedRange(null,p,_);return e.trackedRanges[v]=C,e.trackedRangesDirection[v]=p.getDirection(),v.toString()}};try{i.getEditOperations(e.model,d)}catch(f){return di(f),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-be.compareRangesUsingEnds(i.range,s.range));let t={};for(let i=1;i<e.length;i++){const s=e[i-1],o=e[i];if(be.getStartPosition(s.range).isBefore(be.getEndPosition(o.range))){let r;s.identifier.major>o.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a<e.length;a++)e[a].identifier.major===r&&(e.splice(a,1),a<i&&i--,a--);i>0&&i--}}return t}}class vOe{constructor(e,t,i,s,o,r){this.id=e,this.label=t,this.alias=i,this._precondition=s,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}const pge={getInitialState:()=>CF,tokenize2:(n,e,t,i)=>Wne(0,n,t,i)};function bOe(n,e,t=pge){return MLt(n,e,t||pge)}function RLt(n,e,t,i,s,o,r){let a="<div>",c=i,u=0,d=!0;for(let f=0,g=e.getCount();f<g;f++){const p=e.getEndOffset(f);if(p<=i)continue;let _="";for(;c<p&&c<s;c++){const v=n.charCodeAt(c);switch(v){case 9:let C=o-(c+u)%o;for(u+=C-1;C>0;)r&&d?(_+=" ",d=!1):(_+=" ",d=!0),C--;break;case 60:_+="<",d=!1;break;case 62:_+=">",d=!1;break;case 38:_+="&",d=!1;break;case 0:_+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:_+="�",d=!1;break;case 13:_+="​",d=!1;break;case 32:r&&d?(_+=" ",d=!1):(_+=" ",d=!0);break;default:_+=String.fromCharCode(v),d=!1}}if(a+=`<span style="${e.getInlineStyle(f,t)}">${_}</span>`,p>s||c>=s)break}return a+="</div>",a}function MLt(n,e,t){let i='<div class="monaco-tokenized-source">';const s=Jm(n);let o=t.getInitialState();for(let r=0,a=s.length;r<a;r++){const c=s[r];r>0&&(i+="<br/>");const u=t.tokenize2(c,!0,o,0);El.convertToEndOffset(u.tokens,c.length);const f=new El(u.tokens,c,e).inflate();let g=0;for(let p=0,_=f.getCount();p<_;p++){const v=f.getClassName(p),C=f.getEndOffset(p);i+=`<span class="${v}">${Mne(c.substring(g,C))}</span>`,g=C}o=u.endState}return i+="</div>",i}class kLt{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class ALt{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}class Yx{constructor(e,t,i,s){this._instanceId=lLe(++Yx.INSTANCE_COUNT),this._pendingChanges=new kLt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s<o;){const r=s+o>>>1;t===e[r].afterLineNumber?i<e[r].ordinal?o=r:s=r+1:t<e[r].afterLineNumber?o=r:s=r+1}return s}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(s,o,r,a)=>{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new ALt(c,s,o,r,a)),c},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const c of e)this._insertWhitespace(c);for(const c of t)this._changeOneWhitespace(c.id,c.newAfterLineNumber,c.newHeight);for(const c of i){const u=this._findWhitespaceIndex(c.id);u!==-1&&this._removeWhitespace(u)}return}const s=new Set;for(const c of i)s.add(c.id);const o=new Map;for(const c of t)o.set(c.id,c);const r=c=>{let u=[];for(const d of c)if(!s.has(d.id)){if(o.has(d.id)){const f=o.get(d.id);d.afterLineNumber=f.newAfterLineNumber,d.height=f.newHeight}u.push(d)}return u},a=r(this._arr).concat(r(e));a.sort((c,u)=>c.afterLineNumber===u.afterLineNumber?c.ordinal-u.ordinal:c.afterLineNumber-u.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Yx.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;i<s;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const s=this._findWhitespaceIndex(e);if(s!==-1&&(this._arr[s].height!==i&&(this._arr[s].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,s-1)),this._arr[s].afterLineNumber!==t)){const o=this._arr[s];this._removeWhitespace(s),o.afterLineNumber=t,this._insertWhitespace(o)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount-=t-e+1;for(let i=0,s=this._arr.length;i<s;i++){const o=this._arr[i].afterLineNumber;e<=o&&o<=t?this._arr[i].afterLineNumber=e-1:o>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i<s;i++){const o=this._arr[i].afterLineNumber;e<=o&&(this._arr[i].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),this._arr.length===0?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e=e|0;let t=Math.max(0,this._prefixSumValidIndex+1);t===0&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();const e=this._lineHeight*this._lineCount,t=this.getWhitespacesTotalHeight();return e+t+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e=e|0;const t=this._findLastWhitespaceBeforeLineNumber(e);return t===-1?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e=e|0;const t=this._arr;let i=0,s=t.length-1;for(;i<=s;){const r=(s-i|0)/2|0,a=i+r|0;if(t[a].afterLineNumber<e){if(a+1>=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i<this._arr.length?i:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e=e|0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e){this._checkPendingChanges(),e=e|0;let t;e>1?t=this._lineHeight*(e-1):t=0;const i=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e);return t+i+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>t}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(this._paddingBottom===0)return!1;this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s<o;){const r=(s+o)/2|0,a=this.getVerticalOffsetForLineNumber(r)|0;if(e>=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const c=this.getWhitespacesCount()|0;let u,d;a===-1?(a=c,d=r+1,u=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,u=this.getHeightForWhitespaceIndex(a)|0);let f=o,g=f;const p=5e5;let _=0;o>=p&&(_=Math.floor(o/p)*p,_=Math.floor(_/i)*i,g-=_);const v=[],C=e+(t-e)/2;let y=-1;for(let O=s;O<=r;O++){if(y===-1){const A=f,N=f+i;(A<=C&&C<N||A>C)&&(y=O)}for(f+=i,v[O-s]=g,g+=i;d===O;)g+=u,f+=u,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,u=this.getHeightForWhitespaceIndex(a)|0);if(f>=t){r=O;break}}y===-1&&(y=r);const w=this.getVerticalOffsetForLineNumber(r)|0;let I=s,L=r;return I<L&&o<e&&I++,I<L&&w+i>t&&L--,{bigNumbersDelta:_,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:v,centeredLineNumber:y,completelyVisibleStartLineNumber:I,completelyVisibleEndLineNumber:L}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t<i;){const r=Math.floor((t+i)/2),a=this.getVerticalOffsetForWhitespaceIndex(r),c=this.getHeightForWhitespaceIndex(r);if(e>=a+c)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];let o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),c=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:c})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}}Yx.INSTANCE_COUNT=0;const NLt=125;class gD{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class DLt extends wt{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new rt),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new gD(0,0,0,0),this._scrollable=this._register(new L6(e,t)),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new zie(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class $Lt extends wt{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(129),r=s.get(74);this._linesLayout=new Yx(t,s.get(58),r.top,r.bottom),this._scrollable=this._register(new DLt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new gD(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(102)?NLt:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(58)&&this._linesLayout.setLineHeight(t.get(58)),e.hasChanged(74)){const i=t.get(74);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(129)){const i=t.get(129),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new gD(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(102)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(91);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(93)?o+=Math.max(0,t-s.get(58)-s.get(74).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new gD(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new lfe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new lfe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(130),s=t.get(43);if(i.isViewportWrapping){const o=t.get(129),r=t.get(64);return e>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?e+o.verticalScrollbarWidth:e}else{const o=t.get(92)*s.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+o,r)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new gD(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class xLt{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class PLt{constructor(e){this._counts=e,this._isValid=!1,this._validEndIndex=-1,this._modelToView=[],this._viewToModel=[]}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._counts.length;e<t;e++){const i=this._counts[e],s=e>0?this._modelToView[e-1]:0;this._modelToView[e]=s+i;for(let o=0;o<i;o++)this._viewToModel[s+o]=e}this._modelToView.length=this._counts.length,this._viewToModel.length=this._modelToView[this._modelToView.length-1],this._isValid=!0,this._validEndIndex=this._counts.length-1}}changeValue(e,t){this._counts[e]!==t&&(this._counts[e]=t,this._invalidate(e))}removeValues(e,t){this._counts.splice(e,t),this._invalidate(e)}insertValues(e,t){this._counts=Rx(this._counts,e,t),this._invalidate(e)}getTotalValue(){return this._ensureValid(),this._viewToModel.length}getAccumulatedValue(e){return this._ensureValid(),this._modelToView[e]}getIndexOf(e){this._ensureValid();const t=this._viewToModel[e],i=t>0?this._modelToView[t-1]:0;return new xLe(t,e-i)}}class FLt{constructor(e,t,i,s,o,r,a,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=c,this.wrappingIndent=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])}createCoordinatesConverter(){return new xLt(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new jD(sp.fromDecorations(s));for(let v=0;v<o;v++){const C=a.takeWhile(y=>y.lineNumber===v+1);r.addRequest(i[v],C,t?t[v]:null)}const c=r.finalize();let u=[],d=this.hiddenAreasIds.map(v=>this.model.getDecorationRange(v)).sort(be.compareRangesUsingStarts),f=1,g=0,p=-1,_=p+1<d.length?g+1:o+2;for(let v=0;v<o;v++){let C=v+1;C===_&&(p++,f=d[p].startLineNumber,g=d[p].endLineNumber,_=p+1<d.length?g+1:o+2);let y=C>=f&&C<=g,w=C7(c[v],!y);u[v]=w.getViewLineCount(),this.lines[v]=w}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new PLt(u)}getHiddenAreas(){return this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e))}_reduceRanges(e){if(e.length===0)return[];let t=e.map(r=>this.model.validateRange(r)).sort(be.compareRangesUsingStarts),i=[],s=t[0].startLineNumber,o=t[0].endLineNumber;for(let r=1,a=t.length;r<a;r++){let c=t[r];c.startLineNumber>o+1?(i.push(new be(s,1,o,1)),s=c.startLineNumber,o=c.endLineNumber):c.endLineNumber>o&&(o=c.endLineNumber)}return i.push(new be(s,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(f=>this.model.getDecorationRange(f)).sort(be.compareRangesUsingStarts);if(t.length===i.length){let f=!1;for(let g=0;g<t.length;g++)if(!t[g].equalsRange(i[g])){f=!0;break}if(!f)return!1}let s=[];for(const f of t)s.push({range:f,options:Ci.EMPTY});this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,s);let o=t,r=1,a=0,c=-1,u=c+1<o.length?a+1:this.lines.length+2,d=!1;for(let f=0;f<this.lines.length;f++){let g=f+1;g===u&&(c++,r=o[c].startLineNumber,a=o[c].endLineNumber,u=c+1<o.length?a+1:this.lines.length+2);let p=!1;if(g>=r&&g<=a?this.lines[f].isVisible()&&(this.lines[f]=this.lines[f].setVisible(!1),p=!0):(d=!0,this.lines[f].isVisible()||(this.lines[f]=this.lines[f].setVisible(!0),p=!0)),p){let _=this.lines[f].getViewLineCount();this.prefixSumComputer.changeValue(f,_)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.lines.length?!1:this.lines[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.lines.length?1:this.lines[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s){const o=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,c=this.wrappingIndent===s;if(o&&r&&a&&c)return!1;const u=o&&r&&!a&&c;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s;let d=null;if(u){d=[];for(let f=0,g=this.lines.length;f<g;f++)d[f]=this.lines[f].getLineBreakData()}return this._constructLines(!1,d),!0}createLineBreaksComputer(){return(this.wrappingStrategy==="advanced"?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;let s=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,o=this.prefixSumComputer.getAccumulatedValue(i-1);return this.lines.splice(t-1,i-t+1),this.prefixSumComputer.removeValues(t-1,i-t+1),new uJ(s,o)}onModelLinesInserted(e,t,i,s){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.lines[t-2].isVisible();let r=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,a=0,c=[],u=[];for(let d=0,f=s.length;d<f;d++){let g=C7(s[d],!o);c.push(g);let p=g.getViewLineCount();a+=p,u[d]=p}return this.lines=this.lines.slice(0,t-1).concat(c).concat(this.lines.slice(t-1)),this.prefixSumComputer.insertValues(t-1,u),new dJ(r,r+a-1)}onModelLineChanged(e,t,i){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];let s=t-1,o=this.lines[s].getViewLineCount(),r=this.lines[s].isVisible(),a=C7(i,r);this.lines[s]=a;let c=this.lines[s].getViewLineCount(),u=!1,d=0,f=-1,g=0,p=-1,_=0,v=-1;o>c?(d=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,f=d+c-1,_=f+1,v=_+(o-c)-1,u=!0):o<c?(d=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,f=d+o-1,g=f+1,p=g+(c-o)-1,u=!0):(d=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,f=d+c-1),this.prefixSumComputer.changeValue(s,c);const C=d<=f?new _Oe(d,f):null,y=g<=p?new dJ(g,p):null,w=_<=v?new uJ(_,v):null;return[u,C,y,w]}acceptVersionId(e){this._validModelVersionId=e,this.lines.length===1&&!this.lines[0].isVisible()&&this.setHiddenAreas([])}getViewLineCount(){return this.prefixSumComputer.getTotalValue()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),c=this.convertModelPositionToViewPosition(a.startLineNumber,1),u=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:c.lineNumber,endLineNumber:u.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return new mge(i+1,s)}getMinColumnOfViewLine(e){return this.lines[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new ct(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new ct(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=s.modelLineNumber;c++){const u=this.lines[c-1];if(u.isVisible()){let d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,f=c===s.modelLineNumber?s.modelLineWrappedLineIdx+1:u.getViewLineCount();for(let g=d;g<f;g++)a.push(new mge(c,g))}if(!u.isVisible()&&r){const d=new ct(c-1,this.model.getLineMaxColumn(c-1)+1),f=be.fromPositions(r,d);o.push(new _ge(f,a)),a=[],r=null}else u.isVisible()&&!r&&(r=new ct(c,1))}if(r){const c=be.fromPositions(r,this.getModelEndPositionOfViewLine(s));o.push(new _ge(c,a))}return o}getViewLinesBracketGuides(e,t,i,s){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,r=[];for(const a of this.getViewLineInfosGroupedByModelRanges(e,t)){const c=a.modelRange.startLineNumber,u=this.model.getLinesBracketGuides(c,a.modelRange.endLineNumber,o,s);for(const d of a.viewLines)if(d.isWrappedLineContinuation&&this.getMinColumnOfViewLine(d)===1)r.push([]);else{let f=u[d.modelLineNumber-c];f=f.map(g=>g.horizontalLine?new H1(g.visibleColumn,g.className,new Iq(g.horizontalLine.top,this.convertModelPositionToViewPosition(d.modelLineNumber,g.horizontalLine.endColumn).column)):g),r.push(f)}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[],r=[],a=[];const c=i.lineNumber-1,u=s.lineNumber-1;let d=null;for(let _=c;_<=u;_++){const v=this.lines[_];if(v.isVisible()){let C=v.getViewLineNumberOfModelPosition(0,_===c?i.column:1),y=v.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(_+1)),w=y-C+1,I=0;w>1&&v.getViewLineMinColumn(this.model,_+1,y)===1&&(I=C===0?1:2),r.push(w),a.push(I),d===null&&(d=new ct(_+1,0))}else d!==null&&(o=o.concat(this.model.getLinesIndentGuides(d.lineNumber,_)),d=null)}d!==null&&(o=o.concat(this.model.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const f=t-e+1;let g=new Array(f),p=0;for(let _=0,v=o.length;_<v;_++){let C=o[_],y=Math.min(f-p,r[_]),w=a[_],I;w===2?I=0:w===1?I=1:I=y;for(let L=0;L<y;L++)L===I&&(C=0),g[p++]=C}return g}getViewLineContent(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return this.lines[i].getViewLineContent(this.model,i+1,s)}getViewLineLength(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return this.lines[i].getViewLineLength(this.model,i+1,s)}getViewLineMinColumn(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return this.lines[i].getViewLineMinColumn(this.model,i+1,s)}getViewLineMaxColumn(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return this.lines[i].getViewLineMaxColumn(this.model,i+1,s)}getViewLineData(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return this.lines[i].getViewLineData(this.model,i+1,s)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let s=this.prefixSumComputer.getIndexOf(e-1),o=e,r=s.index,a=s.remainder,c=[];for(let u=r,d=this.model.getLineCount();u<d;u++){let f=this.lines[u];if(!f.isVisible())continue;let g=u===r?a:0,p=f.getViewLineCount()-g,_=!1;o+p>t&&(_=!0,p=t-o+1);let v=g+p;if(f.getViewLinesData(this.model,u+1,g,v,o-e,i,c),o+=p,_)break}return c}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let s=this.prefixSumComputer.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.lines[o],c=a.getViewLineMinColumn(this.model,o+1,r),u=a.getViewLineMaxColumn(this.model,o+1,r);t<c&&(t=c),t>u&&(t=u);let d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new ct(o+1,d)).equals(i)?new ct(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new be(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){e=this._toValidViewLineNumber(e);let i=this.prefixSumComputer.getIndexOf(e-1),s=i.index,o=i.remainder,r=this.lines[s].getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new ct(s+1,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new be(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const s=this.model.validatePosition(new ct(e,t)),o=s.lineNumber,r=s.column;let a=o-1,c=!1;for(;a>0&&!this.lines[a].isVisible();)a--,c=!0;if(a===0&&!this.lines[a].isVisible())return new ct(1,1);const u=1+(a===0?0:this.prefixSumComputer.getAccumulatedValue(a-1));let d;return c?d=this.lines[a].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(a+1),i):d=this.lines[o-1].getViewPositionOfModelPosition(u,r,i),d}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return be.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new be(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.lines[i].isVisible()){const o=1+(i===0?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.lines[i].isVisible();)i--;if(i===0&&!this.lines[i].isVisible())return 1;const s=1+(i===0?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new be(s.lineNumber,1,o.lineNumber,o.column),t,i);let r=[];const a=s.lineNumber-1,c=o.lineNumber-1;let u=null;for(let p=a;p<=c;p++)if(this.lines[p].isVisible())u===null&&(u=new ct(p+1,p===a?s.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);r=r.concat(this.model.getDecorationsInRange(new be(u.lineNumber,u.column,p,v),t,i)),u=null}u!==null&&(r=r.concat(this.model.getDecorationsInRange(new be(u.lineNumber,u.column,o.lineNumber,o.column),t,i)),u=null),r.sort((p,_)=>{const v=be.compareRangesUsingStarts(p.range,_.range);return v===0?p.id<_.id?-1:p.id>_.id?1:0:v});let d=[],f=0,g=null;for(const p of r){const _=p.id;g!==_&&(g=_,d[f++]=p)}return d}getInjectedTextAt(e){const t=this._toValidViewLineNumber(e.lineNumber),i=this.prefixSumComputer.getIndexOf(t-1),s=i.index,o=i.remainder;return this.lines[s].getInjectedTextAt(o,e.column)}normalizePosition(e,t){const i=this._toValidViewLineNumber(e.lineNumber),s=this.prefixSumComputer.getIndexOf(i-1),o=s.index,r=s.remainder;return this.lines[o].normalizePosition(this.model,o+1,r,e,t)}getLineIndentColumn(e){const t=this._toValidViewLineNumber(e),i=this.prefixSumComputer.getIndexOf(t-1),s=i.index;return i.remainder===0?this.model.getLineIndentColumn(s+1):0}}class mge{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}}class _ge{constructor(e,t){this.modelRange=e,this.viewLines=t}}class U3{constructor(){}isVisible(){return!0}setVisible(e){return e?this:W3.INSTANCE}getLineBreakData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let s=e.getLineTokens(t),o=s.getLineContent();return new Zne(o,!1,1,o.length+1,0,s.inflate(),null)}getViewLinesData(e,t,i,s,o,r,a){if(!r[o]){a[o]=null;return}a[o]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new ct(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i,s,o){return s}getInjectedTextAt(e,t){return null}}U3.INSTANCE=new U3;class W3{constructor(){}isVisible(){return!1}setVisible(e){return e?U3.INSTANCE:this}getLineBreakData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,s,o,r,a){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i,s,o){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}W3.INSTANCE=new W3;class BLt{constructor(e,t){this._lineBreakData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getLineBreakData(){return this._lineBreakData}getViewLineCount(){return this._isVisible?this._lineBreakData.breakOffsets.length:0}getInputStartOffsetOfOutputLineIndex(e){return this._lineBreakData.getInputOffsetOfOutputPosition(e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:this._lineBreakData.getInputOffsetOfOutputPosition(i+1,0)}getViewLineContent(e,t,i){if(!this._isVisible)throw new Error("Not supported");const s=i>0?this._lineBreakData.breakOffsets[i-1]:0,o=i<this._lineBreakData.breakOffsets.length?this._lineBreakData.breakOffsets[i]:this._lineBreakData.breakOffsets[this._lineBreakData.breakOffsets.length-1];let r;if(this._lineBreakData.injectionOffsets!==null){const a=this._lineBreakData.injectionOffsets.map((c,u)=>new sp(0,0,c+1,this._lineBreakData.injectionOptions[u],0));r=sp.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=vge(this._lineBreakData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){if(!this._isVisible)throw new Error("Not supported");const s=i>0?this._lineBreakData.breakOffsets[i-1]:0;let r=(i<this._lineBreakData.breakOffsets.length?this._lineBreakData.breakOffsets[i]:this._lineBreakData.breakOffsets[this._lineBreakData.breakOffsets.length-1])-s;return i>0&&(r=this._lineBreakData.wrappedTextIndentLength+r),r}getViewLineMinColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this._getViewLineMinColumn(i)}_getViewLineMinColumn(e){return e>0?this._lineBreakData.wrappedTextIndentLength+1:1}getViewLineMaxColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineLength(e,t,i)+1}getViewLineData(e,t,i){if(!this._isVisible)throw new Error("Not supported");const s=this._lineBreakData,o=i>0?s.wrappedTextIndentLength:0,r=s.injectionOffsets,a=s.injectionOptions;let c,u,d;if(r){const v=e.getLineTokens(t).withInserted(r.map((I,L)=>({offset:I,text:a[L].content,tokenMetadata:El.defaultTokenMetadata}))),C=i>0?s.breakOffsets[i-1]:0,y=s.breakOffsets[i];c=v.getLineContent().substring(C,y),u=v.sliceAndInflate(C,y,o),d=new Array;let w=0;for(let I=0;I<r.length;I++){const L=a[I].content.length,O=r[I]+w,A=r[I]+w+L;if(O>y)break;if(C<A){const N=a[I];if(N.inlineClassName){const D=i>0?s.wrappedTextIndentLength:0,P=D+Math.max(O-C,0),F=D+Math.min(A-C,y);P!==F&&d.push(new YCt(P,F,N.inlineClassName,N.inlineClassNameAffectsLetterSpacing))}}w+=L}}else{const v=this.getInputStartOffsetOfOutputLineIndex(i),C=this.getInputEndOffsetOfOutputLineIndex(e,t,i),y=e.getLineTokens(t);c=e.getValueInRange({startLineNumber:t,startColumn:v+1,endLineNumber:t,endColumn:C+1}),u=y.sliceAndInflate(v,C,o),d=null}i>0&&(c=vge(s.wrappedTextIndentLength)+c);const f=i>0?s.wrappedTextIndentLength+1:1,g=c.length+1,p=i+1<this.getViewLineCount(),_=i===0?0:s.breakOffsetsVisibleColumn[i-1];return new Zne(c,p,f,g,_,u,d)}getViewLinesData(e,t,i,s,o,r,a){if(!this._isVisible)throw new Error("Not supported");for(let c=i;c<s;c++){let u=o+c-i;if(!r[u]){a[u]=null;continue}a[u]=this.getViewLineData(e,t,c)}}getModelColumnOfViewPosition(e,t){if(!this._isVisible)throw new Error("Not supported");let i=t-1;return e>0&&(i<this._lineBreakData.wrappedTextIndentLength?i=0:i-=this._lineBreakData.wrappedTextIndentLength),this._lineBreakData.getInputOffsetOfOutputPosition(e,i)+1}getViewPositionOfModelPosition(e,t,i=2){if(!this._isVisible)throw new Error("Not supported");let s=this._lineBreakData.getOutputPositionOfInputOffset(t-1,i),o=s.outputLineIndex,r=s.outputOffset+1;return o>0&&(r+=this._lineBreakData.wrappedTextIndentLength),new ct(e+o,r)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");const i=this._lineBreakData.getOutputPositionOfInputOffset(t-1);return e+i.outputLineIndex}normalizePosition(e,t,i,s,o){if(this._lineBreakData.injectionOffsets!==null){const r=s.lineNumber-i,a=this._lineBreakData.outputPositionToOffsetInUnwrappedLine(i,s.column-1),c=this._lineBreakData.normalizeOffsetAroundInjections(a,o);if(c!==a)return this._lineBreakData.getOutputPositionOfOffsetInUnwrappedLine(c,o).toPosition(r,this._lineBreakData.wrappedTextIndentLength)}if(o===0){if(i>0&&s.column===this._getViewLineMinColumn(i))return new ct(s.lineNumber-1,this.getViewLineMaxColumn(e,t,i-1))}else if(o===1){const r=this.getViewLineCount()-1;if(i<r&&s.column===this.getViewLineMaxColumn(e,t,i))return new ct(s.lineNumber+1,this._getViewLineMinColumn(i+1))}return s}getInjectedTextAt(e,t){return this._lineBreakData.getInjectedText(e,t-1)}}let T7=[""];function vge(n){if(n>=T7.length)for(let e=1;e<=n;e++)T7[e]=HLt(e);return T7[n]}function HLt(n){return new Array(n+1).join(" ")}function C7(n,e){return n===null?e?U3.INSTANCE:W3.INSTANCE:new BLt(n,e)}class VLt{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class ULt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new VLt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new uJ(t,i)}onModelLinesInserted(e,t,i,s){return new dJ(t,i)}onModelLineChanged(e,t,i){return[!1,new _Oe(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1;let s=new Array(i);for(let o=0;o<i;o++)s[o]=0;return s}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){let t=this.model.getLineTokens(e),i=t.getLineContent();return new Zne(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const s=this.model.getLineCount();e=Math.min(Math.max(1,e),s),t=Math.min(Math.max(1,t),s);let o=[];for(let r=e;r<=t;r++){let a=r-e;i[a]||(o[a]=null),o[a]=this.getViewLineData(r)}return o}getDecorationsInRange(e,t,i){return this.model.getDecorationsInRange(e,t,i)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class WLt{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new ct(s.startLineNumber,1),0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new ct(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new be(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new GLe(r,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,_ne(this.configuration.options)),i=e.startLineNumber,s=e.endLineNumber;let o=[],r=0,a=[];for(let c=i;c<=s;c++)a[c-i]=[];for(let c=0,u=t.length;c<u;c++){let d=t[c],f=d.options,g=this._getOrCreateViewModelDecoration(d),p=g.range;if(o[r++]=g,f.inlineClassName){let _=new YD(p,f.inlineClassName,f.inlineClassNameAffectsLetterSpacing?3:0),v=Math.max(i,p.startLineNumber),C=Math.min(s,p.endLineNumber);for(let y=v;y<=C;y++)a[y-i].push(_)}if(f.beforeContentClassName&&i<=p.startLineNumber&&p.startLineNumber<=s){let _=new YD(new be(p.startLineNumber,p.startColumn,p.startLineNumber,p.startColumn),f.beforeContentClassName,1);a[p.startLineNumber-i].push(_)}if(f.afterContentClassName&&i<=p.endLineNumber&&p.endLineNumber<=s){let _=new YD(new be(p.endLineNumber,p.endColumn,p.endLineNumber,p.endColumn),f.afterContentClassName,2);a[p.endLineNumber-i].push(_)}}return{decorations:o,inlineDecorations:a}}}const GLt={ModesRegistry:"editor.modesRegistry"};class zLt{constructor(){this._onDidChangeLanguages=new rt,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e){this._languages.splice(t,1);return}}}}getLanguages(){return[].concat(this._languages).concat(this._dynamicLanguages)}}const S0=new zLt;br.add(GLt.ModesRegistry,S0);const TM="plaintext",KLt=".txt";S0.registerLanguage({id:TM,extensions:[KLt],aliases:[$("plainText.alias","Plain Text"),"text"],mimetypes:[Cf.text]});ns.register(TM,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0);class jLt extends wt{constructor(e,t,i,s,o,r){if(super(),this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new wLt,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new bf(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._tokenizeViewportSoon=this._register(new ho(()=>this.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new ho(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new ULt(this.model);else{const a=this._configuration.options,c=a.get(43),u=a.get(123),d=a.get(130),f=a.get(122);this._lines=new FLt(this._editorId,this.model,s,o,c,this.model.getOptions().tabSize,u,d.wrappingColumn,f)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new wR(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new $Lt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(a=>{a.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new TLt(a)),this._eventDispatcher.emitOutgoingEvent(new jie(a.oldScrollWidth,a.oldScrollLeft,a.oldScrollHeight,a.oldScrollTop,a.scrollWidth,a.scrollLeft,a.scrollHeight,a.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(a=>{this._eventDispatcher.emitOutgoingEvent(a)})),this._decorations=new WLt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(a=>{try{const c=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(c,a)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(MF.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new ELt)})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this.invalidateMinimapColorCache(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new be(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const s of i)this.model.tokenizeViewport(s.startLineNumber,s.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new vLt(e)),this._eventDispatcher.emitOutgoingEvent(new Kie(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new gLt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new pLt)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new CLt)}_onConfigurationChanged(e,t){let i=null;if(this._viewportStartLine!==-1){let d=new ct(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(d)}let s=!1;const o=this._configuration.options,r=o.get(43),a=o.get(123),c=o.get(130),u=o.get(122);if(this._lines.setWrappingSettings(r,a,c.wrappingColumn,u)&&(e.emitViewEvent(new aV),e.emitViewEvent(new cV),e.emitViewEvent(new l1(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.getCurrentScrollTop()!==0&&(s=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(80)&&(this._decorations.reset(),e.emitViewEvent(new l1(null))),e.emitViewEvent(new mLt(t)),this.viewLayout.onConfigurationChanged(t),s&&i){const d=this.coordinatesConverter.convertModelPositionToViewPosition(i),f=this.viewLayout.getVerticalOffsetForLineNumber(d.lineNumber);this.viewLayout.setScrollPosition({scrollTop:f+this._viewportStartLineDelta},1)}bf.shouldRecreate(t)&&(this.cursorConfig=new bf(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,s=!1;const o=e.changes,r=e instanceof _0?e.versionId:null,a=this._lines.createLineBreaksComputer();for(const d of o)switch(d.changeType){case 4:{for(let f=0;f<d.detail.length;f++){const g=d.detail[f];let p=d.injectedTexts[f];p&&(p=p.filter(_=>!_.ownerId||_.ownerId===this._editorId)),a.addRequest(g,p,null)}break}case 2:{let f=null;d.injectedText&&(f=d.injectedText.filter(g=>!g.ownerId||g.ownerId===this._editorId)),a.addRequest(d.detail,f,null);break}}const c=a.finalize();let u=0;for(const d of o)switch(d.changeType){case 1:{this._lines.onModelFlushed(),t.emitViewEvent(new aV),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break}case 3:{const f=this._lines.onModelLinesDeleted(r,d.fromLineNumber,d.toLineNumber);f!==null&&(t.emitViewEvent(f),this.viewLayout.onLinesDeleted(f.fromLineNumber,f.toLineNumber)),i=!0;break}case 4:{const f=c.slice(u,u+d.detail.length);u+=d.detail.length;const g=this._lines.onModelLinesInserted(r,d.fromLineNumber,d.toLineNumber,f);g!==null&&(t.emitViewEvent(g),this.viewLayout.onLinesInserted(g.fromLineNumber,g.toLineNumber)),i=!0;break}case 2:{const f=c[u];u++;const[g,p,_,v]=this._lines.onModelLineChanged(r,d.lineNumber,f);s=g,p&&t.emitViewEvent(p),_&&(t.emitViewEvent(_),this.viewLayout.onLinesInserted(_.fromLineNumber,_.toLineNumber)),v&&(t.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}r!==null&&this._lines.acceptVersionId(r),this.viewLayout.onHeightMaybeChanged(),!i&&s&&(t.emitViewEvent(new cV),t.emitViewEvent(new l1(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setMaxLineNumber(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const t=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(t){const i=this.coordinatesConverter.convertModelPositionToViewPosition(t.getStartPosition()),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber);this.viewLayout.setScrollPosition({scrollTop:s+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,s=e.ranges.length;i<s;i++){const o=e.ranges[i],r=this.coordinatesConverter.convertModelPositionToViewPosition(new ct(o.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new ct(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;t[i]={fromLineNumber:r,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new yLt(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule()})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new bLt),this.cursorConfig=new bf(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new bf(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new aV),t.emitViewEvent(new cV),t.emitViewEvent(new l1(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new bf(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new l1(e))}))}setHiddenAreas(e){let t=!1;try{const i=this._eventDispatcher.beginEmitViewEvents();t=this._lines.setHiddenAreas(e),t&&(i.emitViewEvent(new aV),i.emitViewEvent(new cV),i.emitViewEvent(new l1(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),t&&this._eventDispatcher.emitOutgoingEvent(new fge)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(129),t=this._configuration.options.get(58),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new be(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];let s=[],o=0,r=t.startLineNumber,a=t.startColumn,c=t.endLineNumber,u=t.endColumn;for(let d=0,f=i.length;d<f;d++){const g=i[d].startLineNumber,p=i[d].endLineNumber;p<r||g>c||(r<g&&(s[o++]=new be(r,a,g-1,this.model.getLineMaxColumn(g-1))),r=p+1,a=1)}return(r<c||r===c&&a<u)&&(s[o++]=new be(r,a,c,u)),s}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new be(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,s=t.completelyVisibleEndLineNumber;return new be(i,this.getLineMinColumn(i),s,this.getLineMaxColumn(s))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),s=this.coordinatesConverter.convertViewPositionToModelPosition(new ct(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:s,firstPositionDeltaTop:o}}reduceRestoreState(e){if(typeof e.firstPosition>"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getTextModelOptions(){return this.model.getOptions()}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStartLine=e;let s=this.coordinatesConverter.convertViewPositionToModelPosition(new ct(e,this.getLineMinColumn(e)));this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,new be(s.lineNumber,s.column,s.lineNumber,s.column),1);const o=this.viewLayout.getVerticalOffsetForLineNumber(e),r=this.viewLayout.getCurrentScrollTop();this._viewportStartLineDelta=r-o}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=cc(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Fm(this.getLineContent(e));return t===-1?0:t+2}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewLineRenderingData(e,t){let i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(t),c=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return r.inlineDecorations&&(c=[...c,...r.inlineDecorations.map(u=>u.toInlineDecoration(t))]),new Dd(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,c,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let s=this._lines.getViewLinesData(e,t,i);return new XCt(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,_ne(this._configuration.options)),i=new XLt;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const c=r.getColor(e),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(c,o.zIndex,u,d,a)}return i.asArray}invalidateOverviewRulerColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i&&i.invalidateCachedColor()}}invalidateMinimapColorCache(){const e=this.model.getAllDecorations();for(const t of e){const i=t.options.minimap;i&&i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getModelLineMaxColumn(e){return this.model.getLineMaxColumn(e)}validateModelPosition(e){return this.model.validatePosition(e)}validateModelRange(e){return this.model.validateRange(e)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getEOL(){return this.model.getEOL()}getPlainTextToCopy(e,t,i){const s=i?`\r
- `:this.model.getEOL();e=e.slice(0),e.sort(be.compareRangesUsingStarts);let o=!1,r=!1;for(const c of e)c.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const c=e.map(d=>d.startLineNumber);let u="";for(let d=0;d<c.length;d++)d>0&&c[d-1]===c[d]||(u+=this.model.getLineContent(c[d])+s);return u}if(o&&t){let c=[],u=0;for(const d of e){const f=d.startLineNumber;d.isEmpty()?f!==u&&c.push(this.model.getLineContent(f)):c.push(this.model.getValueInRange(d,i?2:0)),u=f}return c.length===1?c[0]:c}let a=[];for(const c of e)c.isEmpty()||a.push(this.model.getValueInRange(c,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===TM||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new be(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(43),r=this._getColorMap(),c=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===va.fontFamily;let u;return c?u=va.fontFamily:(u=o.fontFamily,u=u.replace(/"/g,"'"),/[,']/.test(u)||/[+ ]/.test(u)&&(u=`'${u}'`),u=`${u}, ${va.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${u};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(s,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let c="";for(let u=i;u<=o;u++){const d=this.model.getLineTokens(u),f=d.getLineContent(),g=u===i?s-1:0,p=u===o?r-1:f.length;f===""?c+="<br>":c+=RLt(f,d.inflate(),t,g,p,a,zl)}return c}_getColorMap(){let e=$o.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;i<s;i++)t[i]=mt.Format.CSS.formatHex(e[i]);return t}pushStackElement(){this.model.pushStackElement()}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){this._withViewEventsCollector(s=>this._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new LLt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._cursor.setIsDoingComposition(!1),this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t){this._withViewEventsCollector(i=>this._cursor.revealPrimary(i,e,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new be(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new u4(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new be(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new u4(e,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new u4(e,i,null,s,t,o)))}getVerticalOffsetForLineNumber(e){return this.viewLayout.getVerticalOffsetForLineNumber(e)}getScrollTop(){return this.viewLayout.getCurrentScrollTop()}setScrollTop(e,t){this.viewLayout.setScrollPosition({scrollTop:e},t)}setScrollPosition(e,t){this.viewLayout.setScrollPosition(e,t)}deltaScrollNow(e,t){this.viewLayout.deltaScrollNow(e,t)}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new SLt),this._eventDispatcher.emitOutgoingEvent(new fge))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class XLt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,c=a[a.length-3],u=a[a.length-1];if(c===o&&u+1>=i){s>u&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new zLe(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class qx{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}const Vu=ss("accessibilityService"),kF=new Sn("accessibilityModeEnabled",!1);class YLt extends pM{constructor(e,t){super(0);for(let i=0;i<e.length;i++)this.set(e.charCodeAt(i),1);for(let i=0;i<t.length;i++)this.set(t.charCodeAt(i),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let hJ=[],fJ=[];class Xie{constructor(e,t){this.classifier=new YLt(e,t)}static create(e){return new Xie(e.get(118),e.get(117))}createLineBreaksComputer(e,t,i,s){t=t|0,i=+i;const o=[],r=[],a=[];return{addRequest:(c,u,d)=>{o.push(c),r.push(u),a.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let u=[];for(let d=0,f=o.length;d<f;d++){const g=r[d],p=a[d];p&&!p.injectionOptions&&!g?u[d]=qLt(this.classifier,p,o[d],t,i,c,s):u[d]=JLt(this.classifier,o[d],g,t,i,c,s)}return hJ.length=0,fJ.length=0,u}}}}function qLt(n,e,t,i,s,o,r){if(s===-1)return null;const a=t.length;if(a<=1)return null;const c=e.breakOffsets,u=e.breakOffsetsVisibleColumn,d=TOe(t,i,s,o,r),f=s-d;let g=hJ,p=fJ,_=0,v=0,C=0,y=s;const w=c.length;let I=0;if(I>=0){let L=Math.abs(u[I]-y);for(;I+1<w;){const O=Math.abs(u[I+1]-y);if(O>=L)break;L=O,I++}}for(;I<w;){let L=I<0?0:c[I],O=I<0?0:u[I];v>L&&(L=v,O=C);let A=0,N=0,D=0,P=0;if(O<=y){let V=O,U=L===0?0:t.charCodeAt(L-1),Q=L===0?0:n.get(U),de=!0;for(let q=L;q<a;q++){const K=q,re=t.charCodeAt(q);let Z,J;if(yl(re)?(q++,Z=0,J=2):(Z=n.get(re),J=d$(re,V,i,o)),K>v&&gJ(U,Q,re,Z)&&(A=K,N=V),V+=J,V>y){K>v?(D=K,P=V-J):(D=q+1,P=V),V-N>f&&(A=0),de=!1;break}U=re,Q=Z}if(de){_>0&&(g[_]=c[c.length-1],p[_]=u[c.length-1],_++);break}}if(A===0){let V=O,U=t.charCodeAt(L),Q=n.get(U),de=!1;for(let q=L-1;q>=v;q--){const K=q+1,re=t.charCodeAt(q);if(re===9){de=!0;break}let Z,J;if(fR(re)?(q--,Z=0,J=2):(Z=n.get(re),J=Gg(re)?o:1),V<=y){if(D===0&&(D=K,P=V),V<=y-f)break;if(gJ(re,Z,U,Q)){A=K,N=V;break}}V-=J,U=re,Q=Z}if(A!==0){const q=f-(P-N);if(q<=i){const K=t.charCodeAt(D);let re;yl(K)?re=2:re=d$(K,P,i,o),q-re<0&&(A=0)}}if(de){I--;continue}}if(A===0&&(A=D,N=P),A<=v){const V=t.charCodeAt(v);yl(V)?(A=v+2,N=C+2):(A=v+1,N=C+d$(V,C,i,o))}for(v=A,g[_]=A,C=N,p[_]=N,_++,y=N+f;I<0||I<w&&u[I]<N;)I++;let F=Math.abs(u[I]-y);for(;I+1<w;){const V=Math.abs(u[I+1]-y);if(V>=F)break;F=V,I++}}return _===0?null:(g.length=_,p.length=_,hJ=e.breakOffsets,fJ=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=d,e)}function JLt(n,e,t,i,s,o,r){const a=sp.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(N=>N.options),u=t.map(N=>N.column-1)):(c=null,u=null),s===-1)return c?new XD([a.length],[],0,u,c):null;const d=a.length;if(d<=1)return c?new XD([a.length],[],0,u,c):null;const f=TOe(a,i,s,o,r),g=s-f;let p=[],_=[],v=0,C=0,y=0,w=s,I=a.charCodeAt(0),L=n.get(I),O=d$(I,0,i,o),A=1;yl(I)&&(O+=1,I=a.charCodeAt(1),L=n.get(I),A++);for(let N=A;N<d;N++){const D=N,P=a.charCodeAt(N);let F,V;yl(P)?(N++,F=0,V=2):(F=n.get(P),V=d$(P,O,i,o)),gJ(I,L,P,F)&&(C=D,y=O),O+=V,O>w&&((C===0||O-y>g)&&(C=D,y=O-V),p[v]=C,_[v]=y,v++,w=y+g,C=0),I=P,L=F}return v===0&&(!t||t.length===0)?null:(p[v]=d,_[v]=O,new XD(p,_,f,u,c))}function d$(n,e,t,i){return n===9?t-e%t:Gg(n)||n<32?i:1}function bge(n,e){return e-n%e}function gJ(n,e,t,i){return t!==32&&(e===2||e===3&&i!==2||i===1||i===3&&e!==1)}function TOe(n,e,t,i,s){let o=0;if(s!==0){const r=cc(n);if(r!==-1){for(let c=0;c<r;c++){const u=n.charCodeAt(c)===9?bge(o,e):1;o+=u}const a=s===3?2:s===2?1:0;for(let c=0;c<a;c++){const u=bge(o,e);o+=u}o+i>t&&(o=0)}}return o}var y7;const E7=(y7=window.trustedTypes)===null||y7===void 0?void 0:y7.createPolicy("domLineBreaksComputer",{createHTML:n=>n});class Yie{static create(){return new Yie}constructor(){}createLineBreaksComputer(e,t,i,s){t=t|0,i=+i;let o=[],r=[];return{addRequest:(a,c,u)=>{o.push(a),r.push(c)},finalize:()=>QLt(o,e,t,i,s,r)}}}function QLt(n,e,t,i,s,o){var r;function a(D){const P=o[D];if(P){const F=sp.applyInjectedText(n[D],P),V=P.map(Q=>Q.options),U=P.map(Q=>Q.column-1);return new XD([F.length],[],0,U,V)}else return null}if(i===-1){const D=[];for(let P=0,F=n.length;P<F;P++)D[P]=a(P);return D}const c=Math.round(i*e.typicalHalfwidthCharacterWidth),d=Math.round(t*(s===3?2:s===2?1:0)),f=Math.ceil(e.spaceWidth*d),g=document.createElement("div");Ea.applyFontInfoSlow(g,e);const p=Y0(1e4),_=[],v=[],C=[],y=[],w=[];for(let D=0;D<n.length;D++){const P=sp.applyInjectedText(n[D],o[D]);let F=0,V=0,U=c;if(s!==0)if(F=cc(P),F===-1)F=0;else{for(let K=0;K<F;K++){const re=P.charCodeAt(K)===9?t-V%t:1;V+=re}const q=Math.ceil(e.spaceWidth*V);q+e.typicalFullwidthCharacterWidth>c?(F=0,V=0):U=c-q}const Q=P.substr(F),de=ZLt(Q,V,t,U,p,f);_[D]=F,v[D]=V,C[D]=Q,y[D]=de[0],w[D]=de[1]}const I=p.build(),L=(r=E7==null?void 0:E7.createHTML(I))!==null&&r!==void 0?r:I;g.innerHTML=L,g.style.position="absolute",g.style.top="10000",g.style.wordWrap="break-word",document.body.appendChild(g);let O=document.createRange();const A=Array.prototype.slice.call(g.children,0);let N=[];for(let D=0;D<n.length;D++){const P=A[D],F=e1t(O,P,C[D],y[D]);if(F===null){N[D]=a(D);continue}const V=_[D],U=v[D]+d,Q=w[D],de=[];for(let Z=0,J=F.length;Z<J;Z++)de[Z]=Q[F[Z]];if(V!==0)for(let Z=0,J=F.length;Z<J;Z++)F[Z]+=V;let q,K;const re=o[D];re?(q=re.map(Z=>Z.options),K=re.map(Z=>Z.column-1)):(q=null,K=null),N[D]=new XD(F,de,U,K,q)}return document.body.removeChild(g),N}function ZLt(n,e,t,i,s,o){if(o!==0){let g=String(o);s.appendASCIIString('<div style="text-indent: -'),s.appendASCIIString(g),s.appendASCIIString("px; padding-left: "),s.appendASCIIString(g),s.appendASCIIString("px; box-sizing: border-box; width:")}else s.appendASCIIString('<div style="width:');s.appendASCIIString(String(i)),s.appendASCIIString('px;">');const r=n.length;let a=e,c=0,u=[],d=[],f=0<r?n.charCodeAt(0):0;s.appendASCIIString("<span>");for(let g=0;g<r;g++){g!==0&&g%16384===0&&s.appendASCIIString("</span><span>"),u[g]=c,d[g]=a;const p=f;f=g+1<r?n.charCodeAt(g+1):0;let _=1,v=1;switch(p){case 9:_=t-a%t,v=_;for(let C=1;C<=_;C++)C<_?s.write1(160):s.appendASCII(32);break;case 32:f===32?s.write1(160):s.appendASCII(32);break;case 60:s.appendASCIIString("<");break;case 62:s.appendASCIIString(">");break;case 38:s.appendASCIIString("&");break;case 0:s.appendASCIIString("�");break;case 65279:case 8232:case 8233:case 133:s.write1(65533);break;default:Gg(p)&&v++,p<32?s.write1(9216+p):s.write1(p)}c+=_,a+=v}return s.appendASCIIString("</span>"),u[n.length]=c,d[n.length]=a,s.appendASCIIString("</div>"),[u,d]}function e1t(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{pJ(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function pJ(n,e,t,i,s,o,r,a){if(i===o||(s=s||S7(n,e,t[i],t[i+1]),r=r||S7(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,u=S7(n,e,t[c],t[c+1]);pJ(n,e,t,i,s,c,u,a),pJ(n,e,t,c,u,o,r,a)}function S7(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}var t1t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},uS=function(n,e){return function(t,i){e(t,i,n)}};let n1t=0,i1t=class{constructor(e,t,i,s,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o}dispose(){Ji(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Jx=class d4 extends wt{constructor(e,t,i,s,o,r,a,c,u,d){super(),this._onDidDispose=this._register(new rt),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new rt),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new rt),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new rt),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new rt),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new rt),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new rt),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new rt),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new rt),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new rt),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new rt),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new rt),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new Tge),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new Tge),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new rt),this.onWillType=this._onWillType.event,this._onDidType=this._register(new rt),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new rt),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new rt),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new rt),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new rt),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new rt),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new rt),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new rt),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new rt),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new rt),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new rt),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new rt),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new rt),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new rt),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new rt),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new rt),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new rt),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new rt),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event;const f=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=f.overflowWidgetsDomNode,delete f.overflowWidgetsDomNode,this._id=++n1t,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(f,d)),this._register(this._configuration.onDidChange(p=>{this._onDidChangeConfiguration.fire(p);const _=this._configuration.options;if(p.hasChanged(129)){const v=_.get(129);this._onDidLayoutChange.fire(v)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=u,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new s1t(this,this._contextKeyService)),this._register(new o1t(this,this._contextKeyService)),this._instantiationService=s.createChild(new qx([ai,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new r1t(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={};let g;Array.isArray(i.contributions)?g=i.contributions:g=EO.getEditorContributions();for(const p of g){if(this._contributions[p.id]){di(new Error(`Cannot have two contributions with the same id ${p.id}`));continue}try{const _=this._instantiationService.createInstance(p.ctor,this);this._contributions[p.id]=_}catch(_){di(_)}}EO.getEditorActions().forEach(p=>{if(this._actions[p.id]){di(new Error(`Cannot have two actions with the same id ${p.id}`));return}const _=new vOe(p.id,p.label,p.alias,yd(p.precondition),()=>this._instantiationService.invokeFunction(v=>Promise.resolve(p.runEditorCommand(v,this,null))),this._contextKeyService);this._actions[_.id]=_}),this._codeEditorService.addCodeEditor(this)}_createConfiguration(e,t){return new Ea(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return TF.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;t<i;t++){const s=e[t];this._contributions[s].dispose()}this._contributions={},this._actions={},this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e)}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Yi.getWordAtPosition(this._modelData.model,this._configuration.options.get(115),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===`
- `?i=1:e&&e.lineEnding&&e.lineEnding===`\r
- `&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(let i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetForPosition(e,t,i){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}getTopForLineNumber(e){return this._modelData?d4._getVerticalOffsetForPosition(this._modelData,e,1):-1}getTopForPosition(e,t){return this._modelData?d4._getVerticalOffsetForPosition(this._modelData,e,t):-1}setHiddenAreas(e){this._modelData&&this._modelData.viewModel.setHiddenAreas(e.map(t=>be.lift(t)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Vs.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e){if(this._modelData){if(!ct.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!be.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new be(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,s){if(!ct.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new be(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e){const t=fn.isISelection(e),i=be.isIRange(e);if(!t&&!i)throw new Error("Invalid arguments");if(t)this._setSelectionImpl(e);else if(i){const s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s)}}_setSelectionImpl(e){if(!this._modelData)return;const t=new fn(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections("api",[t])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new be(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!be.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(be.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s<o;s++)if(!fn.isISelection(e[s]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e={},t=Object.keys(this._contributions);for(const o of t){const r=this._contributions[o];typeof r.saveViewState=="function"&&(e[o]=r.saveViewState())}const i=this._modelData.viewModel.saveCursorState(),s=this._modelData.viewModel.saveState();return{cursorState:i,viewState:s,contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const i=t.cursorState;Array.isArray(i)?this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]);const s=t.contributionsState||{},o=Object.keys(this._contributions);for(let a=0,c=o.length;a<c;a++){const u=o[a],d=this._contributions[u];typeof d.restoreViewState=="function"&&d.restoreViewState(s[u])}const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}getContribution(e){return this._contributions[e]||null}getActions(){const e=[],t=Object.keys(this._actions);for(let i=0,s=t.length;i<s;i++){const o=t[i];e.push(this._actions[o])}return e}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run()).then(void 0,di);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,s,e);const a=this._modelData.viewModel.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new be(r.lineNumber,r.column,a.lineNumber,a.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=EO.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,di)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(80)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(80)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(80))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,_ne(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(129)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarMouseDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeReferenceElement(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(129),o=d4._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(58)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Ea.applyFontInfoSlow(e,this._configuration.options.get(43))}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const i=new jLt(this._id,this._configuration,e,Yie.create(),Xie.create(this._configuration.options),r=>qm(r));t.push(e.onDidChangeDecorations(r=>this._onDidChangeModelDecorations.fire(r))),t.push(e.onDidChangeLanguage(r=>{this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(r)})),t.push(e.onDidChangeLanguageConfiguration(r=>this._onDidChangeModelLanguageConfiguration.fire(r))),t.push(e.onDidChangeContent(r=>this._onDidChangeModelContent.fire(r))),t.push(e.onDidChangeOptions(r=>this._onDidChangeModelOptions.fire(r))),t.push(e.onWillDispose(()=>this.setModel(null))),t.push(i.onEvent(r=>{switch(r.kind){case 0:this._onDidContentSizeChange.fire(r);break;case 1:this._editorTextFocus.setValue(r.hasFocus);break;case 2:this._onDidScrollChange.fire(r);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{r.reachedMaxCursorCount&&this._notificationService.warn($("cursors.maximum","The number of cursors has been limited to {0}.",wR.MAX_CURSOR_COUNT));const a=[];for(let d=0,f=r.selections.length;d<f;d++)a[d]=r.selections[d].getPosition();const c={position:a[0],secondaryPositions:a.slice(1),reason:r.reason,source:r.source};this._onDidChangeCursorPosition.fire(c);const u={selection:r.selections[0],secondarySelections:r.selections.slice(1),modelVersionId:r.modelVersionId,oldSelections:r.oldSelections,oldModelVersionId:r.oldModelVersionId,source:r.source,reason:r.reason};this._onDidChangeCursorSelection.fire(u);break}}}));const[s,o]=this._createView(i);if(o){this._domElement.appendChild(s.domNode.domNode);let r=Object.keys(this._contentWidgets);for(let a=0,c=r.length;a<c;a++){const u=r[a];s.addContentWidget(this._contentWidgets[u])}r=Object.keys(this._overlayWidgets);for(let a=0,c=r.length;a<c;a++){const u=r[a];s.addOverlayWidget(this._overlayWidgets[u])}s.render(!1,!0),s.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new i1t(e,i,s,o,t)}_createView(e){let t;this.isSimpleWidget?t={paste:(o,r,a,c)=>{this._paste("keyboard",o,r,a,c)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,c)=>{this._compositionType("keyboard",o,r,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,c)=>{const u={text:o,pasteOnNewLine:r,multicursorText:a,mode:c};this._commandService.executeCommand("paste",u)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,c)=>{if(a||c){const u={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand("compositionType",u)}else{const u={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",u)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new I6(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new hLt(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}};Jx=t1t([uS(3,Qi),uS(4,hs),uS(5,vr),uS(6,ai),uS(7,fo),uS(8,Hr),uS(9,Vu)],Jx);class Tge extends wt{constructor(){super(),this._onDidChangeToTrue=this._register(new rt),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new rt),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class s1t extends wt{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=We.editorSimpleInput.bindTo(t),this._editorFocus=We.focus.bindTo(t),this._textInputFocus=We.textInputFocus.bindTo(t),this._editorTextFocus=We.editorTextFocus.bindTo(t),this._editorTabMovesFocus=We.tabMovesFocus.bindTo(t),this._editorReadonly=We.readOnly.bindTo(t),this._inDiffEditor=We.inDiffEditor.bindTo(t),this._editorColumnSelection=We.columnSelection.bindTo(t),this._hasMultipleSelections=We.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=We.hasNonEmptySelection.bindTo(t),this._canUndo=We.canUndo.bindTo(t),this._canRedo=We.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(128)),this._editorReadonly.set(e.get(80)),this._inDiffEditor.set(e.get(53)),this._editorColumnSelection.set(e.get(18))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class o1t extends wt{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=We.languageId.bindTo(t),this._hasCompletionItemProvider=We.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=We.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=We.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=We.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=We.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=We.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=We.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=We.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=We.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=We.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=We.hasReferenceProvider.bindTo(t),this._hasRenameProvider=We.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=We.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=We.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=We.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=We.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=We.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=We.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=We.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(Ag.onDidChange(i)),this._register(Vm.onDidChange(i)),this._register(Pv.onDidChange(i)),this._register(wx.onDidChange(i)),this._register(n3.onDidChange(i)),this._register(i3.onDidChange(i)),this._register(s3.onDidChange(i)),this._register(Sx.onDidChange(i)),this._register(gR.onDidChange(i)),this._register(kf.onDidChange(i)),this._register(ZW.onDidChange(i)),this._register(e3.onDidChange(i)),this._register(zD.onDidChange(i)),this._register(Ng.onDidChange(i)),this._register(m0.onDidChange(i)),this._register(bC.onDidChange(i)),i()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(Ag.has(e)),this._hasCodeActionsProvider.set(Vm.has(e)),this._hasCodeLensProvider.set(Pv.has(e)),this._hasDefinitionProvider.set(wx.has(e)),this._hasDeclarationProvider.set(n3.has(e)),this._hasImplementationProvider.set(i3.has(e)),this._hasTypeDefinitionProvider.set(s3.has(e)),this._hasHoverProvider.set(Sx.has(e)),this._hasDocumentHighlightProvider.set(gR.has(e)),this._hasDocumentSymbolProvider.set(kf.has(e)),this._hasReferenceProvider.set(ZW.has(e)),this._hasRenameProvider.set(e3.has(e)),this._hasSignatureHelpProvider.set(m0.has(e)),this._hasInlayHintsProvider.set(bC.has(e)),this._hasDocumentFormattingProvider.set(zD.has(e)||Ng.has(e)),this._hasDocumentSelectionFormattingProvider.set(Ng.has(e)),this._hasMultipleDocumentFormattingProvider.set(zD.all(e).length+Ng.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(Ng.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Ii.walkThroughSnippet)})}}class r1t extends wt{constructor(e){super(),this._onChange=this._register(new rt),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(dR(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}const l1t=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),a1t=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function w7(n){return l1t+encodeURIComponent(n.toString())+a1t}const c1t=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),u1t=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function d1t(n){return c1t+encodeURIComponent(n.toString())+u1t}ws((n,e)=>{const t=n.getColor(H1e);t&&e.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${t}; }`);const i=n.getColor(a$);i&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${w7(i)}") repeat-x bottom left; }`);const s=n.getColor(ASt);s&&e.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${s}; }`);const o=n.getColor(T6);o&&e.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${o}; }`);const r=n.getColor(qv);r&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${w7(r)}") repeat-x bottom left; }`);const a=n.getColor(NSt);a&&e.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const c=n.getColor(Rie);c&&e.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${c}; }`);const u=n.getColor(Kg);u&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${w7(u)}") repeat-x bottom left; }`);const d=n.getColor(DSt);d&&e.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${d}; }`);const f=n.getColor(xSt);f&&e.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${f}; }`);const g=n.getColor($St);g&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${d1t(g)}") no-repeat bottom left; }`);const p=n.getColor(dwt);p&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${p.rgba.a}; }`);const _=n.getColor(uwt);_&&e.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${_}; }`);const v=n.getColor(PC)||"inherit";e.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${v}}`)});class Zs{constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new rt({onFirstListenerAdd:()=>e.addEventListener(t,s,i),onLastListenerRemove:()=>e.removeEventListener(t,s,i)})}get event(){return this.emitter.event}dispose(){this.emitter.dispose()}}function Cge(n){return n.preventDefault(),n.stopPropagation(),n}var CM=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let h1t=!1;var G3;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(G3||(G3={}));let f1t=4;const g1t=new rt;let p1t=300;const m1t=new rt;class qie{constructor(){this.disposables=new Wt}get onPointerMove(){return this.disposables.add(new Zs(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Zs(window,"mouseup")).event}dispose(){this.disposables.dispose()}}CM([Vr],qie.prototype,"onPointerMove",null);CM([Vr],qie.prototype,"onPointerUp",null);class Jie{constructor(e){this.el=e,this.disposables=new Wt}get onPointerMove(){return this.disposables.add(new Zs(this.el,so.Change)).event}get onPointerUp(){return this.disposables.add(new Zs(this.el,so.End)).event}dispose(){this.disposables.dispose()}}CM([Vr],Jie.prototype,"onPointerMove",null);CM([Vr],Jie.prototype,"onPointerUp",null);class z3{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}CM([Vr],z3.prototype,"onPointerMove",null);CM([Vr],z3.prototype,"onPointerUp",null);class ca extends wt{constructor(e,t,i){super(),this.hoverDelay=p1t,this.hoverDelayer=this._register(new db(this.hoverDelay)),this._state=3,this._onDidEnablementChange=this._register(new rt),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new rt),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new rt),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new rt),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new Wt),this.orthogonalStartDragHandleDisposables=this._register(new Wt),this.orthogonalEndSashDisposables=this._register(new Wt),this.orthogonalEndDragHandleDisposables=this._register(new Wt),this.el=Nt(e,Vt(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),ki&&this.el.classList.add("mac");const s=this._register(new Zs(this.el,"mousedown")).event;this._register(s(f=>this.onPointerStart(f,new qie),this));const o=this._register(new Zs(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new Zs(this.el,"mouseenter")).event;this._register(r(()=>ca.onMouseEnter(this)));const a=this._register(new Zs(this.el,"mouseleave")).event;this._register(a(()=>ca.onMouseLeave(this))),this._register(Ds.addTarget(this.el));const c=Ln.map(this._register(new Zs(this.el,so.Start)).event,f=>{var g;return Object.assign(Object.assign({},f),{target:(g=f.initialTarget)!==null&&g!==void 0?g:null})});this._register(c(f=>this.onPointerStart(f,new Jie(this.el)),this));const u=this._register(new Zs(this.el,so.Tap)).event,d=Ln.map(Ln.filter(Ln.debounce(u,(f,g)=>{var p;return{event:g,count:((p=f==null?void 0:f.count)!==null&&p!==void 0?p:0)+1}},250),({count:f})=>f===2),({event:f})=>{var g;return Object.assign(Object.assign({},f),{target:(g=f.initialTarget)!==null&&g!==void 0?g:null})});this._register(d(this.onPointerDoublePress,this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=f1t,this._register(g1t.event(f=>{this.size=f,this.layout()}))),this._register(m1t.event(f=>this.hoverDelay=f)),this.hidden=!1,this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",h1t),this.layout()}get state(){return this._state}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this._onDidEnablementChange.fire(e))}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=Nt(this.el,Vt(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(xi(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Zs(this._orthogonalStartDragHandle,"mouseenter")).event(()=>ca.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Zs(this._orthogonalStartDragHandle,"mouseleave")).event(()=>ca.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=Nt(this.el,Vt(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(xi(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Zs(this._orthogonalEndDragHandle,"mouseenter")).event(()=>ca.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Zs(this._orthogonalEndDragHandle,"mouseleave")).event(()=>ca.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){Rs.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const _=this.getOrthogonalSash(e);_&&(i=!0,e.__orthogonalSashEvent=!0,_.onPointerStart(e,new z3(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new z3(t))),!this.state)return;const s=Kvt("iframe");for(const _ of s)_.style.pointerEvents="none";const o=e.pageX,r=e.pageY,a=e.altKey,c={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const u=kd(this.el),d=()=>{let _="";i?_="all-scroll":this.orientation===1?this.state===1?_="s-resize":this.state===2?_="n-resize":_=ki?"row-resize":"ns-resize":this.state===1?_="e-resize":this.state===2?_="w-resize":_=ki?"col-resize":"ew-resize",u.textContent=`* { cursor: ${_} !important; }`},f=new Wt;d(),i||this.onDidEnablementChange(d,null,f);const g=_=>{Rs.stop(_,!1);const v={startX:o,currentX:_.pageX,startY:r,currentY:_.pageY,altKey:a};this._onDidChange.fire(v)},p=_=>{Rs.stop(_,!1),this.el.removeChild(u),this.el.classList.remove("active"),this._onDidEnd.fire(),f.dispose();for(const v of s)v.style.pointerEvents="auto"};t.onPointerMove(g,null,f),t.onPointerUp(p,null,f),f.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&ca.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&ca.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){ca.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}hide(){this.hidden=!0,this.el.style.display="none",this.el.setAttribute("aria-hidden","true")}getOrthogonalSash(e){if(!(!e.target||!(e.target instanceof HTMLElement))&&e.target.classList.contains("orthogonal-drag-handle"))return e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const Qie=ss("IEditorCancelService"),COe=new Sn("cancellableOperation",!1,$("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Fy(Qie,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=COe.bindTo(s.get(ai)),r=new Cd;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},!0);class _1t extends dc{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(Qie).add(e,this))}dispose(){this._unregister(),super.dispose()}}Xt(new class extends jl{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:COe})}runEditorCommand(n,e){n.get(Qie).cancel(e)}});let yOe=class mJ{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?ha("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof mJ))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new mJ(e,this.flags))}};class Qx extends _1t{constructor(e,t,i,s){super(e,s),this._listener=new Wt,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!be.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!be.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class Zie extends dc{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class hy{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(e.getScrollTop()!==0){const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new hy(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}const EOe={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Cf.text,TERMINALS:"Terminals"};class v1t{constructor(e){this.data=e}update(){}getData(){return this.data}}const Tv={CurrentDragAndDropData:void 0};class w0 extends wt{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Pf&&this._register(t.onDidChange(s=>{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new bR)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Ds.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,ac&&this._register(Pt(e,An.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(EOe.TEXT,this._action.label)}))),this._register(Pt(t,so.Tap,s=>this.onClick(s,!0))),this._register(Pt(t,An.MOUSE_DOWN,s=>{i||Rs.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),ki&&this._register(Pt(t,An.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(Pt(t,An.CLICK,s=>{Rs.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(Pt(t,An.DBLCLICK,s=>{Rs.stop(s,!0)})),[An.MOUSE_UP,An.MOUSE_OUT].forEach(s=>{this._register(Pt(t,s,o=>{Rs.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;Rs.stop(e,!0);const s=md(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class Zx extends w0{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Nt(this.element,Vt("a.action-label"))),this.label&&(this._action.id===Ff.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(Nt(this.element,Vt("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=$({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}var b1t=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class pb extends wt{constructor(e,t={}){var i,s,o,r,a,c;super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new rt),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new rt({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new rt),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new rt),this.onBeforeRun=this._onBeforeRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(c=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&c!==void 0?c:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new bR,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(f=>this._onDidRun.fire(f))),this._register(this._actionRunner.onBeforeRun(f=>this._onBeforeRun.fire(f))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let u,d;switch(this._orientation){case 0:u=[15],d=[17];break;case 1:u=[16],d=[18],this.domNode.className+=" vertical";break}this._register(Pt(this.domNode,An.KEY_DOWN,f=>{const g=new Po(f);let p=!0;const _=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(g.equals(u[0])||g.equals(u[1]))?p=this.focusPrevious():d&&(g.equals(d[0])||g.equals(d[1]))?p=this.focusNext():g.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():g.equals(14)?p=this.focusFirst():g.equals(13)?p=this.focusLast():g.equals(2)&&_ instanceof w0&&_.trapsArrowNavigation?p=this.focusNext():this.isTriggerKeyEvent(g)?this._triggerKeys.keyDown?this.doTrigger(g):this.triggerKeyDown=!0:p=!1,p&&(g.preventDefault(),g.stopPropagation())})),this._register(Pt(this.domNode,An.KEY_UP,f=>{const g=new Po(f);this.isTriggerKeyEvent(g)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(g)),g.preventDefault(),g.stopPropagation()):(g.equals(2)||g.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(dR(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(_O()===this.domNode||!Pm(_O(),this.domNode))&&(this._onDidBlur.fire(),this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(Pm(_O(),t)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){e&&(this._actionRunner=e,this.viewItems.forEach(t=>t.actionRunner=e))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let s=X0(t.index)?t.index:null;i.forEach(o=>{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(Pt(r,An.CONTEXT_MENU,c=>{Rs.stop(c,!0)}));let a;this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o)),a||(a=new Zx(this.context,o,t)),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof w0&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a),this._actionIds.push(o.id)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),this._actionIds.splice(s,0,o.id),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem)}clear(){Ji(this.viewItems),this.viewItems=[],this._actionIds=[],wl(this.actionsList)}length(){return this.viewItems.length}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus()}else i!==void 0&&(this.focusedItem=i),this.updateFocus()}focusFirst(){return this.focusedItem=this.length()>1?1:0,this.focusPrevious()}focusLast(){return this.focusedItem=this.length()<2?0:this.length()-2,this.focusNext()}focusNext(){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(),!0}focusPrevious(){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(!0),!0}updateFocus(e,t){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t});for(let i=0;i<this.viewItems.length;i++){const s=this.viewItems[i],o=s;if(i===this.focusedItem){let r=!0;GD(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&GD(s.isEnabled)&&!s.isEnabled()&&(r=!1),r?o.focus(e):this.actionsList.focus({preventScroll:t})}else GD(o.blur)&&o.blur()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof w0){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return b1t(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){Ji(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}const T1t={IconContribution:"base.contributions.icons"};class C1t{constructor(){this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:$("iconDefintion.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:$("iconDefintion.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Lu.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const c=this.iconReferenceSchema.enum.indexOf(e);c!==-1&&(this.iconReferenceSchema.enumDescriptions[c]=i),this._onDidChange.fire()}return o}let r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;let a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;mo.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`};let i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${mo.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!mo.isThemeIcon(r.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join(`
- `)}}const ow=new C1t;br.add(T1t.IconContribution,ow);function Xl(n,e,t,i){return ow.registerIcon(n,e,t,i)}function y1t(){return ow}function E1t(){for(const n of JW.all)ow.registerIcon(n.id,n.definition,n.description);JW.onDidRegister(n=>ow.registerIcon(n.id,n.definition,n.description))}E1t();const SOe="vscode://schemas/icons";let wOe=br.as(e6.JSONContribution);wOe.registerSchema(SOe,ow.getIconSchema());const yge=new ho(()=>wOe.notifySchemaChanged(SOe),200);ow.onDidChange(()=>{yge.isScheduled()||yge.schedule()});const S1t=Xl("widget-close",vn.close,$("widgetClose","Icon for the close action in widgets."));var w1t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},I1t=function(n,e){return function(t,i){e(t,i,n)}},L1t=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},I7;const uV=3;class BN{constructor(e,t,i,s){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=s}getType(){return this.originalLineStart===0?1:this.modifiedLineStart===0?2:0}}class L7{constructor(e){this.entries=e}}const O1t=Xl("diff-review-insert",vn.add,$("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),R1t=Xl("diff-review-remove",vn.remove,$("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),M1t=Xl("diff-review-close",vn.close,$("diffReviewCloseIcon","Icon for 'Close' in diff review."));let K3=class bS extends wt{constructor(e,t){super(),this._modeService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=qi(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=qi(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new pb(this.actionBarContainer.domNode)),this._actionBar.push(new Pf("diffreview.close",$("label.close","Close"),"close-diff-review "+mo.asClassName(M1t),!0,()=>L1t(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=qi(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=qi(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new RF(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{this._isVisible&&(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{this._isVisible&&this._render()})),this._register(Br(this.domNode.domNode,"click",i=>{i.preventDefault();let s=YIe(i.target,"diff-review-row");s&&this._goToRow(s)})),this._register(Br(this.domNode.domNode,"keydown",i=>{(i.equals(18)||i.equals(2066)||i.equals(530))&&(i.preventDefault(),this._goToRow(this._getNextRow())),(i.equals(16)||i.equals(2064)||i.equals(528))&&(i.preventDefault(),this._goToRow(this._getPrevRow())),(i.equals(9)||i.equals(2057)||i.equals(521)||i.equals(1033))&&(i.preventDefault(),this.hide()),(i.equals(10)||i.equals(3))&&(i.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let s=0,o=this._diffs.length;s<o;s++)if(this._diffs[s]===this._currentDiff){i=s;break}e=this._diffs.length+i-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs.length===0)return;e=e%this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new ct(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let s=0,o=this._diffs.length;s<o;s++)if(this._diffs[s]===this._currentDiff){i=s;break}e=i+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs.length===0)return;e=e%this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new ct(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}accept(){let e=-1,t=this._getCurrentFocusedRow();if(t){let i=parseInt(t.getAttribute("data-line"),10);isNaN(i)||(e=i)}this.hide(),e!==-1&&(this._diffEditor.setPosition(new ct(e,1)),this._diffEditor.revealPosition(new ct(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){let e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){let e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){let e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e){let t=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),t&&t!==e&&(t.tabIndex=-1),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,i){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(i),this._content.setHeight(i),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const e=this._diffEditor.getLineChanges();if(!e||e.length===0)return[];const t=this._diffEditor.getOriginalEditor().getModel(),i=this._diffEditor.getModifiedEditor().getModel();return!t||!i?[]:bS._mergeAdjacent(e,t.getLineCount(),i.getLineCount())}static _mergeAdjacent(e,t,i){if(!e||e.length===0)return[];let s=[],o=0;for(let u=0,d=e.length;u<d;u++){const f=e[u],g=f.originalStartLineNumber,p=f.originalEndLineNumber,_=f.modifiedStartLineNumber,v=f.modifiedEndLineNumber;let C=[],y=0;{const w=p===0?g:g-1,I=v===0?_:_-1;let L=1,O=1;if(u>0){const D=e[u-1];D.originalEndLineNumber===0?L=D.originalStartLineNumber+1:L=D.originalEndLineNumber+1,D.modifiedEndLineNumber===0?O=D.modifiedStartLineNumber+1:O=D.modifiedEndLineNumber+1}let A=w-uV+1,N=I-uV+1;if(A<L){const D=L-A;A=A+D,N=N+D}if(N<O){const D=O-N;A=A+D,N=N+D}C[y++]=new BN(A,w,N,I)}p!==0&&(C[y++]=new BN(g,p,0,0)),v!==0&&(C[y++]=new BN(0,0,_,v));{const w=p===0?g+1:p+1,I=v===0?_+1:v+1;let L=t,O=i;if(u+1<d){const D=e[u+1];D.originalEndLineNumber===0?L=D.originalStartLineNumber:L=D.originalStartLineNumber-1,D.modifiedEndLineNumber===0?O=D.modifiedStartLineNumber:O=D.modifiedStartLineNumber-1}let A=w+uV-1,N=I+uV-1;if(A>L){const D=L-A;A=A+D,N=N+D}if(N>O){const D=O-N;A=A+D,N=N+D}C[y++]=new BN(w,A,I,N)}s[o++]=new L7(C)}let r=s[0].entries,a=[],c=0;for(let u=1,d=s.length;u<d;u++){const f=s[u].entries,g=r[r.length-1],p=f[0];if(g.getType()===0&&p.getType()===0&&p.originalLineStart<=g.originalLineEnd){r[r.length-1]=new BN(g.originalLineStart,p.originalLineEnd,g.modifiedLineStart,p.modifiedLineEnd),r=r.concat(f.slice(1));continue}a[c++]=new L7(r),r=f}return a[c++]=new L7(r),a}_findDiffIndex(e){const t=e.lineNumber;for(let i=0,s=this._diffs.length;i<s;i++){const o=this._diffs[i].entries,r=o[o.length-1].modifiedLineEnd;if(t<=r)return i}return 0}_render(){const e=this._diffEditor.getOriginalEditor().getOptions(),t=this._diffEditor.getModifiedEditor().getOptions(),i=this._diffEditor.getOriginalEditor().getModel(),s=this._diffEditor.getModifiedEditor().getModel(),o=i.getOptions(),r=s.getOptions();if(!this._isVisible||!i||!s){wl(this._content.domNode),this._currentDiff=null,this.scrollbar.scanDomNode();return}this._diffEditor.updateOptions({readOnly:!0});const a=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[a]===this._currentDiff)return;this._currentDiff=this._diffs[a];const c=this._diffs[a].entries;let u=document.createElement("div");u.className="diff-review-table",u.setAttribute("role","list"),u.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),Ea.applyFontInfoSlow(u,t.get(43));let d=0,f=0,g=0,p=0;for(let N=0,D=c.length;N<D;N++){const P=c[N],F=P.originalLineStart,V=P.originalLineEnd,U=P.modifiedLineStart,Q=P.modifiedLineEnd;F!==0&&(d===0||F<d)&&(d=F),V!==0&&(f===0||V>f)&&(f=V),U!==0&&(g===0||U<g)&&(g=U),Q!==0&&(p===0||Q>p)&&(p=Q)}let _=document.createElement("div");_.className="diff-review-row";let v=document.createElement("div");v.className="diff-review-cell diff-review-summary";const C=f-d+1,y=p-g+1;v.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${d},${C} +${g},${y} @@`)),_.setAttribute("data-line",String(g));const w=N=>N===0?$("no_lines_changed","no lines changed"):N===1?$("one_line_changed","1 line changed"):$("more_lines_changed","{0} lines changed",N),I=w(C),L=w(y);_.setAttribute("aria-label",$({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,d,I,g,L)),_.appendChild(v),_.setAttribute("role","listitem"),u.appendChild(_);const O=t.get(58);let A=g;for(let N=0,D=c.length;N<D;N++){const P=c[N];bS._renderSection(u,P,A,O,this._width,e,i,o,t,s,r,this._modeService.languageIdCodec),P.modifiedLineStart!==0&&(A=P.modifiedLineEnd)}wl(this._content.domNode),this._content.domNode.appendChild(u),this.scrollbar.scanDomNode()}static _renderSection(e,t,i,s,o,r,a,c,u,d,f,g){const p=t.getType();let _="diff-review-row",v="";const C="diff-review-spacer";let y=null;switch(p){case 1:_="diff-review-row line-insert",v=" char-insert",y=O1t;break;case 2:_="diff-review-row line-delete",v=" char-delete",y=R1t;break}const w=t.originalLineStart,I=t.originalLineEnd,L=t.modifiedLineStart,O=t.modifiedLineEnd,A=Math.max(O-L,I-w),N=r.get(129),D=N.glyphMarginWidth+N.lineNumbersWidth,P=u.get(129),F=10+P.glyphMarginWidth+P.lineNumbersWidth;for(let V=0;V<=A;V++){const U=w===0?0:w+V,Q=L===0?0:L+V,de=document.createElement("div");de.style.minWidth=o+"px",de.className=_,de.setAttribute("role","listitem"),Q!==0&&(i=Q),de.setAttribute("data-line",String(i));let q=document.createElement("div");q.className="diff-review-cell",q.style.height=`${s}px`,de.appendChild(q);const K=document.createElement("span");K.style.width=D+"px",K.style.minWidth=D+"px",K.className="diff-review-line-number"+v,U!==0?K.appendChild(document.createTextNode(String(U))):K.innerText=" ",q.appendChild(K);const re=document.createElement("span");re.style.width=F+"px",re.style.minWidth=F+"px",re.style.paddingRight="10px",re.className="diff-review-line-number"+v,Q!==0?re.appendChild(document.createTextNode(String(Q))):re.innerText=" ",q.appendChild(re);const Z=document.createElement("span");if(Z.className=C,y){const ve=document.createElement("span");ve.className=mo.asClassName(y),ve.innerText=" ",Z.appendChild(ve)}else Z.innerText=" ";q.appendChild(Z);let J;if(Q!==0){let ve=this._renderLine(d,u,f.tabSize,Q,g);bS._ttPolicy&&(ve=bS._ttPolicy.createHTML(ve)),q.insertAdjacentHTML("beforeend",ve),J=d.getLineContent(Q)}else{let ve=this._renderLine(a,r,c.tabSize,U,g);bS._ttPolicy&&(ve=bS._ttPolicy.createHTML(ve)),q.insertAdjacentHTML("beforeend",ve),J=a.getLineContent(U)}J.length===0&&(J=$("blankLine","blank"));let ge="";switch(p){case 0:U===Q?ge=$({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",J,U):ge=$("equalLine","{0} original line {1} modified line {2}",J,U,Q);break;case 1:ge=$("insertLine","+ {0} modified line {1}",J,Q);break;case 2:ge=$("deleteLine","- {0} original line {1}",J,U);break}de.setAttribute("aria-label",ge),e.appendChild(de)}}static _renderLine(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(43),c=El.createEmpty(r,o),u=Dd.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Dd.containsRTL(r,u,e.mightContainRTL());return n6(new Hw(a.isMonospace&&!t.get(29),a.canUseHalfwidthRightwardsArrow,r,!1,u,d,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(104),t.get(87),t.get(82),t.get(44)!==gd.OFF,null)).html}};K3._ttPolicy=(I7=window.trustedTypes)===null||I7===void 0?void 0:I7.createPolicy("diffReview",{createHTML:n=>n});K3=w1t([I1t(1,Ga)],K3);ws((n,e)=>{const t=n.getColor(q1e);t&&e.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${t}; }`);const i=n.getColor(OF);i&&e.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${i} 0 -6px 6px -6px inset; }`)});class k1t extends yn{constructor(){super({id:"editor.action.diffReview.next",label:$("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:dn.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=IOe(e);i&&i.diffReviewNext()}}class A1t extends yn{constructor(){super({id:"editor.action.diffReview.prev",label:$("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:dn.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=IOe(e);i&&i.diffReviewPrev()}}function IOe(n){const e=n.get(hs),t=e.listDiffEditors(),i=e.getActiveCodeEditor();if(!i)return null;for(let s=0,o=t.length;s<o;s++){const r=t[s];if(r.getModifiedEditor().getId()===i.getId()||r.getOriginalEditor().getId()===i.getId())return r}return null}qt(k1t);qt(A1t);const Hy=ss("contextViewService"),Vy=ss("contextMenuService");var O7=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class N1t extends wt{constructor(e,t,i,s,o,r){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=i,this.diff=s,this._contextMenuService=o,this._clipboardService=r,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=vn.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const a=i.getOption(58),c=i.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${a}px`,this._diffActions.style.lineHeight=`${a}px`,this._marginDomNode.appendChild(this._diffActions);const u=[],d=s.modifiedEndLineNumber===0;u.push(new Pf("diff.clipboard.copyDeletedContent",d?s.originalEndLineNumber>s.modifiedStartLineNumber?$("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):$("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.originalEndLineNumber>s.modifiedStartLineNumber?$("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):$("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>O7(this,void 0,void 0,function*(){const v=new be(s.originalStartLineNumber,1,s.originalEndLineNumber+1,1),C=s.originalModel.getValueInRange(v);yield this._clipboardService.writeText(C)})));let f=0,g;s.originalEndLineNumber>s.modifiedStartLineNumber&&(g=new Pf("diff.clipboard.copyDeletedLineContent",d?$("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.originalStartLineNumber):$("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.originalStartLineNumber),void 0,!0,()=>O7(this,void 0,void 0,function*(){const v=s.originalModel.getLineContent(s.originalStartLineNumber+f);if(v===""){const C=s.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(C===0?`
- `:`\r
- `)}else yield this._clipboardService.writeText(v)})),u.push(g)),i.getOption(80)||u.push(new Pf("diff.inline.revertChange",$("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>O7(this,void 0,void 0,function*(){const v=new be(s.originalStartLineNumber,1,s.originalEndLineNumber,s.originalModel.getLineMaxColumn(s.originalEndLineNumber)),C=s.originalModel.getValueInRange(v);if(s.modifiedEndLineNumber===0){const y=i.getModel().getLineMaxColumn(s.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new be(s.modifiedStartLineNumber,y,s.modifiedStartLineNumber,y),text:c+C}])}else{const y=i.getModel().getLineMaxColumn(s.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new be(s.modifiedStartLineNumber,1,s.modifiedEndLineNumber,y),text:C}])}})));const _=(v,C)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:v,y:C}),getActions:()=>(g&&(g.label=d?$("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.originalStartLineNumber+f):$("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.originalStartLineNumber+f)),u),autoSelectFirstItem:!0})};this._register(Br(this._diffActions,"mousedown",v=>{const{top:C,height:y}=Bl(this._diffActions);let w=Math.floor(a/3);v.preventDefault(),_(v.posx,C+y+w)})),this._register(i.onMouseMove(v=>{v.target.type===8||v.target.type===5?v.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,f=this._updateLightBulbPosition(this._marginDomNode,v.event.browserEvent.y,a)):this.visibility=!1:this.visibility=!1})),this._register(i.onMouseDown(v=>{v.event.rightButton&&(v.target.type===8||v.target.type===5)&&v.target.detail.viewZoneId===this._viewZoneId&&(v.event.preventDefault(),f=this._updateLightBulbPosition(this._marginDomNode,v.event.browserEvent.y,a),_(v.event.posx,v.event.posy+a))}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,e?this._diffActions.style.visibility="visible":this._diffActions.style.visibility="hidden")}_updateLightBulbPosition(e,t,i){const{top:s}=Bl(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this.diff.viewLineCounts){let c=0;for(let u=0;u<this.diff.viewLineCounts.length;u++)if(c+=this.diff.viewLineCounts[u],r<c)return u}return r}}const Uy=ss("clipboardService");class zw{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}zw.None=Object.freeze({report(){}});const Mb=ss("editorProgressService");var D1t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dv=function(n,e){return function(t,i){e(t,i,n)}},R7;class Ege{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(t=>!this._zonesMap[String(t.id)])}clean(e){this._zones.length>0&&e.changeViewZones(t=>{for(const i of this._zones)t.removeZone(i)}),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,i,s){const o=s?hy.capture(e):null;e.changeViewZones(r=>{var a;for(const c of this._zones)r.removeZone(c);for(const c of this._inlineDiffMargins)c.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let c=0,u=i.zones.length;c<u;c++){const d=i.zones[c];d.suppressMouseDown=!0;const f=r.addZone(d);this._zones.push(f),this._zonesMap[String(f)]=!0,i.zones[c].diff&&d.marginDomNode&&(d.suppressMouseDown=!1,((a=i.zones[c].diff)===null||a===void 0?void 0:a.originalModel.getValueLength())!==0&&this._inlineDiffMargins.push(new N1t(f,d.marginDomNode,e,i.zones[c].diff,this._contextMenuService,this._clipboardService)))}}),o&&o.restore(e),this._decorations=e.deltaDecorations(this._decorations,i.decorations),t&&t.setZones(i.overviewZones)}}let $1t=0;const x1t=Xl("diff-insert",vn.add,$("diffInsertIcon","Line decoration for inserts in the diff editor.")),LOe=Xl("diff-remove",vn.remove,$("diffRemoveIcon","Line decoration for removals in the diff editor.")),Sge=(R7=window.trustedTypes)===null||R7===void 0?void 0:R7.createPolicy("diffEditorWidget",{createHTML:n=>n});let fy=class oa extends wt{constructor(e,t,i,s,o,r,a,c,u,d,f,g){super(),this._editorProgressService=g,this._onDidDispose=this._register(new rt),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new rt),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new rt),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=o,this._codeEditorService=c,this._contextKeyService=this._register(r.createScoped(e)),this._instantiationService=a.createChild(new qx([ai,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=u,this._notificationService=d,this._id=++$1t,this._state=0,this._updatingDiffProgress=null,this._domElement=e,t=t||{},this._options=Lge(t,{enableSplitViewResizing:!0,renderSideBySide:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit"}),typeof t.isInEmbeddedEditor<"u"?this._contextKeyService.createKey("isInEmbeddedDiffEditor",t.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new ho(()=>this._updateDecorations(),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=oa._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=qi(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(Br(this._overviewDomElement,"mousedown",_=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(_)})),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new Ege(f,s),this._modifiedEditorState=new Ege(f,s),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new _1e(this._containerDomElement,t.dimension,()=>this._onDidContainerSizeChanged())),t.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(t,i.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(t,i.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=a.createInstance(K3,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new Bv(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new Ige(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(u.onDidColorThemeChange(_=>{this._strategy&&this._strategy.applyColors(_)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=oa._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)}));const p=EO.getDiffEditorContributions();for(const _ of p)try{this._register(a.createInstance(_.ctor,this))}catch(v){di(v)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),this._state===1&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=I3(e.type),i}_recreateOverviewRulers(){this._options.renderOverviewRuler&&(this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(e,t){const i=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(e),t);this._register(i.onDidScrollChange(o=>{this._isHandlingScrollEvent||!o.scrollTopChanged&&!o.scrollLeftChanged&&!o.scrollHeightChanged||(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(i.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(i.onDidChangeConfiguration(o=>{i.getModel()&&(o.hasChanged(43)&&this._updateDecorationsRunner.schedule(),o.hasChanged(130)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(i.onDidChangeHiddenAreas(()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()})),this._register(i.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const s=this._contextKeyService.createKey("isInDiffLeftEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget(()=>s.set(!0))),this._register(i.onDidBlurEditorWidget(()=>s.set(!1))),this._register(i.onDidContentSizeChange(o=>{const r=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+oa.ONE_OVERVIEW_WIDTH,a=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:a,contentWidth:r,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),i}_createRightHandSideEditor(e,t){const i=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(e),t);this._register(i.onDidScrollChange(o=>{this._isHandlingScrollEvent||!o.scrollTopChanged&&!o.scrollLeftChanged&&!o.scrollHeightChanged||(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(i.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(i.onDidChangeConfiguration(o=>{i.getModel()&&(o.hasChanged(43)&&this._updateDecorationsRunner.schedule(),o.hasChanged(130)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(i.onDidChangeHiddenAreas(()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()})),this._register(i.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(i.onDidChangeModelOptions(o=>{o.tabSize&&this._updateDecorationsRunner.schedule()}));const s=this._contextKeyService.createKey("isInDiffRightEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget(()=>s.set(!0))),this._register(i.onDidBlurEditorWidget(()=>s.set(!1))),this._register(i.onDidContentSizeChange(o=>{const r=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+oa.ONE_OVERVIEW_WIDTH,a=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:a,contentWidth:r,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),i}_createInnerEditor(e,t,i,s){return e.createInstance(Jx,t,i,s)}dispose(){this._codeEditorService.removeDiffEditor(this),this._beginUpdateDecorationsTimeout!==-1&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return TF.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(e){const t=Lge(e,this._options),i=H1t(this._options,t);this._options=t;const s=i.ignoreTrimWhitespace||i.renderIndicators,o=this._isVisible&&(i.maxComputationTime||i.maxFileSize);s?this._beginUpdateDecorations():o&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(e)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(e)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),i.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new Bv(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new Ige(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=oa._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),i.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e){this._modifiedEditor.setPosition(e)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e){this._modifiedEditor.setSelection(e)}setSelections(e){this._modifiedEditor.setSelections(e)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._modifiedEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){const e=this._originalEditor.saveViewState(),t=this._modifiedEditor.saveViewState();return{original:e,modified:t}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler||!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const e=this._elementSizeObserver.getHeight(),t=this._getReviewHeight(),i=oa.ENTIRE_DIFF_OVERVIEW_WIDTH-2*oa.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:oa.ONE_OVERVIEW_WIDTH,right:i+oa.ONE_OVERVIEW_WIDTH,height:e-t}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:oa.ONE_OVERVIEW_WIDTH,height:e-t}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){this._beginUpdateDecorationsTimeout!==-1&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout(()=>this._beginUpdateDecorations(),oa.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t?!0:!e||!t?!1:e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const e=this._originalEditor.getModel(),t=this._modifiedEditor.getModel();if(!e||!t)return;this._diffComputationToken++;const i=this._diffComputationToken,s=this._options.maxFileSize*1024*1024,o=r=>{const a=r.getValueLength();return s===0||a<=s};if(!o(e)||!o(t)){(!oa._equals(e.uri,this._lastOriginalWarning)||!oa._equals(t.uri,this._lastModifiedWarning))&&(this._lastOriginalWarning=e.uri,this._lastModifiedWarning=t.uri,this._notificationService.warn($("diff.tooLarge","Cannot compare files because one file is too large.")));return}this._setState(1),this._editorWorkerService.computeDiff(e.uri,t.uri,this._options.ignoreTrimWhitespace,this._options.maxComputationTime).then(r=>{i===this._diffComputationToken&&e===this._originalEditor.getModel()&&t===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=r,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())},r=>{i===this._diffComputationToken&&e===this._originalEditor.getModel()&&t===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())})}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),s=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,s.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,s.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:t.wordWrapOverride1="off",e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._options.originalEditable,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(e){const t=this._adjustOptionsForSubEditor(e);return e.modifiedAriaLabel&&(t.ariaLabel=e.modifiedAriaLabel),t.wordWrapOverride1=this._options.diffWordWrap,t.revealHorizontalRightPadding=pp.revealHorizontalRightPadding.defaultValue+oa.ENTIRE_DIFF_OVERVIEW_WIDTH,t.scrollbar.verticalHasArrows=!1,t.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const e=this._elementSizeObserver.getWidth(),t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),s=this._strategy.layout();this._originalDomNode.style.width=s+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=e-s+"px",this._modifiedDomNode.style.left=s+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=t-i+"px",this._overviewDomElement.style.width=oa.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=e-oa.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(oa.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:s,height:t-i}),this._modifiedEditor.layout({width:e-s-(this._options.renderOverviewRuler?oa.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:t-i}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(t-i,e,i),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),s=Math.max(0,e.height),o=Math.max(0,s-2*0),r=i>0?o/i:0,a=Math.max(0,Math.floor(e.height*r)),c=Math.floor(t*r);return{height:a,top:c}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(i.length===0||e<t(i[0]))return null;let s=0,o=i.length-1;for(;s<o;){const r=Math.floor((s+o)/2),a=t(i[r]),c=r+1<=o?t(i[r+1]):1073741824;e<a?o=r-1:e>=c?s=r+1:(s=r,o=r)}return i[s]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,c=>c.originalStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),s=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,a=e-i;return a<=o?s+Math.min(a,r):s+r-o+a}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,c=>c.modifiedStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),s=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,a=e-s;return a<=r?i+Math.min(a,o):i+o-r+a}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};fy.ONE_OVERVIEW_WIDTH=15;fy.ENTIRE_DIFF_OVERVIEW_WIDTH=30;fy.UPDATE_DIFF_DECORATIONS_DELAY=200;fy=D1t([dv(3,Uy),dv(4,eg),dv(5,ai),dv(6,Qi),dv(7,hs),dv(8,fo),dv(9,Hr),dv(10,Vy),dv(11,Mb)],fy);class OOe extends wt{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(V1e)||iJ).transparent(2),i=(e.getColor(U1e)||sJ).transparent(2),s=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,s}getEditorsDiffDecorations(e,t,i,s,o){o=o.sort((u,d)=>u.afterLineNumber-d.afterLineNumber),s=s.sort((u,d)=>u.afterLineNumber-d.afterLineNumber);const r=this._getViewZones(e,s,o,i),a=this._getOriginalEditorDecorations(e,t,i),c=this._getModifiedEditorDecorations(e,t,i);return{original:{decorations:a.decorations,overviewZones:a.overviewZones,zones:r.original},modified:{decorations:c.decorations,overviewZones:c.overviewZones,zones:r.modified}}}}class wge{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class QS{constructor(e,t,i,s,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=i,this._originalEditor=s,this._modifiedEditor=o}static _getViewLineCount(e,t,i){const s=e.getModel(),o=e._getViewModel();if(s&&o){const r=eP(s,o,t,i);return r.endLineNumber-r.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(58),t=this._modifiedEditor.getOption(58),i=this._originalEditor.getOption(130).wrappingColumn!==-1,s=this._modifiedEditor.getOption(130).wrappingColumn!==-1,o=i||s,r=this._originalEditor.getModel(),a=this._originalEditor._getViewModel().coordinatesConverter,c=this._modifiedEditor._getViewModel().coordinatesConverter,u={original:[],modified:[]};let d=0,f=0,g=0,p=0,_=0,v=0;const C=(A,N)=>A.afterLineNumber-N.afterLineNumber,y=(A,N)=>{if(N.domNode===null&&A.length>0){const D=A[A.length-1];if(D.afterLineNumber===N.afterLineNumber&&D.domNode===null){D.heightInLines+=N.heightInLines;return}}A.push(N)},w=new wge(this._modifiedForeignVZ),I=new wge(this._originalForeignVZ);let L=1,O=1;for(let A=0,N=this._lineChanges.length;A<=N;A++){const D=A<N?this._lineChanges[A]:null;D!==null?(g=D.originalStartLineNumber+(D.originalEndLineNumber>0?-1:0),p=D.modifiedStartLineNumber+(D.modifiedEndLineNumber>0?-1:0),f=D.originalEndLineNumber>0?QS._getViewLineCount(this._originalEditor,D.originalStartLineNumber,D.originalEndLineNumber):0,d=D.modifiedEndLineNumber>0?QS._getViewLineCount(this._modifiedEditor,D.modifiedStartLineNumber,D.modifiedEndLineNumber):0,_=Math.max(D.originalStartLineNumber,D.originalEndLineNumber),v=Math.max(D.modifiedStartLineNumber,D.modifiedEndLineNumber)):(g+=1e7+f,p+=1e7+d,_=g,v=p);let P=[],F=[];if(o){let Q;D?D.originalEndLineNumber>0?Q=D.originalStartLineNumber-L:Q=D.modifiedStartLineNumber-O:Q=r.getLineCount()-L;for(let de=0;de<Q;de++){const q=L+de,K=O+de,re=a.getModelLineViewLineCount(q),Z=c.getModelLineViewLineCount(K);re<Z?P.push({afterLineNumber:q,heightInLines:Z-re,domNode:null,marginDomNode:null}):re>Z&&F.push({afterLineNumber:K,heightInLines:re-Z,domNode:null,marginDomNode:null})}D&&(L=(D.originalEndLineNumber>0?D.originalEndLineNumber:D.originalStartLineNumber)+1,O=(D.modifiedEndLineNumber>0?D.modifiedEndLineNumber:D.modifiedStartLineNumber)+1)}for(;w.current&&w.current.afterLineNumber<=v;){let Q;w.current.afterLineNumber<=p?Q=g-p+w.current.afterLineNumber:Q=_;let de=null;D&&D.modifiedStartLineNumber<=w.current.afterLineNumber&&w.current.afterLineNumber<=D.modifiedEndLineNumber&&(de=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),P.push({afterLineNumber:Q,heightInLines:w.current.height/t,domNode:null,marginDomNode:de}),w.advance()}for(;I.current&&I.current.afterLineNumber<=_;){let Q;I.current.afterLineNumber<=g?Q=p-g+I.current.afterLineNumber:Q=v,F.push({afterLineNumber:Q,heightInLines:I.current.height/e,domNode:null}),I.advance()}if(D!==null&&OO(D)){const Q=this._produceOriginalFromDiff(D,f,d);Q&&P.push(Q)}if(D!==null&&RO(D)){const Q=this._produceModifiedFromDiff(D,f,d);Q&&F.push(Q)}let V=0,U=0;for(P=P.sort(C),F=F.sort(C);V<P.length&&U<F.length;){const Q=P[V],de=F[U],q=Q.afterLineNumber-g,K=de.afterLineNumber-p;q<K?(y(u.original,Q),V++):K<q?(y(u.modified,de),U++):Q.shouldNotShrink?(y(u.original,Q),V++):de.shouldNotShrink?(y(u.modified,de),U++):Q.heightInLines>=de.heightInLines?(Q.heightInLines-=de.heightInLines,U++):(de.heightInLines-=Q.heightInLines,V++)}for(;V<P.length;)y(u.original,P[V]),V++;for(;U<F.length;)y(u.modified,F[U]),U++}return{original:QS._ensureDomNodes(u.original),modified:QS._ensureDomNodes(u.modified)}}static _ensureDomNodes(e){return e.map(t=>(t.domNode||(t.domNode=ROe()),t))}}function Rv(n,e,t,i,s){return{range:new be(n,e,t,i),options:s}}const xc={charDelete:Ci.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:Ci.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:Ci.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:Ci.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:Ci.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:Ci.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+mo.asClassName(x1t),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:Ci.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:Ci.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+mo.asClassName(LOe),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:Ci.register({description:"diff-editor-line-delete-margin",marginClassName:"line-delete"})};class Bv extends OOe{constructor(e,t){super(e),this._disableSash=t===!1,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new ca(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart(()=>this._onSashDragStart()),this._sash.onDidChange(i=>this._onSashDrag(i)),this._sash.onDidEnd(()=>this._onSashDragEnd()),this._sash.onDidReset(()=>this._onSashReset())}setEnableSplitViewResizing(e){const t=e===!1;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const i=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?fy.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let s=Math.floor((e||.5)*i);const o=Math.floor(.5*i);return s=this._disableSash?o:s||o,i>Bv.MINIMUM_EDITOR_WIDTH*2?(s<Bv.MINIMUM_EDITOR_WIDTH&&(s=Bv.MINIMUM_EDITOR_WIDTH),s>i-Bv.MINIMUM_EDITOR_WIDTH&&(s=i-Bv.MINIMUM_EDITOR_WIDTH)):s=o,this._sashPosition!==s&&(this._sashPosition=s,this._sash.layout()),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const i=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?fy.ENTIRE_DIFF_OVERVIEW_WIDTH:0),s=this.layout((this._startSashPosition+(e.currentX-e.startX))/i);this._sashRatio=s/i,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i){const s=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new P1t(e,t,i,s,o).getViewZones()}_getOriginalEditorDecorations(e,t,i){const s=this._dataSource.getOriginalEditor(),o=String(this._removeColor),r={decorations:[],overviewZones:[]},a=s.getModel(),c=s._getViewModel();for(const u of e)if(RO(u)){r.decorations.push({range:new be(u.originalStartLineNumber,1,u.originalEndLineNumber,1073741824),options:i?xc.lineDeleteWithSign:xc.lineDelete}),(!OO(u)||!u.charChanges)&&r.decorations.push(Rv(u.originalStartLineNumber,1,u.originalEndLineNumber,1073741824,xc.charDeleteWholeLine));const d=eP(a,c,u.originalStartLineNumber,u.originalEndLineNumber);if(r.overviewZones.push(new jx(d.startLineNumber,d.endLineNumber,o)),u.charChanges){for(const f of u.charChanges)if(RO(f))if(t)for(let g=f.originalStartLineNumber;g<=f.originalEndLineNumber;g++){let p,_;g===f.originalStartLineNumber?p=f.originalStartColumn:p=a.getLineFirstNonWhitespaceColumn(g),g===f.originalEndLineNumber?_=f.originalEndColumn:_=a.getLineLastNonWhitespaceColumn(g),r.decorations.push(Rv(g,p,g,_,xc.charDelete))}else r.decorations.push(Rv(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn,xc.charDelete))}}return r}_getModifiedEditorDecorations(e,t,i){const s=this._dataSource.getModifiedEditor(),o=String(this._insertColor),r={decorations:[],overviewZones:[]},a=s.getModel(),c=s._getViewModel();for(const u of e)if(OO(u)){r.decorations.push({range:new be(u.modifiedStartLineNumber,1,u.modifiedEndLineNumber,1073741824),options:i?xc.lineInsertWithSign:xc.lineInsert}),(!RO(u)||!u.charChanges)&&r.decorations.push(Rv(u.modifiedStartLineNumber,1,u.modifiedEndLineNumber,1073741824,xc.charInsertWholeLine));const d=eP(a,c,u.modifiedStartLineNumber,u.modifiedEndLineNumber);if(r.overviewZones.push(new jx(d.startLineNumber,d.endLineNumber,o)),u.charChanges){for(const f of u.charChanges)if(OO(f))if(t)for(let g=f.modifiedStartLineNumber;g<=f.modifiedEndLineNumber;g++){let p,_;g===f.modifiedStartLineNumber?p=f.modifiedStartColumn:p=a.getLineFirstNonWhitespaceColumn(g),g===f.modifiedEndLineNumber?_=f.modifiedEndColumn:_=a.getLineLastNonWhitespaceColumn(g),r.decorations.push(Rv(g,p,g,_,xc.charInsert))}else r.decorations.push(Rv(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn,xc.charInsert))}}return r}}Bv.MINIMUM_EDITOR_WIDTH=100;class P1t extends QS{constructor(e,t,i,s,o){super(e,t,i,s,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class Ige extends OOe{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange(i=>{this._decorationsLeft!==i.decorationsLeft&&(this._decorationsLeft=i.decorationsLeft,e.relayoutEditors())}))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,s){const o=this._dataSource.getOriginalEditor(),r=this._dataSource.getModifiedEditor();return new F1t(e,t,i,o,r,s).getViewZones()}_getOriginalEditorDecorations(e,t,i){const s=String(this._removeColor),o={decorations:[],overviewZones:[]},r=this._dataSource.getOriginalEditor(),a=r.getModel(),c=r._getViewModel();for(const u of e)if(RO(u)){o.decorations.push({range:new be(u.originalStartLineNumber,1,u.originalEndLineNumber,1073741824),options:xc.lineDeleteMargin});const d=eP(a,c,u.originalStartLineNumber,u.originalEndLineNumber);o.overviewZones.push(new jx(d.startLineNumber,d.endLineNumber,s))}return o}_getModifiedEditorDecorations(e,t,i){const s=this._dataSource.getModifiedEditor(),o=String(this._insertColor),r={decorations:[],overviewZones:[]},a=s.getModel(),c=s._getViewModel();for(const u of e)if(OO(u)){r.decorations.push({range:new be(u.modifiedStartLineNumber,1,u.modifiedEndLineNumber,1073741824),options:i?xc.lineInsertWithSign:xc.lineInsert});const d=eP(a,c,u.modifiedStartLineNumber,u.modifiedEndLineNumber);if(r.overviewZones.push(new jx(d.startLineNumber,d.endLineNumber,o)),u.charChanges){for(const f of u.charChanges)if(OO(f))if(t)for(let g=f.modifiedStartLineNumber;g<=f.modifiedEndLineNumber;g++){let p,_;g===f.modifiedStartLineNumber?p=f.modifiedStartColumn:p=a.getLineFirstNonWhitespaceColumn(g),g===f.modifiedEndLineNumber?_=f.modifiedEndColumn:_=a.getLineLastNonWhitespaceColumn(g),r.decorations.push(Rv(g,p,g,_,xc.charInsert))}else r.decorations.push(Rv(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn,xc.charInsert))}else r.decorations.push(Rv(u.modifiedStartLineNumber,1,u.modifiedEndLineNumber,1073741824,xc.charInsertWholeLine))}return r}layout(){return Math.max(5,this._decorationsLeft)}}class F1t extends QS{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._originalModel=s.getModel(),this._renderIndicators=r,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const s=document.createElement("div");return s.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:s}}_produceModifiedFromDiff(e,t,i){const s=document.createElement("div");s.className=`view-lines line-delete ${E0}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const r={shouldNotShrink:!0,afterLineNumber:e.modifiedEndLineNumber===0?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:s,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let a=e.originalStartLineNumber;a<=e.originalEndLineNumber;a++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(a),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(r),r}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,s=t.get(43),o=t.get(29),r=s.typicalHalfwidthCharacterWidth,a=t.get(92),c=this._originalModel.mightContainNonBasicASCII(),u=this._originalModel.mightContainRTL(),d=t.get(58),g=t.get(129).decorationsWidth,p=t.get(104),_=t.get(87),v=t.get(82),C=t.get(44),y=this._lineBreaksComputer.finalize();let w=0;for(let I=0;I<this._pendingLineChange.length;I++){const L=this._pendingLineChange[I],O=this._pendingViewZones[I],A=O.domNode;Ea.applyFontInfoSlow(A,s);const N=O.marginDomNode;Ea.applyFontInfoSlow(N,s);const D=[];if(L.charChanges)for(const K of L.charChanges)RO(K)&&D.push(new YD(new be(K.originalStartLineNumber,K.originalStartColumn,K.originalEndLineNumber,K.originalEndColumn),"char-delete",0));const P=D.length>0,F=Y0(1e4);let V=0,U=0,Q=null;for(let K=L.originalStartLineNumber;K<=L.originalEndLineNumber;K++){const re=K-L.originalStartLineNumber,Z=this._originalModel.getLineTokens(K),J=Z.getLineContent(),ge=y[w++],ve=Ed.filter(D,K,1,J.length+1);if(ge){let Le=0;for(const Ne of ge.breakOffsets){const qe=Z.sliceAndInflate(Le,Ne,0),Re=J.substring(Le,Ne);V=Math.max(V,this._renderOriginalLine(U++,Re,qe,Ed.extractWrapped(ve,Le,Ne),P,c,u,s,o,d,g,p,_,v,C,i,F,N)),Le=Ne}for(Q||(Q=[]);Q.length<re;)Q[Q.length]=1;Q[re]=ge.breakOffsets.length,O.heightInLines+=ge.breakOffsets.length-1;const Ee=document.createElement("div");Ee.className="line-delete",e.original.push({afterLineNumber:K,afterColumn:0,heightInLines:ge.breakOffsets.length-1,domNode:ROe(),marginDomNode:Ee})}else V=Math.max(V,this._renderOriginalLine(U++,J,Z,ve,P,c,u,s,o,d,g,p,_,v,C,i,F,N))}V+=a;const de=F.build(),q=Sge?Sge.createHTML(de):de;if(A.innerHTML=q,O.minWidthInPx=V*r,Q){const K=L.originalEndLineNumber-L.originalStartLineNumber;for(;Q.length<=K;)Q[Q.length]=1}O.diff.viewLineCounts=Q}e.original.sort((I,L)=>I.afterLineNumber-L.afterLineNumber)}_renderOriginalLine(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v,C,y,w){y.appendASCIIString('<div class="view-line'),o||y.appendASCIIString(" char-delete"),y.appendASCIIString('" style="top:'),y.appendASCIIString(String(e*d)),y.appendASCIIString('px;width:1000000px;">');const I=Dd.isBasicASCII(t,r),L=Dd.containsRTL(t,I,a),O=t6(new Hw(c.isMonospace&&!u,c.canUseHalfwidthRightwardsArrow,t,!1,I,L,0,i,s,C,0,c.spaceWidth,c.middotWidth,c.wsmiddotWidth,g,p,_,v!==gd.OFF,null),y);if(y.appendASCIIString("</div>"),this._renderIndicators){const A=document.createElement("div");A.className=`delete-sign ${mo.asClassName(LOe)}`,A.setAttribute("style",`position:absolute;top:${e*d}px;width:${f}px;height:${d}px;right:0;`),w.appendChild(A)}return O.characterMapping.getAbsoluteOffset(O.characterMapping.length)}}function B1t(n,e){return Hc(n,e,["off","on","inherit"])}function OO(n){return n.modifiedEndLineNumber>0}function RO(n){return n.originalEndLineNumber>0}function ROe(){const n=document.createElement("div");return n.className="diagonal-fill",n}function eP(n,e,t,i){const s=n.getLineCount();return t=Math.min(s,Math.max(1,t)),i=Math.min(s,Math.max(1,i)),e.coordinatesConverter.convertModelRangeToViewRange(new be(t,n.getLineMinColumn(t),i,n.getLineMaxColumn(i)))}function Lge(n,e){return{enableSplitViewResizing:zn(n.enableSplitViewResizing,e.enableSplitViewResizing),renderSideBySide:zn(n.renderSideBySide,e.renderSideBySide),maxComputationTime:yY(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:yY(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:zn(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:zn(n.renderIndicators,e.renderIndicators),originalEditable:zn(n.originalEditable,e.originalEditable),diffCodeLens:zn(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:zn(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:B1t(n.diffWordWrap,e.diffWordWrap)}}function H1t(n,e){return{enableSplitViewResizing:n.enableSplitViewResizing!==e.enableSplitViewResizing,renderSideBySide:n.renderSideBySide!==e.renderSideBySide,maxComputationTime:n.maxComputationTime!==e.maxComputationTime,maxFileSize:n.maxFileSize!==e.maxFileSize,ignoreTrimWhitespace:n.ignoreTrimWhitespace!==e.ignoreTrimWhitespace,renderIndicators:n.renderIndicators!==e.renderIndicators,originalEditable:n.originalEditable!==e.originalEditable,diffCodeLens:n.diffCodeLens!==e.diffCodeLens,renderOverviewRuler:n.renderOverviewRuler!==e.renderOverviewRuler,diffWordWrap:n.diffWordWrap!==e.diffWordWrap}}ws((n,e)=>{const t=n.getColor(V1e);t&&(e.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${t}; }`),e.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${t}; }`),e.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${t}; }`));const i=n.getColor(U1e);i&&(e.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${i}; }`),e.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${i}; }`),e.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${i}; }`));const s=n.getColor(l0t);s&&e.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${n.type==="hc"?"dashed":"solid"} ${s}; }`);const o=n.getColor(a0t);o&&e.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${n.type==="hc"?"dashed":"solid"} ${o}; }`);const r=n.getColor(OF);r&&e.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=n.getColor(c0t);a&&e.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const c=n.getColor(o$);c&&e.addRule(`
- .monaco-diff-editor .diffViewport {
- background: ${c};
- }
- `);const u=n.getColor(r$);u&&e.addRule(`
- .monaco-diff-editor .diffViewport:hover {
- background: ${u};
- }
- `);const d=n.getColor(l$);d&&e.addRule(`
- .monaco-diff-editor .diffViewport:active {
- background: ${d};
- }
- `);const f=n.getColor(u0t);e.addRule(`
- .monaco-editor .diagonal-fill {
- background-image: linear-gradient(
- -45deg,
- ${f} 12.5%,
- #0000 12.5%, #0000 50%,
- ${f} 50%, ${f} 62.5%,
- #0000 62.5%, #0000 100%
- );
- background-size: 8px 8px;
- }
- `)});const Kw=ss("themeService"),Ro=ss("keybindingService");class V1t extends wt{constructor(){super(),this._onCodeEditorAdd=this._register(new rt),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new rt),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new rt),this._onDiffEditorRemove=this._register(new rt),this._onDecorationTypeRegistered=this._register(new rt),this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null)}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}}var U1t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W1t=function(n,e){return function(t,i){e(t,i,n)}};class G1t{constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){var e;this._refCount--,this._refCount===0&&((e=this._styleSheet.parentNode)===null||e===void 0||e.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){zW(e,this._styleSheet)}}class z1t{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){zW(e,this._styleSheet)}}let _J=class extends V1t{constructor(e,t){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=e||null,this._themeService=t}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new z1t(kd())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!G8(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const s=new G1t(this,i,kd(t));this._editorStyleSheets.set(i,s)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,s,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:s,options:i||Object.create(null)};s?r=new K1t(this._themeService,a,c):r=new j1t(e,this._themeService,a,c),this._decorationOptionProviders.set(t,r),this._onDecorationTypeRegistered.fire(t)}r.refCount++}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorations(e))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}};_J=U1t([W1t(1,fo)],_J);class K1t{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new j3(3,i,e),this._afterContentRules=new j3(4,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class j1t{constructor(e,t,i,s){this._disposables=new Wt,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=f=>{const g=new j3(f,s,t);if(this._disposables.add(g),g.hasContent)return g.className},r=f=>{const g=new j3(f,s,t);return this._disposables.add(g),g.hasContent?{className:g.className,hasLetterSpacing:g.hasLetterSpacing}:null};this.className=o(0);const a=r(1);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(3),this.afterContentClassName=o(4),s.options.beforeInjectedText&&s.options.beforeInjectedText.contentText){const f=r(5);this.beforeInjectedText={content:s.options.beforeInjectedText.contentText,inlineClassName:f==null?void 0:f.className,inlineClassNameAffectsLetterSpacing:(f==null?void 0:f.hasLetterSpacing)||s.options.beforeInjectedText.affectsLetterSpacing}}if(s.options.afterInjectedText&&s.options.afterInjectedText.contentText){const f=r(6);this.afterInjectedText={content:s.options.afterInjectedText.contentText,inlineClassName:f==null?void 0:f.className,inlineClassNameAffectsLetterSpacing:(f==null?void 0:f.hasLetterSpacing)||s.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(2);const c=s.options;this.isWholeLine=!!c.isWholeLine,this.stickiness=c.rangeBehavior;const u=c.light&&c.light.overviewRulerColor||c.overviewRulerColor,d=c.dark&&c.dark.overviewRulerColor||c.overviewRulerColor;(typeof u<"u"||typeof d<"u")&&(this.overviewRuler={color:u||d,darkColor:d||u,position:c.overviewRulerLane||Ad.Center})}getOptions(e,t){return t?{description:this.description,inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness,before:this.beforeInjectedText,after:this.afterInjectedText}:this}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const HN={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};",verticalAlign:"vertical-align:{0};"};class j3{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let s=M7.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(s=s+" "+M7.getClassName(this._providerArgs.parentTypeKey,e)),this._className=s,this._unThemedSelector=M7.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(o=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()}):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,s;switch(this._ruleType){case 0:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),s=this.getCSSTextForModelDecorationClassName(e.dark);break;case 1:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),s=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case 2:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),s=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case 3:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case 4:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case 5:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case 6:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),s=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.afterInjectedText);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let r=!1;t.length>0&&(o.insertRule(`${this._unThemedSelector} {${t}}`,0),r=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector} {${i}}`,0),r=!0),s.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${s}}`,0),r=!0),this._hasContent=r}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(typeof e<"u"){if(this.collectBorderSettingsCSSText(e,t),typeof e.contentIconPath<"u"&&t.push(ha(HN.contentIconPath,hb(Jn.revive(e.contentIconPath)))),typeof e.contentText=="string"){const s=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(ha(HN.contentText,s))}this.collectCSSText(e,["verticalAlign","fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return typeof e.gutterIconPath<"u"&&(t.push(ha(HN.gutterIconPath,hb(Jn.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(ha(HN.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(ha("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const s=i.length;for(let o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push(ha(HN[o],r))}return i.length!==s}resolveValue(e){if(Vbt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class M7{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let s=".monaco-editor ."+this.getClassName(e,i);return t&&(s=s+"."+this.getClassName(t,i)),i===3?s+="::before":i===4&&(s+="::after"),s}}var X1t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Oge=function(n,e){return function(t,i){e(t,i,n)}};let X3=class extends _J{constructor(e,t,i){super(e,i),this.onCodeEditorAdd(()=>this._checkContextKey()),this.onCodeEditorRemove(()=>this._checkContextKey()),this._editorIsOpen=t.createKey("editorIsOpen",!1),this._activeCodeEditor=null}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===Ii.http||o===Ii.https)return eLe(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};X3=X1t([Oge(1,ai),Oge(2,fo)],X3);var ese=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},co=function(n,e){return function(t,i){e(t,i,n)}};let Y1t=0,Rge=!1;function q1t(n){if(!n){if(Rge)return;Rge=!0}Uyt(n||document.body)}let Y3=class extends Jx{constructor(e,t,i,s,o,r,a,c,u,d){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||C3.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+C3.accessibilityHelpMessage,super(e,f,{},i,s,o,r,c,u,d),a instanceof a1e?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,q1t(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let s="DYNAMIC_"+ ++Y1t,o=dn.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),wt.None;const t=e.id,i=e.label,s=dn.and(dn.equals("editorId",this.getId()),dn.deserialize(e.precondition)),o=e.keybindings,r=dn.and(s,dn.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,c=e.contextMenuOrder||0,u=(p,..._)=>Promise.resolve(e.run(this,..._)),d=new Wt,f=this.getId()+":"+t;if(d.add(ji.registerCommand(f,u)),a){let p={command:{id:f,title:i},when:s,group:a,order:c};d.add(Th.appendMenuItem(wn.EditorContext,p))}if(Array.isArray(o))for(const p of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(f,p,u,r));let g=new vOe(f,i,i,s,u,this._contextKeyService);return this._actions[t]=g,d.add(xi(()=>{delete this._actions[t]})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof X3)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Y3=ese([co(2,Qi),co(3,hs),co(4,vr),co(5,ai),co(6,Ro),co(7,fo),co(8,Hr),co(9,Vu)],Y3);let vJ=class extends Y3{constructor(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v){const C=Object.assign({},t);y3(g,C,!1);const y=d.registerEditorContainer(e);typeof C.theme=="string"&&d.setTheme(C.theme),typeof C.autoDetectHighContrast<"u"&&d.setAutoDetectHighContrast(!!C.autoDetectHighContrast);let w=C.model;delete C.model,super(e,C,s,o,r,a,c,d,f,p),this._contextViewService=u,this._configurationService=g,this._standaloneThemeService=d,this._register(i),this._register(y);let I;if(typeof w>"u"?(I=MOe(_,v,C.value||"",C.language||Cf.text,void 0),this._ownsModel=!0):(I=w,this._ownsModel=!1),this._attachModel(I),I){let L={oldModelUrl:null,newModelUrl:I.uri};this._onDidChangeModel.fire(L)}}dispose(){super.dispose()}updateOptions(e){y3(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_attachModel(e){super._attachModel(e),this._modelData&&this._contextViewService.setContainer(this._modelData.view.domNode.domNode)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};vJ=ese([co(3,Qi),co(4,hs),co(5,vr),co(6,ai),co(7,Ro),co(8,Hy),co(9,Kw),co(10,Hr),co(11,Yo),co(12,Vu),co(13,Xr),co(14,Ga)],vJ);let bJ=class extends fy{constructor(e,t,i,s,o,r,a,c,u,d,f,g,p,_,v){const C=Object.assign({},t);y3(g,C,!0);const y=d.registerEditorContainer(e);typeof C.theme=="string"&&d.setTheme(C.theme),typeof C.autoDetectHighContrast<"u"&&d.setAutoDetectHighContrast(!!C.autoDetectHighContrast),super(e,C,{},v,c,o,s,u,d,f,p,_),this._contextViewService=a,this._configurationService=g,this._standaloneThemeService=d,this._register(i),this._register(y),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){y3(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Y3,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};bJ=ese([co(3,Qi),co(4,ai),co(5,Ro),co(6,Hy),co(7,eg),co(8,hs),co(9,Kw),co(10,Hr),co(11,Yo),co(12,Vy),co(13,Mb),co(14,Uy)],bJ);function MOe(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(`
- `);let r=t;return o!==-1&&(r=t.substring(0,o)),Mge(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return Mge(n,t,e.create(i),s)}function Mge(n,e,t,i){return n.createModel(e,t,i)}const dS=Object.prototype.hasOwnProperty;class J1t{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(ly,0),this._register(TM,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||ly}}class tP extends wt{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,tP.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new J1t,this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(S0.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){tP.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},qwt();const e=S0.getLanguages();this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{let i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),br.as(Fw.Configuration).registerOverrideIdentifiers(S0.getLanguages().map(t=>t.id)),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;dS.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(let a of t.extensions)nV({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)nV({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)nV({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{let c=new RegExp(a);Zvt(c)||nV({id:i,mime:s,firstline:c},this._warnOnOverwrite)}catch(c){di(c)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);let r=o!==null&&o.length>0;if(!(r&&o[0]===null)){let a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration)}isRegisteredMode(e){return dS.call(this._mimeTypesMap,e)?!0:dS.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return dS.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e]:null}extractModeIds(e){return e?e.split(",").map(t=>t.trim()).map(t=>dS.call(this._mimeTypesMap,t)?this._mimeTypesMap[t]:t).filter(t=>dS.call(this._languages,t)):[]}validateLanguageId(e){return!e||e===ly?ly:dS.call(this._languages,e)?e:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=Jwt(e,t);return this.extractModeIds(i.join(","))}}tP.instanceCount=0;class kge{constructor(e,t){this._selector=t,this.languageId=this._selector();let i;this._onDidChange=new rt({onFirstListenerAdd:()=>{i=e(()=>this._evaluate())},onLastListenerRemove:()=>{i.dispose()}}),this.onDidChange=this._onDidChange.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._onDidChange.fire(this.languageId))}}class nP extends wt{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new rt),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onLanguagesMaybeChanged=this._register(new rt({leakWarningThreshold:200})),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,nP.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new tP(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onLanguagesMaybeChanged.fire()))}dispose(){nP.instanceCount--,super.dispose()}isRegisteredMode(e){return this._registry.isRegisteredMode(e)}getModeIdForLanguageName(e){return this._registry.getModeIdForLanguageNameLowercase(e)}getModeIdByFilepathOrFirstLine(e,t){const i=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return xq(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return xq(t,null)}validateLanguageId(e){return this._registry.validateLanguageId(e)}create(e){return new kge(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new kge(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.validateLanguageId(e||"plaintext")||ly;return this._getOrCreateMode(t),t}triggerMode(e){const t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")}_getOrCreateMode(e){if(!this._encounteredLanguages.has(e)){this._encounteredLanguages.add(e);const t=this.validateLanguageId(e)||ly;this._onDidEncounterLanguage.fire(t)}}}nP.instanceCount=0;var Q1t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k7=function(n,e){return function(t,i){e(t,i,n)}};let TJ=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._modeService=i,this._logService=s,this._hashTable=new Mv,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,i){const s=this._modeService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,s);let r;if(o)r=o.metadata,this._logService.getLevel()===Fg.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Ba.getForeground(r)}, fontStyle ${Ba.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const c=[];if(a){let u=t;for(let f=0;u>0&&f<this._legend.tokenModifiers.length;f++)u&1&&c.push(this._legend.tokenModifiers[f]),u=u>>1;u>0&&this._logService.getLevel()===Fg.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),c.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const f=(d.italic?1:0)<<11;r|=f|1}if(typeof d.bold<"u"){const f=(d.bold?2:0)<<11;r|=f|2}if(typeof d.underline<"u"){const f=(d.underline?4:0)<<11;r|=f|4}if(d.foreground){const f=d.foreground<<14;r|=f|8}r===0&&(r=2147483647)}}else this._logService.getLevel()===Fg.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Fg.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${c.join(" ")}): foreground ${Ba.getForeground(r)}, fontStyle ${Ba.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}};TJ=Q1t([k7(1,fo),k7(2,Ga),k7(3,h_)],TJ);function kOe(n,e,t){const i=n.data,s=n.data.length/5|0,o=Math.max(Math.ceil(s/1024),400),r=[];let a=0,c=1,u=0;for(;a<s;){const d=a;let f=Math.min(d+o,s);if(f<s){let I=f;for(;I-1>d&&i[5*I]===0;)I--;if(I-1===d){let L=f;for(;L+1<s&&i[5*L]===0;)L++;f=L}else f=I}let g=new Uint32Array((f-d)*4),p=0,_=0,v=0,C=0,y=0;for(;a<f;){const I=5*a,L=i[I],O=i[I+1],A=c+L|0,N=L===0?u+O|0:O,D=i[I+2],P=i[I+3],F=i[I+4],V=e.getMetadata(P,F,t);V!==2147483647&&(_===0&&(_=A),v===A&&y>N&&(e.warnOverlappingSemanticTokens(A,N+1),C<N?g[p-4+2]=N:p-=4),g[p]=A-_,g[p+1]=N,g[p+2]=N+D,g[p+3]=V,p+=4,v=A,C=N,y=N+D),c=A,u=N,a++}p!==g.length&&(g=g.subarray(0,p));const w=new O3(_,new L3(g));r.push(w)}return r}class Z1t{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class Mv{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Mv._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<Mv._SIZES.length?2/3*this._currentLength:0),this._elements=[],Mv._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const s=this._hashFunc(e,t,i);let o=this._elements[s];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,s){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Mv._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<Mv._SIZES.length?2/3*this._currentLength:0),this._elements=[],Mv._nullOutEntries(this._elements,this._currentLength);for(const r of o){let a=r;for(;a;){const c=a.next;a.next=null,this._add(a),a=c}}}this._add(new Z1t(e,t,i,s))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}Mv._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];function eOt(n){for(let e=0,t=n.length;e<t;e+=4){const i=n[e+0],s=n[e+1],o=n[e+2],r=n[e+3];n[e+0]=r,n[e+1]=o,n[e+2]=s,n[e+3]=i}}function tOt(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return SIe()||eOt(e),K8.wrap(e)}function AOe(n){const e=new Uint32Array(nOt(n));let t=0;if(e[t++]=n.id,n.type==="full")e[t++]=1,e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length;else{e[t++]=2,e[t++]=n.deltas.length;for(const i of n.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return tOt(e)}function nOt(n){let e=0;if(e+=2,n.type==="full")e+=1+n.data.length;else{e+=1,e+=3*n.deltas.length;for(const t of n.deltas)t.data&&(e+=t.data.length)}return e}var gy=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function R6(n){return n&&!!n.data}function NOe(n){return n&&Array.isArray(n.edits)}class iOt{constructor(e,t){this.provider=e,this.tokens=t}}function DOe(n){return mR.has(n)}function sOt(n){const e=mR.orderedGroups(n);return e.length>0?e[0]:[]}function $Oe(n,e,t,i){return gy(this,void 0,void 0,function*(){const s=sOt(n),o=yield Promise.all(s.map(r=>gy(this,void 0,void 0,function*(){let a;try{a=yield r.provideDocumentSemanticTokens(n,r===e?t:null,i)}catch(c){Ol(c),a=null}return(!a||!R6(a)&&!NOe(a))&&(a=null),new iOt(r,a)})));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null})}function oOt(n){const e=mR.orderedGroups(n);return e.length>0?e[0]:null}class rOt{constructor(e,t){this.provider=e,this.tokens=t}}function lOt(n){return q8.has(n)}function xOe(n){const e=q8.orderedGroups(n);return e.length>0?e[0]:[]}function tse(n,e,t){return gy(this,void 0,void 0,function*(){const i=xOe(n),s=yield Promise.all(i.map(o=>gy(this,void 0,void 0,function*(){let r;try{r=yield o.provideDocumentRangeSemanticTokens(n,e,t)}catch(a){Ol(a),r=null}return(!r||!R6(r))&&(r=null),new rOt(o,r)})));for(const o of s)if(o.tokens)return o;return s.length>0?s[0]:null})}ji.registerCommand("_provideDocumentSemanticTokensLegend",(n,...e)=>gy(void 0,void 0,void 0,function*(){const[t]=e;Gs(t instanceof Jn);const i=n.get(Xr).getModel(t);if(!i)return;const s=oOt(i);return s?s[0].getLegend():n.get(vr).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));ji.registerCommand("_provideDocumentSemanticTokens",(n,...e)=>gy(void 0,void 0,void 0,function*(){const[t]=e;Gs(t instanceof Jn);const i=n.get(Xr).getModel(t);if(!i)return;if(!DOe(i))return n.get(vr).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=yield $Oe(i,null,null,Ai.None);if(!s)return;const{provider:o,tokens:r}=s;if(!r||!R6(r))return;const a=AOe({id:0,type:"full",data:r.data});return r.resultId&&o.releaseDocumentSemanticTokens(r.resultId),a}));ji.registerCommand("_provideDocumentRangeSemanticTokensLegend",(n,...e)=>gy(void 0,void 0,void 0,function*(){const[t,i]=e;Gs(t instanceof Jn);const s=n.get(Xr).getModel(t);if(!s)return;const o=xOe(s);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!be.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const r=yield tse(s,be.lift(i),Ai.None);if(r)return r.provider.getLegend()}));ji.registerCommand("_provideDocumentRangeSemanticTokens",(n,...e)=>gy(void 0,void 0,void 0,function*(){const[t,i]=e;Gs(t instanceof Jn),Gs(be.isIRange(i));const s=n.get(Xr).getModel(t);if(!s)return;const o=yield tse(s,be.lift(i),Ai.None);if(!(!o||!o.tokens))return AOe({id:0,type:"full",data:o.tokens.data})}));var aOt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hS=function(n,e){return function(t,i){e(t,i,n)}};function PT(n){return n.toString()}function Age(n){const e=new X8,t=n.createSnapshot();let i;for(;i=t.read();)e.update(i);return e.digest()}class cOt{constructor(e,t,i){this._modelEventListeners=new Wt,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange(()=>this.model.setMode(e.languageId)),this.model.setMode(e.languageId)}}const uOt=Qc||ki?1:2;class dOt{constructor(e,t,i,s,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}let q3=class pD extends wt{constructor(e,t,i,s,o,r,a){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=s,this._undoRedoService=o,this._modeService=r,this._languageConfigurationService=a,this._onModelAdded=this._register(new rt),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new rt),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new rt),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new fOt(this._themeService,this._modeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())),this._updateModelOptions(),this._register(new hOt(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){var i;let s=$a.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const p=parseInt(e.editor.tabSize,10);isNaN(p)||(s=p),s<1&&(s=1)}let o=s;if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const p=parseInt(e.editor.indentSize,10);isNaN(p)||(o=p),o<1&&(o=1)}let r=$a.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=uOt;const c=e.eol;c===`\r
- `?a=2:c===`
- `&&(a=1);let u=$a.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(u=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=$a.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let f=$a.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(f=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let g=$a.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(g={enabled:!!e.editor.bracketPairColorization.enabled}),{isForSimpleWidget:t,tabSize:s,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:u,largeFileOptimizations:f,bracketPairColorizationOptions:g}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:Tf===3||Tf===2?`
- `:`\r
- `}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){let s=this._modelCreationOptionsByLanguageAndResource[e+t];if(!s){const o=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:t}),r=this._getEOL(t,e);s=pD._readModelOptions({editor:o,eol:r},i),this._modelCreationOptionsByLanguageAndResource[e+t]=s}return s}_updateModelOptions(){const e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const t=Object.keys(this._models);for(let i=0,s=t.length;i<s;i++){const o=t[i],r=this._models[o],a=r.model.getLanguageId(),c=r.model.uri,u=e[a+c],d=this.getCreationOptions(a,c,r.model.isForSimpleWidget);pD._setModelOptionsForModel(r.model,d,u)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&zg(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(PT(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(PT(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(PT(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=new xd(e,o,t,i,this._undoRedoService,this._modeService,this._languageConfigurationService);if(i&&this._disposedModels.has(PT(i))){const u=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),f=Age(r)===u.sha1;if(f||u.sharesUndoRedoStack){for(const g of d.past)Lv(g)&&g.matchesResource(i)&&g.setModel(r);for(const g of d.future)Lv(g)&&g.matchesResource(i)&&g.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,g=>Lv(g)&&g.matchesResource(i)),f&&(r._overwriteVersionId(u.versionId),r._overwriteAlternativeVersionId(u.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(u.initialUndoRedoSnapshot))}else u.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(u.initialUndoRedoSnapshot)}const a=PT(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new cOt(r,u=>this._onWillDispose(u),(u,d)=>this._onDidChangeLanguage(u,d));return this._models[a]=c,c}createModel(e,t,i,s=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,s),this.setMode(o.model,t)):o=this._createModelData(e,TM,i,s),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[PT(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i<s;i++){const o=t[i];e.push(this._models[o].model)}return e}getModel(e){const t=PT(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Ii.file||e.scheme===Ii.vscodeRemote||e.scheme===Ii.userData||e.scheme===Ii.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=PT(e.uri),i=this._models[t],s=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,r=0;if(s||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const c=this._undoRedoService.getElements(e.uri);if(c.past.length>0||c.future.length>0){for(const u of c.past)Lv(u)&&u.matchesResource(e.uri)&&(o=!0,r+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)Lv(u)&&u.matchesResource(e.uri)&&(o=!0,r+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=pD.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(o)if(!s&&r>a){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Lv(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new dOt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,Age(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);pD._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldModeId:i})}};q3.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;q3=aOt([hS(0,Yo),hS(1,PLe),hS(2,fo),hS(3,h_),hS(4,wF),hS(5,Ga),hS(6,yF)],q3);const nse="editor.semanticHighlighting";function CJ(n,e,t){var i;const s=(i=t.getValue(nse,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))===null||i===void 0?void 0:i.enabled;return typeof s=="boolean"?s:e.getColorTheme().semanticHighlighting}class hOt extends wt{constructor(e,t,i,s){super(),this._watchers=Object.create(null),this._semanticStyling=s;const o=c=>{this._watchers[c.uri.toString()]=new ZS(c,t,this._semanticStyling)},r=(c,u)=>{u.dispose(),delete this._watchers[c.uri.toString()]},a=()=>{for(let c of e.getModels()){const u=this._watchers[c.uri.toString()];CJ(c,t,i)?u||o(c):u&&r(c,u)}};this._register(e.onModelAdded(c=>{CJ(c,t,i)&&o(c)})),this._register(e.onModelRemoved(c=>{const u=this._watchers[c.uri.toString()];u&&r(c,u)})),this._register(i.onDidChangeConfiguration(c=>{c.affectsConfiguration(nse)&&a()})),this._register(t.onDidColorThemeChange(a))}}class fOt extends wt{constructor(e,t,i){super(),this._themeService=e,this._modeService=t,this._logService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}get(e){return this._caches.has(e)||this._caches.set(e,new TJ(e.getLegend(),this._themeService,this._modeService,this._logService)),this._caches.get(e)}}class gOt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}class ZS extends wt{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new ho(()=>this._fetchDocumentSemanticTokensNow(),ZS.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const s=()=>{Ji(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const o of mR.all(e))typeof o.onDidChange=="function"&&this._documentProvidersChangeListeners.push(o.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};s(),this._register(mR.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule()})),this._register(t.onDidColorThemeChange(o=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule()})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!DOe(this._model)){this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1);return}const e=new dc,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=$Oe(this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e;const o=[],r=this._model.onDidChangeContent(a=>{o.push(a)});s.then(a=>{if(this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!a)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=a,d=this._semanticStyling.get(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},a=>{a&&(d_(a)||typeof a.message=="string"&&a.message.indexOf("busy")!==-1)||di(a),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),o.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule())})}static _copy(e,t,i,s,o){for(let r=0;r<o;r++)i[s+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,s){const o=this._currentDocumentResponse,r=()=>{s.length>0&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule()};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.setSemanticTokens(null,!1);return}if(!t){this._model.setSemanticTokens(null,!0),r();return}if(NOe(t)){if(!o){this._model.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const g of t.edits)a+=(g.data?g.data.length:0)-g.deleteCount;const c=o.data,u=new Uint32Array(c.length+a);let d=c.length,f=u.length;for(let g=t.edits.length-1;g>=0;g--){const p=t.edits[g],_=d-(p.start+p.deleteCount);_>0&&(ZS._copy(c,d-_,u,f-_,_),f-=_),p.data&&(ZS._copy(p.data,0,u,f-p.data.length,p.data.length),f-=p.data.length),d=p.start}d>0&&ZS._copy(c,0,u,0,d),t={resultId:t.resultId,data:u}}}if(R6(t)){this._currentDocumentResponse=new gOt(e,t.resultId,t.data);const a=kOe(t,i,this._model.getLanguageId());if(s.length>0)for(const c of s)for(const u of a)for(const d of c.changes)u.applyEdit(d.range,d.text);this._model.setSemanticTokens(a,!0)}else this._model.setSemanticTokens(null,!0);r()}}ZS.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;class pOt{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function mOt(n){if(!n||!Array.isArray(n))return[];let e=[],t=0;for(let i=0,s=n.length;i<s;i++){let o=n[i],r=-1;if(typeof o.fontStyle=="string"){r=0;let u=o.fontStyle.split(" ");for(let d=0,f=u.length;d<f;d++)switch(u[d]){case"italic":r=r|1;break;case"bold":r=r|2;break;case"underline":r=r|4;break}}let a=null;typeof o.foreground=="string"&&(a=o.foreground);let c=null;typeof o.background=="string"&&(c=o.background),e[t++]=new pOt(o.token||"",i,r,a,c)}return e}function _Ot(n,e){n.sort((d,f)=>{let g=yOt(d.token,f.token);return g!==0?g:d.index-f.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){let d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}let o=new bOt;for(let d of e)o.getId(d);let r=o.getId(i),a=o.getId(s),c=new ise(t,r,a),u=new sse(c);for(let d=0,f=n.length;d<f;d++){let g=n[d];u.insert(g.token,g.fontStyle,o.getId(g.foreground),o.getId(g.background))}return new POe(o,u)}const vOt=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class bOt{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(vOt);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=mt.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class POe{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(mOt(e),t)}static createFromParsedTokenTheme(e,t){return _Ot(e,t)}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(typeof i>"u"){let s=this._match(t),o=COt(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const TOt=/\b(comment|string|regex|regexp)\b/;function COt(n){let e=n.match(TOt);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function yOt(n,e){return n<e?-1:n>e?1:0}class ise{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}clone(){return new ise(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}}class sse{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;let t=e.indexOf("."),i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));let o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}let o=e.indexOf("."),r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let c=this._children.get(r);typeof c>"u"&&(c=new sse(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,s)}}function EOt(n){let e=[];for(let t=1,i=n.length;t<i;t++){let s=n[t];e[t]=`.mtk${t} { color: ${s}; }`}return e.push(".mtki { font-style: italic; }"),e.push(".mtkb { font-weight: bold; }"),e.push(".mtku { text-decoration: underline; text-underline-position: under; }"),e.join(`
- `)}const SOt={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Ch]:"#FFFFFE",[PC]:"#000000",[Mie]:"#E5EBF1",[y6]:"#D3D3D3",[E6]:"#939393",[kie]:"#ADD6FF4D"}},wOt={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Ch]:"#1E1E1E",[PC]:"#D4D4D4",[Mie]:"#3A3D41",[y6]:"#404040",[E6]:"#707070",[kie]:"#ADD6FF26"}},IOt={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Ch]:"#000000",[PC]:"#FFFFFF",[y6]:"#FFFFFF",[E6]:"#FFFFFF"}};function LOt(){const n=new rt,e=y1t();return e.onDidChange(()=>n.fire()),{onDidChange:n.event,getCSS(){const t={},i=o=>{let r=o.defaults;for(;mo.isThemeIcon(r);){const c=e.getIcon(r.id);if(!c)return;r=c.defaults}const a=r.fontId;if(a){const c=e.getIconFont(a);if(c)return t[a]=c,`.codicon-${o.id}:before { content: '${r.fontCharacter}'; font-family: ${whe(a)}; }`}return`.codicon-${o.id}:before { content: '${r.fontCharacter}'; }`},s=[];for(let o of e.getIcons()){const r=i(o);r&&s.push(r)}for(let o in t){const a=t[o].definition.src.map(c=>`${hb(c.location)} format('${c.format}')`).join(", ");s.push(`@font-face { src: ${a}; font-family: ${whe(o)}; font-display: block; }`)}return s.join(`
- `)}}}const e0="vs",J3="vs-dark",MO="hc-black",OOt=br.as(N1e.ColorContribution),ROt=br.as(u1e.ThemingContribution);class FOe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(h4(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(let t in this.themeData.colors)e.set(t,mt.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=yJ(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,mt.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=OOt.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case e0:return bh.LIGHT;case MO:return bh.HIGH_CONTRAST;default:return bh.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let o=yJ(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=POe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Ba.getForeground(o),a=Ba.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4)}}}function h4(n){return n===e0||n===J3||n===MO}function yJ(n){switch(n){case e0:return SOt;case J3:return wOt;case MO:return IOt}}function A7(n){let e=yJ(n);return new FOe(n,e)}class MOt extends wt{constructor(){super(),this._onColorThemeChange=this._register(new rt),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(e0,A7(e0)),this._knownThemes.set(J3,A7(J3)),this._knownThemes.set(MO,A7(MO));const e=LOt();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
- ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(e0),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),Xvt("(forced-colors: active)",()=>{this._updateActualTheme()})}registerEditorContainer(e){return G8(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=kd(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),wt.None}_registerShadowDomContainer(e){const t=kd(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!h4(t.base)&&!h4(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new FOe(e,t)),h4(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(e0),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(MO):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){let e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};ROt.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(EOt(s)),this._themeCSS=e.join(`
- `),this._updateCSS(),$o.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
- ${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}}var kOt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},AOt=function(n,e){return function(t,i){e(t,i,n)}};const h$="data-keybinding-context";let ose=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};class IR extends ose{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}IR.INSTANCE=new IR;class iP extends ose{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=bO.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===6){const o=Array.from(zi.map(this._values,([r])=>r));this._values.clear(),i.fire(new Dge(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...zi.map(c,([u])=>u)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new Dge(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(iP._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(iP._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}iP._keyPrefix="config.";class NOt{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Nge{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class Dge{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class DOt{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class BOe{constructor(e){this._onDidChangeContext=new FW({merge:t=>new DOt(t)}),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new NOt(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new $Ot(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return yO.contextMatchesRules(t,e)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new Nge(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Nge(e))}getContext(e){return this._isDisposed?IR.INSTANCE:this.getContextValuesContainer(xOt(e))}}let EJ=class extends BOe{constructor(e){super(0),this._contexts=new Map,this._toDispose=new Wt,this._lastContextId=0;const t=new iP(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?IR.INSTANCE:this._contexts.get(e)||IR.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new ose(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};EJ=kOt([AOt(0,Yo)],EJ);class $Ot extends BOe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new pc,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(h$)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(h$,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(h$),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?IR.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function xOt(n){for(;n;){if(n.hasAttribute(h$)){const e=n.getAttribute(h$);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}ji.registerCommand(Syt,function(n,e,t){n.get(ai).createKey(String(e),t)});ji.registerCommand({id:"getContextKeyInfo",handler(){return[...Sn.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:$("getContextKeyInfo","A command that returns information about context keys"),args:[]}});ji.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(let t of Sn.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});function $ge(n){let e=n.definition;for(;e instanceof vn;)e=e.definition;return`.codicon-${n.id}:before { content: '${e.fontCharacter}'; }`}var aa;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),c=Math.min(o.end,r.end);return c-a<=0?{start:0,end:0}:{start:a,end:c}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],c={start:o.start,end:Math.min(r.start,o.end)},u={start:Math.max(r.end,o.start),end:o.end};return t(c)||a.push(c),t(u)||a.push(u),a}n.relativeComplement=s})(aa||(aa={}));var CC;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(CC||(CC={}));function j1(n,e,t){const i=t.mode===CC.ALIGN?t.offset:t.offset+t.size,s=t.mode===CC.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}class LR extends wt{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=wt.None,this.toDisposeOnSetContainer=wt.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Vt(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Vc(this.view),this.setContainer(e,t),this._register(xi(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=Vt(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=POt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Vt("slot"))}else this.container.appendChild(this.view);const s=new Wt;LR.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Br(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),LR.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Br(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){this.isVisible()&&this.hide(),wl(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",pd(this.view),this.toDisposeOnClean=e.render(this.view)||wt.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Xm&&U8.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;let e=this.delegate.getAnchor(),t;if(QIe(e)){let f=Bl(e);t={top:f.top,left:f.left,width:f.width,height:f.height}}else t={top:e.y,left:e.x,width:e.width||1,height:e.height||2};const i=hf(this.view),s=mq(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let c,u;if(a===0){const f={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},g={offset:t.left,size:t.width,position:r===0?0:1,mode:CC.ALIGN};c=j1(window.innerHeight,s,f)+window.pageYOffset,aa.intersects({start:c,end:c+s},{start:f.offset,end:f.offset+f.size})&&(g.mode=CC.AVOID),u=j1(window.innerWidth,i,g)}else{const f={offset:t.left,size:t.width,position:r===0?0:1},g={offset:t.top,size:t.height,position:o===0?0:1,mode:CC.ALIGN};u=j1(window.innerWidth,i,f),aa.intersects({start:u,end:u+i},{start:f.offset,end:f.offset+f.size})&&(g.mode=CC.AVOID),c=j1(window.innerHeight,s,g)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Bl(this.container);this.view.style.top=`${c-(this.useFixedPosition?Bl(this.view).top:d.top)}px`,this.view.style.left=`${u-(this.useFixedPosition?Bl(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Vc(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Pm(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}LR.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];LR.BUBBLE_DOWN_EVENTS=["click"];let POt=`
- :host {
- all: initial; /* 1st rule so subsequent properties are reset. */
- }
- @font-face {
- font-family: "codicon";
- font-display: block;
- src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
- }
- .codicon[class*='codicon-'] {
- font: normal normal normal 16px/1 codicon;
- display: inline-block;
- text-decoration: none;
- text-rendering: auto;
- text-align: center;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- user-select: none;
- -webkit-user-select: none;
- -ms-user-select: none;
- }
- :host {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
- }
- :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
- :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
- :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
- :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
- :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
- :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
- :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
- :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
- :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
- :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
- :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
- :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
- :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
- :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
- :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
- `;function rse(...n){return function(e,t){for(let i=0,s=n.length;i<s;i++){const o=n[i](e,t);if(o)return o}return null}}const M6=FOt.bind(void 0,!0);function FOt(n,e,t){if(!t||t.length<e.length)return null;let i;return n?i=sLe(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function HOe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function BOt(n,e){return SJ(n.toLowerCase(),e.toLowerCase(),0,0)}function SJ(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=SJ(n,e,t+1,i+1))?cse({start:i,end:i+1},s):null}return SJ(n,e,t,i+1)}function lse(n){return 97<=n&&n<=122}function k6(n){return 65<=n&&n<=90}function ase(n){return 48<=n&&n<=57}function VOe(n){return n===32||n===9||n===10||n===13}const UOe=new Set;"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".split("").forEach(n=>UOe.add(n.charCodeAt(0)));function Q3(n){return VOe(n)||UOe.has(n)}function HOt(n,e){return n===e||Q3(n)&&Q3(e)}function WOe(n){return lse(n)||k6(n)||ase(n)}function cse(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function GOe(n,e){for(let t=e;t<n.length;t++){const i=n.charCodeAt(t);if(k6(i)||ase(i)||t>0&&!WOe(n.charCodeAt(t-1)))return t}return n.length}function wJ(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=wJ(n,e,t+1,i+1);!s&&(o=GOe(e,o))<e.length;)s=wJ(n,e,t+1,o),o++;return s===null?null:cse({start:i,end:i+1},s)}}function VOt(n){let e=0,t=0,i=0,s=0,o=0;for(let d=0;d<n.length;d++)o=n.charCodeAt(d),k6(o)&&e++,lse(o)&&t++,WOe(o)&&i++,ase(o)&&s++;const r=e/n.length,a=t/n.length,c=i/n.length,u=s/n.length;return{upperPercent:r,lowerPercent:a,alphaPercent:c,numericPercent:u}}function UOt(n){const{upperPercent:e,lowerPercent:t}=n;return t===0&&e>.6}function WOt(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function GOt(n){let e=0,t=0,i=0,s=0;for(let o=0;o<n.length;o++)i=n.charCodeAt(o),k6(i)&&e++,lse(i)&&t++,VOe(i)&&s++;return(e===0||t===0)&&s===0?n.length<=30:e<=5}function zOe(n,e){if(!e||(e=e.trim(),e.length===0)||!GOt(n)||e.length>60)return null;const t=VOt(e);if(!WOt(t)){if(!UOt(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s<e.length&&(i=wJ(n,e,0,s))===null;)s=GOe(e,s+1);return i}function zOt(n,e,t=!1){if(!e||e.length===0)return null;let i=null,s=0;for(n=n.toLowerCase(),e=e.toLowerCase();s<e.length&&(i=IJ(n,e,0,s,t))===null;)s=KOe(e,s+1);return i}function IJ(n,e,t,i,s){if(t===n.length)return[];if(i===e.length)return null;if(HOt(n.charCodeAt(t),e.charCodeAt(i))){let o=null,r=i+1;if(o=IJ(n,e,t+1,i+1,s),!s)for(;!o&&(r=KOe(e,r))<e.length;)o=IJ(n,e,t+1,r,s),r++;return o===null?null:cse({start:i,end:i+1},o)}else return null}function KOe(n,e){for(let t=e;t<n.length;t++)if(Q3(n.charCodeAt(t))||t>0&&Q3(n.charCodeAt(t-1)))return t;return n.length}const KOt=rse(M6,zOe,HOe),jOt=rse(M6,zOe,BOt),xge=new Py(1e4);function Pge(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=xge.get(n);i||(i=new RegExp(Jvt(n),"i"),xge.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?jOt(n,e):KOt(n,e)}function XOt(n,e,t,i,s,o){const r=Math.min(13,n.length);for(;t<r;t++){const a=OR(n,e,t,i,s,o,!1);if(a)return a}return[0,o]}function A6(n){if(typeof n>"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const yC=128;function use(){const n=[],e=[];for(let t=0;t<=yC;t++)e[t]=0;for(let t=0;t<=yC;t++)n.push(e.slice(0));return n}function jOe(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const XOe=jOe(2*yC),LJ=jOe(2*yC),hv=use(),fS=use(),dV=use();function hV(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 40:case 91:return!0;case void 0:return!1;default:return!!UD(t)}}function Fge(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function f4(n,e,t){return e[n]!==t[n]}function YOt(n,e,t,i,s,o,r=!1){for(;e<t&&s<o;)n[e]===i[s]&&(r&&(XOe[e]=s),e+=1),s+=1;return e===t}var jg;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(jg||(jg={}));function OR(n,e,t,i,s,o,r){const a=n.length>yC?yC:n.length,c=i.length>yC?yC:i.length;if(t>=a||o>=c||a-t>c-o||!YOt(e,t,a,s,o,c,!0))return;qOt(a,c,t,o,e,s);let u=1,d=1,f=t,g=o;const p=[!1];for(u=1,f=t;f<a;u++,f++){const w=XOe[f],I=LJ[f],L=f+1<a?LJ[f+1]:c;for(d=w-o+1,g=w;g<L;d++,g++){let O=Number.MIN_SAFE_INTEGER,A=!1;g<=I&&(O=JOt(n,e,f,t,i,s,g,c,o,hv[u-1][d-1]===0,p));let N=0;O!==Number.MAX_SAFE_INTEGER&&(A=!0,N=O+fS[u-1][d-1]);const D=g>w,P=D?fS[u][d-1]+(hv[u][d-1]>0?-5:0):0,F=g>w+1&&hv[u][d-1]>0,V=F?fS[u][d-2]+(hv[u][d-2]>0?-5:0):0;if(F&&(!D||V>=P)&&(!A||V>=N))fS[u][d]=V,dV[u][d]=3,hv[u][d]=0;else if(D&&(!A||P>=N))fS[u][d]=P,dV[u][d]=2,hv[u][d]=0;else if(A)fS[u][d]=N,dV[u][d]=1,hv[u][d]=hv[u-1][d-1]+1;else throw new Error("not possible")}}if(!p[0]&&!r)return;u--,d--;const _=[fS[u][d],o];let v=0,C=0;for(;u>=1;){let w=d;do{const I=dV[u][w];if(I===3)w=w-2;else if(I===2)w=w-1;else break}while(w>=1);v>1&&e[t+u-1]===s[o+d-1]&&!f4(w+o-1,i,s)&&v+1>hv[u][w]&&(w=d),w===d?v++:v=1,C||(C=w),u--,d=w-1,_.push(d)}c===a&&(_[0]+=2);const y=C-a;return _[0]-=y,_}function qOt(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(LJ[r]=a,r--),a--}function JOt(n,e,t,i,s,o,r,a,c,u,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let f=1,g=!1;return r===t-i?f=n[t]===s[r]?7:5:f4(r,s,o)&&(r===0||!f4(r-1,s,o))?(f=n[t]===s[r]?7:5,g=!0):hV(o,r)&&(r===0||!hV(o,r-1))?f=5:(hV(o,r-1)||Fge(o,r-1))&&(f=5,g=!0),f>1&&t===i&&(d[0]=!0),g||(g=f4(r,s,o)||hV(o,r-1)||Fge(o,r-1)),t===i?r>c&&(f-=g?3:5):u?f+=g?2:0:f+=g?0:1,r+1===a&&(f-=g?3:5),f}function QOt(n,e,t,i,s,o,r){return ZOt(n,e,t,i,s,o,!0,r)}function ZOt(n,e,t,i,s,o,r,a){let c=OR(n,e,t,i,s,o,a);if(c&&!r)return c;if(n.length>=3){const u=Math.min(7,n.length-1);for(let d=t+1;d<u;d++){const f=eRt(n,d);if(f){const g=OR(f,f.toLowerCase(),t,i,s,o,a);g&&(g[0]-=3,(!c||g[0]>c[0])&&(c=g))}}}return c}function eRt(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const f$="$(",dse=new RegExp(`\\$\\(${Lu.iconNameExpression}(?:${Lu.iconModifierExpression})?\\)`,"g"),tRt=new RegExp(`(\\\\)?${dse.source}`,"g");function nRt(n){return n.replace(tRt,(e,t)=>t?e:`\\${e}`)}const iRt=new RegExp(`\\\\${dse.source}`,"g");function sRt(n){return n.replace(iRt,e=>`\\${e}`)}const oRt=new RegExp(`(\\s)?(\\\\)?${dse.source}(\\s)?`,"g");function YOe(n){return n.indexOf(f$)===-1?n:n.replace(oRt,(e,t,i,s)=>i?e:t||s||"")}function fV(n){const e=n.indexOf(f$);return e===-1?{text:n}:rRt(n,e)}function rRt(n,e){const t=[];let i="";function s(g){if(g){i+=g;for(const p of g)t.push(a)}}let o=-1,r="",a=0,c,u,d=e;const f=n.length;for(s(n.substr(0,e));d<f;){if(c=n[d],u=n[d+1],c===f$[0]&&u===f$[1])o=d,s(r),r=f$,d++;else if(c===")"&&o!==-1){const g=d-o+1;a+=g,o=-1,r=""}else o!==-1?/^[a-z0-9\-]$/i.test(c)?r+=c:(s(r),o=-1,r=""):s(c);d++}return s(r),{text:i,iconOffsets:t}}function gV(n,e,t=!1){const{text:i,iconOffsets:s}=e;if(!s||s.length===0)return Pge(n,i,t);const o=kne(i," "),r=i.length-o.length,a=Pge(n,o,t);if(a)for(const c of a){const u=s[c.start+r]+r;c.start+=u,c.end+=u}return a}const OJ=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,N7=/(&)?(&)([^\s&])/g,qOe=Zf("menu-selection",vn.check),JOe=Zf("menu-submenu",vn.chevronRight);var Z3;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(Z3||(Z3={}));let QOe=class mD extends pb{constructor(e,t,i={}){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:a=>this.doGetActionViewItem(a,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...ki||Qc?[10]:[]],keyDown:!0}}),this.menuElement=s,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Wt),this.initializeStyleSheet(e),this._register(Ds.addTarget(s)),Pt(s,An.KEY_DOWN,a=>{new Po(a).equals(2)&&a.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(Pt(s,An.KEY_DOWN,a=>{const c=a.key.toLocaleLowerCase();if(this.mnemonics.has(c)){Rs.stop(a,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof Bge&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(a)),u.length>1){const d=u.shift();d&&d.container&&(this.focusItemByElement(d.container),u.push(d)),this.mnemonics.set(c,u)}}})),Qc&&this._register(Pt(s,An.KEY_DOWN,a=>{const c=new Po(a);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Rs.stop(a,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Rs.stop(a,!0))})),this._register(Pt(this.domNode,An.MOUSE_OUT,a=>{let c=a.relatedTarget;Pm(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),a.stopPropagation())})),this._register(Pt(this.actionsList,An.MOUSE_OVER,a=>{let c=a.target;if(!(!c||!Pm(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Ds.addTarget(this.actionsList)),this._register(Pt(this.actionsList,so.Tap,a=>{let c=a.initialTarget;if(!(!c||!Pm(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}}));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new RF(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(Pt(s,so.Change,a=>{Rs.stop(a,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-a.translationY})})),this._register(Pt(r,An.MOUSE_UP,a=>{a.preventDefault()})),s.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(a=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(a.id)?(console.warn(`Found submenu cycle: ${a.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(a=>!(a instanceof D7)).forEach((a,c,u)=>{a.updatePositionInSet(c+1,u.length)})}initializeStyleSheet(e){G8(e)?(this.styleSheet=kd(e),this.styleSheet.textContent=Hge):(mD.globalStyleSheet||(mD.globalStyleSheet=kd(),mD.globalStyleSheet.textContent=Hge),this.styleSheet=mD.globalStyleSheet)}style(e){const t=this.getContainer(),i=e.foregroundColor?`${e.foregroundColor}`:"",s=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",r=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=s,t.style.boxShadow=r,this.viewItems&&this.viewItems.forEach(a=>{(a instanceof RJ||a instanceof D7)&&a.style(e)})}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++){let i=this.actionsList.children[t];if(e===i){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0),typeof this.focusedItem<"u"&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof Ff)return new D7(t.context,e,{icon:!0});if(e instanceof p6){const s=new Bge(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}));if(t.enableMnemonics){const o=s.getMnemonic();if(o&&s.isEnabled()){let r=[];this.mnemonics.has(o)&&(r=this.mnemonics.get(o)),r.push(s),this.mnemonics.set(o,r)}}return s}else{const s={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const r=t.getKeyBinding(e);if(r){const a=r.getLabel();a&&(s.keybinding=a)}}const o=new RJ(t.context,e,s);if(t.enableMnemonics){const r=o.getMnemonic();if(r&&o.isEnabled()){let a=[];this.mnemonics.has(r)&&(a=this.mnemonics.get(r)),a.push(o),this.mnemonics.set(r,a)}}return o}}};class RJ extends w0{constructor(e,t,i={}){if(i.isMenu=!0,super(t,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass="",this.options.label&&i.enableMnemonics){let s=this.getAction().label;if(s){let o=OJ.exec(s);o&&(this.mnemonic=(o[1]?o[1]:o[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new ho(()=>{this.element&&(this._register(Pt(this.element,An.MOUSE_UP,s=>{if(Rs.stop(s,!0),ac){if(new fh(s).rightButton)return;this.onClick(s)}else setTimeout(()=>{this.onClick(s)},0)})),this._register(Pt(this.element,An.CONTEXT_MENU,s=>{Rs.stop(s,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Nt(this.element,Vt("a.action-menu-item")),this._action.id===Ff.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Nt(this.item,Vt("span.menu-item-check"+qOe.cssSelector)),this.check.setAttribute("role","none"),this.label=Nt(this.item,Vt("span.action-label")),this.options.label&&this.options.keybinding&&(Nt(this.item,Vt("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){wl(this.label);let e=YOe(this.getAction().label);if(e){const t=lRt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=OJ.exec(e);if(i){e=Mne(e),N7.lastIndex=0;let s=N7.exec(e);for(;s&&s[1];)s=N7.exec(e);const o=r=>r.replace(/&&/g,"&");s?this.label.append(kne(o(e.substr(0,s.index))," "),Vt("u",{"aria-hidden":"true"},s[3]),nLe(o(e.substr(s.index+s[0].length))," ")):this.label.innerText=o(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=$({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.getAction().enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.getAction().checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=s)}style(e){this.menuStyle=e,this.applyStyle()}}class Bge extends RJ{constructor(e,t,i,s){super(e,e,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new Wt),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:Z3.Right,this.showScheduler=new ho(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ho(()=>{this.element&&!Pm(_O(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Nt(this.item,Vt("span.submenu-indicator"+JOe.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Pt(this.element,An.KEY_UP,t=>{let i=new Po(t);(i.equals(17)||i.equals(3))&&(Rs.stop(t,!0),this.createSubmenu(!0))})),this._register(Pt(this.element,An.KEY_DOWN,t=>{let i=new Po(t);_O()===this.item&&(i.equals(17)||i.equals(3))&&Rs.stop(t,!0)})),this._register(Pt(this.element,An.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(Pt(this.element,An.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(Pt(this.element,An.FOCUS_OUT,t=>{this.element&&!Pm(_O(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}updateEnabled(){}onClick(e){Rs.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=j1(e.width,t.width,{position:s===Z3.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=j1(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=Nt(this.element,Vt("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new QOe(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new m6],this.submenuOptions),this.menuStyle&&this.parentData.submenu.style(this.menuStyle);const s=this.element.getBoundingClientRect(),o={top:s.top-i,left:s.left,height:s.height+2*i,width:s.width},r=this.submenuContainer.getBoundingClientRect(),{top:a,left:c}=this.calculateSubmenuMenuLayout(new eo(window.innerWidth,window.innerHeight),eo.lift(r),o,this.expandDirection);this.submenuContainer.style.left=`${c-r.left}px`,this.submenuContainer.style.top=`${a-r.top}px`,this.submenuDisposables.add(Pt(this.submenuContainer,An.KEY_UP,u=>{new Po(u).equals(15)&&(Rs.stop(u,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(Pt(this.submenuContainer,An.KEY_DOWN,u=>{new Po(u).equals(15)&&Rs.stop(u,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t?`${t}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class D7 extends Zx{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function lRt(n){const e=OJ,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}let Hge=`
- .monaco-menu {
- font-size: 13px;
- }
- ${$ge(qOe)}
- ${$ge(JOe)}
- .monaco-menu .monaco-action-bar {
- text-align: right;
- overflow: hidden;
- white-space: nowrap;
- }
- .monaco-menu .monaco-action-bar .actions-container {
- display: flex;
- margin: 0 auto;
- padding: 0;
- width: 100%;
- justify-content: flex-end;
- }
- .monaco-menu .monaco-action-bar.vertical .actions-container {
- display: inline-block;
- }
- .monaco-menu .monaco-action-bar.reverse .actions-container {
- flex-direction: row-reverse;
- }
- .monaco-menu .monaco-action-bar .action-item {
- cursor: pointer;
- display: inline-block;
- transition: transform 50ms ease;
- position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
- }
- .monaco-menu .monaco-action-bar .action-item.disabled {
- cursor: default;
- }
- .monaco-menu .monaco-action-bar.animated .action-item.active {
- transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
- }
- .monaco-menu .monaco-action-bar .action-item .icon,
- .monaco-menu .monaco-action-bar .action-item .codicon {
- display: inline-block;
- }
- .monaco-menu .monaco-action-bar .action-item .codicon {
- display: flex;
- align-items: center;
- }
- .monaco-menu .monaco-action-bar .action-label {
- font-size: 11px;
- margin-right: 4px;
- }
- .monaco-menu .monaco-action-bar .action-item.disabled .action-label,
- .monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
- opacity: 0.4;
- }
- /* Vertical actions */
- .monaco-menu .monaco-action-bar.vertical {
- text-align: left;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item {
- display: block;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label.separator {
- display: block;
- border-bottom: 1px solid #bbb;
- padding-top: 1px;
- margin-left: .8em;
- margin-right: .8em;
- }
- .monaco-menu .secondary-actions .monaco-action-bar .action-label {
- margin-left: 6px;
- }
- /* Action Items */
- .monaco-menu .monaco-action-bar .action-item.select-container {
- overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
- flex: 1;
- max-width: 170px;
- min-width: 60px;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 10px;
- }
- .monaco-menu .monaco-action-bar.vertical {
- margin-left: 0;
- overflow: visible;
- }
- .monaco-menu .monaco-action-bar.vertical .actions-container {
- display: block;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item {
- padding: 0;
- transform: none;
- display: flex;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item.active {
- transform: none;
- }
- .monaco-menu .monaco-action-bar.vertical .action-menu-item {
- flex: 1 1 auto;
- display: flex;
- height: 2em;
- align-items: center;
- position: relative;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label {
- flex: 1 1 auto;
- text-decoration: none;
- padding: 0 1em;
- background: none;
- font-size: 12px;
- line-height: 1;
- }
- .monaco-menu .monaco-action-bar.vertical .keybinding,
- .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
- display: inline-block;
- flex: 2 1 auto;
- padding: 0 1em;
- text-align: right;
- font-size: 12px;
- line-height: 1;
- }
- .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
- height: 100%;
- }
- .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
- font-size: 16px !important;
- display: flex;
- align-items: center;
- }
- .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
- margin-left: auto;
- margin-right: -20px;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
- .monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
- opacity: 0.4;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
- display: inline-block;
- box-sizing: border-box;
- margin: 0;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item {
- position: static;
- overflow: visible;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
- position: absolute;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label.separator {
- padding: 0.5em 0 0 0;
- margin-bottom: 0.5em;
- width: 100%;
- height: 0px !important;
- margin-left: .8em !important;
- margin-right: .8em !important;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
- padding: 0.7em 1em 0.1em 1em;
- font-weight: bold;
- opacity: 1;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label:hover {
- color: inherit;
- }
- .monaco-menu .monaco-action-bar.vertical .menu-item-check {
- position: absolute;
- visibility: hidden;
- width: 1em;
- height: 100%;
- }
- .monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
- visibility: visible;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- /* Context Menu */
- .context-view.monaco-menu-container {
- outline: 0;
- border: none;
- animation: fadeIn 0.083s linear;
- -webkit-app-region: no-drag;
- }
- .context-view.monaco-menu-container :focus,
- .context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
- .context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
- outline: 0;
- }
- .monaco-menu .monaco-action-bar.vertical .action-item {
- border: thin solid transparent; /* prevents jumping behaviour on hover or focus */
- }
- /* High Contrast Theming */
- :host-context(.hc-black) .context-view.monaco-menu-container {
- box-shadow: none;
- }
- :host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
- background: none;
- }
- /* Vertical Action Bar Styles */
- .monaco-menu .monaco-action-bar.vertical {
- padding: .5em 0;
- }
- .monaco-menu .monaco-action-bar.vertical .action-menu-item {
- height: 1.8em;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
- .monaco-menu .monaco-action-bar.vertical .keybinding {
- font-size: inherit;
- padding: 0 2em;
- }
- .monaco-menu .monaco-action-bar.vertical .menu-item-check {
- font-size: inherit;
- width: 2em;
- }
- .monaco-menu .monaco-action-bar.vertical .action-label.separator {
- font-size: inherit;
- padding: 0.2em 0 0 0;
- margin-bottom: 0.2em;
- }
- :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
- margin-left: 0;
- margin-right: 0;
- }
- .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
- font-size: 60%;
- padding: 0 1.8em;
- }
- :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
- height: 100%;
- mask-size: 10px 10px;
- -webkit-mask-size: 10px 10px;
- }
- .monaco-menu .action-item {
- cursor: default;
- }
- /* Arrows */
- .monaco-scrollable-element > .scrollbar > .scra {
- cursor: pointer;
- font-size: 11px !important;
- }
- .monaco-scrollable-element > .visible {
- opacity: 1;
- /* Background rule added for IE9 - to allow clicks on dom node */
- background:rgba(0,0,0,0);
- transition: opacity 100ms linear;
- }
- .monaco-scrollable-element > .invisible {
- opacity: 0;
- pointer-events: none;
- }
- .monaco-scrollable-element > .invisible.fade {
- transition: opacity 800ms linear;
- }
- /* Scrollable Content Inset Shadow */
- .monaco-scrollable-element > .shadow {
- position: absolute;
- display: none;
- }
- .monaco-scrollable-element > .shadow.top {
- display: block;
- top: 0;
- left: 3px;
- height: 3px;
- width: 100%;
- box-shadow: #DDD 0 6px 6px -6px inset;
- }
- .monaco-scrollable-element > .shadow.left {
- display: block;
- top: 3px;
- left: 0;
- height: 100%;
- width: 3px;
- box-shadow: #DDD 6px 0 6px -6px inset;
- }
- .monaco-scrollable-element > .shadow.top-left-corner {
- display: block;
- top: 0;
- left: 0;
- height: 3px;
- width: 3px;
- }
- .monaco-scrollable-element > .shadow.top.left {
- box-shadow: #DDD 6px 6px 6px -6px inset;
- }
- /* ---------- Default Style ---------- */
- :host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {
- background: rgba(100, 100, 100, .4);
- }
- :host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {
- background: rgba(121, 121, 121, .4);
- }
- :host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {
- background: rgba(111, 195, 223, .6);
- }
- .monaco-scrollable-element > .scrollbar > .slider:hover {
- background: rgba(100, 100, 100, .7);
- }
- :host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {
- background: rgba(111, 195, 223, .8);
- }
- .monaco-scrollable-element > .scrollbar > .slider.active {
- background: rgba(0, 0, 0, .6);
- }
- :host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {
- background: rgba(191, 191, 191, .4);
- }
- :host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {
- background: rgba(111, 195, 223, 1);
- }
- :host-context(.vs-dark) .monaco-scrollable-element .shadow.top {
- box-shadow: none;
- }
- :host-context(.vs-dark) .monaco-scrollable-element .shadow.left {
- box-shadow: #000 6px 0 6px -6px inset;
- }
- :host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {
- box-shadow: #000 6px 6px 6px -6px inset;
- }
- :host-context(.hc-black) .monaco-scrollable-element .shadow.top {
- box-shadow: none;
- }
- :host-context(.hc-black) .monaco-scrollable-element .shadow.left {
- box-shadow: none;
- }
- :host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {
- box-shadow: none;
- }
- `;function Lg(n,e){const t=Object.create(null);for(let i in e){const s=e[i];s&&(t[i]=bv(s,n))}return t}function hse(n,e,t){function i(){const s=Lg(n.getColorTheme(),e);typeof t=="function"?t(s):t.style(s)}return i(),n.onDidColorThemeChange(i)}function aRt(n,e,t){return hse(e,{badgeBackground:i$,badgeForeground:s$,badgeBorder:_r},n)}function rw(n,e,t){return hse(e,Object.assign(Object.assign({},N6),t||{}),n)}const N6={listFocusBackground:d0t,listFocusForeground:h0t,listFocusOutline:f0t,listActiveSelectionBackground:BC,listActiveSelectionForeground:HC,listActiveSelectionIconForeground:o4,listFocusAndSelectionBackground:BC,listFocusAndSelectionForeground:HC,listInactiveSelectionBackground:g0t,listInactiveSelectionIconForeground:m0t,listInactiveSelectionForeground:p0t,listInactiveFocusBackground:_0t,listInactiveFocusOutline:v0t,listHoverBackground:b0t,listHoverForeground:T0t,listDropBackground:C0t,listSelectionOutline:Ua,listHoverOutline:Ua,listFilterWidgetBackground:y0t,listFilterWidgetOutline:E0t,listFilterWidgetNoMatchesOutline:S0t,listMatchesShadow:dy,treeIndentGuidesStroke:w0t,tableColumnsBorder:I0t},cRt={shadowColor:dy,borderColor:L0t,foregroundColor:O0t,backgroundColor:R0t,selectionForegroundColor:M0t,selectionBackgroundColor:k0t,selectionBorderColor:A0t,separatorColor:N0t};function uRt(n,e,t){return hse(e,Object.assign(Object.assign({},cRt),t),n)}class dRt{constructor(e,t,i,s,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i,s=QIe(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{let r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(Vt(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",Pt(this.block,An.MOUSE_DOWN,u=>u.stopPropagation()));const a=new Wt,c=e.actionRunner||new bR;return c.onBeforeRun(this.onActionRun,this,a),c.onDidRun(this.onDidActionRun,this,a),i=new QOe(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)}),a.add(uRt(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a),a.add(Pt(window,An.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(Pt(window,An.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;let d=new fh(u),f=d.target;if(!d.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),AC(a,i)},focus:()=>{i&&i.focus(!!e.autoSelectFirstItem)},onHide:o=>{e.onHide&&e.onHide(!!o),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},s,!!s)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!d_(e.error)&&this.notificationService.error(e.error)}}var hRt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},VN=function(n,e){return function(t,i){e(t,i,n)}};let MJ=class extends wt{constructor(e,t,i,s,o){super(),this.contextMenuHandler=new dRt(i,e,t,s,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),YS.getInstance().resetKeyStatus()}};MJ=hRt([VN(0,By),VN(1,Hr),VN(2,Hy),VN(3,Ro),VN(4,fo)],MJ);const D6=ss("layoutService");var fRt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gRt=function(n,e){return function(t,i){e(t,i,n)}};let kJ=class extends wt{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=wt.None,this.container=e.container,this.contextView=this._register(new LR(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t!==this.container&&(this.container=t,this.setContainer(t,i?3:2)):this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const s=xi(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};kJ=fRt([gRt(0,D6)],kJ);const AF=ss("dialogService");let pRt=class{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}};class mRt{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(this._hashFn(t),s),s.incoming.set(this._hashFn(e),i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new pRt(e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join(`
- `)}findCycleSlow(){for(let[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(let[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}class Vge extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph:
- ${e.toString()}`}}class e5{constructor(e=new qx,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(Qi,this)}createChild(e){return new e5(e,this._strict,this)}invokeFunction(e,...t){let i=yf.traceInvocation(e),s=!1;try{return e({get:(r,a)=>{if(s)throw G_t("service accessor is only valid during the invocation of its target method");const c=this._getOrCreateServiceInstance(r,i);if(!c&&a!==gvt)throw new Error(`[invokeFunction] unknown service '${r}'`);return c}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof nC?(i=yf.traceCreation(e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=yf.traceCreation(e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){let s=Pg.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of s){let c=this._getOrCreateServiceInstance(a.id,i);if(!c&&this._strict&&!a.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`);o.push(c)}let r=s.length>0?s[0].index:t.length;if(t.length!==r){console.warn(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);let a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return new e(...t,...o)}_setServiceInstance(e,t){if(this._services.get(e)instanceof nC)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof nC?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const s=new mRt(a=>a.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(s.lookupOrInsertNode(a),o++>1e3)throw new Vge(s);for(let c of Pg.getServiceDependencies(a.desc.ctor)){let u=this._getServiceInstanceOrDescriptor(c.id);if(!u&&!c.optional&&console.warn(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`),u instanceof nC){const d={id:c.id,desc:u,_trace:a._trace.branch(c.id,!0)};s.insertEdge(a,d),r.push(d)}}}for(;;){const a=s.roots();if(a.length===0){if(!s.isEmpty())throw new Vge(s);break}for(const{data:c}of a){if(this._getServiceInstanceOrDescriptor(c.id)instanceof nC){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,d)}s.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof nC)return this._createServiceInstance(t,i,s,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],i,s){if(i){const o=new mO(()=>this._createInstance(e,t,s));return new Proxy(Object.create(null),{get(r,a){if(a in r)return r[a];let c=o.value,u=c[a];return typeof u!="function"||(u=u.bind(c),r[a]=u),u},set(r,a,c){return o.value[a]=c,!0}})}else return this._createInstance(e,t,s)}}class yf{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return yf._None}static traceCreation(e){return yf._None}branch(e,t){let i=new yf(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;yf._totals+=e;let t=!1;function i(o,r){let a=[],c=new Array(o+1).join(" ");for(const[u,d,f]of r._dep)if(d&&f){t=!0,a.push(`${c}CREATES -> ${u}`);let g=i(o+1,f);g&&a.push(g)}else a.push(`${c}uses -> ${u}`);return a.join(`
- `)}let s=[`${this.type===0?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${yf._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(s.join(`
- `))}}yf._None=new class extends yf{constructor(){super(-1,null)}stop(){}branch(){return this}};yf._totals=0;const NF=ss("labelService");class _Rt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class gS extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Uge(n,e){const t=[];for(let i of e){if(n.start>=i.range.end)continue;if(n.end<i.range.start)break;const s=aa.intersect(n,i.range);aa.isEmpty(s)||t.push({range:s,size:i.size})}return t}function AJ({start:n,end:e},t){return{start:n+t,end:e+t}}function vRt(n){const e=[];let t=null;for(let i of n){const s=i.range.start,o=i.range.end,r=i.size;if(t&&r===t.size){t.range.end=o;continue}t={range:{start:s,end:o},size:r},e.push(t)}return e}function bRt(...n){return vRt(n.reduce((e,t)=>e.concat(t),[]))}class Wge{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const s=i.length-t,o=Uge({start:0,end:e},this.groups),r=Uge({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:AJ(c.range,s),size:c.size})),a=i.map((c,u)=>({range:{start:e+u,end:e+u+1},size:c.size}));this.groups=bRt(o,a,r),this._size=this.groups.reduce((c,u)=>c+u.size*(u.range.end-u.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(let s of this.groups){const o=s.range.end-s.range.start,r=i+o*s.size;if(e<r)return t+Math.floor((e-i)/s.size);t+=o,i=r}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(let s of this.groups){const o=s.range.end-s.range.start,r=i+o;if(e<r)return t+(e-i)*s.size;t+=o*s.size,i=r}return-1}}function TRt(n){try{n.parentElement&&n.parentElement.removeChild(n)}catch{}}class CRt{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const i=Vt(".monaco-list-row"),o=this.getRenderer(e).renderTemplate(i);t={domNode:i,templateId:e,templateData:o}}return t}release(e){e&&this.releaseRow(e)}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(t.classList.remove("scrolling"),TRt(t)),this.getTemplateCache(i).push(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var jw=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Qp={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class DF{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class yRt{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class ERt{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}function SRt(n,e){return Array.isArray(n)&&Array.isArray(e)?xf(n,e):n===e}class wRt{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,i,s)=>s,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class _p{constructor(e,t,i,s=Qp){if(this.virtualDelegate=t,this.domId=`list_id_${++_p.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new db(50),this.splicing=!1,this.dragOverAnimationStopDisposable=wt.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=wt.None,this.onDragLeaveTimeout=wt.None,this.disposables=new Wt,this._onDidChangeContentHeight=new rt,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new Wge;for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new CRt(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=Jp(s,r=>r.horizontalScrolling,Qp.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=typeof s.additionalScrollHeight>"u"?0:s.additionalScrollHeight,this.accessibilityProvider=new wRt(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",Jp(s,r=>r.transformOptimization,Qp.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(Ds.addTarget(this.rowsContainer)),this.scrollable=new L6(Jp(s,r=>r.smoothScrolling,!1)?125:0,r=>qm(r)),this.scrollableElement=this.disposables.add(new Uie(this.rowsContainer,{alwaysConsumeMouseWheel:Jp(s,r=>r.alwaysConsumeMouseWheel,Qp.alwaysConsumeMouseWheel),horizontal:1,vertical:Jp(s,r=>r.verticalScrollMode,Qp.verticalScrollMode),useShadows:Jp(s,r=>r.useShadows,Qp.useShadows),mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(Pt(this.rowsContainer,so.Change,r=>this.onTouchChange(r))),this.disposables.add(Pt(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(Pt(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(Pt(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(Pt(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(Pt(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=Jp(s,r=>r.setRowLineHeight,Qp.setRowLineHeight),this.setRowHeight=Jp(s,r=>r.setRowHeight,Qp.setRowHeight),this.supportDynamicHeights=Jp(s,r=>r.supportDynamicHeights,Qp.supportDynamicHeights),this.dnd=Jp(s,r=>r.dnd,Qp.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:I9(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){e.additionalScrollHeight!==void 0&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling),e.mouseWheelScrollSensitivity!==void 0&&this.scrollableElement.updateOptions({mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&this.scrollableElement.updateOptions({fastScrollSensitivity:e.fastScrollSensitivity})}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=aa.intersect(s,o),a=new Map;for(let A=r.start;A<r.end;A++){const N=this.items[A];if(N.dragStartDisposable.dispose(),N.row){let D=a.get(N.templateId);D||(D=[],a.set(N.templateId,D));const P=this.renderers.get(N.templateId);P&&P.disposeElement&&P.disposeElement(N.element,A,N.row.templateData,N.size),D.push(N.row)}N.row=null}const c={start:e+t,end:this.items.length},u=aa.intersect(c,s),d=aa.relativeComplement(c,s),f=i.map(A=>({id:String(this.itemId++),element:A,templateId:this.virtualDelegate.getTemplateId(A),size:this.virtualDelegate.getHeight(A),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(A),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:wt.None}));let g;e===0&&t>=this.items.length?(this.rangeMap=new Wge,this.rangeMap.splice(0,0,f),g=this.items,this.items=f):(this.rangeMap.splice(e,t,f),g=this.items.splice(e,t,...f));const p=i.length-t,_=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),v=AJ(u,p),C=aa.intersect(_,v);for(let A=C.start;A<C.end;A++)this.updateItemInDOM(this.items[A],A);const y=aa.relativeComplement(v,_);for(const A of y)for(let N=A.start;N<A.end;N++)this.removeItemFromDOM(N);const w=d.map(A=>AJ(A,p)),L=[{start:e,end:e+i.length},...w].map(A=>aa.intersect(_,A)),O=this.getNextToLastElement(L);for(const A of L)for(let N=A.start;N<A.end;N++){const D=this.items[N],P=a.get(D.templateId),F=P==null?void 0:P.pop();this.insertItemInDOM(N,O,F)}for(const A of a.values())for(const N of A)this.cache.release(N);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),g.map(A=>A.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=qm(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:typeof e=="number"?e:Bvt(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:I9(this.domNode)})}render(e,t,i,s,o,r=!1){const a=this.getRenderRange(t,i),c=aa.relativeComplement(a,e),u=aa.relativeComplement(e,a),d=this.getNextToLastElement(c);if(r){const f=aa.intersect(e,a);for(let g=f.start;g<f.end;g++)this.updateItemInDOM(this.items[g],g)}for(const f of c)for(let g=f.start;g<f.end;g++)this.insertItemInDOM(g,d);for(const f of u)for(let g=f.start;g<f.end;g++)this.removeItemFromDOM(g);s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const s=this.items[e];s.row||(s.row=i??this.cache.alloc(s.templateId));const o=this.accessibilityProvider.getRole(s.element)||"listitem";s.row.domNode.setAttribute("role",o);const r=this.accessibilityProvider.isChecked(s.element);typeof r<"u"&&s.row.domNode.setAttribute("aria-checked",String(!!r)),s.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(s.row.domNode,t):this.rowsContainer.appendChild(s.row.domNode)),this.updateItemInDOM(s,e);const a=this.renderers.get(s.templateId);if(!a)throw new Error(`No renderer found for template id ${s.templateId}`);a&&a.renderElement(s.element,e,s.row.templateData,s.size);const c=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!c,c&&(s.dragStartDisposable=Pt(s.row.domNode,"dragstart",u=>this.onDragStart(s.element,c,u))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=ac?"-moz-fit-content":"fit-content",e.width=I9(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return Ln.map(this.disposables.add(new Zs(this.domNode,"click")).event,e=>this.toMouseEvent(e))}get onMouseDblClick(){return Ln.map(this.disposables.add(new Zs(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return Ln.filter(Ln.map(this.disposables.add(new Zs(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e)),e=>e.browserEvent.button===1)}get onMouseDown(){return Ln.map(this.disposables.add(new Zs(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e))}get onContextMenu(){return Ln.any(Ln.map(this.disposables.add(new Zs(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e)),Ln.map(this.disposables.add(new Zs(this.domNode,so.Contextmenu)).event,e=>this.toGestureEvent(e)))}get onTouchStart(){return Ln.map(this.disposables.add(new Zs(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e))}get onTap(){return Ln.map(this.disposables.add(new Zs(this.rowsContainer,so.Tap)).event,e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(EOe.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(s,i)),typeof o>"u"&&(o=String(s.length));const r=Vt(".monaco-drag-image");r.textContent=o,document.body.appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>document.body.removeChild(r),0)}this.currentDragData=new DF(s),Tv.CurrentDragAndDropData=new yRt(s),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Tv.CurrentDragAndDropData&&Tv.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Tv.CurrentDragAndDropData)this.currentDragData=Tv.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new ERt}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect===0?"copy":"move";let i;if(typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=u3(i).filter(s=>s>=-1&&s<this.length).sort((s,o)=>s-o),i=i[0]===-1?[-1]:i,SRt(this.currentDragFeedback,i))return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=xi(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const s of i){const o=this.items[s];o.dropTarget=!0,o.row&&o.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=xi(()=>{for(const s of i){const o=this.items[s];o.dropTarget=!1,o.row&&o.row.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=j0(()=>this.clearDragOverFeedback(),100),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,Tv.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,Tv.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=wt.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=XIe(this.domNode).top;this.dragOverAnimationDisposable=jvt(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=j0(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const c=this.getRenderRange(e,t);let u=!1;for(let d=c.start;d<c.end;d++){const f=this.probeDynamicHeight(d);f!==0&&this.rangeMap.splice(d,1,[this.items[d]]),a+=f,u=u||f!==0}if(!u){a!==0&&this.eventuallyUpdateScrollDimensions();const d=aa.relativeComplement(s,c);for(const g of d)for(let p=g.start;p<g.end;p++)this.items[p].row&&this.removeItemFromDOM(p);const f=aa.relativeComplement(c,s);for(const g of f)for(let p=g.start;p<g.end;p++){const _=p+1,v=_<this.items.length?this.items[_].row:null,C=v?v.domNode:null;this.insertItemInDOM(p,C)}for(let g=c.start;g<c.end;g++)this.items[g].row&&this.updateItemInDOM(this.items[g],g);if(typeof o=="number"){const g=this.scrollable.getFutureScrollPosition().scrollTop-e,p=this.elementTop(o)-r+g;this.setScrollTop(p,i)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const r=this.virtualDelegate.getDynamicHeight(t.element);if(r!==null){const a=t.size;return t.size=r,t.lastDynamicHeightWidth=this.renderWidth,r-a}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const i=t.size;if(!this.setRowHeight&&t.row){let r=t.row.domNode.offsetHeight;return t.size=r,t.lastDynamicHeightWidth=this.renderWidth,r-i}const s=this.cache.alloc(t.templateId);s.domNode.style.height="",this.rowsContainer.appendChild(s.domNode);const o=this.renderers.get(t.templateId);return o&&(o.renderElement(t.element,e,s.templateData,void 0),o.disposeElement&&o.disposeElement(t.element,e,s.templateData,void 0)),t.size=s.domNode.offsetHeight,this.virtualDelegate.setDynamicHeight&&this.virtualDelegate.setDynamicHeight(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(s.domNode),this.cache.release(s),t.size-i}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return!i||!i.row?null:i.row.domNode}getElementDomId(e){return`${this.domId}_${e}`}dispose(){if(this.items){for(const e of this.items)if(e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement&&t.disposeElement(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[]}this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),Ji(this.disposables)}}_p.InstanceCount=0;jw([Vr],_p.prototype,"onMouseClick",null);jw([Vr],_p.prototype,"onMouseDblClick",null);jw([Vr],_p.prototype,"onMouseMiddleClick",null);jw([Vr],_p.prototype,"onMouseDown",null);jw([Vr],_p.prototype,"onContextMenu",null);jw([Vr],_p.prototype,"onTouchStart",null);jw([Vr],_p.prototype,"onTap",null);var Xw=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gge=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class IRt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.trait}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index<e?s.push(o):o.index>=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let t5=class{constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new rt,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new IRt(this)}splice(e,t,i){var s;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,r=e+t,a=[...this.sortedIndexes.filter(u=>u<e),...i.map((u,d)=>u?d+e:-1).filter(u=>u!==-1),...this.sortedIndexes.filter(u=>u>=r).map(u=>u+o)],c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const u=(s=this.sortedIndexes.find(d=>d>=e))!==null&&s!==void 0?s:c-1;a.push(Math.min(u,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(Kge),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=NJ(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return Xne(this.sortedIndexes,e,Kge)>=0}dispose(){Ji(this._onChange)}};Xw([Vr],t5.prototype,"renderer",null);class LRt extends t5{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class $7{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map(()=>!1));const s=this.trait.get().map(r=>this.identityProvider.getId(this.view.element(r)).toString()),o=i.map(r=>s.indexOf(this.identityProvider.getId(r).toString())>-1);this.trait.splice(e,t,o)}}function py(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function X1(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:X1(n.parentElement)}class ZOe{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Wt,this.multipleSelectionDisposables=new Wt,this.onKeyDown.filter(s=>s.keyCode===3).on(this.onEnter,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===16).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===18).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===11).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===12).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===9).on(this.onEscape,this,this.disposables),i.multipleSelectionSupport!==!1&&this.onKeyDown.filter(s=>(ki?s.metaKey:s.ctrlKey)&&s.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return Ln.chain(this.disposables.add(new Zs(this.view.domNode,"keydown")).event).filter(e=>!py(e.target)).map(e=>new Po(e))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter(t=>(ki?t.metaKey:t.ctrlKey)&&t.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Za(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Xw([Vr],ZOe.prototype,"onKeyDown",null);var Y1;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(Y1||(Y1={}));const eRe=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=93&&n.keyCode<=102||n.keyCode>=80&&n.keyCode<=90}};class ORt{constructor(e,t,i,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=s,this.enabled=!1,this.state=Y1.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Wt,this.disposables=new Wt,this.updateOptions(e.options)}updateOptions(e){(typeof e.enableKeyboardNavigation>"u"?!0:!!e.enableKeyboardNavigation)?this.enable():this.disable(),typeof e.automaticKeyboardNavigation<"u"&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=Ln.chain(this.enabledDisposables.add(new Zs(this.view.domNode,"keydown")).event).filter(s=>!py(s.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(s=>new Po(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>{s.stopPropagation(),s.preventDefault()}).map(s=>s.browserEvent.key).event,t=Ln.debounce(e,()=>null,800);Ln.reduce(Ln.any(e,t),(s,o)=>o===null?null:(s||"")+o)(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Hl(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Y1.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===Y1.Idle?1:0;this.state=Y1.Typing;for(let o=0;o<this.list.length;o++){const r=(i+o+s)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(r)),c=a&&a.toString();if(typeof c>"u"||M6(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class RRt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Wt,Ln.chain(this.disposables.add(new Zs(t.domNode,"keydown")).event).filter(s=>!py(s.target)).map(s=>new Po(s)).filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const o=window.getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function tRe(n){return ki?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function nRe(n){return n.browserEvent.shiftKey}function MRt(n){return n instanceof MouseEvent&&n.button===2}const zge={isSelectionSingleChangeEvent:tRe,isSelectionRangeChangeEvent:nRe};class iRe{constructor(e){this.list=e,this.disposables=new Wt,this._onPointer=new rt,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||zge),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Ds.addTarget(e.getHTMLElement()))),Ln.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||zge))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){X1(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(X1(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||py(e.browserEvent.target)||X1(e.browserEvent.target))return;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionRangeChangeEvent(e))return this.changeSelection(e);if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),MRt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(py(e.browserEvent.target)||X1(e.browserEvent.target)||this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=Za(s,o+1),a=this.list.getSelection(),c=NRt(NJ(a,[i]),i);if(c.length===0)return;const u=NJ(r,DRt(a,c));this.list.setSelection(u,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class sRe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&(e.listBackground.isOpaque()?i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`):ki||console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`)),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`
- .monaco-drag-image,
- .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
- `),e.listFocusAndSelectionForeground&&i.push(`
- .monaco-drag-image,
- .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
- `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`
- .monaco-drag-image,
- .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
- `),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(`
- .monaco-list${t}.drop-target,
- .monaco-list${t} .monaco-list-rows.drop-target,
- .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
- `),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(`
- .monaco-table:hover > .monaco-split-view2,
- .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
- border-color: ${e.tableColumnsBorder};
- }`),this.styleElement.textContent=i.join(`
- `)}}const kRt={listFocusBackground:mt.fromHex("#7FB0D0"),listActiveSelectionBackground:mt.fromHex("#0E639C"),listActiveSelectionForeground:mt.fromHex("#FFFFFF"),listActiveSelectionIconForeground:mt.fromHex("#FFFFFF"),listFocusAndSelectionBackground:mt.fromHex("#094771"),listFocusAndSelectionForeground:mt.fromHex("#FFFFFF"),listInactiveSelectionBackground:mt.fromHex("#3F3F46"),listInactiveSelectionIconForeground:mt.fromHex("#FFFFFF"),listHoverBackground:mt.fromHex("#2A2D2E"),listDropBackground:mt.fromHex("#383B3D"),treeIndentGuidesStroke:mt.fromHex("#a9a9a9"),tableColumnsBorder:mt.fromHex("#cccccc").transparent(.2)},ARt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function NRt(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s<n.length&&n[s]===e+(s-t);)i.push(n[s++]);return i}function NJ(n,e){const t=[];let i=0,s=0;for(;i<n.length||s<e.length;)if(i>=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]<e[s]?t.push(n[i++]):t.push(e[s++]);return t}function DRt(n,e){const t=[];let i=0,s=0;for(;i<n.length||s<e.length;)if(i>=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]<e[s]?t.push(n[i++]):s++;return t}const Kge=(n,e)=>n-e;class $Rt{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){let o=0;for(const r of this.renderers)r.disposeElement&&r.disposeElement(e,t,i[o],s),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class xRt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e);s?i.setAttribute("aria-label",s):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class PRt{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,s){return this.dnd.onDragOver(e,t,i,s)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,s)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,s){this.dnd.drop(e,t,i,s)}}class g_{constructor(e,t,i,s,o=ARt){var r;this.user=e,this._options=o,this.focus=new t5("focused"),this.anchor=new t5("anchor"),this.eventBufferer=new bne,this._ariaLabel="",this.disposables=new Wt,this._onDidDispose=new rt,this.onDidDispose=this._onDidDispose.event;const a=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new LRt(a!=="listbox"),mp(o,kRt,!1);const c=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(c.push(new xRt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(d=>new $Rt(d.templateId,[...c,d]));const u=Object.assign(Object.assign({},o),{dnd:o.dnd&&new PRt(this,o.dnd)});if(this.view=new _p(t,i,s,u),this.view.domNode.setAttribute("role",a),o.styleController)this.styleController=o.styleController(this.view.domId);else{const d=kd(this.view.domNode);this.styleController=new sRe(d,this.view.domId)}if(this.spliceable=new _Rt([new $7(this.focus,this.view,o.identityProvider),new $7(this.selection,this.view,o.identityProvider),new $7(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new RRt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new ZOe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const d=o.keyboardNavigationDelegate||eRe;this.typeLabelController=new ORt(this,this.view,o.keyboardNavigationLabelProvider,d),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return Ln.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return Ln.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Ln.chain(this.disposables.add(new Zs(this.view.domNode,"keydown")).event).map(o=>new Po(o)).filter(o=>e=o.keyCode===58||o.shiftKey&&o.keyCode===68).map(Cge).filter(()=>!1).event,i=Ln.chain(this.disposables.add(new Zs(this.view.domNode,"keyup")).event).forEach(()=>e=!1).map(o=>new Po(o)).filter(o=>o.keyCode===58||o.shiftKey&&o.keyCode===68).map(Cge).map(({browserEvent:o})=>{const r=this.getFocus(),a=r.length?r[0]:void 0,c=typeof a<"u"?this.view.element(a):void 0,u=typeof a<"u"?this.view.domElement(a):this.view.domNode;return{index:a,element:c,anchor:u,browserEvent:o}}).event,s=Ln.chain(this.view.onContextMenu).filter(o=>!e).map(({element:o,index:r,browserEvent:a})=>({element:o,index:r,anchor:{x:a.pageX+1,y:a.pageY},browserEvent:a})).event;return Ln.any(t,i,s)}get onKeyDown(){return this.disposables.add(new Zs(this.view.domNode,"keydown")).event}get onDidFocus(){return Ln.signal(this.disposables.add(new Zs(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new iRe(this)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(t=this.keyboardController)===null||t===void 0||t.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new gS(this.user,`Invalid start index: ${e}`);if(t<0)throw new gS(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new gS(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new gS(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return xq(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new gS(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}focusNextPage(e,t){return Gge(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.view.element(i),o=this.getFocusedElements()[0];if(o!==s){const r=this.findPreviousIndex(i,!1,t);r>-1&&o!==this.view.element(r)?this.setFocus([r],e):this.setFocus([i],e)}else{const r=this.view.getScrollTop();this.view.setScrollTop(r+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==r&&(this.setFocus([]),yield sy(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return Gge(this,void 0,void 0,function*(){let i;const s=this.view.getScrollTop();s===0?i=this.view.indexAt(s):i=this.view.indexAfter(s-1);const o=this.view.element(i),r=this.getFocusedElements()[0];if(r!==o){const a=this.findNextIndex(i,!1,t);a>-1&&r!==this.view.element(a)?this.setFocus([a],e):this.setFocus([i],e)}else{const a=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==a&&(this.setFocus([]),yield sy(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s<this.length;s++){if(e>=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;s<this.length;s++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new gS(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(X0(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*mf(t,0,1)+s)}else{const r=s+o,a=i+this.view.renderHeight;s<i&&r>=a||(s<i||r>=a&&o>=this.view.renderHeight?this.view.setScrollTop(s):r>=a&&this.view.setScrollTop(r-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new gS(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),i=this.view.elementTop(e),s=this.view.elementHeight(e);if(i<t||i+s>t+this.view.renderHeight)return null;const o=s-this.view.renderHeight;return Math.abs((t-i)/o)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Xw([Vr],g_.prototype,"onDidChangeFocus",null);Xw([Vr],g_.prototype,"onDidChangeSelection",null);Xw([Vr],g_.prototype,"onContextMenu",null);Xw([Vr],g_.prototype,"onKeyDown",null);Xw([Vr],g_.prototype,"onDidFocus",null);class FRt{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:wt.None}}renderElement(e,t,i,s){if(i.disposable&&i.disposable.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,s);const r=new dc,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class BRt{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function HRt(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new BRt(n,e.accessibilityProvider)})}class VRt{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(c=>new FRt(c,r));this.list=new g_(e,t,i,a,HRt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Ln.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return Ln.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return Ln.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Za(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const URt={separatorBorder:mt.transparent};class oRe{constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){e!==this.visible&&(e?(this.size=mf(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class WRt extends oRe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class GRt extends oRe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Cv;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(Cv||(Cv={}));var n5;(function(n){n.Distribute={type:"distribute"};function e(i){return{type:"split",index:i}}n.Split=e;function t(i){return{type:"invisible",cachedVisibleSize:i}}n.Invisible=t})(n5||(n5={}));class rRe extends wt{constructor(e,t={}){var i,s;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Cv.Idle,this._onDidSashChange=this._register(new rt),this.onDidSashChange=this._onDidSashChange.event,this._onDidSashReset=this._register(new rt),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.orientation=oc(t.orientation)?0:t.orientation,this.inverseAltBehavior=!!t.inverseAltBehavior,this.proportionalLayout=oc(t.proportionalLayout)?!0:!!t.proportionalLayout,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Nt(this.el,Vt(".sash-container")),this.viewContainer=Vt(".split-view-container"),this.scrollable=new L6(125,qm),this.scrollableElement=this._register(new Uie(this.viewContainer,{vertical:this.orientation===0?(i=t.scrollbarVisibility)!==null&&i!==void 0?i:1:2,horizontal:this.orientation===1?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2},this.scrollable)),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(o=>{this.viewContainer.scrollTop=o.scrollTop,this.viewContainer.scrollLeft=o.scrollLeft})),Nt(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||URt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((o,r)=>{const a=oc(o.visible)||o.visible?o.size:{type:"invisible",cachedVisibleSize:o.size},c=o.view;this.doAddView(c,a,r,!0)}),this.contentSize=this.viewItems.reduce((o,r)=>o+r.size,0),this.saveProportions())}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions)for(let s=0;s<this.viewItems.length;s++){const o=this.viewItems[s];o.size=mf(Math.round(this.proportions[s]*e),o.minimumSize,o.maximumSize)}else{const s=Za(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=AC(Pt(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),Pt(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,c)=>{const u=this.viewItems.map(_=>_.size);let d=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(c=!c),c)if(s===this.sashItems.length-1){const v=this.viewItems[s];d=(v.minimumSize-v.size)/2,f=(v.maximumSize-v.size)/2}else{const v=this.viewItems[s+1];d=(v.size-v.maximumSize)/2,f=(v.size-v.minimumSize)/2}let g,p;if(!c){const _=Za(s,-1),v=Za(s+1,this.viewItems.length),C=_.reduce((D,P)=>D+(this.viewItems[P].minimumSize-u[P]),0),y=_.reduce((D,P)=>D+(this.viewItems[P].viewMaximumSize-u[P]),0),w=v.length===0?Number.POSITIVE_INFINITY:v.reduce((D,P)=>D+(u[P]-this.viewItems[P].minimumSize),0),I=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((D,P)=>D+(u[P]-this.viewItems[P].viewMaximumSize),0),L=Math.max(C,I),O=Math.min(w,y),A=this.findFirstSnapIndex(_),N=this.findFirstSnapIndex(v);if(typeof A=="number"){const D=this.viewItems[A],P=Math.floor(D.viewMinimumSize/2);g={index:A,limitDelta:D.visible?L-P:L+P,size:D.size}}if(typeof N=="number"){const D=this.viewItems[N],P=Math.floor(D.viewMinimumSize/2);p={index:N,limitDelta:D.visible?O+P:O-P,size:D.size}}}this.sashDragState={start:a,current:a,index:s,sizes:u,minDelta:d,maxDelta:f,alt:c,snapBefore:g,snapAfter:p,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:c,snapAfter:u}=this.sashDragState;this.sashDragState.current=e;const d=e-i,f=this.resize(t,d,s,void 0,void 0,r,a,c,u);if(o){const g=t===this.sashItems.length-1,p=this.viewItems.map(I=>I.size),_=g?t:t+1,v=this.viewItems[_],C=v.size-v.maximumSize,y=v.size-v.minimumSize,w=g?t-1:t+1;this.resize(w,-f,p,void 0,void 0,C,y)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=mf(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==Cv.Idle)throw new Error("Cant modify splitview");if(this.state=Cv.Busy,e<0||e>=this.viewItems.length)return;const i=Za(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=mf(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=Cv.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=mf(i,a.minimumSize,a.maximumSize);const s=Za(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==Cv.Idle)throw new Error("Cant modify splitview");this.state=Cv.Busy;const o=Vt(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(g=>this.onViewChange(d,g)),a=xi(()=>this.viewContainer.removeChild(o)),c=AC(r,a);let u;typeof t=="number"?u=t:t.type==="split"?u=this.getViewSize(t.index)/2:t.type==="invisible"?u={cachedVisibleSize:t.cachedVisibleSize}:u=e.minimumSize;const d=this.orientation===0?new WRt(o,e,u,c):new GRt(o,e,u,c);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){let g={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const p=this.orientation===0?new ca(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},g),{orientation:1})):new ca(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},g),{orientation:0})),_=this.orientation===0?D=>({sash:p,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:p,start:D.startX,current:D.currentX,alt:D.altKey}),C=Ln.map(p.onDidStart,_)(this.onSashStart,this),w=Ln.map(p.onDidChange,_)(this.onSashChange,this),L=Ln.map(p.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===p))(this.onSashEnd,this),O=p.onDidReset(()=>{const D=this.sashItems.findIndex(Q=>Q.sash===p),P=Za(D,-1),F=Za(D+1,this.viewItems.length),V=this.findFirstSnapIndex(P),U=this.findFirstSnapIndex(F);typeof V=="number"&&!this.viewItems[V].visible||typeof U=="number"&&!this.viewItems[U].visible||this._onDidSashReset.fire(D)}),A=AC(C,w,L,O,p),N={sash:p,disposable:A};this.sashItems.splice(i-1,0,N)}o.appendChild(e.element);let f;typeof t!="number"&&t.type==="split"&&(f=[t.index]),s||this.relayout([i],f),this.state=Cv.Idle,!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,u){if(e<0||e>=this.viewItems.length)return 0;const d=Za(e,-1),f=Za(e+1,this.viewItems.length);if(o)for(const N of o)W9(d,N),W9(f,N);if(s)for(const N of s)zH(d,N),zH(f,N);const g=d.map(N=>this.viewItems[N]),p=d.map(N=>i[N]),_=f.map(N=>this.viewItems[N]),v=f.map(N=>i[N]),C=d.reduce((N,D)=>N+(this.viewItems[D].minimumSize-i[D]),0),y=d.reduce((N,D)=>N+(this.viewItems[D].maximumSize-i[D]),0),w=f.length===0?Number.POSITIVE_INFINITY:f.reduce((N,D)=>N+(i[D]-this.viewItems[D].minimumSize),0),I=f.length===0?Number.NEGATIVE_INFINITY:f.reduce((N,D)=>N+(i[D]-this.viewItems[D].maximumSize),0),L=Math.max(C,I,r),O=Math.min(w,y,a);let A=!1;if(c){const N=this.viewItems[c.index],D=t>=c.limitDelta;A=D!==N.visible,N.setVisible(D,c.size)}if(!A&&u){const N=this.viewItems[u.index],D=t<u.limitDelta;A=D!==N.visible,N.setVisible(D,u.size)}if(A)return this.resize(e,t,i,s,o,r,a);t=mf(t,L,O);for(let N=0,D=t;N<g.length;N++){const P=g[N],F=mf(p[N]+D,P.minimumSize,P.maximumSize),V=F-p[N];D-=V,P.size=F}for(let N=0,D=t;N<_.length;N++){const P=_[N],F=mf(v[N]-D,P.minimumSize,P.maximumSize),V=F-v[N];D+=V,P.size=F}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,c)=>a+c.size,0);let i=this.size-t;const s=Za(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)W9(s,a);for(const a of o)zH(s,a);typeof e=="number"&&zH(s,e);for(let a=0;i!==0&&a<s.length;a++){const c=this.viewItems[s[a]],u=mf(c.size+i,c.minimumSize,c.maximumSize),d=u-c.size;i-=d,c.size=u}}layoutViews(){this.contentSize=this.viewItems.reduce((t,i)=>t+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(c=>e=c.size-c.minimumSize>0||e);e=!1;const i=this.viewItems.map(c=>e=c.maximumSize-c.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=s.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c<this.sashItems.length;c++){const{sash:u}=this.sashItems[c],d=this.viewItems[c];a+=d.size;const f=!(t[c]&&r[c+1]),g=!(i[c]&&o[c+1]);if(f&&g){const p=Za(c,-1),_=Za(c+1,this.viewItems.length),v=this.findFirstSnapIndex(p),C=this.findFirstSnapIndex(_),y=typeof v=="number"&&!this.viewItems[v].visible,w=typeof C=="number"&&!this.viewItems[C].visible;y&&o[c]&&(a>0||this.startSnappingEnabled)?u.state=1:w&&t[c]&&(a<this.contentSize||this.endSnappingEnabled)?u.state=2:u.state=0}else f&&!g?u.state=1:!f&&g?u.state=2:u.state=3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const i=this.viewItems[t];if(i.visible&&i.snap)return t}for(const t of e){const i=this.viewItems[t];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return t}}dispose(){super.dispose(),this.viewItems.forEach(e=>e.dispose()),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[]}}class $F{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=$F.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=Nt(e,Vt(".monaco-table-tr")),i=[],s=[];for(let r=0;r<this.columns.length;r++){const a=this.renderers[r],c=Nt(t,Vt(".monaco-table-td",{"data-col-index":r}));c.style.width=`${this.getColumnSize(r)}px`,i.push(c),s.push(a.renderTemplate(c))}const o={container:e,cellContainers:i,cellTemplateData:s};return this.renderedTemplates.add(o),o}renderElement(e,t,i,s){for(let o=0;o<this.columns.length;o++){const a=this.columns[o].project(e);this.renderers[o].renderElement(a,t,i.cellTemplateData[o],s)}}disposeElement(e,t,i,s){for(let o=0;o<this.columns.length;o++){const r=this.renderers[o];if(r.disposeElement){const c=this.columns[o].project(e);r.disposeElement(c,t,i.cellTemplateData[o],s)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);wl(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}$F.TemplateId="row";function zRt(n){return{getHeight(e){return n.getHeight(e)},getTemplateId(){return $F.TemplateId}}}class KRt{constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new rt,this.onDidLayout=this._onDidLayout.event,this.element=Vt(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}get minimumSize(){var e;return(e=this.column.minimumWidth)!==null&&e!==void 0?e:120}get maximumSize(){var e;return(e=this.column.maximumWidth)!==null&&e!==void 0?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return(e=this.column.onDidChangeWidthConstraints)!==null&&e!==void 0?e:Ln.None}layout(e){this._onDidLayout.fire([this.index,e])}}class $6{constructor(e,t,i,s,o,r){this.virtualDelegate=i,this.domId=`table_id_${++$6.InstanceCount}`,this.cachedHeight=0,this.domNode=Nt(t,Vt(`.monaco-table.${this.domId}`));const a=s.map((d,f)=>new KRt(d,f)),c={size:a.reduce((d,f)=>d+f.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=new rRe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c}),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const u=new $F(s,o,d=>this.splitview.getViewSize(d));this.list=new g_(e,this.domNode,zRt(i),[u],r),this.columnLayoutDisposable=Ln.any(...a.map(d=>d.onDidLayout))(([d,f])=>u.layoutColumn(d,f)),this.styleElement=kd(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
- top: ${this.virtualDelegate.headerRowHeight+1}px;
- height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
- }`),this.styleElement.textContent=t.join(`
- `),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.splitview.dispose(),this.list.dispose(),this.columnLayoutDisposable.dispose()}}$6.InstanceCount=0;var g$;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element"})(g$||(g$={}));class ah extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class fse{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function gse(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function sP(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function x7(n){return typeof n.collapsible=="boolean"}class jRt{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new bne,this._onDidChangeCollapseState=new rt,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new rt,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new rt,this.onDidSplice=this._onDidSplice.event,this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=zi.empty(),s={}){if(e.length===0)throw new ah(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s,o,r){var a;s===void 0&&(s=zi.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:c}=this.getParentNodeWithListIndex(t);if(!c.lastDiffIds)return this.spliceSimple(t,i,s,o);const u=[...s],d=t[t.length-1],f=new Cm({getElements:()=>c.lastDiffIds},{getElements:()=>[...c.children.slice(0,d),...u,...c.children.slice(d+i)].map(C=>e.getId(C.element).toString())}).ComputeDiff(!1);if(f.quitEarly)return c.lastDiffIds=void 0,this.spliceSimple(t,i,u,o);const g=t.slice(0,-1),p=(C,y,w)=>{if(r>0)for(let I=0;I<w;I++)C--,y--,this.spliceSmart(e,[...g,C,0],Number.MAX_SAFE_INTEGER,u[y].children,o,r-1)};let _=Math.min(c.children.length,d+i),v=u.length;for(const C of f.changes.sort((y,w)=>w.originalStart-y.originalStart))p(_,v,_-(C.originalStart+C.originalLength)),_=C.originalStart,v=C.modifiedStart-d,this.spliceSimple([...g,_],C.originalLength,zi.slice(u,v,v+C.modifiedLength),o);p(_,v,_)}spliceSimple(e,t,i=zi.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:u,visible:d}=this.getParentNodeWithListIndex(e),f=[],g=zi.map(i,N=>this.createTreeNode(N,a,a.visible?1:0,u,f,s)),p=e[e.length-1],_=a.children.length>0;let v=0;for(let N=p;N>=0&&N<a.children.length;N--){const D=a.children[N];if(D.visible){v=D.visibleChildIndex;break}}const C=[];let y=0,w=0;for(const N of g)C.push(N),w+=N.renderNodeCount,N.visible&&(N.visibleChildIndex=v+y++);const I=nfe(a.children,p,t,C);r?a.lastDiffIds?nfe(a.lastDiffIds,p,t,C.map(N=>r.getId(N.element).toString())):a.lastDiffIds=a.children.map(N=>r.getId(N.element).toString()):a.lastDiffIds=void 0;let L=0;for(const N of I)N.visible&&L++;if(L!==0)for(let N=p+C.length;N<a.children.length;N++){const D=a.children[N];D.visible&&(D.visibleChildIndex-=L)}if(a.visibleChildrenCount+=y-L,u&&d){const N=I.reduce((D,P)=>D+(P.visible?P.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,w-N),this.list.splice(c,N,f)}if(I.length>0&&o){const N=D=>{o(D),D.children.forEach(N)};I.forEach(N)}const O=a.children.length>0;_!==O&&this.setCollapsible(e.slice(0,-1),O),this._onDidSplice.fire({insertedNodes:C,deletedNodes:I});let A=a;for(;A;){if(A.visibility===2){this.refilter();break}A=A.parent}}rerender(e){if(e.length===0)throw new ah(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!x7(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let c=0;c<i.children.length;c++)if(i.children[c].visible)if(a>-1){a=-1;break}else a=c;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=r-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(x7(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!x7(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t)}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,s&&o.push(a);const u=e.children||zi.empty(),d=s&&c!==0&&!a.collapsed,f=zi.map(u,_=>this.createTreeNode(_,a,c,d,o,r));let g=0,p=1;for(const _ of f)a.children.push(_),p+=_.renderNodeCount,_.visible&&(_.visibleChildIndex=g++);return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=g,a.visible=c===2?g>0:c===1,a.visible?a.collapsed||(a.renderNodeCount=p):(a.renderNodeCount=0,s&&o.pop()),r&&r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let c=0;for(const u of e.children)a=this._updateNodeAfterFilterChange(u,o,i,s&&!e.collapsed)||a,u.visible&&(u.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):gse(i)?(e.filterData=i.data,sP(i.visibility)):(e.filterData=void 0,sP(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new ah(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new ah(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new ah(this.user,"Invalid tree location");for(let c=0;c<r;c++)i+=t.children[c].renderNodeCount;return s=s&&!t.collapsed,o=o&&t.visible,a.length===0?{parentNode:t,listIndex:i,revealed:s,visible:o}:this.getParentNodeWithListIndex(a,t.children[r],i+1,s,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){if(e.length!==0)return e.length===1?[]:yCt(e)[0]}}const jge=Zf("tree-item-expanded",vn.chevronDown),Xge=Zf("tree-filter-on-type-on",vn.listFilter),Yge=Zf("tree-filter-on-type-off",vn.listSelection),XRt=Zf("tree-filter-clear",vn.close),i5=Zf("tree-item-loading",vn.loading);class YRt extends DF{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function P7(n){return n instanceof DF?new YRt(n):n}class qRt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=wt.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(P7(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver(P7(e),t&&t.element,i,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return r;if(a&&typeof r!="boolean"&&r.autoExpand&&(this.autoExpandDisposable=j0(()=>{const g=this.modelProvider(),p=g.getNodeLocation(t);g.isCollapsed(p)&&g.setCollapsed(p,!1),this.autoExpandNode=void 0},500)),typeof r=="boolean"||!r.accept||typeof r.bubble>"u"||r.feedback){if(!o){const g=typeof r=="boolean"?r:r.accept,p=typeof r=="boolean"?void 0:r.effect;return{accept:g,effect:p,feedback:[i]}}return r}if(r.bubble===1){const g=this.modelProvider(),p=g.getNodeLocation(t),_=g.getParentNodeLocation(p),v=g.getNode(_),C=_&&g.getListIndex(_);return this.onDragOver(e,v,C,s,!1)}const c=this.modelProvider(),u=c.getNodeLocation(t),d=c.getListIndex(u),f=c.getListRenderCount(u);return Object.assign(Object.assign({},r),{feedback:Za(d,d+f)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(P7(e),t&&t.element,i,s)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function JRt(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new qRt(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}),enableKeyboardNavigation:e.simpleKeyboardNavigation})}class pse{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}var oP;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(oP||(oP={}));class QRt{constructor(e,t=[]){this._elements=t,this.onDidChange=Ln.forEach(e,i=>this._elements=i)}get elements(){return this._elements}}class rP{constructor(e,t,i,s,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=rP.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new cyt,this.activeIndentNodes=new Set,this.indentGuidesDisposable=wt.None,this.disposables=new Wt,this.templateId=e.templateId,this.updateOptions(o),Ln.map(i,r=>r.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"&&(this.indent=mf(e.indent,0,40)),typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==oP.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const i=new Wt;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Nt(e,Vt(".monaco-tl-row")),i=Nt(t,Vt(".monaco-tl-indent")),s=Nt(t,Vt(".monaco-tl-twistie")),o=Nt(t,Vt(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:wt.None,templateData:r}}renderElement(e,t,i,s){typeof s=="number"&&(this.renderedNodes.set(e,{templateData:i,height:s}),this.renderedElements.set(e.element,e));const o=rP.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${o}px`,i.indent.style.width=`${o+this.indent-16}px`,this.renderTwistie(e,i),typeof s=="number"&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...jge.classNamesArray);let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...jge.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(wl(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Wt,s=this.modelProvider();let o=e;for(;;){const r=s.getNodeLocation(o),a=s.getParentNodeLocation(r);if(!a)break;const c=s.getNode(a),u=Vt(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(c)&&u.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(u):t.indent.insertBefore(u,t.indent.firstElementChild),this.renderedIndentGuides.add(c,u),i.add(xi(()=>this.renderedIndentGuides.delete(c,u))),o=c}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Ji(this.disposables)}}rP.DefaultIndent=8;class ZRt{constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Wt,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const o=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return o;let r;if(typeof o=="boolean"?r=o?1:0:gse(o)?r=sP(o.visibility):r=o,r===0)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:jg.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(i)?i:[i];for(const o of s){const r=o&&o.toString();if(typeof r>"u")return{data:jg.Default,visibility:!0};const a=OR(this._pattern,this._lowercasePattern,0,r,r.toLowerCase(),0,!0);if(a)return this._matchCount++,s.length===1?{data:a,visibility:!0}:{data:{label:r,score:a},visibility:!0}}return this.tree.options.filterOnType?2:{data:jg.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Ji(this.disposables)}}class eMt{constructor(e,t,i,s,o){this.tree=e,this.view=i,this.filter=s,this.keyboardNavigationDelegate=o,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new rt,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new rt,this.enabledDisposables=new Wt,this.disposables=new Wt,this.domNode=Vt(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,this.disposables.add(Pt(this.domNode,"dragstart",()=>this.onDragStart())),this.messageDomNode=Nt(i.getHTMLElement(),Vt(".monaco-list-type-filter-message")),this.labelDomNode=Nt(this.domNode,Vt("span.label"));const r=Nt(this.domNode,Vt(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=Nt(r,Vt("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(Pt(this.filterOnTypeDomNode,"input",()=>this.onDidChangeFilterOnType())),this.clearDomNode=Nt(r,Vt("button.clear"+XRt.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=$("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),typeof e.filterOnType<"u"&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),typeof e.automaticKeyboardNavigation<"u"&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=this.enabledDisposables.add(new Zs(this.view.getHTMLElement(),"keydown")),t=Ln.chain(e.event).filter(s=>!py(s.target)||s.target===this.filterOnTypeDomNode).filter(s=>s.key!=="Dead"&&!/^Media/.test(s.key)).map(s=>new Po(s)).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter(()=>this.automaticKeyboardNavigation||this.triggered).filter(s=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(s)&&!(s.keyCode===18||s.keyCode===16||s.keyCode===15||s.keyCode===17)||(this.pattern.length>0||this.triggered)&&(s.keyCode===9||s.keyCode===1)&&!s.altKey&&!s.ctrlKey&&!s.metaKey||s.keyCode===1&&(ki?s.altKey&&!s.metaKey:s.ctrlKey)&&!s.shiftKey).forEach(s=>{s.stopPropagation(),s.preventDefault()}).event,i=this.enabledDisposables.add(new Zs(this.clearDomNode,"click"));Ln.chain(Ln.any(t,i.event)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){typeof e=="string"?this.onInput(e):e instanceof MouseEvent||e.keyCode===9||e.keyCode===1&&(ki?e.altKey:e.ctrlKey)?this.onInput(""):e.keyCode===1?this.onInput(this.pattern.length===0?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,s=>!jg.isDefault(s.filterData));const i=this.tree.getFocus();if(i.length>0){const s=i[0];this.tree.getRelativeTop(s)===null&&this.tree.reveal(s,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=Bl(e),i=e.clientWidth,s=i/2,o=this.domNode.clientWidth,r=new Wt;let a=this.positionClassName;const c=()=>{switch(a){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=`${i-o-6}px`;break}},u=f=>{f.preventDefault();const g=f.clientX-t;f.dataTransfer&&(f.dataTransfer.dropEffect="none"),g<s?a="nw":a="ne",c()},d=()=>{this.positionClassName=a,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",Ji(r)};c(),this.domNode.classList.remove(a),this.domNode.classList.add("dragging"),r.add(xi(()=>this.domNode.classList.remove("dragging"))),r.add(Pt(document,"dragover",f=>u(f))),r.add(Pt(this.domNode,"dragend",()=>d())),Tv.CurrentDragAndDropData=new v1t("vscode-ui"),r.add(xi(()=>Tv.CurrentDragAndDropData=void 0))}onDidSpliceModel(){!this._enabled||this.pattern.length===0||(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...Yge.classNamesArray),this.filterOnTypeDomNode.classList.add(...Xge.classNamesArray),this.filterOnTypeDomNode.title=$("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...Xge.classNamesArray),this.filterOnTypeDomNode.classList.add(...Yge.classNamesArray),this.filterOnTypeDomNode.title=$("enable filter on type","Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=$("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=$("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!this.enabled||!this.pattern||this.filterOnType||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!jg.isDefault(e.filterData)}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),Ji(this.disposables)}}function qge(n){let e=g$.Unknown;return Ehe(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=g$.Twistie:Ehe(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(e=g$.Element),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function g4(n,e){e(n),n.children.forEach(t=>g4(t,e))}class F7{constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new rt,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){var i;!(!((i=t)===null||i===void 0)&&i.__forceEvent)&&xf(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const c=this.createNodeSet(),u=d=>c.delete(d);t.forEach(d=>g4(d,u)),this.set([...c.values()]);return}const i=new Set,s=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>g4(c,s));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>g4(c,r));const a=[];for(const c of this.nodes){const u=this.identityProvider.getId(c.element).toString();if(!i.has(u))a.push(c);else{const f=o.get(u);f&&a.push(f)}}if(this.nodes.length>0&&a.length===0){const c=this.getFirstViewElementWithTrait();c&&a.push(c)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class tMt extends iRe{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(py(e.browserEvent.target)||X1(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const r=this.tree.model,a=r.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),r.setCollapsed(a,void 0,c),o&&s)return}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||super.onDoubleClick(e)}}class nMt extends g_{constructor(e,t,i,s,o,r,a,c){super(e,t,i,s,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new tMt(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&s.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),s.length>0&&super.setFocus(u3([...super.getFocus(),...s])),o.length>0&&super.setSelection(u3([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class lRe{constructor(e,t,i,s,o={}){this._options=o,this.eventBufferer=new bne,this.disposables=new Wt,this._onWillRefilter=new rt,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new rt;const r=new pse(i),a=new _he,c=new _he,u=new QRt(c.event);this.renderers=s.map(g=>new rP(g,()=>this.model,a.event,u,o));for(let g of this.renderers)this.disposables.add(g);let d;o.keyboardNavigationLabelProvider&&(d=new ZRt(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:d}),this.disposables.add(d)),this.focus=new F7(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new F7(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new F7(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new nMt(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},JRt(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const f=Ln.forEach(this.model.onDidSplice,g=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(g),this.selection.onDidModelSplice(g)})});if(f(()=>null,null,this.disposables),c.input=Ln.chain(Ln.any(f,this.focus.onDidChange,this.selection.onDidChange)).debounce(()=>null,0).map(()=>{const g=new Set;for(const p of this.focus.getNodes())g.add(p);for(const p of this.selection.getNodes())g.add(p);return[...g.values()]}).event,o.keyboardSupport!==!1){const g=Ln.chain(this.view.onKeyDown).filter(p=>!py(p.target)).map(p=>new Po(p));g.filter(p=>p.keyCode===15).on(this.onLeftArrow,this,this.disposables),g.filter(p=>p.keyCode===17).on(this.onRightArrow,this,this.disposables),g.filter(p=>p.keyCode===10).on(this.onSpace,this,this.disposables)}if(o.keyboardNavigationLabelProvider){const g=o.keyboardNavigationDelegate||eRe;this.typeFilterController=new eMt(this,this.model,this.view,d,g),this.focusNavigationFilter=p=>this.typeFilterController.shouldAllowFocus(p),this.disposables.add(this.typeFilterController)}this.styleElement=kd(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===oP.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Ln.map(this.view.onMouseDblClick,qge)}get onPointer(){return Ln.map(this.view.onPointer,qge)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(Object.assign(Object.assign({},this._options),{enableKeyboardNavigation:this._options.simpleKeyboardNavigation})),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===oP.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(`
- `),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)}focusNext(e=1,t=!1,i,s=this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return t===-1?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(c=>c.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}dispose(){Ji(this.disposables),this.view.dispose()}}class mse{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new jRt(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=zi.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=zi.empty(),i){const s=new Set,o=new Set,r=c=>{var u;if(c.element===null)return;const d=c;if(s.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const f=this.identityProvider.getId(d.element).toString();o.add(f),this.nodesByIdentity.set(f,d)}(u=i.onDidCreateNode)===null||u===void 0||u.call(i,d)},a=c=>{var u;if(c.element===null)return;const d=c;if(s.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const f=this.identityProvider.getId(d.element).toString();o.has(f)||this.nodesByIdentity.delete(f)}(u=i.onDidDeleteNode)===null||u===void 0||u.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=zi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),zi.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i)return Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children)});const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,o=typeof t.collapsed<"u"?t.collapsed:i.collapsed;return Object.assign(Object.assign({},t),{collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new ah(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new ah(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new ah(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new ah(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function p4(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:zi.map(zi.from(n.children),p4),collapsible:n.collapsible,collapsed:n.collapsed}}function m4(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=zi.consume(zi.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:zi.map(zi.concat(s,i),m4),collapsible:n.collapsible,collapsed:n.collapsed}}function DJ(n,e=0){let t;return e<n.element.elements.length-1?t=[DJ(n,e+1)]:t=zi.map(zi.from(n.children),i=>DJ(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function Jge(n){return DJ(n,0)}function aRe(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:zi.map(zi.from(n.children),i=>aRe(i,e,t))})}const iMt=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class sMt{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new mse(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=zi.empty(),i){const s=i.diffIdentityProvider&&iMt(i.diffIdentityProvider);if(e===null){const p=zi.map(t,this.enabled?m4:p4);this._setChildren(null,p,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Error("Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),c=this.model.getNode(a),u=Jge(r),d=aRe(u,e,t),f=(this.enabled?m4:p4)(d),g=c.children.map(p=>p===r?f:p);this._setChildren(c.element,g,{diffIdentityProvider:s,diffDepth:r.depth-c.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=zi.map(i,Jge),o=zi.map(s,e?m4:p4);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const c of a.element.elements)s.add(c),this.nodes.set(c,a.element)},r=a=>{for(const c of a.element.elements)s.has(c)||this.nodes.delete(c)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:r}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new ah(this.user,`Tree element not found: ${e}`);return t}}const oMt=n=>n[n.length-1];class _se{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new _se(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}function rMt(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function lMt(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class aMt{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||oMt;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new fse(o=>new _se(s,o)),this.model=new sMt(e,rMt(this.nodeMapper,t),lMt(s,i))}get onDidSplice(){return Ln.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return Ln.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return Ln.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=zi.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var cMt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class vse extends lRe{constructor(e,t,i,s,o={}){super(e,t,i,s,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=zi.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new mse(e,t,i)}}class cRe{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,s):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}cMt([Vr],cRe.prototype,"compressedTreeNodeProvider",null);function uMt(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class uRe extends vse{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(c=>new cRe(r,c));super(e,t,i,a,uMt(r,o))}setChildren(e,t=zi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new aMt(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var FT=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function B7(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function $J(n,e){return e.parent?e.parent===n?!0:$J(n,e.parent):!1}function dMt(n,e){return n===e||$J(n,e)||$J(e,n)}class bse{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new bse(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class hMt{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...i5.classNamesArray),!0):(t.classList.remove(...i5.classNamesArray),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function Qge(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function Zge(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class fMt extends DF{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function H7(n){return n instanceof DF?new fMt(n):n}class gMt{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(H7(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(H7(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(H7(e),t&&t.element,i,s)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function dRe(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new gMt(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),additionalScrollHeight:n.additionalScrollHeight})}function xJ(n,e){e(n),n.children.forEach(t=>xJ(t,e))}class hRe{constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new rt,this._onDidChangeNodeSlowState=new rt,this.nodeMapper=new fse(a=>new bse(a)),this.disposables=new Wt,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,s,r),this.root=B7({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return Ln.map(this.tree.onDidChangeFocus,Qge)}get onDidChangeSelection(){return Ln.map(this.tree.onDidChangeSelection,Qge)}get onMouseDblClick(){return Ln.map(this.tree.onMouseDblClick,Zge)}get onPointer(){return Ln.map(this.tree.onPointer,Zge)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,s,o){const r=new pse(i),a=s.map(u=>new hMt(u,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=dRe(o)||{};return new vse(e,t,r,a,c)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return FT(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,s,o){return FT(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new ah(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield Ln.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return FT(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new ah(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield Ln.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield Ln.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield Ln.toPromise(this._onDidRender.event)),s})}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new ah(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,s){return FT(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return FT(this,void 0,void 0,function*(){let s;return this.subTreeRefreshPromises.forEach((o,r)=>{!s&&dMt(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s||this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return FT(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield pq.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return FT(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(zi.empty());else{const o=sy(800);o.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},r=>null),s=this.doGetChildren(e).finally(()=>o.cancel())}try{const o=yield s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),d_(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=ul(()=>FT(this,void 0,void 0,function*(){const i=yield this.dataSource.getChildren(e.element);return this.processChildren(i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(di))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)if(r.set(d.element,d),this.identityProvider){const f=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:f})}const c=[],u=o.map(d=>{const f=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const v=B7({element:d,parent:e,hasChildren:f});return f&&this.collapseByDefault&&!this.collapseByDefault(d)&&(v.collapsedByDefault=!1,c.push(v)),v}const g=this.identityProvider.getId(d).toString(),p=a.get(g);if(p){const v=p.node;return r.delete(v.element),this.nodes.delete(v.element),this.nodes.set(d,v),v.element=d,v.hasChildren=f,i?p.collapsed?(v.children.forEach(C=>xJ(C,y=>this.nodes.delete(y.element))),v.children.splice(0,v.children.length),v.stale=!0):c.push(v):f&&this.collapseByDefault&&!this.collapseByDefault(d)&&(v.collapsedByDefault=!1,c.push(v)),v}const _=B7({element:d,parent:e,id:g,hasChildren:f});return s&&s.viewState.focus&&s.viewState.focus.indexOf(g)>-1&&s.focus.push(_),s&&s.viewState.selection&&s.viewState.selection.indexOf(g)>-1&&s.selection.push(_),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(g)>-1?c.push(_):f&&this.collapseByDefault&&!this.collapseByDefault(d)&&(_.collapsedByDefault=!1,c.push(_)),_});for(const d of r.values())xJ(d,f=>this.nodes.delete(f.element));for(const d of u)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...u),e!==this.root&&this.autoExpandSingleChildren&&u.length===1&&c.length===0&&(u[0].collapsedByDefault=!1,c.push(u[0])),c}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}});this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?zi.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class Tse{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new Tse(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class pMt{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...i5.classNamesArray),!0):(t.classList.remove(...i5.classNamesArray),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Ji(this.disposables)}}function mMt(n){const e=n&&dRe(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class _Mt extends hRe{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new fse(c=>new Tse(c)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new pse(i),a=s.map(u=>new pMt(u,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=mMt(o)||{};return new uRe(e,t,r,a,c)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=g=>this.identityProvider.getId(g).toString(),s=g=>{const p=new Set;for(const _ of g){const v=this.tree.getCompressedTreeNode(_===this.root?null:_);if(v.element)for(const C of v.element.elements)p.add(i(C.element))}return p},o=s(this.tree.getSelection()),r=s(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let c=!1;const u=this.getFocus();let d=!1;const f=g=>{const p=g.element;if(p)for(let _=0;_<p.elements.length;_++){const v=i(p.elements[_].element),C=p.elements[p.elements.length-1].element;o.has(v)&&a.indexOf(C)===-1&&(a.push(C),c=!0),r.has(v)&&u.indexOf(C)===-1&&(u.push(C),d=!0)}g.children.forEach(f)};f(this.tree.getCompressedTreeNode(e===this.root?null:e)),c&&this.setSelection(a),d&&this.setFocus(u)}processChildren(e){return this.filter&&(e=zi.filter(e,t=>{const i=this.filter.filter(t,1),s=vMt(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function vMt(n){return typeof n=="boolean"?n?1:0:gse(n)?sP(n.visibility):sP(n)}class bMt extends lRe{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new mse(e,t,i)}}const x6=new Sn("isWindows",zl,$("isWindows","Whether the operating system is Windows")),TMt="inputFocus";var p_=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Li=function(n,e){return function(t,i){e(t,i,n)}};const Mh=ss("listService");let PJ=class{constructor(e){this._themeService=e,this.disposables=new Wt,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const s=new sRe(kd(),"");this.disposables.add(rw(s,this._themeService))}if(this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),AC(e.onDidFocus(()=>this._lastFocusedWidget=e),xi(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&(this._lastFocusedWidget=void 0)}))}dispose(){this.disposables.dispose()}};PJ=p_([Li(0,fo)],PJ);const fRe=new Sn("listFocus",!0),P6=new Sn("listSupportsMultiselect",!0),gRe=dn.and(fRe,dn.not(TMt)),Cse=new Sn("listHasSelectionOrFocus",!1),yse=new Sn("listDoubleSelection",!1),Ese=new Sn("listMultiSelection",!1),F6=new Sn("listSelectionNavigation",!1),pRe="listAutomaticKeyboardNavigation";function B6(n,e){const t=n.createScoped(e.getHTMLElement());return fRe.bindTo(t),t}const Yw="workbench.list.multiSelectModifier",FJ="workbench.list.openMode",yh="workbench.list.horizontalScrolling",s5="workbench.list.keyboardNavigation",Sse="workbench.list.automaticKeyboardNavigation",lP="workbench.tree.indent",o5="workbench.tree.renderIndentGuides",op="workbench.list.smoothScrolling",t_="workbench.list.mouseWheelScrollSensitivity",n_="workbench.list.fastScrollSensitivity",r5="workbench.tree.expandMode";function i_(n){return n.getValue(Yw)==="alt"}class CMt extends wt{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=i_(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Yw)&&(this.useAltAsMultipleSelectionModifier=i_(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:tRe(e)}isSelectionRangeChangeEvent(e){return nRe(e)}}function H6(n,e,t){var i;const s=new Wt;return[Object.assign(Object.assign({},n),{keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return t.mightProducePrintableCharacter(r)}},smoothScrolling:!!e.getValue(op),mouseWheelScrollSensitivity:e.getValue(t_),fastScrollSensitivity:e.getValue(n_),multipleSelectionController:(i=n.multipleSelectionController)!==null&&i!==void 0?i:s.add(new CMt(e))}),s]}let BJ=class extends g_{constructor(e,t,i,s,o,r,a,c,u,d){const f=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!u.getValue(yh),[g,p]=H6(o,u,d);super(e,t,i,s,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Lg(c.getColorTheme(),N6)),g),{horizontalScrolling:f})),this.disposables.add(p),this.contextKeyService=B6(r,this),this.themeService=c,this.listSupportsMultiSelect=P6.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),F6.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=Cse.bindTo(this.contextKeyService),this.listDoubleSelection=yse.bindTo(this.contextKeyService),this.listMultiSelection=Ese.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=i_(u),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const v=this.getSelection(),C=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(v.length>0||C.length>0),this.listMultiSelection.set(v.length>1),this.listDoubleSelection.set(v.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const v=this.getSelection(),C=this.getFocus();this.listHasSelectionOrFocus.set(v.length>0||C.length>0)})),this.disposables.add(u.onDidChangeConfiguration(v=>{v.affectsConfiguration(Yw)&&(this._useAltAsMultipleSelectionModifier=i_(u));let C={};if(v.affectsConfiguration(yh)&&this.horizontalScrolling===void 0){const y=!!u.getValue(yh);C=Object.assign(Object.assign({},C),{horizontalScrolling:y})}if(v.affectsConfiguration(op)){const y=!!u.getValue(op);C=Object.assign(Object.assign({},C),{smoothScrolling:y})}if(v.affectsConfiguration(t_)){const y=u.getValue(t_);C=Object.assign(Object.assign({},C),{mouseWheelScrollSensitivity:y})}if(v.affectsConfiguration(n_)){const y=u.getValue(n_);C=Object.assign(Object.assign({},C),{fastScrollSensitivity:y})}Object.keys(C).length>0&&this.updateOptions(C)})),this.navigator=new mRe(this,Object.assign({configurationService:u},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=rw(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),super.dispose()}};BJ=p_([Li(5,ai),Li(6,Mh),Li(7,fo),Li(8,Yo),Li(9,Ro)],BJ);let epe=class extends VRt{constructor(e,t,i,s,o,r,a,c,u,d){const f=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!u.getValue(yh),[g,p]=H6(o,u,d);super(e,t,i,s,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Lg(c.getColorTheme(),N6)),g),{horizontalScrolling:f})),this.disposables=new Wt,this.disposables.add(p),this.contextKeyService=B6(r,this),this.themeService=c,this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=P6.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),F6.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=i_(u),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),o.overrideStyles&&this.disposables.add(rw(this,c,o.overrideStyles)),this.disposables.add(u.onDidChangeConfiguration(v=>{v.affectsConfiguration(Yw)&&(this._useAltAsMultipleSelectionModifier=i_(u));let C={};if(v.affectsConfiguration(yh)&&this.horizontalScrolling===void 0){const y=!!u.getValue(yh);C=Object.assign(Object.assign({},C),{horizontalScrolling:y})}if(v.affectsConfiguration(op)){const y=!!u.getValue(op);C=Object.assign(Object.assign({},C),{smoothScrolling:y})}if(v.affectsConfiguration(t_)){const y=u.getValue(t_);C=Object.assign(Object.assign({},C),{mouseWheelScrollSensitivity:y})}if(v.affectsConfiguration(n_)){const y=u.getValue(n_);C=Object.assign(Object.assign({},C),{fastScrollSensitivity:y})}Object.keys(C).length>0&&this.updateOptions(C)})),this.navigator=new mRe(this,Object.assign({configurationService:u},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=rw(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};epe=p_([Li(5,ai),Li(6,Mh),Li(7,fo),Li(8,Yo),Li(9,Ro)],epe);let tpe=class extends $6{constructor(e,t,i,s,o,r,a,c,u,d,f){const g=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!d.getValue(yh),[p,_]=H6(r,d,f);super(e,t,i,s,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Lg(u.getColorTheme(),N6)),p),{horizontalScrolling:g})),this.disposables=new Wt,this.disposables.add(_),this.contextKeyService=B6(a,this),this.themeService=u,this.listSupportsMultiSelect=P6.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),F6.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=Cse.bindTo(this.contextKeyService),this.listDoubleSelection=yse.bindTo(this.contextKeyService),this.listMultiSelection=Ese.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=i_(d),this.disposables.add(this.contextKeyService),this.disposables.add(c.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const C=this.getSelection(),y=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(C.length>0||y.length>0),this.listMultiSelection.set(C.length>1),this.listDoubleSelection.set(C.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const C=this.getSelection(),y=this.getFocus();this.listHasSelectionOrFocus.set(C.length>0||y.length>0)})),this.disposables.add(d.onDidChangeConfiguration(C=>{C.affectsConfiguration(Yw)&&(this._useAltAsMultipleSelectionModifier=i_(d));let y={};if(C.affectsConfiguration(yh)&&this.horizontalScrolling===void 0){const w=!!d.getValue(yh);y=Object.assign(Object.assign({},y),{horizontalScrolling:w})}if(C.affectsConfiguration(op)){const w=!!d.getValue(op);y=Object.assign(Object.assign({},y),{smoothScrolling:w})}if(C.affectsConfiguration(t_)){const w=d.getValue(t_);y=Object.assign(Object.assign({},y),{mouseWheelScrollSensitivity:w})}if(C.affectsConfiguration(n_)){const w=d.getValue(n_);y=Object.assign(Object.assign({},y),{fastScrollSensitivity:w})}Object.keys(y).length>0&&this.updateOptions(y)})),this.navigator=new yMt(this,Object.assign({configurationService:d},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=rw(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};tpe=p_([Li(6,ai),Li(7,Mh),Li(8,fo),Li(9,Yo),Li(10,Ro)],tpe);class wse extends wt{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new rt),this.onDidOpen=this._onDidOpen.event,this._register(Ln.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(FJ))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(FJ))!=="doubleClick"}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class mRe extends wse{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class yMt extends wse{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class EMt extends wse{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function SMt(n,e){let t=!1;return i=>{if(t)return t=!1,!1;const s=e.softDispatch(i,n);return s&&s.enterChord?(t=!0,!1):(t=!1,!0)}}let npe=class extends vse{constructor(e,t,i,s,o,r,a,c,u,d,f){const{options:g,getAutomaticKeyboardNavigation:p,disposable:_}=xF(t,o,r,u,d,f);super(e,t,i,s,g),this.disposables.add(_),this.internals=new lw(this,o,p,o.overrideStyles,r,a,c,u,f),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};npe=p_([Li(5,ai),Li(6,Mh),Li(7,fo),Li(8,Yo),Li(9,Ro),Li(10,Vu)],npe);let ipe=class extends uRe{constructor(e,t,i,s,o,r,a,c,u,d,f){const{options:g,getAutomaticKeyboardNavigation:p,disposable:_}=xF(t,o,r,u,d,f);super(e,t,i,s,g),this.disposables.add(_),this.internals=new lw(this,o,p,o.overrideStyles,r,a,c,u,f),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};ipe=p_([Li(5,ai),Li(6,Mh),Li(7,fo),Li(8,Yo),Li(9,Ro),Li(10,Vu)],ipe);let spe=class extends bMt{constructor(e,t,i,s,o,r,a,c,u,d,f,g){const{options:p,getAutomaticKeyboardNavigation:_,disposable:v}=xF(t,r,a,d,f,g);super(e,t,i,s,o,p),this.disposables.add(v),this.internals=new lw(this,r,_,r.overrideStyles,a,c,u,d,g),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};spe=p_([Li(6,ai),Li(7,Mh),Li(8,fo),Li(9,Yo),Li(10,Ro),Li(11,Vu)],spe);let HJ=class extends hRe{constructor(e,t,i,s,o,r,a,c,u,d,f,g){const{options:p,getAutomaticKeyboardNavigation:_,disposable:v}=xF(t,r,a,d,f,g);super(e,t,i,s,o,p),this.disposables.add(v),this.internals=new lw(this,r,_,r.overrideStyles,a,c,u,d,g),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};HJ=p_([Li(6,ai),Li(7,Mh),Li(8,fo),Li(9,Yo),Li(10,Ro),Li(11,Vu)],HJ);let ope=class extends _Mt{constructor(e,t,i,s,o,r,a,c,u,d,f,g,p){const{options:_,getAutomaticKeyboardNavigation:v,disposable:C}=xF(t,a,c,f,g,p);super(e,t,i,s,o,r,_),this.disposables.add(C),this.internals=new lw(this,a,v,a.overrideStyles,c,u,d,f,p),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};ope=p_([Li(7,ai),Li(8,Mh),Li(9,fo),Li(10,Yo),Li(11,Ro),Li(12,Vu)],ope);function xF(n,e,t,i,s,o){var r;const a=()=>{let _=!!t.getContextKeyValue(pRe);return _&&(_=!!i.getValue(Sse)),_},c=o.isScreenReaderOptimized(),u=e.simpleKeyboardNavigation||c?"simple":i.getValue(s5),d=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(yh),[f,g]=H6(e,i,s),p=e.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:g,options:Object.assign(Object.assign({keyboardSupport:!1},f),{indent:typeof i.getValue(lP)=="number"?i.getValue(lP):void 0,renderIndentGuides:i.getValue(o5),smoothScrolling:!!i.getValue(op),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:u==="simple",filterOnType:u==="filter",horizontalScrolling:d,keyboardNavigationEventFilter:SMt(n,s),additionalScrollHeight:p,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(r=e.expandOnlyOnTwistieClick)!==null&&r!==void 0?r:i.getValue(r5)==="doubleClick"})}}let lw=class{constructor(e,t,i,s,o,r,a,c,u){this.tree=e,this.themeService=a,this.disposables=[],this.contextKeyService=B6(o,e),this.listSupportsMultiSelect=P6.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),F6.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.hasSelectionOrFocus=Cse.bindTo(this.contextKeyService),this.hasDoubleSelection=yse.bindTo(this.contextKeyService),this.hasMultiSelection=Ese.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=i_(c);const f=new Set;f.add(pRe);const g=()=>{const _=u.isScreenReaderOptimized()?"simple":c.getValue(s5);e.updateOptions({simpleKeyboardNavigation:_==="simple",filterOnType:_==="filter"})};this.updateStyleOverrides(s),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const p=e.getSelection(),_=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(p.length>0||_.length>0),this.hasMultiSelection.set(p.length>1),this.hasDoubleSelection.set(p.length===2)})}),e.onDidChangeFocus(()=>{const p=e.getSelection(),_=e.getFocus();this.hasSelectionOrFocus.set(p.length>0||_.length>0)}),c.onDidChangeConfiguration(p=>{let _={};if(p.affectsConfiguration(Yw)&&(this._useAltAsMultipleSelectionModifier=i_(c)),p.affectsConfiguration(lP)){const v=c.getValue(lP);_=Object.assign(Object.assign({},_),{indent:v})}if(p.affectsConfiguration(o5)){const v=c.getValue(o5);_=Object.assign(Object.assign({},_),{renderIndentGuides:v})}if(p.affectsConfiguration(op)){const v=!!c.getValue(op);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(s5)&&g(),p.affectsConfiguration(Sse)&&(_=Object.assign(Object.assign({},_),{automaticKeyboardNavigation:i()})),p.affectsConfiguration(yh)&&t.horizontalScrolling===void 0){const v=!!c.getValue(yh);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(r5)&&t.expandOnlyOnTwistieClick===void 0&&(_=Object.assign(Object.assign({},_),{expandOnlyOnTwistieClick:c.getValue(r5)==="doubleClick"})),p.affectsConfiguration(t_)){const v=c.getValue(t_);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(n_)){const v=c.getValue(n_);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&e.updateOptions(_)}),this.contextKeyService.onDidChangeContext(p=>{p.affectsSome(f)&&e.updateOptions({automaticKeyboardNavigation:i()})}),u.onDidChangeScreenReaderOptimized(()=>g())),this.navigator=new EMt(e,Object.assign({configurationService:c},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){Ji(this.styler),this.styler=e?rw(this.tree,this.themeService,e):wt.None}dispose(){this.disposables=Ji(this.disposables),Ji(this.styler),this.styler=void 0}};lw=p_([Li(4,ai),Li(5,Mh),Li(6,fo),Li(7,Yo),Li(8,Vu)],lw);const wMt=br.as(Fw.Configuration);wMt.registerConfiguration({id:"workbench",order:7,title:$("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Yw]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[$("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),$("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:$({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[FJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:$({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[yh]:{type:"boolean",default:!1,description:$("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[lP]:{type:"number",default:8,minimum:0,maximum:40,description:$("tree indent setting","Controls tree indentation in pixels.")},[o5]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:$("render tree indent guides","Controls whether the tree should render indent guides.")},[op]:{type:"boolean",default:!1,description:$("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[t_]:{type:"number",default:1,description:$("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[n_]:{type:"number",default:5,description:$("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[s5]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[$("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),$("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),$("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:$("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[Sse]:{type:"boolean",default:!0,markdownDescription:$("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[r5]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:$("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")}}});var xo;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(xo||(xo={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=$("sev.error","Error"),t[n.Warning]=$("sev.warning","Warning"),t[n.Info]=$("sev.info","Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case Go.Error:return n.Error;case Go.Warning:return n.Warning;case Go.Info:return n.Info;case Go.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return Go.Error;case n.Warning:return Go.Warning;case n.Info:return Go.Info;case n.Hint:return Go.Ignore}}n.toSeverity=o})(xo||(xo={}));var l5;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){let r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(xo.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(l5||(l5={}));const PF=ss("markerService");class IMt{constructor(){this._byResource=new Fa,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new Fa,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1,o=this._byResource.get(e);o&&(i=o.delete(t));let r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i,s,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:zi.empty():Jn.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:zi.empty():zi.map(zi.concat(...this._byOwner.values()),r=>r[1])}}class LMt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Fa,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===Ii.inMemory||e.scheme===Ii.walkThrough||e.scheme===Ii.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===xo.Error?t.errors+=1:i===xo.Warning?t.warnings+=1:i===xo.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class NS{constructor(){this._onMarkerChanged=new Y_t({delay:0,merge:NS._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new IMt,this._stats=new LMt(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(BLe(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=NS._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:c,startColumn:u,endLineNumber:d,endColumn:f,relatedInformation:g,tags:p}=i;if(r)return c=c>0?c:1,u=u>0?u:1,d=d>=c?d:c,f=f>0?f:u,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:c,startColumn:u,endLineNumber:d,endColumn:f,relatedInformation:g,tags:p}}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const c of r)if(NS._accept(c,s)){const u=a.push(c);if(o>0&&u===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(let a of this._data.values())for(let c of a)if(NS._accept(c,s)){const u=r.push(c);if(o>0&&u===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const c of r)for(const u of c)if(NS._accept(u,s)){const d=a.push(u);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Fa;for(let i of e)for(let s of i)t.set(s,!0);return Array.from(t.keys())}}var _4=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},q1;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(q1||(q1={}));class aP extends wt{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new rt),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=q1.None,this.cache=new Map,this.flushDelayer=new Ovt(aP.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;(t=e.changed)===null||t===void 0||t.forEach((s,o)=>this.accept(o,s)),(i=e.deleted)===null||i===void 0||i.forEach(s=>this.accept(s,void 0))}accept(e,t){if(this.state===q1.Closed)return;let i=!1;md(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return md(i)?t:i}getBoolean(e,t){const i=this.get(e);return md(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return md(i)?t:parseInt(i,10)}set(e,t){return _4(this,void 0,void 0,function*(){if(this.state===q1.Closed)return;if(md(t))return this.delete(e);const i=String(t);if(this.cache.get(e)!==i)return this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())})}delete(e){return _4(this,void 0,void 0,function*(){if(!(this.state===q1.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return _4(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}dispose(){this.flushDelayer.dispose(),super.dispose()}}aP.DEFAULT_FLUSH_DELAY=100;class rpe{constructor(){this.onDidChangeItemsExternal=Ln.None,this.items=new Map}updateItems(e){return _4(this,void 0,void 0,function*(){e.insert&&e.insert.forEach((t,i)=>this.items.set(i,t)),e.delete&&e.delete.forEach(t=>this.items.delete(t))})}}const pV="__$__targetStorageMarker",m_=ss("storageService");var a5;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(a5||(a5={}));class V6 extends wt{constructor(e={flushInterval:V6.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new FW),this._onDidChangeTarget=this._register(new FW),this._onWillSaveState=this._register(new rt),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===pV?(e===0?this._globalKeyTargets=void 0:e===1&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getNumber(e,i)}store(e,t,i,s){if(md(t)){this.remove(e,i);return}this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,i,s),(o=this.getStorage(i))===null||o===void 0||o.set(e,t)})}remove(e,t){this.withPausedEmitters(()=>{var i;this.updateKeyTarget(e,t,void 0),(i=this.getStorage(t))===null||i===void 0||i.delete(e)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var s,o;const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,(s=this.getStorage(t))===null||s===void 0||s.set(pV,JSON.stringify(r))):typeof r[e]=="number"&&(delete r[e],(o=this.getStorage(t))===null||o===void 0||o.set(pV,JSON.stringify(r)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return e===0?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(pV,e);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}}V6.DEFAULT_FLUSH_INTERVAL=60*1e3;class OMt extends V6{constructor(){super(),this.globalStorage=this._register(new aP(new rpe)),this.workspaceStorage=this._register(new aP(new rpe)),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.globalStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e)))}getStorage(e){return e===0?this.globalStorage:this.workspaceStorage}}var _Re=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},v4=function(n,e){return function(t,i){e(t,i,n)}};let VJ=class{constructor(e){this._commandService=e}createMenu(e,t,i){return new UJ(e,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t,this)}};VJ=_Re([v4(0,vr)],VJ);let UJ=class k1{constructor(e,t,i,s,o){this._id=e,this._options=t,this._commandService=i,this._contextKeyService=s,this._menuService=o,this._disposables=new Wt,this._menuGroups=[],this._contextKeys=new Set,this._build();const r=new ho(()=>{this._build(),this._onDidChange.fire(this)},t.eventDebounceDelay);this._disposables.add(r),this._disposables.add(Th.onDidChangeMenu(u=>{u.has(e)&&r.schedule()}));const a=this._disposables.add(new Wt),c=()=>{const u=new ho(()=>this._onDidChange.fire(this),t.eventDebounceDelay);a.add(u),a.add(s.onDidChangeContext(d=>{d.affectsSome(this._contextKeys)&&u.schedule()}))};this._onDidChange=new rt({onFirstListenerAdd:c,onLastListenerRemove:a.clear.bind(a)}),this.onDidChange=this._onDidChange.event}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const e=Th.getMenuItems(this._id);let t;e.sort(k1._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(k1._fillInKbExprKeys(e.when,this._contextKeys),uD(e)){if(e.command.precondition&&k1._fillInKbExprKeys(e.command.precondition,this._contextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;k1._fillInKbExprKeys(t,this._contextKeys)}}else this._options.emitEventsForSubmenuChanges&&Th.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let i of this._menuGroups){const[s,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=uD(a)?new Q0(a.command,a.alt,e,this._contextKeyService,this._commandService):new aie(a,this._menuService,this._contextKeyService,e);r.push(c)}r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(e,t){let i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;let a=i.localeCompare(s);if(a!==0)return a}let o=e.order||0,r=t.order||0;return o<r?-1:o>r?1:k1._compareTitles(uD(e)?e.command.title:e.title,uD(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};UJ=_Re([v4(2,vr),v4(3,ai),v4(4,Uw)],UJ);var RMt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lpe=function(n,e){return function(t,i){e(t,i,n)}};class MMt extends wt{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(xi(()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()}))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const s=this.model.deltaDecorations(i,t);for(let o=0;o<s.length;o++)this._markersData.set(s[o],e[o]);return i.length!==0||s.length!==0}getMarker(e){return this._markersData.get(e.id)}}let WJ=class extends wt{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new rt),this._markerDecorations=new Fa,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new MMt(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ii.inMemory||e.uri.scheme===Ii.internal||e.uri.scheme===Ii.vscode)&&this._markerService&&this._markerService.read({resource:e.uri}).map(i=>i.owner).forEach(i=>this._markerService.remove(i,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});let i=t.map(s=>({range:this._createDecorationRange(e.model,s),options:this._createDecorationOption(s)}));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=be.lift(t);return t.severity===xo.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),e.validateRange(i)}_createDecorationOption(e){let t,i,s,o,r;switch(e.severity){case xo.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",s=0;break;case xo.Warning:t="squiggly-warning",i=sr(gwt),s=20,r={color:sr(H0t),position:vh.Inline};break;case xo.Info:t="squiggly-info",i=sr(pwt),s=10;break;case xo.Error:default:t="squiggly-error",i=sr(fwt),s=30,r={color:sr(B0t),position:vh.Inline};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:Ad.Right},minimap:r,zIndex:s,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}};WJ=RMt([lpe(0,Xr),lpe(1,PF)],WJ);var kMt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ape=function(n,e){return function(t,i){e(t,i,n)}};let GJ=class extends wt{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new rt,this._accessibilityModeEnabledContext=kF.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())})),i(),this.onDidChangeScreenReaderOptimized(()=>i())}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}getAccessibilitySupport(){return this._accessibilitySupport}};GJ=kMt([ape(0,ai),ape(1,Yo)],GJ);var mV=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class AMt{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return mV(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,s=document.body.appendChild(Vt("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(s)})}readText(e){return mV(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return mV(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return mV(this,void 0,void 0,function*(){this.findText=e})}}var NMt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cpe=function(n,e){return function(t,i){e(t,i,n)}},_V=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function vV(n){return n.scheme===Ii.file?n.fsPath:n.path}let vRe=0;class bV{constructor(e,t,i,s,o,r,a){this.id=++vRe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class upe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class dpe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);let i=[];return e.length>0&&i.push($({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push($({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(`
- `)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class DMt{constructor(e,t,i,s,o,r,a){this.id=++vRe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new dpe),this.removedResources.has(t)||this.removedResources.set(t,new upe(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new dpe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new upe(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class bRe{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
- `)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i<s;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new M1e(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,c=this._past.length;a<c;a++,s++){const u=this._past[a];i&&(s>=t||u.id!==e.elements[s])&&(i=!1,o=0),!i&&u.type===1&&u.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,s++){const c=this._future[a];i&&(s>=t||c.id!==e.elements[s])&&(i=!1,r=a),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class V7{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const TRe=new bRe("","");TRe.locked=!0;let c5=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);let t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
- `))}pushElement(e,t=CR.None,i=Em.None){if(e.type===0){const s=vV(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new bV(e,s,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const s=new Set,o=[],r=[];for(const a of e.resources){const c=vV(a),u=this.getUriComparisonKey(a);s.has(u)||(s.add(u),o.push(c),r.push(u))}o.length===1?this._pushElement(new bV(e,o[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new DMt(e,o,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const s=e.resourceLabels[t],o=e.strResources[t];let r;this._editStacks.has(o)?r=this._editStacks.get(o):(r=new bRe(s,o),this._editStacks.set(o,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const s=i.getClosestPastElement();return s?s.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),s=new Map;for(const o of i){const r=vV(o.resource),a=this.getUriComparisonKey(o.resource),c=new bV(o,r,a,0,0,0,0);s.set(c.strResource,c)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,s)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),s=new Map;for(const o of i){const r=vV(o.resource),a=this.getUriComparisonKey(o.resource),c=new bV(o,r,a,0,0,0,0);s.set(c.strResource,c)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,s)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const s=this.getUriComparisonKey(e);this._editStacks.has(s)&&this._editStacks.get(s).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new M1e(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof Em){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){di(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),s.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),s.dispose(),o()),c=>(r(),s.dispose(),this._onError(c,e))):(r(),s.dispose(),o())}_invokeWorkspacePrepare(e){return _V(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return wt.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?wt.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(wt.None);const i=e.actual.prepareUndoRedo();return i?vne(i)?t(i):i.then(s=>t(s)):t(wt.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||TRe);return new V7(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new TV(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new TV}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,$({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,$({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,$({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,$({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,$({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,s){return _V(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const a=yield this._dialogService.show(Go.Info,$("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[$({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",i.editStacks.length),$("nok","Undo this File"),$("cancel","Cancel")],{cancelId:2});if(a.choice===2)return;if(a.choice===1)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=$({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new V7([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Em){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,c]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&c)return this._undo(c,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return _V(this,void 0,void 0,function*(){if((yield this._dialogService.show(Go.Info,$("confirmDifferentSource","Would you like to undo '{0}'?",i.label),[$("confirmDifferentSource.yes","Yes"),$("cancel","Cancel")],{cancelId:1})).choice!==1)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder<t.sourceOrder)&&(t=r,i=s)}return[t,i]}canRedo(e){if(e instanceof Em){const[,i]=this._findClosestRedoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasFutureElements():!1}_tryToSplitAndRedo(e,t,i,s){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(s),new TV(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new TV}_checkWorkspaceRedo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,$({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,$({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestFutureElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,$({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,$({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,$({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return _V(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=$({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new V7([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder<t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);if(t)return this._redo(t)}redo(e){if(e instanceof Em){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return typeof e=="string"?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[s,o]=this._findClosestRedoElementInGroup(i.groupId);if(i!==s&&o)return this._redo(o)}try{return i.type===1?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};c5=NMt([cpe(0,AF),cpe(1,Hr)],c5);class TV{constructor(e){this.returnValue=e}}Fy(wF,c5);const $Mt=new RegExp(`(\\\\)?\\$\\((${Lu.iconNameExpression}(?:${Lu.iconModifierExpression})?)\\)`,"g");function I0(n){const e=new Array;let t,i=0,s=0;for(;(t=$Mt.exec(n))!==null;){s=t.index||0,e.push(n.substring(i,s)),i=(t.index||0)+t[0].length;const[,o,r]=t;e.push(o?`$(${r})`:xMt({id:r}))}return i<n.length&&e.push(n.substring(i)),e}function xMt(n){const e=Vt("span");return e.classList.add(...Lu.asClassNameArray(n)),e}const PMt={buttonBackground:mt.fromHex("#0E639C"),buttonHoverBackground:mt.fromHex("#006BB3"),buttonForeground:mt.white};class hpe extends wt{constructor(e,t){super(),this._onDidClick=this._register(new rt),this.options=t||Object.create(null),mp(this.options,PMt,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(Ds.addTarget(this._element)),[An.CLICK,so.Tap].forEach(i=>{this._register(Pt(this._element,i,s=>{if(!this.enabled){Rs.stop(s);return}this._onDidClick.fire(s)}))}),this._register(Pt(this._element,An.KEY_DOWN,i=>{const s=new Po(i);let o=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(i),o=!0):s.equals(9)&&(this._element.blur(),o=!0),o&&Rs.stop(s,!0)})),this._register(Pt(this._element,An.MOUSE_OVER,i=>{this._element.classList.contains("disabled")||this.setHoverBackground()})),this._register(Pt(this._element,An.MOUSE_OUT,i=>{this.applyStyles()})),this.focusTracker=this._register(dR(this._element)),this._register(this.focusTracker.onDidFocus(()=>this.setHoverBackground())),this._register(this.focusTracker.onDidBlur(()=>this.applyStyles())),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;this.options.secondary?e=this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:e=this.buttonHoverBackground?this.buttonHoverBackground.toString():null,e&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const i=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=i?"1px":"",this._element.style.borderStyle=i?"solid":"",this._element.style.borderColor=i}}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button"),this.options.supportIcons?oy(this._element,...I0(e)):this._element.textContent=e,typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}const FMt={badgeBackground:mt.fromHex("#4D4D4D"),badgeForeground:mt.fromHex("#FFFFFF")};class zJ{constructor(e,t){this.count=0,this.options=t||Object.create(null),mp(this.options,FMt,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=Nt(e,Vt(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=ha(this.countFormat,this.count),this.element.title=ha(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}const fpe="done",gpe="active",U7="infinite",ppe="discrete",BMt={progressBarBackground:mt.fromHex("#0E70C0")};class HMt extends wt{constructor(e,t){super(),this.options=t||Object.create(null),mp(this.options,BMt,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new ho(()=>pd(this.element),0)),this.create(e)}create(e){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(gpe,U7,ppe),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(fpe),this.element.classList.contains(U7)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(ppe,fpe),this.element.classList.add(gpe,U7),this}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}class Ise{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const CRe=new Ise("id#"),W7={},VMt=new Ise("quick-input-button-icon-");function KJ(n){if(!n)return;let e;const t=n.dark.toString();return W7[t]?e=W7[t]:(e=VMt.nextId(),_q(`.${e}`,`background-image: ${hb(n.light||n.dark)}`),_q(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${hb(n.dark)}`),W7[t]=e),e}const UMt={ctrlCmd:!1,alt:!1};var cP;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(cP||(cP={}));var wg;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(wg||(wg={}));function WMt(n,e={}){const t=Lse(e);return t.textContent=n,t}function yRe(n,e={}){const t=Lse(e);return ERe(t,zMt(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function Lse(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class GMt{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function ERe(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");o.href="#",t.disposables.add(Br(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{ERe(s,o,t,i)})}function zMt(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new GMt(n);for(;!r.eos();){let a=r.next();const c=a==="\\"&&jJ(r.peek(),e)!==0;if(c&&(a=r.next()),!c&&KMt(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const u=jJ(a,e);if(s.type===u||s.type===5&&u===6)s=o.pop();else{const d={type:u,children:[]};u===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===`
- `)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const u={type:2,content:a};s.children.push(u),o.push(s),s=u}else s.content+=a}return s.type===2&&(s=o.pop()),t}function KMt(n,e){return jJ(n,e)!==0}function jJ(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}class jMt{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class XMt{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new jMt(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const UN=Vt,YMt={inputBackground:mt.fromHex("#3C3C3C"),inputForeground:mt.fromHex("#CCCCCC"),inputValidationInfoBorder:mt.fromHex("#55AAFF"),inputValidationInfoBackground:mt.fromHex("#063B49"),inputValidationWarningBorder:mt.fromHex("#B89500"),inputValidationWarningBackground:mt.fromHex("#352A05"),inputValidationErrorBorder:mt.fromHex("#BE1100"),inputValidationErrorBackground:mt.fromHex("#5A1D1D")};class SRe extends Bd{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new rt),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new rt),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),mp(this.options,YMt,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Nt(e,UN(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",r=Nt(this.element,UN(".ibwrapper"));if(this.input=Nt(r,UN(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Nt(r,UN("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Vie(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Nt(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(u=>this.input.scrollTop=u.scrollTop));const a=this._register(new Zs(document,"selectionchange")),c=Ln.filter(a.event,()=>{const u=document.getSelection();return(u==null?void 0:u.anchorNode)===r});this._register(c(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new pb(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:mq(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return hf(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,s=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+s}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width=`calc(100% - ${e}px)`:this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t=()=>e.style.width=hf(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{if(!this.message)return null;e=Nt(s,UN(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?yRe(this.message.content,o):WMt(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=a.background?a.background.toString():"",r.style.color=a.foreground?a.foreground.toString():"",r.style.border=a.border?`1px solid ${a.border}`:"",Nt(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=$("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=$("alertWarningMessage","Warning: {0}",this.message.content):i=$("alertInfoMessage","Info: {0}",this.message.content),Hl(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=mq(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}class wRe extends SRe{constructor(e,t,i){const s=$({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${s}`,r=` (⇅ ${s})`;super(e,t,i),this.history=new XMt(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const c=this.placeholder.endsWith(")")?o:r,u=this.placeholder+c;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=u:this.setPlaceHolder(u)}};this.observer=new MutationObserver((c,u)=>{c.forEach(d=>{d.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const c=u=>{if(this.placeholder.endsWith(u)){const d=this.placeholder.slice(0,this.placeholder.length-u.length);return i.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};c(r)||c(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,E3(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,E3(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}const qMt=Vt;class JMt extends wt{constructor(e){super(),this.parent=e,this.onKeyDown=t=>Pt(this.inputBox.inputElement,An.KEY_DOWN,i=>{t(new Po(i))}),this.onMouseDown=t=>Pt(this.inputBox.inputElement,An.MOUSE_DOWN,i=>{t(new fh(i))}),this.onDidChange=t=>this.inputBox.onDidChange(t),this.container=Nt(this.parent,qMt(".quick-input-box")),this.inputBox=this._register(new SRe(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return this.inputBox.inputElement.type==="password"}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Go.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Go.Info?1:e===Go.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Go.Info?1:e===Go.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}class my{constructor(e,t){this.supportIcons=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=document.createElement("span"),this.domNode.className="monaco-highlighted-label",e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=my.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&zg(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const r=this.text.substring(t,i.start);e.push(Vt("span",void 0,...this.supportIcons?I0(r):[r])),t=i.end}const s=this.text.substring(i.start,i.end),o=Vt("span.highlight",void 0,...this.supportIcons?I0(s):[s]);i.extraClasses&&o.classList.add(i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);e.push(Vt("span",void 0,...this.supportIcons?I0(i):[i]))}oy(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,s=0;return e.replace(/\r\n|\r|\n/g,(o,r)=>{s=o===`\r
- `?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class mb{constructor(e="",t=!1){var i,s,o;if(this.value=e,typeof this.value!="string")throw Wg("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(s=t.supportThemeIcons)!==null&&s!==void 0?s:!1,this.supportHtml=(o=t.supportHtml)!==null&&o!==void 0?o:!1)}appendText(e,t=0){return this.value+=QMt(this.supportThemeIcons?nRt(e):e).replace(/([ \t]+)/g,(i,s)=>" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
- `:`
- `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=`
- `,this.value+=t,this.value+="\n```\n",this}}function p$(n){return IRe(n)?!n.value:Array.isArray(n)?n.every(p$):!0}function IRe(n){return n instanceof mb?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function QMt(n){return n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}function G7(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1")}function ZMt(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",c=isFinite(parseInt(a)),u=isFinite(parseInt(r));c&&e.push(`width="${a}"`),u&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var XJ=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function ekt(n,e){Yf(e)?n.title=e:e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class tkt{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t){var i;return XJ(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||Yf(e)||e instanceof HTMLElement)s=e;else if(!GD(e.markdown))s=(i=e.markdown)!==null&&i!==void 0?i:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show($("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new dc;const o=this._cancellationTokenSource.token;if(s=yield e.markdown(o),this.isDisposed||o.isCancellationRequested)return}this.show(s,t)})}show(e,t){const i=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!i};this._hoverWidget=this.hoverDelegate.showHover(s,t)}i==null||i.dispose()}hasContent(e){return e?IRe(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function nkt(n,e,t){let i,s;const o=(d,f)=>{var g;d&&(s==null||s.dispose(),s=void 0),f&&(i==null||i.dispose(),i=void 0),(g=n.onDidHideHover)===null||g===void 0||g.call(n)},r=(d,f,g)=>new mc(()=>XJ(this,void 0,void 0,function*(){(!s||s.isDisposed)&&(s=new tkt(n,g||e,d>0),yield s.update(t,f))}),d),a=()=>{if(i)return;const d=new Wt,f=_=>o(!1,_.fromElement===e);d.add(Pt(e,An.MOUSE_LEAVE,f,!0));const g=()=>o(!0,!0);d.add(Pt(e,An.MOUSE_DOWN,g,!0));const p={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const _=v=>p.x=v.x+10;d.add(Pt(e,An.MOUSE_MOVE,_,!0))}d.add(r(n.delay,!1,p)),i=d},c=Pt(e,An.MOUSE_OVER,a,!0);return{show:d=>{o(!1,!0),r(0,d)},hide:()=>{o(!0,!0)},update:d=>XJ(this,void 0,void 0,function*(){t=d,yield s==null?void 0:s.update(t)}),dispose:()=>{c.dispose(),o(!0,!0)}}}class z7{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class Ose extends wt{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new z7(Nt(e,Vt(".monaco-icon-label")))),this.labelContainer=Nt(this.domNode.element,Vt(".monaco-icon-label-container"));const i=Nt(this.labelContainer,Vt("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new z7(Nt(this.labelContainer,Vt("span.monaco-icon-description-container")))),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new okt(i,!!t.supportIcons):this.nameNode=new ikt(i),t!=null&&t.supportDescriptionHighlights?this.descriptionNodeFactory=()=>new my(Nt(this.descriptionContainer.element,Vt("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new z7(Nt(this.descriptionContainer.element,Vt("span.label-description")))),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"];i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough")),this.domNode.className=s.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof my?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,i==null?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(i==null?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)ekt(e,t);else{const s=nkt(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class ikt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&zg(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=Nt(this.container,Vt("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const s=e[i],o=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${i}`;Nt(this.container,Vt("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},s)),i<e.length-1&&Nt(this.container,Vt("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function skt(n,e,t){if(!t)return;let i=0;return n.map(s=>{const o={start:i,end:i+s.length},r=t.map(a=>aa.intersect(o,a)).filter(a=>!aa.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class okt{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&zg(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new my(Nt(this.container,Vt("a.label-name",{id:t==null?void 0:t.domId})),this.supportIcons)),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",s=skt(e,i,t==null?void 0:t.matches);for(let o=0;o<e.length;o++){const r=e[o],a=s?s[o]:void 0,c=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${o}`,u=Vt("a.label-name",{id:c,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new my(Nt(this.container,u),this.supportIcons).set(r,a,void 0,t==null?void 0:t.labelEscapeNewLines),o<e.length-1&&Nt(u,Vt("span.label-separator",void 0,i))}}}}const CV=Vt;class Rse{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelForeground=this.options.keybindingLabelForeground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow,this.domNode=Nt(e,CV(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&Rse.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){let[e,t]=this.keybinding.getParts();e&&this.renderPart(this.domNode,e,this.matches?this.matches.firstPart:null),t&&(Nt(this.domNode,CV("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderPart(this.domNode,t,this.matches?this.matches.chordPart:null)),this.domNode.title=this.keybinding.getAriaLabel()||""}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.applyStyles(),this.didEverRender=!0}clear(){wl(this.domNode),this.keyElements.clear()}renderPart(e,t,i){const s=rie.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,s.ctrlKey,!!(i!=null&&i.ctrlKey),s.separator),t.shiftKey&&this.renderKey(e,s.shiftKey,!!(i!=null&&i.shiftKey),s.separator),t.altKey&&this.renderKey(e,s.altKey,!!(i!=null&&i.altKey),s.separator),t.metaKey&&this.renderKey(e,s.metaKey,!!(i!=null&&i.metaKey),s.separator);const o=t.keyLabel;o&&this.renderKey(e,o,!!(i!=null&&i.keyCode),"")}renderKey(e,t,i,s){Nt(e,this.createKeyElement(t,i?".highlight":"")),s&&Nt(e,CV("span.monaco-keybinding-key-separator",void 0,s))}renderUnbound(e){Nt(e,this.createKeyElement($("unbound","Unbound")))}createKeyElement(e,t=""){const i=CV("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),i}style(e){this.labelBackground=e.keybindingLabelBackground,this.labelForeground=e.keybindingLabelForeground,this.labelBorder=e.keybindingLabelBorder,this.labelBottomBorder=e.keybindingLabelBottomBorder,this.labelShadow=e.keybindingLabelShadow,this.applyStyles()}applyStyles(){var e;if(this.element){for(const t of this.keyElements)this.labelBackground&&(t.style.backgroundColor=(e=this.labelBackground)===null||e===void 0?void 0:e.toString()),this.labelBorder&&(t.style.borderColor=this.labelBorder.toString()),this.labelBottomBorder&&(t.style.borderBottomColor=this.labelBottomBorder.toString()),this.labelShadow&&(t.style.boxShadow=`inset 0 -1px 0 ${this.labelShadow}`);this.labelForeground&&(this.element.style.color=this.labelForeground.toString())}}static areSame(e,t){return e===t||!e&&!t?!0:!!e&&!!t&&zg(e.firstPart,t.firstPart)&&zg(e.chordPart,t.chordPart)}}const mpe=new mO(()=>{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function rkt(n,e,t=!1){const i=n||"",s=e||"",o=mpe.value.collator.compare(i,s);return mpe.value.collatorIsNumeric&&o===0&&i!==s?i<s?-1:1:o}function lkt(n,e,t){const i=n.toLowerCase(),s=e.toLowerCase(),o=akt(n,e,t);if(o)return o;const r=i.endsWith(t),a=s.endsWith(t);if(r!==a)return r?-1:1;const c=rkt(i,s);return c!==0?c:i.localeCompare(s)}function akt(n,e,t){const i=n.toLowerCase(),s=e.toLowerCase(),o=i.startsWith(t),r=s.startsWith(t);if(o!==r)return o?-1:1;if(o&&r){if(i.length<s.length)return-1;if(i.length>s.length)return 1}return 0}var LRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ckt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const rm=Vt;class ukt{constructor(e){this.hidden=!1,this._onChecked=new rt,this.onChecked=this._onChecked.event,Object.assign(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class FF{get templateId(){return FF.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Nt(e,rm(".quick-input-list-entry"));const i=Nt(t.entry,rm("label.quick-input-list-label"));t.toDisposeTemplate.push(Br(i,An.CLICK,u=>{t.checkbox.offsetParent||u.preventDefault()})),t.checkbox=Nt(i,rm("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Br(t.checkbox,An.CHANGE,u=>{t.element.checked=t.checkbox.checked}));const s=Nt(i,rm(".quick-input-list-rows")),o=Nt(s,rm(".quick-input-list-row")),r=Nt(s,rm(".quick-input-list-row"));t.label=new Ose(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const a=Nt(o,rm(".quick-input-list-entry-keybinding"));t.keybinding=new Rse(a,Tf);const c=Nt(r,rm(".quick-input-list-label-meta"));return t.detail=new my(c,!0),t.separator=Nt(t.entry,rm(".quick-input-list-separator")),t.actionBar=new pb(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.toDisposeElement=Ji(i.toDisposeElement),i.element=e,i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(u=>i.checkbox.checked=u));const{labelHighlights:s,descriptionHighlights:o,detailHighlights:r}=e,a=Object.create(null);a.matches=s||[],a.descriptionTitle=e.saneDescription,a.descriptionMatches=o||[],a.extraClasses=e.item.iconClasses,a.italic=e.item.italic,a.strikethrough=e.item.strikethrough,i.label.setLabel(e.saneLabel,e.saneDescription,a),i.keybinding.set(e.item.keybinding),i.detail.set(e.saneDetail,r),e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator),i.actionBar.clear();const c=e.item.buttons;c&&c.length?(i.actionBar.push(c.map((u,d)=>{let f=u.iconClass||(u.iconPath?KJ(u.iconPath):void 0);u.alwaysVisible&&(f=f?`${f} always-visible`:"always-visible");const g=new Pf(`id-${d}`,"",f,!0,()=>ckt(this,void 0,void 0,function*(){e.fireButtonTriggered({button:u,item:e.item})}));return g.tooltip=u.tooltip||"",g}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Ji(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=Ji(e.toDisposeElement),e.toDisposeTemplate=Ji(e.toDisposeTemplate)}}FF.ID="listelement";class dkt{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return FF.ID}}var hr;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(hr||(hr={}));class Mse{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new rt,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new rt,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new rt,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new rt,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new rt,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new rt,this.onKeyDown=this._onKeyDown.event,this._onLeave=new rt,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Nt(this.parent,rm(".quick-input-list"));const s=new dkt,o=new fkt;this.list=i.createList("QuickInput",this.container,s,[new FF],{identityProvider:{getId:r=>r.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(r=>{const a=new Po(r);switch(a.keyCode){case 10:this.toggleCheckbox();break;case 31:(ki?r.metaKey:r.ctrlKey)&&this.list.setFocus(Za(this.list.length));break;case 16:const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break;case 18:const u=this.list.getFocus();u.length===1&&u[0]===this.list.length-1&&this._onLeave.fire();break}this._onKeyDown.fire(a)})),this.disposables.push(this.list.onMouseDown(r=>{r.browserEvent.button!==2&&r.browserEvent.preventDefault()})),this.disposables.push(Pt(this.container,An.CLICK,r=>{(r.x||r.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(r=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(r=>{typeof r.index=="number"&&(r.browserEvent.preventDefault(),this.list.setSelection([r.index]))})),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return Ln.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return Ln.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i<s;i++){const o=e[i];if(!o.hidden)if(o.checked)t=!0;else return!1}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,s=t.length;i<s;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,s=t.length;i<s;i++)t[i].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach(t=>{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Ji(this.elementDisposables);const t=i=>this.fireButtonTriggered(i);this.inputElements=e,this.elements=e.reduce((i,s,o)=>{var r,a,c;if(s.type!=="separator"){const u=o&&e[o-1],d=s.label&&s.label.replace(/\r?\n/g," "),f=s.meta&&s.meta.replace(/\r?\n/g," "),g=s.description&&s.description.replace(/\r?\n/g," "),p=s.detail&&s.detail.replace(/\r?\n/g," "),_=s.ariaLabel||[d,g,p].map(v=>fTt(v)).filter(v=>!!v).join(", ");i.push(new ukt({index:o,item:s,saneLabel:d,saneMeta:f,saneAriaLabel:_,saneDescription:g,saneDetail:p,labelHighlights:(r=s.highlights)===null||r===void 0?void 0:r.label,descriptionHighlights:(a=s.highlights)===null||a===void 0?void 0:a.description,detailHighlights:(c=s.highlights)===null||c===void 0?void 0:c.detail,checked:!1,separator:u&&u.type==="separator"?u:void 0,fireButtonTriggered:t}))}return i},[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map(i=>i.onChecked(()=>this.fireCheckedEvents()))),this.elementsToIndexes=this.elements.reduce((i,s,o)=>(i.set(s.item,o),i),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===hr.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=hr.First),e===hr.Previous&&this.list.getFocus()[0]===0&&(e=hr.Last),e===hr.Second&&this.list.length<2&&(e=hr.First),e){case hr.First:this.list.focusFirst();break;case hr.Second:this.list.focusNth(1);break;case hr.Last:this.list.focusLast();break;case hr.Next:this.list.focusNext();break;case hr.Previous:this.list.focusPrevious();break;case hr.NextPage:this.list.focusNextPage();break;case hr.PreviousPage:this.list.focusPreviousPage();break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${Math.floor(e/44)*44}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const s=i.index&&this.inputElements[i.index-1];i.separator=s&&s.type==="separator"?s:void 0});else{let i;this.elements.forEach(s=>{const o=this.matchOnLabel?yd(gV(e,fV(s.saneLabel))):void 0,r=this.matchOnDescription?yd(gV(e,fV(s.saneDescription||""))):void 0,a=this.matchOnDetail?yd(gV(e,fV(s.saneDetail||""))):void 0,c=this.matchOnMeta?yd(gV(e,fV(s.saneMeta||""))):void 0;if(o||r||a||c?(s.labelHighlights=o,s.descriptionHighlights=r,s.detailHighlights=a,s.hidden=!1):(s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=!s.item.alwaysShow),s.separator=void 0,!this.sortByLabel){const u=s.index&&this.inputElements[s.index-1];i=u&&u.type==="separator"?u:i,i&&!s.hidden&&(s.separator=i,i=void 0)}})}const t=this.elements.filter(i=>!i.hidden);if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort((s,o)=>hkt(s,o,i))}return this.elementsToIndexes=t.reduce((i,s,o)=>(i.set(s.item,o),i),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Ji(this.elementDisposables),this.disposables=Ji(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}LRe([Vr],Mse.prototype,"onDidChangeFocus",null);LRe([Vr],Mse.prototype,"onDidChangeSelection",null);function hkt(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:lkt(n.saneLabel,e.saneLabel,t)}class fkt{getWidgetAriaLabel(){return $("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}var _pe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const rd=Vt,gkt=Zf("quick-input-back",vn.arrowLeft),YJ={iconClass:gkt.classNames,tooltip:$("quickInput.back","Back"),handle:-1};class U6 extends wt{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=U6.noPromptMessage,this._severity=Go.Ignore,this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new rt),this.onDidHideEmitter=this._register(new rt),this.onDisposeEmitter=this._register(new rt),this.visibleDisposables=this._register(new Wt),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Xm;this._ignoreFocusOut=e&&!Xm,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=cP.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new mc,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this.buttons.filter(r=>r===YJ);this.ui.leftActionBar.push(s.map((r,a)=>{const c=new Pf(`id-${a}`,"",r.iconClass||KJ(r.iconPath),!0,()=>_pe(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(r)}));return c.tooltip=r.tooltip||"",c}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this.buttons.filter(r=>r!==YJ);this.ui.rightActionBar.push(o.map((r,a)=>{const c=new Pf(`id-${a}`,"",r.iconClass||KJ(r.iconPath),!0,()=>_pe(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(r)}));return c.tooltip=r.tooltip||"",c}),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,oy(this.ui.message,...I0(i))),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?$("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Go.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}U6.noPromptMessage=$("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class uP extends U6{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new rt),this.onWillAcceptEmitter=this._register(new rt),this.onDidAcceptEmitter=this._register(new rt),this.onDidCustomEmitter=this._register(new rt),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?wg.NONE:wg.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new rt),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new rt),this.onDidTriggerItemButtonEmitter=this._register(new rt),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e||"",this.update(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?UMt:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(hr.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e,this.ui.list.filter(this.filterValue(this.ui.inputBox.value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(hr.Next),this.canSelectMany&&this.ui.list.domFocus(),Rs.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(hr.Previous):this.ui.list.focus(hr.Last),this.canSelectMany&&this.ui.list.domFocus(),Rs.stop(e,!0);break;case 12:this.ui.list.focus(hr.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Rs.stop(e,!0);break;case 11:this.ui.list.focus(hr.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Rs.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(hr.First),Rs.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(hr.Last),Rs.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&xf(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&xf(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&xf(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return Pt(this.ui.container,An.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Po(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const[a,c]=r.getParts();return c?!1:a.shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a.altKey&&i===6||a.ctrlKey&&i===5||a.metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",t&&!this.description);const i={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!t,progressBar:!t,visibleCount:!0,count:this.canSelectMany,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");const s=this.ariaLabel||this.placeholder||uP.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==s&&(this.ui.inputBox.ariaLabel=s),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case wg.NONE:this._itemActivation=wg.FIRST;break;case wg.SECOND:this.ui.list.focus(hr.Second),this._itemActivation=wg.FIRST;break;case wg.LAST:this.ui.list.focus(hr.Last),this._itemActivation=wg.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(hr.First)),this.keepScrollPosition&&(this.scrollTop=e)}}uP.DEFAULT_ARIA_LABEL=$("quickInputBox.ariaLabel","Type to narrow down results.");class W6 extends wt{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new rt),this.onDidCustomEmitter=this._register(new rt),this.onDidTriggerButtonEmitter=this._register(new rt),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new rt),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new rt),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(Pt(window,An.KEY_DOWN,e,!0)),this._register(Pt(window,An.KEY_UP,e,!0)),this._register(Pt(window,An.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Nt(this.parentElement,rd(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=kd(e),i=Nt(e,rd(".quick-input-titlebar")),s=this._register(new pb(i));s.domNode.classList.add("quick-input-left-action-bar");const o=Nt(i,rd(".quick-input-title")),r=this._register(new pb(i));r.domNode.classList.add("quick-input-right-action-bar");const a=Nt(e,rd(".quick-input-description")),c=Nt(e,rd(".quick-input-header")),u=Nt(c,rd("input.quick-input-check-all"));u.type="checkbox",this._register(Br(u,An.CHANGE,F=>{const V=u.checked;N.setAllVisibleChecked(V)})),this._register(Pt(u,An.CLICK,F=>{(F.x||F.y)&&p.setFocus()}));const d=Nt(c,rd(".quick-input-description")),f=Nt(c,rd(".quick-input-and-message")),g=Nt(f,rd(".quick-input-filter")),p=this._register(new JMt(g));p.setAttribute("aria-describedby",`${this.idPrefix}message`);const _=Nt(g,rd(".quick-input-visible-count"));_.setAttribute("aria-live","polite"),_.setAttribute("aria-atomic","true");const v=new zJ(_,{countFormat:$({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")}),C=Nt(g,rd(".quick-input-count"));C.setAttribute("aria-live","polite");const y=new zJ(C,{countFormat:$({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")}),w=Nt(c,rd(".quick-input-action")),I=new hpe(w);I.label=$("ok","OK"),this._register(I.onDidClick(F=>{this.onDidAcceptEmitter.fire()}));const L=Nt(c,rd(".quick-input-action")),O=new hpe(L);O.label=$("custom","Custom"),this._register(O.onDidClick(F=>{this.onDidCustomEmitter.fire()}));const A=Nt(f,rd(`#${this.idPrefix}message.quick-input-message`)),N=this._register(new Mse(e,this.idPrefix+"list",this.options));this._register(N.onChangedAllVisibleChecked(F=>{u.checked=F})),this._register(N.onChangedVisibleCount(F=>{v.setCount(F)})),this._register(N.onChangedCheckedCount(F=>{y.setCount(F)})),this._register(N.onLeave(()=>{setTimeout(()=>{p.setFocus(),this.controller instanceof uP&&this.controller.canSelectMany&&N.clearFocus()},0)})),this._register(N.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const D=new HMt(e);D.getContainer().classList.add("quick-input-progress");const P=dR(e);return this._register(P),this._register(Pt(e,An.FOCUS,F=>{this.previousFocusElement=F.relatedTarget instanceof HTMLElement?F.relatedTarget:void 0},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(cP.Blur),this.previousFocusElement=void 0})),this._register(Pt(e,An.FOCUS,F=>{p.setFocus()})),this._register(Pt(e,An.KEY_DOWN,F=>{const V=new Po(F);switch(V.keyCode){case 3:Rs.stop(F,!0),this.onDidAcceptEmitter.fire();break;case 9:Rs.stop(F,!0),this.hide(cP.Gesture);break;case 2:if(!V.altKey&&!V.ctrlKey&&!V.metaKey){const U=[".action-label.codicon"];e.classList.contains("show-checkboxes")?U.push("input"):U.push("input[type=text]"),this.getUI().list.isDisplayed()&&U.push(".monaco-list");const Q=e.querySelectorAll(U.join(", "));V.shiftKey&&V.target===Q[0]?(Rs.stop(F,!0),Q[Q.length-1].focus()):!V.shiftKey&&V.target===Q[Q.length-1]&&(Rs.stop(F,!0),Q[0].focus())}break}})),this.ui={container:e,styleSheet:t,leftActionBar:s,titleBar:i,title:o,description1:a,description2:d,rightActionBar:r,checkAll:u,filterContainer:g,inputBox:p,visibleCountContainer:_,visibleCount:v,countContainer:C,count:y,okContainer:w,ok:I,message:A,customButtonContainer:L,customButton:O,list:N,progressBar:D,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:F=>this.show(F),hide:()=>this.hide(),setVisibilities:F=>this.setVisibilities(F),setComboboxAccessibility:F=>this.setComboboxAccessibility(F),setEnabled:F=>this.setEnabled(F),setContextKey:F=>this.options.setContextKey(F)},this.updateStyles(),this.ui}pick(e,t={},i=Ai.None){return new Promise((s,o)=>{let r=d=>{r=s,t.onKeyMods&&t.onKeyMods(a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let c;const u=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const f=d[0];f&&t.onDidFocus&&t.onDidFocus(f)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const f=d[0];f&&(r(f),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},d),{removeItem:()=>{const f=a.items.indexOf(d.item);if(f!==-1){const g=a.items.slice(),p=g.splice(f,1),_=a.activeItems.filter(C=>C!==p[0]),v=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=g,_&&(a.activeItems=_),a.keepScrollPosition=v}}}))),a.onDidChangeValue(d=>{c&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==c)&&(a.activeItems=[c])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Ji(u),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,f])=>{c=f,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(g=>g.type!=="separator"&&g.picked)),c&&(a.activeItems=[c])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new uP(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Go.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),oy(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const s=this.options.backKeybindingLabel();YJ.tooltip=s?$("quickInput.backWithKeybinding","Back ({0})",s):$("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkBox?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const s=!(!((t=this.ui)===null||t===void 0)&&t.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",s||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,W6.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,contrastBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const r=[];this.styles.list.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(`
- `);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}W6.MAX_WIDTH=600;var qJ;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(qJ||(qJ={}));const qw={Quickaccess:"workbench.contributions.quickaccess"};class pkt{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),xi(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return Bw([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}br.add(qw.Quickaccess,new pkt);const Wy=ss("quickInputService");var mkt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vpe=function(n,e){return function(t,i){e(t,i,n)}};let JJ=class extends wt{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=br.as(qw.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var s;const[o,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,c=a==null?void 0:a.descriptor;if(a&&r&&c===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let _;if(a&&c&&c!==r){const v=a.value.substr(c.prefix.length);v&&(_=`${r.prefix}${v}`)}if(!_){const v=o==null?void 0:o.defaultFilterValue;v===qJ.LAST?_=this.lastAcceptedPickerValues.get(r):typeof v=="string"&&(_=`${r.prefix}${v}`)}typeof _=="string"&&(e=_)}const u=new Wt,d=u.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,r,i),d.placeholder=r==null?void 0:r.placeholder,d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(d.itemActivation=(s=i==null?void 0:i.itemActivation)!==null&&s!==void 0?s:wg.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=_=>_.substring(r?r.prefix.length:0),r!=null&&r.placeholder&&(d.ariaLabel=r==null?void 0:r.placeholder);let f,g;t&&(f=new Promise(_=>g=_),u.add(ub(d.onWillAccept)(_=>{_.veto(),d.hide()}))),u.add(this.registerPickerListeners(d,o,r,e));const p=u.add(new dc);if(o&&u.add(o.provide(d,p.token)),ub(d.onDidHide)(()=>{d.selectedItems.length===0&&p.cancel(),u.dispose(),g==null||g(d.selectedItems)}),d.show(),t)return f}adjustValueSelection(e,t,i){var s;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(s=t==null?void 0:t.prefix.length)!==null&&s!==void 0?s:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,s){const o=new Wt,r=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return o.add(xi(()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(a=>{const[c]=this.getOrInstantiateProvider(a);c!==t?this.show(a,{preserveValue:!0}):r.value=a})),i&&o.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};JJ=mkt([vpe(0,Wy),vpe(1,Qi)],JJ);var _kt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},WN=function(n,e){return function(t,i){e(t,i,n)}};let QJ=class extends Gyt{constructor(e,t,i,s,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=s,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(JJ))),this._quickAccess}createController(e=this.layoutService,t){var i,s;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:a=>this.setContextKey(a),returnFocus:()=>e.focus(),createList:(a,c,u,d,f)=>this.instantiationService.createInstance(BJ,a,c,u,d,f),styles:this.computeStyles()},r=this._register(new W6(Object.assign(Object.assign({},o),t)));return r.layout(e.dimension,(s=(i=e.offset)===null||i===void 0?void 0:i.top)!==null&&s!==void 0?s:0),this._register(e.onDidLayout(a=>{var c,u;return r.layout(a,(u=(c=e.offset)===null||c===void 0?void 0:c.top)!==null&&u!==void 0?u:0)})),this._register(r.onShow(()=>this.resetContextKeys())),this._register(r.onHide(()=>this.resetContextKeys())),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Sn(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=Ai.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},Lg(this.theme,{quickInputBackground:Ffe,quickInputForeground:FSt,quickInputTitleBackground:BSt,contrastBorder:_r,widgetShadow:dy})),inputBox:Lg(this.theme,{inputForeground:Sie,inputBackground:Eie,inputBorder:wie,inputValidationInfoBackground:Iie,inputValidationInfoForeground:Lie,inputValidationInfoBorder:Oie,inputValidationWarningBackground:D1e,inputValidationWarningForeground:$1e,inputValidationWarningBorder:x1e,inputValidationErrorBackground:P1e,inputValidationErrorForeground:F1e,inputValidationErrorBorder:B1e}),countBadge:Lg(this.theme,{badgeBackground:i$,badgeForeground:s$,badgeBorder:_r}),button:Lg(this.theme,{buttonForeground:RSt,buttonBackground:tJ,buttonHoverBackground:MSt,buttonBorder:_r}),progressBar:Lg(this.theme,{progressBarBackground:kSt}),keybindingLabel:Lg(this.theme,{keybindingLabelBackground:USt,keybindingLabelForeground:WSt,keybindingLabelBorder:GSt,keybindingLabelBottomBorder:zSt,keybindingLabelShadow:dy}),list:Lg(this.theme,{listBackground:Ffe,listInactiveFocusForeground:r4,listInactiveSelectionIconForeground:l4,listInactiveFocusBackground:a4,listFocusOutline:Ua,listInactiveFocusOutline:Ua,pickerGroupBorder:VSt,pickerGroupForeground:HSt})}}};QJ=_kt([WN(0,Qi),WN(1,ai),WN(2,fo),WN(3,Vu),WN(4,D6)],QJ);var ORe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DS=function(n,e){return function(t,i){e(t,i,n)}};let ZJ=class extends QJ{constructor(e,t,i,s,o,r){super(t,i,s,o,r),this.host=void 0;const a=RR.get(e);this.host={_serviceBrand:void 0,get container(){return a.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};ZJ=ORe([DS(1,Qi),DS(2,ai),DS(3,fo),DS(4,Vu),DS(5,D6)],ZJ);let eQ=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(ZJ,e);this.mapEditorToService.set(e,t),ub(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=Ai.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};eQ=ORe([DS(0,Qi),DS(1,hs)],eQ);class RR{constructor(e){this.editor=e,this.widget=new G6(this.editor)}static get(e){return e.getContribution(RR.ID)}dispose(){this.widget.dispose()}}RR.ID="editor.controller.quickInput";class G6{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return G6.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}G6.ID="editor.contrib.quickInputWidget";_s(RR.ID,RR);var ms;(function(n){const e=new qx;class t{constructor(c,u){this._serviceId=c,this._factory=u,this._value=null}get id(){return this._serviceId}get(c){if(!this._value){if(c&&(this._value=c[this._serviceId.toString()]),this._value||(this._value=this._factory(c)),!this._value)throw new Error("Service "+this._serviceId+" is missing!");e.set(this._serviceId,this._value)}return this._value}}n.LazyStaticService=t;let i=[];function s(a,c){let u=new t(a,c);return i.push(u),u}function o(a){let c=new qx;for(const[d,f]of iCt())c.set(d,f);for(let d in a)a.hasOwnProperty(d)&&c.set(ss(d),a[d]);i.forEach(d=>c.set(d.id,d.get(a)));let u=new e5(c,!0);return c.set(Qi,u),[c,u]}n.init=o,n.instantiationService=s(Qi,()=>new e5(e,!0));const r=new c1e;n.configurationService=s(Yo,()=>r),n.resourceConfigurationService=s(jne,()=>new Pyt(r)),n.resourcePropertiesService=s(PLe,()=>new Kq(r)),n.contextService=s(s1e,()=>new g6),n.labelService=s(NF,()=>new Hyt),n.telemetryService=s(By,()=>new Fyt),n.dialogService=s(AF,()=>new $yt),n.notificationService=s(Hr,()=>new f6),n.markerService=s(PF,()=>new NS),n.modeService=s(Ga,a=>new nP),n.standaloneThemeService=s(Kw,()=>new MOt),n.logService=s(h_,()=>new OCt(new LCt)),n.undoRedoService=s(wF,a=>new c5(n.dialogService.get(a),n.notificationService.get(a))),n.languageConfigurationService=s(yF,a=>new l3(n.configurationService.get(a),n.modeService.get(a))),n.modelService=s(Xr,a=>new q3(n.configurationService.get(a),n.resourcePropertiesService.get(a),n.standaloneThemeService.get(a),n.logService.get(a),n.undoRedoService.get(a),n.modeService.get(a),n.languageConfigurationService.get(a))),n.markerDecorationsService=s(lie,a=>new WJ(n.modelService.get(a),n.markerService.get(a))),n.contextKeyService=s(ai,a=>new EJ(n.configurationService.get(a))),n.codeEditorService=s(hs,a=>new X3(null,n.contextKeyService.get(a),n.standaloneThemeService.get(a))),n.editorProgressService=s(Mb,()=>new h6),n.storageService=s(m_,()=>new OMt),n.editorWorkerService=s(eg,a=>new Fq(n.modelService.get(a),n.resourceConfigurationService.get(a),n.logService.get(a)))})(ms||(ms={}));class vkt extends wt{constructor(e,t){super();const[i,s]=ms.init(t);this._serviceCollection=i,this._instantiationService=s;const o=this.get(Yo),r=this.get(Hr),a=this.get(By),c=this.get(fo),u=this.get(h_),d=this.get(ai);let f=(C,y)=>{let w=null;return t&&(w=t[C.toString()]),w||(w=y()),this._serviceCollection.set(C,w),w};f(Vu,()=>new GJ(d,o)),f(Mh,()=>new PJ(c));let g=f(vr,()=>new xyt(this._instantiationService)),p=f(Ro,()=>this._register(new a1e(d,g,a,r,u,e))),_=f(D6,()=>new Vyt(ms.codeEditorService.get(hs),e));f(Wy,()=>new eQ(s,ms.codeEditorService.get(hs)));let v=f(Hy,()=>this._register(new kJ(_)));f(Uy,()=>new AMt),f(Vy,()=>{const C=new MJ(a,r,v,p,c);return C.configure({blockMouse:!1}),this._register(C)}),f(Uw,()=>new VJ(g)),f(tie,()=>new Byt(ms.modelService.get(Xr)))}get(e){let t=this._serviceCollection.get(e);if(!t)throw new Error("Missing service "+e);return t}set(e,t){this._serviceCollection.set(e,t)}has(e){return this._serviceCollection.has(e)}}function RRe(n,e,t){let i=new vkt(n,e),s=null;i.has(Nd)||(s=new zq(ms.modelService.get()),i.set(Nd,s)),i.has(np)||i.set(np,new Eq(i.get(hs),i.get(vr)));let o=t(i);return s&&s.setEditor(o),o}function bkt(n,e,t){return RRe(n,t||{},i=>new vJ(n,e,i,i.get(Qi),i.get(hs),i.get(vr),i.get(ai),i.get(Ro),i.get(Hy),i.get(Kw),i.get(Hr),i.get(Yo),i.get(Vu),i.get(Xr),i.get(Ga)))}function Tkt(n){return ms.codeEditorService.get().onCodeEditorAdd(e=>{n(e)})}function Ckt(n,e,t){return RRe(n,t||{},i=>new bJ(n,e,i,i.get(Qi),i.get(ai),i.get(Ro),i.get(Hy),i.get(eg),i.get(hs),i.get(Kw),i.get(Hr),i.get(Yo),i.get(Vy),i.get(Mb),i.get(Uy)))}function ykt(n,e){return new Fbt(n,e)}function Ekt(n,e,t){return MOe(ms.modelService.get(),ms.modeService.get(),n,e,t)}function Skt(n,e){ms.modelService.get().setMode(n,ms.modeService.get().create(e))}function wkt(n,e,t){n&&ms.markerService.get().changeOne(e,n.uri,t)}function Ikt(n){return ms.markerService.get().read(n)}function Lkt(n){return ms.markerService.get().onMarkerChanged(n)}function Okt(n){return ms.modelService.get().getModel(n)}function Rkt(){return ms.modelService.get().getModels()}function Mkt(n){return ms.modelService.get().onModelAdded(n)}function kkt(n){return ms.modelService.get().onModelRemoved(n)}function Akt(n){return ms.modelService.get().onModelModeChanged(e=>{n({model:e.model,oldLanguage:e.oldModeId})})}function Nkt(n){return NCt(ms.modelService.get(),n)}function Dkt(n,e){const t=ms.standaloneThemeService.get();return t.registerEditorContainer(n),eie.colorizeElement(t,ms.modeService.get(),n,e)}function $kt(n,e,t){return ms.standaloneThemeService.get().registerEditorContainer(document.body),eie.colorize(ms.modeService.get(),n,e,t)}function xkt(n,e,t=4){return ms.standaloneThemeService.get().registerEditorContainer(document.body),eie.colorizeModelLine(n,e,t)}function Pkt(n){let e=$o.get(n);return e||{getInitialState:()=>CF,tokenize:(t,i,s,o)=>CLe(n,t,s,o)}}function Fkt(n,e){ms.modeService.get().triggerMode(e);let i=Pkt(e),s=Jm(n),o=[],r=i.getInitialState();for(let a=0,c=s.length;a<c;a++){let u=s[a],d=i.tokenize(u,!0,r,0);o[a]=d.tokens,r=d.endState}return o}function Bkt(n,e){ms.standaloneThemeService.get().defineTheme(n,e)}function Hkt(n){ms.standaloneThemeService.get().setTheme(n)}function Vkt(){Zyt()}function Ukt(n,e){return ji.registerCommand({id:n,handler:e})}function Wkt(){return{create:bkt,onDidCreateEditor:Tkt,createDiffEditor:Ckt,createDiffNavigator:ykt,createModel:Ekt,setModelLanguage:Skt,setModelMarkers:wkt,getModelMarkers:Ikt,onDidChangeMarkers:Lkt,getModels:Rkt,getModel:Okt,onDidCreateModel:Mkt,onWillDisposeModel:kkt,onDidChangeModelLanguage:Akt,createWebWorker:Nkt,colorizeElement:Dkt,colorize:$kt,colorizeModelLine:xkt,tokenize:Fkt,defineTheme:Bkt,setTheme:Hkt,remeasureFonts:Vkt,registerCommand:Ukt,AccessibilitySupport:MY,ContentWidgetPositionPreference:$Y,CursorChangeReason:xY,DefaultEndOfLine:PY,EditorAutoIndentStrategy:BY,EditorOption:HY,EndOfLinePreference:VY,EndOfLineSequence:UY,MinimapPosition:YY,MouseTargetType:qY,OverlayWidgetPositionPreference:JY,OverviewRulerLane:QY,RenderLineNumbersType:ZY,RenderMinimap:eq,ScrollbarVisibility:nq,ScrollType:tq,TextEditorCursorBlinkingStyle:lq,TextEditorCursorStyle:aq,TrackedRangeStickiness:cq,WrappingIndent:uq,ConfigurationChangedEvent:LIe,BareFontInfo:g0,FontInfo:wq,TextModelResolvedOptions:QU,FindMatch:yx,EditorType:TF,EditorOptions:pp}}function Gkt(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function yV(n,e){return typeof n=="boolean"?n:e}function bpe(n,e){return typeof n=="string"?n:e}function zkt(n){const e={};for(const t of n)e[t]=!0;return e}function Tpe(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=zkt(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function tQ(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,r){i=!0;let a="";if(typeof n[r]=="string")a=n[r];else if(n[r]&&n[r]instanceof RegExp)a=n[r].source;else throw n[r]===void 0?Qs(n,"language definition does not contain attribute '"+r+"', used at: "+e):Qs(n,"attribute reference '"+r+"' must be a string, used at: "+e);return O1(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");let s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,s)}function Kkt(n,e,t,i){if(i<0)return n;if(i<e.length)return e[i];if(i>=100){i=i-100;let s=t.split(".");if(s.unshift(t),i<s.length)return s[i]}return null}function jkt(n,e,t,i){let s=-1,o=t,r=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(s=parseInt(r[3]),r[2]&&(s=s+100)),o=r[4]);let a="~",c=o;!o||o.length===0?(a="!=",c=""):/^\w*$/.test(c)?a="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(a=r[1],c=r[2]));let u;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(c)){let d=Tpe(c.split("|"),n.ignoreCase);u=function(f){return a==="~"?d(f):!d(f)}}else if(a==="@"||a==="!@"){let d=n[c];if(!d)throw Qs(n,"the @ match target '"+c+"' is not defined, in rule: "+e);if(!Gkt(function(g){return typeof g=="string"},d))throw Qs(n,"the @ match target '"+c+"' must be an array of strings, in rule: "+e);let f=Tpe(d,n.ignoreCase);u=function(g){return a==="@"?f(g):!f(g)}}else if(a==="~"||a==="!~")if(c.indexOf("$")<0){let d=tQ(n,"^"+c+"$");u=function(f){return a==="~"?d.test(f):!d.test(f)}}else u=function(d,f,g,p){return tQ(n,"^"+aC(n,c,f,g,p)+"$").test(d)};else if(c.indexOf("$")<0){let d=DC(n,c);u=function(f){return a==="=="?f===d:f!==d}}else{let d=DC(n,c);u=function(f,g,p,_,v){let C=aC(n,d,g,p,_);return a==="=="?f===C:f!==C}}return s===-1?{name:t,value:i,test:function(d,f,g,p){return u(d,d,f,g,p)}}:{name:t,value:i,test:function(d,f,g,p){let _=Kkt(d,f,g,s);return u(_||"",d,f,g,p)}}}function nQ(n,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw Qs(n,"a 'token' attribute must be of type string, in rule: "+e);{let i={token:t.token};if(t.token.indexOf("$")>=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Qs(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Qs(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!ZCt(n,aC(n,s,"",[],""))))throw Qs(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){let i=[];for(let s=0,o=t.length;s<o;s++)i[s]=nQ(n,e,t[s]);return{group:i}}else if(t.cases){let i=[];for(let o in t.cases)if(t.cases.hasOwnProperty(o)){const r=nQ(n,e,t.cases[o]);o==="@default"||o==="@"||o===""?i.push({test:void 0,value:r,name:o}):o==="@eos"?i.push({test:function(a,c,u,d){return d},value:r,name:o}):i.push(jkt(n,e,o,r))}const s=n.defaultToken;return{test:function(o,r,a,c){for(const u of i)if(!u.test||u.test(o,r,a,c))return u.value;return s}}}else throw Qs(n,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class Xkt{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if(typeof t=="string")i=t;else if(t instanceof RegExp)i=t.source;else throw Qs(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&i[0]==="^",this.name=this.name+": "+i,this.regex=tQ(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=nQ(e,this.name,t)}}function Ykt(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");let t={};t.languageId=n,t.includeLF=yV(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=yV(e.ignoreCase,!1),t.unicode=yV(e.unicode,!1),t.tokenPostfix=bpe(e.tokenPostfix,"."+t.languageId),t.defaultToken=bpe(e.defaultToken,"source"),t.usesEmbedded=!1;let i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,c){for(const u of c){let d=u.include;if(d){if(typeof d!="string")throw Qs(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Qs(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const f=new Xkt(r);if(Array.isArray(u)&&u.length>=1&&u.length<=3)if(f.setRegex(i,u[0]),u.length>=3)if(typeof u[1]=="string")f.setAction(i,{token:u[1],next:u[2]});else if(typeof u[1]=="object"){const g=u[1];g.next=u[2],f.setAction(i,g)}else throw Qs(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else f.setAction(i,u[1]);else{if(!u.regex)throw Qs(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);u.name&&typeof u.name=="string"&&(f.name=u.name),u.matchOnlyAtStart&&(f.matchOnlyAtLineStart=yV(u.matchOnlyAtLineStart,!1)),f.setRegex(i,u.regex),f.setAction(i,u.action)}a.push(f)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Qs(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(let r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Qs(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let o=[];for(let r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Qs(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
- hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:DC(t,a.open),close:DC(t,a.close)});else throw Qs(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function qkt(n){S0.registerLanguage(n)}function Jkt(){let n=[];return n=n.concat(S0.getLanguages()),n}function Qkt(n){return ms.modeService.get().languageIdCodec.encodeLanguageId(n)}function Zkt(n,e){let t=ms.modeService.get().onDidEncounterLanguage(i=>{i===i&&(t.dispose(),e())});return t}function eAt(n,e){const t=ms.modeService.get().validateLanguageId(n);if(!t)throw new Error(`Cannot set configuration for unknown language ${n}`);return ns.register(t,e,100)}class tAt{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i,s){if(typeof this._actual.tokenize=="function")return dP.adaptTokenize(this._languageId,this._actual,e,i,s);throw new Error("Not supported!")}tokenize2(e,t,i){let s=this._actual.tokenizeEncoded(e,i);return new V8(s.tokens,s.endState)}}class dP{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._modeService=i,this._standaloneThemeService=s}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t,i){let s=[],o=0;for(let r=0,a=e.length;r<a;r++){const c=e[r];let u=c.startIndex;r===0?u=0:u<o&&(u=o),s[r]=new H8(u+i,c.scopes,t),o=u}return s}static adaptTokenize(e,t,i,s,o){let r=t.tokenize(i,s),a=dP._toClassicTokens(r.tokens,e,o),c;return r.endState.equals(s)?c=s:c=r.endState,new Ene(a,c)}tokenize(e,t,i,s){return dP.adaptTokenize(this._languageId,this._actual,e,i,s)}_toBinaryTokens(e,t,i){const s=e.encodeLanguageId(this._languageId),o=this._standaloneThemeService.getColorTheme().tokenTheme;let r=[],a=0,c=0;for(let d=0,f=t.length;d<f;d++){const g=t[d],p=o.match(s,g.scopes);if(a>0&&r[a-1]===p)continue;let _=g.startIndex;d===0?_=0:_<c&&(_=c),r[a++]=_+i,r[a++]=p,c=_}let u=new Uint32Array(a);for(let d=0;d<a;d++)u[d]=r[d];return u}tokenize2(e,t,i,s){let o=this._actual.tokenize(e,i),r=this._toBinaryTokens(this._modeService.languageIdCodec,o.tokens,s),a;return o.endState.equals(i)?a=i:a=o.endState,new V8(r,a)}}function nAt(n){return"tokenizeEncoded"in n}function MRe(n){return n&&typeof n.then=="function"}function iAt(n){if(n){const e=[null];for(let t=1,i=n.length;t<i;t++)e[t]=mt.fromHex(n[t]);ms.standaloneThemeService.get().setColorMapOverride(e)}else ms.standaloneThemeService.get().setColorMapOverride(null)}function sAt(n,e){const t=ms.modeService.get().validateLanguageId(n);if(!t)throw new Error(`Cannot set tokens provider for unknown language ${n}`);const i=s=>nAt(s)?new tAt(t,s):new dP(t,s,ms.modeService.get(),ms.standaloneThemeService.get());return MRe(e)?$o.registerPromise(n,e.then(s=>i(s))):$o.register(n,i(e))}function oAt(n,e){const t=i=>nyt(ms.modeService.get(),ms.standaloneThemeService.get(),n,Ykt(n,i));return MRe(e)?$o.registerPromise(n,e.then(i=>t(i))):$o.register(n,t(e))}function rAt(n,e){return ZW.register(n,e)}function lAt(n,e){return e3.register(n,e)}function aAt(n,e){return m0.register(n,e)}function cAt(n,e){return Sx.register(n,{provideHover:(t,i,s)=>{let o=t.getWordAtPosition(i);return Promise.resolve(e.provideHover(t,i,s)).then(r=>{if(r)return!r.range&&o&&(r.range=new be(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),r.range||(r.range=new be(i.lineNumber,i.column,i.lineNumber,i.column)),r})}})}function uAt(n,e){return kf.register(n,e)}function dAt(n,e){return gR.register(n,e)}function hAt(n,e){return t3.register(n,e)}function fAt(n,e){return wx.register(n,e)}function gAt(n,e){return i3.register(n,e)}function pAt(n,e){return s3.register(n,e)}function mAt(n,e){return Pv.register(n,e)}function _At(n,e,t){return Vm.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,provideCodeActions:(i,s,o,r)=>{let a=ms.markerService.get().read({resource:i.uri}).filter(c=>be.areIntersectingOrTouching(c,s));return e.provideCodeActions(i,s,{markers:a,only:o.only},r)},resolveCodeAction:e.resolveCodeAction})}function vAt(n,e){return zD.register(n,e)}function bAt(n,e){return Ng.register(n,e)}function TAt(n,e){return o3.register(n,e)}function CAt(n,e){return Ix.register(n,e)}function yAt(n,e){return Ag.register(n,e)}function EAt(n,e){return pR.register(n,e)}function SAt(n,e){return Oq.register(n,e)}function wAt(n,e){return n3.register(n,e)}function IAt(n,e){return Y8.register(n,e)}function LAt(n,e){return mR.register(n,e)}function OAt(n,e){return q8.register(n,e)}function RAt(n,e){return Une.register(n,e)}function MAt(n,e){return bC.register(n,e)}function kAt(){return{register:qkt,getLanguages:Jkt,onLanguage:Zkt,getEncodedLanguageId:Qkt,setLanguageConfiguration:eAt,setColorMap:iAt,setTokensProvider:sAt,setMonarchTokensProvider:oAt,registerReferenceProvider:rAt,registerRenameProvider:lAt,registerCompletionItemProvider:yAt,registerSignatureHelpProvider:aAt,registerHoverProvider:cAt,registerDocumentSymbolProvider:uAt,registerDocumentHighlightProvider:dAt,registerLinkedEditingRangeProvider:hAt,registerDefinitionProvider:fAt,registerImplementationProvider:gAt,registerTypeDefinitionProvider:pAt,registerCodeLensProvider:mAt,registerCodeActionProvider:_At,registerDocumentFormattingEditProvider:vAt,registerDocumentRangeFormattingEditProvider:bAt,registerOnTypeFormattingEditProvider:TAt,registerLinkProvider:CAt,registerColorProvider:EAt,registerFoldingRangeProvider:SAt,registerDeclarationProvider:wAt,registerSelectionRangeProvider:IAt,registerDocumentSemanticTokensProvider:LAt,registerDocumentRangeSemanticTokensProvider:OAt,registerInlineCompletionsProvider:RAt,registerInlayHintsProvider:MAt,DocumentHighlightKind:FY,CompletionItemKind:AY,CompletionItemTag:NY,CompletionItemInsertTextRule:kY,SymbolKind:oq,SymbolTag:rq,IndentAction:WY,CompletionTriggerKind:DY,SignatureHelpTriggerKind:sq,InlayHintKind:GY,InlineCompletionTriggerKind:zY,FoldingRangeKind:ip}}class MR{static _handleEolEdits(e,t){let i,s=[];for(let o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=MR._handleEolEdits(e,t);s.length===1&&MR._isFullModelReplaceEdit(e,s[0])?e.executeEdits("formatEditsCommand",s.map(o=>ir.replace(be.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",s.map(o=>ir.replaceMove(be.lift(o.range),o.text))),i&&e.pushUndoStop()}}class K7{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}var rp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function kse(n){if(n=n.filter(s=>s.range),!n.length)return;let{range:e}=n[0];for(let s=1;s<n.length;s++)e=be.plusRange(e,n[s].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?n.length===1?Hl($("hint11","Made 1 formatting edit on line {0}",t)):Hl($("hintn1","Made {0} formatting edits on line {1}",n.length,t)):n.length===1?Hl($("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):Hl($("hintnn","Made {0} formatting edits between lines {1} and {2}",n.length,t,i))}function kRe(n){const e=[],t=new Set,i=zD.ordered(n);for(const o of i)e.push(o),o.extensionId&&t.add(K7.toKey(o.extensionId));const s=Ng.ordered(n);for(const o of s){if(o.extensionId){if(t.has(K7.toKey(o.extensionId)))continue;t.add(K7.toKey(o.extensionId))}e.push({displayName:o.displayName,extensionId:o.extensionId,provideDocumentFormattingEdits(r,a,c){return o.provideDocumentRangeFormattingEdits(r,r.getFullModelRange(),a,c)}})}return e}class aw{static setFormatterSelector(e){return{dispose:aw._selectors.unshift(e)}}static select(e,t,i){return rp(this,void 0,void 0,function*(){if(e.length===0)return;const s=zi.first(aw._selectors);if(s)return yield s(e,t,i)})}}aw._selectors=new Cd;function ARe(n,e,t,i,s,o){return rp(this,void 0,void 0,function*(){const r=n.get(Qi),a=Qm(e)?e.getModel():e,c=Ng.ordered(a),u=yield aw.select(c,a,i);u&&(s.report(u),yield r.invokeFunction(AAt,u,e,t,o))})}function AAt(n,e,t,i,s){return rp(this,void 0,void 0,function*(){const o=n.get(eg);let r,a;Qm(t)?(r=t.getModel(),a=new Qx(t,5,void 0,s)):(r=t,a=new Zie(t,s));let c=[],u=0;for(let _ of qne(i).sort(be.compareRangesUsingStarts))u>0&&be.areIntersectingOrTouching(c[u-1],_)?c[u-1]=be.fromPositions(c[u-1].getStartPosition(),_.getEndPosition()):u=c.push(_);const d=_=>rp(this,void 0,void 0,function*(){return(yield e.provideDocumentRangeFormattingEdits(r,_,r.getFormattingOptions(),a.token))||[]}),f=(_,v)=>{if(!_.length||!v.length)return!1;const C=_.reduce((y,w)=>be.plusRange(y,w.range),_[0].range);if(!v.some(y=>be.intersectRanges(C,y.range)))return!1;for(let y of _)for(let w of v)if(be.intersectRanges(y.range,w.range))return!0;return!1},g=[],p=[];try{for(let _ of c){if(a.token.isCancellationRequested)return!0;p.push(yield d(_))}for(let _=0;_<c.length;++_)for(let v=_+1;v<c.length;++v){if(a.token.isCancellationRequested)return!0;if(f(p[_],p[v])){const C=be.plusRange(c[_],c[v]),y=yield d(C);c.splice(v,1),c.splice(_,1),c.push(C),p.splice(v,1),p.splice(_,1),p.push(y),_=0,v=0}}for(let _ of p){if(a.token.isCancellationRequested)return!0;const v=yield o.computeMoreMinimalEdits(r.uri,_);v&&g.push(...v)}}finally{a.dispose()}if(g.length===0)return!1;if(Qm(t))MR.execute(t,g,!0),kse(g),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:_}]=g,v=new fn(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn);r.pushEditOperations([v],g.map(C=>({text:C.text,range:be.lift(C.range),forceMoveMarkers:!0})),C=>{for(const{range:y}of C)if(be.areIntersectingOrTouching(y,v))return[new fn(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return!0})}function NAt(n,e,t,i,s){return rp(this,void 0,void 0,function*(){const o=n.get(Qi),r=Qm(e)?e.getModel():e,a=kRe(r),c=yield aw.select(a,r,t);c&&(i.report(c),yield o.invokeFunction(DAt,c,e,t,s))})}function DAt(n,e,t,i,s){return rp(this,void 0,void 0,function*(){const o=n.get(eg);let r,a;Qm(t)?(r=t.getModel(),a=new Qx(t,5,void 0,s)):(r=t,a=new Zie(t,s));let c;try{const u=yield e.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(c=yield o.computeMoreMinimalEdits(r.uri,u),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!c||c.length===0)return!1;if(Qm(t))MR.execute(t,c,i!==2),i!==2&&(kse(c),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:u}]=c,d=new fn(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);r.pushEditOperations([d],c.map(f=>({text:f.text,range:be.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(be.areIntersectingOrTouching(g,d))return[new fn(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return!0})}function $At(n,e,t,i,s){return rp(this,void 0,void 0,function*(){const o=Ng.ordered(e);for(const r of o){let a=yield Promise.resolve(r.provideDocumentRangeFormattingEdits(e,t,i,s)).catch(Ol);if(Nu(a))return yield n.computeMoreMinimalEdits(e.uri,a)}})}function xAt(n,e,t,i){return rp(this,void 0,void 0,function*(){const s=kRe(e);for(const o of s){let r=yield Promise.resolve(o.provideDocumentFormattingEdits(e,t,i)).catch(Ol);if(Nu(r))return yield n.computeMoreMinimalEdits(e.uri,r)}})}function NRe(n,e,t,i,s){const o=o3.ordered(e);return o.length===0||o[0].autoFormatTriggerCharacters.indexOf(i)<0?Promise.resolve(void 0):Promise.resolve(o[0].provideOnTypeFormattingEdits(e,t,i,s,Ai.None)).catch(Ol).then(r=>n.computeMoreMinimalEdits(e.uri,r))}ji.registerCommand("_executeFormatRangeProvider",function(n,...e){return rp(this,void 0,void 0,function*(){const[t,i,s]=e;Gs(Jn.isUri(t)),Gs(be.isIRange(i));const o=n.get(Nd),r=n.get(eg),a=yield o.createModelReference(t);try{return $At(r,a.object.textEditorModel,be.lift(i),s,Ai.None)}finally{a.dispose()}})});ji.registerCommand("_executeFormatDocumentProvider",function(n,...e){return rp(this,void 0,void 0,function*(){const[t,i]=e;Gs(Jn.isUri(t));const s=n.get(Nd),o=n.get(eg),r=yield s.createModelReference(t);try{return xAt(o,r.object.textEditorModel,i,Ai.None)}finally{r.dispose()}})});ji.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return rp(this,void 0,void 0,function*(){const[t,i,s,o]=e;Gs(Jn.isUri(t)),Gs(ct.isIPosition(i)),Gs(typeof s=="string");const r=n.get(Nd),a=n.get(eg),c=yield r.createModelReference(t);try{return NRe(a,c.object.textEditorModel,ct.lift(i),s,o)}finally{c.dispose()}})});var j7;pp.wrappingIndent.defaultValue=0;pp.glyphMargin.defaultValue=!1;pp.autoIndent.defaultValue=3;pp.overviewRulerLanes.defaultValue=2;aw.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const vc=FIe();vc.editor=Wkt();vc.languages=kAt();vc.CancellationTokenSource;const hP=vc.Emitter;vc.KeyCode;vc.KeyMod;vc.Position;const A5t=vc.Range;vc.Selection;vc.SelectionDirection;const N5t=vc.MarkerSeverity,D5t=vc.MarkerTag,$5t=vc.Uri;vc.Token;const PAt=vc.editor,Xc=vc.languages;(!((j7=Io.MonacoEnvironment)===null||j7===void 0)&&j7.globalAPI||typeof define=="function"&&define.amd)&&(self.monaco=vc);typeof self.require<"u"&&typeof self.require.config=="function"&&self.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var FAt="4.4.4",iQ;(function(n){n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext"})(iQ||(iQ={}));var sQ;(function(n){n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev"})(sQ||(sQ={}));var oQ;(function(n){n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed"})(oQ||(oQ={}));var fP;(function(n){n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest"})(fP||(fP={}));var rQ;(function(n){n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs"})(rQ||(rQ={}));var DRe=function(){function n(e,t,i,s){this._onDidChange=new hP,this._onDidExtraLibsChange=new hP,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this.setInlayHintsOptions(s),this._onDidExtraLibsChangeTimeout=-1}return Object.defineProperty(n.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDidExtraLibsChange",{get:function(){return this._onDidExtraLibsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"workerOptions",{get:function(){return this._workerOptions},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inlayHintsOptions",{get:function(){return this._inlayHintsOptions},enumerable:!1,configurable:!0}),n.prototype.getExtraLibs=function(){return this._extraLibs},n.prototype.addExtraLib=function(e,t){var i=this,s;if(typeof t>"u"?s="ts:extralib-"+Math.random().toString(36).substring(2,15):s=t,this._extraLibs[s]&&this._extraLibs[s].content===e)return{dispose:function(){}};var o=1;return this._removedExtraLibs[s]&&(o=this._removedExtraLibs[s]+1),this._extraLibs[s]&&(o=this._extraLibs[s].version+1),this._extraLibs[s]={content:e,version:o},this._fireOnDidExtraLibsChangeSoon(),{dispose:function(){var r=i._extraLibs[s];r&&r.version===o&&(delete i._extraLibs[s],i._removedExtraLibs[s]=o,i._fireOnDidExtraLibsChangeSoon())}}},n.prototype.setExtraLibs=function(e){for(var t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(var i=0,s=e;i<s.length;i++){var o=s[i],t=o.filePath||"ts:extralib-"+Math.random().toString(36).substring(2,15),r=o.content,a=1;this._removedExtraLibs[t]&&(a=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:r,version:a}}this._fireOnDidExtraLibsChangeSoon()},n.prototype._fireOnDidExtraLibsChangeSoon=function(){var e=this;this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=setTimeout(function(){e._onDidExtraLibsChangeTimeout=-1,e._onDidExtraLibsChange.fire(void 0)},0))},n.prototype.getCompilerOptions=function(){return this._compilerOptions},n.prototype.setCompilerOptions=function(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)},n.prototype.getDiagnosticsOptions=function(){return this._diagnosticsOptions},n.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)},n.prototype.setWorkerOptions=function(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)},n.prototype.setInlayHintsOptions=function(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)},n.prototype.setMaximumWorkerIdleTime=function(e){},n.prototype.setEagerModelSync=function(e){this._eagerModelSync=e},n.prototype.getEagerModelSync=function(){return this._eagerModelSync},n}(),BAt=FAt,$Re=new DRe({allowNonTsExtensions:!0,target:fP.Latest},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{}),xRe=new DRe({allowNonTsExtensions:!0,allowJs:!0,target:fP.Latest},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{}),HAt=function(){return z6().then(function(n){return n.getTypeScriptWorker()})},VAt=function(){return z6().then(function(n){return n.getJavaScriptWorker()})};Xc.typescript={ModuleKind:iQ,JsxEmit:sQ,NewLineKind:oQ,ScriptTarget:fP,ModuleResolutionKind:rQ,typescriptVersion:BAt,typescriptDefaults:$Re,javascriptDefaults:xRe,getTypeScriptWorker:HAt,getJavaScriptWorker:VAt};function z6(){return On(()=>import("./tsMode-T1dBs3Uq.js"),[])}Xc.onLanguage("typescript",function(){return z6().then(function(n){return n.setupTypeScript($Re)})});Xc.onLanguage("javascript",function(){return z6().then(function(n){return n.setupJavaScript(xRe)})});var Ase=function(){function n(e,t,i){this._onDidChange=new hP,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(n.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"diagnosticsOptions",{get:function(){return this.options},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),n.prototype.setOptions=function(e){this._options=e||Object.create(null),this._onDidChange.fire(this)},n.prototype.setDiagnosticsOptions=function(e){this.setOptions(e)},n.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},n}(),Nse={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0}},Dse={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},PRe=new Ase("css",Nse,Dse),FRe=new Ase("scss",Nse,Dse),BRe=new Ase("less",Nse,Dse);Xc.css={cssDefaults:PRe,lessDefaults:BRe,scssDefaults:FRe};function $se(){return On(()=>import("./cssMode-WC5hNyb9.js"),[])}Xc.onLanguage("less",function(){$se().then(function(n){return n.setupMode(BRe)})});Xc.onLanguage("scss",function(){$se().then(function(n){return n.setupMode(FRe)})});Xc.onLanguage("css",function(){$se().then(function(n){return n.setupMode(PRe)})});var UAt=function(){function n(e,t,i){this._onDidChange=new hP,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(n.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!1,configurable:!0}),n.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},n.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},n}(),WAt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},GAt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},HRe=new UAt("json",WAt,GAt);Xc.json={jsonDefaults:HRe};function zAt(){return On(()=>import("./jsonMode-Bggw9BW1.js"),[])}Xc.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Xc.onLanguage("json",function(){zAt().then(function(n){return n.setupMode(HRe)})});var KAt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},jAt=function(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(u){return function(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(o=u[0]&2?s.return:u[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,u[1])).done)return o;switch(s=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(d){u=[6,d],s=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},XAt=function(){function n(e,t,i){this._onDidChange=new hP,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(n.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),n.prototype.setOptions=function(e){this._options=e||Object.create(null),this._onDidChange.fire(this)},n.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},n}(),YAt={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:null,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},K6={format:YAt,suggest:{},data:{useDefaultDataProvider:!0}};function j6(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===m$,documentFormattingEdits:n===m$,documentRangeFormattingEdits:n===m$}}var m$="html",Cpe="handlebars",ype="razor",VRe=X6(m$,K6,j6(m$)),qAt=VRe.defaults,URe=X6(Cpe,K6,j6(Cpe)),JAt=URe.defaults,WRe=X6(ype,K6,j6(ype)),QAt=WRe.defaults;Xc.html={htmlDefaults:qAt,razorDefaults:QAt,handlebarDefaults:JAt,htmlLanguageService:VRe,handlebarLanguageService:URe,razorLanguageService:WRe,registerHTMLLanguageService:X6};function ZAt(){return On(()=>import("./htmlMode-C-DxRcIA.js"),[])}function X6(n,e,t){var i=this;e===void 0&&(e=K6),t===void 0&&(t=j6(n));var s=new XAt(n,e,t),o,r=Xc.onLanguage(n,function(){return KAt(i,void 0,void 0,function(){return jAt(this,function(a){switch(a.label){case 0:return[4,ZAt()];case 1:return o=a.sent().setupMode(s),[2]}})})});return{defaults:s,dispose:function(){r.dispose(),o==null||o.dispose(),o=void 0}}}var GRe={},X7={},eNt=function(){function n(e){var t=this;this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise(function(i,s){t._lazyLoadPromiseResolve=i,t._lazyLoadPromiseReject=s})}return n.getOrCreate=function(e){return X7[e]||(X7[e]=new n(e)),X7[e]},n.prototype.whenLoaded=function(){return this._lazyLoadPromise},n.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,GRe[this._languageId].loader().then(function(t){return e._lazyLoadPromiseResolve(t)},function(t){return e._lazyLoadPromiseReject(t)})),this._lazyLoadPromise},n}();function xn(n){var e=n.id;GRe[e]=n,Xc.register(n);var t=eNt.getOrCreate(e);Xc.setMonarchTokensProvider(e,t.whenLoaded().then(function(i){return i.language})),Xc.onLanguage(e,function(){t.load().then(function(i){Xc.setLanguageConfiguration(e,i.conf)})})}xn({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:function(){return On(()=>import("./abap-CRCWOmpq.js"),[])}});xn({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:function(){return On(()=>import("./apex-BL_CmIl-.js"),[])}});xn({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:function(){return On(()=>import("./azcli-1IWB1ccx.js"),[])}});xn({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:function(){return On(()=>import("./bat-DPkNLes8.js"),[])}});xn({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:function(){return On(()=>import("./bicep-DLNwh9K6.js"),[])}});xn({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:function(){return On(()=>import("./cameligo-CGrWLZr3.js"),[])}});xn({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:function(){return On(()=>import("./clojure-D9WOWImG.js"),[])}});xn({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:function(){return On(()=>import("./coffee-B7EJu28W.js"),[])}});xn({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:function(){return On(()=>import("./cpp-RmZVvII3.js"),[])}});xn({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:function(){return On(()=>import("./cpp-RmZVvII3.js"),[])}});xn({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:function(){return On(()=>import("./csharp-BoL64M5l.js"),[])}});xn({id:"csp",extensions:[],aliases:["CSP","csp"],loader:function(){return On(()=>import("./csp-C46ZqvIl.js"),[])}});xn({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:function(){return On(()=>import("./css-yEtxmcUf.js"),[])}});xn({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:function(){return On(()=>import("./dart-D8lhlL1r.js"),[])}});xn({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:function(){return On(()=>import("./dockerfile-DLk6rpji.js"),[])}});xn({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:function(){return On(()=>import("./ecl-BO6FnfXk.js"),[])}});xn({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:function(){return On(()=>import("./elixir-B9GXSzSz.js"),[])}});xn({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:function(){return On(()=>import("./flow9-Cac8vKd7.js"),[])}});xn({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:function(){return On(()=>import("./fsharp-fd1GTHhf.js"),[])}});xn({id:"go",extensions:[".go"],aliases:["Go"],loader:function(){return On(()=>import("./go-O9LJTZXk.js"),[])}});xn({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:function(){return On(()=>import("./graphql-LQdxqEYJ.js"),[])}});xn({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:function(){return On(()=>import("./handlebars-4enu9dET.js"),[])}});xn({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:function(){return On(()=>import("./hcl-DxDQ3s82.js"),[])}});xn({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:function(){return On(()=>import("./html-C9XX48eS.js"),[])}});xn({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:function(){return On(()=>import("./ini-BvajGCUy.js"),[])}});xn({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:function(){return On(()=>import("./java-SYsfObOQ.js"),[])}});xn({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return On(()=>import("./javascript-CbvoP-qD.js"),__vite__mapDeps([0,1]))}});xn({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:function(){return On(()=>import("./julia-DQXNmw_w.js"),[])}});xn({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:function(){return On(()=>import("./kotlin-qQ0MG-9I.js"),[])}});xn({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:function(){return On(()=>import("./less-B86-qBTk.js"),[])}});xn({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:function(){return On(()=>import("./lexon-Canl7DCW.js"),[])}});xn({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:function(){return On(()=>import("./lua-D28Ae8-K.js"),[])}});xn({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:function(){return On(()=>import("./liquid-CkR3RZ3g.js"),[])}});xn({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:function(){return On(()=>import("./m3-DPitgjJI.js"),[])}});xn({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:function(){return On(()=>import("./markdown-XFFkuszK.js"),[])}});xn({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:function(){return On(()=>import("./mips-CdjsipkG.js"),[])}});xn({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:function(){return On(()=>import("./msdax-CYqgjx_P.js"),[])}});xn({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:function(){return On(()=>import("./mysql-uE-sL1AK.js"),[])}});xn({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:function(){return On(()=>import("./objective-c-B1aVtJYH.js"),[])}});xn({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:function(){return On(()=>import("./pascal-BhNW15KB.js"),[])}});xn({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:function(){return On(()=>import("./pascaligo-5jv8CcQD.js"),[])}});xn({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:function(){return On(()=>import("./perl-DlYyT36c.js"),[])}});xn({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:function(){return On(()=>import("./pgsql-DYSgOGm2.js"),[])}});xn({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:function(){return On(()=>import("./php-120yhfDK.js"),[])}});xn({id:"pla",extensions:[".pla"],loader:function(){return On(()=>import("./pla-CjnFlu4u.js"),[])}});xn({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:function(){return On(()=>import("./postiats-CQpG440k.js"),[])}});xn({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:function(){return On(()=>import("./powerquery-DdJtto1Z.js"),[])}});xn({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:function(){return On(()=>import("./powershell-Bu_VLpJB.js"),[])}});xn({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:function(){return On(()=>import("./protobuf-UZVfc1EA.js"),[])}});xn({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:function(){return On(()=>import("./pug-kFxLfcjb.js"),[])}});xn({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:function(){return On(()=>import("./python-D_-KHpbv.js"),[])}});xn({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:function(){return On(()=>import("./qsharp-BhgV_cYv.js"),[])}});xn({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:function(){return On(()=>import("./r-BIFz-_sK.js"),[])}});xn({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:function(){return On(()=>import("./razor-Csq26Iiw.js"),[])}});xn({id:"redis",extensions:[".redis"],aliases:["redis"],loader:function(){return On(()=>import("./redis-CHOsPHWR.js"),[])}});xn({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:function(){return On(()=>import("./redshift-w2XKkDvD.js"),[])}});xn({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:function(){return On(()=>import("./restructuredtext-CghPJEOS.js"),[])}});xn({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:function(){return On(()=>import("./ruby-CYWGW-b1.js"),[])}});xn({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:function(){return On(()=>import("./rust-DMDD0SHb.js"),[])}});xn({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:function(){return On(()=>import("./sb-BYAiYHFx.js"),[])}});xn({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:function(){return On(()=>import("./scala-Bqvq8jcR.js"),[])}});xn({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:function(){return On(()=>import("./scheme-Dhb-2j9p.js"),[])}});xn({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:function(){return On(()=>import("./scss-CdQcnAnq.js"),[])}});xn({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:function(){return On(()=>import("./shell-CmmbcNmB.js"),[])}});xn({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:function(){return On(()=>import("./solidity-CME5AdoB.js"),[])}});xn({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:function(){return On(()=>import("./sophia-RYC1BQQz.js"),[])}});xn({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:function(){return On(()=>import("./sparql-KEyrF7De.js"),[])}});xn({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:function(){return On(()=>import("./sql-BdTr02Mf.js"),[])}});xn({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:function(){return On(()=>import("./st-C8kzSboH.js"),[])}});xn({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:function(){return On(()=>import("./swift-vE6e-x0J.js"),[])}});xn({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:function(){return On(()=>import("./systemverilog-DgMryOEJ.js"),[])}});xn({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:function(){return On(()=>import("./systemverilog-DgMryOEJ.js"),[])}});xn({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:function(){return On(()=>import("./tcl-PloMZuKG.js"),[])}});xn({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:function(){return On(()=>import("./twig-bne2BnKZ.js"),[])}});xn({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:function(){return On(()=>import("./typescript-BaxiLt3b.js"),[])}});xn({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:function(){return On(()=>import("./vb-BwAE3J76.js"),[])}});xn({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:function(){return On(()=>import("./xml-qcY82du4.js"),[])}});xn({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:function(){return On(()=>import("./yaml-A89blxgn.js"),[])}});var tNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nNt=function(n,e){return function(t,i){e(t,i,n)}},Y6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const q6=new Sn("selectionAnchorSet",!1);let _b=class zRe{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=q6.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}static get(e){return e.getContribution(zRe.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition(),t=this.decorationId?[this.decorationId]:[],i=this.editor.deltaDecorations(t,[{range:fn.fromPositions(e,e),options:{description:"selection-anchor",stickiness:1,hoverMessage:new mb().appendText($("selectionAnchor","Selection Anchor")),className:"selection-anchor"}}]);this.decorationId=i[0],this.selectionAnchorSetContextKey.set(!!this.decorationId),Hl($("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(fn.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){this.decorationId&&(this.editor.deltaDecorations([this.decorationId],[]),this.decorationId=void 0,this.selectionAnchorSetContextKey.set(!1))}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};_b.ID="editor.contrib.selectionAnchorController";_b=tNt([nNt(1,ai)],_b);class iNt extends yn{constructor(){super({id:"editor.action.setSelectionAnchor",label:$("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2080),weight:100}})}run(e,t){return Y6(this,void 0,void 0,function*(){_b.get(t).setSelectionAnchor()})}}class sNt extends yn{constructor(){super({id:"editor.action.goToSelectionAnchor",label:$("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:q6})}run(e,t){return Y6(this,void 0,void 0,function*(){_b.get(t).goToSelectionAnchor()})}}class oNt extends yn{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:$("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:q6,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2089),weight:100}})}run(e,t){return Y6(this,void 0,void 0,function*(){_b.get(t).selectFromAnchorToCursor()})}}class rNt extends yn{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:$("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:q6,kbOpts:{kbExpr:We.editorTextFocus,primary:9,weight:100}})}run(e,t){return Y6(this,void 0,void 0,function*(){_b.get(t).cancelSelectionAnchor()})}}_s(_b.ID,_b);qt(iNt);qt(sNt);qt(oNt);qt(rNt);const lNt=Ze("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},$("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class aNt extends yn{constructor(){super({id:"editor.action.jumpToBracket",label:$("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:3160,weight:100}})}run(e,t){let i=Xg.get(t);i&&i.jumpToBracket()}}class cNt extends yn{constructor(){super({id:"editor.action.selectToBracket",label:$("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){const s=Xg.get(t);if(!s)return;let o=!0;i&&i.selectBrackets===!1&&(o=!1),s.selectToBracket(o)}}class uNt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Xg extends wt{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new ho(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(63),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(63)&&(this._matchBrackets=this._editor.getOption(63),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}static get(e){return e.getContribution(Xg.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.findEnclosingBrackets(s);if(a)r=a[0].getStartPosition();else{const c=e.findNextBracket(s);c&&c.range&&(r=c.range.getStartPosition())}}return r?new fn(r.lineNumber,r.column,r.lineNumber,r.column):new fn(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.matchBracket(o);if(!r&&(r=t.findEnclosingBrackets(o),!r)){const u=t.findNextBracket(o);u&&u.range&&(r=t.matchBracket(u.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(be.compareRangesUsingStarts);const[u,d]=r;if(a=e?u.getStartPosition():u.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const f=a;a=c,c=f}}a&&c&&i.push(new fn(a.lineNumber,a.column,c.lineNumber,c.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();let e=[],t=0;for(const i of this._lastBracketsData){let s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);let o=[],r=0;for(let f=0,g=e.length;f<g;f++){let p=e[f];p.isEmpty()&&(o[r++]=p.getStartPosition())}o.length>1&&o.sort(ct.compare);let a=[],c=0,u=0,d=s.length;for(let f=0,g=o.length;f<g;f++){let p=o[f];for(;u<d&&s[u].position.isBefore(p);)u++;if(u<d&&s[u].position.equals(p))a[c++]=s[u];else{let _=t.matchBracket(p),v=Xg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.findEnclosingBrackets(p,20),v=Xg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new uNt(p,_,v)}}this._lastBracketsData=a,this._lastVersionId=i}}Xg.ID="editor.contrib.bracketMatchingController";Xg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ci.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:sr(lNt),position:Ad.Center}});Xg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ci.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});_s(Xg.ID,Xg);qt(cNt);qt(aNt);ws((n,e)=>{const t=n.getColor(rwt);t&&e.addRule(`.monaco-editor .bracket-match { background-color: ${t}; }`);const i=n.getColor(J1e);i&&e.addRule(`.monaco-editor .bracket-match { border: 1px solid ${i}; }`)});Th.appendMenuItem(wn.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:$({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class dNt{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,s=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&s===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new be(i,s-1,i,s),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new be(i,o,i,o),a)}else{const r=new be(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new be(i,s,i,s),a)}}computeCursorState(e,t){return this._isMovingLeft?new fn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new fn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class KRe extends yn{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],s=t.getSelections();for(const o of s)i.push(new dNt(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class hNt extends KRe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:$("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:We.writable})}}class fNt extends KRe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:$("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:We.writable})}}qt(hNt);qt(fNt);class gNt extends yn{constructor(){super({id:"editor.action.transposeLetters",label:$("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),s=[],o=t.getSelections();for(let r of o){if(!r.isEmpty())continue;let a=r.startLineNumber,c=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(c===1||c===2&&u===2))continue;let d=c===u?r.getPosition():ts.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=ts.leftPosition(i,d),g=ts.leftPosition(i,f),p=i.getValueInRange(be.fromPositions(g,f)),_=i.getValueInRange(be.fromPositions(f,d)),v=be.fromPositions(g,d);s.push(new Dl(v,_+p))}s.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}qt(gNt);var pNt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const cw="9_cutcopypaste",mNt=Ug||document.queryCommandSupported("cut"),jRe=Ug||document.queryCommandSupported("copy"),_Nt=typeof navigator.clipboard>"u"||ac?document.queryCommandSupported("paste"):!0;function xse(n){return n.register(),n}const vNt=mNt?xse(new mM({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ug?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:wn.MenubarEditMenu,group:"2_ccp",title:$({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:wn.EditorContext,group:cw,title:$("actions.clipboard.cutLabel","Cut"),when:We.writable,order:1},{menuId:wn.CommandPalette,group:"",title:$("actions.clipboard.cutLabel","Cut"),order:1},{menuId:wn.SimpleEditorContext,group:cw,title:$("actions.clipboard.cutLabel","Cut"),when:We.writable,order:1}]})):void 0,bNt=jRe?xse(new mM({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ug?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:wn.MenubarEditMenu,group:"2_ccp",title:$({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:wn.EditorContext,group:cw,title:$("actions.clipboard.copyLabel","Copy"),order:2},{menuId:wn.CommandPalette,group:"",title:$("actions.clipboard.copyLabel","Copy"),order:1},{menuId:wn.SimpleEditorContext,group:cw,title:$("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Th.appendMenuItem(wn.MenubarEditMenu,{submenu:wn.MenubarCopy,title:{value:$("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Th.appendMenuItem(wn.EditorContext,{submenu:wn.EditorContextCopy,title:{value:$("copy as","Copy As"),original:"Copy As"},group:cw,order:3});const Y7=_Nt?xse(new mM({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ug?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:wn.MenubarEditMenu,group:"2_ccp",title:$({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:wn.EditorContext,group:cw,title:$("actions.clipboard.pasteLabel","Paste"),when:We.writable,order:4},{menuId:wn.CommandPalette,group:"",title:$("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:wn.SimpleEditorContext,group:cw,title:$("actions.clipboard.pasteLabel","Paste"),when:We.writable,order:4}]})):void 0;class TNt extends yn{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:$("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(32)&&t.getSelection().isEmpty()||(rJ.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),rJ.forceCopyWithSyntaxHighlighting=!1)}}function XRe(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(hs).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(32),r=s.getSelection();return r&&r.isEmpty()&&!o||document.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(document.execCommand(e),!0)))}XRe(vNt,"cut");XRe(bNt,"copy");Y7&&(Y7.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(hs),i=n.get(Uy),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?!document.execCommand("paste")&&hM?pNt(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=Vx.INSTANCE.get(r);let c=!1,u=null,d=null;a&&(c=s.getOption(32)&&!!a.isFromEmptySelection,u=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),s.trigger("keyboard","paste",{text:r,pasteOnNewLine:c,multicursorText:u,mode:d})}}):!0:!1}),Y7.addImplementation(0,"generic-dom",(n,e)=>(document.execCommand("paste"),!0)));jRe&&qt(TNt);class u5{constructor(e){this.executor=e,this._didRun=!1}getValue(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}class $i{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+$i.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new $i(this.value+$i.sep+e)}}$i.sep=".";$i.None=new $i("@@none@@");$i.Empty=new $i("");$i.QuickFix=new $i("quickfix");$i.Refactor=new $i("refactor");$i.Source=new $i("source");$i.SourceOrganizeImports=$i.Source.append("organizeImports");$i.SourceFixAll=$i.Source.append("fixAll");function CNt(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>YRe(e,t,n.include))||!n.includeSourceActions&&$i.Source.contains(e))}function yNt(n,e){const t=e.kind?new $i(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>YRe(t,i,n.include))||!n.includeSourceActions&&t&&$i.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function YRe(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Sm{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return!e||typeof e!="object"?new Sm(t.kind,t.apply,!1):new Sm(Sm.getKindFromUser(e,t.kind),Sm.getApplyFromUser(e,t.apply),Sm.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new $i(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}}var Pse=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const qRe="editor.action.codeAction",JRe="editor.action.refactor",QRe="editor.action.sourceAction",Fse="editor.action.organizeImports",Bse="editor.action.fixAll";class ZRe{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return Pse(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(s){Ol(s)}i&&(this.action.edit=i.edit)}return this})}}class Hse extends wt{constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Hse.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}static codeActionsComparator({action:e},{action:t}){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:Nu(e.diagnostics)?Nu(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:Nu(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&$i.QuickFix.contains(new $i(e.kind))&&!!e.isPreferred)}}const Epe={actions:[],documentation:void 0};function Vse(n,e,t,i,s){var o;const r=t.filter||{},a={only:(o=r.include)===null||o===void 0?void 0:o.value,trigger:t.type},c=new Zie(n,s),u=ENt(n,r),d=new Wt,f=u.map(p=>Pse(this,void 0,void 0,function*(){try{i.report(p);const _=yield p.provideCodeActions(n,e,a,c.token);if(_&&d.add(_),c.token.isCancellationRequested)return Epe;const v=((_==null?void 0:_.actions)||[]).filter(y=>y&&yNt(r,y)),C=SNt(p,v,r.include);return{actions:v.map(y=>new ZRe(y,p)),documentation:C}}catch(_){if(d_(_))throw _;return Ol(_),Epe}})),g=Vm.onDidChange(()=>{const p=Vm.all(n);xf(p,u)||c.cancel()});return Promise.all(f).then(p=>{const _=Yne(p.map(C=>C.actions)),v=Bw(p.map(C=>C.documentation));return new Hse(_,v,d)}).finally(()=>{g.dispose(),c.dispose()})}function ENt(n,e){return Vm.all(n).filter(t=>t.providedCodeActionKinds?t.providedCodeActionKinds.some(i=>CNt(e,new $i(i))):!0)}function SNt(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new $i(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new $i(s.kind)))return o.command}}ji.registerCommand("_executeCodeActionProvider",function(n,e,t,i,s){return Pse(this,void 0,void 0,function*(){if(!(e instanceof Jn))throw Wg();const o=n.get(Xr).getModel(e);if(!o)throw Wg();const r=fn.isISelection(t)?fn.liftSelection(t):be.isIRange(t)?o.validateRange(t):void 0;if(!r)throw Wg();const a=typeof i=="string"?new $i(i):void 0,c=yield Vse(o,r,{type:1,filter:{includeSourceActions:!0,include:a}},zw.None,Ai.None),u=[],d=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let f=0;f<d;f++)u.push(c.validActions[f].resolve(Ai.None));try{return yield Promise.all(u),c.validActions.map(f=>f.action)}finally{setTimeout(()=>c.dispose(),100)}})});var wNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},INt=function(n,e){return function(t,i){e(t,i,n)}};let Pd=class lQ{constructor(e,t){this._messageWidget=new pc,this._messageListeners=new Wt,this._editor=e,this._visible=lQ.MESSAGE_VISIBLE.bindTo(t),this._editorListener=this._editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit())}static get(e){return e.getContribution(lQ.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Hl(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new Spe(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new mc(()=>this.closeMessage(),3e3));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new be(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Spe.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage($("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())}};Pd.ID="editor.contrib.messageController";Pd.MESSAGE_VISIBLE=new Sn("messageVisible",!1,$("messageVisible","Whether the editor is currently showing an inline message"));Pd=wNt([INt(1,ai)],Pd);const LNt=jl.bindToContribution(Pd.get);Xt(new LNt({id:"leaveEditorMessage",precondition:Pd.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:130,primary:9}}));let Spe=class{constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");r.classList.add("message"),r.textContent=s,this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const i=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",i)};return t=setTimeout(i,110),e.getDomNode().addEventListener("animationend",i),e.getDomNode().classList.add("fadeOut"),{dispose:i}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};_s(Pd.ID,Pd);ws((n,e)=>{const t=n.getColor(Oie);if(t){let o=n.type===bh.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.below { border-top-color: ${t}; }`),e.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.top { border-bottom-color: ${t}; }`),e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${o}px solid ${t}; }`)}const i=n.getColor(Iie);i&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${i}; }`);const s=n.getColor(Lie);s&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${s}; }`)});var ONt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wpe=function(n,e){return function(t,i){e(t,i,n)}},RNt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class Ipe extends Pf{constructor(e,t){super(e.command?e.command.id:e.title,MNt(e.title),void 0,!e.disabled,t),this.action=e}}function MNt(n){return n.replace(/\r\n|\r|\n/g," ")}let aQ=class extends wt{constructor(e,t,i,s){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._visible=!1,this._showingActions=this._register(new pc),this._keybindingResolver=new J6({getKeybindings:()=>s.getKeybindings()})}get isVisible(){return this._visible}show(e,t,i,s){return RNt(this,void 0,void 0,function*(){const o=s.includeDisabledActions?t.allActions:t.validActions;if(!o.length){this._visible=!1;return}if(!this._editor.getDomNode())throw this._visible=!1,gM();this._visible=!0,this._showingActions.value=t;const r=this.getMenuActions(e,o,t.documentation),a=ct.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},c=this._keybindingResolver.getResolver(),u=this._editor.getOption(113);this._contextMenuService.showContextMenu({domForShadowRoot:u?this._editor.getDomNode():void 0,getAnchor:()=>a,getActions:()=>r,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:d=>d instanceof Ipe?c(d.action):void 0})})}getMenuActions(e,t,i){var s,o;const r=d=>new Ipe(d.action,()=>this._delegate.onSelectCodeAction(d)),a=t.map(r),c=[...i],u=this._editor.getModel();if(u&&a.length)for(const d of Vm.all(u))d._getAdditionalMenuItems&&c.push(...d._getAdditionalMenuItems({trigger:e.type,only:(o=(s=e.filter)===null||s===void 0?void 0:s.include)===null||o===void 0?void 0:o.value},t.map(f=>f.action)));return c.length&&a.push(new Ff,...c.map(d=>r(new ZRe({title:d.title,command:d},void 0)))),a}_toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Bl(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}};aQ=ONt([wpe(2,Vy),wpe(3,Ro)],aQ);class J6{constructor(e){this._keybindingProvider=e}getResolver(){const e=new u5(()=>this._keybindingProvider.getKeybindings().filter(t=>J6.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Fse?i={kind:$i.SourceOrganizeImports.value}:t.command===Bse&&(i={kind:$i.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Sm.fromUser(i,{kind:$i.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.getValue());return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new $i(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}}J6.codeActionCommands=[JRe,qRe,QRe,Fse,Bse];var kNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ANt=function(n,e){return function(t,i){e(t,i,n)}},_$;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(_$||(_$={}));let d5=class eMe extends wt{constructor(e,t,i,s){super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=i,this._keybindingService=s,this._onClick=this._register(new rt),this.onClick=this._onClick.event,this._state=_$.Hidden,this._domNode=document.createElement("div"),this._domNode.className=vn.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(o=>{const r=this._editor.getModel();(this.state.type!==1||!r||this.state.editorPosition.lineNumber>=r.getLineCount())&&this.hide()})),Ds.ignoreTarget(this._domNode),this._register(Avt(this._domNode,o=>{if(this.state.type!==1)return;this._editor.focus(),o.preventDefault();const{top:r,height:a}=Bl(this._domNode),c=this._editor.getOption(58);let u=Math.floor(c/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(u+=c),this._onClick.fire({x:o.posx,y:r+a+u,actions:this.state.actions,trigger:this.state.trigger})})),this._register(Pt(this._domNode,"mouseenter",o=>{if((o.buttons&1)!==1)return;this.hide();const r=new Ww;r.startMonitoring(o.target,o.buttons,_M,()=>{},()=>{r.dispose()})})),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(56)&&!this._editor.getOption(56).enabled&&this.hide()})),this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const s=this._editor.getOptions();if(!s.get(56).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),c=o.getOptions().tabSize,u=s.get(43),d=o.getLineContent(r),f=xd.computeIndentLevel(d,c),g=u.spaceWidth*f>22,p=v=>v>2&&this._editor.getTopForLineNumber(v)===this._editor.getTopForLineNumber(v-1);let _=r;if(!g){if(r>1&&!p(r-1))_-=1;else if(!p(r+1))_+=1;else if(a*u.spaceWidth<22)return this.hide()}this.state=new _$.Showing(e,t,i,{position:{lineNumber:_,column:1},preference:eMe._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=_$.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix){this._domNode.classList.remove(...vn.lightBulb.classNamesArray),this._domNode.classList.add(...vn.lightbulbAutofix.classNamesArray);const t=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(t){this.title=$("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",t.getLabel());return}}this._domNode.classList.remove(...vn.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...vn.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);e?this.title=$("codeActionWithKb","Show Code Actions ({0})",e.getLabel()):this.title=$("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};d5._posPref=[0];d5=kNt([ANt(3,Ro)],d5);ws((n,e)=>{var t;const i=(t=n.getColor(Ch))===null||t===void 0?void 0:t.transparent(.7),s=n.getColor(o0t);s&&e.addRule(`
- .monaco-editor .contentWidgets ${vn.lightBulb.cssSelector} {
- color: ${s};
- background-color: ${i};
- }`);const o=n.getColor(r0t);o&&e.addRule(`
- .monaco-editor .contentWidgets ${vn.lightbulbAutofix.cssSelector} {
- color: ${o};
- background-color: ${i};
- }`)});var NNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DNt=function(n,e){return function(t,i){e(t,i,n)}},q7=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},$Nt=function(n,e,t,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},xNt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},b4;let cQ=class extends wt{constructor(e,t,i,s,o){super(),this._editor=e,this.delegate=s,this._activeCodeActions=this._register(new pc),b4.set(this,!1),this._codeActionWidget=new u5(()=>this._register(o.createInstance(aQ,this._editor,{onSelectCodeAction:r=>q7(this,void 0,void 0,function*(){this.delegate.applyCodeAction(r,!0)})}))),this._lightBulbWidget=new u5(()=>{const r=this._register(o.createInstance(d5,this._editor,t,i));return this._register(r.onClick(a=>this.showCodeActionList(a.trigger,a.actions,a,{includeDisabledActions:!1}))),r})}dispose(){$Nt(this,b4,!0,"f"),super.dispose()}update(e){var t,i,s;return q7(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let o;try{o=yield e.actions}catch(r){di(r);return}if(!xNt(this,b4,"f"))if(this._lightBulbWidget.getValue().update(o,e.trigger,e.position),e.trigger.type===1){if(!((i=e.trigger.filter)===null||i===void 0)&&i.include){const a=this.tryGetValidActionToApply(e.trigger,o);if(a){try{this._lightBulbWidget.getValue().hide(),yield this.delegate.applyCodeAction(a,!1)}finally{o.dispose()}return}if(e.trigger.context){const c=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,o);if(c&&c.action.disabled){Pd.get(this._editor).showMessage(c.action.disabled,e.trigger.context.position),o.dispose();return}}}const r=!!(!((s=e.trigger.filter)===null||s===void 0)&&s.include);if(e.trigger.context&&(!o.allActions.length||!r&&!o.validActions.length)){Pd.get(this._editor).showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=o,o.dispose();return}this._activeCodeActions.value=o,this._codeActionWidget.getValue().show(e.trigger,o,e.position,{includeDisabledActions:r})}else this._codeActionWidget.getValue().isVisible?o.dispose():this._activeCodeActions.value=o})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i,s){return q7(this,void 0,void 0,function*(){this._codeActionWidget.getValue().show(e,t,i,s)})}};b4=new WeakMap;cQ=NNt([DNt(4,Qi)],cQ);var J7=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},PNt=function(n,e,t,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},A1;const tMe=new Sn("supportedCodeAction","");class FNt extends wt{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new mc),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._onCursorChange()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>cLe(i,t.uri))&&this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2})},this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2})},this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const i of this._markerService.read({resource:t.uri})){const s=t.validateRange(i);if(be.intersectRanges(s,e))return be.lift(s)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:s,column:o}=i.getPosition(),r=t.getLineContent(s);if(r.length===0)return;if(o===1){if(/\s/.test(r[0]))return}else if(o===t.getLineMaxColumn(s)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[o-2])&&/\s/.test(r[o-1]))return}return i}_createEventAndSignalChange(e,t){const i=this._editor.getModel();if(!t||!i){this._signalChange(void 0);return}const s=this._getRangeOfMarker(t),o=s?s.getStartPosition():t.getStartPosition(),r={trigger:e,selection:t,position:o};return this._signalChange(r),r}}var $S;(function(n){n.Empty={type:0};class e{constructor(i,s,o,r){this.trigger=i,this.rangeOrSelection=s,this.position=o,this._cancellablePromise=r,this.type=1,this.actions=r.catch(a=>{if(d_(a))return BNt;throw a})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})($S||($S={}));const BNt={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class HNt extends wt{constructor(e,t,i,s){super(),this._editor=e,this._markerService=t,this._progressService=s,this._codeActionOracle=this._register(new pc),this._state=$S.Empty,this._onDidChangeState=this._register(new rt),this.onDidChangeState=this._onDidChangeState.event,A1.set(this,!1),this._supportedCodeActions=tMe.bindTo(i),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(Vm.onDidChange(()=>this._update())),this._update()}dispose(){J7(this,A1,"f")||(PNt(this,A1,!0,"f"),super.dispose(),this.setState($S.Empty,!0))}_update(){if(J7(this,A1,"f"))return;this._codeActionOracle.value=void 0,this.setState($S.Empty);const e=this._editor.getModel();if(e&&Vm.has(e)&&!this._editor.getOption(80)){const t=[];for(const i of Vm.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new FNt(this._editor,this._markerService,i=>{var s;if(!i){this.setState($S.Empty);return}const o=ul(r=>Vse(e,i.selection,i.trigger,zw.None,r));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(o,250)),this.setState(new $S.Triggered(i.trigger,i.selection,i.position,o))},void 0),this._codeActionOracle.value.trigger({type:2})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value&&this._codeActionOracle.value.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!J7(this,A1,"f")&&this._onDidChangeState.fire(e))}}A1=new WeakMap;var VNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},EV=function(n,e){return function(t,i){e(t,i,n)}},nMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function BF(n){return dn.regex(tMe.keys()[0],new RegExp("(\\s|^)"+jf(n.value)+"\\b"))}const Use={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:$("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:$("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[$("args.schema.apply.first","Always apply the first returned code action."),$("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),$("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:$("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};let uw=class iMe extends wt{constructor(e,t,i,s,o){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new HNt(this._editor,t,i,s)),this._register(this._model.onDidChangeState(r=>this.update(r))),this._ui=new u5(()=>this._register(new cQ(e,yM.Id,HF.Id,{applyCodeAction:(r,a)=>nMe(this,void 0,void 0,function*(){try{yield this._applyCodeAction(r)}finally{a&&this._trigger({type:2,filter:{}})}})},this._instantiationService)))}static get(e){return e.getContribution(iMe.ID)}update(e){this._ui.getValue().update(e)}showCodeActions(e,t,i){return this._ui.getValue().showCodeActionList(e,t,i,{includeDisabledActions:!1})}manualTriggerAtCurrentPosition(e,t,i){if(!this._editor.hasModel())return;Pd.get(this._editor).closeMessage();const s=this._editor.getPosition();this._trigger({type:1,filter:t,autoApply:i,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e){return this._instantiationService.invokeFunction(UNt,e,this._editor)}};uw.ID="editor.contrib.quickFixController";uw=VNt([EV(1,PF),EV(2,ai),EV(3,Mb),EV(4,Qi)],uw);function UNt(n,e,t){return nMe(this,void 0,void 0,function*(){const i=n.get(tie),s=n.get(vr),o=n.get(By),r=n.get(Hr);if(o.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred}),yield e.resolve(Ai.None),e.action.edit&&(yield i.apply(s6.convert(e.action.edit),{editor:t,label:e.action.title})),e.action.command)try{yield s.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(a){const c=WNt(a);r.error(typeof c=="string"?c:$("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function WNt(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}function Jw(n,e,t,i){if(n.hasModel()){const s=uw.get(n);s&&s.manualTriggerAtCurrentPosition(e,t,i)}}class yM extends yn{constructor(){super({id:yM.Id,label:$("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:dn.and(We.writable,We.hasCodeActionsProvider),kbOpts:{kbExpr:We.editorTextFocus,primary:2132,weight:100}})}run(e,t){return Jw(t,$("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0)}}yM.Id="editor.action.quickFix";class GNt extends jl{constructor(){super({id:qRe,precondition:dn.and(We.writable,We.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:Use}]}})}runEditorCommand(e,t,i){const s=Sm.fromUser(i,{kind:$i.Empty,apply:"ifSingle"});return Jw(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?$("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):$("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):s.preferred?$("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):$("editor.action.codeAction.noneMessage","No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class zNt extends yn{constructor(){super({id:JRe,label:$("refactor.label","Refactor..."),alias:"Refactor...",precondition:dn.and(We.writable,We.hasCodeActionsProvider),kbOpts:{kbExpr:We.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:dn.and(We.writable,BF($i.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:Use}]}})}run(e,t,i){const s=Sm.fromUser(i,{kind:$i.Refactor,apply:"never"});return Jw(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?$("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):$("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):s.preferred?$("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):$("editor.action.refactor.noneMessage","No refactorings available"),{include:$i.Refactor.contains(s.kind)?s.kind:$i.None,onlyIncludePreferredActions:s.preferred},s.apply)}}class KNt extends yn{constructor(){super({id:QRe,label:$("source.label","Source Action..."),alias:"Source Action...",precondition:dn.and(We.writable,We.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:dn.and(We.writable,BF($i.Source))},description:{description:"Source Action...",args:[{name:"args",schema:Use}]}})}run(e,t,i){const s=Sm.fromUser(i,{kind:$i.Source,apply:"never"});return Jw(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?$("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):$("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):s.preferred?$("editor.action.source.noneMessage.preferred","No preferred source actions available"):$("editor.action.source.noneMessage","No source actions available"),{include:$i.Source.contains(s.kind)?s.kind:$i.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class jNt extends yn{constructor(){super({id:Fse,label:$("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:dn.and(We.writable,BF($i.SourceOrganizeImports)),kbOpts:{kbExpr:We.editorTextFocus,primary:1581,weight:100}})}run(e,t){return Jw(t,$("editor.action.organize.noneMessage","No organize imports action available"),{include:$i.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}class XNt extends yn{constructor(){super({id:Bse,label:$("fixAll.label","Fix All"),alias:"Fix All",precondition:dn.and(We.writable,BF($i.SourceFixAll))})}run(e,t){return Jw(t,$("fixAll.noneMessage","No fix all action available"),{include:$i.SourceFixAll,includeSourceActions:!0},"ifSingle")}}class HF extends yn{constructor(){super({id:HF.Id,label:$("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:dn.and(We.writable,BF($i.QuickFix)),kbOpts:{kbExpr:We.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return Jw(t,$("editor.action.autoFix.noneMessage","No auto fixes available"),{include:$i.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}HF.Id="editor.action.autoFix";_s(uw.ID,uw);qt(yM);qt(zNt);qt(KNt);qt(jNt);qt(HF);qt(XNt);Xt(new GNt);var Lpe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class uQ{constructor(){this.lenses=[],this._disposables=new Wt}dispose(){this._disposables.dispose()}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function sMe(n,e){return Lpe(this,void 0,void 0,function*(){const t=Pv.ordered(n),i=new Map,s=new uQ,o=t.map((r,a)=>Lpe(this,void 0,void 0,function*(){i.set(r,a);try{const c=yield Promise.resolve(r.provideCodeLenses(n,e));c&&s.add(c,r)}catch(c){Ol(c)}}));return yield Promise.all(o),s.lenses=s.lenses.sort((r,a)=>r.symbol.range.startLineNumber<a.symbol.range.startLineNumber?-1:r.symbol.range.startLineNumber>a.symbol.range.startLineNumber?1:i.get(r.provider)<i.get(a.provider)?-1:i.get(r.provider)>i.get(a.provider)?1:r.symbol.range.startColumn<a.symbol.range.startColumn?-1:r.symbol.range.startColumn>a.symbol.range.startColumn?1:0),s})}ji.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Gs(Jn.isUri(t)),Gs(typeof i=="number"||!i);const s=n.get(Xr).getModel(t);if(!s)throw Wg();const o=[],r=new Wt;return sMe(s,Ai.None).then(a=>{r.add(a);let c=[];for(const u of a.lenses)i==null||u.symbol.command?o.push(u.symbol):i-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(s,u.symbol,Ai.None)).then(d=>o.push(d||u.symbol)));return Promise.all(c)}).then(()=>o).finally(()=>{setTimeout(()=>r.dispose(),100)})});var YNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qNt=function(n,e){return function(t,i){e(t,i,n)}};const oMe=ss("ICodeLensCache");class Ope{constructor(e,t){this.lineCount=e,this.data=t}}let dQ=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Py(20,.75);const t="codelens/cache";GW(()=>e.remove(t,1));const i="codelens/cache2",s=e.get(i,1,"{}");this._deserialize(s),ub(e.onWillSaveState)(o=>{o.reason===a5.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),s=new uQ;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new Ope(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new be(a,1,a,11)});const r=new uQ;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new Ope(s.lineCount,r))}}catch{}}};dQ=YNt([qNt(0,m_)],dQ);Fy(oMe,dQ);class JNt{constructor(e,t,i){this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class Q6{constructor(e,t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${Q6._idPool++}`,this.updatePosition(i),this._domNode=document.createElement("span"),this._domNode.className=`codelens-decoration ${t}`}withCommands(e,t){this._commands.clear();let i=[],s=!1;for(let o=0;o<e.length;o++){const r=e[o];if(r&&(s=!0,r.command)){const a=I0(r.command.title.trim());r.command.id?(i.push(Vt("a",{id:String(o),title:r.command.tooltip},...a)),this._commands.set(String(o),r.command)):i.push(Vt("span",{title:r.command.tooltip},...a)),o+1<e.length&&i.push(Vt("span",void 0," | "))}}s?(oy(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):oy(this._domNode,Vt("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}Q6._idPool=0;class Q7{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,s=t.length;i<s;i++)this._addDecorationsCallbacks[i](t[i])}}class Rpe{constructor(e,t,i,s,o,r,a){this._isDisposed=!1,this._editor=t,this._className=i,this._data=e,this._decorationIds=[];let c,u=[];this._data.forEach((d,f)=>{d.symbol.command&&u.push(d.symbol),s.addDecoration({range:d.symbol.range,options:Ci.EMPTY},g=>this._decorationIds[f]=g),c?c=be.plusRange(c,d.symbol.range):c=be.lift(d.symbol.range)}),this._viewZone=new JNt(c.startLineNumber-1,r,a),this._viewZoneId=o.addZone(this._viewZone),u.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(u,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Q6(this._editor,this._className,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t&&t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&be.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:Ci.EMPTY},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:s}=this._data[t];s.command=i.command||s.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}getItems(){return this._data}}ws((n,e)=>{const t=n.getColor(owt);t&&(e.addRule(`.monaco-editor .codelens-decoration { color: ${t}; }`),e.addRule(`.monaco-editor .codelens-decoration .codicon { color: ${t}; }`));const i=n.getColor(Die);i&&(e.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${i} !important; }`),e.addRule(`.monaco-editor .codelens-decoration > a:hover .codicon { color: ${i} !important; }`))});var QNt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Z7=function(n,e){return function(t,i){e(t,i,n)}},ZNt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let kR=class{constructor(e,t,i,s){this._editor=e,this._commandService=t,this._notificationService=i,this._codeLensCache=s,this._disposables=new Wt,this._localToDispose=new Wt,this._lenses=[],this._getCodeLensModelDelays=new qW(Pv,250,2500),this._oldCodeLensModels=new Wt,this._resolveCodeLensesDelays=new qW(Pv,250,2500),this._resolveCodeLensesScheduler=new ho(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDelays.min),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(o=>{(o.hasChanged(43)||o.hasChanged(16)||o.hasChanged(15))&&this._updateLensStyle(),o.hasChanged(14)&&this._onModelChange()})),this._disposables.add(Pv.onDidChange(this._onModelChange,this)),this._onModelChange(),this._styleClassName="_"+Bne(this._editor.getId()).toString(16),this._styleElement=kd(G8(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose(),this._styleElement.remove()}_getLayoutInfo(){let e=this._editor.getOption(16),t;return!e||e<5?(e=this._editor.getOption(45)*.9|0,t=this._editor.getOption(58)):t=e*Math.max(1.3,this._editor.getOption(58)/this._editor.getOption(45))|0,{codeLensHeight:t,fontSize:e}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(15),s=this._editor.getOption(43),o=`--codelens-font-family${this._styleClassName}`,r=`--codelens-font-features${this._styleClassName}`;let a=`
- .monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${e}px; font-size: ${t}px; padding-right: ${Math.round(t*.5)}px; font-feature-settings: var(${r}) }
- .monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }
- `;i&&(a+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${o}), ${va.fontFamily}}`),this._styleElement.textContent=a,this._editor.getContainerDomNode().style.setProperty(o,i??"inherit"),this._editor.getContainerDomNode().style.setProperty(r,s.fontFeatureSettings),this._editor.changeViewZones(c=>{for(let u of this._lenses)u.updateHeight(e,c)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!Pv.has(e)){t&&this._localToDispose.add(j0(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const s of Pv.all(e))if(typeof s.onDidChange=="function"){let o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new ho(()=>{var s;const o=Date.now();(s=this._getCodeLensModelPromise)===null||s===void 0||s.cancel(),this._getCodeLensModelPromise=ul(r=>sMe(e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._getCodeLensModelDelays.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},di)},this._getCodeLensModelDelays.get(e));this._localToDispose.add(i),this._localToDispose.add(xi(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{let r=[],a=-1;this._lenses.forEach(u=>{!u.isValid()||a===u.getLineNumber()?r.push(u):(u.update(o),a=u.getLineNumber())});let c=new Q7;r.forEach(u=>{u.dispose(c,o),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(s)})}),i.schedule()})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(xi(()=>{if(this._editor.getModel()){const s=hy.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let o=s.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){let a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new Q7;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),i=[],s;for(let a of e.lenses){let c=a.symbol.range.startLineNumber;c<1||c>t||(s&&s[s.length-1].symbol.range.startLineNumber===c?s.push(a):(s=[a],i.push(s)))}const o=hy.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const u=new Q7;let d=0,f=0;for(;f<i.length&&d<this._lenses.length;){let g=i[f][0].symbol.range.startLineNumber,p=this._lenses[d].getLineNumber();p<g?(this._lenses[d].dispose(u,c),this._lenses.splice(d,1)):p===g?(this._lenses[d].updateCodeLensSymbols(i[f],u),f++,d++):(this._lenses.splice(d,0,new Rpe(i[f],this._editor,this._styleClassName,u,c,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++,f++)}for(;d<this._lenses.length;)this._lenses[d].dispose(u,c),this._lenses.splice(d,1);for(;f<i.length;)this._lenses.push(new Rpe(i[f],this._editor,this._styleClassName,u,c,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),f++;u.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],s=[];if(this._lenses.forEach(a=>{const c=a.computeIfNecessary(t);c&&(i.push(c),s.push(a))}),i.length===0)return;const o=Date.now(),r=ul(a=>{const c=i.map((u,d)=>{const f=new Array(u.length),g=u.map((p,_)=>!p.symbol.command&&typeof p.provider.resolveCodeLens=="function"?Promise.resolve(p.provider.resolveCodeLens(t,p.symbol,a)).then(v=>{f[_]=v},Ol):(f[_]=p.symbol,Promise.resolve(void 0)));return Promise.all(g).then(()=>{!a.isCancellationRequested&&!s[d].isDisposed()&&s[d].updateCommands(f)})});return Promise.all(c)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDelays.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{di(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getLenses(){return this._lenses}};kR.ID="css.editor.codeLens";kR=QNt([Z7(1,vr),Z7(2,Hr),Z7(3,oMe)],kR);_s(kR.ID,kR);qt(class extends yn{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:We.hasCodeLensProvider,label:$("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return ZNt(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Wy),s=e.get(vr),o=e.get(Hr),r=t.getSelection().positionLineNumber,a=t.getContribution(kR.ID),c=[];for(let d of a.getLenses())if(d.getLineNumber()===r)for(let f of d.getItems()){const{command:g}=f.symbol;g&&c.push({label:g.title,command:g})}if(c.length===0)return;const u=yield i.pick(c,{canPickMany:!1});if(u)try{yield s.executeCommand(u.command.id,...u.command.arguments||[])}catch(d){o.error(d)}})}});function eDt(n,e){const t=[],s=pR.ordered(n).reverse().map(o=>Promise.resolve(o.provideDocumentColors(n,e)).then(r=>{if(Array.isArray(r))for(let a of r)t.push({colorInfo:a,provider:o})}));return Promise.all(s).then(()=>t)}function Mpe(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}ji.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof Jn))throw Wg();const i=n.get(Xr).getModel(t);if(!i)throw Wg();const s=[],r=pR.ordered(i).reverse().map(a=>Promise.resolve(a.provideDocumentColors(i,Ai.None)).then(c=>{if(Array.isArray(c))for(let u of c)s.push({range:u.range,color:[u.color.red,u.color.green,u.color.blue,u.color.alpha]})}));return Promise.all(r).then(()=>s)});ji.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:o}=i;if(!(s instanceof Jn)||!Array.isArray(t)||t.length!==4||!be.isIRange(o))throw Wg();const[r,a,c,u]=t,d=n.get(Xr).getModel(s);if(!d)throw Wg();const f={range:o,color:{red:r,green:a,blue:c,alpha:u}},g=[],_=pR.ordered(d).reverse().map(v=>Promise.resolve(v.provideColorPresentations(d,f,Ai.None)).then(C=>{Array.isArray(C)&&g.push(...C)}));return Promise.all(_).then(()=>g)});var tDt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kpe=function(n,e){return function(t,i){e(t,i,n)}};const nDt=500;let dw=class rMe extends wt{constructor(e,t,i){super(),this._editor=e,this._codeEditorService=t,this._configurationService=i,this._localToDispose=this._register(new Wt),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=[],this._decorationsTypes=new Set,this._register(e.onDidChangeModel(()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()})),this._register(e.onDidChangeModelLanguage(()=>this.onModelChanged())),this._register(pR.onDidChange(()=>this.onModelChanged())),this._register(e.onDidChangeConfiguration(()=>{let s=this._isEnabled;this._isEnabled=this.isEnabled(),s!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(17)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const e=this._editor.getModel();!e||!pR.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new mc,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},rMe.RECOMPUTE_TIME))})),this.beginCompute())}beginCompute(){this._computePromise=ul(e=>{const t=this._editor.getModel();return t?eDt(t,e):Promise.resolve([])}),this._computePromise.then(e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null},di)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Ci.EMPTY}));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((i,s)=>this._colorDatas.set(i,e[s]))}updateColorDecorators(e){let t=[],i={};for(let s=0;s<e.length&&t.length<nDt;s++){const{red:o,green:r,blue:a,alpha:c}=e[s].colorInfo.color,u=new Di(Math.round(o*255),Math.round(r*255),Math.round(a*255),c);let d=Bne(`rgba(${u.r},${u.g},${u.b},${u.a})`).toString(16),f=`rgba(${u.r}, ${u.g}, ${u.b}, ${u.a})`,g="colorBox-"+d;!this._decorationsTypes.has(g)&&!i[g]&&this._codeEditorService.registerDecorationType("color-detector-color",g,{before:{contentText:" ",border:"solid 0.1em #000",margin:"0.1em 0.2em 0 0.2em",width:"0.8em",height:"0.8em",backgroundColor:f},dark:{before:{border:"solid 0.1em #eee"}}},void 0,this._editor),i[g]=!0,t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:this._codeEditorService.resolveDecorationOptions(g,!0)})}this._decorationsTypes.forEach(s=>{i[s]||this._codeEditorService.removeDecorationType(s)}),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,t)}removeAllDecorations(){this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,[]),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,[]),this._decorationsTypes.forEach(e=>{this._codeEditorService.removeDecorationType(e)})}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(be.fromPositions(e,e)).filter(s=>this._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}};dw.ID="editor.contrib.colorDetector";dw.RECOMPUTE_TIME=1e3;dw=tDt([kpe(1,hs),kpe(2,Yo)],dw);_s(dw.ID,dw);function hQ(n,e){return!!n[e]}class eK{constructor(e,t){this.target=e.target,this.hasTriggerModifier=hQ(e.event,t.triggerModifier),this.hasSideBySideModifier=hQ(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Ape{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=hQ(e,t.triggerModifier)}}class SV{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Npe(n){return n==="altKey"?ki?new SV(57,"metaKey",6,"altKey"):new SV(5,"ctrlKey",6,"altKey"):ki?new SV(6,"altKey",57,"metaKey"):new SV(6,"altKey",5,"ctrlKey")}class lMe extends wt{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new rt),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new rt),this.onExecute=this._onExecute.event,this._onCancel=this._register(new rt),this.onCancel=this._onCancel.event,this._editor=e,this._opts=Npe(this._editor.getOption(69)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(t=>{if(t.hasChanged(69)){const i=Npe(this._editor.getOption(69));if(this._opts.equals(i))return;this._opts=i,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(t=>this._onEditorMouseMove(new eK(t,this._opts)))),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(new eK(t,this._opts)))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(new eK(t,this._opts)))),this._register(this._editor.onKeyDown(t=>this._onEditorKeyDown(new Ape(t,this._opts)))),this._register(this._editor.onKeyUp(t=>this._onEditorKeyUp(new Ape(t,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(t=>this._onDidChangeCursorSelection(t))),this._register(this._editor.onDidChangeModel(t=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(t=>{(t.scrollTopChanged||t.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var iDt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pS=function(n,e){return function(t,i){e(t,i,n)}};let hw=class extends Jx{constructor(e,t,i,s,o,r,a,c,u,d){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},s,o,r,a,c,u,d),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){mp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};hw=iDt([pS(3,Qi),pS(4,hs),pS(5,vr),pS(6,ai),pS(7,fo),pS(8,Hr),pS(9,Vu)],hw);const Dpe=new mt(new Di(0,122,204)),sDt={showArrow:!0,showFrame:!0,className:"",frameColor:Dpe,arrowColor:Dpe,keepEditorSelection:!1},oDt="vs.editor.contrib.zoneWidget";class rDt{constructor(e,t,i,s,o,r){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class lDt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Z6{constructor(e){this._editor=e,this._ruleName=Z6._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),zW(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){zW(this._ruleName),_q(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){this._decorations=this._editor.deltaDecorations(this._decorations,[{range:be.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}Z6._IdGenerator=new Ise(".arrow-decoration-");class aDt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new Wt,this.container=null,this._isShowing=!1,this.editor=e,this.options=lC(t),mp(this.options,sDt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Z6(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()}get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const i=t.getDecorationRange(e);if(i)return i.getStartPosition()}show(e,t){const i=be.isIRange(e)?be.lift(e):be.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:Ci.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(58),t=0;if(this.options.showArrow){let i=Math.round(e/3);t+=2*i}if(this.options.showFrame){let i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(58),c=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,c);let u=0,d=0;if(this._arrow&&this.options.showArrow&&(u=Math.round(a/3),this._arrow.height=u,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(p=>{this._viewZone&&p.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new rDt(r,i.lineNumber,i.column,t,_=>this._onViewZoneTop(_),_=>this._onViewZoneHeight(_)),this._viewZone.id=p.addZone(this._viewZone),this._overlayWidget=new lDt(oDt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const p=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=p+"px",this.container.style.borderBottomWidth=p+"px"}let f=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=u+"px",this.container.style.height=f+"px",this.container.style.overflow="hidden"),this._doLayout(f,o),this.options.keepEditorSelection||this.editor.setSelection(e);const g=this.editor.getModel();if(g){const p=e.endLineNumber+1;p<=g.getLineCount()?this.revealLine(p,!1):this.revealLine(g.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new ca(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.hide(),this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(58),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}class cDt extends bR{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new rt),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Nt(e,Vt(".monaco-dropdown")),this._label=Nt(this._element,Vt(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[An.CLICK,An.MOUSE_DOWN,so.Tap])this._register(Pt(this.element,o,r=>Rs.stop(r,!0)));for(const o of[An.MOUSE_DOWN,so.Tap])this._register(Pt(this._label,o,r=>{r instanceof MouseEvent&&r.detail>1||(this.visible?this.hide():this.show())}));this._register(Pt(this._label,An.KEY_UP,o=>{const r=new Po(o);(r.equals(3)||r.equals(10))&&(Rs.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Ds.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class uDt extends cDt{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class aMe extends w0{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new rt),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=Nt(o,Vt("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new uDt(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}var Wse=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gm=function(n,e){return function(t,i){e(t,i,n)}},cMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function dDt(n,e,t,i,s,o,r){const a=n.getActions(e);return fDt(a,t,!1,i,s,o,r),hDt(a)}function hDt(n){const e=new Wt;for(const[,t]of n)for(const i of t)e.add(i);return e}function fDt(n,e,t,i=a=>a==="navigation",s=Number.MAX_SAFE_INTEGER,o=()=>!1,r=!1){let a,c;Array.isArray(e)?(a=e,c=e):(a=e.primary,c=e.secondary);const u=new Set;for(const[d,f]of n){let g;i(d)?(g=a,g.length>0&&r&&g.push(new Ff)):(g=c,g.length>0&&g.push(new Ff));for(let p of f){const _=g.push(p);p instanceof p6&&u.add({group:d,action:p,index:_-1})}}for(const{group:d,action:f,index:g}of u){const p=i(d)?a:c,_=f.actions;(_.length<=1||p.length+_.length-2<=s)&&o(f,d,p.length)&&p.splice(g,1,..._)}if(a!==c&&a.length>s){const d=a.splice(s,a.length-s);c.unshift(...d,new Ff)}}let AR=class extends Zx{constructor(e,t,i,s,o){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new pc),this._altKey=YS.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return cMe(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(zl||Qc)&&this._altKey.keyStatus.shiftKey;const s=()=>{const o=t&&i;o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event(o=>{i=o.altKey||(zl||Qc)&&o.shiftKey,s()})),this._register(Pt(e,"mouseleave",o=>{t=!1,s()})),this._register(Pt(e,"mouseenter",o=>{t=!0,s()}))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?$("titleAndKb","{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,r=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=r&&r.getLabel(),c=a?$("titleAndKb","{0} ({1})",o,a):o;s+=`
- [${rie.modifierLabels[Tf].altKey}] ${c}`}this.label.title=s}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:s}=this;if(!i||!s)return;const o=this._commandAction.checked&&(!((t=e.toggled)===null||t===void 0)&&t.icon)?e.toggled.icon:e.icon;if(o)if(mo.isThemeIcon(o)){const r=mo.asClassNameArray(o);s.classList.add(...r),this._itemClassDispose.value=xi(()=>{s.classList.remove(...r)})}else o.light&&s.style.setProperty("--menu-entry-icon-light",hb(o.light)),o.dark&&s.style.setProperty("--menu-entry-icon-dark",hb(o.dark)),s.classList.add("icon"),this._itemClassDispose.value=xi(()=>{s.classList.remove("icon"),s.style.removeProperty("--menu-entry-icon-light"),s.style.removeProperty("--menu-entry-icon-dark")})}};AR=Wse([gm(2,Ro),gm(3,Hr),gm(4,ai)],AR);let fQ=class extends aMe{constructor(e,t,i){var s,o;const r=Object.assign({},t??Object.create(null),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(o=t==null?void 0:t.classNames)!==null&&o!==void 0?o:mo.isThemeIcon(e.item.icon)?mo.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,r)}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!mo.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",hb(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",hb(t.dark)))}}};fQ=Wse([gm(2,Vy)],fQ);let gQ=class extends w0{constructor(e,t,i,s,o,r,a,c){var u,d,f;super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=c,this._container=null,this._storageKey=`${e.item.submenu._debugName}_lastActionId`;let g,p=c.get(this._storageKey,1);p&&(g=e.actions.find(v=>p===v.id)),g||(g=e.actions[0]),this._defaultAction=this._instaService.createInstance(AR,g,void 0);const _=Object.assign({},t??Object.create(null),{menuAsChild:(u=t==null?void 0:t.menuAsChild)!==null&&u!==void 0?u:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(f=t==null?void 0:t.actionRunner)!==null&&f!==void 0?f:new bR});this._dropdown=new aMe(e,e.actions,this._contextMenuService,_),this._dropdown.actionRunner.onDidRun(v=>{v.action instanceof Q0&&this.update(v.action)})}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(AR,e,void 0),this._defaultAction.actionRunner=new class extends bR{runAction(t,i){return cMe(this,void 0,void 0,function*(){yield t.run(void 0)})}},this._container&&this._defaultAction.render(Gvt(this._container,Vt(".action-container")))}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=Vt(".action-container");this._defaultAction.render(Nt(this._container,t)),this._register(Pt(t,An.KEY_DOWN,s=>{const o=new Po(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=Vt(".dropdown-action-container");this._dropdown.render(Nt(this._container,i)),this._register(Pt(i,An.KEY_DOWN,s=>{var o;const r=new Po(s);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};gQ=Wse([gm(2,Ro),gm(3,Hr),gm(4,Vy),gm(5,Uw),gm(6,Qi),gm(7,m_)],gQ);function gDt(n,e,t){return e instanceof Q0?n.createInstance(AR,e,void 0):e instanceof aie?e.item.rememberDefaultAction?n.createInstance(gQ,e,t):n.createInstance(fQ,e,t):void 0}var uMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dMe=function(n,e){return function(t,i){e(t,i,n)}};const hMe=ss("IPeekViewService");Fy(hMe,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}});var Fu;(function(n){n.inPeekEditor=new Sn("inReferenceSearchEditor",!0,$("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Fu||(Fu={}));let gP=class{constructor(e,t){e instanceof hw&&Fu.inPeekEditor.bindTo(t)}dispose(){}};gP.ID="editor.contrib.referenceController";gP=uMe([dMe(1,ai)],gP);_s(gP.ID,gP);function pDt(n){let e=n.get(hs).getFocusedCodeEditor();return e instanceof hw?e.getParentEditor():e}const mDt={headerBackgroundColor:mt.white,primaryHeadingColor:mt.fromHex("#333333"),secondaryHeadingColor:mt.fromHex("#6c6c6cb3")};let h5=class extends aDt{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new rt,this.onDidClose=this._onDidClose.event,mp(this.options,mDt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=Vt(".head"),this._bodyElement=Vt(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const i=Vt(".peekview-title");this.options.supportOnTitleClick&&(i.classList.add("clickable"),Br(i,"click",r=>this._onTitleClick(r))),Nt(this._headElement,i),this._fillTitleIcon(i),this._primaryHeading=Vt("span.filename"),this._secondaryHeading=Vt("span.dirname"),this._metaHeading=Vt("span.meta"),Nt(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const s=Vt(".peekview-actions");Nt(this._headElement,s);const o=this._getActionBarOptions();this._actionbarWidget=new pb(s,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Pf("peekview.close",$("label.close","Close"),vn.close.classNames,!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:gDt.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:wl(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,pd(this._metaHeading)):Vc(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(58)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};h5=uMe([dMe(2,Qi)],h5);const _Dt=Ze("peekViewTitle.background",{dark:ro(Kg,.1),light:ro(Kg,.1),hc:null},$("peekViewTitleBackground","Background color of the peek view title area.")),fMe=Ze("peekViewTitleLabel.foreground",{dark:mt.white,light:mt.black,hc:mt.white},$("peekViewTitleForeground","Color of the peek view title.")),gMe=Ze("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hc:"#FFFFFF99"},$("peekViewTitleInfoForeground","Color of the peek view title info.")),vDt=Ze("peekView.border",{dark:Kg,light:Kg,hc:_r},$("peekViewBorder","Color of the peek view borders and arrow.")),pMe=Ze("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:mt.black},$("peekViewResultsBackground","Background color of the peek view result list.")),bDt=Ze("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:mt.white},$("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),TDt=Ze("peekViewResult.fileForeground",{dark:mt.white,light:"#1E1E1E",hc:mt.white},$("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),CDt=Ze("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},$("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),yDt=Ze("peekViewResult.selectionForeground",{dark:mt.white,light:"#6C6C6C",hc:mt.white},$("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),T4=Ze("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:mt.black},$("peekViewEditorBackground","Background color of the peek view editor.")),EDt=Ze("peekViewEditorGutter.background",{dark:T4,light:T4,hc:T4},$("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),SDt=Ze("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},$("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),wDt=Ze("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},$("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),IDt=Ze("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:Ua},$("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var LDt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class _y{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=CRe.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?$({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"symbol in {0} on line {1} at column {2}, {3}",Xf(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):$("aria.oneReference","symbol in {0} on line {1} at column {2}",Xf(this.uri),this.range.startLineNumber,this.range.startColumn)}}class ODt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:s,column:o-t}),u=new be(s,c.startColumn,s,o),d=new be(r,a,r,1073741824),f=i.getValueInRange(u).replace(/^\s+/,""),g=i.getValueInRange(e),p=i.getValueInRange(d).replace(/\s+$/,"");return{value:f+g+p,highlight:{start:f.length,end:f.length+g.length}}}}class pP{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Fa}dispose(){Ji(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?$("aria.fileReferences.1","1 symbol in {0}, full path {1}",Xf(this.uri),this.uri.fsPath):$("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Xf(this.uri),this.uri.fsPath)}resolve(e){return LDt(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new ODt(i))}catch(i){di(i)}return this})}}class Du{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new rt,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Du._compareReferences);let s;for(let o of e)if((!s||!Zc.isEqual(s.uri,o.uri,!0))&&(s=new pP(this,o.uri),this.groups.push(s)),s.children.length===0||Du._compareReferences(o,s.children[s.children.length-1])!==0){const r=new _y(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){Ji(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Du(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?$("aria.result.0","No results found"):this.references.length===1?$("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?$("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):$("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,s=i.children.indexOf(e),o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+1<o||!t&&s>0?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:hR(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLen<o.prefixLen?1:s.offsetDist<o.offsetDist?-1:s.offsetDist>o.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&be.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Zc.compare(e.uri,t.uri)||be.compareRangesUsingStarts(e.range,t.range)}}function mMe(n){if(!n)return;typeof n=="string"&&(n=Jn.file(n));const e=Xf(n)||(n.scheme===Ii.file?n.fsPath:n.path);return zl&&Sbt(e)?pQ(e):e}function pQ(n){return aLe(n)?n.charAt(0).toUpperCase()+n.slice(1):n}var eG=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mP=function(n,e){return function(t,i){e(t,i,n)}};let mQ=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Du||e instanceof pP}getChildren(e){if(e instanceof Du)return e.groups;if(e instanceof pP)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};mQ=eG([mP(0,Nd)],mQ);class RDt{getHeight(){return 23}getTemplateId(e){return e instanceof pP?_P.id:VF.id}}let _Q=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof _y){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Xf(e.uri)}};_Q=eG([mP(0,Ro)],_Q);class MDt{getId(e){return e instanceof _y?e.id:e.uri}}let vQ=class extends wt{constructor(e,t,i){super(),this._uriLabel=t;const s=document.createElement("div");s.classList.add("reference-file"),this.file=this._register(new Ose(s,{supportHighlights:!0})),this.badge=new zJ(Nt(s,Vt(".count"))),this._register(aRt(this.badge,i)),e.appendChild(s)}set(e,t){let i=xne(e.uri);this.file.setLabel(mMe(e.uri),this._uriLabel.getUriLabel(i,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat($("referencesCount","{0} references",s)):this.badge.setTitleFormat($("referenceCount","{0} reference",s))}};vQ=eG([mP(1,NF),mP(2,fo)],vQ);let _P=class _Me{constructor(e){this._instantiationService=e,this.templateId=_Me.id}renderTemplate(e){return this._instantiationService.createInstance(vQ,e)}renderElement(e,t,i){i.set(e.element,A6(e.filterData))}disposeTemplate(e){e.dispose()}};_P.id="FileReferencesRenderer";_P=eG([mP(0,Qi)],_P);class kDt{constructor(e){this.label=new my(e,!1)}set(e,t){var i;const s=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!s||!s.value)this.label.set(`${Xf(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=s;t&&!jg.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,A6(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class VF{constructor(){this.templateId=VF.id}renderTemplate(e){return new kDt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}VF.id="OneReferenceRenderer";class ADt{getWidgetAriaLabel(){return $("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var NDt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fv=function(n,e){return function(t,i){e(t,i,n)}},$pe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class tG{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Wt,this._callOnModelChange=new Wt,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(let t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let o=0,r=e.children.length;o<r;o++){let a=e.children[o];this._decorationIgnoreSet.has(a.id)||a.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:a.range,options:tG.DecorationOptions}),i.push(o))}const s=this._editor.deltaDecorations([],t);for(let o=0;o<s.length;o++)this._decorations.set(s[o],e.children[i[o]])}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(let[i,s]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let r=!1;if(!be.equalsRange(o,s.range)){if(be.spansMultipleLines(o))r=!0;else{const a=s.range.endColumn-s.range.startColumn,c=o.endColumn-o.startColumn;a!==c&&(r=!0)}r?(this._decorationIgnoreSet.add(s.id),e.push(i)):s.range=o}}for(let i=0,s=e.length;i<s;i++)this._decorations.delete(e[i]);this._editor.deltaDecorations(e,[])}}removeDecorations(){this._editor.deltaDecorations([...this._decorations.keys()],[]),this._decorations.clear()}}tG.DecorationOptions=Ci.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class DDt{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const s=JSON.parse(e);t=s.ratio,i=s.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class $Dt extends HJ{}let bQ=class extends h5{constructor(e,t,i,s,o,r,a,c,u,d,f,g){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=r,this._peekViewService=a,this._uriLabel=c,this._undoRedoService=u,this._keybindingService=d,this._modeService=f,this._languageConfigurationService=g,this._disposeOnNewModel=new Wt,this._callOnDispose=new Wt,this._onDidSelectReference=new rt,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new eo(0,0),this._applyTheme(s.getColorTheme()),this._callOnDispose.add(s.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Ji(this._preview),Ji(this._previewNotAvailableMessage),Ji(this._tree),Ji(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(vDt)||mt.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(_Dt)||mt.transparent,primaryHeadingColor:e.getColor(fMe),secondaryHeadingColor:e.getColor(gMe)})}show(e){this.editor.revealRangeInCenterIfOutsideViewport(e,0),super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=Nt(e,Vt("div.messages")),Vc(this._messageContainer),this._splitView=new rRe(e,{orientation:1}),this._previewContainer=Nt(e,Vt("div.preview.inline"));let t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(hw,this._previewContainer,t,this.editor),Vc(this._previewContainer),this._previewNotAvailableMessage=new xd($("missingPreviewMessage","no preview available"),xd.DEFAULT_CREATION_OPTIONS,null,null,this._undoRedoService,this._modeService,this._languageConfigurationService),this._treeContainer=Nt(e,Vt("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new ADt,keyboardNavigationLabelProvider:this._instantiationService.createInstance(_Q),identityProvider:new MDt,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:pMe}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Br(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance($Dt,"ReferencesWidget",this._treeContainer,new RDt,[this._instantiationService.createInstance(_P),this._instantiationService.createInstance(VF)],this._instantiationService.createInstance(mQ),i),this._splitView.addView({onDidChange:Ln.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},n5.Distribute),this._splitView.addView({onDidChange:Ln.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},n5.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));let s=(o,r)=>{o instanceof _y&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),Vc(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new eo(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=$("noResults","No results"),pd(this._messageContainer),Promise.resolve(void 0)):(Vc(this._messageContainer),this._decorationsManager=new tG(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),pd(this._treeContainer),pd(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof _y)return e;if(e instanceof pP&&e.children.length>0)return e.children[0]}revealReference(e){return $pe(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return $pe(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Ii.inMemory?this.setTitle(uLe(e.uri),this._uriLabel.getUriLabel(xne(e.uri))):this.setTitle($("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const s=yield i;if(!this._model){s.dispose();return}Ji(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=be.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};bQ=NDt([fv(3,fo),fv(4,Nd),fv(5,Qi),fv(6,hMe),fv(7,NF),fv(8,wF),fv(9,Ro),fv(10,Ga),fv(11,yF)],bQ);ws((n,e)=>{const t=n.getColor(SDt);t&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${t}; }`);const i=n.getColor(wDt);i&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${i}; }`);const s=n.getColor(IDt);s&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${s}; box-sizing: border-box; }`);const o=n.getColor(Ua);o&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${o}; box-sizing: border-box; }`);const r=n.getColor(pMe);r&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${r}; }`);const a=n.getColor(bDt);a&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${a}; }`);const c=n.getColor(TDt);c&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${c}; }`);const u=n.getColor(CDt);u&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${u}; }`);const d=n.getColor(yDt);d&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${d} !important; }`);const f=n.getColor(T4);f&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input { background-color: ${f};}`);const g=n.getColor(EDt);g&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin { background-color: ${g};}`)});var xDt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},a1=function(n,e){return function(t,i){e(t,i,n)}},xpe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const Qw=new Sn("referenceSearchVisible",!1,$("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let vy=class TQ{constructor(e,t,i,s,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Wt,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Qw.bindTo(i)}static get(e){return e.getContribution(TQ.ID)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=DDt.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(bQ,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle($("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(c=>{let{element:u,kind:d}=c;if(u)switch(d){case"open":(c.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(u,!1,!1);break;case"side":this.openReference(u,!0,!1);break;case"goto":i?this._gotoReference(u):this.openReference(u,!1,!0);break}}));const a=++this._requestIdPool;t.then(c=>{var u;if(a!==this._requestIdPool||!this._widget){c.dispose();return}return(u=this._model)===null||u===void 0||u.dispose(),this._model=c,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle($("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let d=this._editor.getModel().uri,f=new ct(e.startLineNumber,e.startColumn),g=this._model.nearestReference(d,f);if(g)return this._widget.setSelection(g).then(()=>{this._widget&&this._editor.getOption(76)==="editor"&&this._widget.focusOnPreviewEditor()})}})},c=>{this._notificationService.error(c)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return xpe(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return xpe(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const t=be.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:t}},this._editor).then(i=>{var s;if(this._ignoreModelChangeEvent=!1,!i||!this._widget){this.closeWidget();return}if(this._editor===i)this._widget.show(t),this._widget.focusOnReferenceTree();else{const o=TQ.get(i),r=this._model.clone();this.closeWidget(),i.focus(),o.toggleWidget(t,ul(a=>Promise.resolve(r)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},i=>{this._ignoreModelChangeEvent=!1,di(i)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,pinned:i}},this._editor,t)}};vy.ID="editor.contrib.referencesController";vy=xDt([a1(2,ai),a1(3,hs),a1(4,Hr),a1(5,Qi),a1(6,m_),a1(7,Yo)],vy);function Zw(n,e){const t=pDt(n);if(!t)return;let i=vy.get(t);i&&e(i)}_c.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:fl(2089,60),when:dn.or(Qw,Fu.inPeekEditor),handler(n){Zw(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});_c.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:dn.or(Qw,Fu.inPeekEditor),handler(n){Zw(n,e=>{e.goToNextOrPreviousReference(!0)})}});_c.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:dn.or(Qw,Fu.inPeekEditor),handler(n){Zw(n,e=>{e.goToNextOrPreviousReference(!1)})}});ji.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");ji.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");ji.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");ji.registerCommand("closeReferenceSearch",n=>Zw(n,e=>e.closeWidget()));_c.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:dn.and(Fu.inPeekEditor,dn.not("config.editor.stablePeek"))});_c.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:dn.and(Qw,dn.not("config.editor.stablePeek"))});_c.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:dn.and(Qw,gRe),handler(n){var e;const i=(e=n.get(Mh).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof _y&&Zw(n,s=>s.revealReference(i[0]))}});_c.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:dn.and(Qw,gRe),handler(n){var e;const i=(e=n.get(Mh).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof _y&&Zw(n,s=>s.openReference(i[0],!0,!0))}});ji.registerCommand("openReference",n=>{var e;const i=(e=n.get(Mh).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof _y&&Zw(n,s=>s.openReference(i[0],!1,!0))});var vMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_D=function(n,e){return function(t,i){e(t,i,n)}};const Gse=new Sn("hasSymbols",!1,$("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),nG=ss("ISymbolNavigationService");let CQ=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=Gse.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new yQ(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),c=r.getPosition();if(!a||!c)return;let u=!1,d=!1;for(const f of t.references)if(cLe(f.uri,a.uri))u=!0,d=d||be.containsPosition(f.range,c);else if(u)break;(!u||!d)&&this.reset()});this._currentState=AC(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:be.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?$("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):$("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};CQ=vMe([_D(0,ai),_D(1,hs),_D(2,Hr),_D(3,Ro)],CQ);Fy(nG,CQ,!0);Xt(new class extends jl{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:Gse,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(nG).revealNext(e)}});_c.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:Gse,primary:9,handler(n){n.get(nG).reset()}});let yQ=class{constructor(e){this._listener=new Map,this._disposables=new Wt,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Ji(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,AC(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};yQ=vMe([_D(0,hs)],yQ);var bMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function UF(n,e,t,i){const o=t.ordered(n).map(r=>Promise.resolve(i(r,n,e)).then(void 0,a=>{Ol(a)}));return Promise.all(o).then(r=>{const a=[];for(let c of r)Array.isArray(c)?a.push(...c):c&&a.push(c);return a})}function zse(n,e,t){return UF(n,e,wx,(i,s,o)=>i.provideDefinition(s,o,t))}function TMe(n,e,t){return UF(n,e,n3,(i,s,o)=>i.provideDeclaration(s,o,t))}function CMe(n,e,t){return UF(n,e,i3,(i,s,o)=>i.provideImplementation(s,o,t))}function yMe(n,e,t){return UF(n,e,s3,(i,s,o)=>i.provideTypeDefinition(s,o,t))}function iG(n,e,t,i){return UF(n,e,ZW,(s,o,r)=>bMe(this,void 0,void 0,function*(){const a=yield s.provideReferences(o,r,{includeDeclaration:!0},i);if(!t||!a||a.length!==2)return a;const c=yield s.provideReferences(o,r,{includeDeclaration:!1},i);return c&&c.length===1?c:a}))}function WF(n){return bMe(this,void 0,void 0,function*(){const e=yield n(),t=new Du(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}f_("_executeDefinitionProvider",(n,e)=>WF(()=>zse(n,e,Ai.None)));f_("_executeDeclarationProvider",(n,e)=>WF(()=>TMe(n,e,Ai.None)));f_("_executeImplementationProvider",(n,e)=>WF(()=>CMe(n,e,Ai.None)));f_("_executeTypeDefinitionProvider",(n,e)=>WF(()=>yMe(n,e,Ai.None)));f_("_executeReferenceProvider",(n,e)=>WF(()=>iG(n,e,!1,Ai.None)));var Bf=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},tK,nK,iK,sK,oK,rK,lK,aK;Th.appendMenuItem(wn.EditorContext,{submenu:wn.EditorContextPeek,title:$("peek.submenu","Peek"),group:"navigation",order:100});const EMe=new Set;function vp(n){const e=new n;return m1e(e),EMe.add(e.id),e}class EM extends yn{constructor(e,t){super(t),this._configuration=e}run(e,t){if(!t.hasModel())return Promise.resolve(void 0);const i=e.get(Hr),s=e.get(hs),o=e.get(Mb),r=e.get(nG),a=t.getModel(),c=t.getPosition(),u=new Qx(t,5),d=Sne(this._getLocationModel(a,c,u.token),u.token).then(f=>Bf(this,void 0,void 0,function*(){if(!f||u.token.isCancellationRequested)return;Hl(f.ariaMessage);let g;if(f.referenceAt(a.uri,c)){const _=this._getAlternativeCommand(t);_!==this.id&&EMe.has(_)&&(g=t.getAction(_))}const p=f.references.length;if(p===0){if(!this._configuration.muteMessage){const _=a.getWordAtPosition(c);Pd.get(t).showMessage(this._getNoResultFoundMessage(_),c)}}else if(p===1&&g)g.run();else return this._onResult(s,r,t,f)}),f=>{i.error(f)}).finally(()=>{u.dispose()});return o.showWhile(d,250),d}_onResult(e,t,i,s){return Bf(this,void 0,void 0,function*(){const o=this._getGoToPreference(i);if(!(i instanceof hw)&&(this._configuration.openInPeek||o==="peek"&&s.references.length>1))this._openInPeek(i,s);else{const r=s.firstReference(),a=s.references.length>1&&o==="gotoAndPeek",c=yield this._openReference(i,e,r,this._configuration.openToSide,!a);a&&c?this._openInPeek(c,s):s.dispose(),o==="goto"&&t.put(r)}})}_openReference(e,t,i,s,o){return Bf(this,void 0,void 0,function*(){let r;if(pTt(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:be.collapseToStart(r),selectionRevealType:3}},e,s);if(a){if(o){const c=a.getModel(),u=a.deltaDecorations([],[{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&a.deltaDecorations(u,[])},350)}return a}})}_openInPeek(e,t){let i=vy.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),ul(s=>Promise.resolve(t)),this._configuration.openInPeek):t.dispose()}}class sG extends EM{_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(yield zse(e,t,i),$("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?$("noResultWord","No definition found for '{0}'",e.word):$("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(50).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(50).multipleDefinitions}}const SMe=hM&&!VIe?2118:70;vp((tK=class EQ extends sG{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:EQ.id,label:$("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:dn.and(We.hasDefinitionProvider,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:SMe,weight:100},contextMenuOpts:{group:"navigation",order:1.1}}),ji.registerCommandAlias("editor.action.goToDeclaration",EQ.id)}},tK.id="editor.action.revealDefinition",tK));vp((nK=class SQ extends sG{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:SQ.id,label:$("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:dn.and(We.hasDefinitionProvider,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,SMe),weight:100}}),ji.registerCommandAlias("editor.action.openDeclarationToTheSide",SQ.id)}},nK.id="editor.action.revealDefinitionAside",nK));vp((iK=class wQ extends sG{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:wQ.id,label:$("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:dn.and(We.hasDefinitionProvider,Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:wn.EditorContextPeek,group:"peek",order:2}}),ji.registerCommandAlias("editor.action.previewDeclaration",wQ.id)}},iK.id="editor.action.peekDefinition",iK));class wMe extends EM{_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(yield TMe(e,t,i),$("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?$("decl.noResultWord","No declaration found for '{0}'",e.word):$("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(50).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(50).multipleDeclarations}}vp((sK=class IMe extends wMe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:IMe.id,label:$("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:dn.and(We.hasDeclarationProvider,We.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3}})}_getNoResultFoundMessage(e){return e&&e.word?$("decl.noResultWord","No declaration found for '{0}'",e.word):$("decl.generic.noResults","No declaration found")}},sK.id="editor.action.revealDeclaration",sK));vp(class extends wMe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:$("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:dn.and(We.hasDeclarationProvider,Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:wn.EditorContextPeek,group:"peek",order:3}})}});class LMe extends EM{_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(yield yMe(e,t,i),$("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?$("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):$("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(50).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(50).multipleTypeDefinitions}}vp((oK=class OMe extends LMe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:OMe.ID,label:$("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:dn.and(We.hasTypeDefinitionProvider,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4}})}},oK.ID="editor.action.goToTypeDefinition",oK));vp((rK=class RMe extends LMe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:RMe.ID,label:$("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:dn.and(We.hasTypeDefinitionProvider,Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:wn.EditorContextPeek,group:"peek",order:4}})}},rK.ID="editor.action.peekTypeDefinition",rK));class MMe extends EM{_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(yield CMe(e,t,i),$("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?$("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):$("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(50).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(50).multipleImplementations}}vp((lK=class kMe extends MMe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:kMe.ID,label:$("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:dn.and(We.hasImplementationProvider,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:2118,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}},lK.ID="editor.action.goToImplementation",lK));vp((aK=class AMe extends MMe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:AMe.ID,label:$("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:dn.and(We.hasImplementationProvider,Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:wn.EditorContextPeek,group:"peek",order:5}})}},aK.ID="editor.action.peekImplementation",aK));class NMe extends EM{_getNoResultFoundMessage(e){return e?$("references.no","No references found for '{0}'",e.word):$("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(50).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(50).multipleReferences}}vp(class extends NMe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:$("goToReferences.label","Go to References"),alias:"Go to References",precondition:dn.and(We.hasReferenceProvider,Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:We.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(yield iG(e,t,!0,i),$("ref.title","References"))})}});vp(class extends NMe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:$("references.action.label","Peek References"),alias:"Peek References",precondition:dn.and(We.hasReferenceProvider,Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:wn.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(yield iG(e,t,!1,i),$("ref.title","References"))})}});class PDt extends EM{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:$("label.generic","Go to Any Symbol"),alias:"Go to Any Symbol",precondition:dn.and(Fu.notInPeekEditor,We.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i){return Bf(this,void 0,void 0,function*(){return new Du(this._references,$("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&$("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(50).multipleReferences}_getAlternativeCommand(){return""}}ji.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Jn},{name:"position",description:"The position at which to start",constraint:ct.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,s,o,r)=>Bf(void 0,void 0,void 0,function*(){Gs(Jn.isUri(e)),Gs(ct.isIPosition(t)),Gs(Array.isArray(i)),Gs(typeof s>"u"||typeof s=="string"),Gs(typeof r>"u"||typeof r=="boolean");const a=n.get(hs),c=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Qm(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,0),c.invokeWithinContext(u=>{const d=new class extends PDt{_getNoResultFoundMessage(f){return o||super._getNoResultFoundMessage(f)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);u.get(Qi).invokeFunction(d.run.bind(d),c)})})});ji.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Jn},{name:"position",description:"The position at which to start",constraint:ct.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,s)=>Bf(void 0,void 0,void 0,function*(){n.get(vr).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});ji.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Gs(Jn.isUri(e)),Gs(ct.isIPosition(t));const i=n.get(hs);return i.openCodeEditor({resource:e},i.getFocusedCodeEditor()).then(s=>{if(!Qm(s)||!s.hasModel())return;const o=vy.get(s);if(!o)return;const r=ul(c=>iG(s.getModel(),ct.lift(t),!1,c).then(u=>new Du(u,$("ref.title","References")))),a=new be(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(a,r,!1))})}});ji.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");Th.appendMenuItems([{id:wn.MenubarGoMenu,item:{command:{id:"editor.action.revealDefinition",title:$({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},group:"4_symbol_nav",order:2}},{id:wn.MenubarGoMenu,item:{command:{id:"editor.action.revealDeclaration",title:$({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},group:"4_symbol_nav",order:3}},{id:wn.MenubarGoMenu,item:{command:{id:"editor.action.goToTypeDefinition",title:$({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},group:"4_symbol_nav",order:3}},{id:wn.MenubarGoMenu,item:{command:{id:"editor.action.goToImplementation",title:$({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},group:"4_symbol_nav",order:4}},{id:wn.MenubarGoMenu,item:{command:{id:"editor.action.goToReferences",title:$({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},group:"4_symbol_nav",order:5}}]);var FDt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ppe=function(n,e){return function(t,i){e(t,i,n)}};let fw=class vD{constructor(e,t,i){this.textModelResolverService=t,this.modeService=i,this.toUnhook=new Wt,this.toUnhookForKeyboard=new Wt,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let s=new lMe(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([o,r])=>{this.startFindDefinitionFromMouse(o,yd(r))})),this.toUnhook.add(s.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).then(()=>{this.removeLinkDecorations()},r=>{this.removeLinkDecorations(),di(r)})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(vD.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then(()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return Promise.resolve(0);this.currentWordAtPosition=i;let s=new yOe(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=ul(o=>this.findDefinition(e,o)),this.previousPromise.then(o=>{if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}if(o.length>1)this.addDecoration(new be(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),new mb().appendText($("multipleResults","Click to show {0} definitions.",o.length)));else{let r=o[0];if(!r.uri)return;this.textModelResolverService.createModelReference(r.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:u}=r.range;if(u<1||u>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,u,r);let f;r.originSelectionRange?f=be.lift(r.originSelectionRange):f=new be(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const g=this.modeService.getModeIdByFilepathOrFirstLine(c.uri);this.addDecoration(f,new mb().appendCodeblock(g||"",d)),a.dispose()})}}).then(void 0,di)}getPreviewValue(e,t,i){let s=i.targetSelectionRange?i.range:this.getPreviewRangeBasedOnBrackets(e,t);return s.endLineNumber-s.startLineNumber>=vD.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const c=e.getLineFirstNonWhitespaceColumn(a);o=Math.min(o,c)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${o-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),s=Math.min(e.getLineCount(),t+vD.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<s;o++){let r=e.getLineFirstNonWhitespaceColumn(o);if(i===r)break}return new be(t,1,o+1,1)}getPreviewRangeBasedOnBrackets(e,t){const i=Math.min(e.getLineCount(),t+vD.MAX_SOURCE_PREVIEW_LINES),s=[];let o=!0,r=e.findNextBracket(new ct(t,1));for(;r!==null;){if(s.length===0)s.push(r);else{const d=s[s.length-1];if(d.open[0]===r.open[0]&&d.isOpen&&!r.isOpen?s.pop():s.push(r),s.length===0)if(o)o=!1;else return new be(t,1,r.range.endLineNumber+1,1)}const a=e.getLineMaxColumn(t);let c=r.range.endLineNumber,u=r.range.endColumn;if(a===r.range.endColumn&&(c++,u=1),c>i)return new be(t,1,i+1,1);r=e.findNextBracket(new ct(c,u))}return new be(t,1,i+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[i])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&e.target.type===6&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&wx.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?zse(i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const s=!t&&this.editor.getOption(77)&&!this.isInPeekEditor(i);return new sG({openToSide:t,openInPeek:s,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(i,this.editor)})}isInPeekEditor(e){const t=e.get(ai);return Fu.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};fw.ID="editor.contrib.gotodefinitionatposition";fw.MAX_SOURCE_PREVIEW_LINES=8;fw=FDt([Ppe(1,Nd),Ppe(2,Ga)],fw);_s(fw.ID,fw);ws((n,e)=>{const t=n.getColor(Die);t&&e.addRule(`.monaco-editor .goto-definition-link { color: ${t} !important; }`)});const wV=Vt;class DMe extends wt{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this._scrollbar=this._register(new RF(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this._scrollbar.getDomNode())}onContentsChanged(){this._scrollbar.scanDomNode()}}class Kse extends wt{constructor(e,t,i){super(),this.actionContainer=Nt(e,wV("div.action-container")),this.action=Nt(this.actionContainer,wV("a.action")),this.action.setAttribute("href","#"),this.action.setAttribute("role","button"),t.iconClass&&Nt(this.action,wV(`span.icon.${t.iconClass}`));const s=Nt(this.action,wV("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._register(Pt(this.actionContainer,An.MOUSE_DOWN,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this.setEnabled(!0)}static render(e,t,i){return new Kse(e,t,i)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}class BDt{constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new rt,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new rt,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new rt,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let i=0;i<this.colorPresentations.length;i++)if(t.toLowerCase()===this.colorPresentations[i].label){this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation);break}}flushColor(){this._onColorFlushed.fire(this._color)}}const Bg=Vt;class HDt extends wt{constructor(e,t,i){super(),this.model=t,this.domNode=Bg(".colorpicker-header"),Nt(e,this.domNode),this.pickedColorNode=Nt(this.domNode,Bg(".picked-color"));const s=$("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this.pickedColorNode.setAttribute("title",s);const o=Nt(this.domNode,Bg(".original-color"));o.style.backgroundColor=mt.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(tw)||mt.white,this._register(ws((r,a)=>{this.backgroundColor=r.getColor(tw)||mt.white})),this._register(Pt(this.pickedColorNode,An.CLICK,()=>this.model.selectNextColorPresentation())),this._register(Pt(o,An.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this.pickedColorNode.style.backgroundColor=mt.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter())}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=mt.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this.pickedColorNode.prepend(Bg(".codicon.codicon-color-mode"))}}class VDt extends wt{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=Bg(".colorpicker-body"),Nt(e,this.domNode),this.saturationBox=new UDt(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new WDt(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new GDt(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new mt(new km(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new mt(new km(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new mt(new km(i===360?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class UDt extends wt{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new rt,this.onColorFlushed=this._onColorFlushed.event,this.domNode=Bg(".saturation-wrap"),Nt(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",Nt(this.domNode,this.canvas),this.selection=Bg(".saturation-selection"),Nt(this.domNode,this.selection),this.layout(),this._register(Ine(this.domNode,s=>this.onMouseDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new Ww);const t=Bl(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,_M,s=>this.onDidChangePosition(s.posx-t.left,s.posy-t.top),()=>null);const i=KIe(document,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new mt(new km(e.h,1,1,1)),i=this.canvas.getContext("2d"),s=i.createLinearGradient(0,0,this.canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=mt.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class $Me extends wt{constructor(e,t){super(),this.model=t,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new rt,this.onColorFlushed=this._onColorFlushed.event,this.domNode=Nt(e,Bg(".strip")),this.overlay=Nt(this.domNode,Bg(".overlay")),this.slider=Nt(this.domNode,Bg(".slider")),this.slider.style.top="0px",this._register(Ine(this.domNode,i=>this.onMouseDown(i))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new Ww),i=Bl(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,_M,o=>this.onDidChangeTop(o.posy-i.top),()=>null);const s=KIe(document,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class WDt extends $Me{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:s}=e.rgba,o=new mt(new Di(t,i,s,1)),r=new mt(new Di(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class GDt extends $Me{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class zDt extends Bd{constructor(e,t,i,s){super(),this.model=t,this.pixelRatio=i,this._register(HIe(()=>this.layout()));const o=Bg(".colorpicker-widget");e.appendChild(o);const r=new HDt(o,this.model,s);this.body=new VDt(o,this.model,this.pixelRatio),this._register(r),this._register(this.body)}layout(){this.body.layout()}}var KDt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jDt=function(n,e){return function(t,i){e(t,i,n)}},Fpe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class XDt{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let IQ=class{constructor(e,t,i){this._editor=e,this._hover=t,this._themeService=i}computeSync(e,t){return[]}computeAsync(e,t,i){return Fpe(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const s=dw.get(this._editor);for(const o of t){if(o.options.description!=="color-detector-color")continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[yield this._createColorHover(this._editor.getModel(),r.colorInfo,r.provider)]}return[]})}_createColorHover(e,t,i){return Fpe(this,void 0,void 0,function*(){const s=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,u=new Di(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new mt(u),f=yield Mpe(e,t,i,Ai.None),g=new BDt(d,[],0);return g.colorPresentations=f||[],g.guessColorPresentation(d,s),new XDt(this,be.lift(t.range),g,i)})}renderHoverParts(e,t,i){if(e.length===0||!this._editor.hasModel())return wt.None;const s=new Wt,o=e[0],r=this._editor.getModel(),a=o.model,c=s.add(new zDt(t,a,this._editor.getOption(127),this._themeService));let u=new be(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);const d=()=>{let g,p;if(a.presentation.textEdit){g=[a.presentation.textEdit],p=new be(a.presentation.textEdit.range.startLineNumber,a.presentation.textEdit.range.startColumn,a.presentation.textEdit.range.endLineNumber,a.presentation.textEdit.range.endColumn);const _=this._editor.getModel()._setTrackedRange(null,p,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",g),p=this._editor.getModel()._getTrackedRange(_)||p}else g=[{identifier:null,range:u,text:a.presentation.label,forceMoveMarkers:!1}],p=u.setEndPosition(u.endLineNumber,u.startColumn+a.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",g);a.presentation.additionalTextEdits&&(g=[...a.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",g),this._hover.hide()),this._editor.pushUndoStop(),u=p},f=g=>Mpe(r,{range:u,color:{red:g.rgba.r/255,green:g.rgba.g/255,blue:g.rgba.b/255,alpha:g.rgba.a}},o.provider,Ai.None).then(p=>{a.colorPresentations=p||[]});return s.add(a.onColorFlushed(g=>{f(g).then(d)})),s.add(a.onDidChangeColor(f)),this._hover.setColorPicker(c),s}};IQ=KDt([jDt(2,fo)],IQ);class xMe{constructor(e,t,i,s,o){this._computer=e,this._state=0,this._hoverTime=o,this._firstWaitScheduler=new ho(()=>this._triggerAsyncComputation(),0),this._secondWaitScheduler=new ho(()=>this._triggerSyncComputation(),0),this._loadingMessageScheduler=new ho(()=>this._showLoadingMessage(),0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=i,this._progressCallback=s}setHoverTime(e){this._hoverTime=e}_firstWaitTime(){return this._hoverTime/2}_secondWaitTime(){return this._hoverTime/2}_loadingMessageTime(){return 3*this._hoverTime}_triggerAsyncComputation(){this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=ul(e=>this._computer.computeAsync(e)),this._asyncComputationPromise.then(e=>{this._asyncComputationPromiseDone=!0,this._withAsyncResult(e)},e=>this._onError(e))):this._asyncComputationPromiseDone=!0}_triggerSyncComputation(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))}_showLoadingMessage(){this._state===3&&this._onProgress(this._computer.getResultWithLoadingMessage())}_withAsyncResult(e){e&&this._computer.onResult(e,!1),this._state===3&&(this._state=0,this._onComplete(this._computer.getResult()))}_onComplete(e){this._completeCallback(e)}_onError(e){this._errorCallback?this._errorCallback(e):di(e)}_onProgress(e){this._progressCallback(e)}start(e){if(e===0)this._state===0&&(this._state=1,this._firstWaitScheduler.schedule(this._firstWaitTime()),this._loadingMessageScheduler.schedule(this._loadingMessageTime()));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._loadingMessageScheduler.cancel(),this._state===1&&this._firstWaitScheduler.cancel(),this._state===2&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),this._state===3&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0}}class Bpe{constructor(e,t){this.priority=e,this.range=t,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class cK{constructor(e,t,i){this.priority=e,this.owner=t,this.range=i,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */function YDt(n){if(Array.isArray(n)){for(var e=0,t=Array(n.length);e<n.length;e++)t[e]=n[e];return t}else return Array.from(n)}var qDt=Object.hasOwnProperty,Hpe=Object.setPrototypeOf,JDt=Object.isFrozen,QDt=Object.getPrototypeOf,ZDt=Object.getOwnPropertyDescriptor,Bu=Object.freeze,vb=Object.seal,e$t=Object.create,PMe=typeof Reflect<"u"&&Reflect,f5=PMe.apply,LQ=PMe.construct;f5||(f5=function(e,t,i){return e.apply(t,i)});Bu||(Bu=function(e){return e});vb||(vb=function(e){return e});LQ||(LQ=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(YDt(t))))});var t$t=lp(Array.prototype.forEach),Vpe=lp(Array.prototype.pop),GN=lp(Array.prototype.push),TS=lp(String.prototype.toLowerCase),Upe=lp(String.prototype.match),BT=lp(String.prototype.replace),n$t=lp(String.prototype.indexOf),i$t=lp(String.prototype.trim),gv=lp(RegExp.prototype.test),Wpe=s$t(TypeError);function lp(n){return function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return f5(n,e,i)}}function s$t(n){return function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return LQ(n,t)}}function Ls(n,e){Hpe&&Hpe(n,null);for(var t=e.length;t--;){var i=e[t];if(typeof i=="string"){var s=TS(i);s!==i&&(JDt(e)||(e[t]=s),i=s)}n[i]=!0}return n}function mS(n){var e=e$t(null),t=void 0;for(t in n)f5(qDt,n,[t])&&(e[t]=n[t]);return e}function IV(n,e){for(;n!==null;){var t=ZDt(n,e);if(t){if(t.get)return lp(t.get);if(typeof t.value=="function")return lp(t.value)}n=QDt(n)}function i(s){return console.warn("fallback value for",s),null}return i}var Gpe=Bu(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uK=Bu(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),dK=Bu(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o$t=Bu(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hK=Bu(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),r$t=Bu(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zpe=Bu(["#text"]),Kpe=Bu(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),fK=Bu(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jpe=Bu(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),LV=Bu(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),l$t=vb(/\{\{[\s\S]*|[\s\S]*\}\}/gm),a$t=vb(/<%[\s\S]*|[\s\S]*%>/gm),c$t=vb(/^data-[\-\w.\u00B7-\uFFFF]/),u$t=vb(/^aria-[\-\w]+$/),d$t=vb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),h$t=vb(/^(?:\w+script|data):/i),f$t=vb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function Zp(n){if(Array.isArray(n)){for(var e=0,t=Array(n.length);e<n.length;e++)t[e]=n[e];return t}else return Array.from(n)}var g$t=function(){return typeof window>"u"?null:window},p$t=function(e,t){if((typeof e>"u"?"undefined":bD(e))!=="object"||typeof e.createPolicy!="function")return null;var i=null,s="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(s)&&(i=t.currentScript.getAttribute(s));var o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:function(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function FMe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g$t(),e=function(me){return FMe(me)};if(e.version="2.3.1",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;var t=n.document,i=n.document,s=n.DocumentFragment,o=n.HTMLTemplateElement,r=n.Node,a=n.Element,c=n.NodeFilter,u=n.NamedNodeMap,d=u===void 0?n.NamedNodeMap||n.MozNamedAttrMap:u,f=n.Text,g=n.Comment,p=n.DOMParser,_=n.trustedTypes,v=a.prototype,C=IV(v,"cloneNode"),y=IV(v,"nextSibling"),w=IV(v,"childNodes"),I=IV(v,"parentNode");if(typeof o=="function"){var L=i.createElement("template");L.content&&L.content.ownerDocument&&(i=L.content.ownerDocument)}var O=p$t(_,t),A=O&&Se?O.createHTML(""):"",N=i,D=N.implementation,P=N.createNodeIterator,F=N.createDocumentFragment,V=N.getElementsByTagName,U=t.importNode,Q={};try{Q=mS(i).documentMode?i.documentMode:{}}catch{}var de={};e.isSupported=typeof I=="function"&&D&&typeof D.createHTMLDocument<"u"&&Q!==9;var q=l$t,K=a$t,re=c$t,Z=u$t,J=h$t,ge=f$t,ve=d$t,Le=null,Ee=Ls({},[].concat(Zp(Gpe),Zp(uK),Zp(dK),Zp(hK),Zp(zpe))),Ne=null,qe=Ls({},[].concat(Zp(Kpe),Zp(fK),Zp(jpe),Zp(LV))),Re=null,we=null,Ve=!0,Ge=!0,dt=!1,ze=!1,ee=!1,ye=!1,Me=!1,et=!1,at=!1,Ue=!0,Se=!1,Ie=!0,Xe=!0,it=!1,Tt={},He=null,ke=Ls({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ot=null,Ct=Ls({},["audio","video","img","source","image","track"]),Gt=null,Ot=Ls({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),En="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml",le=se,Fe=!1,pe=null,je=i.createElement("form"),Ae=function(me){pe&&pe===me||((!me||(typeof me>"u"?"undefined":bD(me))!=="object")&&(me={}),me=mS(me),Le="ALLOWED_TAGS"in me?Ls({},me.ALLOWED_TAGS):Ee,Ne="ALLOWED_ATTR"in me?Ls({},me.ALLOWED_ATTR):qe,Gt="ADD_URI_SAFE_ATTR"in me?Ls(mS(Ot),me.ADD_URI_SAFE_ATTR):Ot,ot="ADD_DATA_URI_TAGS"in me?Ls(mS(Ct),me.ADD_DATA_URI_TAGS):Ct,He="FORBID_CONTENTS"in me?Ls({},me.FORBID_CONTENTS):ke,Re="FORBID_TAGS"in me?Ls({},me.FORBID_TAGS):{},we="FORBID_ATTR"in me?Ls({},me.FORBID_ATTR):{},Tt="USE_PROFILES"in me?me.USE_PROFILES:!1,Ve=me.ALLOW_ARIA_ATTR!==!1,Ge=me.ALLOW_DATA_ATTR!==!1,dt=me.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=me.SAFE_FOR_TEMPLATES||!1,ee=me.WHOLE_DOCUMENT||!1,et=me.RETURN_DOM||!1,at=me.RETURN_DOM_FRAGMENT||!1,Ue=me.RETURN_DOM_IMPORT!==!1,Se=me.RETURN_TRUSTED_TYPE||!1,Me=me.FORCE_BODY||!1,Ie=me.SANITIZE_DOM!==!1,Xe=me.KEEP_CONTENT!==!1,it=me.IN_PLACE||!1,ve=me.ALLOWED_URI_REGEXP||ve,le=me.NAMESPACE||se,ze&&(Ge=!1),at&&(et=!0),Tt&&(Le=Ls({},[].concat(Zp(zpe))),Ne=[],Tt.html===!0&&(Ls(Le,Gpe),Ls(Ne,Kpe)),Tt.svg===!0&&(Ls(Le,uK),Ls(Ne,fK),Ls(Ne,LV)),Tt.svgFilters===!0&&(Ls(Le,dK),Ls(Ne,fK),Ls(Ne,LV)),Tt.mathMl===!0&&(Ls(Le,hK),Ls(Ne,jpe),Ls(Ne,LV))),me.ADD_TAGS&&(Le===Ee&&(Le=mS(Le)),Ls(Le,me.ADD_TAGS)),me.ADD_ATTR&&(Ne===qe&&(Ne=mS(Ne)),Ls(Ne,me.ADD_ATTR)),me.ADD_URI_SAFE_ATTR&&Ls(Gt,me.ADD_URI_SAFE_ATTR),me.FORBID_CONTENTS&&(He===ke&&(He=mS(He)),Ls(He,me.FORBID_CONTENTS)),Xe&&(Le["#text"]=!0),ee&&Ls(Le,["html","head","body"]),Le.table&&(Ls(Le,["tbody"]),delete Re.tbody),Bu&&Bu(me),pe=me)},Et=Ls({},["mi","mo","mn","ms","mtext"]),Tn=Ls({},["foreignobject","desc","title","annotation-xml"]),Hn=Ls({},uK);Ls(Hn,dK),Ls(Hn,o$t);var Xn=Ls({},hK);Ls(Xn,r$t);var vs=function(me){var tt=I(me);(!tt||!tt.tagName)&&(tt={namespaceURI:se,tagName:"template"});var It=TS(me.tagName),kt=TS(tt.tagName);if(me.namespaceURI===fe)return tt.namespaceURI===se?It==="svg":tt.namespaceURI===En?It==="svg"&&(kt==="annotation-xml"||Et[kt]):!!Hn[It];if(me.namespaceURI===En)return tt.namespaceURI===se?It==="math":tt.namespaceURI===fe?It==="math"&&Tn[kt]:!!Xn[It];if(me.namespaceURI===se){if(tt.namespaceURI===fe&&!Tn[kt]||tt.namespaceURI===En&&!Et[kt])return!1;var un=Ls({},["title","style","font","a","script"]);return!Xn[It]&&(un[It]||!Hn[It])}return!1},Zn=function(me){GN(e.removed,{element:me});try{me.parentNode.removeChild(me)}catch{try{me.outerHTML=A}catch{me.remove()}}},Hi=function(me,tt){try{GN(e.removed,{attribute:tt.getAttributeNode(me),from:tt})}catch{GN(e.removed,{attribute:null,from:tt})}if(tt.removeAttribute(me),me==="is"&&!Ne[me])if(et||at)try{Zn(tt)}catch{}else try{tt.setAttribute(me,"")}catch{}},ti=function(me){var tt=void 0,It=void 0;if(Me)me="<remove></remove>"+me;else{var kt=Upe(me,/^[\r\n\t ]+/);It=kt&&kt[0]}var un=O?O.createHTML(me):me;if(le===se)try{tt=new p().parseFromString(un,"text/html")}catch{}if(!tt||!tt.documentElement){tt=D.createDocument(le,"template",null);try{tt.documentElement.innerHTML=Fe?"":un}catch{}}var gt=tt.body||tt.documentElement;return me&&It&>.insertBefore(i.createTextNode(It),gt.childNodes[0]||null),le===se?V.call(tt,ee?"html":"body")[0]:ee?tt.documentElement:gt},Ps=function(me){return P.call(me.ownerDocument||me,me,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},ae=function(me){return me instanceof f||me instanceof g?!1:typeof me.nodeName!="string"||typeof me.textContent!="string"||typeof me.removeChild!="function"||!(me.attributes instanceof d)||typeof me.removeAttribute!="function"||typeof me.setAttribute!="function"||typeof me.namespaceURI!="string"||typeof me.insertBefore!="function"},xe=function(me){return(typeof r>"u"?"undefined":bD(r))==="object"?me instanceof r:me&&(typeof me>"u"?"undefined":bD(me))==="object"&&typeof me.nodeType=="number"&&typeof me.nodeName=="string"},H=function(me,tt,It){de[me]&&t$t(de[me],function(kt){kt.call(e,tt,It,pe)})},j=function(me){var tt=void 0;if(H("beforeSanitizeElements",me,null),ae(me)||Upe(me.nodeName,/[\u0080-\uFFFF]/))return Zn(me),!0;var It=TS(me.nodeName);if(H("uponSanitizeElement",me,{tagName:It,allowedTags:Le}),!xe(me.firstElementChild)&&(!xe(me.content)||!xe(me.content.firstElementChild))&&gv(/<[/\w]/g,me.innerHTML)&&gv(/<[/\w]/g,me.textContent)||It==="select"&&gv(/<template/i,me.innerHTML))return Zn(me),!0;if(!Le[It]||Re[It]){if(Xe&&!He[It]){var kt=I(me)||me.parentNode,un=w(me)||me.childNodes;if(un&&kt)for(var gt=un.length,Ft=gt-1;Ft>=0;--Ft)kt.insertBefore(C(un[Ft],!0),y(me))}return Zn(me),!0}return me instanceof a&&!vs(me)||(It==="noscript"||It==="noembed")&&gv(/<\/no(script|embed)/i,me.innerHTML)?(Zn(me),!0):(ze&&me.nodeType===3&&(tt=me.textContent,tt=BT(tt,q," "),tt=BT(tt,K," "),me.textContent!==tt&&(GN(e.removed,{element:me.cloneNode()}),me.textContent=tt)),H("afterSanitizeElements",me,null),!1)},ue=function(me,tt,It){if(Ie&&(tt==="id"||tt==="name")&&(It in i||It in je))return!1;if(!(Ge&&!we[tt]&&gv(re,tt))){if(!(Ve&&gv(Z,tt))){if(!Ne[tt]||we[tt])return!1;if(!Gt[tt]){if(!gv(ve,BT(It,ge,""))){if(!((tt==="src"||tt==="xlink:href"||tt==="href")&&me!=="script"&&n$t(It,"data:")===0&&ot[me])){if(!(dt&&!gv(J,BT(It,ge,"")))){if(It)return!1}}}}}}return!0},ie=function(me){var tt=void 0,It=void 0,kt=void 0,un=void 0;H("beforeSanitizeAttributes",me,null);var gt=me.attributes;if(gt){var Ft={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne};for(un=gt.length;un--;){tt=gt[un];var pn=tt,Fn=pn.name,Cn=pn.namespaceURI;if(It=i$t(tt.value),kt=TS(Fn),Ft.attrName=kt,Ft.attrValue=It,Ft.keepAttr=!0,Ft.forceKeepAttr=void 0,H("uponSanitizeAttribute",me,Ft),It=Ft.attrValue,!Ft.forceKeepAttr&&(Hi(Fn,me),!!Ft.keepAttr)){if(gv(/\/>/i,It)){Hi(Fn,me);continue}ze&&(It=BT(It,q," "),It=BT(It,K," "));var Fs=me.nodeName.toLowerCase();if(ue(Fs,kt,It))try{Cn?me.setAttributeNS(Cn,Fn,It):me.setAttribute(Fn,It),Vpe(e.removed)}catch{}}}H("afterSanitizeAttributes",me,null)}},Te=function De(me){var tt=void 0,It=Ps(me);for(H("beforeSanitizeShadowDOM",me,null);tt=It.nextNode();)H("uponSanitizeShadowNode",tt,null),!j(tt)&&(tt.content instanceof s&&De(tt.content),ie(tt));H("afterSanitizeShadowDOM",me,null)};return e.sanitize=function(De,me){var tt=void 0,It=void 0,kt=void 0,un=void 0,gt=void 0;if(Fe=!De,Fe&&(De="<!-->"),typeof De!="string"&&!xe(De)){if(typeof De.toString!="function")throw Wpe("toString is not a function");if(De=De.toString(),typeof De!="string")throw Wpe("dirty is not a string, aborting")}if(!e.isSupported){if(bD(n.toStaticHTML)==="object"||typeof n.toStaticHTML=="function"){if(typeof De=="string")return n.toStaticHTML(De);if(xe(De))return n.toStaticHTML(De.outerHTML)}return De}if(ye||Ae(me),e.removed=[],typeof De=="string"&&(it=!1),!it)if(De instanceof r)tt=ti("<!---->"),It=tt.ownerDocument.importNode(De,!0),It.nodeType===1&&It.nodeName==="BODY"||It.nodeName==="HTML"?tt=It:tt.appendChild(It);else{if(!et&&!ze&&!ee&&De.indexOf("<")===-1)return O&&Se?O.createHTML(De):De;if(tt=ti(De),!tt)return et?null:A}tt&&Me&&Zn(tt.firstChild);for(var Ft=Ps(it?De:tt);kt=Ft.nextNode();)kt.nodeType===3&&kt===un||j(kt)||(kt.content instanceof s&&Te(kt.content),ie(kt),un=kt);if(un=null,it)return De;if(et){if(at)for(gt=F.call(tt.ownerDocument);tt.firstChild;)gt.appendChild(tt.firstChild);else gt=tt;return Ue&&(gt=U.call(t,gt,!0)),gt}var pn=ee?tt.outerHTML:tt.innerHTML;return ze&&(pn=BT(pn,q," "),pn=BT(pn,K," ")),O&&Se?O.createHTML(pn):pn},e.setConfig=function(De){Ae(De),ye=!0},e.clearConfig=function(){pe=null,ye=!1},e.isValidAttribute=function(De,me,tt){pe||Ae({});var It=TS(De),kt=TS(me);return ue(It,kt,tt)},e.addHook=function(De,me){typeof me=="function"&&(de[De]=de[De]||[],GN(de[De],me))},e.removeHook=function(De){de[De]&&Vpe(de[De])},e.removeHooks=function(De){de[De]&&(de[De]=[])},e.removeAllHooks=function(){de={}},e}var __=FMe();__.version;__.isSupported;const m$t=__.sanitize;__.setConfig;__.clearConfig;__.isValidAttribute;const Xpe=__.addHook,Ype=__.removeHook;__.removeHooks;__.removeAllHooks;let v_;(function(){function n(e){v_=e()}n.amd=!0,function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof n=="function"&&n.amd?n(t):(e=typeof globalThis<"u"?globalThis:e||self,e.marked=t())}(this,function(){function e(H,j){for(var ue=0;ue<j.length;ue++){var ie=j[ue];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(H,ie.key,ie)}}function t(H,j,ue){return e(H,ue),H}function i(H,j){if(H){if(typeof H=="string")return s(H,j);var ue=Object.prototype.toString.call(H).slice(8,-1);if(ue==="Object"&&H.constructor&&(ue=H.constructor.name),ue==="Map"||ue==="Set")return Array.from(H);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return s(H,j)}}function s(H,j){(j==null||j>H.length)&&(j=H.length);for(var ue=0,ie=new Array(j);ue<j;ue++)ie[ue]=H[ue];return ie}function o(H,j){var ue=typeof Symbol<"u"&&H[Symbol.iterator]||H["@@iterator"];if(ue)return(ue=ue.call(H)).next.bind(ue);if(Array.isArray(H)||(ue=i(H))||j){ue&&(H=ue);var ie=0;return function(){return ie>=H.length?{done:!0}:{done:!1,value:H[ie++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r={exports:{}};function a(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function c(H){r.exports.defaults=H}r.exports={defaults:a(),getDefaults:a,changeDefaults:c};var u=/[&<>"']/,d=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,g=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},_=function(j){return p[j]};function v(H,j){if(j){if(u.test(H))return H.replace(d,_)}else if(f.test(H))return H.replace(g,_);return H}var C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y(H){return H.replace(C,function(j,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var w=/(^|[^\[])\^/g;function I(H,j){H=H.source||H,j=j||"";var ue={replace:function(Te,De){return De=De.source||De,De=De.replace(w,"$1"),H=H.replace(Te,De),ue},getRegex:function(){return new RegExp(H,j)}};return ue}var L=/[^\w:]/g,O=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(H,j,ue){if(H){var ie;try{ie=decodeURIComponent(y(ue)).replace(L,"").toLowerCase()}catch{return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}j&&!O.test(ue)&&(ue=V(j,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch{return null}return ue}var N={},D=/^[^:]+:\/*[^/]*$/,P=/^([^:]+:)[\s\S]*$/,F=/^([^:]+:\/*[^/]*)[\s\S]*$/;function V(H,j){N[" "+H]||(D.test(H)?N[" "+H]=H+"/":N[" "+H]=q(H,"/",!0)),H=N[" "+H];var ue=H.indexOf(":")===-1;return j.substring(0,2)==="//"?ue?j:H.replace(P,"$1")+j:j.charAt(0)==="/"?ue?j:H.replace(F,"$1")+j:H+j}var U={exec:function(){}};function Q(H){for(var j=1,ue,ie;j<arguments.length;j++){ue=arguments[j];for(ie in ue)Object.prototype.hasOwnProperty.call(ue,ie)&&(H[ie]=ue[ie])}return H}function de(H,j){var ue=H.replace(/\|/g,function(De,me,tt){for(var It=!1,kt=me;--kt>=0&&tt[kt]==="\\";)It=!It;return It?"|":" |"}),ie=ue.split(/ \|/),Te=0;if(ie[0].trim()||ie.shift(),ie[ie.length-1].trim()||ie.pop(),ie.length>j)ie.splice(j);else for(;ie.length<j;)ie.push("");for(;Te<ie.length;Te++)ie[Te]=ie[Te].trim().replace(/\\\|/g,"|");return ie}function q(H,j,ue){var ie=H.length;if(ie===0)return"";for(var Te=0;Te<ie;){var De=H.charAt(ie-Te-1);if(De===j&&!ue)Te++;else if(De!==j&&ue)Te++;else break}return H.substr(0,ie-Te)}function K(H,j){if(H.indexOf(j[1])===-1)return-1;for(var ue=H.length,ie=0,Te=0;Te<ue;Te++)if(H[Te]==="\\")Te++;else if(H[Te]===j[0])ie++;else if(H[Te]===j[1]&&(ie--,ie<0))return Te;return-1}function re(H){H&&H.sanitize&&!H.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Z(H,j){if(j<1)return"";for(var ue="";j>1;)j&1&&(ue+=H),j>>=1,H+=H;return ue+H}var J={escape:v,unescape:y,edit:I,cleanUrl:A,resolveUrl:V,noopTest:U,merge:Q,splitCells:de,rtrim:q,findClosingBracket:K,checkSanitizeDeprecation:re,repeatString:Z},ge=r.exports.defaults,ve=J.rtrim,Le=J.splitCells,Ee=J.escape,Ne=J.findClosingBracket;function qe(H,j,ue,ie){var Te=j.href,De=j.title?Ee(j.title):null,me=H[1].replace(/\\([\[\]])/g,"$1");if(H[0].charAt(0)!=="!"){ie.state.inLink=!0;var tt={type:"link",raw:ue,href:Te,title:De,text:me,tokens:ie.inlineTokens(me,[])};return ie.state.inLink=!1,tt}else return{type:"image",raw:ue,href:Te,title:De,text:Ee(me)}}function Re(H,j){var ue=H.match(/^(\s+)(?:```)/);if(ue===null)return j;var ie=ue[1];return j.split(`
- `).map(function(Te){var De=Te.match(/^\s+/);if(De===null)return Te;var me=De[0];return me.length>=ie.length?Te.slice(ie.length):Te}).join(`
- `)}var we=function(){function H(ue){this.options=ue||ge}var j=H.prototype;return j.space=function(ie){var Te=this.rules.block.newline.exec(ie);if(Te)return Te[0].length>1?{type:"space",raw:Te[0]}:{raw:`
- `}},j.code=function(ie){var Te=this.rules.block.code.exec(ie);if(Te){var De=Te[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:Te[0],codeBlockStyle:"indented",text:this.options.pedantic?De:ve(De,`
- `)}}},j.fences=function(ie){var Te=this.rules.block.fences.exec(ie);if(Te){var De=Te[0],me=Re(De,Te[3]||"");return{type:"code",raw:De,lang:Te[2]?Te[2].trim():Te[2],text:me}}},j.heading=function(ie){var Te=this.rules.block.heading.exec(ie);if(Te){var De=Te[2].trim();if(/#$/.test(De)){var me=ve(De,"#");(this.options.pedantic||!me||/ $/.test(me))&&(De=me.trim())}var tt={type:"heading",raw:Te[0],depth:Te[1].length,text:De,tokens:[]};return this.lexer.inline(tt.text,tt.tokens),tt}},j.hr=function(ie){var Te=this.rules.block.hr.exec(ie);if(Te)return{type:"hr",raw:Te[0]}},j.blockquote=function(ie){var Te=this.rules.block.blockquote.exec(ie);if(Te){var De=Te[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Te[0],tokens:this.lexer.blockTokens(De,[]),text:De}}},j.list=function(ie){var Te=this.rules.block.list.exec(ie);if(Te){var De,me,tt,It,kt,un,gt,Ft,pn,Fn,Cn=Te[1].trim(),Fs=Cn.length>1,vi={type:"list",raw:"",ordered:Fs,start:Fs?+Cn.slice(0,-1):"",loose:!1,items:[]};Cn=Fs?"\\d{1,9}\\"+Cn.slice(-1):"\\"+Cn,this.options.pedantic&&(Cn=Fs?Cn:"[*+-]");for(var go=new RegExp("^( {0,3}"+Cn+")((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))");ie&&!(this.rules.block.hr.test(ie)||!(Te=go.exec(ie)));){pn=Te[2].split(`
- `),this.options.pedantic?(It=2,Fn=pn[0].trimLeft()):(It=Te[2].search(/[^ ]/),It=Te[1].length+(It>4?1:It),Fn=pn[0].slice(It-Te[1].length)),un=!1,De=Te[0],!pn[0]&&/^ *$/.test(pn[1])&&(De=Te[1]+pn.slice(0,2).join(`
- `)+`
- `,vi.loose=!0,pn=[]);var gl=new RegExp("^ {0,"+Math.min(3,It-1)+"}(?:[*+-]|\\d{1,9}[.)])");for(kt=1;kt<pn.length;kt++){if(Ft=pn[kt],this.options.pedantic&&(Ft=Ft.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),gl.test(Ft)){De=Te[1]+pn.slice(0,kt).join(`
- `)+`
- `;break}if(!un){Ft.trim()||(un=!0),Ft.search(/[^ ]/)>=It?Fn+=`
- `+Ft.slice(It):Fn+=`
- `+Ft;continue}if(Ft.search(/[^ ]/)>=It||!Ft.trim()){Fn+=`
- `+Ft.slice(It);continue}else{De=Te[1]+pn.slice(0,kt).join(`
- `)+`
- `;break}}vi.loose||(gt?vi.loose=!0:/\n *\n *$/.test(De)&&(gt=!0)),this.options.gfm&&(me=/^\[[ xX]\] /.exec(Fn),me&&(tt=me[0]!=="[ ] ",Fn=Fn.replace(/^\[[ xX]\] +/,""))),vi.items.push({type:"list_item",raw:De,task:!!me,checked:tt,loose:!1,text:Fn}),vi.raw+=De,ie=ie.slice(De.length)}vi.items[vi.items.length-1].raw=De.trimRight(),vi.items[vi.items.length-1].text=Fn.trimRight(),vi.raw=vi.raw.trimRight();var vo=vi.items.length;for(kt=0;kt<vo;kt++)this.lexer.state.top=!1,vi.items[kt].tokens=this.lexer.blockTokens(vi.items[kt].text,[]),vi.items[kt].tokens.some(function(At){return At.type==="space"})&&(vi.loose=!0,vi.items[kt].loose=!0);return vi}},j.html=function(ie){var Te=this.rules.block.html.exec(ie);if(Te){var De={type:"html",raw:Te[0],pre:!this.options.sanitizer&&(Te[1]==="pre"||Te[1]==="script"||Te[1]==="style"),text:Te[0]};return this.options.sanitize&&(De.type="paragraph",De.text=this.options.sanitizer?this.options.sanitizer(Te[0]):Ee(Te[0]),De.tokens=[],this.lexer.inline(De.text,De.tokens)),De}},j.def=function(ie){var Te=this.rules.block.def.exec(ie);if(Te){Te[3]&&(Te[3]=Te[3].substring(1,Te[3].length-1));var De=Te[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:De,raw:Te[0],href:Te[2],title:Te[3]}}},j.table=function(ie){var Te=this.rules.block.table.exec(ie);if(Te){var De={type:"table",header:Le(Te[1]).map(function(gt){return{text:gt}}),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:Te[3]?Te[3].replace(/\n$/,"").split(`
- `):[]};if(De.header.length===De.align.length){De.raw=Te[0];var me=De.align.length,tt,It,kt,un;for(tt=0;tt<me;tt++)/^ *-+: *$/.test(De.align[tt])?De.align[tt]="right":/^ *:-+: *$/.test(De.align[tt])?De.align[tt]="center":/^ *:-+ *$/.test(De.align[tt])?De.align[tt]="left":De.align[tt]=null;for(me=De.rows.length,tt=0;tt<me;tt++)De.rows[tt]=Le(De.rows[tt],De.header.length).map(function(gt){return{text:gt}});for(me=De.header.length,It=0;It<me;It++)De.header[It].tokens=[],this.lexer.inlineTokens(De.header[It].text,De.header[It].tokens);for(me=De.rows.length,It=0;It<me;It++)for(un=De.rows[It],kt=0;kt<un.length;kt++)un[kt].tokens=[],this.lexer.inlineTokens(un[kt].text,un[kt].tokens);return De}}},j.lheading=function(ie){var Te=this.rules.block.lheading.exec(ie);if(Te){var De={type:"heading",raw:Te[0],depth:Te[2].charAt(0)==="="?1:2,text:Te[1],tokens:[]};return this.lexer.inline(De.text,De.tokens),De}},j.paragraph=function(ie){var Te=this.rules.block.paragraph.exec(ie);if(Te){var De={type:"paragraph",raw:Te[0],text:Te[1].charAt(Te[1].length-1)===`
- `?Te[1].slice(0,-1):Te[1],tokens:[]};return this.lexer.inline(De.text,De.tokens),De}},j.text=function(ie){var Te=this.rules.block.text.exec(ie);if(Te){var De={type:"text",raw:Te[0],text:Te[0],tokens:[]};return this.lexer.inline(De.text,De.tokens),De}},j.escape=function(ie){var Te=this.rules.inline.escape.exec(ie);if(Te)return{type:"escape",raw:Te[0],text:Ee(Te[1])}},j.tag=function(ie){var Te=this.rules.inline.tag.exec(ie);if(Te)return!this.lexer.state.inLink&&/^<a /i.test(Te[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(Te[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(Te[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Te[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:Te[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):Ee(Te[0]):Te[0]}},j.link=function(ie){var Te=this.rules.inline.link.exec(ie);if(Te){var De=Te[2].trim();if(!this.options.pedantic&&/^</.test(De)){if(!/>$/.test(De))return;var me=ve(De.slice(0,-1),"\\");if((De.length-me.length)%2===0)return}else{var tt=Ne(Te[2],"()");if(tt>-1){var It=Te[0].indexOf("!")===0?5:4,kt=It+Te[1].length+tt;Te[2]=Te[2].substring(0,tt),Te[0]=Te[0].substring(0,kt).trim(),Te[3]=""}}var un=Te[2],gt="";if(this.options.pedantic){var Ft=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(un);Ft&&(un=Ft[1],gt=Ft[3])}else gt=Te[3]?Te[3].slice(1,-1):"";return un=un.trim(),/^</.test(un)&&(this.options.pedantic&&!/>$/.test(De)?un=un.slice(1):un=un.slice(1,-1)),qe(Te,{href:un&&un.replace(this.rules.inline._escapes,"$1"),title:gt&>.replace(this.rules.inline._escapes,"$1")},Te[0],this.lexer)}},j.reflink=function(ie,Te){var De;if((De=this.rules.inline.reflink.exec(ie))||(De=this.rules.inline.nolink.exec(ie))){var me=(De[2]||De[1]).replace(/\s+/g," ");if(me=Te[me.toLowerCase()],!me||!me.href){var tt=De[0].charAt(0);return{type:"text",raw:tt,text:tt}}return qe(De,me,De[0],this.lexer)}},j.emStrong=function(ie,Te,De){De===void 0&&(De="");var me=this.rules.inline.emStrong.lDelim.exec(ie);if(me&&!(me[3]&&De.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var tt=me[1]||me[2]||"";if(!tt||tt&&(De===""||this.rules.inline.punctuation.exec(De))){var It=me[0].length-1,kt,un,gt=It,Ft=0,pn=me[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(pn.lastIndex=0,Te=Te.slice(-1*ie.length+It);(me=pn.exec(Te))!=null;)if(kt=me[1]||me[2]||me[3]||me[4]||me[5]||me[6],!!kt){if(un=kt.length,me[3]||me[4]){gt+=un;continue}else if((me[5]||me[6])&&It%3&&!((It+un)%3)){Ft+=un;continue}if(gt-=un,!(gt>0)){if(un=Math.min(un,un+gt+Ft),Math.min(It,un)%2){var Fn=ie.slice(1,It+me.index+un);return{type:"em",raw:ie.slice(0,It+me.index+un+1),text:Fn,tokens:this.lexer.inlineTokens(Fn,[])}}var Cn=ie.slice(2,It+me.index+un-1);return{type:"strong",raw:ie.slice(0,It+me.index+un+1),text:Cn,tokens:this.lexer.inlineTokens(Cn,[])}}}}}},j.codespan=function(ie){var Te=this.rules.inline.code.exec(ie);if(Te){var De=Te[2].replace(/\n/g," "),me=/[^ ]/.test(De),tt=/^ /.test(De)&&/ $/.test(De);return me&&tt&&(De=De.substring(1,De.length-1)),De=Ee(De,!0),{type:"codespan",raw:Te[0],text:De}}},j.br=function(ie){var Te=this.rules.inline.br.exec(ie);if(Te)return{type:"br",raw:Te[0]}},j.del=function(ie){var Te=this.rules.inline.del.exec(ie);if(Te)return{type:"del",raw:Te[0],text:Te[2],tokens:this.lexer.inlineTokens(Te[2],[])}},j.autolink=function(ie,Te){var De=this.rules.inline.autolink.exec(ie);if(De){var me,tt;return De[2]==="@"?(me=Ee(this.options.mangle?Te(De[1]):De[1]),tt="mailto:"+me):(me=Ee(De[1]),tt=me),{type:"link",raw:De[0],text:me,href:tt,tokens:[{type:"text",raw:me,text:me}]}}},j.url=function(ie,Te){var De;if(De=this.rules.inline.url.exec(ie)){var me,tt;if(De[2]==="@")me=Ee(this.options.mangle?Te(De[0]):De[0]),tt="mailto:"+me;else{var It;do It=De[0],De[0]=this.rules.inline._backpedal.exec(De[0])[0];while(It!==De[0]);me=Ee(De[0]),De[1]==="www."?tt="http://"+me:tt=me}return{type:"link",raw:De[0],text:me,href:tt,tokens:[{type:"text",raw:me,text:me}]}}},j.inlineText=function(ie,Te){var De=this.rules.inline.text.exec(ie);if(De){var me;return this.lexer.state.inRawBlock?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):Ee(De[0]):De[0]:me=Ee(this.options.smartypants?Te(De[0]):De[0]),{type:"text",raw:De[0],text:me}}},H}(),Ve=J.noopTest,Ge=J.edit,dt=J.merge,ze={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:Ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};ze._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ze._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ze.def=Ge(ze.def).replace("label",ze._label).replace("title",ze._title).getRegex(),ze.bullet=/(?:[*+-]|\d{1,9}[.)])/,ze.listItemStart=Ge(/^( *)(bull) */).replace("bull",ze.bullet).getRegex(),ze.list=Ge(ze.list).replace(/bull/g,ze.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ze.def.source+")").getRegex(),ze._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ze._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ze.html=Ge(ze.html,"i").replace("comment",ze._comment).replace("tag",ze._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ze.paragraph=Ge(ze._paragraph).replace("hr",ze.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ze._tag).getRegex(),ze.blockquote=Ge(ze.blockquote).replace("paragraph",ze.paragraph).getRegex(),ze.normal=dt({},ze),ze.gfm=dt({},ze.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ze.gfm.table=Ge(ze.gfm.table).replace("hr",ze.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ze._tag).getRegex(),ze.pedantic=dt({},ze.normal,{html:Ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ze._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ve,paragraph:Ge(ze.normal._paragraph).replace("hr",ze.hr).replace("heading",` *#{1,6} *[^
- ]`).replace("lheading",ze.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ve,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ve,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ee._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ee.punctuation=Ge(ee.punctuation).replace(/punctuation/g,ee._punctuation).getRegex(),ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ee.escapedEmSt=/\\\*|\\_/g,ee._comment=Ge(ze._comment).replace("(?:-->|$)","-->").getRegex(),ee.emStrong.lDelim=Ge(ee.emStrong.lDelim).replace(/punct/g,ee._punctuation).getRegex(),ee.emStrong.rDelimAst=Ge(ee.emStrong.rDelimAst,"g").replace(/punct/g,ee._punctuation).getRegex(),ee.emStrong.rDelimUnd=Ge(ee.emStrong.rDelimUnd,"g").replace(/punct/g,ee._punctuation).getRegex(),ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ee.autolink=Ge(ee.autolink).replace("scheme",ee._scheme).replace("email",ee._email).getRegex(),ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ee.tag=Ge(ee.tag).replace("comment",ee._comment).replace("attribute",ee._attribute).getRegex(),ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ee.link=Ge(ee.link).replace("label",ee._label).replace("href",ee._href).replace("title",ee._title).getRegex(),ee.reflink=Ge(ee.reflink).replace("label",ee._label).getRegex(),ee.reflinkSearch=Ge(ee.reflinkSearch,"g").replace("reflink",ee.reflink).replace("nolink",ee.nolink).getRegex(),ee.normal=dt({},ee),ee.pedantic=dt({},ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ge(/^!?\[(label)\]\((.*?)\)/).replace("label",ee._label).getRegex(),reflink:Ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee._label).getRegex()}),ee.gfm=dt({},ee.normal,{escape:Ge(ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),ee.gfm.url=Ge(ee.gfm.url,"i").replace("email",ee.gfm._extended_email).getRegex(),ee.breaks=dt({},ee.gfm,{br:Ge(ee.br).replace("{2,}","*").getRegex(),text:Ge(ee.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ye={block:ze,inline:ee},Me=we,et=r.exports.defaults,at=ye.block,Ue=ye.inline,Se=J.repeatString;function Ie(H){return H.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Xe(H){var j="",ue,ie,Te=H.length;for(ue=0;ue<Te;ue++)ie=H.charCodeAt(ue),Math.random()>.5&&(ie="x"+ie.toString(16)),j+="&#"+ie+";";return j}var it=function(){function H(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||et,this.options.tokenizer=this.options.tokenizer||new Me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var ie={block:at.normal,inline:Ue.normal};this.options.pedantic?(ie.block=at.pedantic,ie.inline=Ue.pedantic):this.options.gfm&&(ie.block=at.gfm,this.options.breaks?ie.inline=Ue.breaks:ie.inline=Ue.gfm),this.tokenizer.rules=ie}H.lex=function(ie,Te){var De=new H(Te);return De.lex(ie)},H.lexInline=function(ie,Te){var De=new H(Te);return De.inlineTokens(ie)};var j=H.prototype;return j.lex=function(ie){ie=ie.replace(/\r\n|\r/g,`
- `).replace(/\t/g," "),this.blockTokens(ie,this.tokens);for(var Te;Te=this.inlineQueue.shift();)this.inlineTokens(Te.src,Te.tokens);return this.tokens},j.blockTokens=function(ie,Te){var De=this;Te===void 0&&(Te=[]),this.options.pedantic&&(ie=ie.replace(/^ +$/gm,""));for(var me,tt,It,kt;ie;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(gt){return(me=gt.call({lexer:De},ie,Te))?(ie=ie.substring(me.raw.length),Te.push(me),!0):!1}))){if(me=this.tokenizer.space(ie)){ie=ie.substring(me.raw.length),me.type&&Te.push(me);continue}if(me=this.tokenizer.code(ie)){ie=ie.substring(me.raw.length),tt=Te[Te.length-1],tt&&(tt.type==="paragraph"||tt.type==="text")?(tt.raw+=`
- `+me.raw,tt.text+=`
- `+me.text,this.inlineQueue[this.inlineQueue.length-1].src=tt.text):Te.push(me);continue}if(me=this.tokenizer.fences(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.heading(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.hr(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.blockquote(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.list(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.html(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.def(ie)){ie=ie.substring(me.raw.length),tt=Te[Te.length-1],tt&&(tt.type==="paragraph"||tt.type==="text")?(tt.raw+=`
- `+me.raw,tt.text+=`
- `+me.raw,this.inlineQueue[this.inlineQueue.length-1].src=tt.text):this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.lheading(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(It=ie,this.options.extensions&&this.options.extensions.startBlock&&function(){var gt=1/0,Ft=ie.slice(1),pn=void 0;De.options.extensions.startBlock.forEach(function(Fn){pn=Fn.call({lexer:this},Ft),typeof pn=="number"&&pn>=0&&(gt=Math.min(gt,pn))}),gt<1/0&>>=0&&(It=ie.substring(0,gt+1))}(),this.state.top&&(me=this.tokenizer.paragraph(It))){tt=Te[Te.length-1],kt&&tt.type==="paragraph"?(tt.raw+=`
- `+me.raw,tt.text+=`
- `+me.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=tt.text):Te.push(me),kt=It.length!==ie.length,ie=ie.substring(me.raw.length);continue}if(me=this.tokenizer.text(ie)){ie=ie.substring(me.raw.length),tt=Te[Te.length-1],tt&&tt.type==="text"?(tt.raw+=`
- `+me.raw,tt.text+=`
- `+me.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=tt.text):Te.push(me);continue}if(ie){var un="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(un);break}else throw new Error(un)}}return this.state.top=!0,Te},j.inline=function(ie,Te){this.inlineQueue.push({src:ie,tokens:Te})},j.inlineTokens=function(ie,Te){var De=this;Te===void 0&&(Te=[]);var me,tt,It,kt=ie,un,gt,Ft;if(this.tokens.links){var pn=Object.keys(this.tokens.links);if(pn.length>0)for(;(un=this.tokenizer.rules.inline.reflinkSearch.exec(kt))!=null;)pn.includes(un[0].slice(un[0].lastIndexOf("[")+1,-1))&&(kt=kt.slice(0,un.index)+"["+Se("a",un[0].length-2)+"]"+kt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(un=this.tokenizer.rules.inline.blockSkip.exec(kt))!=null;)kt=kt.slice(0,un.index)+"["+Se("a",un[0].length-2)+"]"+kt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(un=this.tokenizer.rules.inline.escapedEmSt.exec(kt))!=null;)kt=kt.slice(0,un.index)+"++"+kt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ie;)if(gt||(Ft=""),gt=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Cn){return(me=Cn.call({lexer:De},ie,Te))?(ie=ie.substring(me.raw.length),Te.push(me),!0):!1}))){if(me=this.tokenizer.escape(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.tag(ie)){ie=ie.substring(me.raw.length),tt=Te[Te.length-1],tt&&me.type==="text"&&tt.type==="text"?(tt.raw+=me.raw,tt.text+=me.text):Te.push(me);continue}if(me=this.tokenizer.link(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(me.raw.length),tt=Te[Te.length-1],tt&&me.type==="text"&&tt.type==="text"?(tt.raw+=me.raw,tt.text+=me.text):Te.push(me);continue}if(me=this.tokenizer.emStrong(ie,kt,Ft)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.codespan(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.br(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.del(ie)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(me=this.tokenizer.autolink(ie,Xe)){ie=ie.substring(me.raw.length),Te.push(me);continue}if(!this.state.inLink&&(me=this.tokenizer.url(ie,Xe))){ie=ie.substring(me.raw.length),Te.push(me);continue}if(It=ie,this.options.extensions&&this.options.extensions.startInline&&function(){var Cn=1/0,Fs=ie.slice(1),vi=void 0;De.options.extensions.startInline.forEach(function(go){vi=go.call({lexer:this},Fs),typeof vi=="number"&&vi>=0&&(Cn=Math.min(Cn,vi))}),Cn<1/0&&Cn>=0&&(It=ie.substring(0,Cn+1))}(),me=this.tokenizer.inlineText(It,Ie)){ie=ie.substring(me.raw.length),me.raw.slice(-1)!=="_"&&(Ft=me.raw.slice(-1)),gt=!0,tt=Te[Te.length-1],tt&&tt.type==="text"?(tt.raw+=me.raw,tt.text+=me.text):Te.push(me);continue}if(ie){var Fn="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Fn);break}else throw new Error(Fn)}}return Te},t(H,null,[{key:"rules",get:function(){return{block:at,inline:Ue}}}]),H}(),Tt=r.exports.defaults,He=J.cleanUrl,ke=J.escape,ot=function(){function H(ue){this.options=ue||Tt}var j=H.prototype;return j.code=function(ie,Te,De){var me=(Te||"").match(/\S*/)[0];if(this.options.highlight){var tt=this.options.highlight(ie,me);tt!=null&&tt!==ie&&(De=!0,ie=tt)}return ie=ie.replace(/\n$/,"")+`
- `,me?'<pre><code class="'+this.options.langPrefix+ke(me,!0)+'">'+(De?ie:ke(ie,!0))+`</code></pre>
- `:"<pre><code>"+(De?ie:ke(ie,!0))+`</code></pre>
- `},j.blockquote=function(ie){return`<blockquote>
- `+ie+`</blockquote>
- `},j.html=function(ie){return ie},j.heading=function(ie,Te,De,me){return this.options.headerIds?"<h"+Te+' id="'+this.options.headerPrefix+me.slug(De)+'">'+ie+"</h"+Te+`>
- `:"<h"+Te+">"+ie+"</h"+Te+`>
- `},j.hr=function(){return this.options.xhtml?`<hr/>
- `:`<hr>
- `},j.list=function(ie,Te,De){var me=Te?"ol":"ul",tt=Te&&De!==1?' start="'+De+'"':"";return"<"+me+tt+`>
- `+ie+"</"+me+`>
- `},j.listitem=function(ie){return"<li>"+ie+`</li>
- `},j.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},j.paragraph=function(ie){return"<p>"+ie+`</p>
- `},j.table=function(ie,Te){return Te&&(Te="<tbody>"+Te+"</tbody>"),`<table>
- <thead>
- `+ie+`</thead>
- `+Te+`</table>
- `},j.tablerow=function(ie){return`<tr>
- `+ie+`</tr>
- `},j.tablecell=function(ie,Te){var De=Te.header?"th":"td",me=Te.align?"<"+De+' align="'+Te.align+'">':"<"+De+">";return me+ie+"</"+De+`>
- `},j.strong=function(ie){return"<strong>"+ie+"</strong>"},j.em=function(ie){return"<em>"+ie+"</em>"},j.codespan=function(ie){return"<code>"+ie+"</code>"},j.br=function(){return this.options.xhtml?"<br/>":"<br>"},j.del=function(ie){return"<del>"+ie+"</del>"},j.link=function(ie,Te,De){if(ie=He(this.options.sanitize,this.options.baseUrl,ie),ie===null)return De;var me='<a href="'+ke(ie)+'"';return Te&&(me+=' title="'+Te+'"'),me+=">"+De+"</a>",me},j.image=function(ie,Te,De){if(ie=He(this.options.sanitize,this.options.baseUrl,ie),ie===null)return De;var me='<img src="'+ie+'" alt="'+De+'"';return Te&&(me+=' title="'+Te+'"'),me+=this.options.xhtml?"/>":">",me},j.text=function(ie){return ie},H}(),Ct=function(){function H(){}var j=H.prototype;return j.strong=function(ie){return ie},j.em=function(ie){return ie},j.codespan=function(ie){return ie},j.del=function(ie){return ie},j.html=function(ie){return ie},j.text=function(ie){return ie},j.link=function(ie,Te,De){return""+De},j.image=function(ie,Te,De){return""+De},j.br=function(){return""},H}(),Gt=function(){function H(){this.seen={}}var j=H.prototype;return j.serialize=function(ie){return ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},j.getNextSafeSlug=function(ie,Te){var De=ie,me=0;if(this.seen.hasOwnProperty(De)){me=this.seen[ie];do me++,De=ie+"-"+me;while(this.seen.hasOwnProperty(De))}return Te||(this.seen[ie]=me,this.seen[De]=0),De},j.slug=function(ie,Te){Te===void 0&&(Te={});var De=this.serialize(ie);return this.getNextSafeSlug(De,Te.dryrun)},H}(),Ot=ot,En=Ct,fe=Gt,se=r.exports.defaults,le=J.unescape,Fe=function(){function H(ue){this.options=ue||se,this.options.renderer=this.options.renderer||new Ot,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new En,this.slugger=new fe}H.parse=function(ie,Te){var De=new H(Te);return De.parse(ie)},H.parseInline=function(ie,Te){var De=new H(Te);return De.parseInline(ie)};var j=H.prototype;return j.parse=function(ie,Te){Te===void 0&&(Te=!0);var De="",me,tt,It,kt,un,gt,Ft,pn,Fn,Cn,Fs,vi,go,gl,vo,At,In,Yn,bi,Ur=ie.length;for(me=0;me<Ur;me++){if(Cn=ie[me],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Cn.type]&&(bi=this.options.extensions.renderers[Cn.type].call({parser:this},Cn),bi!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Cn.type))){De+=bi||"";continue}switch(Cn.type){case"space":continue;case"hr":{De+=this.renderer.hr();continue}case"heading":{De+=this.renderer.heading(this.parseInline(Cn.tokens),Cn.depth,le(this.parseInline(Cn.tokens,this.textRenderer)),this.slugger);continue}case"code":{De+=this.renderer.code(Cn.text,Cn.lang,Cn.escaped);continue}case"table":{for(pn="",Ft="",kt=Cn.header.length,tt=0;tt<kt;tt++)Ft+=this.renderer.tablecell(this.parseInline(Cn.header[tt].tokens),{header:!0,align:Cn.align[tt]});for(pn+=this.renderer.tablerow(Ft),Fn="",kt=Cn.rows.length,tt=0;tt<kt;tt++){for(gt=Cn.rows[tt],Ft="",un=gt.length,It=0;It<un;It++)Ft+=this.renderer.tablecell(this.parseInline(gt[It].tokens),{header:!1,align:Cn.align[It]});Fn+=this.renderer.tablerow(Ft)}De+=this.renderer.table(pn,Fn);continue}case"blockquote":{Fn=this.parse(Cn.tokens),De+=this.renderer.blockquote(Fn);continue}case"list":{for(Fs=Cn.ordered,vi=Cn.start,go=Cn.loose,kt=Cn.items.length,Fn="",tt=0;tt<kt;tt++)vo=Cn.items[tt],At=vo.checked,In=vo.task,gl="",vo.task&&(Yn=this.renderer.checkbox(At),go?vo.tokens.length>0&&vo.tokens[0].type==="paragraph"?(vo.tokens[0].text=Yn+" "+vo.tokens[0].text,vo.tokens[0].tokens&&vo.tokens[0].tokens.length>0&&vo.tokens[0].tokens[0].type==="text"&&(vo.tokens[0].tokens[0].text=Yn+" "+vo.tokens[0].tokens[0].text)):vo.tokens.unshift({type:"text",text:Yn}):gl+=Yn),gl+=this.parse(vo.tokens,go),Fn+=this.renderer.listitem(gl,In,At);De+=this.renderer.list(Fn,Fs,vi);continue}case"html":{De+=this.renderer.html(Cn.text);continue}case"paragraph":{De+=this.renderer.paragraph(this.parseInline(Cn.tokens));continue}case"text":{for(Fn=Cn.tokens?this.parseInline(Cn.tokens):Cn.text;me+1<Ur&&ie[me+1].type==="text";)Cn=ie[++me],Fn+=`
- `+(Cn.tokens?this.parseInline(Cn.tokens):Cn.text);De+=Te?this.renderer.paragraph(Fn):Fn;continue}default:{var Yl='Token with "'+Cn.type+'" type was not found.';if(this.options.silent){console.error(Yl);return}else throw new Error(Yl)}}}return De},j.parseInline=function(ie,Te){Te=Te||this.renderer;var De="",me,tt,It,kt=ie.length;for(me=0;me<kt;me++){if(tt=ie[me],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[tt.type]&&(It=this.options.extensions.renderers[tt.type].call({parser:this},tt),It!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(tt.type))){De+=It||"";continue}switch(tt.type){case"escape":{De+=Te.text(tt.text);break}case"html":{De+=Te.html(tt.text);break}case"link":{De+=Te.link(tt.href,tt.title,this.parseInline(tt.tokens,Te));break}case"image":{De+=Te.image(tt.href,tt.title,tt.text);break}case"strong":{De+=Te.strong(this.parseInline(tt.tokens,Te));break}case"em":{De+=Te.em(this.parseInline(tt.tokens,Te));break}case"codespan":{De+=Te.codespan(tt.text);break}case"br":{De+=Te.br();break}case"del":{De+=Te.del(this.parseInline(tt.tokens,Te));break}case"text":{De+=Te.text(tt.text);break}default:{var un='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(un);return}else throw new Error(un)}}}return De},H}(),pe=it,je=Fe,Ae=we,Et=ot,Tn=Ct,Hn=Gt,Xn=J.merge,vs=J.checkSanitizeDeprecation,Zn=J.escape,Hi=r.exports.getDefaults,ti=r.exports.changeDefaults,Ps=r.exports.defaults;function ae(H,j,ue){if(typeof H>"u"||H===null)throw new Error("marked(): input parameter is undefined or null");if(typeof H!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(H)+", string expected");if(typeof j=="function"&&(ue=j,j=null),j=Xn({},ae.defaults,j||{}),vs(j),ue){var ie=j.highlight,Te;try{Te=pe.lex(H,j)}catch(It){return ue(It)}var De=function(kt){var un;if(!kt)try{j.walkTokens&&ae.walkTokens(Te,j.walkTokens),un=je.parse(Te,j)}catch(gt){kt=gt}return j.highlight=ie,kt?ue(kt):ue(null,un)};if(!ie||ie.length<3||(delete j.highlight,!Te.length))return De();var me=0;ae.walkTokens(Te,function(It){It.type==="code"&&(me++,setTimeout(function(){ie(It.text,It.lang,function(kt,un){if(kt)return De(kt);un!=null&&un!==It.text&&(It.text=un,It.escaped=!0),me--,me===0&&De()})},0))}),me===0&&De();return}try{var tt=pe.lex(H,j);return j.walkTokens&&ae.walkTokens(tt,j.walkTokens),je.parse(tt,j)}catch(It){if(It.message+=`
- Please report this to https://github.com/markedjs/marked.`,j.silent)return"<p>An error occurred:</p><pre>"+Zn(It.message+"",!0)+"</pre>";throw It}}ae.options=ae.setOptions=function(H){return Xn(ae.defaults,H),ti(ae.defaults),ae},ae.getDefaults=Hi,ae.defaults=Ps,ae.use=function(){for(var H=this,j=arguments.length,ue=new Array(j),ie=0;ie<j;ie++)ue[ie]=arguments[ie];var Te=Xn.apply(void 0,[{}].concat(ue)),De=ae.defaults.extensions||{renderers:{},childTokens:{}},me;ue.forEach(function(tt){if(tt.extensions&&(me=!0,tt.extensions.forEach(function(kt){if(!kt.name)throw new Error("extension name required");if(kt.renderer){var un=De.renderers?De.renderers[kt.name]:null;un?De.renderers[kt.name]=function(){for(var gt=arguments.length,Ft=new Array(gt),pn=0;pn<gt;pn++)Ft[pn]=arguments[pn];var Fn=kt.renderer.apply(this,Ft);return Fn===!1&&(Fn=un.apply(this,Ft)),Fn}:De.renderers[kt.name]=kt.renderer}if(kt.tokenizer){if(!kt.level||kt.level!=="block"&&kt.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");De[kt.level]?De[kt.level].unshift(kt.tokenizer):De[kt.level]=[kt.tokenizer],kt.start&&(kt.level==="block"?De.startBlock?De.startBlock.push(kt.start):De.startBlock=[kt.start]:kt.level==="inline"&&(De.startInline?De.startInline.push(kt.start):De.startInline=[kt.start]))}kt.childTokens&&(De.childTokens[kt.name]=kt.childTokens)})),tt.renderer&&function(){var kt=ae.defaults.renderer||new Et,un=function(pn){var Fn=kt[pn];kt[pn]=function(){for(var Cn=arguments.length,Fs=new Array(Cn),vi=0;vi<Cn;vi++)Fs[vi]=arguments[vi];var go=tt.renderer[pn].apply(kt,Fs);return go===!1&&(go=Fn.apply(kt,Fs)),go}};for(var gt in tt.renderer)un(gt);Te.renderer=kt}(),tt.tokenizer&&function(){var kt=ae.defaults.tokenizer||new Ae,un=function(pn){var Fn=kt[pn];kt[pn]=function(){for(var Cn=arguments.length,Fs=new Array(Cn),vi=0;vi<Cn;vi++)Fs[vi]=arguments[vi];var go=tt.tokenizer[pn].apply(kt,Fs);return go===!1&&(go=Fn.apply(kt,Fs)),go}};for(var gt in tt.tokenizer)un(gt);Te.tokenizer=kt}(),tt.walkTokens){var It=ae.defaults.walkTokens;Te.walkTokens=function(kt){tt.walkTokens.call(H,kt),It&&It(kt)}}me&&(Te.extensions=De),ae.setOptions(Te)})},ae.walkTokens=function(H,j){for(var ue=function(){var me=Te.value;switch(j(me),me.type){case"table":{for(var tt=o(me.header),It;!(It=tt()).done;){var kt=It.value;ae.walkTokens(kt.tokens,j)}for(var un=o(me.rows),gt;!(gt=un()).done;)for(var Ft=gt.value,pn=o(Ft),Fn;!(Fn=pn()).done;){var Cn=Fn.value;ae.walkTokens(Cn.tokens,j)}break}case"list":{ae.walkTokens(me.items,j);break}default:ae.defaults.extensions&&ae.defaults.extensions.childTokens&&ae.defaults.extensions.childTokens[me.type]?ae.defaults.extensions.childTokens[me.type].forEach(function(Fs){ae.walkTokens(me[Fs],j)}):me.tokens&&ae.walkTokens(me.tokens,j)}},ie=o(H),Te;!(Te=ie()).done;)ue()},ae.parseInline=function(H,j){if(typeof H>"u"||H===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof H!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(H)+", string expected");j=Xn({},ae.defaults,j||{}),vs(j);try{var ue=pe.lexInline(H,j);return j.walkTokens&&ae.walkTokens(ue,j.walkTokens),je.parseInline(ue,j)}catch(ie){if(ie.message+=`
- Please report this to https://github.com/markedjs/marked.`,j.silent)return"<p>An error occurred:</p><pre>"+Zn(ie.message+"",!0)+"</pre>";throw ie}},ae.Parser=je,ae.parser=je.parse,ae.Renderer=Et,ae.TextRenderer=Tn,ae.Lexer=pe,ae.lexer=pe.lex,ae.Tokenizer=Ae,ae.Slugger=Hn,ae.parse=ae;var xe=ae;return xe})})();v_.Parser;v_.parser;var _$t=v_.Renderer;v_.TextRenderer;v_.Lexer;v_.lexer;v_.Tokenizer;v_.Slugger;var v$t=v_.parse;function b$t(n,e={},t={}){var i;const s=new Wt;let o=!1;const r=s.add(new dc),a=Lse(e),c=function(v){let C;try{C=bq(decodeURIComponent(v))}catch{}return C?(C=xbt(C,y=>{if(n.uris&&n.uris[y])return Jn.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(C))):v},u=function(v,C){const y=n.uris&&n.uris[v];if(!y)return v;let w=Jn.revive(y);return C?v.startsWith(Ii.data+":")?v:GIe.asBrowserUri(w).toString(!0):Jn.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:c(w.query)})),w.toString())};let d;const f=new Promise(v=>d=v),g=new _$t;if(g.image=(v,C,y)=>{let w=[],I=[];if(v){({href:v,dimensions:w}=ZMt(v)),v=u(v,!0);try{const L=Jn.parse(v);e.baseUrl&&L.scheme===Ii.file&&(v=khe(e.baseUrl,v).toString())}catch{}I.push(`src="${v}"`)}return y&&I.push(`alt="${y}"`),C&&I.push(`title="${C}"`),w.length&&(I=I.concat(w)),"<img "+I.join(" ")+">"},g.link=(v,C,y)=>(v===y&&(y=G7(y)),v=u(v,!1),e.baseUrl&&(/^\w[\w\d+.-]*:/.test(v)||(v=khe(e.baseUrl,v).toString())),C=G7(C),v=G7(v),!v||v.match(/^data:|javascript:/i)||v.match(/^command:/i)&&!n.isTrusted||v.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)?y:(v=v.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="#" data-href="${v}" title="${C||v}">${y}</a>`)),g.paragraph=v=>`<p>${v}</p>`,e.codeBlockRenderer&&(g.code=(v,C)=>{const y=e.codeBlockRenderer(C,v),w=CRe.nextId();return Sne(Promise.all([y,f]),r.token).then(I=>{var L;if(!o&&I){const O=a.querySelector(`div[data-code="${w}"]`);O&&oy(O,I[0]),(L=e.asyncRenderCallback)===null||L===void 0||L.call(e)}}).catch(()=>{}),`<div class="code" data-code="${w}">${Mne(v)}</div>`}),e.actionHandler){const v=e.actionHandler.disposables.add(new Zs(a,"click")),C=e.actionHandler.disposables.add(new Zs(a,"auxclick"));e.actionHandler.disposables.add(Ln.any(v.event,C.event)(y=>{const w=new fh(y);if(!w.leftButton&&!w.middleButton)return;let I=w.target;if(!(I.tagName!=="A"&&(I=I.parentElement,!I||I.tagName!=="A")))try{const L=I.dataset.href;L&&e.actionHandler.callback(L,w)}catch(L){di(L)}finally{w.preventDefault()}}))}n.supportHtml||(t.sanitizer=v=>(n.isTrusted?v.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=g;let p=(i=n.value)!==null&&i!==void 0?i:"";p.length>1e5&&(p=`${p.substr(0,1e5)}…`),n.supportThemeIcons&&(p=sRt(p));let _=v$t(p,t);if(n.supportThemeIcons&&(_=I0(_).map(C=>typeof C=="string"?C:C.outerHTML).join("")),a.innerHTML=T$t(n,_),d(),e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const C=s.add(Pt(v,"load",()=>{C.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{o=!0,r.cancel(),s.dispose()}}}function T$t(n,e){const{config:t,allowedSchemes:i}=C$t(n);Xpe("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}});const s=document.createElement("a");Xpe("afterSanitizeAttributes",o=>{for(const r of["href","src"])o.hasAttribute(r)&&(s.href=o.getAttribute(r),i.includes(s.protocol.replace(/:$/,""))||o.removeAttribute(r))});try{return m$t(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{Ype("uponSanitizeAttribute"),Ype("afterSanitizeAttributes")}}function C$t(n){const e=[Ii.http,Ii.https,Ii.mailto,Ii.data,Ii.file,Ii.vscodeFileResource,Ii.vscodeRemote,Ii.vscodeRemoteResource];return n.isTrusted&&e.push(Ii.command),{config:{ALLOWED_TAGS:["ul","li","p","b","i","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],ALLOWED_ATTR:["href","data-href","target","title","src","alt","class","style","data-code","width","height","align"],ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}var y$t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qpe=function(n,e){return function(t,i){e(t,i,n)}},E$t=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},gK;let by=class BMe{constructor(e,t,i){this._options=e,this._modeService=t,this._openerService=i,this._onDidRenderAsync=new rt,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new Wt;return{element:s.add(b$t(e,Object.assign(Object.assign({},this._getRenderOptions(e,s)),t),i)).element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{baseUrl:this._options.baseUrl,codeBlockRenderer:(i,s)=>E$t(this,void 0,void 0,function*(){var o,r,a,c;let u;i?u=this._modeService.getModeIdForLanguageName(i):this._options.editor&&(u=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),u||(u="plaintext"),this._modeService.triggerMode(u);const d=(r=yield $o.getPromise(u))!==null&&r!==void 0?r:void 0,f=document.createElement("span");if(f.innerHTML=(c=(a=BMe._ttpTokenizer)===null||a===void 0?void 0:a.createHTML(s,this._modeService.languageIdCodec,d))!==null&&c!==void 0?c:bOe(s,this._modeService.languageIdCodec,d),this._options.editor){const g=this._options.editor.getOption(43);Ea.applyFontInfoSlow(f,g)}else this._options.codeBlockFontFamily&&(f.style.fontFamily=this._options.codeBlockFontFamily);return f}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>this._openerService.open(i,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:e.isTrusted}).catch(di),disposables:t}}}};by._ttpTokenizer=(gK=window.trustedTypes)===null||gK===void 0?void 0:gK.createPolicy("tokenizeToString",{createHTML(n,e,t){return bOe(n,e,t)}});by=y$t([qpe(1,Ga),qpe(2,np)],by);function HMe(n,e,t){const s=Sx.ordered(n).map(o=>Promise.resolve(o.provideHover(n,e,t)).then(r=>r&&S$t(r)?r:void 0,r=>{Ol(r)}));return Promise.all(s).then(Bw)}f_("_executeHoverProvider",(n,e)=>HMe(n,e,Ai.None));function S$t(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var w$t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pK=function(n,e){return function(t,i){e(t,i,n)}},I$t=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const Jpe=Vt;class OV{constructor(e,t,i){this.owner=e,this.range=t,this.contents=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let OQ=class{constructor(e,t,i,s,o){this._editor=e,this._hover=t,this._modeService=i,this._openerService=s,this._configurationService=o}createLoadingMessage(e){return new OV(this,e.range,[new mb().appendText($("modesContentHover.loading","Loading..."))])}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const d of t){const f=d.range.startLineNumber===s?d.range.startColumn:1,g=d.range.endLineNumber===s?d.range.endColumn:o,p=d.options.hoverMessage;if(!p||p$(p))continue;const _=new be(e.range.startLineNumber,f,e.range.startLineNumber,g);r.push(new OV(this,_,qne(p)))}const a=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});return typeof u=="number"&&a>=u&&r.push(new OV(this,e.range,[{value:$("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}])),r}computeAsync(e,t,i){return I$t(this,void 0,void 0,function*(){if(!this._editor.hasModel()||e.type!==1)return Promise.resolve([]);const s=this._editor.getModel();if(!Sx.has(s))return Promise.resolve([]);const o=yield HMe(s,new ct(e.range.startLineNumber,e.range.startColumn),i),r=[];for(const a of o){if(p$(a.contents))continue;const c=a.range?be.lift(a.range):e.range;r.push(new OV(this,c,a.contents))}return r})}renderHoverParts(e,t,i){const s=new Wt;for(const o of e)for(const r of o.contents){if(p$(r))continue;const a=Jpe("div.hover-row.markdown-hover"),c=Nt(a,Jpe("div.hover-contents")),u=s.add(new by({editor:this._editor},this._modeService,this._openerService));s.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",this._hover.onContentsChanged()}));const d=s.add(u.render(r));c.appendChild(d.element),t.appendChild(a)}return s}};OQ=w$t([pK(2,Ga),pK(3,np),pK(4,Yo)],OQ);var VMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},UMe=function(n,e){return function(t,i){e(t,i,n)}};class Qpe{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let RQ=class WMe{constructor(e,t){this._markerService=t,this._onDidChange=new rt,this.onDidChange=this._onDidChange.event,this._dispoables=new Wt,this._markers=[],this._nextIdx=-1,Jn.isUri(e)?this._resourceFilter=s=>s.toString()===e.toString():e&&(this._resourceFilter=e);const i=()=>{this._markers=this._markerService.read({resource:Jn.isUri(e)?e:void 0,severities:xo.Error|xo.Warning|xo.Info}),typeof e=="function"&&(this._markers=this._markers.filter(s=>this._resourceFilter(s.resource))),this._markers.sort(WMe._compareMarker)};i(),this._dispoables.add(t.onMarkerChanged(s=>{(!this._resourceFilter||s.some(o=>this._resourceFilter(o)))&&(i(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Qpe(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=Xne(this._markers,{resource:e.uri},(r,a)=>Cx(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;r<this._markers.length;r++){let a=be.lift(this._markers[r]);if(a.isEmpty()){const c=e.getWordAtPosition(a.getStartPosition());c&&(a=new be(a.startLineNumber,c.startColumn,a.startLineNumber,c.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,s=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}s||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;let s=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),s!==this._nextIdx}find(e,t){let i=this._markers.findIndex(s=>s.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(be.containsPosition(this._markers[i],t))return new Qpe(this._markers[i],i+1,this._markers.length)}}static _compareMarker(e,t){let i=Cx(e.resource.toString(),t.resource.toString());return i===0&&(i=xo.compare(e.severity,t.severity)),i===0&&(i=be.compareRangesUsingStarts(e,t)),i}};RQ=VMe([UMe(1,PF)],RQ);const GMe=ss("IMarkerNavigationService");let MQ=class{constructor(e){this._markerService=e,this._provider=new Cd}getMarkerList(e){for(let t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new RQ(e,this._markerService)}};MQ=VMe([UMe(0,PF)],MQ);Fy(GMe,MQ,!0);var kQ;(function(n){function e(t){switch(t){case Go.Ignore:return"severity-ignore "+vn.info.classNames;case Go.Info:return vn.info.classNames;case Go.Warning:return vn.warning.classNames;case Go.Error:return vn.error.classNames;default:return""}}n.className=e})(kQ||(kQ={}));ws((n,e)=>{const t=n.getColor(K0t);if(t){const o=vn.error.cssSelector;e.addRule(`
- .monaco-editor .zone-widget ${o},
- .markers-panel .marker-icon${o},
- .text-search-provider-messages .providerMessage ${o},
- .extensions-viewlet > .extensions ${o} {
- color: ${t};
- }
- `)}const i=n.getColor(j0t);if(i){const o=vn.warning.cssSelector;e.addRule(`
- .monaco-editor .zone-widget ${o},
- .markers-panel .marker-icon${o},
- .extensions-viewlet > .extensions ${o},
- .extension-editor ${o},
- .text-search-provider-messages .providerMessage ${o},
- .preferences-editor ${o} {
- color: ${i};
- }
- `)}const s=n.getColor(X0t);if(s){const o=vn.info.cssSelector;e.addRule(`
- .monaco-editor .zone-widget ${o},
- .markers-panel .marker-icon${o},
- .extensions-viewlet > .extensions ${o},
- .text-search-provider-messages .providerMessage ${o},
- .extension-editor ${o} {
- color: ${s};
- }
- `)}});var L$t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},c1=function(n,e){return function(t,i){e(t,i,n)}};class O$t{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Wt,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Br(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new Vie(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:3,verticalScrollbarSize:3}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Ji(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=Jm(i);this._lines=a.length,this._longestLineLength=0;for(const g of a)this._longestLineLength=Math.max(g.length+r,this._longestLineLength);wl(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let c=this._messageBlock;for(const g of a)c=document.createElement("div"),c.innerText=g,g===""&&(c.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(c);if(t||o){const g=document.createElement("span");if(g.classList.add("details"),c.appendChild(g),t){const p=document.createElement("span");p.innerText=t,p.classList.add("source"),g.appendChild(p)}if(o)if(typeof o=="string"){const p=document.createElement("span");p.innerText=`(${o})`,p.classList.add("code"),g.appendChild(p)}else{this._codeLink=Vt("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=_=>{this._openerService.open(o.target,{allowCommands:!0}),_.preventDefault(),_.stopPropagation()};const p=Nt(this._codeLink,Vt("span"));p.innerText=o.value,g.appendChild(this._codeLink)}}if(wl(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Nu(s)){const g=this._relatedBlock.appendChild(document.createElement("div"));g.style.paddingTop=`${Math.floor(this._editor.getOption(58)*.66)}px`,this._lines+=1;for(const p of s){let _=document.createElement("div"),v=document.createElement("a");v.classList.add("filename"),v.innerText=`${mMe(p.resource)}(${p.startLineNumber}, ${p.startColumn}): `,v.title=this._labelService.getUriLabel(p.resource),this._relatedDiagnostics.set(v,p);let C=document.createElement("span");C.innerText=p.message,_.appendChild(v),_.appendChild(C),this._lines+=1,g.appendChild(_)}}const u=this._editor.getOption(43),d=Math.ceil(u.typicalFullwidthCharacterWidth*this._longestLineLength*.75),f=u.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:f})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case xo.Error:t=$("Error","Error");break;case xo.Warning:t=$("Warning","Warning");break;case xo.Info:t=$("Info","Info");break;case xo.Hint:t=$("Hint","Hint");break}let i=$("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}let NR=class zMe extends h5{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Wt,this._onDidSelectRelatedInformation=new rt,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=xo.Warning,this._backgroundColor=mt.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(A$t);let t=AQ,i=R$t;this._severity===xo.Warning?(t=NQ,i=M$t):this._severity===xo.Info&&(t=DQ,i=k$t);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(fMe),secondaryHeadingColor:e.getColor(gMe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onBeforeRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(zMe.TitleMenu,this._contextKeyService);dDt(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Nt(e,Vt(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new O$t(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let s=be.lift(e);const o=this.editor.getPosition();let r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?$("problems","{0} of {1} problems",t,i):$("change","{0} of {1} problem",t,i);this.setTitle(Xf(a.uri),c)}this._icon.className=`codicon ${kQ.className(xo.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};NR.TitleMenu=new wn("gotoErrorTitleMenu");NR=L$t([c1(1,fo),c1(2,np),c1(3,Uw),c1(4,Qi),c1(5,ai),c1(6,NF)],NR);let Zpe=Px(a$,H1e),eme=Px(qv,T6),tme=Px(Kg,Rie);const AQ=Ze("editorMarkerNavigationError.background",{dark:Zpe,light:Zpe,hc:_r},$("editorMarkerNavigationError","Editor marker navigation widget error color.")),R$t=Ze("editorMarkerNavigationError.headerBackground",{dark:ro(AQ,.1),light:ro(AQ,.1),hc:null},$("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),NQ=Ze("editorMarkerNavigationWarning.background",{dark:eme,light:eme,hc:_r},$("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),M$t=Ze("editorMarkerNavigationWarning.headerBackground",{dark:ro(NQ,.1),light:ro(NQ,.1),hc:"#0C141F"},$("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),DQ=Ze("editorMarkerNavigationInfo.background",{dark:tme,light:tme,hc:_r},$("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),k$t=Ze("editorMarkerNavigationInfo.headerBackground",{dark:ro(DQ,.1),light:ro(DQ,.1),hc:null},$("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),A$t=Ze("editorMarkerNavigation.background",{dark:Ch,light:Ch,hc:Ch},$("editorMarkerNavigationBackground","Editor marker navigation widget background."));ws((n,e)=>{const t=n.getColor(IF);t&&e.addRule(`.monaco-editor .marker-widget a.code-link span { color: ${t}; }`);const i=n.getColor(LF);i&&e.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${i}; }`)});var N$t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},RV=function(n,e){return function(t,i){e(t,i,n)}},KMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let Ty=class C4{constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new Wt,this._editor=e,this._widgetVisible=jMe.bindTo(this._contextKeyService)}static get(e){return e.getContribution(C4.ID)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(NR,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var s,o,r;(!(!((s=this._model)===null||s===void 0)&&s.selected)||!be.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:be.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new ct(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){return KMe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const i=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(i.move(e,this._editor.getModel(),this._editor.getPosition()),!i.selected)return;if(i.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:i.selected.marker}},this._editor);s&&(C4.get(s).close(),C4.get(s).nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}})}};Ty.ID="editor.contrib.markerController";Ty=N$t([RV(1,GMe),RV(2,ai),RV(3,hs),RV(4,Qi)],Ty);class oG extends yn{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){return KMe(this,void 0,void 0,function*(){t.hasModel()&&Ty.get(t).nagivate(this._next,this._multiFile)})}}class Zv extends oG{constructor(){super(!0,!1,{id:Zv.ID,label:Zv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:578,weight:100},menuOpts:{menuId:NR.TitleMenu,title:Zv.LABEL,icon:Xl("marker-navigation-next",vn.arrowDown,$("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Zv.ID="editor.action.marker.next";Zv.LABEL=$("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class DR extends oG{constructor(){super(!1,!1,{id:DR.ID,label:DR.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:1602,weight:100},menuOpts:{menuId:NR.TitleMenu,title:Zv.LABEL,icon:Xl("marker-navigation-previous",vn.arrowUp,$("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}DR.ID="editor.action.marker.prev";DR.LABEL=$("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class D$t extends oG{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:$("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:66,weight:100},menuOpts:{menuId:wn.MenubarGoMenu,title:$({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class $$t extends oG{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:$("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:1090,weight:100},menuOpts:{menuId:wn.MenubarGoMenu,title:$({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}_s(Ty.ID,Ty);qt(Zv);qt(DR);qt(D$t);qt($$t);const jMe=new Sn("markersNavigationVisible",!1),x$t=jl.bindToContribution(Ty.get);Xt(new x$t({id:"closeMarkersNavigation",precondition:jMe,handler:n=>n.close(),kbOpts:{weight:150,kbExpr:We.focus,primary:9,secondary:[1033]}}));var P$t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nme=function(n,e){return function(t,i){e(t,i,n)}};const cf=Vt;class F$t{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const ime={type:1,filter:{include:$i.QuickFix}};let $Q=class{constructor(e,t,i,s){this._editor=e,this._hover=t,this._markerDecorationsService=i,this._openerService=s,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const c=a.range.startLineNumber===s?a.range.startColumn:1,u=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const f=new be(e.range.startLineNumber,c,e.range.startLineNumber,u);r.push(new F$t(this,f,d))}return r}renderHoverParts(e,t,i){if(!e.length)return wt.None;const s=new Wt;e.forEach(r=>t.appendChild(this.renderMarkerHover(r,s)));const o=e.length===1?e[0]:e.sort((r,a)=>xo.compare(r.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(o,i,s),s}renderMarkerHover(e,t){const i=cf("div.hover-row"),s=Nt(i,cf("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(s);const u=Nt(s,cf("span"));if(u.style.whiteSpace="pre-wrap",u.innerText=r,o||a)if(a&&typeof a!="string"){const d=cf("span");if(o){const _=Nt(d,cf("span"));_.innerText=o}const f=Nt(d,cf("a.code-link"));f.setAttribute("href",a.target.toString()),t.add(Pt(f,"click",_=>{this._openerService.open(a.target,{allowCommands:!0}),_.preventDefault(),_.stopPropagation()}));const g=Nt(f,cf("span"));g.innerText=a.value;const p=Nt(s,d);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const d=Nt(s,cf("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Nu(c))for(const{message:d,resource:f,startLineNumber:g,startColumn:p}of c){const _=Nt(s,cf("div"));_.style.marginTop="8px";const v=Nt(_,cf("a"));v.innerText=`${Xf(f)}(${g}, ${p}): `,v.style.cursor="pointer",t.add(Pt(v,"click",y=>{y.stopPropagation(),y.preventDefault(),this._openerService&&this._openerService.open(f,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:g,startColumn:p}}}).catch(di)}));const C=Nt(_,cf("span"));C.innerText=d,this._editor.applyFontInfo(C)}return i}renderMarkerStatusbar(e,t,i){if((e.marker.severity===xo.Error||e.marker.severity===xo.Warning||e.marker.severity===xo.Info)&&t.addAction({label:$("view problem","View Problem"),commandId:Zv.ID,run:()=>{this._hover.hide(),Ty.get(this._editor).showAtMarker(e.marker),this._editor.focus()}}),!this._editor.getOption(80)){const s=t.append(cf("div"));this.recentMarkerCodeActionsInfo&&(l5.makeKey(this.recentMarkerCodeActionsInfo.marker)===l5.makeKey(e.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=$("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?wt.None:i.add(j0(()=>s.textContent=$("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=" ");const r=this.getCodeActions(e.marker);i.add(xi(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:e.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=$("noQuickFixes","No quick fixes available");return}s.style.display="none";let c=!1;i.add(xi(()=>{c||a.dispose()})),t.addAction({label:$("quick fixes","Quick Fix..."),commandId:yM.Id,run:u=>{c=!0;const d=uw.get(this._editor),f=Bl(u);this._hover.hide(),d.showCodeActions(ime,a,{x:f.left+6,y:f.top+f.height+6})}})},di)}}getCodeActions(e){return ul(t=>Vse(this._editor.getModel(),new be(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),ime,zw.None,t))}};$Q=P$t([nme(2,lie),nme(3,np)],$Q);ws((n,e)=>{const t=n.getColor(IF);t&&e.addRule(`.monaco-hover .hover-contents a.code-link span { color: ${t}; }`);const i=n.getColor(LF);i&&e.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${i}; }`)});const XMe="editor.action.inlineSuggest.commit";class YMe{constructor(e,t,i=0){this.lineNumber=e,this.parts=t,this.additionalReservedLineCount=i}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return H$t(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(`
- `)}))).substring(this.parts[0].column-1)}}class B$t{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
- `&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}function H$t(n,e){const t=new B$t(n),i=e.map(s=>{const o=be.lift(s.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:s.text}});i.sort((s,o)=>o.startOffset-s.startOffset);for(const s of i)n=n.substring(0,s.startOffset)+s.text+n.substring(s.endOffset);return n}class sme{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}}class qMe extends wt{constructor(e){super(),this.editor=e,this._expanded=void 0,this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(105)&&this._expanded===void 0&&this.onDidChangeEmitter.fire()}))}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}function V$t(n,e){return n===e?!0:!n||!e?!1:n.range.equalsRange(e.range)&&n.text===e.text&&n.command===e.command}function JMe(n,e,t,i,s=0){if(n.range.startLineNumber!==n.range.endLineNumber)return;const o=e.getLineContent(n.range.startLineNumber),r=Hs(o).length;if(n.range.startColumn-1<=r){const p=Hs(n.text).length,_=o.substring(n.range.startColumn-1,r),v=be.fromPositions(n.range.getStartPosition().delta(0,_.length),n.range.getEndPosition()),C=n.text.startsWith(_)?n.text.substring(_.length):n.text.substring(p);n={range:v,text:C,command:n.command}}const c=e.getValueInRange(n.range),u=U$t(c,n.text);if(!u)return;const d=n.range.startLineNumber,f=new Array;if(t==="prefix"){const p=u.filter(_=>_.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==c.length)return}const g=n.text.length-s;for(const p of u){const _=n.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===n.range.startLineNumber&&_<i.column||p.originalLength>0)return;if(p.modifiedLength===0)continue;const v=p.modifiedStart+p.modifiedLength,C=Math.max(p.modifiedStart,Math.min(v,g)),y=n.text.substring(p.modifiedStart,C),w=n.text.substring(C,Math.max(p.modifiedStart,v));if(y.length>0){const I=Jm(y);f.push(new sme(_,I,!1))}if(w.length>0){const I=Jm(w);f.push(new sme(_,I,!0))}}return new YMe(d,f,0)}let em;function U$t(n,e){if((em==null?void 0:em.originalValue)===n&&(em==null?void 0:em.newValue)===e)return em==null?void 0:em.changes;{const t=W$t(n,e);return em={originalValue:n,newValue:e,changes:t},t}}function W$t(n,e){if(n.length>5e3||e.length>5e3)return;function t(c){let u=0;for(let d=0,f=c.length;d<f;d++){const g=c.charCodeAt(d);g>u&&(u=g)}return u}const i=Math.max(t(n),t(e));function s(c){if(c<0)throw new Error("unexpected");return i+c+1}function o(c){let u=0,d=0;const f=new Int32Array(c.length);for(let g=0,p=c.length;g<p;g++){const _=d*100+u;c[g]==="("?(f[g]=s(2*_),u++):c[g]===")"?(f[g]=s(2*_+1),u===1&&d++,u=Math.max(u-1,0)):f[g]=c.charCodeAt(g)}return f}const r=o(n),a=o(e);return new Cm({getElements:()=>r},{getElements:()=>a}).ComputeDiff(!1).changes}var G$t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},z$t=function(n,e){return function(t,i){e(t,i,n)}},kv=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let xQ=class extends wt{constructor(e,t,i){super(),this.editor=e,this.cache=t,this.commandService=i,this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.completionSession=this._register(new pc),this.active=!1,this.disposed=!1,this._register(i.onDidExecuteCommand(s=>{new Set([cie.id,uie.id,LO.Tab.id,LO.DeleteLeft.id,LO.DeleteRight.id,XMe,"acceptSelectedSuggestion"]).has(s.commandId)&&e.hasTextFocus()&&this.handleUserInput()})),this._register(this.editor.onDidType(s=>{this.handleUserInput()})),this._register(this.editor.onDidChangeCursorPosition(s=>{this.session&&!this.session.isValid&&this.hide()})),this._register(xi(()=>{this.disposed=!0})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.hide()}))}handleUserInput(){this.session&&!this.session.isValid&&this.hide(),setTimeout(()=>{this.disposed||this.startSessionIfTriggered()},0)}get session(){return this.completionSession.value}get ghostText(){var e;return(e=this.session)===null||e===void 0?void 0:e.ghostText}get minReservedLineCount(){return this.session?this.session.minReservedLineCount:0}setExpanded(e){var t;(t=this.session)===null||t===void 0||t.setExpanded(e)}setActive(e){var t;this.active=e,e&&((t=this.session)===null||t===void 0||t.scheduleAutomaticUpdate())}startSessionIfTriggered(){this.editor.getOption(54).enabled&&(this.session&&this.session.isValid||this.trigger(rh.Automatic))}trigger(e){if(this.completionSession.value){e===rh.Explicit&&this.completionSession.value.ensureUpdateWithExplicitContext();return}this.completionSession.value=new K$t(this.editor,this.editor.getPosition(),()=>this.active,this.commandService,this.cache,e),this.completionSession.value.takeOwnership(this.completionSession.value.onDidChange(()=>{this.onDidChangeEmitter.fire()}))}hide(){this.completionSession.clear(),this.onDidChangeEmitter.fire()}commitCurrentSuggestion(){var e;(e=this.session)===null||e===void 0||e.commitCurrentCompletion()}showNext(){var e;(e=this.session)===null||e===void 0||e.showNextInlineCompletion()}showPrevious(){var e;(e=this.session)===null||e===void 0||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return kv(this,void 0,void 0,function*(){const t=yield(e=this.session)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};xQ=G$t([z$t(2,vr)],xQ);class K$t extends qMe{constructor(e,t,i,s,o,r){super(e),this.triggerPosition=t,this.shouldUpdate=i,this.commandService=s,this.cache=o,this.initialTriggerKind=r,this.minReservedLineCount=0,this.updateOperation=this._register(new pc),this.updateSoon=this._register(new ho(()=>{let c=this.initialTriggerKind;return this.initialTriggerKind=rh.Automatic,this.update(c)},50)),this.currentlySelectedCompletionId=void 0;let a;this._register(this.onDidChange(()=>{const c=this.currentCompletion;if(c&&c.sourceInlineCompletion!==a){a=c.sourceInlineCompletion;const u=c.sourceProvider;u.handleItemDidShow&&u.handleItemDidShow(c.sourceInlineCompletions,a)}})),this._register(xi(()=>{this.cache.clear()})),this._register(this.editor.onDidChangeCursorPosition(c=>{this.cache.value&&this.onDidChangeEmitter.fire()})),this._register(this.editor.onDidChangeModelContent(c=>{this.scheduleAutomaticUpdate()})),this._register(Une.onDidChange(()=>{this.updateSoon.schedule()})),this.scheduleAutomaticUpdate()}fixAndGetIndexOfCurrentSelection(){if(!this.currentlySelectedCompletionId||!this.cache.value||this.cache.value.completions.length===0)return 0;const e=this.cache.value.completions.findIndex(t=>t.semanticId===this.currentlySelectedCompletionId);return e===-1?(this.currentlySelectedCompletionId=void 0,0):e}get currentCachedCompletion(){if(this.cache.value)return this.cache.value.completions[this.fixAndGetIndexOfCurrentSelection()]}showNextInlineCompletion(){var e;return kv(this,void 0,void 0,function*(){yield this.ensureUpdateWithExplicitContext();const t=((e=this.cache.value)===null||e===void 0?void 0:e.completions)||[];if(t.length>0){const i=(this.fixAndGetIndexOfCurrentSelection()+1)%t.length;this.currentlySelectedCompletionId=t[i].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()})}showPreviousInlineCompletion(){var e;return kv(this,void 0,void 0,function*(){yield this.ensureUpdateWithExplicitContext();const t=((e=this.cache.value)===null||e===void 0?void 0:e.completions)||[];if(t.length>0){const i=(this.fixAndGetIndexOfCurrentSelection()+t.length-1)%t.length;this.currentlySelectedCompletionId=t[i].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()})}ensureUpdateWithExplicitContext(){var e;return kv(this,void 0,void 0,function*(){this.updateOperation.value?this.updateOperation.value.triggerKind===rh.Explicit?yield this.updateOperation.value.promise:yield this.update(rh.Explicit):((e=this.cache.value)===null||e===void 0?void 0:e.triggerKind)!==rh.Explicit&&(yield this.update(rh.Explicit))})}hasMultipleInlineCompletions(){var e;return kv(this,void 0,void 0,function*(){return yield this.ensureUpdateWithExplicitContext(),(((e=this.cache.value)===null||e===void 0?void 0:e.completions.length)||0)>1})}get ghostText(){const e=this.currentCompletion,t=this.editor.getOptions().get(54).mode;return e?JMe(e,this.editor.getModel(),t,this.editor.getPosition()):void 0}get currentCompletion(){const e=this.currentCachedCompletion;if(e)return e.toLiveInlineCompletion()}get isValid(){return this.editor.getPosition().lineNumber===this.triggerPosition.lineNumber}scheduleAutomaticUpdate(){this.updateOperation.clear(),this.updateSoon.schedule()}update(e){return kv(this,void 0,void 0,function*(){if(!this.shouldUpdate())return;const t=this.editor.getPosition(),i=ul(o=>kv(this,void 0,void 0,function*(){let r;try{r=yield ZMe(t,this.editor.getModel(),{triggerKind:e,selectedSuggestionInfo:void 0},o)}catch(a){di(a);return}o.isCancellationRequested||(this.cache.setValue(this.editor,r,e),this.onDidChangeEmitter.fire())})),s=new QMe(i,e);this.updateOperation.value=s,yield i,this.updateOperation.value===s&&this.updateOperation.clear()})}takeOwnership(e){this._register(e)}commitCurrentCompletion(){if(!this.ghostText)return;const e=this.currentCompletion;e&&this.commit(e)}commit(e){const t=this.cache.clearAndLeak();this.editor.executeEdits("inlineSuggestion.accept",[ir.replaceMove(e.range,e.text)]),e.command?this.commandService.executeCommand(e.command.id,...e.command.arguments||[]).finally(()=>{t==null||t.dispose()}).then(void 0,Ol):t==null||t.dispose(),this.onDidChangeEmitter.fire()}}class QMe{constructor(e,t){this.promise=e,this.triggerKind=t}dispose(){this.promise.cancel()}}class j$t extends wt{constructor(e,t,i,s){super(),this.triggerKind=s;const o=e.deltaDecorations([],t.items.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._register(xi(()=>{e.deltaDecorations(o,[])})),this.completions=t.items.map((r,a)=>new X$t(r,o[a])),this._register(e.onDidChangeModelContent(()=>{let r=!1;const a=e.getModel();for(const c of this.completions){const u=a.getDecorationRange(c.decorationId);if(!u){di(new Error("Decoration has no range"));continue}c.synchronizedRange.equalsRange(u)||(r=!0,c.synchronizedRange=u)}r&&i()})),this._register(t)}}class X$t{constructor(e,t){this.inlineCompletion=e,this.decorationId=t,this.semanticId=JSON.stringify({text:this.inlineCompletion.text,startLine:this.inlineCompletion.range.startLineNumber,startColumn:this.inlineCompletion.range.startColumn,command:this.inlineCompletion.command}),this.synchronizedRange=e.range}toLiveInlineCompletion(){return{text:this.inlineCompletion.text,range:this.synchronizedRange,command:this.inlineCompletion.command,sourceProvider:this.inlineCompletion.sourceProvider,sourceInlineCompletions:this.inlineCompletion.sourceInlineCompletions,sourceInlineCompletion:this.inlineCompletion.sourceInlineCompletion}}}function Y$t(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new be(n.lineNumber,t.startColumn,n.lineNumber,i):be.fromPositions(n,n.with(void 0,i))}function ZMe(n,e,t,i=Ai.None){return kv(this,void 0,void 0,function*(){const s=Y$t(n,e),o=Une.all(e),r=yield Promise.all(o.map(c=>kv(this,void 0,void 0,function*(){const u=yield c.provideInlineCompletions(e,n,t,i);return{completions:u,provider:c,dispose:()=>{u&&c.freeInlineCompletions(u)}}}))),a=new Map;for(const c of r){const u=c.completions;if(u)for(const d of u.items.map(f=>({text:f.text,range:f.range?be.lift(f.range):s,command:f.command,sourceProvider:c.provider,sourceInlineCompletions:u,sourceInlineCompletion:f})))d.range.startLineNumber===d.range.endLineNumber&&a.set(JSON.stringify({text:d.text,range:d.range}),d)}return{items:[...a.values()],dispose:()=>{for(const c of r)c.dispose()}}})}function g5(n,e){if(!e)return e;const t=n.getValueInRange(e.range),i=hR(t,e.text),s=n.getOffsetAt(e.range.getStartPosition())+i,o=n.getPositionAt(s),r=t.substr(i),a=KW(r,e.text),c=n.getPositionAt(Math.max(s,n.getOffsetAt(e.range.getEndPosition())-a));return{range:be.fromPositions(o,c),text:e.text.substr(i,e.text.length-i-a)}}class ff{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e=this.pos,t=0,i=this.value.charCodeAt(e),s;if(s=ff._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(ff.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(ff.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(ff.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(ff.isVariableCharacter(i)||ff.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof ff._table[i]>"u"&&!ff.isDigitCharacter(i)&&!ff.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}}ff._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class SM{constructor(){this._children=[]}appendChild(e){return e instanceof Su&&this._children[this._children.length-1]instanceof Su?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o,function r(a,c){for(const u of a)u.parent=c,r(u.children,u)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof rG)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Su extends SM{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Su(this.value)}}class eke extends SM{}class Ef extends eke{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof GF?this._children[0]:void 0}clone(){let e=new Ef(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class GF extends SM{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Su&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new GF;return this.options.forEach(e.appendChild,e),e}}class jse extends SM{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof Og&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof Og){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){let e=new jse;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Og extends SM{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.toLowerCase():i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}clone(){return new Og(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class vP extends eke{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Su(t)],!0):!1}clone(){const e=new vP(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function ome(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class rG extends SM{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(i){return i instanceof Ef&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(s=>s===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return ome([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof Ef&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof vP&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new rG;return this._children=this.children.map(t=>t.clone()),e}walk(e){ome(this.children,e)}}class lG{constructor(){this._scanner=new ff,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const s=new rG;for(;this._parse(s););const o=new Map,r=[];let a=0;s.walk(c=>(c instanceof Ef&&(a+=1,c.isFinalTabstop?o.set(0,void 0):!o.has(c.index)&&c.children.length>0?o.set(c.index,c.children):r.push(c)),!0));for(const c of r){const u=o.get(c.index);if(u){const d=new Ef(c.index);d.transform=c.transform;for(const f of u)d.appendChild(f.clone());s.replace(c,[d])}}return i||(i=a>0&&t),!o.has(0)&&i&&s.appendChild(new Ef(0)),s}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Su(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Ef(Number(t)):new vP(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Ef(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Su("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new GF;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Su(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new vP(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Su("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){let t=new jse,i="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Su(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new Og(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Og(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){let o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Og(Number(s),o)),!0)}else if(this._accept(11)){let o=this._until(4);if(o)return e.appendChild(new Og(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){let o=this._until(4);if(o)return e.appendChild(new Og(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){let o=this._until(1);if(o){let r=this._until(4);if(r)return e.appendChild(new Og(Number(s),void 0,o,r)),!0}}else{let o=this._until(4);if(o)return e.appendChild(new Og(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Su(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}const _l=new Uint8Array(16),Qa=[];for(let n=0;n<256;n++)Qa.push(n.toString(16).padStart(2,"0"));let PQ;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?PQ=crypto.getRandomValues.bind(crypto):PQ=function(n){for(let e=0;e<n.length;e++)n[e]=Math.floor(Math.random()*256);return n};function q$t(){PQ(_l),_l[6]=_l[6]&15|64,_l[8]=_l[8]&63|128;let n=0,e="";return e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+="-",e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+="-",e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+="-",e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+="-",e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+=Qa[_l[n++]],e+=Qa[_l[n++]],e}const rme="code-workspace";function lme(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Jn.isUri(e.uri)}function J$t(n){if(n.configuration)return{id:n.id,configPath:n.configuration};if(n.folders.length===1)return{id:n.id,uri:n.folders[0].uri}}class Q$t{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){let i=t.resolve(e);if(i!==void 0)return i}}}class Z$t{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=Hs(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(u=>u===e?!1:(u instanceof Su&&(a=Hs(Jm(u.value).pop())),!0));const c=hR(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(u,d,f)=>`${d}${a.substr(c)}${f}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber)}}}}class ext{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return d0(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=d0(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return DIe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(xne(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class txt{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!tLe(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}class nxt{constructor(e,t){this._model=e,this._selection=t}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=ns.getComments(i);if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}}class Am{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Am.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Am.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Am.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Am.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3))}}Am.dayNames=[$("Sunday","Sunday"),$("Monday","Monday"),$("Tuesday","Tuesday"),$("Wednesday","Wednesday"),$("Thursday","Thursday"),$("Friday","Friday"),$("Saturday","Saturday")];Am.dayNamesShort=[$("SundayShort","Sun"),$("MondayShort","Mon"),$("TuesdayShort","Tue"),$("WednesdayShort","Wed"),$("ThursdayShort","Thu"),$("FridayShort","Fri"),$("SaturdayShort","Sat")];Am.monthNames=[$("January","January"),$("February","February"),$("March","March"),$("April","April"),$("May","May"),$("June","June"),$("July","July"),$("August","August"),$("September","September"),$("October","October"),$("November","November"),$("December","December")];Am.monthNamesShort=[$("JanuaryShort","Jan"),$("FebruaryShort","Feb"),$("MarchShort","Mar"),$("AprilShort","Apr"),$("MayShort","May"),$("JuneShort","Jun"),$("JulyShort","Jul"),$("AugustShort","Aug"),$("SeptemberShort","Sep"),$("OctoberShort","Oct"),$("NovemberShort","Nov"),$("DecemberShort","Dec")];class ixt{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=J$t(this._workspaceService.getWorkspace());if(t){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(lme(e))return d0(e.uri.path);let t=d0(e.configPath.path);return t.endsWith(rme)&&(t=t.substr(0,t.length-rme.length-1)),t}_resoveWorkspacePath(e){if(lme(e))return pQ(e.uri.fsPath);let t=d0(e.configPath.path),i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?pQ(i):"/"}}class sxt{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return q$t()}}ws((n,e)=>{function t(i){const s=n.getColor(i);return s?s.toString():"transparent"}e.addRule(`.monaco-editor .snippet-placeholder { background-color: ${t($0t)}; outline-color: ${t(x0t)}; }`),e.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${t(P0t)}; outline-color: ${t(F0t)}; }`)});class gf{constructor(e,t,i,s){this._editor=e,this._snippet=t,this._offset=i,this._snippetLineLeadingWhitespace=s,this._nestingLevel=1,this._placeholderGroups=tfe(t.placeholders,Ef.compareByIndex),this._placeholderGroupsIdx=-1}dispose(){this._placeholderDecorations&&this._editor.deltaDecorations([...this._placeholderDecorations.values()],[]),this._placeholderGroups.length=0}_initDecorations(){if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=be.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?gf._decor.inactiveFinal:gf._decor.inactive,c=t.addDecoration(r,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){let s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),c=this._editor.getModel().getValueInRange(a),u=o.transform.resolve(c).split(/\r\n|\r|\n/);for(let d=1;d<u.length;d++)u[d]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+u[d]);s.push(ir.replace(a,u.join(this._editor.getModel().getEOL())))}s.length>0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),u=this._editor.getModel().getDecorationRange(c);r.push(new fn(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(c,a.isFinalTabstop?gf._decor.activeFinal:gf._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const f=this._placeholderDecorations.get(d);s.changeDecorationOptions(f,d.isFinalTabstop?gf._decor.activeFinal:gf._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(c,a.isFinalTabstop?gf._decor.inactiveFinal:gf._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Ef){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get choice(){return this._placeholderGroups[this._placeholderGroupsIdx][0].choice}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const c of o._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=s.index+(r+1)/this._nestingLevel:c.index=s.index+c.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const c of o._snippet.placeholders){const u=o._snippet.offset(c),d=o._snippet.fullLen(c),f=be.fromPositions(t.getPositionAt(o._offset+u),t.getPositionAt(o._offset+u+d)),g=i.addDecoration(f,gf._decor.inactive);this._placeholderDecorations.set(c,g)}}this._placeholderGroups=tfe(this._snippet.placeholders,Ef.compareByIndex)})}}gf._decor={active:Ci.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ci.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ci.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ci.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const ame={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};class cm{constructor(e,t,i=ame){this._templateMerges=[],this._snippets=[],this._editor=e,this._template=t,this._options=i}static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=Hs(r,0,t.column-1);let c;return i.walk(u=>{if(!(u instanceof Su)||u.parent instanceof GF)return!0;const d=u.value.split(/\r\n|\r|\n/);if(s){const g=i.offset(u);if(g===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??i.toString();let p=c.charCodeAt(g-1);(p===10||p===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let p=1;p<d.length;p++)d[p]=e.normalizeIndentation(a+d[p])}const f=d.join(e.getEOL());return f!==u.value&&(u.parent.replace(u,[new Su(f)]),c=void 0),!0}),a}static adjustSelection(e,t,i,s){if(i!==0||s!==0){const{positionLineNumber:o,positionColumn:r}=t,a=r-i,c=r+s,u=e.validateRange({startLineNumber:o,startColumn:a,endLineNumber:o,endColumn:c});t=fn.createWithDirection(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn,t.getDirection())}return t}static createEditsAndSnippets(e,t,i,s,o,r,a,c){const u=[],d=[];if(!e.hasModel())return{edits:u,snippets:d};const f=e.getModel(),g=e.invokeWithinContext(L=>L.get(s1e)),p=e.invokeWithinContext(L=>new ext(L.get(NF),f)),_=()=>a;let v=0,C=f.getValueInRange(cm.adjustSelection(f,e.getSelection(),i,0)),y=f.getValueInRange(cm.adjustSelection(f,e.getSelection(),0,s)),w=f.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber);const I=e.getSelections().map((L,O)=>({selection:L,idx:O})).sort((L,O)=>be.compareRangesUsingStarts(L.selection,O.selection));for(const{selection:L,idx:O}of I){let A=cm.adjustSelection(f,L,i,0),N=cm.adjustSelection(f,L,0,s);C!==f.getValueInRange(A)&&(A=L),y!==f.getValueInRange(N)&&(N=L);const D=L.setStartPosition(A.startLineNumber,A.startColumn).setEndPosition(N.endLineNumber,N.endColumn),P=new lG().parse(t,!0,o),F=D.getStartPosition(),V=cm.adjustWhitespace(f,F,P,r||O>0&&w!==f.getLineFirstNonWhitespaceColumn(L.positionLineNumber),!0);P.resolveVariables(new Q$t([p,new txt(_,O,I.length,e.getOption(70)==="spread"),new Z$t(f,L,O,c),new nxt(f,L),new Am,new ixt(g),new sxt]));const U=f.getOffsetAt(F)+v;v+=P.toString().length-f.getValueLengthInRange(D),u[O]=ir.replace(D,P.toString()),u[O].identifier={major:O,minor:0},d[O]=new gf(e,P,U,V)}return{edits:u,snippets:d}}dispose(){Ji(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=cm.createEditsAndSnippets(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer);this._snippets=t,this._editor.executeEdits("snippet",e,i=>this._snippets[0].hasPlaceholder?this._move(!0):i.filter(s=>!!s.identifier).map(s=>fn.fromPositions(s.range.getEndPosition()))),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=ame){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=cm.createEditsAndSnippets(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer);this._editor.executeEdits("snippet",i,o=>{for(const r of this._snippets)r.merge(s);return console.assert(s.length===0),this._snippets[0].hasPlaceholder?this._move(void 0):o.filter(r=>!!r.identifier).map(r=>fn.fromPositions(r.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get choice(){return this._snippets[0].choice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;let t=new Map;for(const i of this._snippets){const s=i.computePossibleSelections();if(t.size===0)for(const[o,r]of s){r.sort(be.compareRangesUsingStarts);for(const a of e)if(r[0].containsRange(a)){t.set(o,[]);break}}if(t.size===0)return!1;t.forEach((o,r)=>{o.push(...s.get(r))})}e.sort(be.compareRangesUsingStarts);for(let[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(be.compareRangesUsingStarts);for(let o=0;o<s.length;o++)if(!s[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}}var v$=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const Ni={Visible:new Sn("suggestWidgetVisible",!1,$("suggestWidgetVisible","Whether suggestion are visible")),DetailsVisible:new Sn("suggestWidgetDetailsVisible",!1,$("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new Sn("suggestWidgetMultipleSuggestions",!1,$("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new Sn("suggestionMakesTextEdit",!0,$("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Sn("acceptSuggestionOnEnter",!0,$("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Sn("suggestionHasInsertAndReplaceRange",!1,$("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new Sn("suggestionInsertMode",void 0,{type:"string",description:$("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new Sn("suggestionCanResolve",!1,$("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Cy=new wn("suggestWidgetStatusBar");class oxt{constructor(e,t,i,s){this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=jg.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),be.isIRange(t.range)?(this.editStart=new ct(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new ct(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new ct(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||be.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new ct(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new ct(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new ct(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||be.spansMultipleLines(t.range.insert)||be.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return v$(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(i=>{Object.assign(this.completion,i),this._isResolved=!0,t.dispose()},i=>{d_(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class p5{constructor(e=2,t=new Set,i=new Set,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=s}}p5.default=new p5;let rxt;function lxt(){return rxt}class axt{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}function tke(n,e,t=p5.default,i={triggerKind:0},s=Ai.None){return v$(this,void 0,void 0,function*(){const o=new Ym(!0);e=e.clone();const r=n.getWordAtPosition(e),a=r?new be(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn):be.fromPositions(e),c={replace:a,insert:a.setEndPosition(e.lineNumber,e.column)},u=[],d=new Wt,f=[];let g=!1;const p=(v,C,y)=>{var w,I,L;if(C){for(let O of C.suggestions)if(!t.kindFilter.has(O.kind)){if(!t.showDeprecated&&(!((w=O==null?void 0:O.tags)===null||w===void 0)&&w.includes(1)))continue;O.range||(O.range=c),O.sortText||(O.sortText=typeof O.label=="string"?O.label:O.label.label),!g&&O.insertTextRules&&O.insertTextRules&4&&(g=lG.guessNeedsClipboard(O.insertText)),u.push(new oxt(e,O,C,v))}vne(C)&&d.add(C),f.push({providerName:(I=v._debugDisplayName)!==null&&I!==void 0?I:"unkown_provider",elapsedProvider:(L=C.duration)!==null&&L!==void 0?L:-1,elapsedOverall:y.elapsed()})}},_=v$(this,void 0,void 0,function*(){});for(let v of Ag.orderedGroups(n)){let C=u.length;if(yield Promise.all(v.map(y=>v$(this,void 0,void 0,function*(){if(!(t.providerFilter.size>0&&!t.providerFilter.has(y)))try{const w=new Ym(!0),I=yield y.provideCompletionItems(n,e,i,s);p(y,I,w)}catch(w){Ol(w)}}))),C!==u.length||s.isCancellationRequested)break}return yield _,s.isCancellationRequested?(d.dispose(),Promise.reject(gM())):new axt(u.sort(nke(t.snippetSortOrder)),g,{entries:f,elapsed:o.elapsed()},d)})}function Xse(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLow<e.sortTextLow)return-1;if(n.sortTextLow>e.sortTextLow)return 1}return n.completion.label<e.completion.label?-1:n.completion.label>e.completion.label?1:n.completion.kind-e.completion.kind}function cxt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return Xse(n,e)}function uxt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return Xse(n,e)}const aG=new Map;aG.set(0,cxt);aG.set(2,uxt);aG.set(1,Xse);function nke(n){return aG.get(n)}ji.registerCommand("_executeCompletionItemProvider",(n,...e)=>v$(void 0,void 0,void 0,function*(){const[t,i,s,o]=e;Gs(Jn.isUri(t)),Gs(ct.isIPosition(i)),Gs(typeof s=="string"||!s),Gs(typeof o=="number"||!o);const r=yield n.get(Nd).createModelReference(t);try{const a={incomplete:!1,suggestions:[]},c=[],u=yield tke(r.object.textEditorModel,ct.lift(i),void 0,{triggerCharacter:s,triggerKind:s?1:0});for(const d of u.items)c.length<(o??0)&&c.push(d.resolve(Ai.None)),a.incomplete=a.incomplete||d.container.incomplete,a.suggestions.push(d.completion);try{return yield Promise.all(c),a}finally{setTimeout(()=>u.disposable.dispose(),100)}}finally{r.dispose()}}));const FQ=new class{constructor(){this.onlyOnceSuggestions=[]}provideCompletionItems(){let e={suggestions:this.onlyOnceSuggestions.slice(0)};return this.onlyOnceSuggestions.length=0,e}};Ag.register("*",FQ);function dxt(n,e){setTimeout(()=>{FQ.onlyOnceSuggestions.push(...e),n.getContribution("editor.contrib.suggestController").triggerSuggest(new Set().add(FQ))},0)}var hxt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cme=function(n,e){return function(t,i){e(t,i,n)}};const ume={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Kl=class TD{constructor(e,t,i){this._editor=e,this._logService=t,this._snippetListener=new Wt,this._modelVersionId=-1,this._inSnippet=TD.InSnippetMode.bindTo(i),this._hasNextTabstop=TD.HasNextTabstop.bindTo(i),this._hasPrevTabstop=TD.HasPrevTabstop.bindTo(i)}static get(e){return e.getContribution(TD.ID)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?ume:Object.assign(Object.assign({},ume),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){this._editor.hasModel()&&(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new cm(this._editor,e,t),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(i=>i.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState())))}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{choice:e}=this._session;if(!e){this._currentChoice=void 0;return}if(this._currentChoice!==e){this._currentChoice=e,this._editor.setSelections(this._editor.getSelections().map(i=>fn.fromPositions(i.getStartPosition())));const[t]=e.options;dxt(this._editor,e.options.map((i,s)=>({kind:13,label:i.value,insertText:i.value,sortText:"a".repeat(s+1),range:be.fromPositions(this._editor.getPosition(),this._editor.getPosition().delta(0,t.value.length))})))}}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session&&this._session.prev(),this._updateState()}next(){this._session&&this._session.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};Kl.ID="snippetController2";Kl.InSnippetMode=new Sn("inSnippetMode",!1,$("inSnippetMode","Whether the editor in current in snippet mode"));Kl.HasNextTabstop=new Sn("hasNextTabstop",!1,$("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));Kl.HasPrevTabstop=new Sn("hasPrevTabstop",!1,$("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));Kl=hxt([cme(1,h_),cme(2,ai)],Kl);_s(Kl.ID,Kl);const cG=jl.bindToContribution(Kl.get);Xt(new cG({id:"jumpToNextSnippetPlaceholder",precondition:dn.and(Kl.InSnippetMode,Kl.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:130,kbExpr:We.editorTextFocus,primary:2}}));Xt(new cG({id:"jumpToPrevSnippetPlaceholder",precondition:dn.and(Kl.InSnippetMode,Kl.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:130,kbExpr:We.editorTextFocus,primary:1026}}));Xt(new cG({id:"leaveSnippet",precondition:Kl.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:130,kbExpr:We.editorTextFocus,primary:9,secondary:[1033]}}));Xt(new cG({id:"acceptSnippet",precondition:Kl.InSnippetMode,handler:n=>n.finish()}));var fxt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dme=function(n,e){return function(t,i){e(t,i,n)}};class Yse{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;let s=i[0].score[0];for(let o=0;o<i.length;o++){const{score:r,completion:a}=i[o];if(r[0]!==s)break;if(a.preselect)return o}return 0}}class ike extends Yse{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class gxt extends Yse{constructor(){super("recentlyUsed"),this._cache=new Py(300,.66),this._seq=0}memorize(e,t,i){const s=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(s,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const s=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(s))return super.select(e,t,i);let o=i[0].score[0],r=-1,a=-1,c=-1;for(let u=0;u<i.length&&i[u].score[0]===o;u++){const d=`${e.getLanguageId()}/${i[u].textLabel}`,f=this._cache.peek(d);if(f&&f.touch>c&&f.type===i[u].completion.kind&&f.insertText===i[u].completion.insertText&&(c=f.touch,a=u),i[u].completion.preselect&&r===-1)return r=u}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();let t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:TLe(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class pxt extends Yse{constructor(){super("recentlyUsedByPrefix"),this._trie=bO.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){let{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);let o=`${e.getLanguageId()}/${s}`,r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;a<i.length;a++){let{kind:c,insertText:u}=i[a].completion;if(c===r.type&&u===r.insertText)return a}return super.select(e,t,i)}toJSON(){let e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:TLe(i.type),this._trie.set(t,i)}}}let bP=class y4{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Wt,this._persistSoon=new ho(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===a5.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const s=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==s){this._saveState();const o=y4._strategyCtors.get(s)||ike;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,c=this._storageService.get(`${y4._storagePrefix}/${s}`,a);c&&this._strategy.fromJSON(JSON.parse(c))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${y4._storagePrefix}/${this._strategy.name}`,i,t,1)}}};bP._strategyCtors=new Map([["recentlyUsedByPrefix",pxt],["recentlyUsed",gxt],["first",ike]]);bP._storagePrefix="suggest/memories";bP=fxt([dme(0,m_),dme(1,Yo)],bP);const ske=ss("ISuggestMemories");Fy(ske,bP,!0);var mxt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_xt=function(n,e){return function(t,i){e(t,i,n)}};let TP=class oke{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=oke.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(110)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(110)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};TP.AtEnd=new Sn("atEndOfWord",!1);TP=mxt([_xt(1,ai)],TP);var vxt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bxt=function(n,e){return function(t,i){e(t,i,n)}};let gw=class E4{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=E4.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(E4._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(;s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits););return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=E4._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};gw.OtherSuggestions=new Sn("hasOtherSuggestions",!1);gw=vxt([bxt(1,ai)],gw);class Txt{constructor(e,t,i){this._disposables=new Wt,this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(s=>{if(this._active&&!t.isFrozen()){const o=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(o)&&e.getOption(0)&&i(this._active.item)}}))}_onItem(e){if(!e||!Nu(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new U1;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var Cxt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class cd{provideSelectionRanges(e,t){return Cxt(this,void 0,void 0,function*(){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;yield new Promise(a=>cd._bracketsRightYield(a,0,e,s,r)),yield new Promise(a=>cd._bracketsLeftYield(a,0,e,s,r,o))}return i})}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=cd._maxRounds){e();break}if(!s){e();break}let c=i.findNextBracket(s);if(!c){e();break}if(Date.now()-a>cd._maxDuration){setTimeout(()=>cd._bracketsRightYield(e,t+1,i,s,o));break}const d=c.close[0];if(c.isOpen){let f=r.has(d)?r.get(d):0;r.set(d,f+1)}else{let f=r.has(d)?r.get(d):0;if(f-=1,r.set(d,Math.max(0,f)),f<0){let g=o.get(d);g||(g=new Cd,o.set(d,g)),g.push(c.range)}}s=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,c=Date.now();for(;;){if(t>=cd._maxRounds&&o.size===0){e();break}if(!s){e();break}let u=i.findPrevBracket(s);if(!u){e();break}if(Date.now()-c>cd._maxDuration){setTimeout(()=>cd._bracketsLeftYield(e,t+1,i,s,o,r));break}const f=u.close[0];if(u.isOpen){let g=a.has(f)?a.get(f):0;if(g-=1,a.set(f,Math.max(0,g)),g<0){let p=o.get(f);if(p){let _=p.shift();p.size===0&&o.delete(f);const v=be.fromPositions(u.range.getEndPosition(),_.getStartPosition()),C=be.fromPositions(u.range.getStartPosition(),_.getEndPosition());r.push({range:v}),r.push({range:C}),cd._addBracketLeading(i,C,r)}}}else{let g=a.has(f)?a.get(f):0;a.set(f,g+1)}s=u.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:be.fromPositions(new ct(s,o),t.getEndPosition())}),i.push({range:be.fromPositions(new ct(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:be.fromPositions(new ct(r,a),t.getEndPosition())}),i.push({range:be.fromPositions(new ct(r,1),t.getEndPosition())}))}}}cd._maxDuration=30;cd._maxRounds=2;var yxt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class pm{static create(e,t){return yxt(this,void 0,void 0,function*(){if(!t.getOption(105).localityBonus||!t.hasModel())return pm.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return pm.None;const[o]=yield new cd().provideSelectionRanges(i,[s]);if(o.length===0)return pm.None;const r=yield e.computeWordRanges(i.uri,o[0].range);if(!r)return pm.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends pm{distance(c,u){if(!s.equals(t.getPosition()))return 0;if(u.kind===17)return 2<<20;let d=typeof u.label=="string"?u.label:u.label.label,f=r[d];if(BLe(f))return 2<<20;let g=Xne(f,be.fromPositions(c),be.compareRangesUsingStarts),p=g>=0?f[g]:f[Math.max(0,~g-1)],_=o.length;for(const v of o){if(!be.containsRange(v.range,p))break;_-=1}return _}}})}}pm.None=new class extends pm{distance(){return 0}};class xS{constructor(e,t,i,s,o,r,a){this.clipboardText=a,this._snippetCompareFn=xS._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=1,this._lineContext=i,r==="top"?this._snippetCompareFn=xS._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=xS._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}get allProvider(){return this._ensureCachedState(),this._providerInfo.keys()}get incomplete(){this._ensureCachedState();const e=new Set;for(let[t,i]of this._providerInfo)i&&e.add(t);return e}adopt(e){let t=[];for(let i=0;i<this._items.length;)e.has(this._items[i].provider)?i++:(t.push(this._items[i]),this._items[i]=this._items[this._items.length-1],this._items.pop());return this._refilterKind=1,t}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._providerInfo=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?OR:QOt;for(let u=0;u<r.length;u++){const d=r[u];if(d.isInvalid)continue;this._providerInfo.set(d.provider,!!d.container.incomplete);const f=d.position.column-d.editStart.column,g=f+i-(d.position.column-this._column);if(s.length!==g&&(s=g===0?"":t.slice(-g),o=s.toLowerCase()),d.word=s,g===0)d.score=jg.Default;else{let p=0;for(;p<f;){const _=s.charCodeAt(p);if(_===32||_===9)p+=1;else break}if(p>=g)d.score=jg.Default;else if(typeof d.completion.filterText=="string"){let _=c(s,o,p,d.completion.filterText,d.filterTextLow,0,!1);if(!_)continue;vq(d.completion.filterText,d.textLabel)===0?d.score=_:(d.score=XOt(s,o,p,d.textLabel,d.labelLow,0),d.score[0]=_[0])}else{let _=c(s,o,p,d.textLabel,d.labelLow,0,!1);if(!_)continue;d.score=_}}d.idx=u,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?$q(e.length-.85,e,(u,d)=>u-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return xS._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return xS._compareCompletionItems(e,t)}}var Ext=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},u1=function(n,e){return function(t,i){e(t,i,n)}},Sxt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class d1{constructor(e,t,i,s){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=i,this.shy=s}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column||!isNaN(Number(s.word)))}}function wxt(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=t.getValue("editor.inlineSuggest.allowQuickSuggestions");return i!==void 0?!!i:!1}function Ixt(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=t.getValue("editor.inlineSuggest.allowSuggestOnTriggerCharacters");return i!==void 0?!!i:!1}let BQ=class rke{constructor(e,t,i,s,o,r,a){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._toDispose=new Wt,this._quickSuggestDelay=10,this._triggerCharacterListener=new Wt,this._triggerQuickSuggest=new mc,this._state=0,this._completionDisposables=new Wt,this._onDidCancel=new rt,this._onDidTrigger=new rt,this._onDidSuggest=new rt,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new fn(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters(),this._updateQuickSuggest()})),this._toDispose.add(Ag.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(u=>{this._onCursorChange(u)}));let c=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{c=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{c=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{c||this._refilterCompletionItems()})),this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){Ji(this._triggerCharacterListener),Ji([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(79),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&this._quickSuggestDelay!==0||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(80)||!this._editor.hasModel()||!this._editor.getOption(108))return;const e=new Map;for(const i of Ag.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(lxt()),e.set(s,o)),o.add(i)}const t=i=>{if(!Ixt(this._editor,this._contextKeyService,this._configurationService)||d1.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let s="";fR(i.charCodeAt(i.length-1))?yl(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const o=e.get(s);if(o){const r=this._completionModel?{items:this._completionModel.adopt(o),clipboardText:this._completionModel.clipboardText}:void 0;this.trigger({auto:!0,shy:!1,triggerCharacter:s},!!this._completionModel,o,r)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(t))}get state(){return this._state}cancel(e=!1){var t;this._state!==0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._state!==0&&(!this._editor.hasModel()||!Ag.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._state===2,shy:!1},!0))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._state===0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._state!==0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._state===0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){this._editor.getOption(78)!==!1&&(this._editor.getOption(105).snippetsPreventQuickSuggestions&&Kl.get(this._editor).isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._state!==0||!d1.shouldAutoTrigger(this._editor)||!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(78);if(i!==!1){if(i!==!0){e.tokenizeIfCheap(t.lineNumber);const s=e.getLineTokens(t.lineNumber),o=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(!(i.other&&o===0||i.comments&&o===1||i.strings&&o===2))return}wxt(this._editor,this._contextKeyService,this._configurationService)&&Ag.has(e)&&this.trigger({auto:!0,shy:!1})}},this._quickSuggestDelay)))}_refilterCompletionItems(){Promise.resolve().then(()=>{if(this._state===0||!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new d1(e,t,this._state===2,!1);this._onNewContext(i)})}trigger(e,t=!1,i,s){var o;if(!this._editor.hasModel())return;const r=this._editor.getModel(),a=e.auto,c=new d1(r,this._editor.getPosition(),a,e.shy);this.cancel(t),this._state=a?2:1,this._onDidTrigger.fire({auto:a,shy:e.shy,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(o=e.triggerKind)!==null&&o!==void 0?o:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new dc;const d=this._editor.getOption(100);let f=1;switch(d){case"top":f=0;break;case"bottom":f=2;break}const{itemKind:g,showDeprecated:p}=rke._createSuggestFilter(this._editor),_=pm.create(this._editorWorkerService,this._editor),v=tke(r,this._editor.getPosition(),new p5(f,g,i,p),u,this._requestToken.token);Promise.all([v,_]).then(([C,y])=>Sxt(this,void 0,void 0,function*(){var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let I=s==null?void 0:s.clipboardText;if(!I&&C.needsClipboard&&(I=yield this._clipboardService.readText()),this._state===0)return;const L=this._editor.getModel();let O=C.items;if(s){const N=nke(f);O=O.concat(s.items).sort(N)}const A=new d1(L,this._editor.getPosition(),a,e.shy);this._completionModel=new xS(O,this._context.column,{leadingLineContent:A.leadingLineContent,characterCountDelta:A.column-this._context.column},y,this._editor.getOption(105),this._editor.getOption(100),I),this._completionDisposables.add(C.disposable),this._onNewContext(A),this._reportDurationsTelemetry(C.durations)})).catch(di)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set;e.getOption(100)==="none"&&t.add(27);const s=e.getOption(105);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(27),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(Hs(e.leadingLineContent)!==Hs(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.auto,shy:!1},!0):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){const t=new Set(Ag.all(this._editor.getModel()));for(let s of this._completionModel.allProvider)t.delete(s);const i=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1},!0,t,{items:i,clipboardText:this._completionModel.clipboardText});return}if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&e.leadingWord.word.length!==0){const{incomplete:t}=this._completionModel,i=this._completionModel.adopt(t);this.trigger({auto:this._state===2,shy:!1,triggerKind:2},!0,t,{items:i,clipboardText:this._completionModel.clipboardText})}else{let t=this._completionModel.lineContext,i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){if(d1.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.auto,shy:!1},!0);return}if(this._context.auto){this.cancel();return}else if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:i})}}}}};BQ=Ext([u1(1,eg),u1(2,Uy),u1(3,By),u1(4,h_),u1(5,ai),u1(6,Yo)],BQ);class uG{constructor(e,t){this._disposables=new Wt,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType(()=>{if(!this._empty||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;a<s;a++)if(!i[a].isEmpty()){o=!0;break}if(!o)return;this._lastOvertyped=[];const r=e.getModel();for(let a=0;a<s;a++){const c=i[a];if(r.getValueLengthInRange(c)>uG._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(c),multiline:c.startLineNumber!==c.endLineNumber}}this._empty=!1})),this._disposables.add(t.onDidCancel(i=>{!this._empty&&!i.retrigger&&(this._empty=!0)}))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}uG._maxSelectionLength=51200;var Lxt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mK=function(n,e){return function(t,i){e(t,i,n)}};class qse extends AR{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=$("ddd","{0} ({1})",this._action.label,qse.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let HQ=class{constructor(e,t,i,s){this._menuService=i,this._contextKeyService=s,this._menuDisposables=new Wt,this.element=Nt(e,Vt(".suggest-status-bar"));const o=r=>r instanceof Q0?t.createInstance(qse,r,void 0):void 0;this._leftActions=new pb(this.element,{actionViewItemProvider:o}),this._rightActions=new pb(this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(Cy,this._contextKeyService),t=()=>{const i=[],s=[];for(let[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};HQ=Lxt([mK(1,Qi),mK(2,Uw),mK(3,ai)],HQ);const Oxt=Ze("symbolIcon.arrayForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Rxt=Ze("symbolIcon.booleanForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Mxt=Ze("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},$("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),kxt=Ze("symbolIcon.colorForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Axt=Ze("symbolIcon.constantForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Nxt=Ze("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},$("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dxt=Ze("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},$("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),$xt=Ze("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},$("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),xxt=Ze("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},$("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Pxt=Ze("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},$("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Fxt=Ze("symbolIcon.fileForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Bxt=Ze("symbolIcon.folderForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Hxt=Ze("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},$("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Vxt=Ze("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},$("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Uxt=Ze("symbolIcon.keyForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Wxt=Ze("symbolIcon.keywordForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Gxt=Ze("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},$("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),zxt=Ze("symbolIcon.moduleForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Kxt=Ze("symbolIcon.namespaceForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),jxt=Ze("symbolIcon.nullForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Xxt=Ze("symbolIcon.numberForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Yxt=Ze("symbolIcon.objectForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),qxt=Ze("symbolIcon.operatorForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Jxt=Ze("symbolIcon.packageForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Qxt=Ze("symbolIcon.propertyForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Zxt=Ze("symbolIcon.referenceForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),ePt=Ze("symbolIcon.snippetForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),tPt=Ze("symbolIcon.stringForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),nPt=Ze("symbolIcon.structForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),iPt=Ze("symbolIcon.textForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),sPt=Ze("symbolIcon.typeParameterForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),oPt=Ze("symbolIcon.unitForeground",{dark:Bn,light:Bn,hc:Bn},$("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),rPt=Ze("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},$("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));ws((n,e)=>{const t=n.getColor(Oxt);t&&e.addRule(`${vn.symbolArray.cssSelector} { color: ${t}; }`);const i=n.getColor(Rxt);i&&e.addRule(`${vn.symbolBoolean.cssSelector} { color: ${i}; }`);const s=n.getColor(Mxt);s&&e.addRule(`${vn.symbolClass.cssSelector} { color: ${s}; }`);const o=n.getColor(Gxt);o&&e.addRule(`${vn.symbolMethod.cssSelector} { color: ${o}; }`);const r=n.getColor(kxt);r&&e.addRule(`${vn.symbolColor.cssSelector} { color: ${r}; }`);const a=n.getColor(Axt);a&&e.addRule(`${vn.symbolConstant.cssSelector} { color: ${a}; }`);const c=n.getColor(Nxt);c&&e.addRule(`${vn.symbolConstructor.cssSelector} { color: ${c}; }`);const u=n.getColor(Dxt);u&&e.addRule(`
- ${vn.symbolValue.cssSelector},${vn.symbolEnum.cssSelector} { color: ${u}; }`);const d=n.getColor($xt);d&&e.addRule(`${vn.symbolEnumMember.cssSelector} { color: ${d}; }`);const f=n.getColor(xxt);f&&e.addRule(`${vn.symbolEvent.cssSelector} { color: ${f}; }`);const g=n.getColor(Pxt);g&&e.addRule(`${vn.symbolField.cssSelector} { color: ${g}; }`);const p=n.getColor(Fxt);p&&e.addRule(`${vn.symbolFile.cssSelector} { color: ${p}; }`);const _=n.getColor(Bxt);_&&e.addRule(`${vn.symbolFolder.cssSelector} { color: ${_}; }`);const v=n.getColor(Hxt);v&&e.addRule(`${vn.symbolFunction.cssSelector} { color: ${v}; }`);const C=n.getColor(Vxt);C&&e.addRule(`${vn.symbolInterface.cssSelector} { color: ${C}; }`);const y=n.getColor(Uxt);y&&e.addRule(`${vn.symbolKey.cssSelector} { color: ${y}; }`);const w=n.getColor(Wxt);w&&e.addRule(`${vn.symbolKeyword.cssSelector} { color: ${w}; }`);const I=n.getColor(zxt);I&&e.addRule(`${vn.symbolModule.cssSelector} { color: ${I}; }`);const L=n.getColor(Kxt);L&&e.addRule(`${vn.symbolNamespace.cssSelector} { color: ${L}; }`);const O=n.getColor(jxt);O&&e.addRule(`${vn.symbolNull.cssSelector} { color: ${O}; }`);const A=n.getColor(Xxt);A&&e.addRule(`${vn.symbolNumber.cssSelector} { color: ${A}; }`);const N=n.getColor(Yxt);N&&e.addRule(`${vn.symbolObject.cssSelector} { color: ${N}; }`);const D=n.getColor(qxt);D&&e.addRule(`${vn.symbolOperator.cssSelector} { color: ${D}; }`);const P=n.getColor(Jxt);P&&e.addRule(`${vn.symbolPackage.cssSelector} { color: ${P}; }`);const F=n.getColor(Qxt);F&&e.addRule(`${vn.symbolProperty.cssSelector} { color: ${F}; }`);const V=n.getColor(Zxt);V&&e.addRule(`${vn.symbolReference.cssSelector} { color: ${V}; }`);const U=n.getColor(ePt);U&&e.addRule(`${vn.symbolSnippet.cssSelector} { color: ${U}; }`);const Q=n.getColor(tPt);Q&&e.addRule(`${vn.symbolString.cssSelector} { color: ${Q}; }`);const de=n.getColor(nPt);de&&e.addRule(`${vn.symbolStruct.cssSelector} { color: ${de}; }`);const q=n.getColor(iPt);q&&e.addRule(`${vn.symbolText.cssSelector} { color: ${q}; }`);const K=n.getColor(sPt);K&&e.addRule(`${vn.symbolTypeParameter.cssSelector} { color: ${K}; }`);const re=n.getColor(oPt);re&&e.addRule(`${vn.symbolUnit.cssSelector} { color: ${re}; }`);const Z=n.getColor(rPt);Z&&e.addRule(`${vn.symbolVariable.cssSelector} { color: ${Z}; }`)});class lke{constructor(){this._onDidWillResize=new rt,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new rt,this.onDidResize=this._onDidResize.event,this._sashListener=new Wt,this._size=new eo(0,0),this._minSize=new eo(0,0),this._maxSize=new eo(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new ca(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ca(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ca(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:G3.North}),this._southSash=new ca(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:G3.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(Ln.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(Ln.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Ln.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Ln.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new eo(t,e);eo.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}var lPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},aPt=function(n,e){return function(t,i){e(t,i,n)}};function Jse(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let VQ=class{constructor(e,t){this._editor=e,this._onDidClose=new rt,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new rt,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Wt,this._renderDisposeable=new Wt,this._borderWidth=1,this._size=new eo(330,0),this.domNode=Vt(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(by,{editor:e}),this._body=Vt(".body"),this._scrollbar=new RF(this._body,{}),Nt(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Nt(this._body,Vt(".header")),this._close=Nt(this._header,Vt("span"+vn.close.cssSelector)),this._close.title=$("details.close","Close"),this._type=Nt(this._header,Vt("p.type")),this._docs=Nt(this._body,Vt("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(43)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(43),i=t.getMassagedFontFamily(Mf?va.fontFamily:null),s=e.get(106)||t.fontSize,o=e.get(107)||t.lineHeight,r=t.fontWeight,a=`${s}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=c,this._close.style.width=c}getLayoutInfo(){const e=this._editor.getOption(107)||this._editor.getOption(43).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=$("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,s;this._renderDisposeable.clear();let{detail:o,documentation:r}=e.completion;if(t){let a="";a+=`score: ${e.score[0]}
- `,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}
- `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
- `,a+=`distance: ${e.distance} (localityBonus-setting)
- `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
- `,a+=`commit_chars: ${(s=e.completion.commitCharacters)===null||s===void 0?void 0:s.join("")}
- `,r=new mb().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!Jse(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,pd(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else wl(this._type),this._type.title="",Vc(this._type),this.domNode.classList.add("no-type");if(wl(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),wl(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new eo(e,t);eo.equals(i,this._size)||(this._size=i,Fvt(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};VQ=lPt([aPt(1,Qi)],VQ);class cPt{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new Wt,this._added=!1,this._resizable=new lke,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=s.width-a.dimension.width,c=!0),a.north&&(o=s.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e){var t;const i=Bl(e);this._anchorBox=i,this._placeAtAnchor(this._anchorBox,(t=this._userSize)!==null&&t!==void 0?t:this.widget.size)}_placeAtAnchor(e,t){var i;const s=W8(document.body),o=this.widget.getLayoutInfo(),r=new eo(220,2*o.lineHeight),a=e.top,c=function(){const w=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),I=-o.borderWidth+e.left+e.width,L=new eo(w,s.height-e.top-o.borderHeight-o.verticalPadding),O=L.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:I,fit:w-t.width,maxSizeTop:L,maxSizeBottom:O,minSize:r.with(Math.min(w,r.width))}}(),u=function(){const w=e.left-o.borderWidth-o.horizontalPadding,I=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),L=new eo(w,s.height-e.top-o.borderHeight-o.verticalPadding),O=L.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:I,fit:w-t.width,maxSizeTop:L,maxSizeBottom:O,minSize:r.with(Math.min(w,r.width))}}(),d=function(){const w=e.left,I=-o.borderWidth+e.top+e.height,L=new eo(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:I,left:w,fit:L.height-t.height,maxSizeBottom:L,maxSizeTop:L,minSize:r.with(L.width)}}(),f=[c,u,d],g=(i=f.find(w=>w.fit>=0))!==null&&i!==void 0?i:f.sort((w,I)=>I.fit-w.fit)[0],p=e.top+e.height-o.borderHeight;let _,v=t.height;const C=Math.max(g.maxSizeTop.height,g.maxSizeBottom.height);v>C&&(v=C);let y;v<=g.maxSizeTop.height?(_=!0,y=g.maxSizeTop):(_=!1,y=g.maxSizeBottom),this._applyTopLeft({left:g.left,top:_?g.top:p-v}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!_,g===c,_,g!==c),this._resizable.minSize=g.minSize,this._resizable.maxSize=y,this._resizable.layout(v,Math.min(y.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var Kv;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(Kv||(Kv={}));function MV(n,e,t,i){const s=i===Kv.ROOT_FOLDER?["rootfolder-icon"]:i===Kv.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Ii.data?o=ry.parseMetaData(t).get(ry.META_DATA_LABEL):o=hme(uLe(t).toLowerCase()),i===Kv.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),o.length<=255){const a=o.split(".");for(let c=1;c<a.length;c++)s.push(`${a.slice(c).join(".")}-ext-file-icon`)}s.push("ext-file-icon")}const r=uPt(n,e,t);r&&s.push(`${hme(r)}-lang-file-icon`)}}return s}function uPt(n,e,t){if(!t)return null;let i=null;if(t.scheme===Ii.data){const o=ry.parseMetaData(t).get(ry.META_DATA_MIME);o&&(i=e.getModeId(o))}else{const s=n.getModel(t);s&&(i=s.getLanguageId())}return i&&i!==TM?i:e.getModeIdByFilepathOrFirstLine(t)}function hme(n){return n.replace(/[\11\12\14\15\40]/g,"/")}var dPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_K=function(n,e){return function(t,i){e(t,i,n)}},zN;function ake(n){return`suggest-aria-id:${n}`}const hPt=Xl("suggest-more-info",vn.chevronRight,$("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),fPt=new(zN=class S4{extract(e,t){if(e.textLabel.match(S4._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(S4._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=S4._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},zN._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,zN._regexStrict=new RegExp(`^${zN._regexRelaxed.source}$`,"i"),zN);let UQ=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._modeService=i,this._themeService=s,this._onDidToggleDetails=new rt,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=Object.create(null);t.disposables=new Wt,t.root=e,t.root.classList.add("show-file-icons"),t.icon=Nt(e,Vt(".icon")),t.colorspan=Nt(t.icon,Vt("span.colorspan"));const i=Nt(e,Vt(".contents")),s=Nt(i,Vt(".main"));t.iconContainer=Nt(s,Vt(".icon-label.codicon")),t.left=Nt(s,Vt("span.left")),t.right=Nt(s,Vt("span.right")),t.iconLabel=new Ose(t.left,{supportHighlights:!0,supportIcons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=Nt(t.left,Vt("span.signature-label")),t.qualifierLabel=Nt(t.left,Vt("span.qualifier-label")),t.detailsLabel=Nt(t.right,Vt("span.details-label")),t.readMore=Nt(t.right,Vt("span.readMore"+mo.asCSSSelector(hPt))),t.readMore.title=$("readMore","Read More");const o=()=>{const r=this._editor.getOptions(),a=r.get(43),c=a.getMassagedFontFamily(Mf?va.fontFamily:null),u=a.fontFeatureSettings,d=r.get(106)||a.fontSize,f=r.get(107)||a.lineHeight,g=a.fontWeight,p=`${d}px`,_=`${f}px`;t.root.style.fontSize=p,t.root.style.fontWeight=g,s.style.fontFamily=c,s.style.fontFeatureSettings=u,s.style.lineHeight=_,t.icon.style.height=_,t.icon.style.width=_,t.readMore.style.height=_,t.readMore.style.width=_};return o(),t.disposables.add(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(43)||r.hasChanged(106)||r.hasChanged(107))&&o()})),t}renderElement(e,t,i){const{completion:s}=e;i.root.id=ake(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:A6(e.score)};let r=[];if(s.kind===19&&fPt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=MV(this._modelService,this._modeService,Jn.from({scheme:"fake",path:e.textLabel}),Kv.FILE),c=MV(this._modelService,this._modeService,Jn.from({scheme:"fake",path:s.detail}),Kv.FILE);o.extraClasses=a.length>c.length?a:c}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=Yne([MV(this._modelService,this._modeService,Jn.from({scheme:"fake",path:e.textLabel}),Kv.FOLDER),MV(this._modelService,this._modeService,Jn.from({scheme:"fake",path:s.detail}),Kv.FOLDER)])):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...gTt(s.kind).split(" ")));s.tags&&s.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=vK(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=vK(s.label.detail||""),i.detailsLabel.textContent=vK(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(105).showInlineDetails?pd(i.detailsLabel):Vc(i.detailsLabel),Jse(e)?(i.right.classList.add("can-expand-details"),pd(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Vc(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};UQ=dPt([_K(1,Xr),_K(2,Ga),_K(3,fo)],UQ);function vK(n){return n.replace(/\r\n|\r|\n/g,"")}var gPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kV=function(n,e){return function(t,i){e(t,i,n)}},pPt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const mPt=Ze("editorSuggestWidget.background",{dark:Od,light:Od,hc:Od},$("editorSuggestWidgetBackground","Background color of the suggest widget.")),_Pt=Ze("editorSuggestWidget.border",{dark:b0,light:b0,hc:b0},$("editorSuggestWidgetBorder","Border color of the suggest widget.")),vPt=Ze("editorSuggestWidget.foreground",{dark:PC,light:PC,hc:PC},$("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),bPt=Ze("editorSuggestWidget.selectedForeground",{dark:r4,light:r4,hc:r4},$("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget.")),TPt=Ze("editorSuggestWidget.selectedIconForeground",{dark:l4,light:l4,hc:l4},$("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget.")),CPt=Ze("editorSuggestWidget.selectedBackground",{dark:a4,light:a4,hc:a4},$("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")),yPt=Ze("editorSuggestWidget.highlightForeground",{dark:Qv,light:Qv,hc:Qv},$("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),EPt=Ze("editorSuggestWidget.focusHighlightForeground",{dark:o7,light:o7,hc:o7},$("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));class SPt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof hw}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(eo.is(i))return eo.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let CP=class WQ{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new mc,this._disposables=new Wt,this._onDidSelect=new rt,this._onDidFocus=new rt,this._onDidHide=new rt,this._onDidShow=new rt,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new rt,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new lke,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new wPt(this,e),this._persistedSize=new SPt(t,e);class r{constructor(p,_,v=!1,C=!1){this.persistedSize=p,this.currentSize=_,this.persistHeight=v,this.persistWidth=C}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(g=>{var p,_,v,C;if(this._resize(g.dimension.width,g.dimension.height),a&&(a.persistHeight=a.persistHeight||!!g.north||!!g.south,a.persistWidth=a.persistWidth||!!g.east||!!g.west),!!g.done){if(a){const{itemHeight:y,defaultSize:w}=this.getLayoutInfo(),I=Math.round(y/2);let{width:L,height:O}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-O)<=I)&&(O=(_=(p=a.persistedSize)===null||p===void 0?void 0:p.height)!==null&&_!==void 0?_:w.height),(!a.persistWidth||Math.abs(a.currentSize.width-L)<=I)&&(L=(C=(v=a.persistedSize)===null||v===void 0?void 0:v.width)!==null&&C!==void 0?C:w.width),this._persistedSize.store(new eo(L,O))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Nt(this.element.domNode,Vt(".message")),this._listElement=Nt(this.element.domNode,Vt(".tree"));const c=o.createInstance(VQ,this.editor);c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new cPt(c,this.editor);const u=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(105).showIcons);u();const d=o.createInstance(UQ,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new g_("SuggestWidget",this._listElement,{getHeight:g=>this.getLayoutInfo().itemHeight,getTemplateId:g=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getAriaLabel:g=>{if(g.isResolved&&this._isDetailsVisible()){const{documentation:p,detail:_}=g.completion,v=ha("{0}{1}",_||"",p?typeof p=="string"?p:p.value:"");return $("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",g.textLabel,v)}else return g.textLabel},getWidgetAriaLabel:()=>$("suggest","Suggest"),getWidgetRole:()=>"listbox"}}),this._status=o.createInstance(HQ,this.element.domNode);const f=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(105).showStatusBar);f(),this._disposables.add(rw(this._list,s,{listInactiveFocusBackground:CPt,listInactiveFocusOutline:Ua})),this._disposables.add(s.onDidColorThemeChange(g=>this._onThemeChange(g))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(g=>this._onListMouseDownOrTap(g))),this._disposables.add(this._list.onTap(g=>this._onListMouseDownOrTap(g))),this._disposables.add(this._list.onDidChangeSelection(g=>this._onListSelection(g))),this._disposables.add(this._list.onDidChangeFocus(g=>this._onListFocus(g))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(g=>{g.hasChanged(105)&&(f(),u())})),this._ctxSuggestWidgetVisible=Ni.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Ni.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Ni.MultipleSuggestions.bindTo(i),this._disposables.add(Br(this._details.widget.domNode,"keydown",g=>{this._onDetailsKeydown.fire(g)})),this._disposables.add(this.editor.onMouseDown(g=>this._onEditorMouseDown(g)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){const t=e.getColor(mPt);t&&(this.element.domNode.style.backgroundColor=t.toString(),this._messageElement.style.backgroundColor=t.toString(),this._details.widget.domNode.style.backgroundColor=t.toString());const i=e.getColor(_Pt);i&&(this.element.domNode.style.borderColor=i.toString(),this._messageElement.style.borderColor=i.toString(),this._status.element.style.borderTopColor=i.toString(),this._details.widget.domNode.style.borderColor=i.toString(),this._detailsBorderColor=i.toString());const s=e.getColor(uy);s&&(this._detailsFocusBorderColor=s.toString()),this._details.widget.borderWidth=e.type==="hc"?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0});return}if(!this._completionModel)return;const i=e.elements[0],s=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(s),this._currentSuggestionDetails=ul(o=>pPt(this,void 0,void 0,function*(){const r=j0(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250);o.onCancellationRequested(()=>r.dispose());const a=yield i.resolve(o);return r.dispose(),a})),this._currentSuggestionDetails.then(()=>{s>=this._list.length||i!==this._list.element(s)||(this._ignoreFocusEvents=!0,this._list.splice(s,1,[i]),this._list.setFocus([s]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:ake(s)}))}).catch(di)),this._onDidFocus.fire({item:i,index:s,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Vc(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=WQ.LOADING_MESSAGE,Vc(this._listElement,this._status.element),pd(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=WQ.NO_SUGGESTIONS_MESSAGE,Vc(this._listElement,this._status.element),pd(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:Vc(this._messageElement),pd(this._listElement,this._status.element),this._show();break;case 4:Vc(this._messageElement),pd(this._listElement,this._status.element),this._show();break;case 5:Vc(this._messageElement),pd(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=j0(()=>this._setState(1),t)))}showSuggestions(e,t,i,s){var o,r;if(this._contentWidget.setPosition(this.editor.getPosition()),(o=this._loadingTimeout)===null||o===void 0||o.dispose(),(r=this._currentSuggestionDetails)===null||r===void 0||r.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const a=this._completionModel.items.length,c=a===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),c){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus([t]),this._layout(this.element.size),this._detailsBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsBorderColor)}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._detailsBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsBorderColor)):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._detailsFocusBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsFocusBorderColor))}toggleDetails(){this._isDetailsVisible()?(this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(Jse(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&this._details.show(),this._positionDetails())}_layout(e){var t,i,s;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const o=W8(document.body),r=this.getLayoutInfo();e||(e=r.defaultSize);let a=e.height,c=e.width;if(this._status.element.style.lineHeight=`${r.itemHeight}px`,this._state===2||this._state===1)a=r.itemHeight+r.borderHeight,c=r.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new eo(c,a),this._contentWidget.setPreference(2);else{const u=o.width-r.borderHeight-2*r.horizontalPadding;c>u&&(c=u);const d=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:c,f=r.statusBarHeight+this._list.contentHeight+r.borderHeight,g=r.itemHeight+r.statusBarHeight,p=Bl(this.editor.getDomNode()),_=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),v=p.top+_.top+_.height,C=Math.min(o.height-v-r.verticalPadding,f),y=p.top+_.top-r.verticalPadding,w=Math.min(y,f);let I=Math.min(Math.max(w,C)+r.borderHeight,f);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),a<g&&(a=g),a>I&&(a=I),a>C||this._forceRenderingAbove&&y>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),I=w):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),I=C),this.element.preferredSize=new eo(d,r.defaultSize.height),this.element.maxSize=new eo(u,I),this.element.minSize=new eo(220,g),this._cappedHeight=a===f?{wanted:(s=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&s!==void 0?s:e.height,capped:a}:void 0}this._resize(c,a)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode)}getLayoutInfo(){const e=this.editor.getOption(43),t=mf(this.editor.getOption(107)||e.lineHeight,8,1e3),i=!this.editor.getOption(105).showStatusBar||this._state===2||this._state===1?0:t,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new eo(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};CP.LOADING_MESSAGE=$("suggestWidget.loading","Loading...");CP.NO_SUGGESTIONS_MESSAGE=$("suggestWidget.noSuggestions","No suggestions.");CP=gPt([kV(1,m_),kV(2,ai),kV(3,fo),kV(4,Qi)],CP);class wPt{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new eo(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}ws((n,e)=>{const t=n.getColor(yPt);t&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${t}; }`);const i=n.getColor(EPt);t&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight { color: ${i}; }`);const s=n.getColor(vPt);s&&e.addRule(`.monaco-editor .suggest-widget, .monaco-editor .suggest-details { color: ${s}; }`);const o=n.getColor(bPt);o&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused { color: ${o}; }`);const r=n.getColor(TPt);r&&e.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon { color: ${r}; }`);const a=n.getColor(IF);a&&e.addRule(`.monaco-editor .suggest-details a { color: ${a}; }`);const c=n.getColor(LF);c&&e.addRule(`.monaco-editor .suggest-details a:hover { color: ${c}; }`);const u=n.getColor(yie);u&&e.addRule(`.monaco-editor .suggest-details code { background-color: ${u}; }`)});var IPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},KN=function(n,e){return function(t,i){e(t,i,n)}};class LPt{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);this._marker=e.deltaDecorations([],[{range:be.fromPositions(t,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let Af=class cke{constructor(e,t,i,s,o,r){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._lineSuffix=new pc,this._toDispose=new Wt,this._selectors=new OPt(d=>d.priority),this.editor=e,this.model=o.createInstance(BQ,this.editor);const a=Ni.InsertMode.bindTo(s);a.set(e.getOption(105).insertMode),this.model.onDidTrigger(()=>a.set(e.getOption(105).insertMode)),this.widget=this._toDispose.add(new mO(()=>{const d=this._instantiationService.createInstance(CP,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(v=>this._insertSuggestion(v,0),this));const f=new Txt(this.editor,d,v=>this._insertSuggestion(v,2));this._toDispose.add(f),this._toDispose.add(this.model.onDidSuggest(v=>{v.completionModel.items.length===0&&f.reset()}));const g=Ni.MakesTextEdit.bindTo(this._contextKeyService),p=Ni.HasInsertAndReplaceRange.bindTo(this._contextKeyService),_=Ni.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(xi(()=>{g.reset(),p.reset(),_.reset()})),this._toDispose.add(d.onDidFocus(({item:v})=>{const C=this.editor.getPosition(),y=v.editStart.column,w=C.column;let I=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&w-y===v.completion.insertText.length&&(I=this.editor.getModel().getValueInRange({startLineNumber:C.lineNumber,startColumn:y,endLineNumber:C.lineNumber,endColumn:w})!==v.completion.insertText),g.set(I),p.set(!ct.equals(v.editInsertEnd,v.editReplaceEnd)),_.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(v=>{if(v.toKeybinding().equals(new K0(!0,!1,!1,!1,33))||ki&&v.toKeybinding().equals(new K0(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeybinding().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new mO(()=>this._toDispose.add(new uG(this.editor,this.model)))),this._alternatives=this._toDispose.add(new mO(()=>this._toDispose.add(new gw(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(TP,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new LPt(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(!d.shy){let f=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(f=g.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),f!==-1)break;f===-1&&(f=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items)),this.widget.value.showSuggestions(d.completionModel,f,d.isFrozen,d.auto)}})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));let c=Ni.AcceptSuggestionsOnEnter.bindTo(s),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}static get(e){return e.getContribution(cke.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=this.editor.getModel(),s=i.getAlternativeVersionId(),{item:o}=e,r=[],a=new dc;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(o,!!(t&8));if(this._memoryService.memorize(i,this.editor.getPosition(),o),Array.isArray(o.completion.additionalTextEdits)){const d=hy.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(f=>ir.replace(be.lift(f.range),f.text))),d.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!o.isResolved){const d=new Ym(!0);let f;const g=i.onDidChangeContent(C=>{if(C.isFlush){a.cancel(),g.dispose();return}for(let y of C.changes){const w=be.getEndPosition(y.range);(!f||ct.isBefore(w,f))&&(f=w)}});let p=t;t|=2;let _=!1,v=this.editor.onWillType(()=>{v.dispose(),_=!0,p&2||this.editor.pushUndoStop()});r.push(o.resolve(a.token).then(()=>{if(!o.completion.additionalTextEdits||a.token.isCancellationRequested||f&&o.completion.additionalTextEdits.some(y=>ct.isBefore(f,be.getStartPosition(y.range))))return!1;_&&this.editor.pushUndoStop();const C=hy.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(y=>ir.replace(be.lift(y.range),y.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(_||!(p&2))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",d.elapsed(),C),g.dispose(),v.dispose()}))}let{insertText:u}=o.completion;o.completion.insertTextRules&4||(u=lG.escape(u)),Kl.get(this.editor).insert(u,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),o.completion.command?o.completion.command.id===zF.id?this.model.trigger({auto:!0,shy:!1},!0):(r.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(di)),this.model.cancel()):this.model.cancel(),t&4&&this._alternatives.value.set(e,d=>{for(a.cancel();i.canUndo();){s!==i.getAlternativeVersionId()&&i.undo(),this._insertSuggestion(d,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(r).finally(()=>{this.model.clear(),a.dispose()})}getOverwriteInfo(e,t){Gs(this.editor.hasModel());let i=this.editor.getOption(105).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(Nu(e.completion.additionalTextEdits)){let t=$("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Hl(t)}}triggerSuggest(e){this.editor.hasModel()&&(this.model.trigger({auto:!1,shy:!1},!1,e),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,c=r.column;return c-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:c})!==o.completion.insertText};Ln.once(this.model.onDidTrigger)(o=>{let r=[];Ln.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Ji(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(Ji(r),a.items.length===0){i();return}const c=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),u=a.items[c];if(!s(u)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:u,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};Af.ID="editor.contrib.suggestController";Af=IPt([KN(1,ske),KN(2,vr),KN(3,ai),KN(4,Qi),KN(5,h_)],Af);class OPt{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class zF extends yn{constructor(){super({id:zF.id,label:$("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:dn.and(We.writable,We.hasCompletionItemProvider),kbOpts:{kbExpr:We.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t){const i=Af.get(t);i&&i.triggerSuggest()}}zF.id="editor.action.triggerSuggest";_s(Af.ID,Af);qt(zF);const kh=190,Uu=jl.bindToContribution(Af.get);Xt(new Uu({id:"acceptSelectedSuggestion",precondition:Ni.Visible,handler(n){n.acceptSelectedSuggestion(!0,!1)}}));_c.registerKeybindingRule({id:"acceptSelectedSuggestion",when:dn.and(Ni.Visible,We.textInputFocus),primary:2,weight:kh});_c.registerKeybindingRule({id:"acceptSelectedSuggestion",when:dn.and(Ni.Visible,We.textInputFocus,Ni.AcceptSuggestionsOnEnter,Ni.MakesTextEdit),primary:3,weight:kh});Th.appendMenuItem(Cy,{command:{id:"acceptSelectedSuggestion",title:$("accept.insert","Insert")},group:"left",order:1,when:Ni.HasInsertAndReplaceRange.toNegated()});Th.appendMenuItem(Cy,{command:{id:"acceptSelectedSuggestion",title:$("accept.insert","Insert")},group:"left",order:1,when:dn.and(Ni.HasInsertAndReplaceRange,Ni.InsertMode.isEqualTo("insert"))});Th.appendMenuItem(Cy,{command:{id:"acceptSelectedSuggestion",title:$("accept.replace","Replace")},group:"left",order:1,when:dn.and(Ni.HasInsertAndReplaceRange,Ni.InsertMode.isEqualTo("replace"))});Xt(new Uu({id:"acceptAlternativeSelectedSuggestion",precondition:dn.and(Ni.Visible,We.textInputFocus),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Cy,group:"left",order:2,when:dn.and(Ni.HasInsertAndReplaceRange,Ni.InsertMode.isEqualTo("insert")),title:$("accept.replace","Replace")},{menuId:Cy,group:"left",order:2,when:dn.and(Ni.HasInsertAndReplaceRange,Ni.InsertMode.isEqualTo("replace")),title:$("accept.insert","Insert")}]}));ji.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Xt(new Uu({id:"hideSuggestWidget",precondition:Ni.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:9,secondary:[1033]}}));Xt(new Uu({id:"selectNextSuggestion",precondition:dn.and(Ni.Visible,Ni.MultipleSuggestions),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Xt(new Uu({id:"selectNextPageSuggestion",precondition:dn.and(Ni.Visible,Ni.MultipleSuggestions),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:12,secondary:[2060]}}));Xt(new Uu({id:"selectLastSuggestion",precondition:dn.and(Ni.Visible,Ni.MultipleSuggestions),handler:n=>n.selectLastSuggestion()}));Xt(new Uu({id:"selectPrevSuggestion",precondition:dn.and(Ni.Visible,Ni.MultipleSuggestions),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Xt(new Uu({id:"selectPrevPageSuggestion",precondition:dn.and(Ni.Visible,Ni.MultipleSuggestions),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:11,secondary:[2059]}}));Xt(new Uu({id:"selectFirstSuggestion",precondition:dn.and(Ni.Visible,Ni.MultipleSuggestions),handler:n=>n.selectFirstSuggestion()}));Xt(new Uu({id:"toggleSuggestionDetails",precondition:Ni.Visible,handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Cy,group:"right",order:1,when:dn.and(Ni.DetailsVisible,Ni.CanResolve),title:$("detail.more","show less")},{menuId:Cy,group:"right",order:1,when:dn.and(Ni.DetailsVisible.toNegated(),Ni.CanResolve),title:$("detail.less","show more")}]}));Xt(new Uu({id:"toggleExplainMode",precondition:Ni.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2133}}));Xt(new Uu({id:"toggleSuggestionFocus",precondition:Ni.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:2570,mac:{primary:778}}}));Xt(new Uu({id:"insertBestCompletion",precondition:dn.and(We.textInputFocus,dn.equals("config.editor.tabCompletion","on"),TP.AtEnd,Ni.Visible.toNegated(),gw.OtherSuggestions.toNegated(),Kl.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(jc(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:kh,primary:2}}));Xt(new Uu({id:"insertNextSuggestion",precondition:dn.and(We.textInputFocus,dn.equals("config.editor.tabCompletion","on"),gw.OtherSuggestions,Ni.Visible.toNegated(),Kl.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:2}}));Xt(new Uu({id:"insertPrevSuggestion",precondition:dn.and(We.textInputFocus,dn.equals("config.editor.tabCompletion","on"),gw.OtherSuggestions,Ni.Visible.toNegated(),Kl.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:kh,kbExpr:We.textInputFocus,primary:1026}}));qt(class extends yn{constructor(){super({id:"editor.action.resetSuggestSize",label:$("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){Af.get(e).resetWidgetSize()}});function RPt(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}function MPt(n,e){return(t,i)=>e(n(t),n(i))}function kPt(){return(n,e)=>n-e}function APt(n,e){let t;for(const i of n)(t===void 0||e(i,t)>0)&&(t=i);return t}class NPt extends wt{constructor(e,t){super(),this.editor=e,this.suggestControllerPreselector=t,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentInlineCompletion=void 0,this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.setInactiveDelayed=this._register(new ho(()=>{this.isSuggestWidgetVisible||this._isActive&&(this._isActive=!1,this.onDidChangeEmitter.fire())},100)),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const i=Af.get(this.editor);if(i){this._register(i.registerSelector({priority:100,select:(r,a,c)=>{const u=this.editor.getModel(),d=g5(u,this.suggestControllerPreselector());if(!d)return-1;const f=ct.lift(a),g=c.map((_,v)=>{const C=fme(i,f,_,this.isShiftKeyPressed),y=g5(u,C);if(!y)return;const w=DPt(d.range,y.range)&&d.text.startsWith(y.text);return{index:v,valid:w,prefixLength:y.text.length,suggestItem:_}}).filter(_=>_&&_.valid),p=APt(g,MPt(_=>_.prefixLength,kPt()));return p?p.index:-1}}));let s=!1;const o=()=>{s||(s=!0,this._register(i.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(i.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.setInactiveDelayed.schedule(),this.update(this._isActive)})),this._register(i.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Ln.once(i.model.onDidTrigger)(r=>{o()}))}this.update(this._isActive)}get state(){if(this._isActive)return{selectedItemAsInlineCompletion:this._currentInlineCompletion}}update(e){const t=this.getInlineCompletion();let i=!1;V$t(this._currentInlineCompletion,t)||(this._currentInlineCompletion=t,i=!0),this._isActive!==e&&(this._isActive=e,i=!0),i&&this.onDidChangeEmitter.fire()}getInlineCompletion(){const e=Af.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem();if(t)return fme(e,this.editor.getPosition(),t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Af.get(this.editor);e&&e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Af.get(this.editor);e&&e.forceRenderingAbove()}}function DPt(n,e){return n.startLineNumber===e.startLineNumber&&n.startColumn===e.startColumn&&(n.endLineNumber<e.endLineNumber||n.endLineNumber===e.endLineNumber&&n.endColumn<=e.endColumn)}function fme(n,e,t,i){if(Array.isArray(t.completion.additionalTextEdits)&&t.completion.additionalTextEdits.length>0)return{text:"",range:be.fromPositions(e,e)};let{insertText:s}=t.completion;if(t.completion.insertTextRules&4){const r=new lG().parse(s),a=n.editor.getModel();if(r.children.length>100)return;cm.adjustWhitespace(a,e,r,!0,!0),s=r.toString()}const o=n.getOverwriteInfo(t,i);return{text:s,range:be.fromPositions(e.delta(0,-o.overwriteBefore),e.delta(0,Math.max(o.overwriteAfter,0)))}}var gme=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class $Pt extends qMe{constructor(e,t){super(e),this.cache=t,this.suggestionInlineCompletionSource=this._register(new NPt(this.editor,()=>{var i,s;return(s=(i=this.cache.value)===null||i===void 0?void 0:i.completions[0])===null||s===void 0?void 0:s.toLiveInlineCompletion()})),this.updateOperation=this._register(new pc),this.updateCacheSoon=this._register(new ho(()=>this.updateCache(),50)),this.minReservedLineCount=0,this._register(this.suggestionInlineCompletionSource.onDidChange(()=>{this.updateCacheSoon.schedule(),this.suggestionInlineCompletionSource.state||(this.minReservedLineCount=0);const s=this.ghostText;s&&(this.minReservedLineCount=Math.max(this.minReservedLineCount,xPt(s.parts.map(o=>o.lines.length-1)))),this.minReservedLineCount>=1&&this.isSuggestionPreviewEnabled()?this.suggestionInlineCompletionSource.forceRenderingAbove():this.suggestionInlineCompletionSource.stopForceRenderingAbove(),this.onDidChangeEmitter.fire()})),this._register(this.cache.onDidChange(()=>{this.onDidChangeEmitter.fire()})),this._register(this.editor.onDidChangeCursorPosition(i=>{this.isSuggestionPreviewEnabled()&&(this.minReservedLineCount=0,this.updateCacheSoon.schedule(),this.onDidChangeEmitter.fire())})),this._register(xi(()=>this.suggestionInlineCompletionSource.stopForceRenderingAbove()))}get isActive(){return this.suggestionInlineCompletionSource.state!==void 0}isSuggestionPreviewEnabled(){return this.editor.getOption(105).preview}updateCache(){return gme(this,void 0,void 0,function*(){const e=this.suggestionInlineCompletionSource.state;if(!e||!e.selectedItemAsInlineCompletion)return;const t={text:e.selectedItemAsInlineCompletion.text,range:e.selectedItemAsInlineCompletion.range},i=this.editor.getPosition(),s=ul(r=>gme(this,void 0,void 0,function*(){let a;try{a=yield ZMe(i,this.editor.getModel(),{triggerKind:rh.Automatic,selectedSuggestionInfo:t},r)}catch(c){di(c);return}r.isCancellationRequested||(this.cache.setValue(this.editor,a,rh.Automatic),this.onDidChangeEmitter.fire())})),o=new QMe(s,rh.Automatic);this.updateOperation.value=o,yield s,this.updateOperation.value===o&&this.updateOperation.clear()})}get ghostText(){var e,t;if(!this.isSuggestionPreviewEnabled())return;const i=this.suggestionInlineCompletionSource.state,s=g5(this.editor.getModel(),i==null?void 0:i.selectedItemAsInlineCompletion),o=g5(this.editor.getModel(),(t=(e=this.cache.value)===null||e===void 0?void 0:e.completions[0])===null||t===void 0?void 0:t.toLiveInlineCompletion()),r=o&&s&&o.text.startsWith(s.text)&&o.range.equalsRange(s.range)?o:s||o,a=s?((r==null?void 0:r.text.length)||0)-s.text.length:0;return(d=>{const f=this.editor.getOptions().get(105).previewMode;return d?JMe(d,this.editor.getModel(),f,this.editor.getPosition(),a)||new YMe(d.range.endLineNumber,[],this.minReservedLineCount):void 0})(r)}}function xPt(n){return n.reduce((e,t)=>e+t,0)}var PPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},FPt=function(n,e){return function(t,i){e(t,i,n)}},BPt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class HPt extends wt{constructor(){super(...arguments),this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.hasCachedGhostText=!1,this.currentModelRef=this._register(new pc)}get targetModel(){var e;return(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object}setTargetModel(e){var t;((t=this.currentModelRef.value)===null||t===void 0?void 0:t.object)!==e&&(this.currentModelRef.clear(),this.currentModelRef.value=e?RPt(e,e.onDidChange(()=>{this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire()})):void 0,this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire())}get ghostText(){var e,t;return this.hasCachedGhostText||(this.cachedGhostText=(t=(e=this.currentModelRef.value)===null||e===void 0?void 0:e.object)===null||t===void 0?void 0:t.ghostText,this.hasCachedGhostText=!0),this.cachedGhostText}setExpanded(e){var t;(t=this.targetModel)===null||t===void 0||t.setExpanded(e)}get minReservedLineCount(){return this.targetModel?this.targetModel.minReservedLineCount:0}}let GQ=class extends HPt{constructor(e,t){super(),this.editor=e,this.commandService=t,this.sharedCache=this._register(new VPt),this.suggestWidgetAdapterModel=this._register(new $Pt(this.editor,this.sharedCache)),this.inlineCompletionsModel=this._register(new xQ(this.editor,this.sharedCache,this.commandService)),this._register(this.suggestWidgetAdapterModel.onDidChange(()=>{this.updateModel()})),this.updateModel()}get activeInlineCompletionsModel(){if(this.targetModel===this.inlineCompletionsModel)return this.inlineCompletionsModel}updateModel(){this.setTargetModel(this.suggestWidgetAdapterModel.isActive?this.suggestWidgetAdapterModel:this.inlineCompletionsModel),this.inlineCompletionsModel.setActive(this.targetModel===this.inlineCompletionsModel)}shouldShowHoverAt(e){var t;const i=(t=this.activeInlineCompletionsModel)===null||t===void 0?void 0:t.ghostText;return i?i.parts.some(s=>e.containsPosition(new ct(i.lineNumber,s.column))):!1}triggerInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.trigger(rh.Explicit)}commitInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.commitCurrentSuggestion()}hideInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.hide()}showNextInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.showNext()}showPreviousInlineCompletion(){var e;(e=this.activeInlineCompletionsModel)===null||e===void 0||e.showPrevious()}hasMultipleInlineCompletions(){var e;return BPt(this,void 0,void 0,function*(){const t=yield(e=this.activeInlineCompletionsModel)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};GQ=PPt([FPt(1,vr)],GQ);class VPt extends wt{constructor(){super(...arguments),this.onDidChangeEmitter=new rt,this.onDidChange=this.onDidChangeEmitter.event,this.cache=this._register(new pc)}get value(){return this.cache.value}setValue(e,t,i){this.cache.value=new j$t(e,t,()=>this.onDidChangeEmitter.fire(),i)}clearAndLeak(){return this.cache.clearAndLeak()}clear(){this.cache.clear()}}var uke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},b$=function(n,e){return function(t,i){e(t,i,n)}},bK;const pme=(bK=window.trustedTypes)===null||bK===void 0?void 0:bK.createPolicy("editorGhostText",{createHTML:n=>n});let zQ=class extends wt{constructor(e,t,i,s){super(),this.editor=e,this.model=t,this.instantiationService=i,this.modeService=s,this.disposed=!1,this.partsWidget=this._register(this.instantiationService.createInstance(KQ,this.editor)),this.additionalLinesWidget=this._register(new UPt(this.editor,this.modeService.languageIdCodec)),this.viewMoreContentWidget=void 0,this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(29)||o.hasChanged(104)||o.hasChanged(87)||o.hasChanged(82)||o.hasChanged(44)||o.hasChanged(43)||o.hasChanged(58))&&this.update()})),this._register(xi(()=>{var o;this.disposed=!0,this.update(),(o=this.viewMoreContentWidget)===null||o===void 0||o.dispose(),this.viewMoreContentWidget=void 0})),this._register(t.onDidChange(()=>{this.update()})),this.update()}shouldShowHoverAtViewZone(e){return this.additionalLinesWidget.viewZoneId===e}update(){var e;const t=this.model.ghostText;if(!this.editor.hasModel()||!t||this.disposed){this.partsWidget.clear(),this.additionalLinesWidget.clear();return}const i=new Array,s=new Array;function o(u,d){if(s.length>0){const f=s[s.length-1];d&&f.decorations.push(new Ed(f.content.length+1,f.content.length+1+u[0].length,d,0)),f.content+=u[0],u=u.slice(1)}for(const f of u)s.push({content:f,decorations:d?[new Ed(1,f.length+1,d,0)]:[]})}const r=this.editor.getModel().getLineContent(t.lineNumber);this.editor.getModel().getLineTokens(t.lineNumber);let a,c=0;for(const u of t.parts){let d=u.lines;a===void 0?(i.push({column:u.column,text:d[0],preview:u.preview}),d=d.slice(1)):o([r.substring(c,u.column-1)],void 0),d.length>0&&(o(d,"ghost-text"),a===void 0&&u.column<=r.length&&(a=u.column)),c=u.column-1}a!==void 0&&o([r.substring(c)],void 0),this.partsWidget.setParts(t.lineNumber,i,a!==void 0?{column:a,length:r.length+1-a}:void 0),this.additionalLinesWidget.updateLines(t.lineNumber,s,t.additionalReservedLineCount),t.parts.some(u=>u.lines.length<0)?this.viewMoreContentWidget=this.renderViewMoreLines(new ct(t.lineNumber,this.editor.getModel().getLineMaxColumn(t.lineNumber)),"",0):((e=this.viewMoreContentWidget)===null||e===void 0||e.dispose(),this.viewMoreContentWidget=void 0)}renderViewMoreLines(e,t,i){const s=this.editor.getOption(43),o=document.createElement("div");o.className="suggest-preview-additional-widget",Ea.applyFontInfoSlow(o,s);const r=document.createElement("span");r.className="content-spacer",r.append(t),o.append(r);const a=document.createElement("span");a.className="content-newline suggest-preview-text",a.append("⏎ "),o.append(a);const c=new Wt,u=document.createElement("div");return u.className="button suggest-preview-text",u.append(`+${i} lines…`),c.add(Br(u,"mousedown",d=>{var f;(f=this.model)===null||f===void 0||f.setExpanded(!0),d.preventDefault(),this.editor.focus()})),o.append(u),new KPt(this.editor,e,o,c)}};zQ=uke([b$(2,Qi),b$(3,Ga)],zQ);let KQ=class{constructor(e,t,i,s){this.editor=e,this.codeEditorService=t,this.themeService=i,this.contextKeyService=s,this.decorationIds=[],this.disposableStore=new Wt}dispose(){this.clear(),this.disposableStore.dispose()}clear(){this.editor.deltaDecorations(this.decorationIds,[]),this.disposableStore.clear()}setParts(e,t,i){this.disposableStore.clear();const s=this.themeService.getColorTheme(),o=s.getColor(Z1e);let r,a;o&&(r=String(o.rgba.a),a=mt.Format.CSS.format(dke(o)));const c=s.getColor(Q1e);let u;c&&(u=`2px dashed ${c}`);const d=this.editor.getModel();if(!d)return;const{tabSize:f}=d.getOptions(),g=d.getLineContent(e)||"";let p=0,_="";const v=new Array;i&&v.push({range:be.fromPositions(new ct(e,i.column),new ct(e,i.column+i.length)),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});const C=this.contextKeyService.getContextKeyValue("config.editor.useInjectedText"),y=C===void 0?!0:!!C;this.decorationIds=this.editor.deltaDecorations(this.decorationIds,t.map(w=>{_+=g.substring(p,w.column-1),p=w.column-1;const I=y?w.text:this.renderSingleLineText(w.text,_,f,!1),L=this.disposableStore.add(zPt(this.codeEditorService,"ghost-text","0-ghost-text-",{after:{contentText:I,opacity:r,color:a,border:u,fontWeight:w.preview?"bold":"normal"}}));return{range:be.fromPositions(new ct(e,w.column)),options:y?{description:"ghost-text",after:{content:I,inlineClassName:w.preview?"ghost-text-decoration-preview":"ghost-text-decoration"},showIfCollapsed:!0}:Object.assign({},L.resolve())}}).concat(v))}renderSingleLineText(e,t,i,s){const o=t+e,r=Vs.visibleColumnsByColumns(o,i);let a="",c=t.length+1;for(const u of e){if(u===" "){const d=r[c+1]-r[c];if(s){a+="→";for(let f=1;f<d;f++)a+=" "}else for(let f=0;f<d;f++)a+=" "}else u===" "?s?a+="·":a+=" ":a+=u;c+=1}return a}};KQ=uke([b$(1,hs),b$(2,fo),b$(3,ai)],KQ);function dke(n){const{r:e,b:t,g:i}=n.rgba;return new mt(new Di(e,i,t,255))}class UPt{constructor(e,t){this.editor=e,this.languageIdCodec=t,this._viewZoneId=void 0}get viewZoneId(){return this._viewZoneId}dispose(){this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");WPt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c})}})}}function WPt(n,e,t,i,s){const o=i.get(29),r=i.get(104),a="none",c=i.get(82),u=i.get(44),d=i.get(43),f=i.get(58),g=Y0(1e4);g.appendASCIIString('<div class="suggest-preview-text">');for(let v=0,C=t.length;v<C;v++){const y=t[v],w=y.content;g.appendASCIIString('<div class="view-line'),g.appendASCIIString('" style="top:'),g.appendASCIIString(String(v*f)),g.appendASCIIString('px;width:1000000px;">');const I=Dne(w),L=z8(w),O=El.createEmpty(w,s);t6(new Hw(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,w,!1,I,L,0,O,y.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,u!==gd.OFF,null),g),g.appendASCIIString("</div>")}g.appendASCIIString("</div>"),Ea.applyFontInfoSlow(n,d);const p=g.build(),_=pme?pme.createHTML(p):p;n.innerHTML=_}let GPt=0;function zPt(n,e,t,i){const s=t+GPt++;return n.registerDecorationType(e,s,i),{dispose(){n.removeDecorationType(s)},resolve(){return n.resolveDecorationOptions(s,!0)}}}class KPt extends wt{constructor(e,t,i,s){super(),this.editor=e,this.position=t,this.domNode=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!1,this._register(s),this._register(xi(()=>{this.editor.removeContentWidget(this)})),this.editor.addContentWidget(this)}getId(){return"editor.widget.viewMoreLinesWidget"}getDomNode(){return this.domNode}getPosition(){return{position:this.position,preference:[0]}}}ws((n,e)=>{const t=n.getColor(Z1e);if(t){const s=String(t.rgba.a),o=mt.Format.CSS.format(dke(t));e.addRule(`.monaco-editor .ghost-text-decoration { opacity: ${s} !important; color: ${o} !important; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { color: ${t.toString()} !important; }`),e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { opacity: ${s} !important; color: ${o} !important; }`)}const i=n.getColor(Q1e);i&&(e.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 1px solid ${i}; }`),e.addRule(`.monaco-editor .ghost-text-decoration { border: 1px solid ${i}; }`),e.addRule(`.monaco-editor .ghost-text-decoration-preview { border: 1px solid ${i}; }`))});var hke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jQ=function(n,e){return function(t,i){e(t,i,n)}},dG=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let al=class fke extends wt{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.triggeredExplicitly=!1,this.activeController=this._register(new pc),this._register(this.editor.onDidChangeModel(()=>{this.updateModelController()})),this._register(this.editor.onDidChangeConfiguration(i=>{i.hasChanged(105)&&this.updateModelController(),i.hasChanged(54)&&this.updateModelController()})),this.updateModelController()}static get(e){return e.getContribution(fke.ID)}get activeModel(){var e;return(e=this.activeController.value)===null||e===void 0?void 0:e.model}updateModelController(){const e=this.editor.getOption(105),t=this.editor.getOption(54);this.activeController.value=void 0,this.activeController.value=this.editor.hasModel()&&(e.preview||t.enabled||this.triggeredExplicitly)?this.instantiationService.createInstance(XQ,this.editor):void 0}shouldShowHoverAt(e){var t;return((t=this.activeModel)===null||t===void 0?void 0:t.shouldShowHoverAt(e))||!1}shouldShowHoverAtViewZone(e){var t,i;return((i=(t=this.activeController.value)===null||t===void 0?void 0:t.widget)===null||i===void 0?void 0:i.shouldShowHoverAtViewZone(e))||!1}trigger(){var e;this.triggeredExplicitly=!0,this.activeController.value||this.updateModelController(),(e=this.activeModel)===null||e===void 0||e.triggerInlineCompletion()}commit(){var e;(e=this.activeModel)===null||e===void 0||e.commitInlineCompletion()}hide(){var e;(e=this.activeModel)===null||e===void 0||e.hideInlineCompletion()}showNextInlineCompletion(){var e;(e=this.activeModel)===null||e===void 0||e.showNextInlineCompletion()}showPreviousInlineCompletion(){var e;(e=this.activeModel)===null||e===void 0||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return dG(this,void 0,void 0,function*(){const t=yield(e=this.activeModel)===null||e===void 0?void 0:e.hasMultipleInlineCompletions();return t!==void 0?t:!1})}};al.inlineSuggestionVisible=new Sn("inlineSuggestionVisible",!1,$("inlineSuggestionVisible","Whether an inline suggestion is visible"));al.inlineSuggestionHasIndentation=new Sn("inlineSuggestionHasIndentation",!1,$("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));al.inlineSuggestionHasIndentationLessThanTabSize=new Sn("inlineSuggestionHasIndentationLessThanTabSize",!0,$("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"));al.ID="editor.contrib.ghostTextController";al=hke([jQ(1,Qi)],al);class jPt{constructor(e){this.contextKeyService=e,this.inlineCompletionVisible=al.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=al.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=al.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService)}}let XQ=class extends wt{constructor(e,t,i){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.contextKeys=new jPt(this.contextKeyService),this.model=this._register(this.instantiationService.createInstance(GQ,this.editor)),this.widget=this._register(this.instantiationService.createInstance(zQ,this.editor,this.model)),this._register(xi(()=>{this.contextKeys.inlineCompletionVisible.set(!1),this.contextKeys.inlineCompletionSuggestsIndentation.set(!1),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(!0)})),this._register(this.model.onDidChange(()=>{this.updateContextKeys()})),this.updateContextKeys()}updateContextKeys(){var e;this.contextKeys.inlineCompletionVisible.set(((e=this.model.activeInlineCompletionsModel)===null||e===void 0?void 0:e.ghostText)!==void 0);let t=!1,i=!0;const s=this.model.inlineCompletionsModel.ghostText;if(this.model.activeInlineCompletionsModel&&s&&s.parts.length>0){const{column:o,lines:r}=s.parts[0],a=r[0],c=this.editor.getModel().getLineIndentColumn(s.lineNumber);if(o<=c){let d=cc(a);d===-1&&(d=a.length-1),t=d>0;const f=this.editor.getModel().getOptions().tabSize;i=Vs.visibleColumnFromColumn(a,d+1,f)<f}}this.contextKeys.inlineCompletionSuggestsIndentation.set(t),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(i)}};XQ=hke([jQ(1,Qi),jQ(2,ai)],XQ);const gke=jl.bindToContribution(al.get),yP=new gke({id:XMe,precondition:al.inlineSuggestionVisible,handler(n){n.commit(),n.editor.focus()}});Xt(yP);_c.registerKeybindingRule({primary:2,weight:200,id:yP.id,when:dn.and(yP.precondition,We.tabMovesFocus.toNegated(),al.inlineSuggestionHasIndentationLessThanTabSize)});Xt(new gke({id:"editor.action.inlineSuggest.hide",precondition:al.inlineSuggestionVisible,kbOpts:{weight:100,primary:9},handler(n){n.hide()}}));class $R extends yn{constructor(){super({id:$R.ID,label:$("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:dn.and(We.writable,al.inlineSuggestionVisible),kbOpts:{weight:100,primary:601}})}run(e,t){return dG(this,void 0,void 0,function*(){const i=al.get(t);i&&(i.showNextInlineCompletion(),t.focus())})}}$R.ID="editor.action.inlineSuggest.showNext";class xR extends yn{constructor(){super({id:xR.ID,label:$("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:dn.and(We.writable,al.inlineSuggestionVisible),kbOpts:{weight:100,primary:599}})}run(e,t){return dG(this,void 0,void 0,function*(){const i=al.get(t);i&&(i.showPreviousInlineCompletion(),t.focus())})}}xR.ID="editor.action.inlineSuggest.showPrevious";class XPt extends yn{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:$("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:We.writable})}run(e,t){return dG(this,void 0,void 0,function*(){const i=al.get(t);i&&i.trigger()})}}_s(al.ID,al);qt(XPt);qt($R);qt(xR);var YPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},h1=function(n,e){return function(t,i){e(t,i,n)}};class qPt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}hasMultipleSuggestions(){return this.controller.hasMultipleInlineCompletions()}}let YQ=class{constructor(e,t,i,s,o,r,a,c){this._editor=e,this._hover=t,this._commandService=i,this._menuService=s,this._contextKeyService=o,this._modeService=r,this._openerService=a,this.accessibilityService=c}suggestHoverAnchor(e){const t=al.get(this._editor);if(!t)return null;if(e.target.type===8){const i=e.target.detail;if(t.shouldShowHoverAtViewZone(i.viewZoneId))return new cK(1e3,this,be.fromPositions(i.positionBefore||i.position,i.positionBefore||i.position))}return e.target.type===7&&e.target.range&&t.shouldShowHoverAt(e.target.range)?new cK(1e3,this,e.target.range):e.target.type===6&&e.target.range&&e.target.detail&&e.target.detail.mightBeForeignElement&&t.shouldShowHoverAt(e.target.range)?new cK(1e3,this,e.target.range):null}computeSync(e,t){const i=al.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new qPt(this,e.range,i)]:[]}renderHoverParts(e,t,i){const s=new Wt,o=e[0];this.accessibilityService.isScreenReaderOptimized()&&this.renderScreenReaderText(o,t,s);const r=s.add(this._menuService.createMenu(wn.InlineCompletionsActions,this._contextKeyService)),a=i.addAction({label:$("showNextInlineSuggestion","Next"),commandId:$R.ID,run:()=>this._commandService.executeCommand($R.ID)}),c=i.addAction({label:$("showPreviousInlineSuggestion","Previous"),commandId:xR.ID,run:()=>this._commandService.executeCommand(xR.ID)});i.addAction({label:$("acceptInlineSuggestion","Accept"),commandId:yP.id,run:()=>this._commandService.executeCommand(yP.id)});const u=[a,c];for(const d of u)d.setEnabled(!1);o.hasMultipleSuggestions().then(d=>{for(const f of u)f.setEnabled(d)});for(const[d,f]of r.getActions())for(const g of f)g instanceof Q0&&i.addAction({label:g.label,commandId:g.item.id,run:()=>this._commandService.executeCommand(g.item.id)});return s}renderScreenReaderText(e,t,i){var s,o;const r=Vt,a=r("div.hover-row.markdown-hover"),c=Nt(a,r("div.hover-contents")),u=i.add(new by({editor:this._editor},this._modeService,this._openerService)),d=g=>{i.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",this._hover.onContentsChanged()}));const p=$("inlineSuggestionFollows","Suggestion:"),_=i.add(u.render(new mb().appendText(p).appendCodeblock("text",g)));c.replaceChildren(_.element)},f=(o=(s=e.controller.activeModel)===null||s===void 0?void 0:s.inlineCompletionsModel)===null||o===void 0?void 0:o.ghostText;if(f){const g=this._editor.getModel().getLineContent(f.lineNumber);d(f.renderForScreenReader(g))}t.appendChild(a)}};YQ=YPt([h1(2,vr),h1(3,Uw),h1(4,ai),h1(5,Ga),h1(6,np),h1(7,Vu)],YQ);var pke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},w4=function(n,e){return function(t,i){e(t,i,n)}},mme=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const _me=Vt;let qQ=class extends wt{constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=_me("div.hover-row.status-bar"),this.actionsElement=Nt(this.hoverElement,_me("div.actions"))}get hasContent(){return this._hasContent}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Kse.render(this.actionsElement,e,i))}append(e){const t=Nt(this.actionsElement,e);return this._hasContent=!0,t}};qQ=pke([w4(0,Ro)],qQ);class m5{constructor(e,t){this._participants=t,this._editor=e,this._result=[],this._anchor=null}setAnchor(e){this._anchor=e,this._result=[]}clearResult(){this._result=[]}static _getLineDecorations(e,t){if(t.type!==1)return[];const i=e.getModel(),s=t.range.startLineNumber,o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,c=r.range.endLineNumber===s?r.range.endColumn:o;return!(a>t.range.startColumn||t.range.endColumn>c)})}computeAsync(e){return mme(this,void 0,void 0,function*(){const t=this._anchor;if(!this._editor.hasModel()||!t)return Promise.resolve([]);const i=m5._getLineDecorations(this._editor,t),s=yield Promise.all(this._participants.map(o=>this._computeAsync(o,i,t,e)));return Yne(s)})}_computeAsync(e,t,i,s){return mme(this,void 0,void 0,function*(){return e.computeAsync?e.computeAsync(i,t,s):[]})}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=m5._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Bw(t)}onResult(e,t){t?this._result=e.concat(this._result):this._result=this._result.concat(e)}getResult(){return this._result.slice(0)}getResultWithLoadingMessage(){if(this._anchor){for(const e of this._participants)if(e.createLoadingMessage){const t=e.createLoadingMessage(this._anchor);if(t)return this._result.slice(0).concat([t])}}return this._result.slice(0)}}let EC=class JQ extends Bd{constructor(e,t,i,s,o){super(),this._hoverVisibleKey=t,this._keybindingService=s,this._contextKeyService=o,this.allowEditorOverflow=!0,this._participants=[i.createInstance(IQ,e,this),i.createInstance(OQ,e,this),i.createInstance(YQ,e,this),i.createInstance($Q,e,this)],this._editor=e,this._isVisible=!1,this._stoleFocus=!1,this._renderDisposable=null,this._hover=this._register(new DMe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this.onkeydown(this._hover.containerDomNode,r=>{r.equals(9)&&this.hide()}),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(43)&&this._updateFont()})),this._editor.onDidLayoutChange(()=>this.layout()),this.layout(),this._editor.addContentWidget(this),this._showAtPosition=null,this._showAtRange=null,this._stoleFocus=!1,this._messages=[],this._lastAnchor=null,this._computer=new m5(this._editor,this._participants),this._highlightDecorations=[],this._isChangingDecorations=!1,this._shouldFocus=!1,this._colorPicker=null,this._preferAbove=this._editor.getOption(52).above,this._hoverOperation=new xMe(this._computer,r=>this._withResult(r,!0),null,r=>this._withResult(r,!1),this._editor.getOption(52).delay),this._register(Br(this.getDomNode(),An.FOCUS,()=>{this._colorPicker&&this.getDomNode().classList.add("colorpicker-hover")})),this._register(Br(this.getDomNode(),An.BLUR,()=>{this.getDomNode().classList.remove("colorpicker-hover")})),this._register(e.onDidChangeConfiguration(()=>{this._hoverOperation.setHoverTime(this._editor.getOption(52).delay),this._preferAbove=this._editor.getOption(52).above})),this._register($o.onDidChange(()=>{this._isVisible&&this._lastAnchor&&this._messages.length>0&&(this._hover.contentsDomNode.textContent="",this._renderMessages(this._lastAnchor,this._messages))}))}dispose(){this._hoverOperation.cancel(),this._editor.removeContentWidget(this),super.dispose()}getId(){return JQ.ID}getDomNode(){return this._hover.containerDomNode}_shouldShowAt(e){const t=e.target.type;if(t===6)return!0;if(t===7){const i=this._editor.getOption(43).typicalHalfwidthCharacterWidth/2,s=e.target.detail;if(s&&!s.isAfterLines&&typeof s.horizontalDistanceToText=="number"&&s.horizontalDistanceToText<i)return!0}return!1}maybeShowAt(e){var t;const i=[];for(const s of this._participants)if(typeof s.suggestHoverAnchor=="function"){const o=s.suggestHoverAnchor(e);o&&i.push(o)}if(this._shouldShowAt(e)&&e.target.range){const o=[...((t=e.target.element)===null||t===void 0?void 0:t.classList.values())||[]].find(r=>r.startsWith("ced-colorBox"))&&e.target.range.endColumn-e.target.range.startColumn===1?new be(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1):e.target.range;i.push(new Bpe(0,o))}return i.length===0?!1:(i.sort((s,o)=>o.priority-s.priority),this._startShowingAt(i[0],0,!1),!0)}_showAt(e,t,i){this._showAtPosition=e,this._showAtRange=t,this._hoverVisibleKey.set(!0),this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=i,i&&this._hover.containerDomNode.focus()}getPosition(){if(this._isVisible){let e=this._preferAbove;return!e&&this._contextKeyService.getContextKeyValue(Ni.Visible.key)&&(e=!0),{position:this._showAtPosition,range:this._showAtRange,preference:e?[1,2]:[2,1]}}return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont(),this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(43);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i/t}`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`}onModelDecorationsChanged(){this._isChangingDecorations||this._isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._colorPicker||this._hoverOperation.start(0))}startShowingAtRange(e,t,i){this._startShowingAt(new Bpe(0,e),t,i)}_startShowingAt(e,t,i){if(!(this._lastAnchor&&this._lastAnchor.equals(e))){if(this._hoverOperation.cancel(),this._isVisible)if(!this._showAtPosition||!this._lastAnchor||!e.canAdoptVisibleHover(this._lastAnchor,this._showAtPosition))this.hide();else{const s=this._messages.filter(o=>o.isValidForHoverAnchor(e));if(s.length===0)this.hide();else{if(s.length===this._messages.length)return;this._renderMessages(e,s)}}this._lastAnchor=e,this._computer.setAnchor(e),this._shouldFocus=i,this._hoverOperation.start(t)}}hide(){this._lastAnchor=null,this._hoverOperation.cancel(),this._isVisible&&(setTimeout(()=>{this._isVisible||this._hoverVisibleKey.set(!1)},0),this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus()),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,[]),this._isChangingDecorations=!1,this._renderDisposable&&(this._renderDisposable.dispose(),this._renderDisposable=null),this._colorPicker=null}isColorPickerVisible(){return!!this._colorPicker}setColorPicker(e){this._colorPicker=e}onContentsChanged(){this._hover.onContentsChanged()}_withResult(e,t){this._messages=e,this._lastAnchor&&this._messages.length>0?this._renderMessages(this._lastAnchor,this._messages):t&&this.hide()}_renderMessages(e,t){this._renderDisposable&&(this._renderDisposable.dispose(),this._renderDisposable=null),this._colorPicker=null;let i=1073741824,s=t[0].range,o=null,r=document.createDocumentFragment();const a=new Wt,c=new Map;for(const d of t)i=Math.min(i,d.range.startColumn),s=be.plusRange(s,d.range),d.forceShowAtRange&&(o=d.range),c.has(d.owner)||c.set(d.owner,[]),c.get(d.owner).push(d);const u=a.add(new qQ(this._keybindingService));for(const[d,f]of c)a.add(d.renderHoverParts(f,r,u));u.hasContent&&r.appendChild(u.hoverElement),this._renderDisposable=a,r.hasChildNodes()&&(o?this._showAt(o.getStartPosition(),o,this._shouldFocus):this._showAt(new ct(e.range.startLineNumber,i),s,this._shouldFocus),this._updateContents(r)),this._colorPicker&&this._colorPicker.layout(),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,s?[{range:s,options:JQ._DECORATION_OPTIONS}]:[]),this._isChangingDecorations=!1}};EC.ID="editor.contrib.modesContentHoverWidget";EC._DECORATION_OPTIONS=Ci.register({description:"content-hover-highlight",className:"hoverHighlight"});EC=pke([w4(2,Qi),w4(3,Ro),w4(4,ai)],EC);const vme=Vt;class JPt{constructor(e){this._editor=e,this._lineNumber=-1,this._result=[]}setLineNumber(e){this._lineNumber=e,this._result=[]}clearResult(){this._result=[]}computeSync(){const e=s=>({value:s}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const s of t){if(!s.options.glyphMarginClassName)continue;const o=s.options.glyphMarginHoverMessage;!o||p$(o)||i.push(...qne(o).map(e))}return i}onResult(e,t){this._result=this._result.concat(e)}getResult(){return this._result}getResultWithLoadingMessage(){return this.getResult()}}class t0 extends Bd{constructor(e,t,i=Dbt){super(),this._renderDisposeables=this._register(new Wt),this._editor=e,this._isVisible=!1,this._messages=[],this._lastLineNumber=-1,this._hover=this._register(new DMe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new by({editor:this._editor},t,i)),this._computer=new JPt(this._editor),this._hoverOperation=new xMe(this._computer,s=>this._withResult(s),void 0,s=>this._withResult(s),300),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(43)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._hoverOperation.cancel(),this._editor.removeOverlayWidget(this),super.dispose()}getId(){return t0.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),o=this._editor.getOption(58),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._hoverOperation.start(0))}startShowingAt(e){this._lastLineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._lastLineNumber=e,this._computer.setLineNumber(e),this._hoverOperation.start(0))}hide(){this._lastLineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const o=vme("div.hover-row.markdown-hover"),r=Nt(o,vme("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}}t0.ID="editor.contrib.modesGlyphHoverWidget";var QPt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},AV=function(n,e){return function(t,i){e(t,i,n)}};let yy=class mke{constructor(e,t,i,s,o){this._editor=e,this._instantiationService=t,this._openerService=i,this._modeService=s,this._toUnhook=new Wt,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(r=>{r.hasChanged(52)&&(this._unhookEvents(),this._hookEvents())}),this._hoverVisibleKey=We.hoverVisible.bindTo(o)}static get(e){return e.getContribution(mke.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(52);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i))),this._toUnhook.add(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged()))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(e)),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onModelDecorationsChanged(){var e,t;(e=this._contentWidget)===null||e===void 0||e.onModelDecorationsChanged(),(t=this._glyphWidget)===null||t===void 0||t.onModelDecorationsChanged()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target.type;if(t===9&&e.target.detail===EC.ID){this._hoverClicked=!0;return}t===12&&e.target.detail===t0.ID||(t!==12&&e.target.detail!==t0.ID&&(this._hoverClicked=!1),this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseMove(e){var t,i,s,o,r;let a=e.target.type;if(this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&a===9&&e.target.detail===EC.ID||this._isHoverSticky&&!(!((i=(t=e.event.browserEvent.view)===null||t===void 0?void 0:t.getSelection())===null||i===void 0)&&i.isCollapsed)||!this._isHoverSticky&&a===9&&e.target.detail===EC.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible())||this._isHoverSticky&&a===12&&e.target.detail===t0.ID)return;if(!this._isHoverEnabled){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(o=this._glyphWidget)===null||o===void 0||o.hide();return}if(a===2&&e.target.position){(r=this._contentWidget)===null||r===void 0||r.hide(),this._glyphWidget||(this._glyphWidget=new t0(this._editor,this._modeService,this._openerService)),this._glyphWidget.startShowingAt(e.target.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible())||(this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(EC,this._editor,this._hoverVisibleKey)),this._contentWidget}isColorPickerVisible(){var e;return((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,i){this._getOrCreateContentWidget().startShowingAtRange(e,t,i)}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};yy.ID="editor.contrib.hover";yy=QPt([AV(1,Qi),AV(2,np),AV(3,Ga),AV(4,ai)],yy);class ZPt extends yn{constructor(){super({id:"editor.action.showHover",label:$({key:"showHover",comment:["Label for action that will trigger the showing of a hover in the editor.","This allows for users to show the hover without using the mouse."]},"Show Hover"),alias:"Show Hover",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2087),weight:100}})}run(e,t){if(!t.hasModel())return;let i=yy.get(t);if(!i)return;const s=t.getPosition(),o=new be(s.lineNumber,s.column,s.lineNumber,s.column),r=t.getOption(2)===2;i.showContentHover(o,1,r)}}class eFt extends yn{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:$({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){let i=yy.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new be(s.lineNumber,s.column,s.lineNumber,s.column);fw.get(t).startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,!0)})}}_s(yy.ID,yy);qt(ZPt);qt(eFt);ws((n,e)=>{const t=n.getColor(ZSt);t&&e.addRule(`.monaco-editor .hoverHighlight { background-color: ${t}; }`);const i=n.getColor(tw);i&&e.addRule(`.monaco-editor .monaco-hover { background-color: ${i}; }`);const s=n.getColor(Nie);s&&(e.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${s}; }`),e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${s.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${s.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${s.transparent(.5)}; }`));const o=n.getColor(IF);o&&e.addRule(`.monaco-editor .monaco-hover a { color: ${o}; }`);const r=n.getColor(LF);r&&e.addRule(`.monaco-editor .monaco-hover a:hover { color: ${r}; }`);const a=n.getColor(Aie);a&&e.addRule(`.monaco-editor .monaco-hover { color: ${a}; }`);const c=n.getColor(e0t);c&&e.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${c}; }`);const u=n.getColor(yie);u&&e.addRule(`.monaco-editor .monaco-hover code { background-color: ${u}; }`)});class QQ extends wt{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){var t;if(e.target.type!==6||![...((t=e.target.element)===null||t===void 0?void 0:t.classList.values())||[]].find(r=>r.startsWith("ced-colorBox"))||!e.target.range)return;const o=this._editor.getContribution(yy.ID);if(!o.isColorPickerVisible()){const r=new be(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1);o.showContentHover(r,0,!1)}}}QQ.ID="editor.contrib.colorContribution";_s(QQ.ID,QQ);class SC{constructor(e,t){this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r<s;r++){const a=e.charCodeAt(i+r),c=t.charCodeAt(r);if(a!==c&&!(a>=65&&a<=90&&a+32===c)&&!(c>=65&&c<=90&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,c=e.startColumn,u=e.endLineNumber,d=e.endColumn,f=o.getLineContent(a),g=o.getLineContent(u);let p=f.lastIndexOf(t,c-1+t.length),_=g.indexOf(i,d-1-i.length);if(p!==-1&&_!==-1)if(a===u)f.substring(p+t.length,_).indexOf(i)>=0&&(p=-1,_=-1);else{const C=f.substring(p+t.length),y=g.substring(0,_);(C.indexOf(i)>=0||y.indexOf(i)>=0)&&(p=-1,_=-1)}let v;p!==-1&&_!==-1?(s&&p+t.length<f.length&&f.charCodeAt(p+t.length)===32&&(t=t+" "),s&&_>0&&g.charCodeAt(_-1)===32&&(i=" "+i,_-=1),v=SC._createRemoveBlockCommentOperations(new be(a,p+t.length+1,u,_+1),t,i)):(v=SC._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=v.length===1?i:null);for(const C of v)r.addTrackedEditOperation(C.range,C.text)}static _createRemoveBlockCommentOperations(e,t,i){let s=[];return be.isEmpty(e)?s.push(ir.delete(new be(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ir.delete(new be(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ir.delete(new be(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){let o=[];return be.isEmpty(e)?o.push(ir.replace(new be(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(ir.insert(new ct(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(ir.insert(new ct(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=ns.getComments(o);!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new fn(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new fn(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}class yv{constructor(e,t,i,s,o,r){this._selection=e,this._tabSize=t,this._type=i,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i){e.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),o=ns.getComments(s),r=o?o.lineCommentToken:null;if(!r)return null;let a=[];for(let c=0,u=i-t+1;c<u;c++)a[c]={ignore:!1,commentStr:r,commentStrOffset:0,commentStrLength:r.length};return a}static _analyzeLines(e,t,i,s,o,r,a){let c=!0,u;e===0?u=!0:e===1?u=!1:u=!0;for(let d=0,f=s.length;d<f;d++){const g=s[d],p=o+d;if(p===o&&a){g.ignore=!0;continue}const _=i.getLineContent(p),v=cc(_);if(v===-1){g.ignore=r,g.commentStrOffset=_.length;continue}if(c=!1,g.ignore=!1,g.commentStrOffset=v,u&&!SC._haystackHasNeedleAtOffset(_,g.commentStr,v)&&(e===0?u=!1:e===1||(g.ignore=!0)),u&&t){const C=v+g.commentStrLength;C<_.length&&_.charCodeAt(C)===32&&(g.commentStrLength+=1)}}if(e===0&&c){u=!1;for(let d=0,f=s.length;d<f;d++)s[d].ignore=!1}return{supported:!0,shouldRemoveComments:u,lines:s}}static _gatherPreflightData(e,t,i,s,o,r,a){const c=yv._gatherPreflightCommentStrings(i,s,o);return c===null?{supported:!1}:yv._analyzeLines(e,t,i,c,s,r,a)}_executeLineComments(e,t,i,s){let o;i.shouldRemoveComments?o=yv._createRemoveLineCommentsOperations(i.lines,s.startLineNumber):(yv._normalizeInsertionPoint(e,i.lines,s.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,s.startLineNumber));const r=new ct(s.positionLineNumber,s.positionColumn);for(let a=0,c=o.length;a<c;a++)t.addEditOperation(o[a].range,o[a].text),be.isEmpty(o[a].range)&&be.getStartPosition(o[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(o[a].text||"").length);this._selectionId=t.trackSelection(s)}_attemptRemoveBlockComment(e,t,i,s){let o=t.startLineNumber,r=t.endLineNumber,a=s.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn),c=e.getLineContent(o).lastIndexOf(i,a-1),u=e.getLineContent(r).indexOf(s,t.endColumn-1-i.length);return c!==-1&&u===-1&&(u=e.getLineContent(o).indexOf(s,c+i.length),r=o),c===-1&&u!==-1&&(c=e.getLineContent(r).lastIndexOf(i,u),o=r),t.isEmpty()&&(c===-1||u===-1)&&(c=e.getLineContent(o).indexOf(i),c!==-1&&(u=e.getLineContent(o).indexOf(s,c+i.length))),c!==-1&&e.getLineContent(o).charCodeAt(c+i.length)===32&&(i+=" "),u!==-1&&e.getLineContent(r).charCodeAt(u-1)===32&&(s=" "+s,u-=1),c!==-1&&u!==-1?SC._createRemoveBlockCommentOperations(new be(o,c+i.length+1,r,u+1),i,s):null}_executeBlockComment(e,t,i){e.tokenizeIfCheap(i.startLineNumber);let s=e.getLanguageIdAtPosition(i.startLineNumber,1),o=ns.getComments(s);if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const r=o.blockCommentStartToken,a=o.blockCommentEndToken;let c=this._attemptRemoveBlockComment(e,i,r,a);if(!c){if(i.isEmpty()){const u=e.getLineContent(i.startLineNumber);let d=cc(u);d===-1&&(d=u.length),c=SC._createAddBlockCommentOperations(new be(i.startLineNumber,d+1,i.startLineNumber,u.length+1),r,a,this._insertSpace)}else c=SC._createAddBlockCommentOperations(new be(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);c.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(const u of c)t.addEditOperation(u.range,u.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new be(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
- `),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const s=yv._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine);return s.supported?this._executeLineComments(e,t,s,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new fn(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){let i=[];for(let s=0,o=e.length;s<o;s++){const r=e[s];r.ignore||i.push(ir.delete(new be(t+s,r.commentStrOffset+1,t+s,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){let i=[];const s=this._insertSpace?" ":"";for(let o=0,r=e.length;o<r;o++){const a=e[o];a.ignore||i.push(ir.insert(new ct(t+o,a.commentStrOffset+1),a.commentStr+s))}return i}static nextVisibleColumn(e,t,i,s){return i?e+(t-e%t):e+s}static _normalizeInsertionPoint(e,t,i,s){let o=1073741824,r,a;for(let c=0,u=t.length;c<u;c++){if(t[c].ignore)continue;const d=e.getLineContent(i+c);let f=0;for(let g=0,p=t[c].commentStrOffset;f<o&&g<p;g++)f=yv.nextVisibleColumn(f,s,d.charCodeAt(g)===9,1);f<o&&(o=f)}o=Math.floor(o/s)*s;for(let c=0,u=t.length;c<u;c++){if(t[c].ignore)continue;const d=e.getLineContent(i+c);let f=0;for(r=0,a=t[c].commentStrOffset;f<o&&r<a;r++)f=yv.nextVisibleColumn(f,s,d.charCodeAt(r)===9,1);f>o?t[c].commentStrOffset=r-1:t[c].commentStrOffset=r}}}class Qse extends yn{constructor(e,t){super(t),this._type=e}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=[],o=i.getOptions(),r=t.getOption(19),a=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));a.sort((u,d)=>be.compareRangesUsingStarts(u.selection,d.selection));let c=a[0];for(let u=1;u<a.length;u++){const d=a[u];c.selection.endLineNumber===d.selection.startLineNumber&&(c.index<d.index?d.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=d))}for(const u of a)s.push(new yv(u.selection,o.tabSize,this._type,r.insertSpace,r.ignoreEmptyLines,u.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class tFt extends Qse{constructor(){super(0,{id:"editor.action.commentLine",label:$("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:wn.MenubarEditMenu,group:"5_insert",title:$({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class nFt extends Qse{constructor(){super(1,{id:"editor.action.addCommentLine",label:$("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2081),weight:100}})}}class iFt extends Qse{constructor(){super(2,{id:"editor.action.removeCommentLine",label:$("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2099),weight:100}})}}class sFt extends yn{constructor(){super({id:"editor.action.blockComment",label:$("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:wn.MenubarEditMenu,group:"5_insert",title:$({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){if(!t.hasModel())return;const i=t.getOption(19),s=[],o=t.getSelections();for(const r of o)s.push(new SC(r,i.insertSpace));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}qt(tFt);qt(nFt);qt(iFt);qt(sFt);var oFt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jN=function(n,e){return function(t,i){e(t,i,n)}};let PR=class _ke{constructor(e,t,i,s,o,r){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._toDispose=new Wt,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(a=>this._onContextMenu(a))),this._toDispose.add(this._editor.onMouseWheel(a=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),u=a.srcElement;u.shadowRoot&&Pw(c)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(a=>{a.keyCode===58&&(a.preventDefault(),a.stopPropagation(),this.showContextMenu())}))}static get(e){return e.getContribution(_ke.ID)}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(20)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||(e.event.preventDefault(),e.event.stopPropagation(),e.target.type!==6&&e.target.type!==7&&e.target.type!==1))return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(20)||!this._editor.hasModel())return;if(!this._contextMenuService){this._editor.focus();return}const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?wn.SimpleEditorContext:wn.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(let r of o){const[,a]=r;let c=0;for(const u of a)if(u instanceof aie){const d=this._getMenuActions(e,u.item.submenu);d.length>0&&(i.push(new p6(u.id,u.label,d)),c++)}else i.push(u),c++;c&&i.push(new Ff)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(52);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=Bl(this._editor.getDomNode()),a=r.left+o.left,c=r.top+o.top+o.height;t={x:a,y:c}}const s=this._editor.getOption(113)&&!Xm;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>e,getActionViewItem:o=>{const r=this._keybindingFor(o);if(r)return new Zx(o,o,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new Zx(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.focus(),this._editor.updateOptions({hover:i})}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};PR.ID="editor.contrib.contextmenu";PR=oFt([jN(1,Vy),jN(2,Hy),jN(3,ai),jN(4,Ro),jN(5,Uw)],PR);class rFt extends yn{constructor(){super({id:"editor.action.showContextMenu",label:$("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:1092,weight:100}})}run(e,t){PR.get(t).showContextMenu()}}_s(PR.ID,PR);qt(rFt);class TK{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s<t;s++)if(!this.selections[s].equalsSelection(e.selections[s]))return!1;return!0}}class CK{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class pw extends wt{constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new TK(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new CK(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}static get(e){return e.getContribution(pw.ID)}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new CK(new TK(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new CK(new TK(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}pw.ID="editor.contrib.cursorUndoRedoController";class lFt extends yn{constructor(){super({id:"cursorUndo",label:$("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:2099,weight:100}})}run(e,t,i){pw.get(t).cursorUndo()}}class aFt extends yn{constructor(){super({id:"cursorRedo",label:$("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){pw.get(t).cursorRedo()}}_s(pw.ID,pw);qt(lFt);qt(aFt);class cFt{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){let i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new be(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new fn(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new fn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new fn(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new fn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new fn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function f1(n){return ki?n.altKey:n.ctrlKey}class eb extends wt{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._dndDecorationIds=[],this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(31)||this._editor.getOption(18)||(f1(e)&&(this._modifierPressed=!0),this._mouseDown&&f1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(31)||this._editor.getOption(18)||(f1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===eb.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){let t=e.target;if(this._dragSelection===null){let s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}f1(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){let t=new ct(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){let s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new fn(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new fn(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(f1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(eb.ID,new cFt(this._dragSelection,t,f1(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){let t=[{range:new be(e.lineNumber,e.column,e.lineNumber,e.column),options:eb._DECORATION_OPTIONS}];this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,t),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,[])}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}eb.ID="editor.contrib.dragAndDrop";eb.TRIGGER_KEY_VALUE=ki?6:5;eb._DECORATION_OPTIONS=Ci.register({description:"dnd-target",className:"dnd-target"});_s(eb.ID,eb);class Na{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getCurrentMatchesPosition(e){let t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const s=i.options;if(s===Na._FIND_MATCH_DECORATION||s===Na._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let s=0,o=this._decorations.length;s<o;s++){let r=this._editor.getModel().getDecorationRange(this._decorations[s]);if(e.equalsRange(r)){t=this._decorations[s],i=s+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(s=>{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,Na._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,Na._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){let r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new be(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,Na._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=Na._FIND_MATCH_DECORATION,o=[];if(e.length>1e3){s=Na._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),u=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/u));let f=e[0].range.startLineNumber,g=e[0].range.endLineNumber;for(let p=1,_=e.length;p<_;p++){const v=e[p].range;g+d>=v.startLineNumber?v.endLineNumber>g&&(g=v.endLineNumber):(o.push({range:new be(f,1,g,1),options:Na._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),f=v.startLineNumber,g=v.endLineNumber)}o.push({range:new be(f,1,g,1),options:Na._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let r=new Array(e.length);for(let a=0,c=e.length;a<c;a++)r[a]={range:e[a].range,options:s};this._decorations=i.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Na._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumber<e.lineNumber)return s;if(!(s.endColumn>e.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){let s=this._decorations[t],o=this._editor.getModel().getDecorationRange(s);if(!(!o||o.startLineNumber<e.lineNumber)){if(o.startLineNumber>e.lineNumber)return o;if(!(o.startColumn<e.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}Na._CURRENT_FIND_MATCH_DECORATION=Ci.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:sr($ie),position:Ad.Center},minimap:{color:sr(G1e),position:vh.Inline}});Na._FIND_MATCH_DECORATION=Ci.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:sr($ie),position:Ad.Center},minimap:{color:sr(G1e),position:vh.Inline}});Na._FIND_MATCH_NO_OVERVIEW_DECORATION=Ci.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});Na._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Ci.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:sr($ie),position:Ad.Center}});Na._RANGE_HIGHLIGHT_DECORATION=Ci.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});Na._FIND_SCOPE_DECORATION=Ci.register({description:"find-scope",className:"findScope",isWholeLine:!0});class uFt{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let i=[];for(let r=0;r<this._ranges.length;r++)i.push({range:this._ranges[r],text:this._replaceStrings[r]});i.sort((r,a)=>be.compareRangesUsingStarts(r.range,a.range));let s=[],o=i[0];for(let r=1;r<i.length;r++)o.range.endLineNumber===i[r].range.startLineNumber&&o.range.endColumn===i[r].range.startColumn?(o.range=o.range.plusRange(i[r].range),o.text=o.text+i[r].text):(s.push(o),o=i[r]);s.push(o);for(const r of s)t.addEditOperation(r.range,r.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function vke(n,e){if(n&&n[0]!==""){const t=bme(n,e,"-"),i=bme(n,e,"_");return t&&!i?Tme(n,e,"-"):!t&&i?Tme(n,e,"_"):n[0].toUpperCase()===n[0]?e.toUpperCase():n[0].toLowerCase()===n[0]?e.toLowerCase():lbt(n[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function bme(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function Tme(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=vke([s[a]],r)+t}),o.slice(0,-1)}class Cme{constructor(e){this.staticValue=e,this.kind=0}}class dFt{constructor(e){this.pieces=e,this.kind=1}}class FR{constructor(e){!e||e.length===0?this._state=new Cme(""):e.length===1&&e[0].staticValue!==null?this._state=new Cme(e[0].staticValue):this._state=new dFt(e)}static fromStaticValue(e){return new FR([L0.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}buildReplaceString(e,t){if(this._state.kind===0)return t?vke(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s<o;s++){let r=this._state.pieces[s];if(r.staticValue!==null){i+=r.staticValue;continue}let a=FR._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){let c=[],u=r.caseOps.length,d=0;for(let f=0,g=a.length;f<g;f++){if(d>=u){c.push(a.slice(f));break}switch(r.caseOps[d]){case"U":c.push(a[f].toUpperCase());break;case"u":c.push(a[f].toUpperCase()),d++;break;case"L":c.push(a[f].toLowerCase());break;case"l":c.push(a[f].toLowerCase()),d++;break;default:c.push(a[f])}}a=c.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class L0{constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}static staticValue(e){return new L0(e,-1,null)}static caseOps(e,t){return new L0(null,e,t)}}class hFt{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=L0.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=L0.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=L0.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new FR(this._result)}}function fFt(n){if(!n||n.length===0)return new FR(null);let e=[],t=new hFt(n);for(let i=0,s=n.length;i<s;i++){let o=n.charCodeAt(i);if(o===92){if(i++,i>=s)break;let r=n.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
- `,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===36){if(i++,i>=s)break;let r=n.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1<s){let c=n.charCodeAt(i+1);if(48<=c&&c<=57){i++,a=a*10+(c-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const eI=new Sn("findWidgetVisible",!1),hG=new Sn("findInputFocussed",!1),Zse=new Sn("replaceInputFocussed",!1),NV={primary:545,mac:{primary:2593}},DV={primary:565,mac:{primary:2613}},$V={primary:560,mac:{primary:2608}},xV={primary:554,mac:{primary:2602}},PV={primary:558,mac:{primary:2606}},io={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},wC=19999,gFt=240;class T${constructor(e,t){this._toDispose=new Wt,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new mc,this._decorations=new Na(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new ho(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Ji(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},gFt)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let c=a.endLineNumber;return a.endColumn===1&&(c=c-1),new be(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));let s=this._findMatches(i,!1,wC);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=FLe(s.map(c=>c.range),c=>be.compareRangesUsingStarts(c,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(35).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){let e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){let t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:s}=e,o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new ct(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()<wC){let d=this._decorations.matchBeforePosition(e);d&&d.isEmpty()&&d.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),d=this._decorations.matchBeforePosition(e)),d&&this._setCurrentFindMatch(d);return}if(this._cannotFind())return;let i=this._decorations.getFindScope(),s=T$._getSearchRange(this._editor.getModel(),i);s.getEndPosition().isBefore(e)&&(e=s.getEndPosition()),e.isBefore(s.getStartPosition())&&(e=s.getEndPosition());let{lineNumber:o,column:r}=e,a=this._editor.getModel(),c=new ct(o,r),u=a.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,!1);if(u&&u.range.isEmpty()&&u.range.getStartPosition().equals(c)&&(c=this._prevSearchPosition(c),u=a.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,!1)),!!u){if(!t&&!s.containsRange(u.range))return this._moveToPrevMatch(u.range.getStartPosition(),!0);this._setCurrentFindMatch(u.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:s}=e,o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new ct(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<wC){let i=this._decorations.matchAfterPosition(e);i&&i.isEmpty()&&i.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),i=this._decorations.matchAfterPosition(e)),i&&this._setCurrentFindMatch(i);return}let t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,s=!1){if(this._cannotFind())return null;let o=this._decorations.getFindScope(),r=T$._getSearchRange(this._editor.getModel(),o);r.getEndPosition().isBefore(e)&&(e=r.getStartPosition()),e.isBefore(r.getStartPosition())&&(e=r.getStartPosition());let{lineNumber:a,column:c}=e,u=this._editor.getModel(),d=new ct(a,c),f=u.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,t);return i&&f&&f.range.isEmpty()&&f.range.getStartPosition().equals(d)&&(d=this._nextSearchPosition(d),f=u.findNextMatch(this._state.searchString,d,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,t)),f?!s&&!r.containsRange(f.range)?this._getNextMatch(f.range.getEndPosition(),t,i,!0):f:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_getReplacePattern(){return this._state.isRegex?fFt(this._state.replaceString):FR.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;let e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){let s=e.buildReplaceString(i.matches,this._state.preserveCase),o=new Dl(t,s);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new ct(t.startLineNumber,t.startColumn+s.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const s=(e||[null]).map(o=>T$._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=wC?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new vS(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let f="mu";i.ignoreCase&&(f+="i"),i.global&&(f+="g"),i=new RegExp(i.source,f)}const s=this._editor.getModel(),o=s.getValue(1),r=s.getFullModelRange(),a=this._getReplacePattern();let c;const u=this._state.preserveCase;a.hasReplacementPatterns||u?c=o.replace(i,function(){return a.buildReplaceString(arguments,u)}):c=o.replace(i,a.buildReplaceString(null,u));let d=new Hie(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern();let i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;r<a;r++)s[r]=t.buildReplaceString(i[r].matches,this._state.preserveCase);let o=new uFt(this._editor.getSelection(),i.map(r=>r.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;let e=this._decorations.getFindScopes(),i=this._findMatches(e,!1,1073741824).map(o=>new fn(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)),s=this._editor.getSelection();for(let o=0,r=i.length;o<r;o++)if(i[o].equalsRange(s)){i=[s].concat(i.slice(0,o)).concat(i.slice(o+1));break}this._editor.setSelections(i)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}const pFt={inputActiveOptionBorder:mt.fromHex("#007ACC00"),inputActiveOptionForeground:mt.fromHex("#FFFFFF"),inputActiveOptionBackground:mt.fromHex("#0E639C50")};class KF extends Bd{constructor(e){super(),this._onChange=this._register(new rt),this.onChange=this._onChange.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._opts=Object.assign(Object.assign({},pFt),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon&&t.push(...Lu.asClassNameArray(this._opts.icon)),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault()}),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}style(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"transparent",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"transparent")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const mFt=$("caseDescription","Match Case"),_Ft=$("wordsDescription","Match Whole Word"),vFt=$("regexDescription","Use Regular Expression");class bke extends KF{constructor(e){super({icon:vn.caseSensitive,title:mFt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Tke extends KF{constructor(e){super({icon:vn.wholeWord,title:_Ft+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Cke extends KF{constructor(e){super({icon:vn.regex,title:vFt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class fG extends Bd{constructor(e,t,i,s){super(),this._hideSoon=this._register(new ho(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const o=s.getColorTheme().getColor(Qq),r=s.getColorTheme().getColor(eJ),a=s.getColorTheme().getColor(Zq);this.caseSensitive=this._register(new bke({appendTitle:this._keybindingLabelFor(io.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:a})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new Tke({appendTitle:this._keybindingLabelFor(io.ToggleWholeWordCommand),isChecked:this._state.wholeWord,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:a})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new Cke({appendTitle:this._keybindingLabelFor(io.ToggleRegexCommand),isChecked:this._state.isRegex,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:a})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(c=>{let u=!1;c.isRegex&&(this.regex.checked=this._state.isRegex,u=!0),c.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,u=!0),c.matchCase&&(this.caseSensitive.checked=this._state.matchCase,u=!0),!this._state.isRevealed&&u&&this._revealTemporarily()})),this._register(Lne(this._domNode,c=>this._onMouseOut())),this._register(Pt(this._domNode,"mouseover",c=>this._onMouseOver())),this._applyTheme(s.getColorTheme()),this._register(s.onDidColorThemeChange(this._applyTheme.bind(this)))}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return fG.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseOut(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(Qq),inputActiveOptionForeground:e.getColor(eJ),inputActiveOptionBackground:e.getColor(Zq)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}fG.ID="editor.contrib.findOptionsWidget";ws((n,e)=>{const t=n.getColor(Od);t&&e.addRule(`.monaco-editor .findOptionsWidget { background-color: ${t}; }`);const i=n.getColor(Jv);i&&e.addRule(`.monaco-editor .findOptionsWidget { color: ${i}; }`);const s=n.getColor(dy);s&&e.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${s}; }`);const o=n.getColor(_r);o&&e.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${o}; }`)});function FV(n,e){return n===1?!0:n===2?!1:e}class bFt extends wt{constructor(){super(),this._onFindReplaceStateChange=this._register(new rt),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0}get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return FV(this._isRegexOverride,this._isRegex)}get wholeWord(){return FV(this._wholeWordOverride,this._wholeWord)}get matchCase(){return FV(this._matchCaseOverride,this._matchCase)}get preserveCase(){return FV(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}changeMatchInfo(e,t,i){let s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(be.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var s;let o={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},r=!1;const a=this.isRegex,c=this.wholeWord,u=this.matchCase,d=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(f=>{var g;return(g=this._searchScope)===null||g===void 0?void 0:g.some(p=>!be.equalsRange(p,f))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,o.isRegex=!0),c!==this.wholeWord&&(r=!0,o.wholeWord=!0),u!==this.matchCase&&(r=!0,o.matchCase=!0),d!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=wC}}const TFt=$("defaultLabel","input");class CFt extends Bd{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this._onDidOptionChange=this._register(new rt),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new rt),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new rt),this._onKeyUp=this._register(new rt),this._onCaseSensitiveKeyDown=this._register(new rt),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new rt),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||TFt,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const o=s.appendCaseSensitiveLabel||"",r=s.appendWholeWordsLabel||"",a=s.appendRegexLabel||"",c=s.history||[],u=!!s.flexibleHeight,d=!!s.flexibleWidth,f=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new wRe(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:c,showHistoryHint:s.showHistoryHint,flexibleHeight:u,flexibleWidth:d,flexibleMaxHeight:f})),this.regex=this._register(new Cke({appendTitle:a,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange(_=>{this._onDidOptionChange.fire(_),!_&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(_=>{this._onRegexKeyDown.fire(_)})),this.wholeWords=this._register(new Tke({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange(_=>{this._onDidOptionChange.fire(_),!_&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new bke({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange(_=>{this._onDidOptionChange.fire(_),!_&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(_=>{this._onCaseSensitiveKeyDown.fire(_)})),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let g=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,_=>{if(_.equals(15)||_.equals(17)||_.equals(9)){let v=g.indexOf(document.activeElement);if(v>=0){let C=-1;_.equals(17)?C=(v+1)%g.length:_.equals(15)&&(v===0?C=g.length-1:C=v-1),_.equals(9)?(g[v].blur(),this.inputBox.focus()):C>=0&&g[C].focus(),Rs.stop(_,!0)}}});let p=document.createElement("div");p.className="controls",p.style.display=this._showOptionButtons?"block":"none",p.appendChild(this.caseSensitive.domNode),p.appendChild(this.wholeWords.domNode),p.appendChild(this.regex.domNode),this.domNode.appendChild(p),e&&e.appendChild(this.domNode),this._register(Pt(this.inputBox.inputElement,"compositionstart",_=>{this.imeSessionInProgress=!0})),this._register(Pt(this.inputBox.inputElement,"compositionend",_=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,_=>this._onKeyDown.fire(_)),this.onkeyup(this.inputBox.inputElement,_=>this._onKeyUp.fire(_)),this.oninput(this.inputBox.inputElement,_=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,_=>this._onMouseDown.fire(_))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e}getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}const yFt=$("defaultLabel","input"),EFt=$("label.preserveCaseCheckbox","Preserve Case");class SFt extends KF{constructor(e){super({icon:vn.preserveCase,title:EFt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wFt extends Bd{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new rt),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new rt),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new rt),this._onInput=this._register(new rt),this._onKeyUp=this._register(new rt),this._onPreserveCaseKeyDown=this._register(new rt),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||yFt,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,c=!!s.flexibleWidth,u=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new wRe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:u})),this.preserveCase=this._register(new SFt({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(g=>{this._onPreserveCaseKeyDown.fire(g)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let d=[this.preserveCase.domNode];this.onkeydown(this.domNode,g=>{if(g.equals(15)||g.equals(17)||g.equals(9)){let p=d.indexOf(document.activeElement);if(p>=0){let _=-1;g.equals(17)?_=(p+1)%d.length:g.equals(15)&&(p===0?_=d.length-1:_=p-1),g.equals(9)?(d[p].blur(),this.inputBox.focus()):_>=0&&d[_].focus(),Rs.stop(g,!0)}}});let f=document.createElement("div");f.className="controls",f.style.display=this._showOptionButtons?"block":"none",f.appendChild(this.preserveCase.domNode),this.domNode.appendChild(f),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,g=>this._onKeyDown.fire(g)),this.onkeyup(this.inputBox.inputElement,g=>this._onKeyUp.fire(g)),this.oninput(this.inputBox.inputElement,g=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,g=>this._onMouseDown.fire(g))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var yke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Eke=function(n,e){return function(t,i){e(t,i,n)}};const EP="historyNavigationWidget",Ske="historyNavigationForwardsEnabled",wke="historyNavigationBackwardsEnabled";function IFt(n,e,t){new Sn(t,e).bindTo(n)}function LFt(n,e){return n.createScoped(e.target)}function Ike(n,e){return n.getContext(document.activeElement).getValue(e)}function Lke(n,e){const t=LFt(n,e);IFt(t,e,EP);const i=new Sn(Ske,!0).bindTo(t),s=new Sn(wke,!0).bindTo(t);return{scopedContextKeyService:t,historyNavigationForwardsEnablement:i,historyNavigationBackwardsEnablement:s}}let ZQ=class extends CFt{constructor(e,t,i,s,o=!1){super(e,t,o,i),this._register(Lke(s,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};ZQ=yke([Eke(3,ai)],ZQ);let eZ=class extends wFt{constructor(e,t,i,s,o=!1){super(e,t,o,i),this._register(Lke(s,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};eZ=yke([Eke(3,ai)],eZ);_c.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:dn.and(dn.has(EP),dn.equals(wke,!0),Ni.Visible.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{const e=Ike(n.get(ai),EP);e&&e.historyNavigator.showPreviousValue()}});_c.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:dn.and(dn.has(EP),dn.equals(Ske,!0),Ni.Visible.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{const e=Ike(n.get(ai),EP);e&&e.historyNavigator.showNextValue()}});function yme(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var OFt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const RFt=Xl("find-selection",vn.selection,$("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Eme=Xl("find-collapsed",vn.chevronRight,$("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),Sme=Xl("find-expanded",vn.chevronDown,$("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),MFt=Xl("find-replace",vn.replace,$("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),kFt=Xl("find-replace-all",vn.replaceAll,$("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),AFt=Xl("find-previous-match",vn.arrowUp,$("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),NFt=Xl("find-next-match",vn.arrowDown,$("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),DFt=$("label.find","Find"),$Ft=$("placeholder.find","Find"),xFt=$("label.previousMatchButton","Previous Match"),PFt=$("label.nextMatchButton","Next Match"),FFt=$("label.toggleSelectionFind","Find in Selection"),BFt=$("label.closeButton","Close"),HFt=$("label.replace","Replace"),VFt=$("placeholder.replace","Replace"),UFt=$("label.replaceButton","Replace"),WFt=$("label.replaceAllButton","Replace All"),GFt=$("label.toggleReplaceButton","Toggle Replace"),zFt=$("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",wC),KFt=$("label.matchesLocation","{0} of {1}"),wme=$("label.noResults","No results"),tm=419,jFt=275,XFt=jFt-54;let XN=69;const YFt=33,Ime="ctrlEnterReplaceAll.windows.donotask",Lme=ki?256:2048;class yK{constructor(e){this.afterLineNumber=e,this.heightInPx=YFt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Ome(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function Rme(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){n.stopPropagation();return}}class gG extends Bd{constructor(e,t,i,s,o,r,a,c,u){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=s,this._keybindingService=o,this._contextKeyService=r,this._storageService=c,this._notificationService=u,this._ctrlEnterReplaceAllWarningPrompted=!!c.getBoolean(Ime,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new db(500),this._register(xi(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(80)&&(this._codeEditor.getOption(80)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(129)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(35)){const f=this._codeEditor.getOption(35).addExtraSpaceOnTop;f&&!this._viewZone&&(this._viewZone=new yK(0),this._showViewZone()),!f&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>OFt(this,void 0,void 0,function*(){if(this._isVisible){let d=yield this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}}))),this._findInputFocused=hG.bindTo(r),this._findFocusTracker=this._register(dR(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=Zse.bindTo(r),this._replaceFocusTracker=this._register(dR(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(35).addExtraSpaceOnTop&&(this._viewZone=new yK(0)),this._applyTheme(a.getColorTheme()),this._register(a.onDidColorThemeChange(this._applyTheme.bind(this))),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return gG.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(80)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=hf(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){let t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,di)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=XN+"px",this._state.matchesCount>=wC?this._matchesCount.title=zFt:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=wC&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=ha(KFt,i,t)}else e=wme;this._matchesCount.appendChild(document.createTextNode(e)),Hl(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),XN=Math.max(XN,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===wme)return i===""?$("ariaSearchNoResultEmpty","{0} found",e):$("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=$("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return $("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){let e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);let e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);let i=!this._codeEditor.getOption(80);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(35).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(35).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=Bl(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const c=XIe(this._domNode).left;r>c&&(t=!1);const u=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(u?u.left:0)>c&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(35).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(35).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new yK(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;let r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(74).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(Qq),inputActiveOptionBackground:e.getColor(Zq),inputActiveOptionForeground:e.getColor(eJ),inputBackground:e.getColor(Eie),inputForeground:e.getColor(Sie),inputBorder:e.getColor(wie),inputValidationInfoBackground:e.getColor(Iie),inputValidationInfoForeground:e.getColor(Lie),inputValidationInfoBorder:e.getColor(Oie),inputValidationWarningBackground:e.getColor(D1e),inputValidationWarningForeground:e.getColor($1e),inputValidationWarningBorder:e.getColor(x1e),inputValidationErrorBackground:e.getColor(P1e),inputValidationErrorForeground:e.getColor(F1e),inputValidationErrorBorder:e.getColor(B1e)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible||!wne(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&hf(this._domNode)>tm){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=hf(this._findInput.domNode);return}if(tm+28+s>=i&&(r=!0),tm+28+s-XN>=i&&(a=!0),tm+28+s-XN>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._resized){this._findInput.inputBox.layout();let c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=hf(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){let e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!be.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(Lme|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(`
- `),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Ome(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return Rme(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(Lme|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{zl&&Ug&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info($("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(Ime,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
- `),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Ome(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return Rme(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new ZQ(null,this._contextViewProvider,{width:XFt,label:DFt,placeholder:$Ft,appendCaseSensitiveLabel:this._keybindingLabelFor(io.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(io.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(io.ToggleRegexCommand),validation:c=>{if(c.length===0||!this._findInput.getRegex())return null;try{return new RegExp(c,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>yme(this._keybindingService)},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(c=>this._onFindInputKeyDown(c))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(c=>{c.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),c.preventDefault())})),this._register(this._findInput.onRegexKeyDown(c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),c.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(c=>{this._tryUpdateHeight()&&this._showViewZone()})),Qc&&this._register(this._findInput.onMouseDown(c=>this._onFindInputMouseDown(c))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new g1({label:xFt+this._keybindingLabelFor(io.PreviousMatchFindAction),icon:AFt,onTrigger:()=>{this._codeEditor.getAction(io.PreviousMatchFindAction).run().then(void 0,di)}})),this._nextBtn=this._register(new g1({label:PFt+this._keybindingLabelFor(io.NextMatchFindAction),icon:NFt,onTrigger:()=>{this._codeEditor.getAction(io.NextMatchFindAction).run().then(void 0,di)}}));let i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",i.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new KF({icon:RFt,title:FFt+this._keybindingLabelFor(io.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let c=this._codeEditor.getSelections();c.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),c.length&&this._state.change({searchScope:c},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new g1({label:BFt+this._keybindingLabelFor(io.CloseFindWidgetCommand),icon:S1t,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),c.preventDefault())}})),s.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new eZ(null,void 0,{label:HFt,placeholder:VFt,appendPreserveCaseLabel:this._keybindingLabelFor(io.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>yme(this._keybindingService)},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(c=>this._onReplaceInputKeyDown(c))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(c=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(c=>{c.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),c.preventDefault())})),this._replaceBtn=this._register(new g1({label:UFt+this._keybindingLabelFor(io.ReplaceOneAction),icon:MFt,onTrigger:()=>{this._controller.replace()},onKeyDown:c=>{c.equals(1026)&&(this._closeBtn.focus(),c.preventDefault())}})),this._replaceAllBtn=this._register(new g1({label:WFt+this._keybindingLabelFor(io.ReplaceAllAction),icon:kFt,onTrigger:()=>{this._controller.replaceAll()}}));let o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new g1({label:GFt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=hf(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width=`${tm}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(o),this._resizeSash=new ca(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=tm;this._register(this._resizeSash.onDidStart(()=>{a=hf(this._domNode)})),this._register(this._resizeSash.onDidChange(c=>{this._resized=!0;let u=a+c.startX-c.currentX;if(u<tm)return;const d=parseFloat(Rne(this._domNode).maxWidth)||0;u>d||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=hf(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const c=hf(this._domNode);if(c<tm)return;let u=tm;if(!this._resized||c===tm){const d=this._codeEditor.getLayoutInfo();u=d.width-28-d.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=hf(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}gG.ID="editor.contrib.findWidget";class g1 extends Bd{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+mo.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,i=>{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}this._opts.onKeyDown&&this._opts.onKeyDown(i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...mo.asClassNameArray(Eme)),this._domNode.classList.add(...mo.asClassNameArray(Sme))):(this._domNode.classList.remove(...mo.asClassNameArray(Sme)),this._domNode.classList.add(...mo.asClassNameArray(Eme)))}}ws((n,e)=>{const t=(_,v)=>{v&&e.addRule(`.monaco-editor ${_} { background-color: ${v}; }`)};t(".findMatch",n.getColor(nJ)),t(".currentFindMatch",n.getColor(XSt)),t(".findScope",n.getColor(YSt));const i=n.getColor(Od);t(".find-widget",i);const s=n.getColor(dy);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const o=n.getColor(JSt);o&&e.addRule(`.monaco-editor .findMatch { border: 1px ${n.type==="hc"?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=n.getColor(qSt);r&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const a=n.getColor(QSt);a&&e.addRule(`.monaco-editor .findScope { border: 1px ${n.type==="hc"?"dashed":"solid"} ${a}; }`);const c=n.getColor(_r);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const u=n.getColor(Jv);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const d=n.getColor(OSt);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const f=n.getColor(PSt);if(f)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${f}; }`);else{const _=n.getColor(b0);_&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${_}; }`)}const g=n.getColor(D0t);g&&e.addRule(`
- .monaco-editor .find-widget .button:not(.disabled):hover,
- .monaco-editor .find-widget .codicon-find-selection:hover {
- background-color: ${g} !important;
- }
- `);const p=n.getColor(uy);p&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${p}; }`)});var Oke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},um=function(n,e){return function(t,i){e(t,i,n)}},BR=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const qFt=524288;function tZ(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)<qFt)return n.getModel().getValueInRange(i)}return null}let Fd=class Rke extends wt{constructor(e,t,i,s){super(),this._editor=e,this._findWidgetVisible=eI.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=s,this._updateHistoryDelayer=new db(500),this._state=this._register(new bFt),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(o=>this._onStateChanged(o))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{let o=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),o&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(35).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(Rke.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!hG.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=jf(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e){return BR(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;let t={isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){let i=tZ(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);i&&(this._state.isRegex?t.searchString=jf(i):t.searchString=i)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){let i=tZ(this._editor,e.seedSearchStringFromSelection);i&&(t.searchString=i)}if(!t.searchString&&e.seedSearchStringFromGlobalClipboard){let i=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;i&&(t.searchString=i)}if(e.forceRevealReplace?t.isReplaceRevealed=!0:this._findWidgetVisible.get()||(t.isReplaceRevealed=!1),e.updateSearchScope){let i=this._editor.getSelections();i.some(s=>!s.isEmpty())&&(t.searchScope=i)}t.loop=e.loop,this._state.change(t,!1),this._model||(this._model=new T$(this._editor,this._state))})}start(e){return this._start(e)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return BR(this,void 0,void 0,function*(){return this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Fd.ID="editor.contrib.findController";Fd=Oke([um(1,ai),um(2,m_),um(3,Uy)],Fd);let nZ=class extends Fd{constructor(e,t,i,s,o,r,a,c){super(e,i,a,c),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._notificationService=r,this._widget=null,this._findOptionsWidget=null}_start(e){const t=Object.create(null,{_start:{get:()=>super._start}});return BR(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(35).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":s=!!i&&i.startLineNumber!==i.endLineNumber;break}e.updateSearchScope=s,yield t._start.call(this,e),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new gG(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new fG(this._editor,this._state,this._keybindingService,this._themeService))}};nZ=Oke([um(1,Hy),um(2,ai),um(3,Ro),um(4,fo),um(5,Hr),um(6,m_),um(7,Uy)],nZ);const JFt=p1e(new g1e({id:io.StartFindAction,label:$("startFindAction","Find"),alias:"Find",precondition:dn.or(We.focus,dn.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:wn.MenubarEditMenu,group:"3_find",title:$({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));JFt.addImplementation(0,(n,e,t)=>{const i=Fd.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(35).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(35).loop}):!1});class QFt extends yn{constructor(){super({id:io.StartFindWithSelection,label:$("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return BR(this,void 0,void 0,function*(){let i=Fd.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class Mke extends yn{run(e,t){return BR(this,void 0,void 0,function*(){let i=Fd.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class ZFt extends Mke{constructor(){super({id:io.NextMatchFindAction,label:$("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:We.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:dn.and(We.focus,hG),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class e2t extends Mke{constructor(){super({id:io.PreviousMatchFindAction,label:$("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:We.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:dn.and(We.focus,hG),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class kke extends yn{run(e,t){return BR(this,void 0,void 0,function*(){let i=Fd.get(t);if(!i)return;const s=t.getOption(35).seedSearchStringFromSelection==="selection";let o=null;t.getOption(35).seedSearchStringFromSelection!=="never"&&(o=tZ(t,"single",s)),o&&i.setSearchString(o),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:s,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class t2t extends kke{constructor(){super({id:io.NextSelectionMatchFindAction,label:$("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class n2t extends kke{constructor(){super({id:io.PreviousSelectionMatchFindAction,label:$("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const i2t=p1e(new g1e({id:io.StartFindReplaceAction,label:$("startReplace","Replace"),alias:"Replace",precondition:dn.or(We.focus,dn.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:wn.MenubarEditMenu,group:"3_find",title:$({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));i2t.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(80))return!1;const i=Fd.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(35).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(35).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(35).loop})});_s(Fd.ID,nZ);qt(QFt);qt(ZFt);qt(e2t);qt(t2t);qt(n2t);const bp=jl.bindToContribution(Fd.get);Xt(new bp({id:io.CloseFindWidgetCommand,precondition:eI,handler:n=>n.closeFindWidget(),kbOpts:{weight:105,kbExpr:dn.and(We.focus,dn.not("isComposing")),primary:9,secondary:[1033]}}));Xt(new bp({id:io.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:We.focus,primary:NV.primary,mac:NV.mac,win:NV.win,linux:NV.linux}}));Xt(new bp({id:io.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:105,kbExpr:We.focus,primary:DV.primary,mac:DV.mac,win:DV.win,linux:DV.linux}}));Xt(new bp({id:io.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:105,kbExpr:We.focus,primary:$V.primary,mac:$V.mac,win:$V.win,linux:$V.linux}}));Xt(new bp({id:io.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:105,kbExpr:We.focus,primary:xV.primary,mac:xV.mac,win:xV.win,linux:xV.linux}}));Xt(new bp({id:io.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:105,kbExpr:We.focus,primary:PV.primary,mac:PV.mac,win:PV.win,linux:PV.linux}}));Xt(new bp({id:io.ReplaceOneAction,precondition:eI,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:We.focus,primary:3094}}));Xt(new bp({id:io.ReplaceOneAction,precondition:eI,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:dn.and(We.focus,Zse),primary:3}}));Xt(new bp({id:io.ReplaceAllAction,precondition:eI,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:We.focus,primary:2563}}));Xt(new bp({id:io.ReplaceAllAction,precondition:eI,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:dn.and(We.focus,Zse),primary:void 0,mac:{primary:2051}}}));Xt(new bp({id:io.SelectAllMatchesAction,precondition:eI,handler:n=>n.selectAllMatches(),kbOpts:{weight:105,kbExpr:We.focus,primary:515}}));const Mme=65535,Hv=16777215,kme=4278190080;class SP{constructor(e,t,i){if(e.length!==t.length||e.length>Mme)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],t=(i,s)=>{let o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;i<s;i++){let o=this._startIndexes[i],r=this._endIndexes[i];if(o>Hv||r>Hv)throw new Error("startLineNumber or endLineNumber must not exceed "+Hv);for(;e.length>0&&!t(o,r);)e.pop();let a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Hv}getEndLineNumber(e){return this._endIndexes[e]&Hv}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,i=e%32;return(this._collapseStates[t]&1<<i)!==0}setCollapsed(e,t){let i=e/32|0,s=e%32,o=this._collapseStates[i];t?this._collapseStates[i]=o|1<<s:this._collapseStates[i]=o&~(1<<s)}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s<this._types.length;s++)this._types[s]===e&&(this.setCollapsed(s,t),i=!0);return i}toRegion(e){return new s2t(this,e)}getParentIndex(e){this.ensureParentIndices();let t=((this._startIndexes[e]&kme)>>>24)+((this._endIndexes[e]&kme)>>>16);return t===Mme?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){let s=Math.floor((t+i)/2);e<this.getStartLineNumber(s)?i=s:t=s+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t<this.length;t++)e[t]=`[${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}}class s2t{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class o2t{constructor(e,t){this._updateEventEmitter=new rt,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new SP(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=c=>{for(;s<c;){const u=this._regions.getEndLineNumber(s),d=this._regions.isCollapsed(s);u<=o&&i.changeDecorationOptions(this._editorDecorationIds[s],this._decorationProvider.getDecorationOption(d,u<=r)),d&&u>r&&(r=u),s++}};for(let c of e){let u=c.regionIndex,d=this._editorDecorationIds[u];if(d&&!t[d]){t[d]=!0,a(u);let f=!this._regions.isCollapsed(u);this._regions.setCollapsed(u,f),o=Math.max(o,this._regions.getEndLineNumber(u))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let i=[],s=(f,g)=>{for(let p of t)if(f<p&&p<=g)return!0;return!1},o=-1,r=(f,g)=>{const p=e.getStartLineNumber(f),_=e.getEndLineNumber(f);g||(g=e.isCollapsed(f)),g&&s(p,_)&&(g=!1),e.setCollapsed(f,g);const v=this._textModel.getLineMaxColumn(p),C={startLineNumber:p,startColumn:Math.max(v-1,1),endLineNumber:p,endColumn:v};i.push({range:C,options:this._decorationProvider.getDecorationOption(g,_<=o)}),g&&_>o&&(o=_)},a=0,c=()=>{for(;a<this._regions.length;){let f=this._regions.isCollapsed(a);if(a++,f)return a-1}return-1},u=0,d=c();for(;d!==-1&&u<e.length;){let f=this._textModel.getDecorationRange(this._editorDecorationIds[d]);if(f){let g=f.startLineNumber;if(f.startColumn===Math.max(f.endColumn-1,1)&&this._textModel.getLineMaxColumn(g)===f.endColumn)for(;u<e.length;){let p=e.getStartLineNumber(u);if(g>=p)r(u,g===p),u++;else break}}d=c()}for(;u<e.length;)r(u,!1),u++;this._editorDecorationIds=this._decorationProvider.deltaDecorations(this._editorDecorationIds,i),this._regions=e,this._isInitialized=!0,this._updateEventEmitter.fire({model:this})}getMemento(){let e=[];for(let t=0;t<this._regions.length;t++)if(this._regions.isCollapsed(t)){let i=this._textModel.getDecorationRange(this._editorDecorationIds[t]);if(i){let s=i.startLineNumber,o=i.endLineNumber+this._regions.getEndLineNumber(t)-this._regions.getStartLineNumber(t);e.push({startLineNumber:s,endLineNumber:o})}}if(e.length>0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let s=this.getRegionAtLine(i.startLineNumber);s&&!s.isCollapsed&&t.push(s)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){let r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,c=this._regions.length;a<c;a++){let u=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;r.length>0&&!u.containedBy(r[r.length-1]);)r.pop();r.push(u),t(u,r.length)&&i.push(u)}else break}}else for(let r=s,a=this._regions.length;r<a;r++){let c=this._regions.toRegion(r);if(this._regions.getStartLineNumber(r)<o)(!t||t(c))&&i.push(c);else break}return i}}function r2t(n,e,t){let i=[];for(let s of t){let o=n.getRegionAtLine(s);o&&(o.isCollapsed,i.push(o))}n.toggleCollapseState(i)}function wM(n,e,t=Number.MAX_VALUE,i){let s=[];if(i&&i.length>0)for(let o of i){let r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){let a=n.getRegionsInside(r,(c,u)=>c.isCollapsed!==e&&u<t);s.push(...a)}}else{let o=n.getRegionsInside(null,(r,a)=>r.isCollapsed!==e&&a<t);s.push(...o)}n.toggleCollapseState(s)}function Ake(n,e,t,i){let s=[];for(let o of i){let r=n.getAllRegionsAtLine(o,(a,c)=>a.isCollapsed!==e&&c<=t);s.push(...r)}n.toggleCollapseState(s)}function l2t(n,e,t){let i=[];for(let s of t){let o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function a2t(n,e,t,i){let s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function Nke(n,e,t){let i=[];for(let r of t)i.push(n.getAllRegionsAtLine(r,void 0)[0]);let s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function eoe(n,e,t){let i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){let a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function toe(n,e,t){let i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function c2t(n,e){let t=null,i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){let s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function u2t(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{let i=t.parentIndex,s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function d2t(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){let i=t.parentIndex,s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class h2t{constructor(e){this._updateEventEmitter=new rt,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}updateHiddenRanges(){let e=!1,t=[],i=0,s=0,o=Number.MAX_VALUE,r=-1,a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;let c=a.getStartLineNumber(i)+1,u=a.getEndLineNumber(i);o<=c&&u<=r||(!e&&s<this._hiddenRanges.length&&this._hiddenRanges[s].startLineNumber===c&&this._hiddenRanges[s].endLineNumber===u?(t.push(this._hiddenRanges[s]),s++):(e=!0,t.push(new be(c,1,u,1))),o=c,r=u)}(e||s<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyMemento(e){if(!Array.isArray(e)||e.length===0)return!1;let t=[];for(let i of e){if(!i.startLineNumber||!i.endLineNumber)return!1;t.push(new be(i.startLineNumber+1,1,i.endLineNumber,1))}return this.applyHiddenRanges(t),!0}getMemento(){return this._hiddenRanges.map(e=>({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber}))}applyHiddenRanges(e){this._hiddenRanges=e,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return Ame(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,s=null,o=r=>((!s||!f2t(r,s))&&(s=Ame(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r<a;r++){let c=e[r],u=o(c.startLineNumber);u&&(c=c.setStartPosition(u,i.getLineMaxColumn(u)),t=!0);let d=o(c.endLineNumber);d&&(c=c.setEndPosition(d,i.getLineMaxColumn(d)),t=!0),e[r]=c}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function f2t(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function Ame(n,e){let t=FLe(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const g2t=5e3,p2t="indent";class m2t{constructor(e){this.editorModel=e,this.id=p2t}dispose(){}compute(e){let t=ns.getFoldingRules(this.editorModel.getLanguageId()),i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(v2t(this.editorModel,i,s))}}let _2t=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Hv||t>Hv)return;let s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){if(this._length<=this._foldingRangesLimit){let t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=this._length-1,o=0;s>=0;s--,o++)t[o]=this._startIndexes[s],i[o]=this._endIndexes[s];return new SP(t,i)}else{let t=0,i=this._indentOccurrences.length;for(let a=0;a<this._indentOccurrences.length;a++){let c=this._indentOccurrences[a];if(c){if(c+t>this._foldingRangesLimit){i=a;break}t+=c}}const s=e.getOptions().tabSize;let o=new Uint32Array(this._foldingRangesLimit),r=new Uint32Array(this._foldingRangesLimit);for(let a=this._length-1,c=0;a>=0;a--){let u=this._startIndexes[a],d=e.getLineContent(u),f=xd.computeIndentLevel(d,s);(f<i||f===i&&t++<this._foldingRangesLimit)&&(o[c]=u,r[c]=this._endIndexes[a],c++)}return new SP(o,r)}}};function v2t(n,e,t,i=g2t){const s=n.getOptions().tabSize;let o=new _2t(i),r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));let a=[],c=n.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let u=n.getLineCount();u>0;u--){let d=n.getLineContent(u),f=xd.computeIndentLevel(d,s),g=a[a.length-1];if(f===-1){e&&(g.endAbove=u);continue}let p;if(r&&(p=d.match(r)))if(p[1]){let _=a.length-1;for(;_>0&&a[_].indent!==-2;)_--;if(_>0){a.length=_+1,g=a[_],o.insertFirst(u,g.line,f),g.line=u,g.indent=f,g.endAbove=u;continue}}else{a.push({indent:-2,endAbove:u,line:u});continue}if(g.indent>f){do a.pop(),g=a[a.length-1];while(g.indent>f);let _=g.endAbove-1;_-u>=1&&o.insertFirst(u,_,f)}g.indent===f?g.endAbove=u:a.push({indent:f,endAbove:u,line:u})}return o.toIndentRanges(n)}const b2t=5e3,T2t={},Dke="syntax";class C2t{constructor(e,t,i,s=b2t){this.editorModel=e,this.providers=t,this.limit=s,this.id=Dke;for(const o of t)typeof o.onDidChange=="function"&&(this.disposables||(this.disposables=new Wt),this.disposables.add(o.onDidChange(i)))}compute(e){return y2t(this.providers,this.editorModel,e).then(t=>t?$ke(t,this.limit):null)}dispose(){var e;(e=this.disposables)===null||e===void 0||e.dispose()}}function y2t(n,e,t){let i=null,s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,T2t,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);let c=e.getLineCount();for(let u of a)u.start>0&&u.end>u.start&&u.end<=c&&i.push({start:u.start,end:u.end,rank:r,kind:u.kind})}},Ol));return Promise.all(s).then(o=>i)}class E2t{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Hv||t>Hv)return;let o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;i<this._length;i++)e[i]=this._startIndexes[i],t[i]=this._endIndexes[i];return new SP(e,t,this._types)}else{let e=0,t=this._nestingLevelCounts.length;for(let r=0;r<this._nestingLevelCounts.length;r++){let a=this._nestingLevelCounts[r];if(a){if(a+e>this._foldingRangesLimit){t=r;break}e+=a}}let i=new Uint32Array(this._foldingRangesLimit),s=new Uint32Array(this._foldingRangesLimit),o=[];for(let r=0,a=0;r<this._length;r++){let c=this._nestingLevels[r];(c<t||c===t&&e++<this._foldingRangesLimit)&&(i[a]=this._startIndexes[r],s[a]=this._endIndexes[r],o[a]=this._types[r],a++)}return new SP(i,s,o)}}}function $ke(n,e){let t=n.sort((r,a)=>{let c=r.start-a.start;return c===0&&(c=r.rank-a.rank),c}),i=new E2t(e),s,o=[];for(let r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}const xke="init";class S2t{constructor(e,t,i,s){if(this.editorModel=e,this.id=xke,t.length){let o=r=>({range:{startLineNumber:r.startLineNumber,startColumn:0,endLineNumber:r.endLineNumber,endColumn:e.getLineLength(r.endLineNumber)},options:{description:"folding-initializing-range-provider",stickiness:1}});this.decorationIds=e.deltaDecorations([],t.map(o)),this.timeout=setTimeout(i,s)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),typeof this.timeout=="number"&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let i of this.decorationIds){let s=this.editorModel.getDecorationRange(i);s&&t.push({start:s.startLineNumber,end:s.endLineNumber,rank:1})}return Promise.resolve($ke(t,Number.MAX_VALUE))}}const noe=Xl("folding-expanded",vn.chevronDown,$("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),ioe=Xl("folding-collapsed",vn.chevronRight,$("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin."));class Sf{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?Sf.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?Sf.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Sf.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?Sf.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Sf.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}Sf.COLLAPSED_VISUAL_DECORATION=Ci.register({description:"folding-collapsed-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:mo.asClassName(ioe)});Sf.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ci.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:mo.asClassName(ioe)});Sf.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ci.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:mo.asClassName(noe)});Sf.EXPANDED_VISUAL_DECORATION=Ci.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+mo.asClassName(noe)});Sf.HIDDEN_RANGE_DECORATION=Ci.register({description:"folding-hidden-range-decoration",stickiness:1});var w2t=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},I2t=function(n,e){return function(t,i){e(t,i,n)}};const bc=new Sn("foldingEnabled",!1);let HR=class Pke extends wt{constructor(e,t){super(),this.contextKeyService=t,this.localToDispose=this._register(new Wt),this.editor=e;const i=this.editor.getOptions();this._isEnabled=i.get(37),this._useFoldingProviders=i.get(38)!=="indentation",this._unfoldOnClickAfterEndOfLine=i.get(41),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=i.get(40),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingStateMemento=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Sf(e),this.foldingDecorationProvider.autoHideFoldingControls=i.get(98)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=i.get(39),this.foldingEnabled=bc.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(s=>{if(s.hasChanged(37)&&(this._isEnabled=this.editor.getOptions().get(37),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),s.hasChanged(98)||s.hasChanged(39)){const o=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls=o.get(98)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=o.get(39),this.onModelContentChanged()}s.hasChanged(38)&&(this._useFoldingProviders=this.editor.getOptions().get(38)!=="indentation",this.onFoldingStrategyChanged()),s.hasChanged(41)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(41)),s.hasChanged(40)&&(this._foldingImportsByDefault=this.editor.getOptions().get(40))})),this.onModelChanged()}static get(e){return e.getContribution(Pke.ID)}saveViewState(){let e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){let t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel||!e||e.lineCount!==t.getLineCount()||(this._currentModelHasFoldedImports=!!e.foldedImports,!e.collapsedRegions))return;(e.provider===Dke||e.provider===xke)&&(this.foldingStateMemento=e);const i=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(i)){const s=this.getFoldingModel();s&&s.then(o=>{if(o){this._restoringViewState=!0;try{o.applyMemento(i)}finally{this._restoringViewState=!1}}}).then(void 0,di)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new o2t(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new h2t(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new db(200),this.cursorChangedScheduler=new ho(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(Oq.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(()=>this.onModelContentChanged())),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.foldingStateMemento=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.onModelContentChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.onModelContentChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new m2t(e),this._useFoldingProviders&&this.foldingModel){let t=Oq.ordered(this.foldingModel.textModel);if(t.length===0&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions)return this.rangeProvider=new S2t(e,this.foldingStateMemento.collapsedRegions,()=>{this.foldingStateMemento=null,this.onFoldingStrategyChanged()},3e4);t.length>0&&(this.rangeProvider=new C2t(e,t,()=>this.onModelContentChanged()))}return this.foldingStateMemento=null,this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onModelContentChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=this.getRangeProvider(e.textModel);let i=this.foldingRegionPromise=ul(s=>t.compute(s));return i.then(s=>{if(s&&i===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=s.setCollapsedAllOfType(ip.Imports.value,!0);c&&(o=hy.capture(this.editor),this._currentModelHasFoldedImports=c)}let r=this.editor.getSelections(),a=r?r.map(c=>c.startLineNumber):[];e.update(s,a),o&&o.restore(this.editor)}return e})}).then(void 0,e=>(di(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){let t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){let i=this.editor.getSelections();if(i&&i.length>0){let s=[];for(let o of i){let r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,di)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<5)return;i=!0;break;case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){let a=this.editor.getModel();if(a&&t.startColumn===a.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.getFoldingModel();if(!t||!this.mouseDownInfo||!e.target)return;let i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!(!o||o.startLineNumber!==i)){if(s){if(e.target.type!==4)return}else{let r=this.editor.getModel();if(!r||o.startColumn!==r.getLineMaxColumn(i))return}t.then(r=>{if(r){let a=r.getRegionAtLine(i);if(a&&a.startLineNumber===i){let c=a.isCollapsed;if(s||c){let u=e.event.altKey,d=[];if(u){let f=p=>!p.containedBy(a)&&!a.containedBy(p),g=r.getRegionsInside(null,f);for(const p of g)p.isCollapsed&&d.push(p);d.length===0&&(d=g)}else{let f=e.event.middleButton||e.event.shiftKey;if(f)for(const g of r.getRegionsInside(a))g.isCollapsed===c&&d.push(g);(c||!f||d.length===0)&&d.push(a)}r.toggleCollapseState(d),this.reveal({lineNumber:i,column:1})}}}}).then(void 0,di)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};HR.ID="editor.contrib.folding";HR=w2t([I2t(1,ai)],HR);class nu extends yn{runEditorCommand(e,t,i){let s=HR.get(t);if(!s)return;let o=s.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(r=>{if(r){this.invoke(s,r,t,i);const a=t.getSelection();a&&s.reveal(a.getStartPosition())}})}getSelectedLines(e){let t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Fke(n){if(!oc(n)){if(!jc(n))return!1;const e=n;if(!oc(e.levels)&&!X0(e.levels)||!oc(e.direction)&&!Yf(e.direction)||!oc(e.selectionLines)&&(!dLe(e.selectionLines)||!e.selectionLines.every(X0)))return!1}return!0}class L2t extends nu{constructor(){super({id:"editor.unfold",label:$("unfoldAction.label","Unfold"),alias:"Unfold",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
- * 'levels': Number of levels to unfold. If not set, defaults to 1.
- * 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
- * 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
- `,constraint:Fke,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){let o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?Ake(t,!1,o,r):wM(t,!1,o,r)}}class O2t extends nu{constructor(){super({id:"editor.unfoldRecursively",label:$("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2137),weight:100}})}invoke(e,t,i,s){wM(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class R2t extends nu{constructor(){super({id:"editor.fold",label:$("foldAction.label","Fold"),alias:"Fold",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument:
- * 'levels': Number of levels to fold.
- * 'direction': If 'up', folds given number of levels up otherwise folds down.
- * 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
- If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
- `,constraint:Fke,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){let o=this.getLineNumbers(s,i);const r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?l2t(t,!0,o):a==="up"?Ake(t,!0,r||1,o):wM(t,!0,r||1,o)}}class M2t extends nu{constructor(){super({id:"editor.toggleFold",label:$("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2090),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);r2t(t,1,s)}}class k2t extends nu{constructor(){super({id:"editor.foldRecursively",label:$("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2135),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);wM(t,!0,Number.MAX_VALUE,s)}}class A2t extends nu{constructor(){super({id:"editor.foldAllBlockComments",label:$("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2133),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())toe(t,ip.Comment.value,!0);else{const s=i.getModel();if(!s)return;const o=ns.getComments(s.getLanguageId());if(o&&o.blockCommentStartToken){let r=new RegExp("^\\s*"+jf(o.blockCommentStartToken));eoe(t,r,!0)}}}}class N2t extends nu{constructor(){super({id:"editor.foldAllMarkerRegions",label:$("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2077),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())toe(t,ip.Region.value,!0);else{const s=i.getModel();if(!s)return;const o=ns.getFoldingRules(s.getLanguageId());if(o&&o.markers&&o.markers.start){let r=new RegExp(o.markers.start);eoe(t,r,!0)}}}}class D2t extends nu{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:$("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2078),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())toe(t,ip.Region.value,!1);else{const s=i.getModel();if(!s)return;const o=ns.getFoldingRules(s.getLanguageId());if(o&&o.markers&&o.markers.start){let r=new RegExp(o.markers.start);eoe(t,r,!1)}}}}class $2t extends nu{constructor(){super({id:"editor.foldAllExcept",label:$("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2131),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);Nke(t,!0,s)}}class x2t extends nu{constructor(){super({id:"editor.unfoldAllExcept",label:$("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2129),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);Nke(t,!1,s)}}class P2t extends nu{constructor(){super({id:"editor.foldAll",label:$("foldAllAction.label","Fold All"),alias:"Fold All",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2069),weight:100}})}invoke(e,t,i){wM(t,!0)}}class F2t extends nu{constructor(){super({id:"editor.unfoldAll",label:$("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2088),weight:100}})}invoke(e,t,i){wM(t,!1)}}class mw extends nu{getFoldingLevel(){return parseInt(this.id.substr(mw.ID_PREFIX.length))}invoke(e,t,i){a2t(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}mw.ID_PREFIX="editor.foldLevel";mw.ID=n=>mw.ID_PREFIX+n;class B2t extends nu{constructor(){super({id:"editor.gotoParentFold",label:$("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);if(s.length>0){let o=c2t(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class H2t extends nu{constructor(){super({id:"editor.gotoPreviousFold",label:$("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);if(s.length>0){let o=u2t(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class V2t extends nu{constructor(){super({id:"editor.gotoNextFold",label:$("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);if(s.length>0){let o=d2t(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}_s(HR.ID,HR);qt(L2t);qt(O2t);qt(R2t);qt(k2t);qt(P2t);qt(F2t);qt(A2t);qt(N2t);qt(D2t);qt($2t);qt(x2t);qt(M2t);qt(B2t);qt(H2t);qt(V2t);for(let n=1;n<=7;n++)m1e(new mw({id:mw.ID(n),label:$("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:bc,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2048|21+n),weight:100}}));const U2t=Ze("editor.foldBackground",{light:ro(FC,.3),dark:ro(FC,.3),hc:null},$("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),W2t=Ze("editorGutter.foldingControlForeground",{dark:i7,light:i7,hc:i7},$("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));ws((n,e)=>{const t=n.getColor(U2t);t&&e.addRule(`.monaco-editor .folded-background { background-color: ${t}; }`);const i=n.getColor(W2t);i&&e.addRule(`
- .monaco-editor .cldr${mo.asCSSSelector(noe)},
- .monaco-editor .cldr${mo.asCSSSelector(ioe)} {
- color: ${i} !important;
- }
- `)});class G2t extends yn{constructor(){super({id:"editor.action.fontZoomIn",label:$("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){fb.setZoomLevel(fb.getZoomLevel()+1)}}class z2t extends yn{constructor(){super({id:"editor.action.fontZoomOut",label:$("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){fb.setZoomLevel(fb.getZoomLevel()-1)}}class K2t extends yn{constructor(){super({id:"editor.action.fontZoomReset",label:$("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){fb.setZoomLevel(0)}}qt(G2t);qt(z2t);qt(K2t);var Bke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hke=function(n,e){return function(t,i){e(t,i,n)}},soe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let wP=class{constructor(e,t){this._workerService=t,this._callOnDispose=new Wt,this._callOnModel=new Wt,this._editor=e,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(o3.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){if(this._callOnModel.clear(),!this._editor.getOption(48)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=o3.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;let i=new U1;for(let s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._callOnModel.add(this._editor.onDidType(s=>{let o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition();let s=!1;const o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s=!0,o.dispose();return}for(let a=0,c=r.changes.length;a<c;a++)if(r.changes[a].range.endLineNumber<=i.lineNumber){s=!0,o.dispose();return}});NRe(this._workerService,t,i,e,t.getFormattingOptions()).then(r=>{o.dispose(),!s&&Nu(r)&&(MR.execute(this._editor,r,!0),kse(r))},r=>{throw o.dispose(),r})}};wP.ID="editor.contrib.autoFormat";wP=Bke([Hke(1,eg)],wP);let IP=class{constructor(e,t){this.editor=e,this._instantiationService=t,this._callOnDispose=new Wt,this._callOnModel=new Wt,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(Ng.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(47)&&this.editor.hasModel()&&Ng.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(ARe,this.editor,e,2,zw.None,Ai.None).catch(di))}};IP.ID="editor.contrib.formatOnPaste";IP=Bke([Hke(1,Qi)],IP);class j2t extends yn{constructor(){super({id:"editor.action.formatDocument",label:$("formatDocument.label","Format Document"),alias:"Format Document",precondition:dn.and(We.notInCompositeEditor,We.writable,We.hasDocumentFormattingProvider),kbOpts:{kbExpr:We.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return soe(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(Qi);yield e.get(Mb).showWhile(i.invokeFunction(NAt,t,1,zw.None,Ai.None),250)}})}}class X2t extends yn{constructor(){super({id:"editor.action.formatSelection",label:$("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:dn.and(We.writable,We.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2084),weight:100},contextMenuOpts:{when:We.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return soe(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Qi),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new be(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Mb).showWhile(i.invokeFunction(ARe,t,o,1,zw.None,Ai.None),250)})}}_s(wP.ID,wP);_s(IP.ID,IP);qt(j2t);qt(X2t);ji.registerCommand("editor.action.format",n=>soe(void 0,void 0,void 0,function*(){const e=n.get(hs).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(vr);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));class J1{remove(){this.parent&&this.parent.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class Nme extends J1{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class Y2t extends J1{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class ec extends J1{constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}static create(e,t){let i=this._keys.for(e,!0),s=ec._requests.get(i);if(!s){let o=new dc;s={promiseCnt:0,source:o,promise:ec._create(e,o.token),model:void 0},ec._requests.set(i,s);const r=Date.now();s.promise.then(()=>{this._requestDurations.update(e,Date.now()-r)})}return s.model?Promise.resolve(s.model):(s.promiseCnt+=1,t.onCancellationRequested(()=>{--s.promiseCnt===0&&(s.source.cancel(),ec._requests.delete(i))}),new Promise((o,r)=>{s.promise.then(a=>{s.model=a,o(a)},a=>{ec._requests.delete(i),r(a)})}))}static _create(e,t){const i=new dc(t),s=new ec(e.uri),o=kf.ordered(e),r=o.map((c,u)=>{var d;let f=J1.findId(`provider_${u}`,s),g=new Y2t(f,s,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(e,i.token)).then(p=>{for(const _ of p||[])ec._makeOutlineElement(_,g);return g},p=>(Ol(p),g)).then(p=>{J1.empty(p)?p.remove():s._groups.set(f,p)})}),a=kf.onDidChange(()=>{const c=kf.ordered(e);xf(c,o)||i.cancel()});return Promise.all(r).then(()=>i.token.isCancellationRequested&&!t.isCancellationRequested?ec._create(e,t):s._compact()).finally(()=>{a.dispose()})}static _makeOutlineElement(e,t){let i=J1.findId(e,t),s=new Nme(i,t,e);if(e.children)for(const o of e.children)ec._makeOutlineElement(o,s);t.children.set(s.id,s)}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{let t=zi.first(this._groups.values());for(let[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Nme?e.push(t.symbol):e.push(...zi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>be.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return ec._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>be.compareRangesUsingStarts(i.range,s.range))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&ec._flattenDocumentSymbols(e,s.children,s.name)}}ec._requestDurations=new qW(kf,350);ec._requests=new Py(9,.75);ec._keys=new class{constructor(){this._counter=1,this._data=new WeakMap}for(n,e){return`${n.id}/${e?n.getVersionId():""}/${this._hash(kf.all(n))}`}_hash(n){let e="";for(const t of n){let i=this._data.get(t);typeof i>"u"&&(i=this._counter++,this._data.set(t,i)),e+=i}return e}};var Vke=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function Dme(n,e,t){return Vke(this,void 0,void 0,function*(){return(yield ec.create(n,t)).getTopLevelSymbols()})}ji.registerCommand("_executeDocumentSymbolProvider",function(n,...e){return Vke(this,void 0,void 0,function*(){const[t]=e;Gs(Jn.isUri(t));const i=n.get(Xr).getModel(t);if(i)return Dme(i,!1,Ai.None);const s=yield n.get(Nd).createModelReference(t);try{return yield Dme(s.object.textEditorModel,!1,Ai.None)}finally{s.dispose()}})});function bu(n,e){let t=0;for(let i=0;i<n.length;i++)n.charAt(i)===" "?t+=e:t++;return t}function C$(n,e,t){n=n<0?0:n;let i="";if(!t){let s=Math.floor(n/e);n=n%e;for(let o=0;o<s;o++)i+=" "}for(let s=0;s<n;s++)i+=" ";return i}function Uke(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const s=ns.getIndentationRules(n.getLanguageId());if(!s)return[];for(t=Math.min(t,n.getLineCount());e<=t&&s.unIndentedLinePattern;){let v=n.getLineContent(e);if(!s.unIndentedLinePattern.test(v))break;e++}if(e>t-1)return[];const{tabSize:o,indentSize:r,insertSpaces:a}=n.getOptions(),c=(v,C)=>(C=C||1,_d.shiftIndent(v,v.length+C,o,r,a)),u=(v,C)=>(C=C||1,_d.unshiftIndent(v,v.length+C,o,r,a));let d=[],f,g=n.getLineContent(e),p=g;f=Hs(g);let _=f;s.increaseIndentPattern&&s.increaseIndentPattern.test(p)?(_=c(_),f=c(f)):s.indentNextLinePattern&&s.indentNextLinePattern.test(p)&&(_=c(_)),e++;for(let v=e;v<=t;v++){let C=n.getLineContent(v),y=Hs(C),w=_+C.substring(y.length);s.decreaseIndentPattern&&s.decreaseIndentPattern.test(w)&&(_=u(_),f=u(f)),y!==_&&d.push(ir.replaceMove(new fn(v,1,v,y.length+1),xd.normalizeIndentation(_,r,a))),!(s.unIndentedLinePattern&&s.unIndentedLinePattern.test(C))&&(s.increaseIndentPattern&&s.increaseIndentPattern.test(w)?(f=c(f),_=f):s.indentNextLinePattern&&s.indentNextLinePattern.test(w)?_=c(_):_=f)}return d}class pG extends yn{constructor(){super({id:pG.ID,label:$("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:We.writable})}run(e,t){let i=t.getModel();if(!i)return;let s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new Z2t(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}pG.ID="editor.action.indentationToSpaces";class mG extends yn{constructor(){super({id:mG.ID,label:$("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:We.writable})}run(e,t){let i=t.getModel();if(!i)return;let s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new eBt(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}mG.ID="editor.action.indentationToTabs";class Wke extends yn{constructor(e,t){super(t),this.insertSpaces=e}run(e,t){const i=e.get(Wy),s=e.get(Xr);let o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===r.tabSize?$("configuredTabSize","Configured Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(a,{placeHolder:$({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:a[c]}).then(u=>{u&&o&&!o.isDisposed()&&o.updateOptions({tabSize:parseInt(u.label,10),insertSpaces:this.insertSpaces})})},50)}}class _G extends Wke{constructor(){super(!1,{id:_G.ID,label:$("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}_G.ID="editor.action.indentUsingTabs";class vG extends Wke{constructor(){super(!0,{id:vG.ID,label:$("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}vG.ID="editor.action.indentUsingSpaces";class bG extends yn{constructor(){super({id:bG.ID,label:$("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Xr);let s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}}bG.ID="editor.action.detectIndentation";class q2t extends yn{constructor(){super({id:"editor.action.reindentlines",label:$("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:We.writable})}run(e,t){let i=t.getModel();if(!i)return;let s=Uke(i,1,i.getLineCount());s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class J2t extends yn{constructor(){super({id:"editor.action.reindentselectedlines",label:$("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:We.writable})}run(e,t){let i=t.getModel();if(!i)return;let s=t.getSelections();if(s===null)return;let o=[];for(let r of s){let a=r.startLineNumber,c=r.endLineNumber;if(a!==c&&r.endColumn===1&&c--,a===1){if(a===c)continue}else a--;let u=Uke(i,a,c);o.push(...u)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class Q2t{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(let i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(let s of this._edits)t.addEditOperation(be.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class iZ{constructor(e){this.callOnDispose=new Wt,this.callOnModel=new Wt,this.editor=e,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(9)<4||this.editor.getOption(47))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){let t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(9),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions();let c=[],u={shiftIndent:p=>_d.shiftIndent(p,p.length+1,o,r,a),unshiftIndent:p=>_d.unshiftIndent(p,p.length+1,o,r,a)},d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let f=i.getLineContent(d);if(!/\S/.test(f.substring(0,e.startColumn-1))){const p=ns.getGoodIndentForLine(s,i,i.getLanguageId(),d,u);if(p!==null){let _=Hs(f),v=bu(p,o),C=bu(_,o);if(v!==C){let y=C$(v,o,a);c.push({range:new be(d,1,d,_.length+1),text:y}),f=y+f.substr(_.length)}else{let y=ns.getIndentMetadata(i,d);if(y===0||y===8)return}}}const g=d;for(;d<e.endLineNumber;){if(!/\S/.test(i.getLineContent(d+1))){d++;continue}break}if(d!==e.endLineNumber){let p={getLineTokens:v=>i.getLineTokens(v),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(v,C)=>i.getLanguageIdAtPosition(v,C),getLineContent:v=>v===g?f:i.getLineContent(v)},_=ns.getGoodIndentForLine(s,p,i.getLanguageId(),d+1,u);if(_!==null){let v=bu(_,o),C=bu(Hs(i.getLineContent(d+1)),o);if(v!==C){let y=v-C;for(let w=d+1;w<=e.endLineNumber;w++){let I=i.getLineContent(w),L=Hs(I),A=bu(L,o)+y,N=C$(A,o,a);N!==L&&c.push({range:new be(w,1,w,L.length+1),text:N})}}}}if(c.length>0){this.editor.pushUndoStop();let p=new Q2t(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.forceTokenization(t);let i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;let s=e.getLineTokens(t);if(s.getCount()>0){let o=s.findTokenIndexAtOffset(i);if(o>=0&&s.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}}iZ.ID="editor.contrib.autoIndentOnPaste";function Gke(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;r<t;r++)s+=" ";let o=new RegExp(s,"gi");for(let r=1,a=n.getLineCount();r<=a;r++){let c=n.getLineFirstNonWhitespaceColumn(r);if(c===0&&(c=n.getLineMaxColumn(r)),c===1)continue;const u=new be(r,1,r,c),d=n.getValueInRange(u),f=i?d.replace(/\t/ig,s):d.replace(o," ");e.addEditOperation(u,f)}}class Z2t{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Gke(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class eBt{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),Gke(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}_s(iZ.ID,iZ);qt(pG);qt(mG);qt(_G);qt(vG);qt(bG);qt(q2t);qt(J2t);var tBt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nBt=function(n,e){return function(t,i){e(t,i,n)}},_5=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const iBt=1500;class zke{constructor(){this._data=new Fa}push(e,t){const i=this._data.get(e.uri);i===void 0?this._data.set(e.uri,new Set([t])):i.add(t)}pop(e,t){const i=this._data.get(e.uri);i&&(i.delete(t),i.size===0&&this._data.delete(e.uri))}has(e,t){var i;return!!(!((i=this._data.get(e.uri))===null||i===void 0)&&i.has(t))}}function Kke(n,e,t,i){return _5(this,void 0,void 0,function*(){const s=[],r=bC.ordered(n).reverse().map(a=>e.map(c=>_5(this,void 0,void 0,function*(){try{t.push(n,a);const u=yield a.provideInlayHints(n,c,i);u!=null&&u.length&&s.push(u.filter(d=>c.containsPosition(d.position)))}catch(u){Ol(u)}finally{t.pop(n,a)}})));return yield Promise.all(r.flat()),s.flat().sort((a,c)=>ct.compare(a.position,c.position))})}class v5{constructor(){this._entries=new Py(50)}get(e){const t=v5._key(e);return this._entries.get(t)}set(e,t){const i=v5._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}let VR=class jke{constructor(e,t){this._editor=e,this._codeEditorService=t,this._decorationOwnerId=++jke._decorationOwnerIdPool,this._disposables=new Wt,this._sessionDisposables=new Wt,this._getInlayHintsDelays=new qW(bC,25,500),this._cache=new v5,this._decorations=new Map,this._disposables.add(bC.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(i=>{i.hasChanged(125)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){if(this._sessionDisposables.clear(),this._removeAllDecorations(),!this._editor.getOption(125).enabled)return;const e=this._editor.getModel();if(!e||!bC.has(e))return;const t=this._cache.get(e);t&&this._updateHintsDecorators([e.getFullModelRange()],t);const i=new zke,s=new ho(()=>_5(this,void 0,void 0,function*(){const r=Date.now(),a=new dc;this._sessionDisposables.add(xi(()=>a.dispose(!0)));const c=this._getHintsRanges(),u=yield Kke(e,c,i,a.token);s.delay=this._getInlayHintsDelays.update(e,Date.now()-r),!a.token.isCancellationRequested&&(this._updateHintsDecorators(c,u),this._cache.set(e,Array.from(this._decorations.values()).map(d=>d.hint)))}),this._getInlayHintsDelays.get(e));this._sessionDisposables.add(s),this._sessionDisposables.add(this._editor.onDidChangeModelContent(()=>s.schedule())),this._disposables.add(this._editor.onDidScrollChange(()=>s.schedule())),s.schedule();const o=new Wt;this._sessionDisposables.add(o);for(const r of bC.all(e))typeof r.onDidChangeInlayHints=="function"&&o.add(r.onDidChangeInlayHints(()=>{i.has(e,r)||s.schedule()}))}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(be.compareRangesUsingStarts)){const r=t.validateRange(new be(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!be.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=be.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){const{fontSize:i,fontFamily:s}=this._getLayoutInfo(),o=this._editor.getModel(),r=[],a=[],c="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(c,s);for(const f of t){const{text:g,position:p,whitespaceBefore:_,whitespaceAfter:v}=f,C=_?i/3|0:0,y=v?i/3|0:0,w={contentText:sBt(g),fontSize:`${i}px`,margin:`0px ${y}px 0px ${C}px`,fontFamily:`var(${c}), ${va.fontFamily}`,padding:`1px ${Math.max(1,i/4)|0}px`,borderRadius:`${i/4|0}px`,verticalAlign:"middle",backgroundColor:sr(C0),color:sr(T0)};f.kind===QW.Parameter?(w.backgroundColor=sr(s0t),w.color=sr(i0t)):f.kind===QW.Type&&(w.backgroundColor=sr(n0t),w.color=sr(t0t));let I={beforeInjectedText:Object.assign(Object.assign({},w),{affectsLetterSpacing:!0})},L=be.fromPositions(p),O=o.getWordAtPosition(p),A=!1;O&&(O.endColumn===p.column?(I.afterInjectedText=I.beforeInjectedText,I.beforeInjectedText=void 0,A=!0,L=$me(O,p.lineNumber)):O.startColumn===p.column&&(A=!0,L=$me(O,p.lineNumber)));const N="inlayHints-"+Bne(I).toString(16);if(this._codeEditorService.registerDecorationType("inlay-hints-controller",N,I,void 0,this._editor),r.push(N),a.push({range:L,options:Object.assign(Object.assign({},this._codeEditorService.resolveDecorationOptions(N,!0)),{showIfCollapsed:!A,stickiness:0})})>iBt)break}const u=[];for(const f of e)for(const{id:g}of o.getDecorationsInRange(f,this._decorationOwnerId,!0)){const p=this._decorations.get(g);p&&(u.push(g),this._codeEditorService.removeDecorationType(p.decorationTypeId),this._decorations.delete(g))}const d=o.deltaDecorations(u,a,this._decorationOwnerId);for(let f=0;f<d.length;f++)this._decorations.set(d[f],{hint:t[f],decorationTypeId:r[f]})}_getLayoutInfo(){const e=this._editor.getOption(125),t=this._editor.getOption(45);let i=e.fontSize;(!i||i<5||i>t)&&(i=t*.9|0);const s=e.fontFamily||this._editor.getOption(42);return{fontSize:i,fontFamily:s}}_removeAllDecorations(){this._editor.deltaDecorations(Array.from(this._decorations.keys()),[]);for(let e of this._decorations.values())this._codeEditorService.removeDecorationType(e.decorationTypeId);this._decorations.clear()}};VR.ID="editor.contrib.InlayHints";VR._decorationOwnerIdPool=0;VR=tBt([nBt(1,hs)],VR);function $me(n,e){return new be(e,n.startColumn,e,n.endColumn)}function sBt(n){return n.replace(/[ \t]/g," ")}_s(VR.ID,VR);ji.registerCommand("_executeInlayHintProvider",(n,...e)=>_5(void 0,void 0,void 0,function*(){const[t,i]=e;Gs(Jn.isUri(t)),Gs(be.isIRange(i));const s=yield n.get(Nd).createModelReference(t);try{return yield Kke(s.object.textEditorModel,[be.lift(i)],new zke,Ai.None)}finally{s.dispose()}}));class oBt{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const s=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new fn(s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn),s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn)):new fn(s.endLineNumber,s.endColumn-this._text.length,s.endLineNumber,s.endColumn)}}var rBt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lBt=function(n,e){return function(t,i){e(t,i,n)}};let Ey=class sZ{constructor(e,t){this.decorationIds=[],this.editor=e,this.editorWorkerService=t}static get(e){return e.getContribution(sZ.ID)}dispose(){}run(e,t){this.currentRequest&&this.currentRequest.cancel();const i=this.editor.getSelection(),s=this.editor.getModel();if(!s||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const r=new yOe(this.editor,5),a=s.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=ul(c=>this.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!r.validate(this.editor))return;let u=be.lift(c.range),d=c.range,f=c.value.length-(o.endColumn-o.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},f>1&&(o=new fn(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+f-1));const g=new oBt(u,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[{range:d,options:sZ.DECORATION}]),this.decorationRemover&&this.decorationRemover.cancel(),this.decorationRemover=sy(350),this.decorationRemover.then(()=>this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[])).catch(di)}).catch(di)):Promise.resolve(void 0)}};Ey.ID="editor.contrib.inPlaceReplaceController";Ey.DECORATION=Ci.register({description:"in-place-replace",className:"valueSetReplacement"});Ey=rBt([lBt(1,eg)],Ey);class aBt extends yn{constructor(){super({id:"editor.action.inPlaceReplace.up",label:$("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:3154,weight:100}})}run(e,t){const i=Ey.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}class cBt extends yn{constructor(){super({id:"editor.action.inPlaceReplace.down",label:$("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:3156,weight:100}})}run(e,t){const i=Ey.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}_s(Ey.ID,Ey);qt(aBt);qt(cBt);ws((n,e)=>{const t=n.getColor(J1e);t&&e.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${t}; }`)});class uBt{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){let i=dBt(e,this._cursors);for(let s=0,o=i.length;s<o;s++){let r=i[s];t.addEditOperation(r.range,r.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function dBt(n,e){e.sort((r,a)=>r.lineNumber===a.lineNumber?r.column-a.column:r.lineNumber-a.lineNumber);for(let r=e.length-2;r>=0;r--)e[r].lineNumber===e[r+1].lineNumber&&e.splice(r,1);let t=[],i=0,s=0,o=e.length;for(let r=1,a=n.getLineCount();r<=a;r++){let c=n.getLineContent(r),u=c.length+1,d=0;if(s<o&&e[s].lineNumber===r&&(d=e[s].column,s++,d===u)||c.length===0)continue;let f=Fm(c),g=0;if(f===-1)g=1;else if(f!==c.length-1)g=f+2;else continue;g=Math.max(d,g),t[i++]=ir.delete(new be(r,g,r,u))}return t}class Xke{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));let s=[];for(let r=i.startLineNumber;r<=i.endLineNumber;r++)s.push(e.getLineContent(r));const o=s.join(`
- `);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new be(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
- `):this._isCopyingDown?t.addEditOperation(new be(i.startLineNumber,1,i.startLineNumber,1),o+`
- `):t.addEditOperation(new be(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
- `+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let s=i.startLineNumber,o=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(s=s+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=fn.createWithDirection(s,o,r,a,this._selectionDirection)}return i}}class hBt{constructor(e,t,i){this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){let i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let s=this._selection;s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(this._moveEndPositionDown=!0,s=s.setEndPosition(s.endLineNumber-1,e.getLineMaxColumn(s.endLineNumber-1)));const{tabSize:o,indentSize:r,insertSpaces:a}=e.getOptions();let c=this.buildIndentConverter(o,r,a),u={getLineTokens:d=>e.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,f)=>e.getLanguageIdAtPosition(d,f),getLineContent:null};if(s.startLineNumber===s.endLineNumber&&e.getLineMaxColumn(s.startLineNumber)===1){let d=s.startLineNumber,f=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(f)===1?t.addEditOperation(new be(1,1,1,1),null):(t.addEditOperation(new be(d,1,d,1),e.getLineContent(f)),t.addEditOperation(new be(f,1,f,e.getLineMaxColumn(f)),null)),s=new fn(f,1,f,1)}else{let d,f;if(this._isMovingDown){d=s.endLineNumber+1,f=e.getLineContent(d),t.addEditOperation(new be(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let g=f;if(this.shouldAutoIndent(e,s)){let p=this.matchEnterRule(e,c,o,d,s.startLineNumber-1);if(p!==null){let v=Hs(e.getLineContent(d)),C=p+bu(v,o);g=C$(C,o,a)+this.trimLeft(f)}else{u.getLineContent=C=>C===s.startLineNumber?e.getLineContent(d):e.getLineContent(C);let v=ns.getGoodIndentForLine(this._autoIndent,u,e.getLanguageIdAtPosition(d,1),s.startLineNumber,c);if(v!==null){let C=Hs(e.getLineContent(d)),y=bu(v,o),w=bu(C,o);y!==w&&(g=C$(y,o,a)+this.trimLeft(f))}}t.addEditOperation(new be(s.startLineNumber,1,s.startLineNumber,1),g+`
- `);let _=this.matchEnterRuleMovingDown(e,c,o,s.startLineNumber,d,g);if(_!==null)_!==0&&this.getIndentEditsOfMovingBlock(e,t,s,o,a,_);else{u.getLineContent=C=>C===s.startLineNumber?g:C>=s.startLineNumber+1&&C<=s.endLineNumber+1?e.getLineContent(C-1):e.getLineContent(C);let v=ns.getGoodIndentForLine(this._autoIndent,u,e.getLanguageIdAtPosition(d,1),s.startLineNumber+1,c);if(v!==null){const C=Hs(e.getLineContent(s.startLineNumber)),y=bu(v,o),w=bu(C,o);if(y!==w){const I=y-w;this.getIndentEditsOfMovingBlock(e,t,s,o,a,I)}}}}else t.addEditOperation(new be(s.startLineNumber,1,s.startLineNumber,1),g+`
- `)}else if(d=s.startLineNumber-1,f=e.getLineContent(d),t.addEditOperation(new be(d,1,d+1,1),null),t.addEditOperation(new be(s.endLineNumber,e.getLineMaxColumn(s.endLineNumber),s.endLineNumber,e.getLineMaxColumn(s.endLineNumber)),`
- `+f),this.shouldAutoIndent(e,s)){u.getLineContent=p=>p===d?e.getLineContent(s.startLineNumber):e.getLineContent(p);let g=this.matchEnterRule(e,c,o,s.startLineNumber,s.startLineNumber-2);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,s,o,a,g);else{let p=ns.getGoodIndentForLine(this._autoIndent,u,e.getLanguageIdAtPosition(s.startLineNumber,1),d,c);if(p!==null){let _=Hs(e.getLineContent(s.startLineNumber)),v=bu(p,o),C=bu(_,o);if(v!==C){let y=v-C;this.getIndentEditsOfMovingBlock(e,t,s,o,a,y)}}}}}this._selectionId=t.trackSelection(s)}buildIndentConverter(e,t,i){return{shiftIndent:s=>_d.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>_d.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===gr.None||o.indentAction===gr.Indent?r=o.indentation+o.appendText:o.indentAction===gr.IndentOutdent?r=o.indentation:o.indentAction===gr.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);let a=e.getLineContent(s);if(this.trimLeft(a).indexOf(this.trimLeft(r))>=0){let c=Hs(e.getLineContent(s)),u=Hs(r),d=ns.getIndentMetadata(e,s);d!==null&&d&2&&(u=t.unshiftIndent(u));let f=bu(u,i),g=bu(c,i);return f-g}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(Fm(r)>=0){let a=e.getLineMaxColumn(o),c=ns.getEnterAction(this._autoIndent,e,new be(o,a,o,a));return this.parseEnterResult(e,t,i,s,c)}else{let a=s-1;for(;a>=1;){let d=e.getLineContent(a);if(Fm(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;let c=e.getLineMaxColumn(a),u=ns.getEnterAction(this._autoIndent,e,new be(a,c,a,c));return this.parseEnterResult(e,t,i,s,u)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),Fm(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;let c=e.getLineMaxColumn(a),u=ns.getEnterAction(this._autoIndent,e,new be(a,c,a,c));return this.parseEnterResult(e,t,i,s,u)}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.isCheapToTokenize(t.startLineNumber))return!1;let i=e.getLanguageIdAtPosition(t.startLineNumber,1),s=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==s||ns.getIndentRulesSupport(i)===null)}getIndentEditsOfMovingBlock(e,t,i,s,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){let c=e.getLineContent(a),u=Hs(c),f=bu(u,s)+r,g=C$(f,s,o);g!==u&&(t.addEditOperation(new be(a,1,a,u.length+1),g),a===i.endLineNumber&&i.endColumn<=u.length+1&&g===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}}class VC{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return VC._COLLATOR||(VC._COLLATOR=new Intl.Collator),VC._COLLATOR}getEditOperations(e,t){let i=fBt(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;let s=Yke(e,t,i);if(!s)return!1;for(let o=0,r=s.before.length;o<r;o++)if(s.before[o]!==s.after[o])return!0;return!1}}VC._COLLATOR=null;function Yke(n,e,t){let i=e.startLineNumber,s=e.endLineNumber;if(e.endColumn===1&&s--,i>=s)return null;let o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(VC.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function fBt(n,e,t){let i=Yke(n,e,t);return i?ir.replace(new be(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(`
- `)):null}class qke extends yn{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>be.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;r<i.length;r++){const a=i[r];s.selection.endLineNumber===a.selection.startLineNumber&&(s.index<a.index?a.ignore=!0:(s.ignore=!0,s=a))}const o=[];for(const r of i)o.push(new Xke(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class gBt extends qke{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:$("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"2_line",title:$({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class pBt extends qke{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:$("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"2_line",title:$({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class mBt extends yn{constructor(){super({id:"editor.action.duplicateSelection",label:$("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:We.writable,menuOpts:{menuId:wn.MenubarSelectionMenu,group:"2_line",title:$({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const s=[],o=t.getSelections(),r=t.getModel();for(const a of o)if(a.isEmpty())s.push(new Xke(a,!0));else{const c=new fn(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);s.push(new aIt(c,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Jke extends yn{constructor(e,t){super(t),this.down=e}run(e,t){let i=[],s=t.getSelections()||[];const o=t.getOption(9);for(const r of s)i.push(new hBt(r,this.down,o));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class _Bt extends Jke{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:$("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"2_line",title:$({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class vBt extends Jke{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:$("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"2_line",title:$({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class Qke extends yn{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!VC.canRun(t.getModel(),o,this.descending))return;let s=[];for(let o=0,r=i.length;o<r;o++)s[o]=new VC(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class bBt extends Qke{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:$("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:We.writable})}}class TBt extends Qke{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:$("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:We.writable})}}class CBt extends yn{constructor(){super({id:"editor.action.removeDuplicateLines",label:$("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:We.writable})}run(e,t){if(!t.hasModel())return;let i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let s=[],o=[],r=0;for(let a of t.getSelections()){let c=new Set,u=[];for(let p=a.startLineNumber;p<=a.endLineNumber;p++){let _=i.getLineContent(p);c.has(_)||(u.push(_),c.add(_))}let d=new fn(a.startLineNumber,1,a.endLineNumber,i.getLineMaxColumn(a.endLineNumber)),f=a.startLineNumber-r,g=new fn(f,1,f+u.length-1,u[u.length-1].length);s.push(ir.replace(d,u.join(`
- `))),o.push(g),r+=a.endLineNumber-a.startLineNumber+1-u.length}t.pushUndoStop(),t.executeEdits(this.id,s,o),t.pushUndoStop()}}class TG extends yn{constructor(){super({id:TG.ID,label:$("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:fl(2089,2102),weight:100}})}run(e,t,i){let s=[];i.reason==="auto-save"&&(s=(t.getSelections()||[]).map(a=>new ct(a.positionLineNumber,a.positionColumn)));let o=t.getSelection();if(o===null)return;let r=new uBt(o,s);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}TG.ID="editor.action.trimTrailingWhitespace";class yBt extends yn{constructor(){super({id:"editor.action.deleteLines",label:$("lines.delete","Delete Line"),alias:"Delete Line",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;let i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0,r=[],a=[];for(let c=0,u=i.length;c<u;c++){const d=i[c];let f=d.startLineNumber,g=d.endLineNumber,p=1,_=s.getLineMaxColumn(g);g<s.getLineCount()?(g+=1,_=1):f>1&&(f-=1,p=s.getLineMaxColumn(f)),r.push(ir.replace(new fn(f,p,g,_),"")),a.push(new fn(f-o,d.positionColumn,f-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){let t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(r-=1),{startLineNumber:o.startLineNumber,selectionStartColumn:o.selectionStartColumn,endLineNumber:r,positionColumn:o.positionColumn}});t.sort((o,r)=>o.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);let i=[],s=t[0];for(let o=1;o<t.length;o++)s.endLineNumber+1>=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class EBt extends yn{constructor(){super({id:"editor.action.indentLines",label:$("lines.indent","Indent Line"),alias:"Indent Line",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,yo.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class SBt extends yn{constructor(){super({id:"editor.action.outdentLines",label:$("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:2135,weight:100}})}run(e,t){LO.Outdent.runEditorCommand(e,t,null)}}class wBt extends yn{constructor(){super({id:"editor.action.insertLineBefore",label:$("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,yo.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class IBt extends yn{constructor(){super({id:"editor.action.insertLineAfter",label:$("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,yo.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Zke extends yn{run(e,t){if(!t.hasModel())return;const i=t.getSelection();let s=this._getRangesToDelete(t),o=[];for(let c=0,u=s.length-1;c<u;c++){let d=s[c],f=s[c+1];be.intersectRanges(d,f)===null?o.push(d):s[c+1]=be.plusRange(d,f)}o.push(s[s.length-1]);let r=this._getEndCursorState(i,o),a=o.map(c=>ir.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class LBt extends Zke{constructor(){super({id:"deleteAllLeft",label:$("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null,s=[],o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){let c=r.startLineNumber-o;a=new fn(c,r.startColumn,c,r.startColumn)}else a=new fn(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){let t=e.getSelections();if(t===null)return[];let i=t,s=e.getModel();return s===null?[]:(i.sort(be.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){let r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineContent(r).length+1;return new be(r,a,o.startLineNumber,1)}else return new be(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new be(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class OBt extends Zke{constructor(){super({id:"deleteAllRight",label:$("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null,s=[];for(let o=0,r=t.length,a=0;o<r;o++){let c=t[o],u=new fn(c.startLineNumber-a,c.startColumn,c.startLineNumber-a,c.startColumn);c.intersectRanges(e)?i=u:s.push(u)}return i&&s.unshift(i),s}_getRangesToDelete(e){let t=e.getModel();if(t===null)return[];let i=e.getSelections();if(i===null)return[];let s=i.map(o=>{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new be(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new be(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(be.compareRangesUsingStarts),s}}class RBt extends yn{constructor(){super({id:"editor.action.joinLines",label:$("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:We.writable,kbOpts:{kbExpr:We.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){let i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(be.compareRangesUsingStarts);let o=[],r=i.reduce((g,p)=>g.isEmpty()?g.endLineNumber===p.startLineNumber?(s.equalsSelection(g)&&(s=p),p):p.startLineNumber>g.endLineNumber+1?(o.push(g),p):new fn(g.startLineNumber,g.startColumn,p.endLineNumber,p.endColumn):p.startLineNumber>g.endLineNumber?(o.push(g),p):new fn(g.startLineNumber,g.startColumn,p.endLineNumber,p.endColumn));o.push(r);let a=t.getModel();if(a===null)return;let c=[],u=[],d=s,f=0;for(let g=0,p=o.length;g<p;g++){let _=o[g],v=_.startLineNumber,C=1,y=0,w,I,L=a.getLineContent(_.endLineNumber).length-_.endColumn;if(_.isEmpty()||_.startLineNumber===_.endLineNumber){let N=_.getStartPosition();N.lineNumber<a.getLineCount()?(w=v+1,I=a.getLineMaxColumn(w)):(w=N.lineNumber,I=a.getLineMaxColumn(N.lineNumber))}else w=_.endLineNumber,I=a.getLineMaxColumn(w);let O=a.getLineContent(v);for(let N=v+1;N<=w;N++){let D=a.getLineContent(N),P=a.getLineFirstNonWhitespaceColumn(N);if(P>=1){let F=!0;O===""&&(F=!1),F&&(O.charAt(O.length-1)===" "||O.charAt(O.length-1)===" ")&&(F=!1,O=O.replace(/[\s\uFEFF\xA0]+$/g," "));let V=D.substr(P-1);O+=(F?" ":"")+V,F?y=V.length+1:y=V.length}else y=0}let A=new be(v,C,w,I);if(!A.isEmpty()){let N;_.isEmpty()?(c.push(ir.replace(A,O)),N=new fn(A.startLineNumber-f,O.length-y+1,v-f,O.length-y+1)):_.startLineNumber===_.endLineNumber?(c.push(ir.replace(A,O)),N=new fn(_.startLineNumber-f,_.startColumn,_.endLineNumber-f,_.endColumn)):(c.push(ir.replace(A,O)),N=new fn(_.startLineNumber-f,_.startColumn,_.startLineNumber-f,O.length-L)),be.intersectRanges(A,s)!==null?d=N:u.push(N)}f+=A.endLineNumber-A.startLineNumber}u.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,u),t.pushUndoStop()}}class MBt extends yn{constructor(){super({id:"editor.action.transpose",label:$("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:We.writable})}run(e,t){let i=t.getSelections();if(i===null)return;let s=t.getModel();if(s===null)return;let o=[];for(let r=0,a=i.length;r<a;r++){let c=i[r];if(!c.isEmpty())continue;let u=c.getStartPosition(),d=s.getLineMaxColumn(u.lineNumber);if(u.column>=d){if(u.lineNumber===s.getLineCount())continue;let f=new be(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),g=s.getValueInRange(f).split("").reverse().join("");o.push(new Dl(new fn(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),g))}else{let f=new be(u.lineNumber,Math.max(1,u.column-1),u.lineNumber,u.column+1),g=s.getValueInRange(f).split("").reverse().join("");o.push(new Hie(f,g,new fn(u.lineNumber,u.column+1,u.lineNumber,u.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class CG extends yn{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(115),r=[];for(const a of i)if(a.isEmpty()){const c=a.getStartPosition(),u=t.getConfiguredWordAtPosition(c);if(!u)continue;const d=new be(c.lineNumber,u.startColumn,c.lineNumber,u.endColumn),f=s.getValueInRange(d);r.push(ir.replace(d,this._modifyText(f,o)))}else{const c=s.getValueInRange(a);r.push(ir.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class kBt extends CG{constructor(){super({id:"editor.action.transformToUppercase",label:$("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:We.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class ABt extends CG{constructor(){super({id:"editor.action.transformToLowercase",label:$("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:We.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class ooe{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class LP extends CG{constructor(){super({id:"editor.action.transformToTitlecase",label:$("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:We.writable})}_modifyText(e,t){const i=LP.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}}LP.titleBoundary=new ooe("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class UC extends CG{constructor(){super({id:"editor.action.transformToSnakecase",label:$("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:We.writable})}_modifyText(e,t){const i=UC.caseBoundary.get(),s=UC.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}}UC.caseBoundary=new ooe("(\\p{Ll})(\\p{Lu})","gmu");UC.singleLetters=new ooe("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");qt(gBt);qt(pBt);qt(mBt);qt(_Bt);qt(vBt);qt(bBt);qt(TBt);qt(CBt);qt(TG);qt(yBt);qt(EBt);qt(SBt);qt(wBt);qt(IBt);qt(LBt);qt(OBt);qt(RBt);qt(MBt);qt(kBt);qt(ABt);UC.caseBoundary.isSupported()&&UC.singleLetters.isSupported()&&qt(UC);LP.titleBoundary.isSupported()&&qt(LP);var NBt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DBt=function(n,e){return function(t,i){e(t,i,n)}},oZ=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const eAe=new Sn("LinkedEditingInputVisible",!1),tAe="linked-editing-decoration";let Sy=class rZ extends wt{constructor(e,t){super(),this._debounceDuration=200,this._localToDispose=this._register(new Wt),this._editor=e,this._enabled=!1,this._visibleContextKey=eAe.bindTo(t),this._currentDecorations=[],this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Wt),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(i=>{(i.hasChanged(61)||i.hasChanged(81))&&this.reinitialize(!1)})),this._register(t3.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}static get(e){return e.getContribution(rZ.ID)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(61)||this._editor.getOption(81))&&t3.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._languageWordPattern=ns.getWordDefinition(t.getLanguageId()),this._localToDispose.add(t.onDidChangeLanguageConfiguration(()=>{this._languageWordPattern=ns.getWordDefinition(t.getLanguageId())}));const s=new db(this._debounceDuration),o=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration)},r=new db(0),a=c=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(c=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const u=t.getDecorationRange(this._currentDecorations[0]);if(u&&c.changes.every(d=>u.intersectRanges(d.range))){a(this._currentDecorations);return}}o()})),this._localToDispose.add({dispose:()=>{s.cancel(),r.cancel()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._currentDecorations||e.length===0)return;const t=this._editor.getModel(),i=t.getDecorationRange(e[0]);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}let o=[];for(let r=1,a=e.length;r<a;r++){const c=t.getDecorationRange(e[r]);if(c)if(c.startLineNumber!==c.endLineNumber)o.push({range:c,text:s});else{let u=t.getValueInRange(c),d=s,f=c.startColumn,g=c.endColumn;const p=hR(u,d);f+=p,u=u.substr(p),d=d.substr(p);const _=KW(u,d);g-=_,u=u.substr(0,u.length-_),d=d.substr(0,d.length-_),(f!==g||d.length!==0)&&o.push({range:new be(c.startLineNumber,f,c.endLineNumber,g),text:d})}}if(o.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const r=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(r)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,[]),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(e=!1){return oZ(this,void 0,void 0,function*(){if(!this._editor.hasModel()){this.clearRanges();return}const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations&&this._currentDecorations.length>0){const r=i.getDecorationRange(this._currentDecorations[0]);if(r&&r.containsPosition(t))return}}this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=ul(r=>oZ(this,void 0,void 0,function*(){try{const a=yield nAe(i,t,r);if(o!==this._currentRequest||(this._currentRequest=null,s!==i.getVersionId()))return;let c=[];a!=null&&a.ranges&&(c=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let u=!1;for(let f=0,g=c.length;f<g;f++)if(be.containsPosition(c[f],t)){if(u=!0,f!==0){const p=c[f];c.splice(f,1),c.unshift(p)}break}if(!u){this.clearRanges();return}const d=c.map(f=>({range:f,options:rZ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,d)}catch(a){d_(a)||di(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};Sy.ID="editor.contrib.linkedEditing";Sy.DECORATION=Ci.register({description:"linked-editing",stickiness:0,className:tAe});Sy=NBt([DBt(1,ai)],Sy);class $Bt extends yn{constructor(){super({id:"editor.action.linkedEditing",label:$("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:dn.and(We.writable,We.hasRenameProvider),kbOpts:{kbExpr:We.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(hs),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return Jn.isUri(s)&&ct.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},di):super.runCommand(e,t)}run(e,t){const i=Sy.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const xBt=jl.bindToContribution(Sy.get);Xt(new xBt({id:"cancelLinkedEditingInput",precondition:eAe,handler:n=>n.clearRanges(),kbOpts:{kbExpr:We.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function nAe(n,e,t){const i=t3.ordered(n);return UIe(i.map(s=>()=>oZ(this,void 0,void 0,function*(){try{return yield s.provideLinkedEditingRanges(n,e,t)}catch(o){Ol(o);return}})),s=>!!s&&Nu(s==null?void 0:s.ranges))}const PBt=Ze("editor.linkedEditingBackground",{dark:mt.fromHex("#f00").transparent(.3),light:mt.fromHex("#f00").transparent(.3),hc:mt.fromHex("#f00").transparent(.3)},$("editorLinkedEditingBackground","Background color when the editor auto renames on type."));ws((n,e)=>{const t=n.getColor(PBt);t&&e.addRule(`.monaco-editor .${tAe} { background: ${t}; border-left-color: ${t}; }`)});f_("_executeLinkedEditingProvider",(n,e)=>nAe(n,e,Ai.None));_s(Sy.ID,Sy);qt($Bt);var iAe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class FBt{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return iAe(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}}class b5{constructor(e){this._disposables=new Wt;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new FBt(r,s));t=b5._union(t,o),vne(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){let i=[],s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;s<o&&r<a;){const c=e[s],u=t[r];if(be.areIntersectingOrTouching(c.range,u.range)){s++;continue}be.compareRangesUsingStarts(c.range,u.range)<0?(i.push(c),s++):(i.push(u),r++)}for(;s<o;s++)i.push(e[s]);for(;r<a;r++)i.push(t[r]);return i}}function sAe(n,e){const t=[],i=Ix.ordered(n).reverse().map((s,o)=>Promise.resolve(s.provideLinks(n,e)).then(r=>{r&&(t[o]=[r,s])},Ol));return Promise.all(i).then(()=>{const s=new b5(Bw(t));return e.isCancellationRequested?(s.dispose(),new b5([])):s})}ji.registerCommand("_executeLinkProvider",(n,...e)=>iAe(void 0,void 0,void 0,function*(){let[t,i]=e;Gs(t instanceof Jn),typeof i!="number"&&(i=0);const s=n.get(Xr).getModel(t);if(!s)return[];const o=yield sAe(s,Ai.None);if(!o)return[];for(let a=0;a<Math.min(i,o.links.length);a++)yield o.links[a].resolve(Ai.None);const r=o.links.slice(0);return o.dispose(),r}));var BBt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xme=function(n,e){return function(t,i){e(t,i,n)}},HBt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};function VBt(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?$("links.navigate.executeCmd","Execute command"):$("links.navigate.follow","Follow link"),s=e?ki?$("links.navigate.kb.meta.mac","cmd + click"):$("links.navigate.kb.meta","ctrl + click"):ki?$("links.navigate.kb.alt.mac","option + click"):$("links.navigate.kb.alt","alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=` "${$("tooltip.explanation","Execute command {0}",c)}"`}}return new mb("",!0).appendMarkdown(`[${i}](${n.url.toString(!0).replace(/ /g,"%20")}${o}) (${s})`)}else return new mb().appendText(`${i} (${s})`)}const Pme={general:Ci.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Ci.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class kO{constructor(e,t){this.link=e,this.decorationId=t}static decoration(e,t){return{range:e.range,options:kO._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s=Object.assign({},i?Pme.active:Pme.general);return s.hoverMessage=VBt(e,t),s}activate(e,t){e.changeDecorationOptions(this.decorationId,kO._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,kO._getOptions(this.link,t,!1))}}let _w=class lZ{constructor(e,t,i){this.listenersToRemove=new Wt,this.editor=e,this.openerService=t,this.notificationService=i;let s=new lMe(e);this.listenersToRemove.add(s),this.listenersToRemove.add(s.onMouseMoveOrRelevantKeyDown(([o,r])=>{this._onEditorMouseMove(o,r)})),this.listenersToRemove.add(s.onExecute(o=>{this.onEditorMouseUp(o)})),this.listenersToRemove.add(s.onCancel(o=>{this.cleanUpActiveLinkDecoration()})),this.enabled=e.getOption(62),this.listenersToRemove.add(e.onDidChangeConfiguration(o=>{const r=e.getOption(62);this.enabled!==r&&(this.enabled=r,this.updateDecorations([]),this.stop(),this.beginCompute())})),this.listenersToRemove.add(e.onDidChangeModelContent(o=>this.onChange())),this.listenersToRemove.add(e.onDidChangeModel(o=>this.onModelChanged())),this.listenersToRemove.add(e.onDidChangeModelLanguage(o=>this.onModelModeChanged())),this.listenersToRemove.add(Ix.onDidChange(o=>this.onModelModeChanged())),this.timeout=new mc,this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null,this.beginCompute()}static get(e){return e.getContribution(lZ.ID)}onModelChanged(){this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.beginCompute()}onModelModeChanged(){this.stop(),this.beginCompute()}onChange(){this.timeout.setIfNotSet(()=>this.beginCompute(),lZ.RECOMPUTE_TIME)}beginCompute(){return HBt(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.enabled)return;const e=this.editor.getModel();if(Ix.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=ul(t=>sAe(e,t));try{this.activeLinksList=yield this.computePromise,this.updateDecorations(this.activeLinksList.links)}catch(t){di(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(69)==="altKey";let i=[],s=Object.keys(this.currentOccurrences);for(let a=0,c=s.length;a<c;a++){let u=s[a],d=this.currentOccurrences[u];i.push(d.decorationId)}let o=[];if(e)for(const a of e)o.push(kO.decoration(a,t));let r=this.editor.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let a=0,c=r.length;a<c;a++){let u=new kO(e[a],r[a]);this.currentOccurrences[u.decorationId]=u}}_onEditorMouseMove(e,t){const i=this.editor.getOption(69)==="altKey";if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const s=this.getLinkOccurrence(e.target.position);s&&this.editor.changeDecorations(o=>{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(69)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(Ai.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Ii.file&&o.startsWith(`${Ii.file}:`)){const a=Jn.parse(o);if(a.scheme===Ii.file){const c=qU(a);let u=null;c.startsWith("/./")?u=`.${c.substr(1)}`:c.startsWith("//./")&&(u=`.${c.substr(2)}`),u&&(o=Ibt(r,u))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn($("invalid.url","Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn($("missing.url","Failed to open this link because its target is missing.")):di(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.timeout.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){this.listenersToRemove.dispose(),this.stop(),this.timeout.dispose()}};_w.ID="editor.linkDetector";_w.RECOMPUTE_TIME=1e3;_w=BBt([xme(1,np),xme(2,Hr)],_w);class UBt extends yn{constructor(){super({id:"editor.action.openLink",label:$("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){let i=_w.get(t);if(!i||!t.hasModel())return;let s=t.getSelections();for(let o of s){let r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}_s(_w.ID,_w);qt(UBt);ws((n,e)=>{const t=n.getColor(Die);t&&e.addRule(`.monaco-editor .detected-link-active { color: ${t} !important; }`)});function IM(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?$("cursorAdded","Cursor added: {0}",i):$("cursorsAdded","Cursors added: {0}",i);E3(s)}}class WBt extends yn{constructor(){super({id:"editor.action.insertCursorAbove",label:$("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"3_multi",title:$({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,vl.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),IM(r,o.getCursorStates())}}class GBt extends yn{constructor(){super({id:"editor.action.insertCursorBelow",label:$("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"3_multi",title:$({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,vl.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),IM(r,o.getCursorStates())}}class zBt extends yn{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:$("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"3_multi",title:$({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s<e.endLineNumber;s++){let o=t.getLineMaxColumn(s);i.push(new fn(s,o,s,o))}e.endColumn>1&&i.push(new fn(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates();let a=[];s.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),IM(r,o.getCursorStates())}}class KBt extends yn{constructor(){super({id:"editor.action.addCursorsToBottom",label:$("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount();let o=[];for(let c=i[0].startLineNumber;c<=s;c++)o.push(new fn(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),IM(a,r.getCursorStates())}}class jBt extends yn{constructor(){super({id:"editor.action.addCursorsToTop",label:$("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections();let s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new fn(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),IM(r,o.getCursorStates())}}class BV{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class OP{constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new OP(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const c=e.getSelection();let u,d=null;if(c.isEmpty()){const f=e.getConfiguredWordAtPosition(c.getStartPosition());if(!f)return null;u=f.word,d=new fn(c.startLineNumber,f.startColumn,c.startLineNumber,f.endColumn)}else u=e.getModel().getValueInRange(c).replace(/\r\n/g,`
- `);return new OP(e,t,s,u,o,r,d)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new BV(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new BV(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(115):null,!1);return i?new fn(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new BV(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new BV(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(115):null,!1);return i?new fn(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(){return this._editor.hasModel()?(this.findController.highlightFindOptions(),this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(115):null,!1,1073741824)):[]}}class vw extends wt{constructor(e){super(),this._sessionDispose=this._register(new Wt),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(vw.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=OP.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new fn(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!oAe(this._editor.getModel(),t,s)){const r=this._editor.getModel();let a=[];for(let c=0,u=t.length;c<u;c++)a[c]=this._expandEmptyToWord(r,t[c]);this._editor.setSelections(a);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex)t=this._editor.getModel().findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(115):null,!1,1073741824);else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll()}if(i.searchScope){const s=i.searchScope;let o=[];t.forEach(r=>{s.forEach(a=>{r.range.endLineNumber<=a.endLineNumber&&r.range.startLineNumber>=a.startLineNumber&&o.push(r)})}),t=o}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;o<r;o++){const a=t[o];if(a.range.intersectRanges(s)){t[o]=t[0],t[0]=a;break}}this._setSelections(t.map(o=>new fn(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}vw.ID="editor.contrib.multiCursorController";class LM extends yn{run(e,t){const i=vw.get(t);if(!i)return;const s=Fd.get(t);if(!s)return;const o=t._getViewModel();if(o){const r=o.getCursorStates();this._run(i,s),IM(r,o.getCursorStates())}}}class XBt extends LM{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:$("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:2082,weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"3_multi",title:$({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class YBt extends LM{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:$("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:wn.MenubarSelectionMenu,group:"3_multi",title:$({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class qBt extends LM{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:$("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:fl(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class JBt extends LM{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:$("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class QBt extends LM{constructor(){super({id:"editor.action.selectHighlights",label:$("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:3114,weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"3_multi",title:$({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class ZBt extends LM{constructor(){super({id:"editor.action.changeAll",label:$("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:dn.and(We.writable,We.editorTextFocus),kbOpts:{kbExpr:We.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class Fme{constructor(e,t,i,s){this.searchText=e,this.matchCase=t,this.wordSeparators=i,this.modelVersionId=s}static softEquals(e,t){return!e&&!t?!0:!e||!t?!1:e.searchText===t.searchText&&e.matchCase===t.matchCase&&e.wordSeparators===t.wordSeparators&&e.modelVersionId===t.modelVersionId}}class tb extends wt{constructor(e){super(),this.editor=e,this._isEnabled=e.getOption(96),this.decorations=[],this.updateSoon=this._register(new ho(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(96)})),this._register(e.onDidChangeCursorSelection(t=>{this._isEnabled&&(t.selection.isEmpty()?t.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(t=>{this._setState(null)})),this._register(e.onDidChangeModelContent(t=>{this._isEnabled&&this.updateSoon.schedule()})),this._register(Fd.get(e).getState().onFindReplaceStateChange(t=>{this._update()}))}_update(){this._setState(tb._createState(this._isEnabled,this.editor))}static _createState(e,t){if(!e||!t.hasModel())return null;const i=t.getSelection();if(i.startLineNumber!==i.endLineNumber)return null;const s=vw.get(t);if(!s)return null;const o=Fd.get(t);if(!o)return null;let r=s.getSession(o);if(!r){const u=t.getSelections();if(u.length>1){const f=o.getState().matchCase;if(!oAe(t.getModel(),u,f))return null}r=OP.create(t,o)}if(!r||r.currentMatch||/^[ \t]+$/.test(r.searchText)||r.searchText.length>200)return null;const a=o.getState(),c=a.matchCase;if(a.isRevealed){let u=a.searchString;c||(u=u.toLowerCase());let d=r.searchText;if(c||(d=d.toLowerCase()),u===d&&r.matchCase===a.matchCase&&r.wholeWord===a.wholeWord&&!a.isRegex)return null}return new Fme(r.searchText,r.matchCase,r.wholeWord?t.getOption(115):null,t.getModel().getVersionId())}_setState(e){if(Fme.softEquals(this.state,e)){this.state=e;return}if(this.state=e,!this.state){this.decorations=this.editor.deltaDecorations(this.decorations,[]);return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=gR.has(t)&&this.editor.getOption(71);let s=t.findMatches(this.state.searchText,!0,!1,this.state.matchCase,this.state.wordSeparators,!1).map(c=>c.range);s.sort(be.compareRangesUsingStarts);let o=this.editor.getSelections();o.sort(be.compareRangesUsingStarts);let r=[];for(let c=0,u=0,d=s.length,f=o.length;c<d;){const g=s[c];if(u>=f)r.push(g),c++;else{const p=be.compareRangesUsingStarts(g,o[u]);p<0?((o[u].isEmpty()||!be.areIntersecting(g,o[u]))&&r.push(g),c++):(p>0||c++,u++)}}const a=r.map(c=>({range:c,options:i?tb._SELECTION_HIGHLIGHT:tb._SELECTION_HIGHLIGHT_OVERVIEW}));this.decorations=this.editor.deltaDecorations(this.decorations,a)}dispose(){this._setState(null),super.dispose()}}tb.ID="editor.contrib.selectionHighlighter";tb._SELECTION_HIGHLIGHT_OVERVIEW=Ci.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",minimap:{color:sr(C6),position:vh.Inline},overviewRuler:{color:sr(W1e),position:Ad.Center}});tb._SELECTION_HIGHLIGHT=Ci.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});function oAe(n,e,t){const i=Bme(n,e[0],!t);for(let s=1,o=e.length;s<o;s++){const r=e[s];if(r.isEmpty())return!1;const a=Bme(n,r,!t);if(i!==a)return!1}return!0}function Bme(n,e,t){const i=n.getValueInRange(e);return t?i.toLowerCase():i}_s(vw.ID,vw);_s(tb.ID,tb);qt(WBt);qt(GBt);qt(zBt);qt(XBt);qt(YBt);qt(qBt);qt(JBt);qt(QBt);qt(ZBt);qt(KBt);qt(jBt);var rAe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const bw={Visible:new Sn("parameterHintsVisible",!1),MultipleSignatures:new Sn("parameterHintsMultipleSignatures",!1)};function lAe(n,e,t,i){return rAe(this,void 0,void 0,function*(){const s=m0.ordered(n);for(const o of s)try{const r=yield o.provideSignatureHelp(n,e,i,t);if(r)return r}catch(r){Ol(r)}})}ji.registerCommand("_executeSignatureHelpProvider",(n,...e)=>rAe(void 0,void 0,void 0,function*(){const[t,i,s]=e;Gs(Jn.isUri(t)),Gs(ct.isIPosition(i)),Gs(typeof s=="string"||!s);const o=yield n.get(Nd).createModelReference(t);try{const r=yield lAe(o.object.textEditorModel,ct.lift(i),{triggerKind:Hm.Invoke,isRetrigger:!1,triggerCharacter:s},Ai.None);return r?(setTimeout(()=>r.dispose(),0),r.value):void 0}finally{o.dispose()}}));var eHt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},iC;(function(n){n.Default={type:0};class e{constructor(s,o){this.request=s,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(s){this.hints=s,this.type=1}}n.Active=t})(iC||(iC={}));class yG extends wt{constructor(e,t=yG.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new rt),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=iC.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new pc),this.triggerChars=new U1,this.retriggerChars=new U1,this.triggerId=0,this.editor=e,this.throttledDelayer=new db(t),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(i=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(i=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(i=>this.onCursorChange(i))),this._register(this.editor.onDidChangeModelContent(i=>this.onModelContentChange())),this._register(m0.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(i=>this.onDidType(i))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=iC.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!m0.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(di)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(75).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(75).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new iC.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return eHt(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(tHt);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new iC.Pending(ul(c=>lAe(r,a,o,c)),i);try{const c=yield this.state.request;return e!==this.triggerId?(c==null||c.dispose(),!1):!c||!c.value.signatures||c.value.signatures.length===0?(c==null||c.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new iC.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=iC.Default),di(c),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars=new U1,this.retriggerChars=new U1;const e=this.editor.getModel();if(e)for(const t of m0.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])this.triggerChars.add(i.charCodeAt(0)),this.retriggerChars.add(i.charCodeAt(0));for(const i of t.signatureHelpRetriggerCharacters||[])this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Hm.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Hm.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Hm.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(75).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}yG.DEFAULT_DELAY=120;function tHt(n,e){switch(e.triggerKind){case Hm.Invoke:return e;case Hm.ContentChange:return n;case Hm.TriggerCharacter:default:return e}}var nHt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},EK=function(n,e){return function(t,i){e(t,i,n)}};const ld=Vt,iHt=Xl("parameter-hints-next",vn.chevronDown,$("parameterHintsNextIcon","Icon for show next parameter hint.")),sHt=Xl("parameter-hints-previous",vn.chevronUp,$("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let T5=class aAe extends wt{constructor(e,t,i,s){super(),this.editor=e,this.renderDisposeables=this._register(new Wt),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new by({editor:e},s,i)),this.model=this._register(new yG(e)),this.keyVisible=bw.Visible.bindTo(t),this.keyMultipleSignatures=bw.MultipleSignatures.bindTo(t),this._register(this.model.onChangedHints(o=>{o?(this.show(),this.render(o)):this.hide()}))}createParameterHintDOMNodes(){const e=ld(".editor-widget.parameter-hints-widget"),t=Nt(e,ld(".phwrapper"));t.tabIndex=-1;const i=Nt(t,ld(".controls")),s=Nt(i,ld(".button"+mo.asCSSSelector(sHt))),o=Nt(i,ld(".overloads")),r=Nt(i,ld(".button"+mo.asCSSSelector(iHt)));this._register(Pt(s,"click",g=>{Rs.stop(g),this.previous()})),this._register(Pt(r,"click",g=>{Rs.stop(g),this.next()}));const a=ld(".body"),c=new RF(a,{});this._register(c),t.appendChild(c.getDomNode());const u=Nt(a,ld(".signature")),d=Nt(a,ld(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:u,overloads:o,docs:d,scrollbar:c},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(g=>{this.visible&&this.editor.layoutContentWidget(this)}));const f=()=>{if(!this.domNodes)return;const g=this.editor.getOption(43);this.domNodes.element.style.fontSize=`${g.fontSize}px`,this.domNodes.element.style.lineHeight=`${g.lineHeight/g.fontSize}`};f(),this._register(Ln.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(g=>g.hasChanged(43)).on(f,null)),this._register(this.editor.onDidLayoutChange(g=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes&&this.domNodes.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes&&this.domNodes.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const s=e.signatures[e.activeSignature];if(!s)return;const o=Nt(this.domNodes.signature,ld(".code")),r=this.editor.getOption(43);o.style.fontSize=`${r.fontSize}px`,o.style.fontFamily=r.fontFamily;const a=s.parameters.length>0,c=(t=s.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,s,c);else{const f=Nt(o,ld("span"));f.textContent=s.label}const u=s.parameters[c];if(u!=null&&u.documentation){const f=ld("span.documentation");if(typeof u.documentation=="string")f.textContent=u.documentation;else{const g=this.renderMarkdownDocs(u.documentation);f.appendChild(g.element)}Nt(this.domNodes.docs,ld("p",{},f))}if(s.documentation!==void 0)if(typeof s.documentation=="string")Nt(this.domNodes.docs,ld("p",{},s.documentation));else{const f=this.renderMarkdownDocs(s.documentation);Nt(this.domNodes.docs,f.element)}const d=this.hasDocs(s,u);if(this.domNodes.signature.classList.toggle("has-docs",d),this.domNodes.docs.classList.toggle("empty",!d),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,u){let f="";const g=s.parameters[c];Array.isArray(g.label)?f=s.label.substring(g.label[0],g.label[1]):f=g.label,g.documentation&&(f+=typeof g.documentation=="string"?`, ${g.documentation}`:`, ${g.documentation.value}`),s.documentation&&(f+=typeof s.documentation=="string"?`, ${s.documentation}`:`, ${s.documentation.value}`),this.announcedLabel!==f&&(Hl($("hint","{0}, hint",f)),this.announcedLabel=f)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&UH(t.documentation).length>0||t&&typeof t.documentation=="object"&&UH(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&UH(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&UH(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),Nt(e,r,a,c)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${jf(i.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}cancel(){this.model.cancel()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return aAe.ID}trigger(e){this.model.trigger(e,0)}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};T5.ID="editor.widget.parameterHintsWidget";T5=nHt([EK(1,ai),EK(2,np),EK(3,Ga)],T5);const oHt=Ze("editorHoverWidget.highlightForeground",{dark:Qv,light:Qv,hc:Qv},$("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));ws((n,e)=>{const t=n.getColor(Nie);if(t){const u=n.type===bh.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .parameter-hints-widget { border: ${u}px solid ${t}; }`),e.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${t.transparent(.5)}; }`)}const i=n.getColor(tw);i&&e.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${i}; }`);const s=n.getColor(IF);s&&e.addRule(`.monaco-editor .parameter-hints-widget a { color: ${s}; }`);const o=n.getColor(LF);o&&e.addRule(`.monaco-editor .parameter-hints-widget a:hover { color: ${o}; }`);const r=n.getColor(Aie);r&&e.addRule(`.monaco-editor .parameter-hints-widget { color: ${r}; }`);const a=n.getColor(yie);a&&e.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${a}; }`);const c=n.getColor(oHt);c&&e.addRule(`.monaco-editor .parameter-hints-widget .parameter.active { color: ${c}}`)});var rHt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lHt=function(n,e){return function(t,i){e(t,i,n)}};let Tw=class cAe extends wt{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(T5,this.editor))}static get(e){return e.getContribution(cAe.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};Tw.ID="editor.controller.parameterHints";Tw=rHt([lHt(1,Qi)],Tw);class aHt extends yn{constructor(){super({id:"editor.action.triggerParameterHints",label:$("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:We.hasSignatureHelpProvider,kbOpts:{kbExpr:We.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=Tw.get(t);i&&i.trigger({triggerKind:Hm.Invoke})}}_s(Tw.ID,Tw);qt(aHt);const roe=175,loe=jl.bindToContribution(Tw.get);Xt(new loe({id:"closeParameterHints",precondition:bw.Visible,handler:n=>n.cancel(),kbOpts:{weight:roe,kbExpr:We.focus,primary:9,secondary:[1033]}}));Xt(new loe({id:"showPrevParameterHint",precondition:dn.and(bw.Visible,bw.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:roe,kbExpr:We.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Xt(new loe({id:"showNextParameterHint",precondition:dn.and(bw.Visible,bw.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:roe,kbExpr:We.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var cHt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},SK=function(n,e){return function(t,i){e(t,i,n)}};const EG=new Sn("renameInputVisible",!1,$("renameInputVisible","Whether the rename input widget is visible"));let aZ=class{constructor(e,t,i,s,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._disposables=new Wt,this.allowEditorOverflow=!0,this._visibleContextKey=EG.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(43)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){if(!this._domNode){this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",$("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label);const e=()=>{var t,i;const[s,o]=this._acceptKeybindings;this._keybindingService.lookupKeybinding(s),this._label.innerText=$({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(t=this._keybindingService.lookupKeybinding(s))===null||t===void 0?void 0:t.getLabel(),(i=this._keybindingService.lookupKeybinding(o))===null||i===void 0?void 0:i.getLabel())};e(),this._disposables.add(this._keybindingService.onDidUpdateKeybindings(e)),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())}return this._domNode}_updateStyles(e){var t,i,s,o;if(!this._input||!this._domNode)return;const r=e.getColor(dy);this._domNode.style.backgroundColor=String((t=e.getColor(Od))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=r?` 0 0 8px 2px ${r}`:"",this._domNode.style.color=String((i=e.getColor(Sie))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((s=e.getColor(Eie))!==null&&s!==void 0?s:"");const a=e.getColor(wie);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none",this._input.style.borderColor=(o=a==null?void 0:a.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(43);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){this._currentAcceptInput&&this._currentAcceptInput(e)}cancelInput(e){this._currentCancelInput&&this._currentCancelInput(e)}getInput(e,t,i,s,o,r){this._domNode.classList.toggle("preview",o),this._position=new ct(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",s.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new Wt;return new Promise(c=>{this._currentCancelInput=u=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,c(u),!0),this._currentAcceptInput=u=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,c({newName:this._input.value,wantsPreview:o&&u})},r.onCancellationRequested(()=>this.cancelInput(!0)),a.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!1))),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};aZ=cHt([SK(2,fo),SK(3,Ro),SK(4,ai)],aZ);var uHt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},p1=function(n,e){return function(t,i){e(t,i,n)}},O0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class aoe{constructor(e,t){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=e3.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return O0(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const s=this._providers[this._providerRenameIdx];if(!s.resolveRenameLocation)break;let o=yield s.resolveRenameLocation(this.model,this.position,e);if(o){if(o.rejectReason){t.push(o.rejectReason);continue}return o}}const i=this.model.getWordAtPosition(this.position);return i?{range:new be(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
- `):void 0}:{range:be.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
- `):void 0}})}provideRenameEdits(e,t){return O0(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,s){return O0(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
- `)};const r=yield o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat($("no result","No result.")),s);return r})}}function dHt(n,e,t){return O0(this,void 0,void 0,function*(){const i=new aoe(n,e),s=yield i.resolveRenameLocation(Ai.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:i.provideRenameEdits(t,Ai.None)})}let Cw=class uAe{constructor(e,t,i,s,o,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._dispoableStore=new Wt,this._cts=new dc,this._renameInputField=this._dispoableStore.add(new mO(()=>this._dispoableStore.add(this._instaService.createInstance(aZ,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(e){return e.getContribution(uAe.ID)}dispose(){this._dispoableStore.dispose(),this._cts.dispose(!0)}run(){return O0(this,void 0,void 0,function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const e=this.editor.getPosition(),t=new aoe(this.editor.getModel(),e);if(!t.hasProvider())return;this._cts=new Qx(this.editor,5);let i;try{const d=t.resolveRenameLocation(this._cts.token);this._progressService.showWhile(d,250),i=yield d}catch(d){Pd.get(this.editor).showMessage(d||$("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),e);return}if(!i)return;if(i.rejectReason){Pd.get(this.editor).showMessage(i.rejectReason,e);return}if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new Qx(this.editor,5,i.range);let s=this.editor.getSelection(),o=0,r=i.text.length;!be.isEmpty(s)&&!be.spansMultipleLines(s)&&be.containsRange(i.range,s)&&(o=Math.max(0,s.startColumn-i.range.startColumn),r=Math.min(i.range.endColumn,s.endColumn)-i.range.startColumn);const a=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=yield this._renameInputField.value.getInput(i.range,i.text,o,r,a,this._cts.token);if(typeof c=="boolean"){c&&this.editor.focus();return}this.editor.focus();const u=Sne(t.provideRenameEdits(c.newName,this._cts.token),this._cts.token).then(d=>O0(this,void 0,void 0,function*(){if(!(!d||!this.editor.hasModel())){if(d.rejectReason){this._notificationService.info(d.rejectReason);return}this.editor.setSelection(be.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(s6.convert(d),{editor:this.editor,showPreview:c.wantsPreview,label:$("label","Renaming '{0}'",i==null?void 0:i.text),quotableLabel:$("quotableLabel","Renaming {0}",i==null?void 0:i.text)}).then(f=>{f.ariaSummary&&Hl($("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",i.text,c.newName,f.ariaSummary))}).catch(f=>{this._notificationService.error($("rename.failedApply","Rename failed to apply edits")),this._logService.error(f)})}}),d=>{this._notificationService.error($("rename.failed","Rename failed to compute edits")),this._logService.error(d)});return this._progressService.showWhile(u,250),u})}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};Cw.ID="editor.contrib.renameController";Cw=uHt([p1(1,Qi),p1(2,Hr),p1(3,tie),p1(4,Mb),p1(5,h_),p1(6,jne)],Cw);class hHt extends yn{constructor(){super({id:"editor.action.rename",label:$("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:dn.and(We.writable,We.hasRenameProvider),kbOpts:{kbExpr:We.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(hs),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return Jn.isUri(s)&&ct.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},di):super.runCommand(e,t)}run(e,t){const i=Cw.get(t);return i?i.run():Promise.resolve()}}_s(Cw.ID,Cw);qt(hHt);const coe=jl.bindToContribution(Cw.get);Xt(new coe({id:"acceptRenameInput",precondition:EG,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:We.focus,primary:3}}));Xt(new coe({id:"acceptRenameInputWithPreview",precondition:dn.and(EG,dn.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:We.focus,primary:1027}}));Xt(new coe({id:"cancelRenameInput",precondition:EG,handler:n=>n.cancelRenameInput(),kbOpts:{weight:199,kbExpr:We.focus,primary:9,secondary:[1033]}}));f_("_executeDocumentRenameProvider",function(n,e,...t){const[i]=t;return Gs(typeof i=="string"),dHt(n,e,i)});f_("_executePrepareRename",function(n,e){return O0(this,void 0,void 0,function*(){const i=yield new aoe(n,e).resolveRenameLocation(Ai.None);if(i!=null&&i.rejectReason)throw new Error(i.rejectReason);return i})});br.as(Fw.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:$("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});class fHt{provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;let{word:o,startColumn:r}=s,a=i.column-r,c=a,u=a,d=0;for(;c>=0;c--){let f=o.charCodeAt(c);if(c!==a&&(f===95||f===45))break;if(vC(f)&&hm(d))break;d=f}for(c+=1;u<o.length;u++){let f=o.charCodeAt(u);if(hm(f)&&vC(d))break;if(f===95||f===45)break;d=f}c<u&&e.push({range:new be(i.lineNumber,r+c,i.lineNumber,r+u)})}_addWordRanges(e,t,i){const s=t.getWordAtPosition(i);s&&e.push({range:new be(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new be(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var uoe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class doe{constructor(e,t){this.index=e,this.ranges=t}mov(e){let t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new doe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}class UR{constructor(e){this._editor=e,this._ignoreSelection=!1}static get(e){return e.getContribution(UR.ID)}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return uoe(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(!Y8.has(i)||(this._state||(yield hAe(i,t.map(o=>o.getPosition()),this._editor.getOption(101),Ai.None).then(o=>{var r;if(!(!Nu(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!xf(this._editor.getSelections(),t,(a,c)=>a.equalsSelection(c)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(c=>c.containsPosition(t[a].getStartPosition())&&c.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new doe(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state))return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>fn.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}})}}UR.ID="editor.contrib.smartSelectController";class dAe extends yn{constructor(e,t){super(t),this._forward=e}run(e,t){return uoe(this,void 0,void 0,function*(){let i=UR.get(t);i&&(yield i.run(this._forward))})}}class gHt extends dAe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:$("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"1_basic",title:$({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}ji.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class pHt extends dAe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:$("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:We.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:wn.MenubarSelectionMenu,group:"1_basic",title:$({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}_s(UR.ID,UR);qt(gHt);qt(pHt);Y8.register("*",new fHt);function hAe(n,e,t,i){return uoe(this,void 0,void 0,function*(){const s=Y8.all(n);s.length===1&&s.unshift(new cd);let o=[],r=[];for(const a of s)o.push(Promise.resolve(a.provideSelectionRanges(n,e,i)).then(c=>{if(Nu(c)&&c.length===e.length)for(let u=0;u<e.length;u++){r[u]||(r[u]=[]);for(const d of c[u])be.isIRange(d.range)&&be.containsPosition(d.range,e[u])&&r[u].push(be.lift(d.range))}},Ol));return yield Promise.all(o),r.map(a=>{if(a.length===0)return[];a.sort((f,g)=>ct.isBefore(f.getStartPosition(),g.getStartPosition())?1:ct.isBefore(g.getStartPosition(),f.getStartPosition())||ct.isBefore(f.getEndPosition(),g.getEndPosition())?-1:ct.isBefore(g.getEndPosition(),f.getEndPosition())?1:0);let c=[],u;for(const f of a)(!u||be.containsRange(f,u)&&!be.equalsRange(f,u))&&(c.push(f),u=f);if(!t.selectLeadingAndTrailingWhitespace)return c;let d=[c[0]];for(let f=1;f<c.length;f++){const g=c[f-1],p=c[f];if(p.startLineNumber!==g.startLineNumber||p.endLineNumber!==g.endLineNumber){const _=new be(g.startLineNumber,n.getLineFirstNonWhitespaceColumn(g.startLineNumber),g.endLineNumber,n.getLineLastNonWhitespaceColumn(g.endLineNumber));_.containsRange(g)&&!_.equalsRange(g)&&p.containsRange(_)&&!p.equalsRange(_)&&d.push(_);const v=new be(g.startLineNumber,1,g.endLineNumber,n.getLineMaxColumn(g.endLineNumber));v.containsRange(g)&&!v.equalsRange(_)&&p.containsRange(v)&&!p.equalsRange(v)&&d.push(v)}d.push(p)}return d})})}Kyt("_executeSelectionRangeProvider",function(n,...e){const[t]=e;return hAe(n,t,{selectLeadingAndTrailingWhitespace:!0},Ai.None)});class mHt extends yn{constructor(){super({id:"editor.action.forceRetokenize",label:$("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.resetTokenization();const s=new Ym(!0);i.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}qt(mHt);class WR extends yn{constructor(){super({id:WR.ID,label:$({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),alias:"Toggle Tab Key Moves Focus",precondition:void 0,kbOpts:{kbExpr:null,primary:2091,mac:{primary:1323},weight:100}})}run(e,t){const s=!f3.getTabFocusMode();f3.setTabFocusMode(s),Hl(s?$("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):$("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}WR.ID="editor.action.toggleTabFocusMode";qt(WR);var _Ht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hme=function(n,e){return function(t,i){e(t,i,n)}},vHt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};const fAe="ignoreUnusualLineTerminators";function bHt(n,e,t){n.setModelProperty(e.uri,fAe,t)}function THt(n,e){return n.getModelProperty(e.uri,fAe)}let RP=class extends wt{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._config=this._editor.getOption(112),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(112)&&(this._config=this._editor.getOption(112),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()}))}_checkForUnusualLineTerminators(){return vHt(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||THt(this._codeEditorService,e)===!0||this._editor.getOption(80))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(!(yield this._dialogService.confirm({title:$("unusualLineTerminators.title","Unusual Line Terminators"),message:$("unusualLineTerminators.message","Detected unusual line terminators"),detail:$("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Xf(e.uri)),primaryButton:$("unusualLineTerminators.fix","Remove Unusual Line Terminators"),secondaryButton:$("unusualLineTerminators.ignore","Ignore")})).confirmed){bHt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};RP.ID="editor.contrib.unusualLineTerminatorsDetector";RP=_Ht([Hme(1,AF),Hme(2,hs)],RP);_s(RP.ID,RP);var CHt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wK=function(n,e){return function(t,i){e(t,i,n)}};let MP=class extends wt{constructor(e,t,i,s){super(),this._modelService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._tokenizeViewport=new ho(()=>this._tokenizeViewportNow(),100),this._outstandingRequests=[],this._register(this._editor.onDidScrollChange(()=>{this._tokenizeViewport.schedule()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._editor.onDidChangeModelContent(o=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(q8.onDidChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()})),this._register(this._configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration(nse)&&(this._cancelAll(),this._tokenizeViewport.schedule())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),this._tokenizeViewport.schedule()}))}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.hasCompleteSemanticTokens())return;if(!CJ(e,this._themeService,this._configurationService)){e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1);return}if(!lOt(e)){e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=ul(o=>Promise.resolve(tse(e,t,o)));return s.then(o=>{if(!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:r,tokens:a}=o,c=this._modelService.getSemanticTokensProviderStyling(r);e.setPartialSemanticTokens(t,kOe(a,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}};MP.ID="editor.contrib.viewportSemanticTokens";MP=CHt([wK(1,Xr),wK(2,fo),wK(3,Yo)],MP);_s(MP.ID,MP);var yHt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},EHt=function(n,e){return function(t,i){e(t,i,n)}};const SHt=Ze("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hc:null},$("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0),wHt=Ze("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hc:null},$("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),IHt=Ze("editor.wordHighlightBorder",{light:null,dark:null,hc:Ua},$("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),LHt=Ze("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:Ua},$("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),OHt=Ze("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},$("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),RHt=Ze("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hc:"#C0A0C0CC"},$("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),SG=new Sn("hasWordHighlights",!1);function gAe(n,e,t){const i=gR.ordered(n);return UIe(i.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(n,e,t)).then(void 0,Ol)),Nu)}class pAe{constructor(e,t,i){this._wordRange=this._getCurrentWordRange(e,t),this.result=ul(s=>this._compute(e,t,i,s))}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new be(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let u=0,d=i.length;!c&&u<d;u++){let f=e.getDecorationRange(i[u]);f&&f.startLineNumber===s&&f.startColumn<=o&&f.endColumn>=r&&(c=!0)}return c}cancel(){this.result.cancel()}}class MHt extends pAe{_compute(e,t,i,s){return gAe(e,t.getPosition(),s).then(o=>o||[])}}class kHt extends pAe{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,s){return sy(250,s).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:Ex.Text}))})}isValid(e,t,i){const s=t.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,t,i)}}function AHt(n,e,t){return gR.has(n)?new MHt(n,e,t):new kHt(n,e,t)}f_("_executeDocumentHighlights",(n,e)=>gAe(n,e,Ai.None));class OM{constructor(e,t){this.toUnhook=new Wt,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this._hasWordHighlights=SG.bindTo(t),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(71),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(i=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(i)})),this.toUnhook.add(e.onDidChangeModelContent(i=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(i=>{let s=this.editor.getOption(71);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,this._stopAll())})),this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this._decorationIds.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return Bw(this._decorationIds.map(e=>this.model.getDecorationRange(e)).sort(be.compareRangesUsingStarts))}moveNext(){let e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);Hl(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);Hl(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this._decorationIds.length>0&&(this._decorationIds=this.editor.deltaDecorations(this._decorationIds,[]),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){let e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}let t=e.startColumn,i=e.endColumn;const s=this._getWord();if(!s||s.startColumn>t||s.endColumn<i){this._stopAll();return}const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this._decorationIds);if(this.lastCursorPositionChangeTime=new Date().getTime(),o)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();let r=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=AHt(this.model,this.editor.getSelection(),this.editor.getOption(115)),this.workerRequest.result.then(a=>{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},di)}}_beginRenderDecorations(){let e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;let e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:OM._getDecorationOptions(t.kind)});this._decorationIds=this.editor.deltaDecorations(this._decorationIds,e),this._hasWordHighlights.set(this.hasDecorations())}static _getDecorationOptions(e){return e===Ex.Write?this._WRITE_OPTIONS:e===Ex.Text?this._TEXT_OPTIONS:this._REGULAR_OPTIONS}dispose(){this._stopAll(),this.toUnhook.dispose()}}OM._WRITE_OPTIONS=Ci.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:sr(RHt),position:Ad.Center},minimap:{color:sr(C6),position:vh.Inline}});OM._TEXT_OPTIONS=Ci.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight",overviewRuler:{color:sr(W1e),position:Ad.Center},minimap:{color:sr(C6),position:vh.Inline}});OM._REGULAR_OPTIONS=Ci.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:sr(OHt),position:Ad.Center},minimap:{color:sr(C6),position:vh.Inline}});let yw=class mAe extends wt{constructor(e,t){super(),this.wordHighlighter=null;const i=()=>{e.hasModel()&&(this.wordHighlighter=new OM(e,t))};this._register(e.onDidChangeModel(s=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),i()})),i()}static get(e){return e.getContribution(mAe.ID)}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){this.wordHighlighter&&this.wordHighlighter.moveNext()}moveBack(){this.wordHighlighter&&this.wordHighlighter.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};yw.ID="editor.contrib.wordHighlighter";yw=yHt([EHt(1,ai)],yw);class _Ae extends yn{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=yw.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class NHt extends _Ae{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:$("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:SG,kbOpts:{kbExpr:We.editorTextFocus,primary:65,weight:100}})}}class DHt extends _Ae{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:$("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:SG,kbOpts:{kbExpr:We.editorTextFocus,primary:1089,weight:100}})}}class $Ht extends yn{constructor(){super({id:"editor.action.wordHighlight.trigger",label:$("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:SG.toNegated(),kbOpts:{kbExpr:We.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const s=yw.get(t);s&&s.restoreViewState(!0)}}_s(yw.ID,yw);qt(NHt);qt(DHt);qt($Ht);ws((n,e)=>{const t=n.getColor(kie);t&&(e.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${t}; }`),e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`));const i=n.getColor(SHt);i&&e.addRule(`.monaco-editor .wordHighlight { background-color: ${i}; }`);const s=n.getColor(wHt);s&&e.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${s}; }`);const o=n.getColor(jSt);o&&e.addRule(`.monaco-editor .selectionHighlight { border: 1px ${n.type==="hc"?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=n.getColor(IHt);r&&e.addRule(`.monaco-editor .wordHighlight { border: 1px ${n.type==="hc"?"dashed":"solid"} ${r}; box-sizing: border-box; }`);const a=n.getColor(LHt);a&&e.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${n.type==="hc"?"dashed":"solid"} ${a}; box-sizing: border-box; }`)});class wG extends jl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=Ih(t.getOption(115)),o=t.getModel(),a=t.getSelections().map(c=>{const u=new ct(c.positionLineNumber,c.positionColumn),d=this._move(s,o,u,this._wordNavigationType);return this._moveTo(c,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(c=>Ri.fromModelSelection(c))),a.length===1){const c=new ct(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new fn(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new fn(t.lineNumber,t.column,t.lineNumber,t.column)}}class Gy extends wG{_move(e,t,i,s){return Yi.moveWordLeft(e,t,i,s)}}class zy extends wG{_move(e,t,i,s){return Yi.moveWordRight(e,t,i,s)}}class xHt extends Gy{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class PHt extends Gy{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class FHt extends Gy{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:dn.and(We.textInputFocus,(e=dn.and(kF,x6))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class BHt extends Gy{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class HHt extends Gy{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class VHt extends Gy{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:dn.and(We.textInputFocus,(e=dn.and(kF,x6))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class UHt extends Gy{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s){return super._move(Ih(pp.wordSeparators.defaultValue),t,i,s)}}class WHt extends Gy{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s){return super._move(Ih(pp.wordSeparators.defaultValue),t,i,s)}}class GHt extends zy{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class zHt extends zy{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:dn.and(We.textInputFocus,(e=dn.and(kF,x6))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class KHt extends zy{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class jHt extends zy{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class XHt extends zy{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:dn.and(We.textInputFocus,(e=dn.and(kF,x6))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class YHt extends zy{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class qHt extends zy{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s){return super._move(Ih(pp.wordSeparators.defaultValue),t,i,s)}}class JHt extends zy{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s){return super._move(Ih(pp.wordSeparators.defaultValue),t,i,s)}}class IG extends jl{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=Ih(t.getOption(115)),o=t.getModel(),r=t.getSelections(),a=t.getOption(5),c=t.getOption(8),u=ns.getAutoClosingPairs(o.getLanguageId()),d=t._getViewModel(),f=r.map(g=>{const p=this._delete({wordSeparators:s,model:o,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(6),autoClosingBrackets:a,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Dl(p,"")});t.pushUndoStop(),t.executeCommands(this.id,f),t.pushUndoStop()}}class hoe extends IG{_delete(e,t){let i=Yi.deleteWordLeft(e,t);return i||new be(1,1,1,1)}}class foe extends IG{_delete(e,t){let i=Yi.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new be(s,o,s,o)}}class QHt extends hoe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:We.writable})}}class ZHt extends hoe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:We.writable})}}class eVt extends hoe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class tVt extends foe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:We.writable})}}class nVt extends foe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:We.writable})}}class iVt extends foe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class sVt extends yn{constructor(){super({id:"deleteInsideWord",precondition:We.writable,label:$("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=Ih(t.getOption(115)),o=t.getModel(),a=t.getSelections().map(c=>{const u=Yi.deleteInsideWord(s,o,c);return new Dl(u,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Xt(new xHt);Xt(new PHt);Xt(new FHt);Xt(new BHt);Xt(new HHt);Xt(new VHt);Xt(new GHt);Xt(new zHt);Xt(new KHt);Xt(new jHt);Xt(new XHt);Xt(new YHt);Xt(new UHt);Xt(new WHt);Xt(new qHt);Xt(new JHt);Xt(new QHt);Xt(new ZHt);Xt(new eVt);Xt(new tVt);Xt(new nVt);Xt(new iVt);qt(sVt);class oVt extends IG{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){let i=w6.deleteWordPartLeft(e);return i||new be(1,1,1,1)}}class rVt extends IG{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:We.writable,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let i=w6.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new be(s,o,s,o)}}class vAe extends wG{_move(e,t,i,s){return w6.moveWordPartLeft(e,t,i)}}class lVt extends vAe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}ji.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class aVt extends vAe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}ji.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class bAe extends wG{_move(e,t,i,s){return w6.moveWordPartRight(e,t,i)}}class cVt extends bAe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class uVt extends bAe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:We.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Xt(new oVt);Xt(new rVt);Xt(new lVt);Xt(new aVt);Xt(new cVt);Xt(new uVt);var TAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},I4=function(n,e){return function(t,i){e(t,i,n)}};const CAe=new Sn("accessibilityHelpWidgetVisible",!1);let Ew=class yAe extends wt{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(GR,this._editor))}static get(e){return e.getContribution(yAe.ID)}show(){this._widget.show()}hide(){this._widget.hide()}};Ew.ID="editor.contrib.accessibilityHelpController";Ew=TAe([I4(1,Qi)],Ew);function dVt(n,e){return!n||n.length===0?Er.noSelection:n.length===1?e?ha(Er.singleSelectionRange,n[0].positionLineNumber,n[0].positionColumn,e):ha(Er.singleSelection,n[0].positionLineNumber,n[0].positionColumn):e?ha(Er.multiSelectionRange,n.length,e):n.length>0?ha(Er.multiSelection,n.length):""}let GR=class L4 extends Bd{constructor(e,t,i,s){super(),this._contextKeyService=t,this._keybindingService=i,this._openerService=s,this._editor=e,this._isVisibleKey=CAe.bindTo(this._contextKeyService),this._domNode=qi(document.createElement("div")),this._domNode.setClassName("accessibilityHelpWidget"),this._domNode.setDisplay("none"),this._domNode.setAttribute("role","dialog"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode=qi(document.createElement("div")),this._contentDomNode.setAttribute("role","document"),this._domNode.appendChild(this._contentDomNode),this._isVisible=!1,this._register(this._editor.onDidLayoutChange(()=>{this._isVisible&&this._layout()})),this._register(Br(this._contentDomNode.domNode,"keydown",o=>{if(this._isVisible&&(o.equals(2083)&&(Hl(Er.emergencyConfOn),this._editor.updateOptions({accessibilitySupport:"on"}),wl(this._contentDomNode.domNode),this._buildContent(),this._contentDomNode.domNode.focus(),o.preventDefault(),o.stopPropagation()),o.equals(2086))){Hl(Er.openingDocs);let r=this._editor.getRawOptions().accessibilityHelpUrl;typeof r>"u"&&(r="https://go.microsoft.com/fwlink/?linkid=852450"),this._openerService.open(Jn.parse(r)),o.preventDefault(),o.stopPropagation()}})),this.onblur(this._contentDomNode.domNode,()=>{this.hide()}),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return L4.ID}getDomNode(){return this._domNode.domNode}getPosition(){return{preference:null}}show(){this._isVisible||(this._isVisible=!0,this._isVisibleKey.set(!0),this._layout(),this._domNode.setDisplay("block"),this._domNode.setAttribute("aria-hidden","false"),this._contentDomNode.domNode.tabIndex=0,this._buildContent(),this._contentDomNode.domNode.focus())}_descriptionForCommand(e,t,i){let s=this._keybindingService.lookupKeybinding(e);return s?ha(t,s.getAriaLabel()):ha(i,e)}_buildContent(){const e=this._editor.getOptions(),t=this._editor.getSelections();let i=0;if(t){const a=this._editor.getModel();a&&t.forEach(c=>{i+=a.getValueLengthInRange(c)})}let s=dVt(t,i);e.get(53)?e.get(80)?s+=Er.readonlyDiffEditor:s+=Er.editableDiffEditor:e.get(80)?s+=Er.readonlyEditor:s+=Er.editableEditor;const o=ki?Er.changeConfigToOnMac:Er.changeConfigToOnWinLinux;switch(e.get(2)){case 0:s+=`
- - `+o;break;case 2:s+=`
- - `+Er.auto_on;break;case 1:s+=`
- - `+Er.auto_off,s+=" "+o;break}e.get(128)?s+=`
- - `+this._descriptionForCommand(WR.ID,Er.tabFocusModeOnMsg,Er.tabFocusModeOnMsgNoKb):s+=`
- - `+this._descriptionForCommand(WR.ID,Er.tabFocusModeOffMsg,Er.tabFocusModeOffMsgNoKb);const r=ki?Er.openDocMac:Er.openDocWinLinux;s+=`
- - `+r,s+=`
- `+Er.outroMsg,this._contentDomNode.domNode.appendChild(yRe(s)),this._contentDomNode.domNode.setAttribute("aria-label",s)}hide(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,wl(this._contentDomNode.domNode),this._editor.focus())}_layout(){let e=this._editor.getLayoutInfo(),t=Math.max(5,Math.min(L4.WIDTH,e.width-40)),i=Math.max(5,Math.min(L4.HEIGHT,e.height-40));this._domNode.setWidth(t),this._domNode.setHeight(i);let s=Math.round((e.height-i)/2);this._domNode.setTop(s);let o=Math.round((e.width-t)/2);this._domNode.setLeft(o)}};GR.ID="editor.contrib.accessibilityHelpWidget";GR.WIDTH=500;GR.HEIGHT=300;GR=TAe([I4(1,ai),I4(2,Ro),I4(3,np)],GR);class hVt extends yn{constructor(){super({id:"editor.action.showAccessibilityHelp",label:Er.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){let i=Ew.get(t);i&&i.show()}}_s(Ew.ID,Ew);qt(hVt);const fVt=jl.bindToContribution(Ew.get);Xt(new fVt({id:"closeAccessibilityHelp",precondition:CAe,handler:n=>n.hide(),kbOpts:{weight:200,kbExpr:We.focus,primary:9,secondary:[1033]}}));ws((n,e)=>{const t=n.getColor(Od);t&&e.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${t}; }`);const i=n.getColor(Jv);i&&e.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${i}; }`);const s=n.getColor(dy);s&&e.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${s}; }`);const o=n.getColor(_r);o&&e.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${o}; }`)});class cZ extends wt{constructor(e){super(),this.editor=e,this.widget=null,Xm&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(80);!this.widget&&e?this.widget=new LG(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}cZ.ID="editor.contrib.iPadShowKeyboard";class LG extends wt{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(Pt(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(Pt(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return LG.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}LG.ID="editor.contrib.ShowKeyboardWidget";_s(cZ.ID,cZ);var gVt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Vme=function(n,e){return function(t,i){e(t,i,n)}};let zR=class EAe extends wt{constructor(e,t,i){super(),this._editor=e,this._modeService=i,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register($o.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}static get(e){return e.getContribution(EAe.ID)}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new OG(this._editor,this._modeService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};zR.ID="editor.contrib.inspectTokens";zR=gVt([Vme(1,Kw),Vme(2,Ga)],zR);class pVt extends yn{constructor(){super({id:"editor.action.inspectTokens",label:Vq.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){let i=zR.get(t);i&&i.launch()}}function mVt(n){let e="";for(let t=0,i=n.length;t<i;t++){let s=n.charCodeAt(t);switch(s){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(s)}}return e}function _Vt(n,e){const t=$o.get(e);if(t)return t;const i=n.encodeLanguageId(e);return{getInitialState:()=>CF,tokenize:(s,o,r,a)=>CLe(e,s,r,a),tokenize2:(s,o,r,a)=>Wne(i,s,r,a)}}class OG extends wt{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._modeService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=_Vt(this._modeService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return OG._ID}_compute(e){let t=this._getTokensAtLine(e.lineNumber),i=0;for(let c=t.tokens1.length-1;c>=0;c--){let u=t.tokens1[c];if(e.column-1>=u.offset){i=c;break}}let s=0;for(let c=t.tokens2.length>>>1;c>=0;c--)if(e.column-1>=t.tokens2[c<<1]){s=c;break}let o=this._model.getLineContent(e.lineNumber),r="";if(i<t.tokens1.length){let c=t.tokens1[i].offset,u=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;r=o.substring(c,u)}oy(this._domNode,Vt("h2.tm-token",void 0,mVt(r),Vt("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),Nt(this._domNode,Vt("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(s<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(s<<1)+1]):null;Nt(this._domNode,Vt("table.tm-metadata-table",void 0,Vt("tbody",void 0,Vt("tr",void 0,Vt("td.tm-metadata-key",void 0,"language"),Vt("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Vt("tr",void 0,Vt("td.tm-metadata-key",void 0,"token type"),Vt("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Vt("tr",void 0,Vt("td.tm-metadata-key",void 0,"font style"),Vt("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Vt("tr",void 0,Vt("td.tm-metadata-key",void 0,"foreground"),Vt("td.tm-metadata-value",void 0,`${a?mt.Format.CSS.formatHex(a.foreground):"-?-"}`)),Vt("tr",void 0,Vt("td.tm-metadata-key",void 0,"background"),Vt("td.tm-metadata-value",void 0,`${a?mt.Format.CSS.formatHex(a.background):"-?-"}`))))),Nt(this._domNode,Vt("hr.tokens-inspect-separator")),i<t.tokens1.length&&Nt(this._domNode,Vt("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){let t=$o.getColorMap(),i=Ba.getLanguageId(e),s=Ba.getTokenType(e),o=Ba.getFontStyle(e),r=Ba.getForeground(e),a=Ba.getBackground(e);return{languageId:this._modeService.languageIdCodec.decodeLanguageId(i),tokenType:s,fontStyle:o,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 4:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),t.length===0&&(t="---"),t}_getTokensAtLine(e){let t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t,0),s=this._tokenizationSupport.tokenize2(this._model.getLineContent(e),!0,t,0);return{startState:t,tokens1:i.tokens,tokens2:s.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t,0).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}OG._ID="editor.contrib.inspectTokensWidget";_s(zR.ID,zR);qt(pVt);ws((n,e)=>{const t=n.getColor(Nie);if(t){let o=n.type===bh.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .tokens-inspect-widget { border: ${o}px solid ${t}; }`),e.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${t}; }`)}const i=n.getColor(tw);i&&e.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${i}; }`);const s=n.getColor(Aie);s&&e.addRule(`.monaco-editor .tokens-inspect-widget { color: ${s}; }`)});var vVt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bVt=function(n,e){return function(t,i){e(t,i,n)}};let C5=class O4{constructor(e){this.quickInputService=e,this.registry=br.as(qw.Quickaccess)}provide(e){const t=new Wt;t.add(e.onDidAccept(()=>{const[o]=e.selectedItems;o&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(o=>{const r=this.registry.getQuickAccessProvider(o.substr(O4.PREFIX.length));r&&r.prefix&&r.prefix!==O4.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})}));const{editorProviders:i,globalProviders:s}=this.getQuickAccessProviders();return e.items=i.length===0||s.length===0?[...i.length===0?s:i]:[{label:$("globalCommands","global commands"),type:"separator"},...s,{label:$("editorCommands","editor commands"),type:"separator"},...i],t}getQuickAccessProviders(){const e=[],t=[];for(const i of this.registry.getQuickAccessProviders().sort((s,o)=>s.prefix.localeCompare(o.prefix)))if(i.prefix!==O4.PREFIX)for(const s of i.helpEntries){const o=s.prefix||i.prefix,r=o||"…";(s.needsEditor?t:e).push({prefix:o,label:r,ariaLabel:$("helpPickAriaLabel","{0}, {1}",r,s.description),description:s.description})}return{editorProviders:t,globalProviders:e}}};C5.PREFIX="?";C5=vVt([bVt(0,Wy)],C5);br.as(qw.Quickaccess).registerQuickAccessProvider({ctor:C5,prefix:"",helpEntries:[{description:Uq.helpQuickAccessActionLabel,needsEditor:!0}]});class SAe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const s=new Wt;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new pc);return o.value=this.doProvide(e,t),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t){const i=new Wt,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const o={editor:s},r=YLe(s);if(r){let a=yd(s.saveViewState());i.add(r.onDidChangeCursorPosition(()=>{a=yd(s.saveViewState())})),o.restoreViewState=()=>{a&&s===this.activeTextEditorControl&&s.restoreViewState(a)},i.add(ub(t.onCancellationRequested)(()=>{var c;return(c=o.restoreViewState)===null||c===void 0?void 0:c.call(o)}))}i.add(xi(()=>this.clearDecorations(s))),i.add(this.provideWithTextEditor(o,e,t))}else i.add(this.provideWithoutTextEditor(e,t));return i}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus()}getModel(e){var t;return XLe(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:sr(hwt),position:Ad.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class RG extends SAe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=$("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,wt.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new Wt;o.add(t.onDidAccept(c=>{const[u]=t.selectedItems;if(u){if(!this.isValidLineNumber(s,u.lineNumber))return;this.gotoLocation(e,{range:this.toRange(u.lineNumber,u.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=this.parsePosition(s,t.value.trim().substr(RG.PREFIX.length)),u=this.getPickLabel(s,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:u}],t.ariaLabel=u,!this.isValidLineNumber(s,c.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(c.lineNumber,c.column);s.revealRangeInCenter(d,0),this.addDecorations(s,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=YLe(s);return a&&a.getOptions().get(59).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(xi(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?$("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):$("gotoLineLabel","Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?$("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):$("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:t,column:i};return s.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}RG.PREFIX=":";var TVt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},CVt=function(n,e){return function(t,i){e(t,i,n)}};let kP=class extends RG{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Ln.None}get activeTextEditorControl(){return yd(this.editorService.getFocusedCodeEditor())}};kP=TVt([CVt(0,hs)],kP);br.as(qw.Quickaccess).registerQuickAccessProvider({ctor:kP,prefix:kP.PREFIX,helpEntries:[{description:b3.gotoLineActionLabel,needsEditor:!0}]});let yVt=class extends yn{constructor(){super({id:"editor.action.gotoLine",label:b3.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Wy).quickAccess.show(kP.PREFIX)}};qt(yVt);const wAe=[void 0,[]];function IK(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?EVt(n,s.values,t,i):IAe(n,e,t,i)}function EVt(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,c]=IAe(n,r,t,i);if(typeof a!="number")return wAe;s+=a,o.push(...c)}return[s,SVt(o)]}function IAe(n,e,t,i){const s=OR(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,!0);return s?[s[0],A6(s)]:wAe}function SVt(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!wVt(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function wVt(n,e){return!(n.end<e.start||e.end<n.start)}function Ume(n){return n.startsWith('"')&&n.endsWith('"')}const LAe=" ";function uZ(n){typeof n!="string"&&(n="");const e=n.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:s}=Wme(n),o=t.indexOf(h0)>=0,r=Ume(n);let a;const c=n.split(LAe);if(c.length>1)for(const u of c){const d=Ume(u),{pathNormalized:f,normalized:g,normalizedLowercase:p}=Wme(u);g&&(a||(a=[]),a.push({original:u,originalLowercase:u.toLowerCase(),pathNormalized:f,normalized:g,normalizedLowercase:p,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function Wme(n){let e;zl?e=n.replace(/\//g,h0):e=n.replace(/\\/g,h0);const t=Qvt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Gme(n){return Array.isArray(n)?uZ(n.map(e=>e.original).join(LAe)):uZ(n.original)}var YN=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};class Eh extends SAe{constructor(e=Object.create(null)){super(e),this.options=e,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,$("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),wt.None}provideWithTextEditor(e,t,i){const s=e.editor,o=this.getModel(s);return o?kf.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):wt.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new Wt;return this.provideLabelPick(i,$("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),YN(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return YN(this,void 0,void 0,function*(){if(kf.has(e))return!0;let i;const s=new Promise(r=>i=r),o=t.add(kf.onDidChange(()=>{kf.has(e)&&(o.dispose(),i(!0))}));return t.add(xi(()=>i(!1))),s})}doProvideWithEditorSymbols(e,t,i,s){const o=e.editor,r=new Wt;r.add(i.onDidAccept(f=>{const[g]=i.selectedItems;g&&g.range&&(this.gotoLocation(e,{range:g.range.selection,keyMods:i.keyMods,preserveFocus:f.inBackground}),f.inBackground||i.hide())})),r.add(i.onDidTriggerItemButton(({item:f})=>{f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const a=this.getDocumentSymbols(t,s);let c;const u=()=>YN(this,void 0,void 0,function*(){c==null||c.dispose(!0),i.busy=!1,c=new dc(s),i.busy=!0;try{const f=uZ(i.value.substr(Eh.PREFIX.length).trim()),g=yield this.doGetSymbolPicks(a,f,void 0,c.token);if(s.isCancellationRequested)return;g.length>0?i.items=g:f.original.length>0?this.provideLabelPick(i,$("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,$("noSymbolResults","No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}});r.add(i.onDidChangeValue(()=>u())),u();let d=!0;return r.add(i.onDidChangeActive(()=>{const[f]=i.activeItems;if(f&&f.range){if(d){d=!1;return}o.revealRangeInCenter(f.range.selection,0),this.addDecorations(o,f.range.decoration)}})),r}doGetSymbolPicks(e,t,i,s){return YN(this,void 0,void 0,function*(){const o=yield e;if(s.isCancellationRequested)return[];const r=t.original.indexOf(Eh.SCOPE_PREFIX)===0,a=r?1:0;let c,u;t.values&&t.values.length>1?(c=Gme(t.values[0]),u=Gme(t.values.slice(1))):c=t;const d=[];for(let p=0;p<o.length;p++){const _=o[p],v=qvt(_.name),C=`$(symbol-${Lq.toString(_.kind)||"property"}) ${v}`,y=C.length-v.length;let w=_.containerName;i!=null&&i.extraContainerLabel&&(w?w=`${i.extraContainerLabel} • ${w}`:w=i.extraContainerLabel);let I,L,O,A;if(t.original.length>a){let D=!1;if(c!==t&&([I,L]=IK(C,Object.assign(Object.assign({},t),{values:void 0}),a,y),typeof I=="number"&&(D=!0)),typeof I!="number"&&([I,L]=IK(C,c,a,y),typeof I!="number"))continue;if(!D&&u){if(w&&u.original.length>0&&([O,A]=IK(w,u)),typeof O!="number")continue;typeof I=="number"&&(I+=O)}}const N=_.tags&&_.tags.indexOf(1)>=0;d.push({index:p,kind:_.kind,score:I,label:C,ariaLabel:v,description:w,highlights:N?void 0:{label:L,description:A},range:{selection:be.collapseToStart(_.selectionRange),decoration:_.range},strikethrough:N,buttons:(()=>{var D,P;const F=!((D=this.options)===null||D===void 0)&&D.openSideBySideDirection?(P=this.options)===null||P===void 0?void 0:P.openSideBySideDirection():void 0;if(F)return[{iconClass:F==="right"?vn.splitHorizontal.classNames:vn.splitVertical.classNames,tooltip:F==="right"?$("openToSide","Open to the Side"):$("openToBottom","Open to the Bottom")}]})()})}const f=d.sort((p,_)=>r?this.compareByKindAndScore(p,_):this.compareByScore(p,_));let g=[];if(r){let C=function(){_&&typeof p=="number"&&v>0&&(_.label=ha(OK[p]||LK,v))},p,_,v=0;for(const y of f)p!==y.kind?(C(),p=y.kind,v=1,_={type:"separator"},g.push(_)):v++,g.push(y);C()}else f.length>0&&(g=[{label:$("symbols","symbols ({0})",d.length),type:"separator"},...f]);return g})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=OK[e.kind]||LK,s=OK[t.kind]||LK,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return YN(this,void 0,void 0,function*(){const i=yield ec.create(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}}Eh.PREFIX="@";Eh.SCOPE_PREFIX=":";Eh.PREFIX_BY_CATEGORY=`${Eh.PREFIX}${Eh.SCOPE_PREFIX}`;const LK=$("property","properties ({0})"),OK={5:$("method","methods ({0})"),11:$("function","functions ({0})"),8:$("_constructor","constructors ({0})"),12:$("variable","variables ({0})"),4:$("class","classes ({0})"),22:$("struct","structs ({0})"),23:$("event","events ({0})"),24:$("operator","operators ({0})"),10:$("interface","interfaces ({0})"),2:$("namespace","namespaces ({0})"),3:$("package","packages ({0})"),25:$("typeParameter","type parameters ({0})"),1:$("modules","modules ({0})"),6:$("property","properties ({0})"),9:$("enum","enumerations ({0})"),21:$("enumMember","enumeration members ({0})"),14:$("string","strings ({0})"),0:$("file","files ({0})"),17:$("array","arrays ({0})"),15:$("number","numbers ({0})"),16:$("boolean","booleans ({0})"),18:$("object","objects ({0})"),19:$("key","keys ({0})"),7:$("field","fields ({0})"),13:$("constant","constants ({0})")};var IVt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},LVt=function(n,e){return function(t,i){e(t,i,n)}};let dZ=class extends Eh{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Ln.None}get activeTextEditorControl(){return yd(this.editorService.getFocusedCodeEditor())}};dZ=IVt([LVt(0,hs)],dZ);br.as(qw.Quickaccess).registerQuickAccessProvider({ctor:dZ,prefix:Eh.PREFIX,helpEntries:[{description:Nx.quickOutlineActionLabel,prefix:Eh.PREFIX,needsEditor:!0},{description:Nx.quickOutlineByCategoryActionLabel,prefix:Eh.PREFIX_BY_CATEGORY,needsEditor:!0}]});let OVt=class extends yn{constructor(){super({id:"editor.action.quickOutline",label:Nx.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:We.hasDocumentSymbolProvider,kbOpts:{kbExpr:We.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Wy).quickAccess.show(Eh.PREFIX)}};qt(OVt);function RK(n,e){return e&&(n.stack||n.stacktrace)?$("stackTrace.format","{0}: {1}",Kme(n),zme(n.stack)||zme(n.stacktrace)):Kme(n)}function zme(n){return Array.isArray(n)?n.join(`
- `):n}function Kme(n){return typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?$("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||$("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function OAe(n=null,e=!1){if(!n)return $("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=Bw(n),i=OAe(t[0],e);return t.length>1?$("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Yf(n))return n;if(n.detail){const t=n.detail;if(t.error)return RK(t.error,e);if(t.exception)return RK(t.exception,e)}return n.stack?RK(n,e):n.message?n.message:$("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var HV=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})},Q1;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(Q1||(Q1={}));function MK(n){const e=n;return Array.isArray(e.items)}function RVt(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class MG extends wt{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t){var i;const s=new Wt;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=s.add(new pc),a=()=>HV(this,void 0,void 0,function*(){const c=r.value=new Wt;o==null||o.dispose(!0),e.busy=!1,o=new dc(t);const u=o.token,d=e.value.substr(this.prefix.length).trim(),f=this._getPicks(d,c,u),g=(p,_)=>{var v;let C,y;if(MK(p)?(C=p.items,y=p.active):C=p,C.length===0){if(_)return!1;d.length>0&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(C=[this.options.noResultsPick])}return e.items=C,y&&(e.activeItems=[y]),!0};if(f!==null)if(RVt(f)){let p=!1,_=!1;yield Promise.all([HV(this,void 0,void 0,function*(){yield sy(MG.FAST_PICKS_RACE_DELAY),!u.isCancellationRequested&&(_||(p=g(f.picks,!0)))}),HV(this,void 0,void 0,function*(){e.busy=!0;try{const v=yield f.additionalPicks;if(u.isCancellationRequested)return;let C,y;MK(f.picks)?(C=f.picks.items,y=f.picks.active):C=f.picks;let w,I;if(MK(v)?(w=v.items,I=v.active):w=v,w.length>0||!p){let L;if(!y&&!I){const O=e.activeItems[0];O&&C.indexOf(O)!==-1&&(L=O)}g({items:[...C,...w],active:y||I||L})}}finally{u.isCancellationRequested||(e.busy=!1),_=!0}})])}else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const p=yield f;if(u.isCancellationRequested)return;g(p)}finally{u.isCancellationRequested||(e.busy=!1)}}});return s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),s.add(e.onDidTriggerItemButton(({button:c,item:u})=>HV(this,void 0,void 0,function*(){var d,f;if(typeof u.trigger=="function"){const g=(f=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&f!==void 0?f:-1;if(g>=0){const p=u.trigger(g,e.keyMods),_=typeof p=="number"?p:yield p;if(t.isCancellationRequested)return;switch(_){case Q1.NO_ACTION:break;case Q1.CLOSE_PICKER:e.hide();break;case Q1.REFRESH_PICKER:a();break;case Q1.REMOVE_ITEM:const v=e.items.indexOf(u);if(v!==-1){const C=e.items.slice(),y=C.splice(v,1),w=e.activeItems.filter(L=>L!==y[0]),I=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=C,w&&(e.activeItems=w),e.keepScrollPosition=I}break}}}}))),s}}MG.FAST_PICKS_RACE_DELAY=200;var RAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},PS=function(n,e){return function(t,i){e(t,i,n)}},jme=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let AP=class R4 extends MG{constructor(e,t,i,s,o,r){super(R4.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(Sw)),this.options=e}_getPicks(e,t,i){return jme(this,void 0,void 0,function*(){const s=yield this.getCommandPicks(t,i);if(i.isCancellationRequested)return[];const o=[];for(const u of s){const d=yd(R4.WORD_FILTER(e,u.label)),f=u.commandAlias?yd(R4.WORD_FILTER(e,u.commandAlias)):void 0;d||f?(u.highlights={label:d,detail:this.options.showAlias?f:void 0},o.push(u)):e===u.commandId&&o.push(u)}const r=new Map;for(const u of o){const d=r.get(u.label);d?(u.description=u.commandId,d.description=d.commandId):r.set(u.label,u)}o.sort((u,d)=>{const f=this.commandsHistory.peek(u.commandId),g=this.commandsHistory.peek(d.commandId);return f&&g?f>g?-1:1:f?-1:g?1:u.label.localeCompare(d.label)});const a=[];let c=!1;for(let u=0;u<o.length;u++){const d=o[u],f=this.keybindingService.lookupKeybinding(d.commandId),g=f?$("commandPickAriaLabelWithKeybinding","{0}, {1}",d.label,f.getAriaLabel()):d.label;u===0&&this.commandsHistory.peek(d.commandId)&&(a.push({type:"separator",label:$("recentlyUsed","recently used")}),c=!0),u!==0&&c&&!this.commandsHistory.peek(d.commandId)&&(a.push({type:"separator",label:$("morecCommands","other commands")}),c=!1),a.push(Object.assign(Object.assign({},d),{ariaLabel:g,detail:this.options.showAlias&&d.commandAlias!==d.label?d.commandAlias:void 0,keybinding:f,accept:()=>jme(this,void 0,void 0,function*(){this.commandsHistory.push(d.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"quick open"});try{yield this.commandService.executeCommand(d.commandId)}catch(p){d_(p)||this.dialogService.show(Go.Error,$("canNotRun","Command '{0}' resulted in an error ({1})",d.label,OAe(p)))}})}))}return a})}};AP.PREFIX=">";AP.WORD_FILTER=rse(M6,zOt,HOe);AP=RAe([PS(1,Qi),PS(2,Ro),PS(3,vr),PS(4,By),PS(5,AF)],AP);let Sw=class nl extends wt{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(()=>this.updateConfiguration()))}updateConfiguration(){this.configuredCommandsHistoryLength=nl.getConfiguredCommandHistoryLength(this.configurationService),nl.cache&&nl.cache.limit!==this.configuredCommandsHistoryLength&&(nl.cache.limit=this.configuredCommandsHistoryLength,nl.saveState(this.storageService))}load(){const e=this.storageService.get(nl.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=nl.cache=new Py(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}nl.counter=this.storageService.getNumber(nl.PREF_KEY_COUNTER,0,nl.counter)}push(e){nl.cache&&(nl.cache.set(e,nl.counter++),nl.saveState(this.storageService))}peek(e){var t;return(t=nl.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!nl.cache)return;const t={usesLRU:!0,entries:[]};nl.cache.forEach((i,s)=>t.entries.push({key:s,value:i})),e.store(nl.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(nl.PREF_KEY_COUNTER,nl.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:nl.DEFAULT_COMMANDS_HISTORY_LENGTH}};Sw.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Sw.PREF_KEY_CACHE="commandPalette.mru.cache";Sw.PREF_KEY_COUNTER="commandPalette.mru.counter";Sw.counter=1;Sw=RAe([PS(0,m_),PS(1,Yo)],Sw);class MVt extends AP{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:YOe(i.label)||i.id});return t}}var kVt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},m1=function(n,e){return function(t,i){e(t,i,n)}},AVt=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{u(i.next(d))}catch(f){r(f)}}function c(d){try{u(i.throw(d))}catch(f){r(f)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((i=i.apply(n,e||[])).next())})};let NP=class extends MVt{constructor(e,t,i,s,o,r){super({showAlias:!1},e,i,s,o,r),this.codeEditorService=t}get activeTextEditorControl(){return yd(this.codeEditorService.getFocusedCodeEditor())}getCommandPicks(){return AVt(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}};NP=kVt([m1(0,Qi),m1(1,hs),m1(2,Ro),m1(3,vr),m1(4,By),m1(5,AF)],NP);br.as(qw.Quickaccess).registerQuickAccessProvider({ctor:NP,prefix:NP.PREFIX,helpEntries:[{description:T3.quickCommandHelp,needsEditor:!0}]});class NVt extends yn{constructor(){super({id:"editor.action.quickCommand",label:T3.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:We.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Wy).quickAccess.show(NP.PREFIX)}}qt(NVt);var DVt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_1=function(n,e){return function(t,i){e(t,i,n)}};let hZ=class extends vy{constructor(e,t,i,s,o,r,a){super(!0,e,t,i,s,o,r,a)}};hZ=DVt([_1(1,ai),_1(2,hs),_1(3,Hr),_1(4,Qi),_1(5,m_),_1(6,Yo)],hZ);_s(vy.ID,hZ);class $Vt extends yn{constructor(){super({id:"editor.action.toggleHighContrast",label:Wq.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Kw);this._originalThemeName?(i.setTheme(this._originalThemeName),this._originalThemeName=null):(this._originalThemeName=i.getColorTheme().themeName,i.setTheme("hc-black"))}}qt($Vt);const xVt={__name:"monacoEditor",props:{pythonCode:{type:String,require:!0,default:""},codeMirrorShow:{type:Boolean,require:!0,default:!0}},setup(n){const e=us(null),t=te(null),i=Yc.useyPythonCodeStore(),s=n;$n(()=>{o()});const o=()=>{e.value=PAt.create(t.value,{theme:"dark",value:s.pythonCode,language:"python",folding:!0,foldingHighlight:!0,foldingStrategy:"auto",showFoldingControls:"always",disableLayerHinting:!0,emptySelectionClipboard:!1,selectionClipboard:!1,automaticLayout:!0,codeLens:!1,scrollBeyondLastLine:!1,colorDecorators:!0,accessibilitySupport:"auto",lineNumbers:"on",lineNumbersMinChars:5,enableSplitViewResizing:!1,readOnly:s.codeShow,minimap:{enabled:!1}}),e.value.onDidChangeModelContent(()=>{i.pythonCode=e.value.getValue()})};return ht(()=>[s.pythonCode,s.codeMirrorShow],([r,a])=>{e.value&&(e.value.setValue(r),e.value.updateOptions({readOnly:a}))}),(r,a)=>(G(),he("div",{class:"monacoCode",ref_key:"main",ref:t},null,512))}},PVt={style:{height:"100%"}},FVt={style:{height:"100%"}},BVt={style:{height:"calc(100% - 230px)","overflow-y":"hidden"}},HVt={style:{height:"230px"}},VVt={__name:"BlocklyComponent",setup(n){const e=us(null),t=te(""),i=te(!0),s=Yc.useyXmlStore(),o=Yc.useyPythonCodeStore(),r=Yc.useLoadBlocklyStatus(),a=te(!0),c=te(null);$n(()=>{let y=oxe;localStorage.getItem("lang")=="en"?y=lxe:localStorage.getItem("lang")=="zhHant"&&(y=rxe),c.value=y;let w=ra.utils.xml.textToDom(axe.xml);for(var I=w.getElementsByTagName("category"),L=0,O;O=I[L];L++){var A=O.getAttribute("id"),N=c.value[A]||A;N&&O.setAttribute("name",N)}g(w),localStorage.getItem("workspaceXml")&&C()});const u=y=>{a.value=y,t.value=o.pythonCode},d=y=>{i.value=!y},f=y=>{t.value=y},g=y=>{ra.Blocks=bxe.Blocks,ra.Python=Txe.Python,ra.setLocale(c.value),e.value=ra.inject("blocklyDiv",{toolbox:y,theme:Cxe,collapse:!0,comments:!0,css:!0,disable:!0,grid:!1,maxBlocks:1/0,rtl:!1,scrollbars:!0,sounds:!0,trashcan:!0,zoom:{controls:!0,wheel:!1,startScale:1,maxScale:2,minScale:.2,scaleSpeed:1.2}}),e.value.addChangeListener(p),window.blockly=e.value,window.Blockly=ra},p=y=>{(y.type==ra.Events.BLOCK_DRAG||y.type=="viewport_change")&&v(),_()},_=()=>{let y=ra.Python.workspaceToCode(e.value);var w=ra.Xml.domToText(ra.Xml.workspaceToDom(e.value));t.value=y,o.$patch({pythonCode:y}),s.$patch({xmlStr:w})},v=()=>{var y=ra.Xml.domToText(ra.Xml.workspaceToDom(e.value));localStorage.setItem("workspaceXml",y)},C=()=>{let y=localStorage.getItem("workspaceXml");y&&ra.Xml.domToWorkspace(ra.utils.xml.textToDom(y),e.value)};return Sl(()=>{r.status&&(e.value.clear(),ra.Xml.domToWorkspace(ra.utils.xml.textToDom(s.xmlStr),e.value))}),(y,w)=>{const I=Bt("el-col"),L=Bt("el-row");return G(),he("div",PVt,[ce(L,{style:{height:"100%"}},{default:_e(()=>[ce(I,{xl:16,lg:16,md:16,xs:24},{default:_e(()=>w[0]||(w[0]=[oe("div",{id:"blocklyDiv",style:{height:"100%",width:"100%"}},null,-1)])),_:1}),ce(I,{xl:8,lg:8,md:8,xs:24},{default:_e(()=>[oe("div",FVt,[oe("div",BVt,[ce(jmt,{onGetSwitchs:u,onGetCodemirror:d,onGetPythonCode:f}),a.value?(G(),nt(xVt,{key:0,pythonCode:t.value,codeMirrorShow:i.value},null,8,["pythonCode","codeMirrorShow"])):(G(),nt(Jmt,{key:1}))]),oe("div",HVt,[ce(xmt)])])]),_:1})]),_:1})])}}},UVt=Oh(VVt,[["__scopeId","data-v-9a85887d"]]),WVt="/assets/logo1-DEiYbowd.png",MAe=(n,e)=>{let t=new Blob([n],{type:"text/plain;charset=utf-8"});const i=window.URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(i)},AO=Sb("user",()=>{const n=te({});return{userInfo:n,setUserInfo:t=>{n.value=t}}}),GVt={class:"headerLeft"},zVt=["src"],KVt={__name:"headerLeft",props:{exportImportFileName:{type:String,require:!0,default:""}},emits:["setFileName"],setup(n,{emit:e}){const{t}=Jf(),i=n,s=e,o=te(i.exportImportFileName),r=Yc.useyXmlStore(),a=AO(),c=Yc.useLoadBlocklyStatus(),u=()=>{console.log(o.value,r.xmlStr),r.xmlStr&&r.xmlStr!='<xml xmlns="https://developers.google.com/blockly/xml"></xml>'?MAe(r.xmlStr,o.value+".xml"):po({message:t("message.export_content_empty"),type:"warning"})},d=()=>{if(JSON.stringify(a.userInfo)!="{}"){let _={filename:o.value,xml:r.xmlStr};Os.defaults.withCredentials=!0,Os.post("https://api.cocorobo.cn/blockx/",_).then(v=>{if(console.log(v),v.data&&v.data.filename){let C=location.href+"&Qd="+v.data.filename;navigator.clipboard.writeText(C).then(()=>{po({message:t("message.link_copy"),type:"success"})}).catch(y=>{po({message:t("message.link_copy_error"),type:"warning"}),console.error("复制到剪贴板失败: ",y)})}})}else po({message:t("message.please_login"),type:"warning"})},f=()=>{r.$patch({xmlStr:'<xml xmlns="https://developers.google.com/blockly/xml"></xml>'}),c.$patch({status:!0}),localStorage.setItem("workspaceXml",'<xml xmlns="https://developers.google.com/blockly/xml"></xml>'),setTimeout(()=>{c.$patch({status:!1})},100)},g=async()=>{console.log("保存当前积木图片");let _=window.blockly.svgBlockCanvas_.cloneNode(!0);_.removeAttribute("width"),_.removeAttribute("height"),_.removeAttribute("transform");let v=document.createElementNS("http://www.w3.org/2000/svg","style");v.textContent=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 100;","}",".injectionDiv {","height: 100%;","position: relative;","}",".blocklyNonSelectable {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","-ms-user-select: none;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: 0.9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #888;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyText {","cursor: default;","fill: #fff;","font-family: sans-serif;","font-size: 11pt;","}",".blocklyTextCode {"," font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {","fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyoutButton {","fill: #888;","cursor: default;","}",".blocklyFlyoutButtonShadow {","fill: #666;","}",".blocklyFlyoutButton:hover {","fill: #aaa;","}",".blocklyFlyoutLabel {","cursor: default;","}",".blocklyFlyoutLabelBackground {","opacity: 0;","}",".blocklyFlyoutLabelText {","fill: #000;","}",".blocklyFlyoutLabelText:hover {","fill: #aaa;","}",".blocklySvg text {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyCommentTextarea {","background-color: #ffc;","border: 0;","margin: 0;","padding: 2px;","resize: none;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;","padding: 0 1px;","width: 100%","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyZoom>image {","opacity: .4;","}",".blocklyZoom>image:hover {","opacity: .6;","}",".blocklyZoom>image:active {","opacity: .8;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyAngleCircle {","stroke: #444;","stroke-width: 1;","fill: #ddd;","fill-opacity: .8;","}",".blocklyAngleMarks {","stroke: #444;","stroke-width: 1;","}",".blocklyAngleGauge {","fill: #f88;","fill-opacity: .8;","}",".blocklyAngleLine {","stroke: #f00;","stroke-width: 2;","stroke-linecap: round;","}",".blocklyContextMenu {","border-radius: 4px;","}",".blocklyDropdownMenu {","padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px !important;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {","height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;","}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<<PATH>>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0px -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {","background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}",".blocklyWidgetDiv .goog-palette {","outline: none;","cursor: default;","}",".blocklyWidgetDiv .goog-palette-table {","border: 1px solid #666;","border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {","height: 13px;","width: 15px;","margin: 0;","border: 0;","text-align: center;","vertical-align: middle;","border-right: 1px solid #666;","font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {","position: relative;","height: 13px;","width: 15px;","border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {","border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {","border: 1px solid #000;","color: #fff;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;","border-color: #ccc #666 #666 #ccc;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 50%;","z-index: 100;","}",".blocklyWidgetDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","padding: 4px 7em 4px 28px;","white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {","padding-left: 7em;","padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {","padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {","padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {","color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: 0.3;","-moz-opacity: 0.3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {","background-color: #d6e9f8;","border-color: #d6e9f8;","border-style: dotted;","border-width: 1px 0;","padding-bottom: 3px;","padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {","background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {","color: #999;","direction: ltr;","left: auto;","padding: 0 6px;","position: absolute;","right: 0;","text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {","left: 0;","right: auto;","text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {","text-decoration: underline;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {","color: #999;","font-size: 12px;","padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {","border-top: 1px solid #ccc;","margin: 4px 0;","padding: 0;","}",""].join(""),_.insertBefore(v,_.firstChild);let C=window.blockly.svgBlockCanvas_.getBBox(),y=document.createElement("canvas");y.width=Math.ceil(Math.abs(C.x)+C.width+120),y.height=Math.ceil(Math.abs(C.y)+C.height+50),y.appendChild(_),y.appendChild(_);let w=y.getContext("2d"),I=new XMLSerializer().serializeToString(_),L=/xlink:href="blockly\/([^\s]*)"/g,O=I.match(L);console.log(O),O!=null&&await function(){return new Promise(D=>{let P=O.length,F=0;for(let U=0;U<P;U++){let Q,de=document.createElement("canvas"),q=de.getContext("2d"),K=new Image;K.setAttribute("src",O[U].replace('xlink:href="',_href).replace('"',"")),K.onload=function(){de.width=K.width,de.height=K.height,q.drawImage(K,0,0),Q=de.toDataURL("image/png",1),I=I.replace(O[U],'xlink:href="'+Q+'"'),F++}}let V=setInterval(()=>{if(F==P)return clearInterval(V),D(!0)})})}(),I='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background-color:#FFF" width="'+y.width+'" height="'+y.height+'" viewBox="'+(C.x-50)+" "+(C.y-50)+" "+y.width+" "+y.height+'"><rect width="100%" height="100%" fill="white"></rect>'+I+"</svg>";var A=new Image;A.setAttribute("src","data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(I)))),A.onload=function(){w.drawImage(A,5,5);var N=y.toDataURL("image/png",1),D=document.createElement("a");D.download=o.value+".png",D.href=N,document.body.appendChild(D),D.click()}},p=()=>{s("setFileName",o.value)};return Sl(()=>{i.exportImportFileName&&(o.value=i.exportImportFileName)}),(_,v)=>{const C=Bt("el-input"),y=Bt("el-button"),w=Bt("el-tooltip");return G(),he("div",GVt,[oe("img",{src:T(WVt)},null,8,zVt),ce(C,{modelValue:o.value,"onUpdate:modelValue":v[0]||(v[0]=I=>o.value=I),placeholder:"",onInput:v[1]||(v[1]=I=>p()),style:{"--el-input-width":"150px"}},null,8,["modelValue"]),ce(w,{content:_.$t("message.save")},{default:_e(()=>[ce(y,{round:"",onClick:v[2]||(v[2]=I=>u())},{default:_e(()=>[mn(st(_.$t("message.save")),1)]),_:1})]),_:1},8,["content"]),ce(w,{content:_.$t("message.share")},{default:_e(()=>[oe("i",{class:"material-icons",onClick:v[3]||(v[3]=I=>d())},"share")]),_:1},8,["content"]),ce(w,{content:_.$t("message.delete_all_blockly")},{default:_e(()=>[oe("i",{class:"material-icons",onClick:v[4]||(v[4]=I=>f())},"delete")]),_:1},8,["content"]),ce(w,{content:_.$t("message.screenshot")},{default:_e(()=>[oe("i",{class:"material-icons",onClick:v[5]||(v[5]=I=>g())},"photo_camera")]),_:1},8,["content"])])}}},jVt=Oh(KVt,[["__scopeId","data-v-79eb8b59"]]),Xme="/assets/user-D9i2ZrgT.png",XVt={style:{position:"relative"}},YVt={key:0,class:"user_login_style"},qVt=["src"],JVt={class:"user_name"},QVt={key:1,class:"user_login_style"},ZVt=["src"],eUt={class:"login_button"},tUt={class:"my-header"},nUt=["onClick"],iUt={key:0,class:"loginIframe"},sUt={key:1,class:"cloud"},oUt={class:"user_span_color"},rUt={class:"user_span_color"},lUt={class:"user_span_color"},aUt={class:"clearfix",style:{"margin-top":"20px"}},cUt={__name:"user",setup(n){const{t:e}=Jf(),t=AO(),i=te(!1),s=te(!1),o=te(""),r=te(""),a=te(""),c=te([]),u=te(""),d=te(""),f=te(""),g=te(""),p=te(!1);$n(()=>{p.value=window.location.host.indexOf("cocorobo.hk")>-1,window.addEventListener("message",function(w){w.data.id=="loginVerify"&&w.data.status==="logged"&&(i.value=!0,o.value=w.data.data.alias,r.value=w.data.data.username,a.value=w.data.data.defaultSchool,u.value=w.data.data.apiKey,t.setUserInfo(w.data.data),_(),po({message:e("message.login_success"),type:"success"}))})});const _=()=>{const w=p.value?`https://api.cocorobo.hk/iot/data/apikey/${u.value}/event/`:`https://api.cocorobo.cn/iot/data/apikey/${u.value}/event/`;Os.get(w).then(I=>{if(I.data.length>0){let L=[];I.data.map(O=>{let A={id:O.eventAPIKey,value:O.name,url:O.url};return L.push(A),O}),d.value=L[0].value,f.value=L[0].id,g.value=L[0].url,c.value=L}})},v=w=>{let I=c.value.filter(L=>L.value==w)[0];f.value=I.id,g.value=I.url},C=()=>{const w=p.value?"//cocorobo.hk/cloud":"//cocorobo.cn/cloud";window.open(w)},y=()=>{const w=p.value?"//api.cocorobo.hk/api/logout":"//api.cocorobo.cn/api/logout";Os.defaults.withCredentials=!0,Os.get(w).then(I=>{I.data=="logout"&&(i.value=!1,po({message:e("message.logout_success"),type:"success"}),t.setUserInfo({}))})};return(w,I)=>{const L=Bt("el-tooltip"),O=Bt("el-option"),A=Bt("el-select"),N=Bt("el-input"),D=Bt("el-button"),P=Bt("el-dialog");return G(),he("div",XVt,[oe("div",{class:"user",onClick:I[0]||(I[0]=F=>s.value=!0)},[I[8]||(I[8]=oe("iframe",{src:"//cocorobo.cn/login",frameborder:"0",scrolling:"no",style:{display:"none"}},null,-1)),i.value?(G(),he("div",YVt,[oe("img",{src:T(Xme),alt:""},null,8,qVt),oe("span",JVt,st(o.value),1)])):(G(),he("div",QVt,[oe("img",{src:T(Xme),alt:""},null,8,ZVt),oe("span",eUt,st(w.$t("message.login")),1)]))]),ce(P,{class:"loginModel",modelValue:s.value,"onUpdate:modelValue":I[7]||(I[7]=F=>s.value=F),title:"",width:"350px","show-close":!1},{header:_e(({close:F})=>[oe("div",tUt,[oe("i",{class:"material-icons right",style:{color:"#000","margin-top":"10px"},onClick:F},"close",8,nUt)])]),default:_e(()=>[i.value?(G(),he("div",sUt,[oe("h4",null,st(o.value),1),oe("p",null,[oe("span",oUt,st(w.$t("message.your_email")),1),mn(st(r.value),1)]),oe("p",null,[oe("span",rUt,st(w.$t("message.your_schoole")),1),mn(st(a.value),1)]),oe("div",null,[oe("p",null,[oe("span",lUt,st(w.$t("message.cloud_project")),1),ce(L,{class:"box-item",effect:"dark",content:w.$t("message.click_to_refresh"),placement:"bottom"},{default:_e(()=>[oe("i",{class:"material-icons cloud-icon right",onClick:I[1]||(I[1]=F=>_())},"autorenew")]),_:1},8,["content"])]),ce(A,{modelValue:d.value,"onUpdate:modelValue":I[2]||(I[2]=F=>d.value=F),onChange:v},{default:_e(()=>[(G(!0),he(Qt,null,fi(c.value,F=>(G(),nt(O,{key:F.id,value:F.value},{default:_e(()=>[mn(st(F.value),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),oe("p",null,[I[10]||(I[10]=oe("span",{class:"user_span_color"},"API key:",-1)),ce(L,{class:"box-item",effect:"dark",content:w.$t("message.copy_apiKey"),placement:"bottom"},{default:_e(()=>[oe("i",{class:"material-icons cloud-icon right",onClick:I[3]||(I[3]=F=>_())},"content_copy")]),_:1},8,["content"])]),ce(N,{modelValue:f.value,"onUpdate:modelValue":I[4]||(I[4]=F=>f.value=F)},null,8,["modelValue"])]),oe("div",aUt,[ce(D,{class:"background_blue left",style:{color:"#fff"},onClick:I[5]||(I[5]=F=>C())},{default:_e(()=>[mn(st(w.$t("message.go_cloud_serve")),1)]),_:1}),ce(D,{class:"background_blue right",style:{color:"#fff"},onClick:I[6]||(I[6]=F=>y())},{default:_e(()=>[mn(st(w.$t("message.logout")),1)]),_:1})])])):(G(),he("div",iUt,I[9]||(I[9]=[oe("iframe",{src:"//cocorobo.cn/login",frameborder:"0",scrolling:"no"},null,-1)])))]),_:1},8,["modelValue"])])}}},kAe="/assets/cocoblockly-navbar_labs-icon-DoQiUAGP.png",uUt={class:"example"},dUt=["src"],hUt={class:"header_right_title_span"},fUt={class:"example_dialog_body"},gUt={class:"example_item"},pUt=["onClick"],mUt={class:"example_item"},_Ut=["onClick"],vUt={class:"example_item"},bUt=["onClick"],TUt={__name:"example",emits:["setFileName"],setup(n,{emit:e}){const{t}=Jf(),i=Yc.useImportFileNameStore(),s=e,o=Yc.useLoadBlocklyStatus(),r=Yc.useyXmlStore(),a=te(!1),c=[{id:1,name:t("message.example_1"),childrenList:[{id:1,name:t("message.example_1_1"),childrenList:[{name:t("message.example_1_1_1"),url:"基础/未命名.xml"},{name:t("message.example_1_1_2"),url:"基础/未命名.xml"}]},{id:2,name:t("message.example_1_2"),url:"https://www.baidu.com",childrenList:[{name:t("message.example_1_2_1"),url:"基础/未命名.xml"},{name:t("message.example_1_2_2"),url:"基础/未命名.xml"}]}]},{id:2,name:t("message.example_2"),childrenList:[{name:t("message.example_2_1"),childrenList:[{name:t("message.example_2_1_1"),url:"基础/未命名.xml"},{name:t("message.example_2_1_2"),url:"基础/未命名1.xml"}]}]}],u=te(0),d=te(0),f=v=>{u.value=v,d.value=0},g=v=>{d.value=v},p=v=>{Os.get(`/example/${v.url}`).then(C=>{let y=C.data;console.log(C.data,_(y)),_(y)?(i.$patch({fileName:v.name}),s("setFileName",v.name),r.$patch({xmlStr:y}),localStorage.setItem("workspaceXml",y),o.$patch({status:!0}),po({message:t("message.open_example_success"),type:"success"}),setTimeout(()=>{o.$patch({status:!1})},100),a.value=!1):po({message:t("message.open_example_error"),type:"error"})})},_=v=>new DOMParser().parseFromString(v,"application/xml").getElementsByTagName("parsererror").length===0;return(v,C)=>{const y=Bt("el-tooltip"),w=Bt("el-dialog");return G(),he("div",uUt,[ce(y,{content:v.$t("message.example")},{default:_e(()=>[oe("div",{class:"el-dropdown-link",title:"样例",onClick:C[0]||(C[0]=I=>a.value=!0)},[oe("img",{src:T(kAe),alt:"",class:"header_right_icon left"},null,8,dUt),oe("span",hUt,st(v.$t("message.example")),1)])]),_:1},8,["content"]),ce(w,{modelValue:a.value,"onUpdate:modelValue":C[1]||(C[1]=I=>a.value=I),title:v.$t("message.example"),class:"example_dialog"},{default:_e(()=>[oe("div",fUt,[oe("div",gUt,[(G(),he(Qt,null,fi(c,(I,L)=>oe("div",{class:Y(u.value==L?"example_item_div_active example_item_div":"example_item_div"),key:L,onClick:O=>f(L)},st(I.name),11,pUt)),64))]),oe("div",mUt,[(G(!0),he(Qt,null,fi(c[u.value].childrenList,(I,L)=>(G(),he("div",{class:Y(d.value==L?"example_item_div_active example_item_div":"example_item_div"),key:L,onClick:O=>g(L)},st(I.name),11,_Ut))),128))]),oe("div",vUt,[(G(!0),he(Qt,null,fi(c[u.value].childrenList[d.value].childrenList,(I,L)=>(G(),he("div",{class:"example_item_div",key:L,onClick:O=>p(I)},st(I.name),9,bUt))),128))])])]),_:1},8,["modelValue","title"])])}}},CUt=Oh(TUt,[["__scopeId","data-v-f6e51d9b"]]),yUt="/assets/preloader-DMWULHSL.gif",EUt=["src"],SUt={style:{padding:"20px"}},wUt={class:"labs_card_p"},IUt={__name:"targetCard",props:{imgSrc:{type:String,default:""},linkSrc:{type:String,default:""},title:{type:String,default:""},comingSoon:{type:Boolean,default:!1}},emits:"getNextValue",setup(n,{emit:e}){const t=n,i=e,s=r=>{i("getNextValue",r)},o=()=>{t.linkSrc!=""?window.open(t.linkSrc):s(t.title)};return(r,a)=>{const c=Bt("el-button"),u=Bt("el-card");return G(),nt(u,{style:{"border-radius":"10px"}},{default:_e(()=>[oe("img",{class:"labs_card_img",src:n.imgSrc,alt:""},null,8,EUt),oe("div",SUt,[oe("p",wUt,st(n.title),1),n.comingSoon?Qe("",!0):(G(),nt(c,{key:0,type:"primary",onClick:o},{default:_e(()=>[mn(st(r.$t("message.enter")),1)]),_:1}))])]),_:1})}}},ud=Oh(IUt,[["__scopeId","data-v-35060cee"]]),AAe="/assets/AppCenter_ai_teachableMachine-CQTIYmVw.jpg",NAe="/assets/AppCenter_ai_emotion-DLWQ8NN5.jpg",DAe="/assets/AppCenter_ai_gesture_recognition-BypWNjDz.jpg",$Ae="/assets/object_recognition_header-CE25_6ku.jpg",xAe="/assets/posenet_recogition-B6dlSqE9.png",PAe="/assets/tm_with_pose-g4ZLQwij.jpg",FAe="/assets/AppCenter_ai_speech-DKJR0Hqu.jpg",jF="/assets/AppCenter_comingSoon-C83NGzxm.jpg",LUt={__name:"ai",emits:"getNextValueAI",setup(n,{emit:e}){const t=te("first"),i=e,s=o=>{i("getNextValueAI",o)};return(o,r)=>{const a=Bt("el-col"),c=Bt("el-row"),u=Bt("el-tab-pane"),d=Bt("el-tabs");return G(),he("div",null,[ce(d,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=f=>t.value=f),class:"demo-tabs"},{default:_e(()=>[ce(u,{label:o.$t("message.visual_identification"),name:"first"},{default:_e(()=>[ce(c,{class:"el_row_card"},{default:_e(()=>[ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(AAe),linkSrc:"",title:o.$t("message.Deep_learning_Machines"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1}),ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(NAe),linkSrc:"",title:o.$t("message.emotion_recognition"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1}),ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(DAe),linkSrc:"",title:o.$t("message.gesture_recognition"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1}),ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T($Ae),linkSrc:"",title:o.$t("message.object_recognition"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1}),ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(xAe),linkSrc:"",title:o.$t("message.pose_recognition"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1}),ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(PAe),linkSrc:"",title:o.$t("message.face_recognition"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1})]),_:1})]),_:1},8,["label"]),ce(u,{label:o.$t("message.speech_recognition"),name:"second"},{default:_e(()=>[ce(c,{class:"el_row_card"},{default:_e(()=>[ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(FAe),linkSrc:"",title:o.$t("message.speech_recognition"),onGetNextValue:s,comingSoon:!1},null,8,["imgSrc","title"])]),_:1})]),_:1})]),_:1},8,["label"]),ce(u,{label:o.$t("message.text_processing"),name:"third"},{default:_e(()=>[ce(c,{class:"el_row_card"},{default:_e(()=>[ce(a,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(jF),linkSrc:"",title:o.$t("message.stay_tuned"),onGetNextValue:s,comingSoon:!0},null,8,["imgSrc","title"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])])}}},OUt="/assets/AppCenter_iot_thingspeak-C7U4ZlwS.jpg",RUt="/assets/AppCenter_iot_ifttt-BalWZIhU.jpg",MUt={__name:"iot",setup(n){return(e,t)=>{const i=Bt("el-col"),s=Bt("el-row");return G(),he("div",null,[ce(s,{class:"el_row_card"},{default:_e(()=>[ce(i,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(OUt),linkSrc:"//thingspeak.com/",title:"ThingSpeak",onGetNextValue:e.getNextValue,comingSoon:!1},null,8,["imgSrc","onGetNextValue"])]),_:1}),ce(i,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(RUt),linkSrc:"//ifttt.com/maker_webhooks",title:"IFTTT",onGetNextValue:e.getNextValue,comingSoon:!1},null,8,["imgSrc","onGetNextValue"])]),_:1})]),_:1})])}}},kUt={__name:"robotContro",setup(n){return(e,t)=>{const i=Bt("el-col"),s=Bt("el-row");return G(),he("div",null,[ce(s,{class:"el_row_card"},{default:_e(()=>[ce(i,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(jF),linkSrc:"//thingspeak.com/",title:e.$t("message.stay_tuned"),onGetNextValue:e.getNextValue,comingSoon:!0},null,8,["imgSrc","title","onGetNextValue"])]),_:1})]),_:1})])}}},AUt={__name:"science",setup(n){return(e,t)=>{const i=Bt("el-col"),s=Bt("el-row");return G(),he("div",null,[ce(s,{class:"el_row_card"},{default:_e(()=>[ce(i,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(jF),linkSrc:"//thingspeak.com/",title:e.$t("message.stay_tuned"),onGetNextValue:e.getNextValue,comingSoon:!0},null,8,["imgSrc","title","onGetNextValue"])]),_:1})]),_:1})])}}},NUt={__name:"interactiveGames",setup(n){return(e,t)=>{const i=Bt("el-col"),s=Bt("el-row");return G(),he("div",null,[ce(s,{class:"el_row_card"},{default:_e(()=>[ce(i,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(jF),linkSrc:"//thingspeak.com/",title:e.$t("message.stay_tuned"),onGetNextValue:e.getNextValue,comingSoon:!0},null,8,["imgSrc","title","onGetNextValue"])]),_:1})]),_:1})])}}},DUt={__name:"ARVR",setup(n){return(e,t)=>{const i=Bt("el-col"),s=Bt("el-row");return G(),he("div",null,[ce(s,{class:"el_row_card"},{default:_e(()=>[ce(i,{span:12,class:"card_style"},{default:_e(()=>[ce(ud,{imgSrc:T(jF),linkSrc:"//thingspeak.com/",title:e.$t("message.stay_tuned"),onGetNextValue:e.getNextValue,comingSoon:!0},null,8,["imgSrc","title","onGetNextValue"])]),_:1})]),_:1})])}}},$Ut={class:"labs"},xUt=["title"],PUt=["src"],FUt={class:"header_right_title_span"},BUt={class:"my-header"},HUt={class:"labs_title"},VUt={class:"all_class"},UUt={class:"labs_class_left"},WUt={class:"labs_class_right"},GUt={key:0},zUt={key:1},KUt={key:2},jUt={key:3},XUt={key:4},YUt={key:5},qUt=["src"],JUt={class:"labs_card_container"},QUt={key:0},ZUt=["onClick"],e4t={key:1,class:"my-header"},t4t={class:"labs_title"},n4t=["src"],i4t={key:0,class:"model-loading",style:{width:"100%",height:"100%","background-color":"rgba(255, 255, 255, 0.9)"}},s4t={__name:"labs",setup(n){const{t:e}=Jf(),t=location.href.indexOf("hk")>0,i=te(!1),s=te(1),o=te(e("message.AI")),r=te(0),a=[{title:e("message.Deep_learning_Machines"),content:e("message.Deep_learning_Machines_content"),img:AAe,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!0,microphone:!1,iframeSrc:t?"https://ai-demos.cocorobo.hk/teachable-machine-2/public/":"https://ai-demos.cocorobo.cn/teachable-machine-2/public/"},{title:e("message.emotion_recognition"),content:e("message.emotion_recognition_content"),img:NAe,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!0,microphone:!1,iframeSrc:t?"https://beta.ai-demos.cocorobo.hk/labs/emotion-cloud/index.html":"https://beta.ai-demos.cocorobo.cn/labs/emotion-cloud/index.html"},{title:e("message.gesture_recognition"),content:e("message.gesture_recognition_content"),img:DAe,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!0,microphone:!1,iframeSrc:t?"https://beta.ai-demos.cocorobo.hk/labs/gesture-cloud/index.html":"https://beta.ai-demos.cocorobo.cn/labs/gesture-cloud/index.html"},{title:e("message.object_recognition"),content:e("message.object_recognition_content"),img:$Ae,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!0,microphone:!1,iframeSrc:t?"https://ai-demos.cocorobo.hk/object-detection-2/":"https://ai-demos.cocorobo.cn/object-detection-2/"},{title:e("message.pose_recognition"),content:e("message.pose_recognition_content"),img:xAe,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!0,microphone:!1,iframeSrc:t?"https://ai-demos.cocorobo.hk/posenet-2/demos/dist/":"https://ai-demos.cocorobo.cn/posenet-2/demos/dist/"},{title:e("message.face_recognition"),content:e("message.face_recognition_content"),img:PAe,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!0,microphone:!1,iframeSrc:t?"https://ai-demos.cocorobo.hk/teachable-machine-pose-recognition-2/public/":"https://ai-demos.cocorobo.cn/teachable-machine-pose-recognition-2/public/"},{title:e("message.speech_recognition"),content:e("message.speech_recognition_content"),img:FAe,system:"Windows (>Windows7), macOS (>10.11)",resolution:"1440*768",memoryCapacity:"8GB-16GB",HardDisk:"256GB-512GB",GraphicsCard:"650M",camera:!1,microphone:!0,iframeSrc:t?"https://beta.ai-demos.cocorobo.hk/labs/speech-cloud/index.html":"https://beta.ai-demos.cocorobo.cn/labs/speech-cloud/index.html"}],c=te({}),u=te(!1),d=te(null),f=te(!0),g=(w,I)=>{s.value=w,o.value=I},p=w=>{r.value=1,c.value=a.find(I=>I.title==w)},_=()=>{u.value=!0,f.value=!0,setTimeout(()=>{v()},100)},v=()=>{const w={data:AO().userInfo,id:"loginVerify",url:localStorage.getItem("lang")=="zhHans"?"zh-hans":localStorage.getItem("lang")=="zhHant"?"zh-hant":"en"};d.value&&(f.value=!1,d.value.contentWindow.postMessage(JSON.parse(JSON.stringify(w)),"*"))},C=()=>{console.log(r.value,c.value.iframeSrc),c.value.iframeSrc==""&&u.value?(u.value=!1,r.value=1,c.value={}):r.value==1?(r.value=0,c.value={}):(i.value=!1,c.value={})},y=()=>{console.log(AO().userInfo),JSON.stringify(AO().userInfo)!="{}"?(i.value=!0,r.value=0,c.value={}):po({message:e("message.please_login"),type:"warning"})};return(w,I)=>{const L=Bt("el-tooltip"),O=Bt("el-col"),A=Bt("el-row"),N=Bt("el-button"),D=Bt("el-dialog");return G(),he("div",$Ut,[ce(L,{content:w.$t("message.labs")},{default:_e(()=>[oe("div",{class:"el-dropdown-link",title:w.$t("message.labs"),onClick:y},[oe("img",{src:T(kAe),alt:"",class:"header_right_icon left"},null,8,PUt),oe("span",FUt,st(w.$t("message.labs")),1)],8,xUt)]),_:1},8,["content"]),ce(D,{modelValue:i.value,"onUpdate:modelValue":I[7]||(I[7]=P=>i.value=P),title:"","show-close":!1},{header:_e(({close:P})=>[oe("div",BUt,[oe("span",HUt,st(w.$t("message.labs")),1),oe("i",{class:"material-icons right",style:{"margin-top":"5px",cursor:"pointer","margin-right":"-15px"},onClick:C},"close")])]),default:_e(()=>[r.value==0?(G(),nt(A,{key:0,class:"labs_body"},{default:_e(()=>[ce(O,{class:"labs_class_content",span:6},{default:_e(()=>[oe("p",VUt,st(w.$t("message.all_categorization")),1),oe("ul",UUt,[oe("li",{class:Y(s.value==1?"active":""),onClick:I[0]||(I[0]=P=>g(1,w.$t("message.AI")))},st(w.$t("message.AI")),3),oe("li",{class:Y(s.value==2?"active":""),onClick:I[1]||(I[1]=P=>g(2,w.$t("message.IoT")))},st(w.$t("message.IoT")),3),oe("li",{class:Y(s.value==3?"active":""),onClick:I[2]||(I[2]=P=>g(3,w.$t("message.robot_control")))},st(w.$t("message.robot_control")),3),oe("li",{class:Y(s.value==4?"active":""),onClick:I[3]||(I[3]=P=>g(4,"科学实验"))},"科学实验",2),oe("li",{class:Y(s.value==5?"active":""),onClick:I[4]||(I[4]=P=>g(5,w.$t("message.scientific_experiment")))},st(w.$t("message.scientific_experiment")),3),oe("li",{class:Y(s.value==6?"active":""),onClick:I[5]||(I[5]=P=>g(6,"AR/VR"))},"AR/VR",2)])]),_:1}),ce(O,{span:18,style:{padding:"0 0.75rem"}},{default:_e(()=>[oe("h5",null,st(o.value),1),oe("ul",WUt,[s.value==1?(G(),he("li",GUt,[ce(LUt,{onGetNextValueAI:p})])):s.value==2?(G(),he("li",zUt,[ce(MUt)])):s.value==3?(G(),he("li",KUt,[ce(kUt)])):s.value==4?(G(),he("li",jUt,[ce(AUt)])):s.value==5?(G(),he("li",XUt,[ce(NUt)])):(G(),he("li",YUt,[ce(DUt)]))])]),_:1})]),_:1})):r.value==1?(G(),nt(A,{key:1,gutter:20,class:"activeContent"},{default:_e(()=>[ce(O,{span:12,style:{"background-color":"#fff","box-shadow":"1px 2px 3px #eeeeee"}},{default:_e(()=>[oe("img",{style:{width:"100%"},src:c.value.img,alt:""},null,8,qUt),oe("h3",null,st(c.value.title),1),oe("p",null,st(c.value.content),1)]),_:1}),ce(O,{span:12},{default:_e(()=>[oe("div",JUt,[oe("h4",null,st(w.$t("message.system_configure")),1),oe("p",null,st(w.$t("message.system"))+st(c.value.system),1),oe("p",null,st(w.$t("message.memory"))+st(c.value.memory),1),oe("p",null,st(w.$t("message.HardDisk"))+st(c.value.HardDisk),1),oe("p",null,st(w.$t("message.GraphicsCard"))+st(c.value.GraphicsCard),1),oe("p",null,st(w.$t("message.camera"))+st(c.value.camera?w.$t("message.need"):w.$t("message.not_need")),1),oe("p",null,st(w.$t("message.microphone"))+st(c.value.microphone?w.$t("message.need"):w.$t("message.not_need")),1)]),ce(N,{onClick:I[6]||(I[6]=P=>_())},{default:_e(()=>[mn(st(w.$t("message.enter")),1)]),_:1})]),_:1})]),_:1})):Qe("",!0)]),_:1},8,["modelValue"]),ce(D,{modelValue:u.value,"onUpdate:modelValue":I[8]||(I[8]=P=>u.value=P),width:c.value.iframeSrc?"95%":"","show-close":!1},{header:_e(({close:P})=>[c.value.iframeSrc?(G(),he("span",QUt,[oe("i",{class:"material-icons right",style:{"margin-top":"-15px",cursor:"pointer","margin-right":"0px"},onClick:P},"close",8,ZUt)])):(G(),he("div",e4t,[oe("span",t4t,st(c.value.title),1),oe("i",{class:"material-icons right",style:{"margin-top":"5px",cursor:"pointer","margin-right":"-15px"},onClick:C},"close")]))]),default:_e(()=>[oe("iframe",{id:"postMessage",src:c.value.iframeSrc,ref_key:"labsData",ref:d,frameborder:"0",style:{width:"100%",height:"700px"}},null,8,n4t),f.value?(G(),he("div",i4t,I[9]||(I[9]=[oe("img",{src:yUt,alt:""},null,-1)]))):Qe("",!0)]),_:1},8,["modelValue","width"])])}}},o4t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjI5ODc2NTBBMDUyMDExRUFBMDAzRjA0RjhCREU5OTgyIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjI5ODc2NTBCMDUyMDExRUFBMDAzRjA0RjhCREU5OTgyIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6Mjk4NzY1MDgwNTIwMTFFQUEwMDNGMDRGOEJERTk5ODIiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6Mjk4NzY1MDkwNTIwMTFFQUEwMDNGMDRGOEJERTk5ODIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6e2tSKAAADhElEQVR42uyaXUgUURTHd3VNDc2iVDILNPqgQAuEoDAsiQqK7OuhEosSoQyjXiKiiN6CeioqkaRAESTIh7Soh4IKRCrIiKKgyNK+FCwry3Sn/4W7cDrMx87snZlN9sAPZu459+79z71zv2aDmqYFxoMlBcaJJYQkhMSxkHLwFrwCfaDaDyEhBWVkgFnkPu9/bZFPFve+tEg+SLWRPwwWsLRCUGDzIY2A98DxpBZkE+ITUOTDAx0E88BnVV1rgk+DzmSQovIdyfJxBA2qfEfawFwwrKhy4h2aAkpJWif4QiouesFQrL8Z9GDRWAPq5fV3kKPwQXk6sx8g19fcEOGFkFVseK6Ph5l9EcgFP0EyuA9GLfIcI9f3wAPXHpl4R6Jki/avHbeIX8PiV9j4LdvYzXCbVOwXKDCJ7Saxd90U4UTIQjBGKthuEHeCtcayeBMiuMgquY35i5m/MYoyN4N9YC/YDoJeCMkGX0lF/4Ai6UsDL4lvCEyyKI8LF1Zqt15Ohl8xK1ewka9VrnobwRziqwXfLMrT24hVuTlqcY6ypzjC7puiKCMEPuq0iGjxTLe7FqVZ07fHIDWK/Os0Y6v0UkgWGNWpREmU+VtNhNzwUkgLCOtUQsw3uRZ5c+RAEbEOcIvcj1rMU8qEXNfM7Q2YaZK/jsXPAHks7YibQpIMRDSAQZbWY/JUO0ncB5L+jqQ/dUtISHYBblXSX67j65VzBV8h0C55ivjOsPxLVAtJkS8gtz0sbr1OzHM5WUZiTjP/YuIrYb7zKoWIofSmTgV3G8RvYHFXZZeMPJAe4uu26Hb9IF2FkFS26jVqCU4FiS0j6atZOYd18u5nMVtjFZJmIKI6ypasBV2kNQJyxqergQyDAWWAxLVZ/ZbZ4YNYO10CZTqHCQ02VkFTwYC8zpYH3unkhLFZbrkj6z5Rod9gI5gm08T9bNDrZK11UKclamKcQGs053bIadeaCC4oFBGQO0Wn9shp14rYZfAanIzxeGA+eEa60Bj4YXKSI/yZzF8Mup2eouxSdM6xg1VqE3hoIiQsK97B9i51qvcjdkhmO8cXNvJ2kXx9bASMaYfoxJaznWOTjbwt5Ho6WOvnx9BKdn/FRt5W2c0ittOvrpXPRp87DspoZ2UU8piQB62xFPTLr1LiE8JZB2Wck1/ShuUkuVKOpJ5+Vkj8YSAhJCEkIUSd/RVgAD59DGaapxy6AAAAAElFTkSuQmCC",r4t=["title"],l4t=["src"],a4t={class:"header_right_title_span"},c4t={__name:"languareSwitch",setup(n){const e=t=>{localStorage.setItem("lang",t),window.location.reload()};return(t,i)=>{const s=Bt("el-tooltip"),o=Bt("el-dropdown-item"),r=Bt("el-dropdown-menu"),a=Bt("el-dropdown");return G(),nt(a,{trigger:"click"},{dropdown:_e(()=>[ce(r,null,{default:_e(()=>[ce(o,{class:"header_menu_li",style:{color:"#26a69a"},onClick:i[0]||(i[0]=c=>e("en"))},{default:_e(()=>i[3]||(i[3]=[mn("Englsh")])),_:1}),ce(o,{class:"header_menu_li",style:{color:"#26a69a"},onClick:i[1]||(i[1]=c=>e("zhHant"))},{default:_e(()=>i[4]||(i[4]=[mn("中文繁體")])),_:1}),ce(o,{class:"header_menu_li",style:{color:"#26a69a"},onClick:i[2]||(i[2]=c=>e("zhHans"))},{default:_e(()=>i[5]||(i[5]=[mn("中文简体")])),_:1})]),_:1})]),default:_e(()=>[oe("div",{class:"el-dropdown-link",title:t.$t("message.languare")},[ce(s,{content:t.$t("message.languare")},{default:_e(()=>[oe("div",null,[oe("img",{src:T(o4t),alt:"",class:"header_right_icon left"},null,8,l4t),oe("span",a4t,st(t.$t("message.languare")),1)])]),_:1},8,["content"])],8,r4t)]),_:1})}}},u4t="/assets/%E5%88%86%E4%BA%AB-BDgeFZGL.png",d4t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADkJJREFUeF7tnQvQbtUYx///cdegFGEmFSfRSBdmQhkliqKpVEjKINepJINRVNKQpuIcXYzLTJFLRzJSCJVxQjN0M0oXyWVSOOUyYaJ57KfZp/M5zvnevda71n7ftdZ/zXxz5sy3nmet57+e37f3++61n0WoSQEpsE4FKG2kgBRYtwICRNkhBRZRQIAoPaSAAFEOSIE4BXQFidNNVo0oIEAaWWiFGaeAAInTTVaNKCBAGllohRmngACJ001WjSggQBpZaIUZp4AAidNNVo0oIEAaWWiFGaeAAInTTVaNKCBAGllohRmngACJ001WjSggQBpZaIUZp4AAidNNVo0oIEAaWWiFGaeAAInTTVaNKCBAGllohRmngACJ001WjSgwCiBmthTAjgA2AfC4RrStKczjAZxM8p6aghoSS3ZAzOxmAEuGTEZ95l6BkwGcS/LauZ9poglmBcTMVvRXjkTTlZs5UGAlgGNInjUHc8k+hWyAmNmJAN6fPQINMCsFziF5yKwGH2vcnIBcA2CbsQLRODNRYDnJA2Yy8kiD5gTkTwA2GikODTM7BaqGJCcgNrs108gjK1AtJAJk5EyqeLgqIREgFWfsDEKrDhIBMoMsqnzIqiARIJVn64zCqwYSATKjDGpg2CogESANZOoMQyweEgEyw+xpZOiiIZk7QEhmm9PChDSz4wAcG5KkY80tZE4xfa0LPsZuCptiIcmWjLGLMFYSCpAp0j3OtEhIBEjAYo8Fb8CUorrG/vGKGux/jYqDRIAErLoACRBr3V2LgkSABKx5w4D4G4VBn9cmyFoMJAJEgAxRwAH5BYDzhnQe2KcISATIwNX0bi1fQbovF48zs/1bg0SACJAhChzvgHjH1iARIEPSo+/T+hVklVQtQSJABMgQBR64grQGiQAZkh66gvwfIK3cbgkQATJEgbUC0gIkAmRIeugKsk5AaodEgAiQIQosCkjNkAiQIemhK8hEQGqFRIAIkCEKDAKkRkgEyJD00BVkMCC1QSJABMgQBYIAqQkSATIkPXQFCQakFkgEiAAZokAUIDVAIkCGpMfqPpeHdZ/b3jsHziwakNIhESCBmdJo96kAyQTJ2SRfn3s9BEhuhevwPzUgmSB5M8lP55RYgORUtx7fSQDJAMkdAHbtDvG5PpfUAiSXsnX5TQZIBkjOJ7lfLrkFSC5l6/KbFJAMkOxH8vwckguQHKrW5zM5IIkh+QjJLAfGtgzIHgAuqi+Xs0S0J8mLc3hO9PruJSR3zzG/lgHZDMCvc4haoc/Nu69Ub8sVVwJIVpLMcmBss4D0l/hvAHhFroWvxO+FJPfKHUsCSLYkeVPqebYOyGMBrEwtamX+NiR51xgxTQnJLiST73RoGpD+KrIxgGVd5UAviqa2WoHl3R+Pw0jeOaYoUxTWFiA5F8rMXglgewDbAFgv51hz7PseANcCuCrX16aTYhcgExSqpTjbpETQ79eugAARIGJjEQUEiAARIALk/iLHUefg6RarbX5i8waAPqS3nTptRC9AdIvVRqZHRilABEhk6rRhJkAESBuZHhmlABEgkanThpkAESBtZHpklAJEgESmThtmAkSAtJHpkVEKEAESmTptmAkQAdJGpkdGKUAESGTqtGEmQARIG5keGaUAESCRqdOGmQARIPcrYGYPB/AUAJsv+PH/e7u1r7jiVVf851aS/2oBEQHSMCBm9lzflt1XUnleYML/GMCFAC4j+ZNA22K6C5DGADGz3QC8ugfDa3GlaF6j6jIAXyZ5SQqH8+JDgDQCiJltCeAoAIdmTj4v/38KyRszjzOKewFSOSD9Z4t39XB43a0xmtetOgXAqaV/VhEgFQNiZnsCOAHAdmNQsZYxrgbwAZLF1hwWIJUCYmYf8uScERhrDnsCyQ/OyVyCpiFAKgTEzPyD8kuCMiF/5++S9C8IimoCpDJAzOyv3b3/o+c0C/9G8jFzOre1TkuAVASImX0fwIvmPAEvJbnrnM/xgekJkEoAMbPDACwtJPEOJ+kFuue+CZAKADEzP1PEzxYpqe1F0p/Ez3UTIIUDYmZb90e3bZI40/4NYNXDPn/I+JDE/n8HwI9S+3liv0ndCZDyAfkCgNcmyIprAPiBLz8AcB1J36C48F7cNy4+q9tS8sKu384Atk0w5rkkD0rgJ5sLAVIwIGa2T5e0X5syOxyKZSSD/JjZvn6gTQ/LNFPYl+QF0zjIaStAygbkhwB2miJBDiX5mSnsfZv8mwD4/qvYtoLkC2KNc9sJkEIBMbN3AjhtigTZh+TXp7BfePu1d3cS1jRXgSNJfjzFXFL7ECAFAmJmG/RHk8V+MN+A5F9SJpOZrQ/g7kif/oF9G5Kx9pHDTjYTIGUC4ucXfnXy8q61x2YkfxNpu6iZmW0KIPb88v1mdQ7hYkEJkDIBOQPA2yKS/KUkvxNhN9jEzHYH8O3BBqs7nkny7RF2WU0ESJmA/BKAP5sIaR8j+d4Qg9i+ZnYSgPcE2t9I8umBNtm7C5DCADGzZwC4PjAz/IHfTiT/HGgX1d3MNgKwIgLirUjeEDVoJiMBUh4ghwP4RGA+HEXy1ECbqbqbmb/F6G8VhrQjSM7VfjIBUh4g/nXoESFZB2DH7l2MHwXaTNW9eyfl+d07KVcEOvkUybcG2mTtLkDKA+SL3R6p1wRkxV3dztkNA/on69rtMF7Z7TAOeQ9+7l6qEiDlAfI9ACHvU8ws6czM30XfI4C4W0huEdA/e1cBUh4gvvv1mQGZ4bWqQq44Aa4X72pm/rnnyACH95F8cED/7F0FSHmA3Ang8QGZ8UmSvqlw9GZmbwFwVuDAm5L8baBNtu4CpDxALDAbjid5XKBNku5m5tviveJiSNuFpO8wnosmQMoD5A4AGwdkzxkk3xHQP1lXM/Mn46cHOnwySd+bNRdNgJQHyLX9i0tDE2g5yQOGdk7Zz8wcjpDtI/eSfFjKOUzrS4CUB4jvpQqpL3U5Sa/gPnozM7+98tusoe0GklsN7TxGPwFSHiDnAHhdQHL4u+XrkfR/R2tm5u+w3xP4LvtFJF8+2iQHDCRAygPkZADvHrC2C7vsSvLSQJupupuZ1+fyOl0hbWn3TkjoLoEQ/8F9BUh5gHiBBi/UENJG/ybLzPybs2NDJgngoO5B4bmBNlm7C5DyAHkigNsDs8KPI9ihqyByS6BdVHczWwLgysBtJj7Wk0j+IWrQTEYCpDBAfLpm5kee7RCYE165xHcCZ29m5jtyQx9OXknSj4SbqyZAygTkwwCOjsikA0guj7AbbGJm+wM4b7DB6o4nkjwmwi6riQApExDfABh7KM12JL1IXPJmZl5Mzg/NiWleZfHiGMOcNgKkTED8CAHftBhb1cS/9v1HysQys0f2X+vGuPUn51uT9KMb5qoJkAIB8SknqIv1HJI/S5GNZvZsAD+dwpfqYg0UjwP7BXeL/UvAbqdf8GAjGZjZtJUVvTLK2V0xh3/GTLkrzvAIAId0e8POjLHvbVRZMUC8bMlYKSApavPeBMCfzn9l6NfA/de4rwJwMICnBazv2rqqNm+AgAIkQKz+VitVdXd39y0AnwfgZYW8Aoq/MuvNX9n1SiVelse3ubwscJrr6q7q7oFCCpBAwczMjyTwQztDtsAHjpKlu7/4tRvJ67J4T+Q09s6jO0Yiy3stAiRiYc3M/6r7bVJJ7WCSfrWa6yZAJizPPH9IXzh1M/sogFEqJybI6JNIvi+Bn+wuBEglgPSfR/wJtj/Jnuc2sxe4YkQRIBUB0kMSWjcrJm9ibb5E8sBY41nYCZDKAOkheUP3lP2zs0ioRcZ8I8nPzdmcJk5HgFQISA/Jnt1Bm36C1KzrTP0HwN4kY/eOTUzinB0ESKWA9JD4lng/S2T7nEm0iO+rvGgDSX83pMgmQCoGpIfkQX1lEa8uMtb5G/6g0cH0kkP3FUlGP2kBUjkgq8Izs0cB8PpYDkrsLuBJue67ch2M00n+fVLnEn4vQBoBZAEoTwDg+6i8esiLEyWpF9T+Zr+fywvbVdMESGOALAzXzDbrTsv1DY/+E3pWue8k9qOfLyAZe3Dn3IMkQBoGZA1YHtoXxfbC2At/vNsf1/whee/cZ3eCCQoQAZIgjep1IUAESL3ZnSAyASJAEqRRvS4EiACpN7sTRCZABEiCNKrXhQARIPVmd4LIBIgASZBG9boQIAKk3uxOEJkAESAJ0qheFwJEgNSb3QkiEyACJEEa1etCgAiQerM7QWQCRIAkSKN6XQgQAVJvdieITIAIkARpVK8LASJA6s3uBJEJEAGSII3qdSFABEi92Z0gMgEiQBKkUb0uBIgAqTe7E0QmQARIgjSq14UAqXdtFdlsFWjjhKnZaqzRC1ZAgBS8eJp6fgUESH6NNULBCgiQghdPU8+vgADJr7FGKFgBAVLw4mnq+RUQIPk11ggFK1AcIHcDWL9gwTX1shRYQvJXqafM1A5X+TOzq7tDLbfN5V9+pcACBW4juXkORXICshTAYTkmLZ9SYA0FlpE8PIcq2QDxyZrZzQCW5Ji4fEqBXoFbSG6RS42sgPSQrACwY64A5LdpBa4guVNOBbID0kNyIoADAfgZfWpSYFoFfg/gHJJHT+tokv0ogCz44O7HIT910qT0eymwiAK3k7xpLIVGBWSsoDSOFEilgABJpaT8VKmAAKlyWRVUKgUESCol5adKBQRIlcuqoFIpIEBSKSk/VSogQKpcVgWVSgEBkkpJ+alSAQFS5bIqqFQKCJBUSspPlQoIkCqXVUGlUkCApFJSfqpUQIBUuawKKpUCAiSVkvJTpQICpMplVVCpFBAgqZSUnyoVECBVLquCSqWAAEmlpPxUqYAAqXJZFVQqBQRIKiXlp0oFBEiVy6qgUinwX1of1zLGbRi5AAAAAElFTkSuQmCC",h4t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADVJJREFUeF7tnVvMH0UZxp/nhpggNCEahBiECBKpgahYRITABUgFYgTkQkMVTaiI1BrxghKCXsCNGmnrCRJPxcREKFxQrJYoFTwVrQqmJEAjaJRDvDBSSYg3rztxCz18X7+d+c87/9nZZ5MvIXTmfWd+M8/Os/+d3SV0iIAILEqAYiMCIrA4AQlEs0MEDkFAAtH0EAEJRHNABNIIaAVJ46ZaEyEggUxkoNXNNAISSBo31ZoIAQlkIgOtbqYRkEDSuKnWRAhIIBMZaHUzjYAEksZNtSZCQAKZyECrm2kEJJA0bqo1EQISyEQGWt1MIyCBpHFTrYkQkEAmMtDqZhoBCSSNm2pNhIAEMpGBVjfTCEggadxUayIEJJCJDLS6mUZAAknjploTISCBTGSg1c00AhJIGjfVmggBCWQiA61uphGQQNK4HVTLzJYBOBvASgBnADgGwLGZwi8V5lkAzwF4GMAWkj9bqoL+fRgBCWQYp0OWMrPVANYBOC5DuBwhdgBYT/KHOYJNOYYEMsPom1lYJb4J4AMzhPGsei/JSz0TtB5bAkkcYTM7C8DPARyWGKJUtX+QfGOpZK3lkUASRtTMTgGwK6HqvKrsIvm2eSUfc14JJHL0zOzo7mI8XAQvj6w67+J3kbxi3o0YW34JJHLEzOx6AF+KrFZL8Q/rwj1uKCSQOF4ws0cBnBpZrZbiO0i+u5bGjKEdEkjEKJnZxQDui6hSY9FLSG6psWE1tkkCiRiV7mfd2wFcHVGlxqJ3kAz3bXQMICCBDIC0t4iZPQLgXRFVaiz6O5IramxYjW2SQCJGxcyeBnB8RJUaiz5D8oQaG1Zjm0YtkP5+xFv7fU+vKwA4/IJ1eIE8nileAvDlPoEBOHAOHPj/FiozpH1hf1j429lZurBPbJTH6ARiZicCuBbA+SO8FzHKSZKh0dsB/KLfH/avDPGKhRiVQMzsun5T4BuKEVKinASe6EUS9q+N4hiNQMzsx/1W8lGAVSMPSWAryfePgdEoBGJmwQfraIwAyernX/UNNLPbAHymsbmh7vyfQHhmZW3NMKoWSH/NsaFmgGrbzATWkNw4cxSnANUKpP+1KjxCqgtyp8GvJOzz4VFlkrsrac9+zahZIGHlCL9a6WifwEaSa2rsZs0CeQpAuOeho30Cu0meVGM3qxSImYXt5GFbuY7pEDite37+sdq6W6tAPtg9c3FPbbDUHlcCl5K81zVDQvBaBfLJ/m0hCV1SlZESuIbkt2pre60C+QKAm2eAdWf38rat/Ua5J2eIo6pLEOg3jJ4J4OMA3jMDsC929w3DuFd1tCiQK0jeVRXliTSm2/Awy4lNAhk6T2YAfTrJnUPzqFx+Amb2IQA/SogsgQyFligQPUo6FLBzOTP7DoCrItNIIEOBJQrkKpLfG5pD5fwImNnHAHw3MoMEMhRYokCWdy9Ge3xoDpXzI5D45kkJZOiQJArkSJJ7huZQOT8CZnYEgBcjM0ggQ4ElCuQ8kuHRTh1zJmBm5wJ4MLIZEshQYIkCuZ7kV4bmUDk/Amb2uX1eDDE0kQQylFSiQF7o7sRqa/xQyE7lzOzkcIM24e0vEsjQMUkUSAivN5gPhexUzsz+AiDlvVsSyNAxmUEgIUXYYnKTbhgOpZ2nXP/e4u8DOCoxogQyFFymTwyED9yEn3310+9Q8GnlwqMJ4e/NadVfqfV5kntfaDdjqHzVa92LdSWATfm6qUgjILCKZNhkWtVRq0AuAPDTqkipMd4E3kdym3eS2Pi1CiR8GPPfAF4T2yGVHyWBlwEsI/nf2lpfpUACJDMLF3yragOm9rgQ2ETyoy6RZwxas0Au7H+RmrGLqj4CAiu7T8P9pMZ2VisQrSI1TheXNlW7eoTe1i6QtwN4qNu28FqXoVHQeRP4D4BzSP5x3g1ZLH/VAulXkfBNwPBtQB3tEVhN8o6au1W9QHqRhBcCfLtmkGpbNIFPkAxPHlZ9jEIgvUjO6F8FFGyXjvES+AOAT5HcMYYujEYgvUjCtcg6ADeMAa7auB+Bv4fPHXR7tTbUeL9jtNcgCzXczMK+n/CNwnDHPfz30f2f5mQ9BMIHPMPHO/8E4IHunVnbSI7q+4QB5ahWkEONfcJXqKrcPVrP/H61JSm7q8fw9aghrCWQIZQmXkYCaWACaAXxG0QJxI9tscgSiB9qCcSPbbHIEogfagnEj22xyBKIH2oJxI9tscgSiB9qCcSPbbHIEogfagnEj22xyBKIH2oJxI9tscgSiB9qCcSPbbHIEogfagnEj22xyBKIH2oJxI9tscg1CcTMju8+Q3YKgBUAHgkvryP5TE4YB+T4dfiuPMkXcubYG0sC8aBaOGYNAjGz8NrN8JWrSxbofpb3Bi+Rw+UzdBJI4cnskW7eAjGzsOX++aX6Nssu1xI5Fmq/BLLUqI7g3ysQSPiya/jC61LHepJrlyq0yER1zyGB7E9A291TZuoBdczsMgB3R4S6nOTmiPLhRXruORZrj1aQmJGqtOw8VxAzu6V/FHgonVtJ3ji0cChXIocEcjABrSAxs3SRsma2BcBFEaHuJ3lxRPkgEPccEogEsi+BbI/cmln4YGX4cOXQYzvJ84YW7lcQ9xwSiAQigcSosi+ra5AEaLVVmfM1iPvZvcQqpRVEK4hWkIQzm1aQBGi1VdEKctCIRF/naAXRCqIVJOHMphUkAVptVbSCaAXxmJO6D5KBaokL6BI5ZLFksWSxEk4IslgJ0GqrIosli+UxJ2WxMlAtYX9K5JDFksWSxUo4IchiJUCrrYosliyWx5yUxcpAtYT9KZFDFksWSxYr4YQgi5UArbYqsliyWB5zUhYrA9US9qdEDlksWSxZrIQTgixWArTaqshiyWJ5zElZrAxUS9ifEjlksWSxZLESTgiyWAnQaqsiiyWL5TEnZbEyUC1hf0rkkMWSxZLFSjghyGIlQKutiiyWLJbHnJTFykC1hP0pkUMWSxZLFivhhCCLlQCttiqyWLJYHnNSFisD1RL2p0QOWSxZLFmshBOCLFYCtNqqyGLJYnnMSVmsDFRL2J8SOWSxZLFksRJOCLJYCdBqqyKLJYvlMSdlsTJQLWF/SuSQxZLFksVKOCHIYiVAq62KLJYslseclMXKQLWE/SmRQxZLFksWK+GEIIuVAK22KrJYslgec1IWKwPVEvanRA5ZLFksWayEE4IsVgK02qrIYsliecxJWawMVEvYnxI5ZLFksWSxEk4IslgJ0GqrIosli+UxJ2WxMlAtYX9K5JDFksWSxUo4IchiJUCrrYosliyWx5yUxcpAtYT9KZFDFksWy8tifRXA2git3UbysxHlYWbuOSQQCcRLIFcC2BQx4VeRvDOifBCIew4JRALxEshRAP4M4NgBk34XgNNJvjyg7CtFzMw9hwQigbgIJAQ1s48A+MGASb+c5OMDyh1UpESOhdqlX7FSRquyOvP8FWsvCjO7EMDWRdC8BGBFqjgG5ngCwEqST+ccHgkkJ805xapBIP1K8g4AqwG8s//bCSD8rZ9VHPuI5MAcvwHwWwA3kQxCzHpIIFlxzidYLQKZT+99s0ogvnyLRJdA/DBLIH5si0WWQPxQSyB+bItFlkD8UEsgfmyLRZZA/FBLIH5si0WWQPxQSyB+bItFlkD8UEsgfmyLRZZA/FCb2e0Aro7JQLKJneJNdKK/QWcxAxhurJE8M7LO5Ip3u4iXAXgMwHExnZdAYmgVKJuwgoRWXUbyngLNG20KM7sGwDdiOyCBxBJzLp8okL8COIfk35ybN8rwZnZut/N4C4DDYzsggcQScy6fKJDQqvu7zbg3kwz7pXT0BMzsfADh2uOEFCgSSAo1xzpm9iKAI2ZIEYQSVpR/zhCjhaqvB/AmABfN0Jk9JI+coX41VVu6SA9bvd9SDdlpN+RJkie3gKAlgTwIIHhmHfMnsJ3kefNvxuwtaEkg1wL42uxIFCEDgU+T/HqGOHMP0ZJATgXw6NyJqgGBwGkkw72T0R/NCCSMhJndHe5tjH5Uxt2BzSQvH3cXXm19awI5G8BDrQzOSPsR7is9PNK2H9TspgTSryIbAFzXygCNrB8bSa4ZWZsP2dzmBNKL5KnuFTwntjRQI+jLbpInjaCdUU1sUiC9SH4J4KwoGiqcSuBXJN+bWrnmes0KpBfJLQDW1TwADbTtVpI3NtCPBbvQtEB6kawEcAOAcAGvIx+Bzf27vpq5IF8ITfMC2dtpM7sAQNiAF2zXMf17dA/LN1+ajrSnexnec91DU892/B4AsI3k75vucd+5yQhkCoOpPuYnIIHkZ6qIDRGQQBoaTHUlPwEJJD9TRWyIgATS0GCqK/kJSCD5mSpiQwQkkIYGU13JT0ACyc9UERsiIIE0NJjqSn4CEkh+porYEAEJpKHBVFfyE5BA8jNVxIYISCANDaa6kp+ABJKfqSI2REACaWgw1ZX8BCSQ/EwVsSECEkhDg6mu5CcggeRnqogNEZBAGhpMdSU/AQkkP1NFbIiABNLQYKor+QlIIPmZKmJDBCSQhgZTXclPQALJz1QRGyIggTQ0mOpKfgL/A6gaLDJn8AuMAAAAAElFTkSuQmCC",f4t="/assets/local_storage-BF1lex7Y.png",g4t=["title"],p4t=["src"],m4t={class:"header_right_title_span"},_4t={style:{padding:"14px"}},v4t={class:"cloud_card_top"},b4t=["onClick"],T4t=["onClick"],C4t=["onClick"],y4t={class:"cloud_card_bottom",style:{padding:"14px"}},E4t={class:"dialog-footer"},S4t={class:"dialog-footer"},w4t={__name:"fIleOperation",props:{exportImportFileName:{type:String}},emits:["setFileName"],setup(n,{emit:e}){const{t}=Jf(),i=n,s=e,o=AO(),r=Yc.useyXmlStore(),a=Yc.useImportFileNameStore(),c=Yc.useLoadBlocklyStatus(),u=te(!1),d=te([]),f=te(!1),g=te({}),p=te(""),_=te(t("mesage.add")),v=()=>{JSON.stringify(o.userInfo)!="{}"?(Os.defaults.withCredentials=!0,Os.changeOrigin=!0,Os.get(`${Kj.host}blockx/files`).then(P=>{d.value=P.data}),u.value=!0):po({message:t("message.please_login"),type:"warning"})},C=()=>{const P=document.createElement("input");P.type="file",P.accept=".xml",P.onchange=F=>{const V=F.target.files[0],U=new FileReader;U.onload=Q=>{let de=Q.target.result;r.$patch({xmlStr:de}),c.$patch({status:!0}),a.$patch({fileName:V.name}),s("setFileName",V.name),localStorage.setItem("workspaceXml",de),setTimeout(()=>{c.$patch({status:!1})},100)},U.readAsText(V)},P.click()},y=()=>{let P=i.exportImportFileName+".xml";r.xmlStr&&r.xmlStr!='<xml xmlns="https://developers.google.com/blockly/xml"></xml>'?MAe(r.xmlStr,P):po({message:t("message.export_content_empty"),type:"warning"})},w=(P,F)=>{P.stopPropagation();const V=location.href+"&Qd="+F;navigator.clipboard.writeText(V).then(()=>{po({message:t("message.link_copy"),type:"success"})}).catch(U=>{console.error("复制到剪贴板失败: ",U),po({message:t("message.link_copy_error"),type:"warning"})})},I=(P,F)=>{P.stopPropagation(),Os.delete(`https://api.cocorobo.cn/blockx/${F}`).then(V=>{console.log(V),V.status==200?(po({message:t("message.delete_success"),type:"success"}),v()):po({message:t("message.delete_error"),type:"error"})})},L=(P,F)=>{P.stopPropagation();let V=new FormData;V.append("filename",F),V.append("xml",r.xmlStr),Os.put(`https://api.cocorobo.cn/blockx/${F}`,V).then(U=>{console.log(U),U.data=="OK"?po({message:t("message.save_success"),type:"success"}):po({message:t("message.save_error"),type:"error"})})},O=(P,F)=>{P.stopPropagation(),Os.get(`https://api.cocorobo.cn/blockx/${F.filenameid}`).then(V=>{if(console.log(V.data.xml),V.status==200){let U=V.data.xml;U.indexOf("$")==4&&(U=U.slice(5)),a.$patch({fileName:F.filename}),s("setFileName",F.filename),r.$patch({xmlStr:U}),c.$patch({status:!0}),localStorage.setItem("workspaceXml",U),setTimeout(()=>{c.$patch({status:!1}),u.value=!1},100)}else po({message:t("message.open_error"),type:"error"})})},A=(P,F)=>{f.value=!0,P.stopPropagation(),console.log(F),g.value=F,p.value=F.filename,_.value=t("message.update")},N=()=>{if(_.value==t("message.add")){let P={filename:p.value,type:"",xml:r.xmlStr};Os.post("https://api.cocorobo.cn/blockx/",P).then(F=>{console.log(F),F.statusText=="OK"?(v(),po({message:t("message.add_success"),type:"success"}),f.value=!1):po({message:t("message.add_error"),type:"error"})})}else{let P={currentFilename:g.value.filename,newFilename:p.value};Os.put("https://api.cocorobo.cn/blockx/modify",P).then(F=>{console.log(F),F.data=="Filename update."?(v(),po({message:t("message.update_success"),type:"success"}),f.value=!1):po({message:t("message.update_error"),type:"error"})})}},D=()=>{f.value=!0,p.value="",_.value=t("message.add")};return(P,F)=>{const V=Bt("el-tooltip"),U=Bt("el-dropdown-item"),Q=Bt("el-dropdown-menu"),de=Bt("el-dropdown"),q=Bt("el-icon"),K=Bt("el-card"),re=Bt("el-col"),Z=Bt("el-row"),J=Bt("el-button"),ge=Bt("el-dialog"),ve=Bt("el-input");return G(),he(Qt,null,[ce(de,{trigger:"click"},{dropdown:_e(()=>[ce(Q,null,{default:_e(()=>[ce(U,{class:"header_menu_li",onClick:F[0]||(F[0]=Le=>v()),style:{color:"#26a69a"}},{default:_e(()=>[mn(st(P.$t("message.cloud_save")),1)]),_:1}),ce(U,{class:"header_menu_li",onClick:F[1]||(F[1]=Le=>C()),style:{color:"#26a69a"}},{default:_e(()=>[mn(st(P.$t("message.import")),1)]),_:1}),ce(U,{class:"header_menu_li",onClick:F[2]||(F[2]=Le=>y()),style:{color:"#26a69a"}},{default:_e(()=>[mn(st(P.$t("message.Export")),1)]),_:1})]),_:1})]),default:_e(()=>[oe("div",{class:"el-dropdown-link",title:P.$t("message.file")},[ce(V,{content:P.$t("message.file")},{default:_e(()=>[oe("div",null,[oe("img",{src:T(f4t),alt:"",class:"header_right_icon left"},null,8,p4t),oe("span",m4t,st(P.$t("message.file")),1)])]),_:1},8,["content"])],8,g4t)]),_:1}),ce(ge,{modelValue:u.value,"onUpdate:modelValue":F[5]||(F[5]=Le=>u.value=Le),title:P.$t("message.cloud_save"),width:"800"},{footer:_e(()=>[oe("div",E4t,[ce(J,{onClick:F[4]||(F[4]=Le=>u.value=!1)},{default:_e(()=>[mn(st(P.$t("message.close")),1)]),_:1})])]),default:_e(()=>[ce(Z,{gutter:24,style:{"text-align":"center"}},{default:_e(()=>[ce(re,{span:7,style:{"margin-top":"15px"}},{default:_e(()=>[ce(K,{"body-style":{padding:"0px"}},{default:_e(()=>[oe("div",_4t,[ce(q,{size:80,onClick:F[3]||(F[3]=Le=>D())},{default:_e(()=>[ce(T(PKe))]),_:1})])]),_:1})]),_:1}),(G(!0),he(Qt,null,fi(d.value,(Le,Ee)=>(G(),nt(re,{span:7,style:{"margin-top":"15px"}},{default:_e(()=>[ce(K,{"body-style":{padding:"0px"},onClick:Ne=>O(Ne,Le)},{default:_e(()=>[oe("div",v4t,[oe("img",{onClick:Ne=>w(Ne,Le.filenameid),src:u4t,alt:""},null,8,b4t),oe("div",null,[oe("img",{onClick:Ne=>L(Ne,Le.filenameid),src:d4t,alt:""},null,8,T4t),oe("img",{onClick:Ne=>I(Ne,Le.filename),src:h4t,alt:""},null,8,C4t)])]),oe("div",y4t,[oe("span",null,st(Le.filename),1),ce(q,{size:20},{default:_e(()=>[ce(T(VKe),{onClick:Ne=>A(Ne,Le)},null,8,["onClick"])]),_:2},1024),F[9]||(F[9]=oe("br",null,null,-1)),oe("span",null,st(P.$t("message.last_version"))+st(new Date(Le.date).toLocaleDateString()),1)])]),_:2},1032,["onClick"])]),_:2},1024))),256))]),_:1})]),_:1},8,["modelValue","title"]),ce(ge,{modelValue:f.value,"onUpdate:modelValue":F[8]||(F[8]=Le=>f.value=Le),title:_.value,width:"400"},{footer:_e(()=>[oe("div",S4t,[ce(J,{onClick:N,type:"primary"},{default:_e(()=>[mn(st(P.$t("message.ok")),1)]),_:1}),ce(J,{onClick:F[7]||(F[7]=Le=>f.value=!1)},{default:_e(()=>[mn(st(P.$t("message.close")),1)]),_:1})])]),default:_e(()=>[ce(ve,{modelValue:p.value,"onUpdate:modelValue":F[6]||(F[6]=Le=>p.value=Le),style:{"margin-top":"20px"}},null,8,["modelValue"])]),_:1},8,["modelValue","title"])],64)}}},I4t=Oh(w4t,[["__scopeId","data-v-271552dc"]]),L4t="/assets/learn_nav_icon-C560Mivu.png",O4t=["title"],R4t=["src"],M4t={class:"header_right_title_span"},k4t={href:"//edu.cocorobo.cn/",target:"_blank",rel:"noopener noreferrer"},A4t={href:"//xunlian.cocorobo.cn",target:"_blank",rel:"noopener noreferrer"},N4t={href:"//biaoji.cocorobo.cn/",target:"_blank",rel:"noopener noreferrer"},D4t={href:"//aihub.cocorobo.cn",target:"_blank",rel:"noopener noreferrer"},$4t={href:"//aihub.cocorobo.cn/vision",target:"_blank",rel:"noopener noreferrer"},x4t={href:"//aihub.cocorobo.cn/speech",target:"_blank",rel:"noopener noreferrer"},P4t={href:"//aihub.cocorobo.cn/text",target:"_blank",rel:"noopener noreferrer"},F4t={href:"//aihub.cocorobo.cn/art",target:"_blank",rel:"noopener noreferrer"},B4t={__name:"linkStudy",setup(n){return(e,t)=>{const i=Bt("el-tooltip"),s=Bt("el-dropdown-item"),o=Bt("el-dropdown-menu"),r=Bt("el-dropdown");return G(),nt(r,{trigger:"click"},{dropdown:_e(()=>[ce(o,{class:"link_stydy"},{default:_e(()=>[ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",k4t,st(e.$t("message.go_edu_teaching_platform")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",A4t,st(e.$t("message.go_train_platform")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",N4t,st(e.$t("message.go_biaoji_platform")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",D4t,st(e.$t("message.go_aihub")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",$4t,st(e.$t("message.go_aihub_vision")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",x4t,st(e.$t("message.go_aihub_speech")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",P4t,st(e.$t("message.go_aihub_text")),1)]),_:1}),ce(s,{class:"header_menu_li",style:{color:"#26a69a"}},{default:_e(()=>[oe("a",F4t,st(e.$t("message.go_aihub_art")),1)]),_:1})]),_:1})]),default:_e(()=>[oe("div",{class:"el-dropdown-link",title:e.$t("message.study")},[ce(i,{content:e.$t("message.study")},{default:_e(()=>[oe("div",null,[oe("img",{src:T(L4t),alt:"",class:"header_right_icon left"},null,8,R4t),oe("span",M4t,st(e.$t("message.study")),1)])]),_:1},8,["content"])],8,O4t)]),_:1})}}},H4t={class:"headerRight"},V4t={class:"example headerRightDiv"},U4t={class:"headerRightDiv"},W4t={class:"study headerRightDiv"},G4t={class:"file headerRightDiv"},z4t={class:"lang headerRightDiv"},K4t={class:"user headerRightDiv"},j4t={__name:"headerRight",setup(n){return(e,t)=>(G(),he("div",H4t,[oe("div",V4t,[ce(CUt)]),oe("div",U4t,[ce(s4t)]),oe("div",W4t,[ce(B4t)]),oe("div",G4t,[ce(I4t,wf(nb(e.$attrs)),null,16)]),oe("div",z4t,[ce(c4t)]),oe("div",K4t,[ce(cUt)])]))}},X4t=Oh(j4t,[["__scopeId","data-v-6849b7fd"]]),Y4t={id:"header"},q4t={class:"header-left"},J4t={class:"header-right"},Q4t={__name:"header",setup(n){const{t:e}=Jf(),t=te(e("message.untitled")),i=s=>{t.value=s};return(s,o)=>(G(),he("div",Y4t,[oe("div",q4t,[ce(jVt,{onSetFileName:i,exportImportFileName:t.value},null,8,["exportImportFileName"])]),oe("div",J4t,[ce(X4t,{onSetFileName:i,exportImportFileName:t.value},null,8,["exportImportFileName"])])]))}},Z4t=Oh(Q4t,[["__scopeId","data-v-d663c38c"]]),eWt="/assets/nav_help-Buyc1obJ.png",tWt={class:"footer"},nWt={class:"translatable_copyright_left",style:{color:"#fff"}},iWt={id:"copyright_middle",style:{color:"#fff"}},sWt={class:"translatable_copyright_right",style:{color:"#fff"}},oWt={style:{}},rWt={class:"translatable_update_logs",style:{color:"#fff"}},lWt={id:"help",target:"_blank",href:"//pi-help.cocorobo.cn",style:{position:"relative"}},aWt={class:"translatable_help_board",style:{color:"#fff"}},cWt=["src"],uWt={__name:"footer",setup(n){const e=te(!1),t=new Date().getFullYear();return(i,s)=>{const o=Bt("el-tooltip"),r=Bt("el-dialog");return G(),he(Qt,null,[oe("div",tWt,[oe("div",null,[oe("span",nWt,st(i.$t("message.cocorobo"))+" © ",1),oe("span",iWt,st(T(t)),1),oe("span",sWt,st(i.$t("message.cocorobo_copy")),1)]),oe("div",oWt,[ce(o,{content:i.$t("message.update_log")},{default:_e(()=>[oe("span",{onClick:s[0]||(s[0]=a=>e.value=!0),style:{cursor:"pointer"}},[oe("span",rWt,st(i.$t("message.update_log")),1),s[2]||(s[2]=oe("i",{class:"material-icons sketch_name_icon",style:{"margin-left":"5px",cursor:"pointer",position:"relative",top:"7px"}},"message",-1))])]),_:1},8,["content"]),s[3]||(s[3]=oe("span",{class:"vertical-separator",style:{padding:"4px 6px 4px 6px"}},null,-1)),oe("span",null,[ce(o,{content:i.$t("message.help_file")},{default:_e(()=>[oe("a",lWt,[oe("span",aWt,st(i.$t("message.help_file")),1),oe("img",{class:"nav-icon",src:T(eWt),style:{height:"20px","margin-left":"5px",position:"relative",top:"-8px"}},null,8,cWt)])]),_:1},8,["content"])]),s[4]||(s[4]=oe("span",{class:"vertical-separator",style:{padding:"4px 6px 4px 6px"}},null,-1)),s[5]||(s[5]=oe("span",null,"CocoBlockly Pi",-1))])]),ce(r,{modelValue:e.value,"onUpdate:modelValue":s[1]||(s[1]=a=>e.value=a),title:"更新日志"},{default:_e(()=>s[6]||(s[6]=[oe("div",null,"111111111",-1),oe("div",null,"111111111",-1),oe("div",null,"111111111",-1),oe("div",null,"111111111",-1)])),_:1},8,["modelValue"])],64)}}},dWt=Oh(uWt,[["__scopeId","data-v-9fd1ec18"]]);var CD={exports:{}};/**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */var hWt=CD.exports,Yme;function fWt(){return Yme||(Yme=1,function(n,e){(function(){var t,i="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",r="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",f=1,g=2,p=4,_=1,v=2,C=1,y=2,w=4,I=8,L=16,O=32,A=64,N=128,D=256,P=512,F=30,V="...",U=800,Q=16,de=1,q=2,K=3,re=1/0,Z=9007199254740991,J=17976931348623157e292,ge=NaN,ve=4294967295,Le=ve-1,Ee=ve>>>1,Ne=[["ary",N],["bind",C],["bindKey",y],["curry",I],["curryRight",L],["flip",P],["partial",O],["partialRight",A],["rearg",D]],qe="[object Arguments]",Re="[object Array]",we="[object AsyncFunction]",Ve="[object Boolean]",Ge="[object Date]",dt="[object DOMException]",ze="[object Error]",ee="[object Function]",ye="[object GeneratorFunction]",Me="[object Map]",et="[object Number]",at="[object Null]",Ue="[object Object]",Se="[object Promise]",Ie="[object Proxy]",Xe="[object RegExp]",it="[object Set]",Tt="[object String]",He="[object Symbol]",ke="[object Undefined]",ot="[object WeakMap]",Ct="[object WeakSet]",Gt="[object ArrayBuffer]",Ot="[object DataView]",En="[object Float32Array]",fe="[object Float64Array]",se="[object Int8Array]",le="[object Int16Array]",Fe="[object Int32Array]",pe="[object Uint8Array]",je="[object Uint8ClampedArray]",Ae="[object Uint16Array]",Et="[object Uint32Array]",Tn=/\b__p \+= '';/g,Hn=/\b(__p \+=) '' \+/g,Xn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vs=/&(?:amp|lt|gt|quot|#39);/g,Zn=/[&<>"']/g,Hi=RegExp(vs.source),ti=RegExp(Zn.source),Ps=/<%-([\s\S]+?)%>/g,ae=/<%([\s\S]+?)%>/g,xe=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,ue=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,Te=RegExp(ie.source),De=/^\s+/,me=/\s/,tt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,It=/\{\n\/\* \[wrapped with (.+)\] \*/,kt=/,? & /,un=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gt=/[()=,{}\[\]\/\s]/,Ft=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fn=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,Fs=/^0b[01]+$/i,vi=/^\[object .+?Constructor\]$/,go=/^0o[0-7]+$/i,gl=/^(?:0|[1-9]\d*)$/,vo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,At=/($^)/,In=/['\n\r\u2028\u2029\\]/g,Yn="\\ud800-\\udfff",bi="\\u0300-\\u036f",Ur="\\ufe20-\\ufe2f",Yl="\\u20d0-\\u20ff",RM=bi+Ur+Yl,tI="\\u2700-\\u27bf",b_="a-z\\xdf-\\xf6\\xf8-\\xff",YF="\\xac\\xb1\\xd7\\xf7",nI="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",MM="\\u2000-\\u206f",kM=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AM="A-Z\\xc0-\\xd6\\xd8-\\xde",Ky="\\ufe0e\\ufe0f",T_=YF+nI+MM+kM,kb="['’]",qF="["+Yn+"]",iI="["+T_+"]",Ab="["+RM+"]",NM="\\d+",JF="["+tI+"]",Tp="["+b_+"]",DM="[^"+Yn+T_+NM+tI+b_+AM+"]",Nb="\\ud83c[\\udffb-\\udfff]",sI="(?:"+Ab+"|"+Nb+")",$M="[^"+Yn+"]",jy="(?:\\ud83c[\\udde6-\\uddff]){2}",tg="[\\ud800-\\udbff][\\udc00-\\udfff]",wa="["+AM+"]",xM="\\u200d",oI="(?:"+Tp+"|"+DM+")",rI="(?:"+wa+"|"+DM+")",lI="(?:"+kb+"(?:d|ll|m|re|s|t|ve))?",PM="(?:"+kb+"(?:D|LL|M|RE|S|T|VE))?",aI=sI+"?",FM="["+Ky+"]?",BM="(?:"+xM+"(?:"+[$M,jy,tg].join("|")+")"+FM+aI+")*",Xy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",QF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",HM=FM+aI+BM,Cp="(?:"+[JF,jy,tg].join("|")+")"+HM,VM="(?:"+[$M+Ab+"?",Ab,jy,tg,qF].join("|")+")",Ah=RegExp(kb,"g"),ZF=RegExp(Ab,"g"),cI=RegExp(Nb+"(?="+Nb+")|"+VM+HM,"g"),e2=RegExp([wa+"?"+Tp+"+"+lI+"(?="+[iI,wa,"$"].join("|")+")",rI+"+"+PM+"(?="+[iI,wa+oI,"$"].join("|")+")",wa+"?"+oI+"+"+lI,wa+"+"+PM,QF,Xy,NM,Cp].join("|"),"g"),yp=RegExp("["+xM+Yn+RM+Ky+"]"),UM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,t2=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],n2=-1,Fo={};Fo[En]=Fo[fe]=Fo[se]=Fo[le]=Fo[Fe]=Fo[pe]=Fo[je]=Fo[Ae]=Fo[Et]=!0,Fo[qe]=Fo[Re]=Fo[Gt]=Fo[Ve]=Fo[Ot]=Fo[Ge]=Fo[ze]=Fo[ee]=Fo[Me]=Fo[et]=Fo[Ue]=Fo[Xe]=Fo[it]=Fo[Tt]=Fo[ot]=!1;var Mo={};Mo[qe]=Mo[Re]=Mo[Gt]=Mo[Ot]=Mo[Ve]=Mo[Ge]=Mo[En]=Mo[fe]=Mo[se]=Mo[le]=Mo[Fe]=Mo[Me]=Mo[et]=Mo[Ue]=Mo[Xe]=Mo[it]=Mo[Tt]=Mo[He]=Mo[pe]=Mo[je]=Mo[Ae]=Mo[Et]=!0,Mo[ze]=Mo[ee]=Mo[ot]=!1;var i2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},WM={"&":"&","<":"<",">":">",'"':""","'":"'"},s2={"&":"&","<":"<",">":">",""":'"',"'":"'"},o2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},uI=parseFloat,r2=parseInt,GM=typeof dC=="object"&&dC&&dC.Object===Object&&dC,zM=typeof self=="object"&&self&&self.Object===Object&&self,Yr=GM||zM||Function("return this")(),Db=e&&!e.nodeType&&e,Ep=Db&&!0&&n&&!n.nodeType&&n,Hd=Ep&&Ep.exports===Db,dI=Hd&&GM.process,iu=function(){try{var bt=Ep&&Ep.require&&Ep.require("util").types;return bt||dI&&dI.binding&&dI.binding("util")}catch{}}(),KM=iu&&iu.isArrayBuffer,jM=iu&&iu.isDate,XM=iu&&iu.isMap,YM=iu&&iu.isRegExp,qM=iu&&iu.isSet,hI=iu&&iu.isTypedArray;function qr(bt,Yt,xt){switch(xt.length){case 0:return bt.call(Yt);case 1:return bt.call(Yt,xt[0]);case 2:return bt.call(Yt,xt[0],xt[1]);case 3:return bt.call(Yt,xt[0],xt[1],xt[2])}return bt.apply(Yt,xt)}function $b(bt,Yt,xt,ei){for(var Pi=-1,zs=bt==null?0:bt.length;++Pi<zs;){var Wr=bt[Pi];Yt(ei,Wr,xt(Wr),bt)}return ei}function Tc(bt,Yt){for(var xt=-1,ei=bt==null?0:bt.length;++xt<ei&&Yt(bt[xt],xt,bt)!==!1;);return bt}function l2(bt,Yt){for(var xt=bt==null?0:bt.length;xt--&&Yt(bt[xt],xt,bt)!==!1;);return bt}function JM(bt,Yt){for(var xt=-1,ei=bt==null?0:bt.length;++xt<ei;)if(!Yt(bt[xt],xt,bt))return!1;return!0}function ng(bt,Yt){for(var xt=-1,ei=bt==null?0:bt.length,Pi=0,zs=[];++xt<ei;){var Wr=bt[xt];Yt(Wr,xt,bt)&&(zs[Pi++]=Wr)}return zs}function Yy(bt,Yt){var xt=bt==null?0:bt.length;return!!xt&&Vd(bt,Yt,0)>-1}function fI(bt,Yt,xt){for(var ei=-1,Pi=bt==null?0:bt.length;++ei<Pi;)if(xt(Yt,bt[ei]))return!0;return!1}function qo(bt,Yt){for(var xt=-1,ei=bt==null?0:bt.length,Pi=Array(ei);++xt<ei;)Pi[xt]=Yt(bt[xt],xt,bt);return Pi}function ig(bt,Yt){for(var xt=-1,ei=Yt.length,Pi=bt.length;++xt<ei;)bt[Pi+xt]=Yt[xt];return bt}function gI(bt,Yt,xt,ei){var Pi=-1,zs=bt==null?0:bt.length;for(ei&&zs&&(xt=bt[++Pi]);++Pi<zs;)xt=Yt(xt,bt[Pi],Pi,bt);return xt}function QM(bt,Yt,xt,ei){var Pi=bt==null?0:bt.length;for(ei&&Pi&&(xt=bt[--Pi]);Pi--;)xt=Yt(xt,bt[Pi],Pi,bt);return xt}function pI(bt,Yt){for(var xt=-1,ei=bt==null?0:bt.length;++xt<ei;)if(Yt(bt[xt],xt,bt))return!0;return!1}var a2=su("length");function c2(bt){return bt.split("")}function u2(bt){return bt.match(un)||[]}function ZM(bt,Yt,xt){var ei;return xt(bt,function(Pi,zs,Wr){if(Yt(Pi,zs,Wr))return ei=zs,!1}),ei}function qy(bt,Yt,xt,ei){for(var Pi=bt.length,zs=xt+(ei?1:-1);ei?zs--:++zs<Pi;)if(Yt(bt[zs],zs,bt))return zs;return-1}function Vd(bt,Yt,xt){return Yt===Yt?m2(bt,Yt,xt):qy(bt,tk,xt)}function ek(bt,Yt,xt,ei){for(var Pi=xt-1,zs=bt.length;++Pi<zs;)if(ei(bt[Pi],Yt))return Pi;return-1}function tk(bt){return bt!==bt}function nk(bt,Yt){var xt=bt==null?0:bt.length;return xt?Jy(bt,Yt)/xt:ge}function su(bt){return function(Yt){return Yt==null?t:Yt[bt]}}function bo(bt){return function(Yt){return bt==null?t:bt[Yt]}}function Sp(bt,Yt,xt,ei,Pi){return Pi(bt,function(zs,Wr,To){xt=ei?(ei=!1,zs):Yt(xt,zs,Wr,To)}),xt}function d2(bt,Yt){var xt=bt.length;for(bt.sort(Yt);xt--;)bt[xt]=bt[xt].value;return bt}function Jy(bt,Yt){for(var xt,ei=-1,Pi=bt.length;++ei<Pi;){var zs=Yt(bt[ei]);zs!==t&&(xt=xt===t?zs:xt+zs)}return xt}function xb(bt,Yt){for(var xt=-1,ei=Array(bt);++xt<bt;)ei[xt]=Yt(xt);return ei}function Wu(bt,Yt){return qo(Yt,function(xt){return[xt,bt[xt]]})}function mI(bt){return bt&&bt.slice(0,vI(bt)+1).replace(De,"")}function Ia(bt){return function(Yt){return bt(Yt)}}function Qy(bt,Yt){return qo(Yt,function(xt){return bt[xt]})}function C_(bt,Yt){return bt.has(Yt)}function ik(bt,Yt){for(var xt=-1,ei=bt.length;++xt<ei&&Vd(Yt,bt[xt],0)>-1;);return xt}function sk(bt,Yt){for(var xt=bt.length;xt--&&Vd(Yt,bt[xt],0)>-1;);return xt}function h2(bt,Yt){for(var xt=bt.length,ei=0;xt--;)bt[xt]===Yt&&++ei;return ei}var ok=bo(i2),f2=bo(WM);function rk(bt){return"\\"+o2[bt]}function Zy(bt,Yt){return bt==null?t:bt[Yt]}function y_(bt){return yp.test(bt)}function g2(bt){return UM.test(bt)}function p2(bt){for(var Yt,xt=[];!(Yt=bt.next()).done;)xt.push(Yt.value);return xt}function _I(bt){var Yt=-1,xt=Array(bt.size);return bt.forEach(function(ei,Pi){xt[++Yt]=[Pi,ei]}),xt}function Pb(bt,Yt){return function(xt){return bt(Yt(xt))}}function Nh(bt,Yt){for(var xt=-1,ei=bt.length,Pi=0,zs=[];++xt<ei;){var Wr=bt[xt];(Wr===Yt||Wr===d)&&(bt[xt]=d,zs[Pi++]=xt)}return zs}function Fb(bt){var Yt=-1,xt=Array(bt.size);return bt.forEach(function(ei){xt[++Yt]=ei}),xt}function lk(bt){var Yt=-1,xt=Array(bt.size);return bt.forEach(function(ei){xt[++Yt]=[ei,ei]}),xt}function m2(bt,Yt,xt){for(var ei=xt-1,Pi=bt.length;++ei<Pi;)if(bt[ei]===Yt)return ei;return-1}function Bb(bt,Yt,xt){for(var ei=xt+1;ei--;)if(bt[ei]===Yt)return ei;return ei}function wp(bt){return y_(bt)?ck(bt):a2(bt)}function La(bt){return y_(bt)?Hb(bt):c2(bt)}function vI(bt){for(var Yt=bt.length;Yt--&&me.test(bt.charAt(Yt)););return Yt}var ak=bo(s2);function ck(bt){for(var Yt=cI.lastIndex=0;cI.test(bt);)++Yt;return Yt}function Hb(bt){return bt.match(cI)||[]}function bI(bt){return bt.match(e2)||[]}var TI=function bt(Yt){Yt=Yt==null?Yr:E_.defaults(Yr.Object(),Yt,E_.pick(Yr,t2));var xt=Yt.Array,ei=Yt.Date,Pi=Yt.Error,zs=Yt.Function,Wr=Yt.Math,To=Yt.Object,S_=Yt.RegExp,uk=Yt.String,ql=Yt.TypeError,w_=xt.prototype,Ud=zs.prototype,Ip=To.prototype,Vb=Yt["__core-js_shared__"],Ub=Ud.toString,no=Ip.hasOwnProperty,CI=0,yI=function(){var S=/[^.]+$/.exec(Vb&&Vb.keys&&Vb.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),Wb=Ip.toString,Gb=Ub.call(To),_2=Yr._,eE=S_("^"+Ub.call(no).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zb=Hd?Yt.Buffer:t,Dh=Yt.Symbol,tE=Yt.Uint8Array,nE=zb?zb.allocUnsafe:t,Kb=Pb(To.getPrototypeOf,To),dk=To.create,hk=Ip.propertyIsEnumerable,iE=w_.splice,fk=Dh?Dh.isConcatSpreadable:t,jb=Dh?Dh.iterator:t,Gu=Dh?Dh.toStringTag:t,Xb=function(){try{var S=Ka(To,"defineProperty");return S({},"",{}),S}catch{}}(),gk=Yt.clearTimeout!==Yr.clearTimeout&&Yt.clearTimeout,Yb=ei&&ei.now!==Yr.Date.now&&ei.now,EI=Yt.setTimeout!==Yr.setTimeout&&Yt.setTimeout,sE=Wr.ceil,oE=Wr.floor,rE=To.getOwnPropertySymbols,pk=zb?zb.isBuffer:t,$h=Yt.isFinite,mk=w_.join,_k=Pb(To.keys,To),Jr=Wr.max,Jl=Wr.min,v2=ei.now,b2=Yt.parseInt,xh=Wr.random,Lp=w_.reverse,qb=Ka(Yt,"DataView"),I_=Ka(Yt,"Map"),Jb=Ka(Yt,"Promise"),Op=Ka(Yt,"Set"),zu=Ka(Yt,"WeakMap"),sg=Ka(To,"create"),L_=zu&&new zu,og={},O_=ja(qb),vk=ja(I_),SI=ja(Jb),bk=ja(Op),Tr=ja(zu),lE=Dh?Dh.prototype:t,Ph=lE?lE.valueOf:t,rg=lE?lE.toString:t;function Be(S){if(Ar(S)&&!Xi(S)&&!(S instanceof bs)){if(S instanceof ou)return S;if(no.call(S,"__wrapped__"))return fg(S)}return new ou(S)}var Rl=function(){function S(){}return function(R){if(!Cr(R))return{};if(dk)return dk(R);S.prototype=R;var B=new S;return S.prototype=t,B}}();function aE(){}function ou(S,R){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!R,this.__index__=0,this.__values__=t}Be.templateSettings={escape:Ps,evaluate:ae,interpolate:xe,variable:"",imports:{_:Be}},Be.prototype=aE.prototype,Be.prototype.constructor=Be,ou.prototype=Rl(aE.prototype),ou.prototype.constructor=ou;function bs(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function T2(){var S=new bs(this.__wrapped__);return S.__actions__=Gr(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=Gr(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=Gr(this.__views__),S}function Tk(){if(this.__filtered__){var S=new bs(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function C2(){var S=this.__wrapped__.value(),R=this.__dir__,B=Xi(S),ne=R<0,Ce=B?S.length:0,Pe=_n(0,Ce,this.__views__),lt=Pe.start,ut=Pe.end,_t=ut-lt,Zt=ne?ut:lt-1,en=this.__iteratees__,an=en.length,Rn=0,qn=Jl(_t,this.__takeCount__);if(!B||!ne&&Ce==_t&&qn==_t)return Vk(S,this.__actions__);var Ei=[];e:for(;_t--&&Rn<qn;){Zt+=R;for(var Ui=-1,_i=S[Zt];++Ui<an;){var gs=en[Ui],Ts=gs.iteratee,Nc=gs.type,Ma=Ts(_i);if(Nc==q)_i=Ma;else if(!Ma){if(Nc==de)continue e;break e}}Ei[Rn++]=_i}return Ei}bs.prototype=Rl(aE.prototype),bs.prototype.constructor=bs;function lg(S){var R=-1,B=S==null?0:S.length;for(this.clear();++R<B;){var ne=S[R];this.set(ne[0],ne[1])}}function wI(){this.__data__=sg?sg(null):{},this.size=0}function y2(S){var R=this.has(S)&&delete this.__data__[S];return this.size-=R?1:0,R}function E2(S){var R=this.__data__;if(sg){var B=R[S];return B===c?t:B}return no.call(R,S)?R[S]:t}function S2(S){var R=this.__data__;return sg?R[S]!==t:no.call(R,S)}function Ck(S,R){var B=this.__data__;return this.size+=this.has(S)?0:1,B[S]=sg&&R===t?c:R,this}lg.prototype.clear=wI,lg.prototype.delete=y2,lg.prototype.get=E2,lg.prototype.has=S2,lg.prototype.set=Ck;function Ku(S){var R=-1,B=S==null?0:S.length;for(this.clear();++R<B;){var ne=S[R];this.set(ne[0],ne[1])}}function yk(){this.__data__=[],this.size=0}function II(S){var R=this.__data__,B=R_(R,S);if(B<0)return!1;var ne=R.length-1;return B==ne?R.pop():iE.call(R,B,1),--this.size,!0}function w2(S){var R=this.__data__,B=R_(R,S);return B<0?t:R[B][1]}function I2(S){return R_(this.__data__,S)>-1}function L2(S,R){var B=this.__data__,ne=R_(B,S);return ne<0?(++this.size,B.push([S,R])):B[ne][1]=R,this}Ku.prototype.clear=yk,Ku.prototype.delete=II,Ku.prototype.get=w2,Ku.prototype.has=I2,Ku.prototype.set=L2;function Fh(S){var R=-1,B=S==null?0:S.length;for(this.clear();++R<B;){var ne=S[R];this.set(ne[0],ne[1])}}function ci(){this.size=0,this.__data__={hash:new lg,map:new(I_||Ku),string:new lg}}function Cc(S){var R=Ju(this,S).delete(S);return this.size-=R?1:0,R}function pl(S){return Ju(this,S).get(S)}function Bo(S){return Ju(this,S).has(S)}function Bh(S,R){var B=Ju(this,S),ne=B.size;return B.set(S,R),this.size+=B.size==ne?0:1,this}Fh.prototype.clear=ci,Fh.prototype.delete=Cc,Fh.prototype.get=pl,Fh.prototype.has=Bo,Fh.prototype.set=Bh;function ju(S){var R=-1,B=S==null?0:S.length;for(this.__data__=new Fh;++R<B;)this.add(S[R])}function Vn(S){return this.__data__.set(S,c),this}function Mr(S){return this.__data__.has(S)}ju.prototype.add=ju.prototype.push=Vn,ju.prototype.has=Mr;function ru(S){var R=this.__data__=new Ku(S);this.size=R.size}function O2(){this.__data__=new Ku,this.size=0}function LI(S){var R=this.__data__,B=R.delete(S);return this.size=R.size,B}function Ek(S){return this.__data__.get(S)}function R2(S){return this.__data__.has(S)}function Sk(S,R){var B=this.__data__;if(B instanceof Ku){var ne=B.__data__;if(!I_||ne.length<s-1)return ne.push([S,R]),this.size=++B.size,this;B=this.__data__=new Fh(ne)}return B.set(S,R),this.size=B.size,this}ru.prototype.clear=O2,ru.prototype.delete=LI,ru.prototype.get=Ek,ru.prototype.has=R2,ru.prototype.set=Sk;function cE(S,R){var B=Xi(S),ne=!B&&J_(S),Ce=!B&&!ne&&Jh(S),Pe=!B&&!ne&&!Ce&&Vp(S),lt=B||ne||Ce||Pe,ut=lt?xb(S.length,uk):[],_t=ut.length;for(var Zt in S)(R||no.call(S,Zt))&&!(lt&&(Zt=="length"||Ce&&(Zt=="offset"||Zt=="parent")||Pe&&(Zt=="buffer"||Zt=="byteLength"||Zt=="byteOffset")||Xd(Zt,_t)))&&ut.push(Zt);return ut}function OI(S){var R=S.length;return R?S[WI(0,R-1)]:t}function wk(S,R){return Fi(Gr(S),Rp(R,0,S.length))}function M2(S){return Fi(Gr(S))}function uE(S,R,B){(B!==t&&!Ya(S[R],B)||B===t&&!(R in S))&&Hh(S,R,B)}function Qb(S,R,B){var ne=S[R];(!(no.call(S,R)&&Ya(ne,B))||B===t&&!(R in S))&&Hh(S,R,B)}function R_(S,R){for(var B=S.length;B--;)if(Ya(S[B][0],R))return B;return-1}function k2(S,R,B,ne){return Vh(S,function(Ce,Pe,lt){R(ne,Ce,B(Ce),lt)}),ne}function Ik(S,R){return S&&ta(R,ar(R),S)}function dE(S,R){return S&&ta(R,Nr(R),S)}function Hh(S,R,B){R=="__proto__"&&Xb?Xb(S,R,{configurable:!0,enumerable:!0,value:B,writable:!0}):S[R]=B}function RI(S,R){for(var B=-1,ne=R.length,Ce=xt(ne),Pe=S==null;++B<ne;)Ce[B]=Pe?t:Q_(S,R[B]);return Ce}function Rp(S,R,B){return S===S&&(B!==t&&(S=S<=B?S:B),R!==t&&(S=S>=R?S:R)),S}function Ql(S,R,B,ne,Ce,Pe){var lt,ut=R&f,_t=R&g,Zt=R&p;if(B&&(lt=Ce?B(S,ne,Ce,Pe):B(S)),lt!==t)return lt;if(!Cr(S))return S;var en=Xi(S);if(en){if(lt=ME(S),!ut)return Gr(S,lt)}else{var an=kl(S),Rn=an==ee||an==ye;if(Jh(S))return N_(S,ut);if(an==Ue||an==qe||Rn&&!Ce){if(lt=_t||Rn?{}:Kd(S),!ut)return _t?sT(S,dE(lt,S)):F_(S,Ik(lt,S))}else{if(!Mo[an])return Ce?S:{};lt=cu(S,an,ut)}}Pe||(Pe=new ru);var qn=Pe.get(S);if(qn)return qn;Pe.set(S,lt),wL(S)?S.forEach(function(_i){lt.add(Ql(_i,R,B,_i,S,Pe))}):Rc(S)&&S.forEach(function(_i,gs){lt.set(gs,Ql(_i,R,B,gs,S,Pe))});var Ei=Zt?_t?LE:ZI:_t?Nr:ar,Ui=en?t:Ei(S);return Tc(Ui||S,function(_i,gs){Ui&&(gs=_i,_i=S[gs]),Qb(lt,gs,Ql(_i,R,B,gs,S,Pe))}),lt}function A2(S){var R=ar(S);return function(B){return MI(B,S,R)}}function MI(S,R,B){var ne=B.length;if(S==null)return!ne;for(S=To(S);ne--;){var Ce=B[ne],Pe=R[Ce],lt=S[Ce];if(lt===t&&!(Ce in S)||!Pe(lt))return!1}return!0}function kI(S,R,B){if(typeof S!="function")throw new ql(r);return NE(function(){S.apply(t,B)},R)}function M_(S,R,B,ne){var Ce=-1,Pe=Yy,lt=!0,ut=S.length,_t=[],Zt=R.length;if(!ut)return _t;B&&(R=qo(R,Ia(B))),ne?(Pe=fI,lt=!1):R.length>=s&&(Pe=C_,lt=!1,R=new ju(R));e:for(;++Ce<ut;){var en=S[Ce],an=B==null?en:B(en);if(en=ne||en!==0?en:0,lt&&an===an){for(var Rn=Zt;Rn--;)if(R[Rn]===an)continue e;_t.push(en)}else Pe(R,an,ne)||_t.push(en)}return _t}var Vh=EE(Xu),hE=EE(gE,!0);function Lk(S,R){var B=!0;return Vh(S,function(ne,Ce,Pe){return B=!!R(ne,Ce,Pe),B}),B}function Mp(S,R,B){for(var ne=-1,Ce=S.length;++ne<Ce;){var Pe=S[ne],lt=R(Pe);if(lt!=null&&(ut===t?lt===lt&&!Mc(lt):B(lt,ut)))var ut=lt,_t=Pe}return _t}function Ok(S,R,B,ne){var Ce=S.length;for(B=Oi(B),B<0&&(B=-B>Ce?0:Ce+B),ne=ne===t||ne>Ce?Ce:Oi(ne),ne<0&&(ne+=Ce),ne=B>ne?0:zE(ne);B<ne;)S[B++]=R;return S}function AI(S,R){var B=[];return Vh(S,function(ne,Ce,Pe){R(ne,Ce,Pe)&&B.push(ne)}),B}function ml(S,R,B,ne,Ce){var Pe=-1,lt=S.length;for(B||(B=jd),Ce||(Ce=[]);++Pe<lt;){var ut=S[Pe];R>0&&B(ut)?R>1?ml(ut,R-1,B,ne,Ce):ig(Ce,ut):ne||(Ce[Ce.length]=ut)}return Ce}var fE=$p(),NI=$p(!0);function Xu(S,R){return S&&fE(S,R,ar)}function gE(S,R){return S&&NI(S,R,ar)}function Zb(S,R){return ng(R,function(B){return Qh(S[B])})}function ag(S,R){R=Wd(R,S);for(var B=0,ne=R.length;S!=null&&B<ne;)S=S[na(R[B++])];return B&&B==ne?S:t}function DI(S,R,B){var ne=R(S);return Xi(S)?ne:ig(ne,B(S))}function Zl(S){return S==null?S===t?ke:at:Gu&&Gu in To(S)?Qr(S):iL(S)}function pE(S,R){return S>R}function N2(S,R){return S!=null&&no.call(S,R)}function D2(S,R){return S!=null&&R in To(S)}function eT(S,R,B){return S>=Jl(R,B)&&S<Jr(R,B)}function mE(S,R,B){for(var ne=B?fI:Yy,Ce=S[0].length,Pe=S.length,lt=Pe,ut=xt(Pe),_t=1/0,Zt=[];lt--;){var en=S[lt];lt&&R&&(en=qo(en,Ia(R))),_t=Jl(en.length,_t),ut[lt]=!B&&(R||Ce>=120&&en.length>=120)?new ju(lt&&en):t}en=S[0];var an=-1,Rn=ut[0];e:for(;++an<Ce&&Zt.length<_t;){var qn=en[an],Ei=R?R(qn):qn;if(qn=B||qn!==0?qn:0,!(Rn?C_(Rn,Ei):ne(Zt,Ei,B))){for(lt=Pe;--lt;){var Ui=ut[lt];if(!(Ui?C_(Ui,Ei):ne(S[lt],Ei,B)))continue e}Rn&&Rn.push(Ei),Zt.push(qn)}}return Zt}function $2(S,R,B,ne){return Xu(S,function(Ce,Pe,lt){R(ne,B(Ce),Pe,lt)}),ne}function kp(S,R,B){R=Wd(R,S),S=kE(S,R);var ne=S==null?S:S[na(Zu(R))];return ne==null?t:qr(ne,S,B)}function $I(S){return Ar(S)&&Zl(S)==qe}function Rk(S){return Ar(S)&&Zl(S)==Gt}function Mk(S){return Ar(S)&&Zl(S)==Ge}function k_(S,R,B,ne,Ce){return S===R?!0:S==null||R==null||!Ar(S)&&!Ar(R)?S!==S&&R!==R:kk(S,R,B,ne,k_,Ce)}function kk(S,R,B,ne,Ce,Pe){var lt=Xi(S),ut=Xi(R),_t=lt?Re:kl(S),Zt=ut?Re:kl(R);_t=_t==qe?Ue:_t,Zt=Zt==qe?Ue:Zt;var en=_t==Ue,an=Zt==Ue,Rn=_t==Zt;if(Rn&&Jh(S)){if(!Jh(R))return!1;lt=!0,en=!1}if(Rn&&!en)return Pe||(Pe=new ru),lt||Vp(S)?Yk(S,R,B,ne,Ce,Pe):qk(S,R,_t,B,ne,Ce,Pe);if(!(B&_)){var qn=en&&no.call(S,"__wrapped__"),Ei=an&&no.call(R,"__wrapped__");if(qn||Ei){var Ui=qn?S.value():S,_i=Ei?R.value():R;return Pe||(Pe=new ru),Ce(Ui,_i,B,ne,Pe)}}return Rn?(Pe||(Pe=new ru),QI(S,R,B,ne,Ce,Pe)):!1}function Ak(S){return Ar(S)&&kl(S)==Me}function _E(S,R,B,ne){var Ce=B.length,Pe=Ce,lt=!ne;if(S==null)return!Pe;for(S=To(S);Ce--;){var ut=B[Ce];if(lt&&ut[2]?ut[1]!==S[ut[0]]:!(ut[0]in S))return!1}for(;++Ce<Pe;){ut=B[Ce];var _t=ut[0],Zt=S[_t],en=ut[1];if(lt&&ut[2]){if(Zt===t&&!(_t in S))return!1}else{var an=new ru;if(ne)var Rn=ne(Zt,en,_t,S,R,an);if(!(Rn===t?k_(en,Zt,_|v,ne,an):Rn))return!1}}return!0}function xI(S){if(!Cr(S)||ko(S))return!1;var R=Qh(S)?eE:vi;return R.test(ja(S))}function PI(S){return Ar(S)&&Zl(S)==Xe}function vE(S){return Ar(S)&&kl(S)==it}function Nk(S){return Ar(S)&&du(S.length)&&!!Fo[Zl(S)]}function Dk(S){return typeof S=="function"?S:S==null?Ja:typeof S=="object"?Xi(S)?HI(S[0],S[1]):BI(S):xL(S)}function bE(S){if(!Qu(S))return _k(S);var R=[];for(var B in To(S))no.call(S,B)&&B!="constructor"&&R.push(B);return R}function $k(S){if(!Cr(S))return kr(S);var R=Qu(S),B=[];for(var ne in S)ne=="constructor"&&(R||!no.call(S,ne))||B.push(ne);return B}function TE(S,R){return S<R}function FI(S,R){var B=-1,ne=Jo(S)?xt(S.length):[];return Vh(S,function(Ce,Pe,lt){ne[++B]=R(Ce,Pe,lt)}),ne}function BI(S){var R=tL(S);return R.length==1&&R[0][2]?Zk(R[0][0],R[0][1]):function(B){return B===S||_E(B,S,R)}}function HI(S,R){return zr(S)&&Qk(R)?Zk(na(S),R):function(B){var ne=Q_(B,S);return ne===t&&ne===R?Z_(B,S):k_(R,ne,_|v)}}function tT(S,R,B,ne,Ce){S!==R&&fE(R,function(Pe,lt){if(Ce||(Ce=new ru),Cr(Pe))x2(S,R,lt,B,tT,ne,Ce);else{var ut=ne?ne(V_(S,lt),Pe,lt+"",S,R,Ce):t;ut===t&&(ut=Pe),uE(S,lt,ut)}},Nr)}function x2(S,R,B,ne,Ce,Pe,lt){var ut=V_(S,B),_t=V_(R,B),Zt=lt.get(_t);if(Zt){uE(S,B,Zt);return}var en=Pe?Pe(ut,_t,B+"",S,R,lt):t,an=en===t;if(an){var Rn=Xi(_t),qn=!Rn&&Jh(_t),Ei=!Rn&&!qn&&Vp(_t);en=_t,Rn||qn||Ei?Xi(ut)?en=ut:No(ut)?en=Gr(ut):qn?(an=!1,en=N_(_t,!0)):Ei?(an=!1,en=$_(_t,!0)):en=[]:Vi(_t)||J_(_t)?(en=ut,J_(ut)?en=bB(ut):(!Cr(ut)||Qh(ut))&&(en=Kd(_t))):an=!1}an&&(lt.set(_t,en),Ce(en,_t,ne,Pe,lt),lt.delete(_t)),uE(S,B,en)}function VI(S,R){var B=S.length;if(B)return R+=R<0?B:0,Xd(R,B)?S[R]:t}function xk(S,R,B){R.length?R=qo(R,function(Pe){return Xi(Pe)?function(lt){return ag(lt,Pe.length===1?Pe[0]:Pe)}:Pe}):R=[Ja];var ne=-1;R=qo(R,Ia(Ti()));var Ce=FI(S,function(Pe,lt,ut){var _t=qo(R,function(Zt){return Zt(Pe)});return{criteria:_t,index:++ne,value:Pe}});return d2(Ce,function(Pe,lt){return iT(Pe,lt,B)})}function P2(S,R){return Pk(S,R,function(B,ne){return Z_(S,ne)})}function Pk(S,R,B){for(var ne=-1,Ce=R.length,Pe={};++ne<Ce;){var lt=R[ne],ut=ag(S,lt);B(ut,lt)&&Yu(Pe,Wd(lt,S),ut)}return Pe}function F2(S){return function(R){return ag(R,S)}}function UI(S,R,B,ne){var Ce=ne?ek:Vd,Pe=-1,lt=R.length,ut=S;for(S===R&&(R=Gr(R)),B&&(ut=qo(S,Ia(B)));++Pe<lt;)for(var _t=0,Zt=R[Pe],en=B?B(Zt):Zt;(_t=Ce(ut,en,_t,ne))>-1;)ut!==S&&iE.call(ut,_t,1),iE.call(S,_t,1);return S}function Fk(S,R){for(var B=S?R.length:0,ne=B-1;B--;){var Ce=R[B];if(B==ne||Ce!==Pe){var Pe=Ce;Xd(Ce)?iE.call(S,Ce,1):KI(S,Ce)}}return S}function WI(S,R){return S+oE(xh()*(R-S+1))}function B2(S,R,B,ne){for(var Ce=-1,Pe=Jr(sE((R-S)/(B||1)),0),lt=xt(Pe);Pe--;)lt[ne?Pe:++Ce]=S,S+=B;return lt}function GI(S,R){var B="";if(!S||R<1||R>Z)return B;do R%2&&(B+=S),R=oE(R/2),R&&(S+=S);while(R);return B}function os(S,R){return xp(sL(S,R,Ja),S+"")}function H2(S){return OI(tv(S))}function gi(S,R){var B=tv(S);return Fi(B,Rp(R,0,B.length))}function Yu(S,R,B,ne){if(!Cr(S))return S;R=Wd(R,S);for(var Ce=-1,Pe=R.length,lt=Pe-1,ut=S;ut!=null&&++Ce<Pe;){var _t=na(R[Ce]),Zt=B;if(_t==="__proto__"||_t==="constructor"||_t==="prototype")return S;if(Ce!=lt){var en=ut[_t];Zt=ne?ne(en,_t,ut):t,Zt===t&&(Zt=Cr(en)?en:Xd(R[Ce+1])?[]:{})}Qb(ut,_t,Zt),ut=ut[_t]}return S}var V2=L_?function(S,R){return L_.set(S,R),S}:Ja,zI=Xb?function(S,R){return Xb(S,"toString",{configurable:!0,enumerable:!1,value:JA(R),writable:!0})}:Ja;function Uh(S){return Fi(tv(S))}function Jt(S,R,B){var ne=-1,Ce=S.length;R<0&&(R=-R>Ce?0:Ce+R),B=B>Ce?Ce:B,B<0&&(B+=Ce),Ce=R>B?0:B-R>>>0,R>>>=0;for(var Pe=xt(Ce);++ne<Ce;)Pe[ne]=S[ne+R];return Pe}function cg(S,R){var B;return Vh(S,function(ne,Ce,Pe){return B=R(ne,Ce,Pe),!B}),!!B}function ea(S,R,B){var ne=0,Ce=S==null?ne:S.length;if(typeof R=="number"&&R===R&&Ce<=Ee){for(;ne<Ce;){var Pe=ne+Ce>>>1,lt=S[Pe];lt!==null&&!Mc(lt)&&(B?lt<=R:lt<R)?ne=Pe+1:Ce=Pe}return Ce}return A_(S,R,Ja,B)}function A_(S,R,B,ne){var Ce=0,Pe=S==null?0:S.length;if(Pe===0)return 0;R=B(R);for(var lt=R!==R,ut=R===null,_t=Mc(R),Zt=R===t;Ce<Pe;){var en=oE((Ce+Pe)/2),an=B(S[en]),Rn=an!==t,qn=an===null,Ei=an===an,Ui=Mc(an);if(lt)var _i=ne||Ei;else Zt?_i=Ei&&(ne||Rn):ut?_i=Ei&&Rn&&(ne||!qn):_t?_i=Ei&&Rn&&!qn&&(ne||!Ui):qn||Ui?_i=!1:_i=ne?an<=R:an<R;_i?Ce=en+1:Pe=en}return Jl(Pe,Le)}function Bk(S,R){for(var B=-1,ne=S.length,Ce=0,Pe=[];++B<ne;){var lt=S[B],ut=R?R(lt):lt;if(!B||!Ya(ut,_t)){var _t=ut;Pe[Ce++]=lt===0?0:lt}}return Pe}function Hk(S){return typeof S=="number"?S:Mc(S)?ge:+S}function yc(S){if(typeof S=="string")return S;if(Xi(S))return qo(S,yc)+"";if(Mc(S))return rg?rg.call(S):"";var R=S+"";return R=="0"&&1/S==-re?"-0":R}function lu(S,R,B){var ne=-1,Ce=Yy,Pe=S.length,lt=!0,ut=[],_t=ut;if(B)lt=!1,Ce=fI;else if(Pe>=s){var Zt=R?null:qI(S);if(Zt)return Fb(Zt);lt=!1,Ce=C_,_t=new ju}else _t=R?[]:ut;e:for(;++ne<Pe;){var en=S[ne],an=R?R(en):en;if(en=B||en!==0?en:0,lt&&an===an){for(var Rn=_t.length;Rn--;)if(_t[Rn]===an)continue e;R&&_t.push(an),ut.push(en)}else Ce(_t,an,B)||(_t!==ut&&_t.push(an),ut.push(en))}return ut}function KI(S,R){return R=Wd(R,S),S=kE(S,R),S==null||delete S[na(Zu(R))]}function Ml(S,R,B,ne){return Yu(S,R,B(ag(S,R)),ne)}function CE(S,R,B,ne){for(var Ce=S.length,Pe=ne?Ce:-1;(ne?Pe--:++Pe<Ce)&&R(S[Pe],Pe,S););return B?Jt(S,ne?0:Pe,ne?Pe+1:Ce):Jt(S,ne?Pe+1:0,ne?Ce:Pe)}function Vk(S,R){var B=S;return B instanceof bs&&(B=B.value()),gI(R,function(ne,Ce){return Ce.func.apply(Ce.thisArg,ig([ne],Ce.args))},B)}function Uk(S,R,B){var ne=S.length;if(ne<2)return ne?lu(S[0]):[];for(var Ce=-1,Pe=xt(ne);++Ce<ne;)for(var lt=S[Ce],ut=-1;++ut<ne;)ut!=Ce&&(Pe[Ce]=M_(Pe[Ce]||lt,S[ut],R,B));return lu(ml(Pe,1),R,B)}function jI(S,R,B){for(var ne=-1,Ce=S.length,Pe=R.length,lt={};++ne<Ce;){var ut=ne<Pe?R[ne]:t;B(lt,S[ne],ut)}return lt}function yE(S){return No(S)?S:[]}function Ap(S){return typeof S=="function"?S:Ja}function Wd(S,R){return Xi(S)?S:zr(S,R)?[S]:nA(as(S))}var Np=os;function za(S,R,B){var ne=S.length;return B=B===t?ne:B,!R&&B>=ne?S:Jt(S,R,B)}var Dp=gk||function(S){return Yr.clearTimeout(S)};function N_(S,R){if(R)return S.slice();var B=S.length,ne=nE?nE(B):new S.constructor(B);return S.copy(ne),ne}function nT(S){var R=new S.constructor(S.byteLength);return new tE(R).set(new tE(S)),R}function D_(S,R){var B=R?nT(S.buffer):S.buffer;return new S.constructor(B,S.byteOffset,S.byteLength)}function ug(S){var R=new S.constructor(S.source,Fn.exec(S));return R.lastIndex=S.lastIndex,R}function dg(S){return Ph?To(Ph.call(S)):{}}function $_(S,R){var B=R?nT(S.buffer):S.buffer;return new S.constructor(B,S.byteOffset,S.length)}function Gd(S,R){if(S!==R){var B=S!==t,ne=S===null,Ce=S===S,Pe=Mc(S),lt=R!==t,ut=R===null,_t=R===R,Zt=Mc(R);if(!ut&&!Zt&&!Pe&&S>R||Pe&<&&_t&&!ut&&!Zt||ne&<&&_t||!B&&_t||!Ce)return 1;if(!ne&&!Pe&&!Zt&&S<R||Zt&&B&&Ce&&!ne&&!Pe||ut&&B&&Ce||!lt&&Ce||!_t)return-1}return 0}function iT(S,R,B){for(var ne=-1,Ce=S.criteria,Pe=R.criteria,lt=Ce.length,ut=B.length;++ne<lt;){var _t=Gd(Ce[ne],Pe[ne]);if(_t){if(ne>=ut)return _t;var Zt=B[ne];return _t*(Zt=="desc"?-1:1)}}return S.index-R.index}function x_(S,R,B,ne){for(var Ce=-1,Pe=S.length,lt=B.length,ut=-1,_t=R.length,Zt=Jr(Pe-lt,0),en=xt(_t+Zt),an=!ne;++ut<_t;)en[ut]=R[ut];for(;++Ce<lt;)(an||Ce<Pe)&&(en[B[Ce]]=S[Ce]);for(;Zt--;)en[ut++]=S[Ce++];return en}function P_(S,R,B,ne){for(var Ce=-1,Pe=S.length,lt=-1,ut=B.length,_t=-1,Zt=R.length,en=Jr(Pe-ut,0),an=xt(en+Zt),Rn=!ne;++Ce<en;)an[Ce]=S[Ce];for(var qn=Ce;++_t<Zt;)an[qn+_t]=R[_t];for(;++lt<ut;)(Rn||Ce<Pe)&&(an[qn+B[lt]]=S[Ce++]);return an}function Gr(S,R){var B=-1,ne=S.length;for(R||(R=xt(ne));++B<ne;)R[B]=S[B];return R}function ta(S,R,B,ne){var Ce=!B;B||(B={});for(var Pe=-1,lt=R.length;++Pe<lt;){var ut=R[Pe],_t=ne?ne(B[ut],S[ut],ut,B,S):t;_t===t&&(_t=S[ut]),Ce?Hh(B,ut,_t):Qb(B,ut,_t)}return B}function F_(S,R){return ta(S,RE(S),R)}function sT(S,R){return ta(S,nL(S),R)}function au(S,R){return function(B,ne){var Ce=Xi(B)?$b:k2,Pe=R?R():{};return Ce(B,S,Ti(ne,2),Pe)}}function qu(S){return os(function(R,B){var ne=-1,Ce=B.length,Pe=Ce>1?B[Ce-1]:t,lt=Ce>2?B[2]:t;for(Pe=S.length>3&&typeof Pe=="function"?(Ce--,Pe):t,lt&&Al(B[0],B[1],lt)&&(Pe=Ce<3?t:Pe,Ce=1),R=To(R);++ne<Ce;){var ut=B[ne];ut&&S(R,ut,ne,Pe)}return R})}function EE(S,R){return function(B,ne){if(B==null)return B;if(!Jo(B))return S(B,ne);for(var Ce=B.length,Pe=R?Ce:-1,lt=To(B);(R?Pe--:++Pe<Ce)&&ne(lt[Pe],Pe,lt)!==!1;);return B}}function $p(S){return function(R,B,ne){for(var Ce=-1,Pe=To(R),lt=ne(R),ut=lt.length;ut--;){var _t=lt[S?ut:++Ce];if(B(Pe[_t],_t,Pe)===!1)break}return R}}function XI(S,R,B){var ne=R&C,Ce=Ec(S);function Pe(){var lt=this&&this!==Yr&&this instanceof Pe?Ce:S;return lt.apply(ne?B:this,arguments)}return Pe}function Oa(S){return function(R){R=as(R);var B=y_(R)?La(R):t,ne=B?B[0]:R.charAt(0),Ce=B?za(B,1).join(""):R.slice(1);return ne[S]()+Ce}}function zd(S){return function(R){return gI(NB(VA(R).replace(Ah,"")),S,"")}}function Ec(S){return function(){var R=arguments;switch(R.length){case 0:return new S;case 1:return new S(R[0]);case 2:return new S(R[0],R[1]);case 3:return new S(R[0],R[1],R[2]);case 4:return new S(R[0],R[1],R[2],R[3]);case 5:return new S(R[0],R[1],R[2],R[3],R[4]);case 6:return new S(R[0],R[1],R[2],R[3],R[4],R[5]);case 7:return new S(R[0],R[1],R[2],R[3],R[4],R[5],R[6])}var B=Rl(S.prototype),ne=S.apply(B,R);return Cr(ne)?ne:B}}function Wk(S,R,B){var ne=Ec(S);function Ce(){for(var Pe=arguments.length,lt=xt(Pe),ut=Pe,_t=B_(Ce);ut--;)lt[ut]=arguments[ut];var Zt=Pe<3&<[0]!==_t&<[Pe-1]!==_t?[]:Nh(lt,_t);if(Pe-=Zt.length,Pe<B)return Kk(S,R,SE,Ce.placeholder,t,lt,Zt,t,t,B-Pe);var en=this&&this!==Yr&&this instanceof Ce?ne:S;return qr(en,this,lt)}return Ce}function YI(S){return function(R,B,ne){var Ce=To(R);if(!Jo(R)){var Pe=Ti(B,3);R=ar(R),B=function(ut){return Pe(Ce[ut],ut,Ce)}}var lt=S(R,B,ne);return lt>-1?Ce[Pe?R[lt]:lt]:t}}function U2(S){return Sc(function(R){var B=R.length,ne=B,Ce=ou.prototype.thru;for(S&&R.reverse();ne--;){var Pe=R[ne];if(typeof Pe!="function")throw new ql(r);if(Ce&&!lt&&eL(Pe)=="wrapper")var lt=new ou([],!0)}for(ne=lt?ne:B;++ne<B;){Pe=R[ne];var ut=eL(Pe),_t=ut=="wrapper"?OE(Pe):t;_t&&lo(_t[0])&&_t[1]==(N|I|O|D)&&!_t[4].length&&_t[9]==1?lt=lt[eL(_t[0])].apply(lt,_t[3]):lt=Pe.length==1&&lo(Pe)?lt[ut]():lt.thru(Pe)}return function(){var Zt=arguments,en=Zt[0];if(lt&&Zt.length==1&&Xi(en))return lt.plant(en).value();for(var an=0,Rn=B?R[an].apply(this,Zt):en;++an<B;)Rn=R[an].call(this,Rn);return Rn}})}function SE(S,R,B,ne,Ce,Pe,lt,ut,_t,Zt){var en=R&N,an=R&C,Rn=R&y,qn=R&(I|L),Ei=R&P,Ui=Rn?t:Ec(S);function _i(){for(var gs=arguments.length,Ts=xt(gs),Nc=gs;Nc--;)Ts[Nc]=arguments[Nc];if(qn)var Ma=B_(_i),tl=h2(Ts,Ma);if(ne&&(Ts=x_(Ts,ne,Ce,qn)),Pe&&(Ts=P_(Ts,Pe,lt,qn)),gs-=tl,qn&&gs<Zt){var Dr=Nh(Ts,Ma);return Kk(S,R,SE,_i.placeholder,B,Ts,Dr,ut,_t,Zt-gs)}var id=an?B:this,of=Rn?id[S]:S;return gs=Ts.length,ut?Ts=AE(Ts,ut):Ei&&gs>1&&Ts.reverse(),en&&_t<gs&&(Ts.length=_t),this&&this!==Yr&&this instanceof _i&&(of=Ui||Ec(of)),of.apply(id,Ts)}return _i}function wE(S,R){return function(B,ne){return $2(B,S,R(ne),{})}}function Wh(S,R){return function(B,ne){var Ce;if(B===t&&ne===t)return R;if(B!==t&&(Ce=B),ne!==t){if(Ce===t)return ne;typeof B=="string"||typeof ne=="string"?(B=yc(B),ne=yc(ne)):(B=Hk(B),ne=Hk(ne)),Ce=S(B,ne)}return Ce}}function oT(S){return Sc(function(R){return R=qo(R,Ia(Ti())),os(function(B){var ne=this;return S(R,function(Ce){return qr(Ce,ne,B)})})})}function Gh(S,R){R=R===t?" ":yc(R);var B=R.length;if(B<2)return B?GI(R,S):R;var ne=GI(R,sE(S/wp(R)));return y_(R)?za(La(ne),0,S).join(""):ne.slice(0,S)}function Gk(S,R,B,ne){var Ce=R&C,Pe=Ec(S);function lt(){for(var ut=-1,_t=arguments.length,Zt=-1,en=ne.length,an=xt(en+_t),Rn=this&&this!==Yr&&this instanceof lt?Pe:S;++Zt<en;)an[Zt]=ne[Zt];for(;_t--;)an[Zt++]=arguments[++ut];return qr(Rn,Ce?B:this,an)}return lt}function zk(S){return function(R,B,ne){return ne&&typeof ne!="number"&&Al(R,B,ne)&&(B=ne=t),R=Zh(R),B===t?(B=R,R=0):B=Zh(B),ne=ne===t?R<B?1:-1:Zh(ne),B2(R,B,ne,S)}}function IE(S){return function(R,B){return typeof R=="string"&&typeof B=="string"||(R=Ho(R),B=Ho(B)),S(R,B)}}function Kk(S,R,B,ne,Ce,Pe,lt,ut,_t,Zt){var en=R&I,an=en?lt:t,Rn=en?t:lt,qn=en?Pe:t,Ei=en?t:Pe;R|=en?O:A,R&=~(en?A:O),R&w||(R&=~(C|y));var Ui=[S,R,Ce,qn,an,Ei,Rn,ut,_t,Zt],_i=B.apply(t,Ui);return lo(S)&&eA(_i,Ui),_i.placeholder=ne,oL(_i,S,R)}function rT(S){var R=Wr[S];return function(B,ne){if(B=Ho(B),ne=ne==null?0:Jl(Oi(ne),292),ne&&$h(B)){var Ce=(as(B)+"e").split("e"),Pe=R(Ce[0]+"e"+(+Ce[1]+ne));return Ce=(as(Pe)+"e").split("e"),+(Ce[0]+"e"+(+Ce[1]-ne))}return R(B)}}var qI=Op&&1/Fb(new Op([,-0]))[1]==re?function(S){return new Op(S)}:$L;function JI(S){return function(R){var B=kl(R);return B==Me?_I(R):B==it?lk(R):Wu(R,S(R))}}function zh(S,R,B,ne,Ce,Pe,lt,ut){var _t=R&y;if(!_t&&typeof S!="function")throw new ql(r);var Zt=ne?ne.length:0;if(Zt||(R&=~(O|A),ne=Ce=t),lt=lt===t?lt:Jr(Oi(lt),0),ut=ut===t?ut:Oi(ut),Zt-=Ce?Ce.length:0,R&A){var en=ne,an=Ce;ne=Ce=t}var Rn=_t?t:OE(S),qn=[S,R,B,ne,Ce,en,an,Pe,lt,ut];if(Rn&&H_(qn,Rn),S=qn[0],R=qn[1],B=qn[2],ne=qn[3],Ce=qn[4],ut=qn[9]=qn[9]===t?_t?0:S.length:Jr(qn[9]-Zt,0),!ut&&R&(I|L)&&(R&=~(I|L)),!R||R==C)var Ei=XI(S,R,B);else R==I||R==L?Ei=Wk(S,R,ut):(R==O||R==(C|O))&&!Ce.length?Ei=Gk(S,R,B,ne):Ei=SE.apply(t,qn);var Ui=Rn?V2:eA;return oL(Ui(Ei,qn),S,R)}function jk(S,R,B,ne){return S===t||Ya(S,Ip[B])&&!no.call(ne,B)?R:S}function Xk(S,R,B,ne,Ce,Pe){return Cr(S)&&Cr(R)&&(Pe.set(R,S),tT(S,R,t,Xk,Pe),Pe.delete(R)),S}function AG(S){return Vi(S)?t:S}function Yk(S,R,B,ne,Ce,Pe){var lt=B&_,ut=S.length,_t=R.length;if(ut!=_t&&!(lt&&_t>ut))return!1;var Zt=Pe.get(S),en=Pe.get(R);if(Zt&&en)return Zt==R&&en==S;var an=-1,Rn=!0,qn=B&v?new ju:t;for(Pe.set(S,R),Pe.set(R,S);++an<ut;){var Ei=S[an],Ui=R[an];if(ne)var _i=lt?ne(Ui,Ei,an,R,S,Pe):ne(Ei,Ui,an,S,R,Pe);if(_i!==t){if(_i)continue;Rn=!1;break}if(qn){if(!pI(R,function(gs,Ts){if(!C_(qn,Ts)&&(Ei===gs||Ce(Ei,gs,B,ne,Pe)))return qn.push(Ts)})){Rn=!1;break}}else if(!(Ei===Ui||Ce(Ei,Ui,B,ne,Pe))){Rn=!1;break}}return Pe.delete(S),Pe.delete(R),Rn}function qk(S,R,B,ne,Ce,Pe,lt){switch(B){case Ot:if(S.byteLength!=R.byteLength||S.byteOffset!=R.byteOffset)return!1;S=S.buffer,R=R.buffer;case Gt:return!(S.byteLength!=R.byteLength||!Pe(new tE(S),new tE(R)));case Ve:case Ge:case et:return Ya(+S,+R);case ze:return S.name==R.name&&S.message==R.message;case Xe:case Tt:return S==R+"";case Me:var ut=_I;case it:var _t=ne&_;if(ut||(ut=Fb),S.size!=R.size&&!_t)return!1;var Zt=lt.get(S);if(Zt)return Zt==R;ne|=v,lt.set(S,R);var en=Yk(ut(S),ut(R),ne,Ce,Pe,lt);return lt.delete(S),en;case He:if(Ph)return Ph.call(S)==Ph.call(R)}return!1}function QI(S,R,B,ne,Ce,Pe){var lt=B&_,ut=ZI(S),_t=ut.length,Zt=ZI(R),en=Zt.length;if(_t!=en&&!lt)return!1;for(var an=_t;an--;){var Rn=ut[an];if(!(lt?Rn in R:no.call(R,Rn)))return!1}var qn=Pe.get(S),Ei=Pe.get(R);if(qn&&Ei)return qn==R&&Ei==S;var Ui=!0;Pe.set(S,R),Pe.set(R,S);for(var _i=lt;++an<_t;){Rn=ut[an];var gs=S[Rn],Ts=R[Rn];if(ne)var Nc=lt?ne(Ts,gs,Rn,R,S,Pe):ne(gs,Ts,Rn,S,R,Pe);if(!(Nc===t?gs===Ts||Ce(gs,Ts,B,ne,Pe):Nc)){Ui=!1;break}_i||(_i=Rn=="constructor")}if(Ui&&!_i){var Ma=S.constructor,tl=R.constructor;Ma!=tl&&"constructor"in S&&"constructor"in R&&!(typeof Ma=="function"&&Ma instanceof Ma&&typeof tl=="function"&&tl instanceof tl)&&(Ui=!1)}return Pe.delete(S),Pe.delete(R),Ui}function Sc(S){return xp(sL(S,t,cT),S+"")}function ZI(S){return DI(S,ar,RE)}function LE(S){return DI(S,Nr,nL)}var OE=L_?function(S){return L_.get(S)}:$L;function eL(S){for(var R=S.name+"",B=og[R],ne=no.call(og,R)?B.length:0;ne--;){var Ce=B[ne],Pe=Ce.func;if(Pe==null||Pe==S)return Ce.name}return R}function B_(S){var R=no.call(Be,"placeholder")?Be:S;return R.placeholder}function Ti(){var S=Be.iteratee||Bs;return S=S===Bs?Dk:S,arguments.length?S(arguments[0],arguments[1]):S}function Ju(S,R){var B=S.__data__;return pt(R)?B[typeof R=="string"?"string":"hash"]:B.map}function tL(S){for(var R=ar(S),B=R.length;B--;){var ne=R[B],Ce=S[ne];R[B]=[ne,Ce,Qk(Ce)]}return R}function Ka(S,R){var B=Zy(S,R);return xI(B)?B:t}function Qr(S){var R=no.call(S,Gu),B=S[Gu];try{S[Gu]=t;var ne=!0}catch{}var Ce=Wb.call(S);return ne&&(R?S[Gu]=B:delete S[Gu]),Ce}var RE=rE?function(S){return S==null?[]:(S=To(S),ng(rE(S),function(R){return hk.call(S,R)}))}:FL,nL=rE?function(S){for(var R=[];S;)ig(R,RE(S)),S=Kb(S);return R}:FL,kl=Zl;(qb&&kl(new qb(new ArrayBuffer(1)))!=Ot||I_&&kl(new I_)!=Me||Jb&&kl(Jb.resolve())!=Se||Op&&kl(new Op)!=it||zu&&kl(new zu)!=ot)&&(kl=function(S){var R=Zl(S),B=R==Ue?S.constructor:t,ne=B?ja(B):"";if(ne)switch(ne){case O_:return Ot;case vk:return Me;case SI:return Se;case bk:return it;case Tr:return ot}return R});function _n(S,R,B){for(var ne=-1,Ce=B.length;++ne<Ce;){var Pe=B[ne],lt=Pe.size;switch(Pe.type){case"drop":S+=lt;break;case"dropRight":R-=lt;break;case"take":R=Jl(R,S+lt);break;case"takeRight":S=Jr(S,R-lt);break}}return{start:S,end:R}}function W2(S){var R=S.match(It);return R?R[1].split(kt):[]}function Jk(S,R,B){R=Wd(R,S);for(var ne=-1,Ce=R.length,Pe=!1;++ne<Ce;){var lt=na(R[ne]);if(!(Pe=S!=null&&B(S,lt)))break;S=S[lt]}return Pe||++ne!=Ce?Pe:(Ce=S==null?0:S.length,!!Ce&&du(Ce)&&Xd(lt,Ce)&&(Xi(S)||J_(S)))}function ME(S){var R=S.length,B=new S.constructor(R);return R&&typeof S[0]=="string"&&no.call(S,"index")&&(B.index=S.index,B.input=S.input),B}function Kd(S){return typeof S.constructor=="function"&&!Qu(S)?Rl(Kb(S)):{}}function cu(S,R,B){var ne=S.constructor;switch(R){case Gt:return nT(S);case Ve:case Ge:return new ne(+S);case Ot:return D_(S,B);case En:case fe:case se:case le:case Fe:case pe:case je:case Ae:case Et:return $_(S,B);case Me:return new ne;case et:case Tt:return new ne(S);case Xe:return ug(S);case it:return new ne;case He:return dg(S)}}function hg(S,R){var B=R.length;if(!B)return S;var ne=B-1;return R[ne]=(B>1?"& ":"")+R[ne],R=R.join(B>2?", ":" "),S.replace(tt,`{
- /* [wrapped with `+R+`] */
- `)}function jd(S){return Xi(S)||J_(S)||!!(fk&&S&&S[fk])}function Xd(S,R){var B=typeof S;return R=R??Z,!!R&&(B=="number"||B!="symbol"&&gl.test(S))&&S>-1&&S%1==0&&S<R}function Al(S,R,B){if(!Cr(B))return!1;var ne=typeof R;return(ne=="number"?Jo(B)&&Xd(R,B.length):ne=="string"&&R in B)?Ya(B[R],S):!1}function zr(S,R){if(Xi(S))return!1;var B=typeof S;return B=="number"||B=="symbol"||B=="boolean"||S==null||Mc(S)?!0:j.test(S)||!H.test(S)||R!=null&&S in To(R)}function pt(S){var R=typeof S;return R=="string"||R=="number"||R=="symbol"||R=="boolean"?S!=="__proto__":S===null}function lo(S){var R=eL(S),B=Be[R];if(typeof B!="function"||!(R in bs.prototype))return!1;if(S===B)return!0;var ne=OE(B);return!!ne&&S===ne[0]}function ko(S){return!!yI&&yI in S}var G2=Vb?Qh:iv;function Qu(S){var R=S&&S.constructor,B=typeof R=="function"&&R.prototype||Ip;return S===B}function Qk(S){return S===S&&!Cr(S)}function Zk(S,R){return function(B){return B==null?!1:B[S]===R&&(R!==t||S in To(B))}}function NG(S){var R=UE(S,function(ne){return B.size===u&&B.clear(),ne}),B=R.cache;return R}function H_(S,R){var B=S[1],ne=R[1],Ce=B|ne,Pe=Ce<(C|y|N),lt=ne==N&&B==I||ne==N&&B==D&&S[7].length<=R[8]||ne==(N|D)&&R[7].length<=R[8]&&B==I;if(!(Pe||lt))return S;ne&C&&(S[2]=R[2],Ce|=B&C?0:w);var ut=R[3];if(ut){var _t=S[3];S[3]=_t?x_(_t,ut,R[4]):ut,S[4]=_t?Nh(S[3],d):R[4]}return ut=R[5],ut&&(_t=S[5],S[5]=_t?P_(_t,ut,R[6]):ut,S[6]=_t?Nh(S[5],d):R[6]),ut=R[7],ut&&(S[7]=ut),ne&N&&(S[8]=S[8]==null?R[8]:Jl(S[8],R[8])),S[9]==null&&(S[9]=R[9]),S[0]=R[0],S[1]=Ce,S}function kr(S){var R=[];if(S!=null)for(var B in To(S))R.push(B);return R}function iL(S){return Wb.call(S)}function sL(S,R,B){return R=Jr(R===t?S.length-1:R,0),function(){for(var ne=arguments,Ce=-1,Pe=Jr(ne.length-R,0),lt=xt(Pe);++Ce<Pe;)lt[Ce]=ne[R+Ce];Ce=-1;for(var ut=xt(R+1);++Ce<R;)ut[Ce]=ne[Ce];return ut[R]=B(lt),qr(S,this,ut)}}function kE(S,R){return R.length<2?S:ag(S,Jt(R,0,-1))}function AE(S,R){for(var B=S.length,ne=Jl(R.length,B),Ce=Gr(S);ne--;){var Pe=R[ne];S[ne]=Xd(Pe,B)?Ce[Pe]:t}return S}function V_(S,R){if(!(R==="constructor"&&typeof S[R]=="function")&&R!="__proto__")return S[R]}var eA=tA(V2),NE=EI||function(S,R){return Yr.setTimeout(S,R)},xp=tA(zI);function oL(S,R,B){var ne=R+"";return xp(S,hg(ne,lT(W2(ne),B)))}function tA(S){var R=0,B=0;return function(){var ne=v2(),Ce=Q-(ne-B);if(B=ne,Ce>0){if(++R>=U)return arguments[0]}else R=0;return S.apply(t,arguments)}}function Fi(S,R){var B=-1,ne=S.length,Ce=ne-1;for(R=R===t?ne:R;++B<R;){var Pe=WI(B,Ce),lt=S[Pe];S[Pe]=S[B],S[B]=lt}return S.length=R,S}var nA=NG(function(S){var R=[];return S.charCodeAt(0)===46&&R.push(""),S.replace(ue,function(B,ne,Ce,Pe){R.push(Ce?Pe.replace(Ft,"$1"):ne||B)}),R});function na(S){if(typeof S=="string"||Mc(S))return S;var R=S+"";return R=="0"&&1/S==-re?"-0":R}function ja(S){if(S!=null){try{return Ub.call(S)}catch{}try{return S+""}catch{}}return""}function lT(S,R){return Tc(Ne,function(B){var ne="_."+B[0];R&B[1]&&!Yy(S,ne)&&S.push(ne)}),S.sort()}function fg(S){if(S instanceof bs)return S.clone();var R=new ou(S.__wrapped__,S.__chain__);return R.__actions__=Gr(S.__actions__),R.__index__=S.__index__,R.__values__=S.__values__,R}function U_(S,R,B){(B?Al(S,R,B):R===t)?R=1:R=Jr(Oi(R),0);var ne=S==null?0:S.length;if(!ne||R<1)return[];for(var Ce=0,Pe=0,lt=xt(sE(ne/R));Ce<ne;)lt[Pe++]=Jt(S,Ce,Ce+=R);return lt}function Xa(S){for(var R=-1,B=S==null?0:S.length,ne=0,Ce=[];++R<B;){var Pe=S[R];Pe&&(Ce[ne++]=Pe)}return Ce}function z2(){var S=arguments.length;if(!S)return[];for(var R=xt(S-1),B=arguments[0],ne=S;ne--;)R[ne-1]=arguments[ne];return ig(Xi(B)?Gr(B):[B],ml(R,1))}var wc=os(function(S,R){return No(S)?M_(S,ml(R,1,No,!0)):[]}),K2=os(function(S,R){var B=Zu(R);return No(B)&&(B=t),No(S)?M_(S,ml(R,1,No,!0),Ti(B,2)):[]}),j2=os(function(S,R){var B=Zu(R);return No(B)&&(B=t),No(S)?M_(S,ml(R,1,No,!0),t,B):[]});function X2(S,R,B){var ne=S==null?0:S.length;return ne?(R=B||R===t?1:Oi(R),Jt(S,R<0?0:R,ne)):[]}function Y2(S,R,B){var ne=S==null?0:S.length;return ne?(R=B||R===t?1:Oi(R),R=ne-R,Jt(S,0,R<0?0:R)):[]}function W_(S,R){return S&&S.length?CE(S,Ti(R,3),!0,!0):[]}function iA(S,R){return S&&S.length?CE(S,Ti(R,3),!0):[]}function q2(S,R,B,ne){var Ce=S==null?0:S.length;return Ce?(B&&typeof B!="number"&&Al(S,R,B)&&(B=0,ne=Ce),Ok(S,R,B,ne)):[]}function aT(S,R,B){var ne=S==null?0:S.length;if(!ne)return-1;var Ce=B==null?0:Oi(B);return Ce<0&&(Ce=Jr(ne+Ce,0)),qy(S,Ti(R,3),Ce)}function rL(S,R,B){var ne=S==null?0:S.length;if(!ne)return-1;var Ce=ne-1;return B!==t&&(Ce=Oi(B),Ce=B<0?Jr(ne+Ce,0):Jl(Ce,ne-1)),qy(S,Ti(R,3),Ce,!0)}function cT(S){var R=S==null?0:S.length;return R?ml(S,1):[]}function sA(S){var R=S==null?0:S.length;return R?ml(S,re):[]}function oA(S,R){var B=S==null?0:S.length;return B?(R=R===t?1:Oi(R),ml(S,R)):[]}function J2(S){for(var R=-1,B=S==null?0:S.length,ne={};++R<B;){var Ce=S[R];ne[Ce[0]]=Ce[1]}return ne}function ia(S){return S&&S.length?S[0]:t}function Kh(S,R,B){var ne=S==null?0:S.length;if(!ne)return-1;var Ce=B==null?0:Oi(B);return Ce<0&&(Ce=Jr(ne+Ce,0)),Vd(S,R,Ce)}function rA(S){var R=S==null?0:S.length;return R?Jt(S,0,-1):[]}var lA=os(function(S){var R=qo(S,yE);return R.length&&R[0]===S[0]?mE(R):[]}),lL=os(function(S){var R=Zu(S),B=qo(S,yE);return R===Zu(B)?R=t:B.pop(),B.length&&B[0]===S[0]?mE(B,Ti(R,2)):[]}),Zr=os(function(S){var R=Zu(S),B=qo(S,yE);return R=typeof R=="function"?R:t,R&&B.pop(),B.length&&B[0]===S[0]?mE(B,t,R):[]});function aL(S,R){return S==null?"":mk.call(S,R)}function Zu(S){var R=S==null?0:S.length;return R?S[R-1]:t}function sa(S,R,B){var ne=S==null?0:S.length;if(!ne)return-1;var Ce=ne;return B!==t&&(Ce=Oi(B),Ce=Ce<0?Jr(ne+Ce,0):Jl(Ce,ne-1)),R===R?Bb(S,R,Ce):qy(S,tk,Ce,!0)}function cL(S,R){return S&&S.length?VI(S,Oi(R)):t}var aA=os(G_);function G_(S,R){return S&&S.length&&R&&R.length?UI(S,R):S}function cA(S,R,B){return S&&S.length&&R&&R.length?UI(S,R,Ti(B,2)):S}function Q2(S,R,B){return S&&S.length&&R&&R.length?UI(S,R,t,B):S}var uL=Sc(function(S,R){var B=S==null?0:S.length,ne=RI(S,R);return Fk(S,qo(R,function(Ce){return Xd(Ce,B)?+Ce:Ce}).sort(Gd)),ne});function Ic(S,R){var B=[];if(!(S&&S.length))return B;var ne=-1,Ce=[],Pe=S.length;for(R=Ti(R,3);++ne<Pe;){var lt=S[ne];R(lt,ne,S)&&(B.push(lt),Ce.push(ne))}return Fk(S,Ce),B}function Pp(S){return S==null?S:Lp.call(S)}function Z2(S,R,B){var ne=S==null?0:S.length;return ne?(B&&typeof B!="number"&&Al(S,R,B)?(R=0,B=ne):(R=R==null?0:Oi(R),B=B===t?ne:Oi(B)),Jt(S,R,B)):[]}function DE(S,R){return ea(S,R)}function eB(S,R,B){return A_(S,R,Ti(B,2))}function tB(S,R){var B=S==null?0:S.length;if(B){var ne=ea(S,R);if(ne<B&&Ya(S[ne],R))return ne}return-1}function nB(S,R){return ea(S,R,!0)}function z_(S,R,B){return A_(S,R,Ti(B,2),!0)}function iB(S,R){var B=S==null?0:S.length;if(B){var ne=ea(S,R,!0)-1;if(Ya(S[ne],R))return ne}return-1}function sB(S){return S&&S.length?Bk(S):[]}function oB(S,R){return S&&S.length?Bk(S,Ti(R,2)):[]}function DG(S){var R=S==null?0:S.length;return R?Jt(S,1,R):[]}function uA(S,R,B){return S&&S.length?(R=B||R===t?1:Oi(R),Jt(S,0,R<0?0:R)):[]}function rB(S,R,B){var ne=S==null?0:S.length;return ne?(R=B||R===t?1:Oi(R),R=ne-R,Jt(S,R<0?0:R,ne)):[]}function $E(S,R){return S&&S.length?CE(S,Ti(R,3),!1,!0):[]}function K_(S,R){return S&&S.length?CE(S,Ti(R,3)):[]}var dA=os(function(S){return lu(ml(S,1,No,!0))}),$G=os(function(S){var R=Zu(S);return No(R)&&(R=t),lu(ml(S,1,No,!0),Ti(R,2))}),hA=os(function(S){var R=Zu(S);return R=typeof R=="function"?R:t,lu(ml(S,1,No,!0),t,R)});function fA(S){return S&&S.length?lu(S):[]}function gA(S,R){return S&&S.length?lu(S,Ti(R,2)):[]}function Pn(S,R){return R=typeof R=="function"?R:t,S&&S.length?lu(S,t,R):[]}function Fp(S){if(!(S&&S.length))return[];var R=0;return S=ng(S,function(B){if(No(B))return R=Jr(B.length,R),!0}),xb(R,function(B){return qo(S,su(B))})}function uT(S,R){if(!(S&&S.length))return[];var B=Fp(S);return R==null?B:qo(B,function(ne){return qr(R,t,ne)})}var pA=os(function(S,R){return No(S)?M_(S,R):[]}),mA=os(function(S){return Uk(ng(S,No))}),_A=os(function(S){var R=Zu(S);return No(R)&&(R=t),Uk(ng(S,No),Ti(R,2))}),j_=os(function(S){var R=Zu(S);return R=typeof R=="function"?R:t,Uk(ng(S,No),t,R)}),xG=os(Fp);function PG(S,R){return jI(S||[],R||[],Qb)}function Lc(S,R){return jI(S||[],R||[],Yu)}var Ao=os(function(S){var R=S.length,B=R>1?S[R-1]:t;return B=typeof B=="function"?(S.pop(),B):t,uT(S,B)});function dT(S){var R=Be(S);return R.__chain__=!0,R}function vA(S,R){return R(S),S}function hT(S,R){return R(S)}var fT=Sc(function(S){var R=S.length,B=R?S[0]:0,ne=this.__wrapped__,Ce=function(Pe){return RI(Pe,S)};return R>1||this.__actions__.length||!(ne instanceof bs)||!Xd(B)?this.thru(Ce):(ne=ne.slice(B,+B+(R?1:0)),ne.__actions__.push({func:hT,args:[Ce],thisArg:t}),new ou(ne,this.__chain__).thru(function(Pe){return R&&!Pe.length&&Pe.push(t),Pe}))});function dL(){return dT(this)}function bA(){return new ou(this.value(),this.__chain__)}function gT(){this.__values__===t&&(this.__values__=DA(this.value()));var S=this.__index__>=this.__values__.length,R=S?t:this.__values__[this.__index__++];return{done:S,value:R}}function pT(){return this}function jh(S){for(var R,B=this;B instanceof aE;){var ne=fg(B);ne.__index__=0,ne.__values__=t,R?Ce.__wrapped__=ne:R=ne;var Ce=ne;B=B.__wrapped__}return Ce.__wrapped__=S,R}function Xh(){var S=this.__wrapped__;if(S instanceof bs){var R=S;return this.__actions__.length&&(R=new bs(this)),R=R.reverse(),R.__actions__.push({func:hT,args:[Pp],thisArg:t}),new ou(R,this.__chain__)}return this.thru(Pp)}function hL(){return Vk(this.__wrapped__,this.__actions__)}var lB=au(function(S,R,B){no.call(S,B)?++S[B]:Hh(S,B,1)});function fL(S,R,B){var ne=Xi(S)?JM:Lk;return B&&Al(S,R,B)&&(R=t),ne(S,Ti(R,3))}function Yh(S,R){var B=Xi(S)?ng:AI;return B(S,Ti(R,3))}var Ks=YI(aT),gL=YI(rL);function xE(S,R){return ml(Is(S,R),1)}function TA(S,R){return ml(Is(S,R),re)}function aB(S,R,B){return B=B===t?1:Oi(B),ml(Is(S,R),B)}function pL(S,R){var B=Xi(S)?Tc:Vh;return B(S,Ti(R,3))}function PE(S,R){var B=Xi(S)?l2:hE;return B(S,Ti(R,3))}var CA=au(function(S,R,B){no.call(S,B)?S[B].push(R):Hh(S,B,[R])});function X_(S,R,B,ne){S=Jo(S)?S:tv(S),B=B&&!ne?Oi(B):0;var Ce=S.length;return B<0&&(B=Jr(Ce+B,0)),ET(S)?B<=Ce&&S.indexOf(R,B)>-1:!!Ce&&Vd(S,R,B)>-1}var mT=os(function(S,R,B){var ne=-1,Ce=typeof R=="function",Pe=Jo(S)?xt(S.length):[];return Vh(S,function(lt){Pe[++ne]=Ce?qr(R,lt,B):kp(lt,R,B)}),Pe}),_T=au(function(S,R,B){Hh(S,B,R)});function Is(S,R){var B=Xi(S)?qo:FI;return B(S,Ti(R,3))}function vT(S,R,B,ne){return S==null?[]:(Xi(R)||(R=R==null?[]:[R]),B=ne?t:B,Xi(B)||(B=B==null?[]:[B]),xk(S,R,B))}var Y_=au(function(S,R,B){S[B?0:1].push(R)},function(){return[[],[]]});function yA(S,R,B){var ne=Xi(S)?gI:Sp,Ce=arguments.length<3;return ne(S,Ti(R,4),B,Ce,Vh)}function Bp(S,R,B){var ne=Xi(S)?QM:Sp,Ce=arguments.length<3;return ne(S,Ti(R,4),B,Ce,hE)}function cB(S,R){var B=Xi(S)?ng:AI;return B(S,qh(Ti(R,3)))}function EA(S){var R=Xi(S)?OI:H2;return R(S)}function Ra(S,R,B){(B?Al(S,R,B):R===t)?R=1:R=Oi(R);var ne=Xi(S)?wk:gi;return ne(S,R)}function mL(S){var R=Xi(S)?M2:Uh;return R(S)}function FE(S){if(S==null)return 0;if(Jo(S))return ET(S)?wp(S):S.length;var R=kl(S);return R==Me||R==it?S.size:bE(S).length}function BE(S,R,B){var ne=Xi(S)?pI:cg;return B&&Al(S,R,B)&&(R=t),ne(S,Ti(R,3))}var SA=os(function(S,R){if(S==null)return[];var B=R.length;return B>1&&Al(S,R[0],R[1])?R=[]:B>2&&Al(R[0],R[1],R[2])&&(R=[R[0]]),xk(S,ml(R,1),[])}),bT=Yb||function(){return Yr.Date.now()};function uB(S,R){if(typeof R!="function")throw new ql(r);return S=Oi(S),function(){if(--S<1)return R.apply(this,arguments)}}function wA(S,R,B){return R=B?t:R,R=S&&R==null?S.length:R,zh(S,N,t,t,t,t,R)}function IA(S,R){var B;if(typeof R!="function")throw new ql(r);return S=Oi(S),function(){return--S>0&&(B=R.apply(this,arguments)),S<=1&&(R=t),B}}var gg=os(function(S,R,B){var ne=C;if(B.length){var Ce=Nh(B,B_(gg));ne|=O}return zh(S,ne,R,B,Ce)}),_L=os(function(S,R,B){var ne=C|y;if(B.length){var Ce=Nh(B,B_(_L));ne|=O}return zh(R,ne,S,B,Ce)});function vL(S,R,B){R=B?t:R;var ne=zh(S,I,t,t,t,t,t,R);return ne.placeholder=vL.placeholder,ne}function Hp(S,R,B){R=B?t:R;var ne=zh(S,L,t,t,t,t,t,R);return ne.placeholder=Hp.placeholder,ne}function HE(S,R,B){var ne,Ce,Pe,lt,ut,_t,Zt=0,en=!1,an=!1,Rn=!0;if(typeof S!="function")throw new ql(r);R=Ho(R)||0,Cr(B)&&(en=!!B.leading,an="maxWait"in B,Pe=an?Jr(Ho(B.maxWait)||0,R):Pe,Rn="trailing"in B?!!B.trailing:Rn);function qn(Dr){var id=ne,of=Ce;return ne=Ce=t,Zt=Dr,lt=S.apply(of,id),lt}function Ei(Dr){return Zt=Dr,ut=NE(gs,R),en?qn(Dr):lt}function Ui(Dr){var id=Dr-_t,of=Dr-Zt,dN=R-id;return an?Jl(dN,Pe-of):dN}function _i(Dr){var id=Dr-_t,of=Dr-Zt;return _t===t||id>=R||id<0||an&&of>=Pe}function gs(){var Dr=bT();if(_i(Dr))return Ts(Dr);ut=NE(gs,Ui(Dr))}function Ts(Dr){return ut=t,Rn&&ne?qn(Dr):(ne=Ce=t,lt)}function Nc(){ut!==t&&Dp(ut),Zt=0,ne=_t=Ce=ut=t}function Ma(){return ut===t?lt:Ts(bT())}function tl(){var Dr=bT(),id=_i(Dr);if(ne=arguments,Ce=this,_t=Dr,id){if(ut===t)return Ei(_t);if(an)return Dp(ut),ut=NE(gs,R),qn(_t)}return ut===t&&(ut=NE(gs,R)),lt}return tl.cancel=Nc,tl.flush=Ma,tl}var VE=os(function(S,R){return kI(S,1,R)}),TT=os(function(S,R,B){return kI(S,Ho(R)||0,B)});function dB(S){return zh(S,P)}function UE(S,R){if(typeof S!="function"||R!=null&&typeof R!="function")throw new ql(r);var B=function(){var ne=arguments,Ce=R?R.apply(this,ne):ne[0],Pe=B.cache;if(Pe.has(Ce))return Pe.get(Ce);var lt=S.apply(this,ne);return B.cache=Pe.set(Ce,lt)||Pe,lt};return B.cache=new(UE.Cache||Fh),B}UE.Cache=Fh;function qh(S){if(typeof S!="function")throw new ql(r);return function(){var R=arguments;switch(R.length){case 0:return!S.call(this);case 1:return!S.call(this,R[0]);case 2:return!S.call(this,R[0],R[1]);case 3:return!S.call(this,R[0],R[1],R[2])}return!S.apply(this,R)}}function LA(S){return IA(2,S)}var OA=Np(function(S,R){R=R.length==1&&Xi(R[0])?qo(R[0],Ia(Ti())):qo(ml(R,1),Ia(Ti()));var B=R.length;return os(function(ne){for(var Ce=-1,Pe=Jl(ne.length,B);++Ce<Pe;)ne[Ce]=R[Ce].call(this,ne[Ce]);return qr(S,this,ne)})}),Oc=os(function(S,R){var B=Nh(R,B_(Oc));return zh(S,O,t,R,B)}),CT=os(function(S,R){var B=Nh(R,B_(CT));return zh(S,A,t,R,B)}),RA=Sc(function(S,R){return zh(S,D,t,t,t,R)});function MA(S,R){if(typeof S!="function")throw new ql(r);return R=R===t?R:Oi(R),os(S,R)}function hB(S,R){if(typeof S!="function")throw new ql(r);return R=R==null?0:Jr(Oi(R),0),os(function(B){var ne=B[R],Ce=za(B,0,R);return ne&&ig(Ce,ne),qr(S,this,Ce)})}function fB(S,R,B){var ne=!0,Ce=!0;if(typeof S!="function")throw new ql(r);return Cr(B)&&(ne="leading"in B?!!B.leading:ne,Ce="trailing"in B?!!B.trailing:Ce),HE(S,R,{leading:ne,maxWait:R,trailing:Ce})}function bL(S){return wA(S,1)}function el(S,R){return Oc(Ap(R),S)}function uu(){if(!arguments.length)return[];var S=arguments[0];return Xi(S)?S:[S]}function gB(S){return Ql(S,p)}function FG(S,R){return R=typeof R=="function"?R:t,Ql(S,p,R)}function BG(S){return Ql(S,f|p)}function pg(S,R){return R=typeof R=="function"?R:t,Ql(S,f|p,R)}function kA(S,R){return R==null||MI(S,R,ar(R))}function Ya(S,R){return S===R||S!==S&&R!==R}var pB=IE(pE),q_=IE(function(S,R){return S>=R}),J_=$I(function(){return arguments}())?$I:function(S){return Ar(S)&&no.call(S,"callee")&&!hk.call(S,"callee")},Xi=xt.isArray,TL=KM?Ia(KM):Rk;function Jo(S){return S!=null&&du(S.length)&&!Qh(S)}function No(S){return Ar(S)&&Jo(S)}function AA(S){return S===!0||S===!1||Ar(S)&&Zl(S)==Ve}var Jh=pk||iv,mB=jM?Ia(jM):Mk;function ed(S){return Ar(S)&&S.nodeType===1&&!Vi(S)}function WE(S){if(S==null)return!0;if(Jo(S)&&(Xi(S)||typeof S=="string"||typeof S.splice=="function"||Jh(S)||Vp(S)||J_(S)))return!S.length;var R=kl(S);if(R==Me||R==it)return!S.size;if(Qu(S))return!bE(S).length;for(var B in S)if(no.call(S,B))return!1;return!0}function fs(S,R){return k_(S,R)}function Co(S,R,B){B=typeof B=="function"?B:t;var ne=B?B(S,R):t;return ne===t?k_(S,R,t,B):!!ne}function CL(S){if(!Ar(S))return!1;var R=Zl(S);return R==ze||R==dt||typeof S.message=="string"&&typeof S.name=="string"&&!Vi(S)}function yL(S){return typeof S=="number"&&$h(S)}function Qh(S){if(!Cr(S))return!1;var R=Zl(S);return R==ee||R==ye||R==we||R==Ie}function GE(S){return typeof S=="number"&&S==Oi(S)}function du(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=Z}function Cr(S){var R=typeof S;return S!=null&&(R=="object"||R=="function")}function Ar(S){return S!=null&&typeof S=="object"}var Rc=XM?Ia(XM):Ak;function js(S,R){return S===R||_E(S,R,tL(R))}function mg(S,R,B){return B=typeof B=="function"?B:t,_E(S,R,tL(R),B)}function EL(S){return td(S)&&S!=+S}function SL(S){if(G2(S))throw new Pi(o);return xI(S)}function yT(S){return S===null}function HG(S){return S==null}function td(S){return typeof S=="number"||Ar(S)&&Zl(S)==et}function Vi(S){if(!Ar(S)||Zl(S)!=Ue)return!1;var R=Kb(S);if(R===null)return!0;var B=no.call(R,"constructor")&&R.constructor;return typeof B=="function"&&B instanceof B&&Ub.call(B)==Gb}var Yd=YM?Ia(YM):PI;function lr(S){return GE(S)&&S>=-Z&&S<=Z}var wL=qM?Ia(qM):vE;function ET(S){return typeof S=="string"||!Xi(S)&&Ar(S)&&Zl(S)==Tt}function Mc(S){return typeof S=="symbol"||Ar(S)&&Zl(S)==He}var Vp=hI?Ia(hI):Nk;function _B(S){return S===t}function vB(S){return Ar(S)&&kl(S)==ot}function qa(S){return Ar(S)&&Zl(S)==Ct}var NA=IE(TE),qd=IE(function(S,R){return S<=R});function DA(S){if(!S)return[];if(Jo(S))return ET(S)?La(S):Gr(S);if(jb&&S[jb])return p2(S[jb]());var R=kl(S),B=R==Me?_I:R==it?Fb:tv;return B(S)}function Zh(S){if(!S)return S===0?S:0;if(S=Ho(S),S===re||S===-re){var R=S<0?-1:1;return R*J}return S===S?S:0}function Oi(S){var R=Zh(S),B=R%1;return R===R?B?R-B:R:0}function zE(S){return S?Rp(Oi(S),0,ve):0}function Ho(S){if(typeof S=="number")return S;if(Mc(S))return ge;if(Cr(S)){var R=typeof S.valueOf=="function"?S.valueOf():S;S=Cr(R)?R+"":R}if(typeof S!="string")return S===0?S:+S;S=mI(S);var B=Fs.test(S);return B||go.test(S)?r2(S.slice(2),B?2:8):Cn.test(S)?ge:+S}function bB(S){return ta(S,Nr(S))}function ft(S){return S?Rp(Oi(S),-Z,Z):S===0?S:0}function as(S){return S==null?"":yc(S)}var KE=qu(function(S,R){if(Qu(R)||Jo(R)){ta(R,ar(R),S);return}for(var B in R)no.call(R,B)&&Qb(S,B,R[B])}),IL=qu(function(S,R){ta(R,Nr(R),S)}),nd=qu(function(S,R,B,ne){ta(R,Nr(R),S,ne)}),Up=qu(function(S,R,B,ne){ta(R,ar(R),S,ne)}),LL=Sc(RI);function ST(S,R){var B=Rl(S);return R==null?B:Ik(B,R)}var $A=os(function(S,R){S=To(S);var B=-1,ne=R.length,Ce=ne>2?R[2]:t;for(Ce&&Al(R[0],R[1],Ce)&&(ne=1);++B<ne;)for(var Pe=R[B],lt=Nr(Pe),ut=-1,_t=lt.length;++ut<_t;){var Zt=lt[ut],en=S[Zt];(en===t||Ya(en,Ip[Zt])&&!no.call(S,Zt))&&(S[Zt]=Pe[Zt])}return S}),TB=os(function(S){return S.push(t,Xk),qr(kc,t,S)});function hu(S,R){return ZM(S,Ti(R,3),Xu)}function xA(S,R){return ZM(S,Ti(R,3),gE)}function jE(S,R){return S==null?S:fE(S,Ti(R,3),Nr)}function PA(S,R){return S==null?S:NI(S,Ti(R,3),Nr)}function CB(S,R){return S&&Xu(S,Ti(R,3))}function yB(S,R){return S&&gE(S,Ti(R,3))}function EB(S){return S==null?[]:Zb(S,ar(S))}function SB(S){return S==null?[]:Zb(S,Nr(S))}function Q_(S,R,B){var ne=S==null?t:ag(S,R);return ne===t?B:ne}function FA(S,R){return S!=null&&Jk(S,R,N2)}function Z_(S,R){return S!=null&&Jk(S,R,D2)}var BA=wE(function(S,R,B){R!=null&&typeof R.toString!="function"&&(R=Wb.call(R)),S[R]=B},JA(Ja)),XE=wE(function(S,R,B){R!=null&&typeof R.toString!="function"&&(R=Wb.call(R)),no.call(S,R)?S[R].push(B):S[R]=[B]},Ti),YE=os(kp);function ar(S){return Jo(S)?cE(S):bE(S)}function Nr(S){return Jo(S)?cE(S,!0):$k(S)}function wB(S,R){var B={};return R=Ti(R,3),Xu(S,function(ne,Ce,Pe){Hh(B,R(ne,Ce,Pe),ne)}),B}function ef(S,R){var B={};return R=Ti(R,3),Xu(S,function(ne,Ce,Pe){Hh(B,Ce,R(ne,Ce,Pe))}),B}var _g=qu(function(S,R,B){tT(S,R,B)}),kc=qu(function(S,R,B,ne){tT(S,R,B,ne)}),IB=Sc(function(S,R){var B={};if(S==null)return B;var ne=!1;R=qo(R,function(Pe){return Pe=Wd(Pe,S),ne||(ne=Pe.length>1),Pe}),ta(S,LE(S),B),ne&&(B=Ql(B,f|g|p,AG));for(var Ce=R.length;Ce--;)KI(B,R[Ce]);return B});function wT(S,R){return OL(S,qh(Ti(R)))}var nn=Sc(function(S,R){return S==null?{}:P2(S,R)});function OL(S,R){if(S==null)return{};var B=qo(LE(S),function(ne){return[ne]});return R=Ti(R),Pk(S,B,function(ne,Ce){return R(ne,Ce[0])})}function VG(S,R,B){R=Wd(R,S);var ne=-1,Ce=R.length;for(Ce||(Ce=1,S=t);++ne<Ce;){var Pe=S==null?t:S[na(R[ne])];Pe===t&&(ne=Ce,Pe=B),S=Qh(Pe)?Pe.call(S):Pe}return S}function UG(S,R,B){return S==null?S:Yu(S,R,B)}function WG(S,R,B,ne){return ne=typeof ne=="function"?ne:t,S==null?S:Yu(S,R,B,ne)}var RL=JI(ar),qE=JI(Nr);function Ns(S,R,B){var ne=Xi(S),Ce=ne||Jh(S)||Vp(S);if(R=Ti(R,4),B==null){var Pe=S&&S.constructor;Ce?B=ne?new Pe:[]:Cr(S)?B=Qh(Pe)?Rl(Kb(S)):{}:B={}}return(Ce?Tc:Xu)(S,function(lt,ut,_t){return R(B,lt,ut,_t)}),B}function ev(S,R){return S==null?!0:KI(S,R)}function ML(S,R,B){return S==null?S:Ml(S,R,Ap(B))}function GG(S,R,B,ne){return ne=typeof ne=="function"?ne:t,S==null?S:Ml(S,R,Ap(B),ne)}function tv(S){return S==null?[]:Qy(S,ar(S))}function Jd(S){return S==null?[]:Qy(S,Nr(S))}function JE(S,R,B){return B===t&&(B=R,R=t),B!==t&&(B=Ho(B),B=B===B?B:0),R!==t&&(R=Ho(R),R=R===R?R:0),Rp(Ho(S),R,B)}function qs(S,R,B){return R=Zh(R),B===t?(B=R,R=0):B=Zh(B),S=Ho(S),eT(S,R,B)}function LB(S,R,B){if(B&&typeof B!="boolean"&&Al(S,R,B)&&(R=B=t),B===t&&(typeof R=="boolean"?(B=R,R=t):typeof S=="boolean"&&(B=S,S=t)),S===t&&R===t?(S=0,R=1):(S=Zh(S),R===t?(R=S,S=0):R=Zh(R)),S>R){var ne=S;S=R,R=ne}if(B||S%1||R%1){var Ce=xh();return Jl(S+Ce*(R-S+uI("1e-"+((Ce+"").length-1))),R)}return WI(S,R)}var HA=zd(function(S,R,B){return R=R.toLowerCase(),S+(B?nv(R):R)});function nv(S){return NL(as(S).toLowerCase())}function VA(S){return S=as(S),S&&S.replace(vo,ok).replace(ZF,"")}function UA(S,R,B){S=as(S),R=yc(R);var ne=S.length;B=B===t?ne:Rp(Oi(B),0,ne);var Ce=B;return B-=R.length,B>=0&&S.slice(B,Ce)==R}function WA(S){return S=as(S),S&&ti.test(S)?S.replace(Zn,f2):S}function GA(S){return S=as(S),S&&Te.test(S)?S.replace(ie,"\\$&"):S}var QE=zd(function(S,R,B){return S+(B?"-":"")+R.toLowerCase()}),zG=zd(function(S,R,B){return S+(B?" ":"")+R.toLowerCase()}),OB=Oa("toLowerCase");function KG(S,R,B){S=as(S),R=Oi(R);var ne=R?wp(S):0;if(!R||ne>=R)return S;var Ce=(R-ne)/2;return Gh(oE(Ce),B)+S+Gh(sE(Ce),B)}function jG(S,R,B){S=as(S),R=Oi(R);var ne=R?wp(S):0;return R&&ne<R?S+Gh(R-ne,B):S}function Qd(S,R,B){S=as(S),R=Oi(R);var ne=R?wp(S):0;return R&&ne<R?Gh(R-ne,B)+S:S}function zA(S,R,B){return B||R==null?R=0:R&&(R=+R),b2(as(S).replace(De,""),R||0)}function KA(S,R,B){return(B?Al(S,R,B):R===t)?R=1:R=Oi(R),GI(as(S),R)}function IT(){var S=arguments,R=as(S[0]);return S.length<3?R:R.replace(S[1],S[2])}var RB=zd(function(S,R,B){return S+(B?"_":"")+R.toLowerCase()});function jA(S,R,B){return B&&typeof B!="number"&&Al(S,R,B)&&(R=B=t),B=B===t?ve:B>>>0,B?(S=as(S),S&&(typeof R=="string"||R!=null&&!Yd(R))&&(R=yc(R),!R&&y_(S))?za(La(S),0,B):S.split(R,B)):[]}var ZE=zd(function(S,R,B){return S+(B?" ":"")+NL(R)});function MB(S,R,B){return S=as(S),B=B==null?0:Rp(Oi(B),0,S.length),R=yc(R),S.slice(B,B+R.length)==R}function XA(S,R,B){var ne=Be.templateSettings;B&&Al(S,R,B)&&(R=t),S=as(S),R=nd({},R,ne,jk);var Ce=nd({},R.imports,ne.imports,jk),Pe=ar(Ce),lt=Qy(Ce,Pe),ut,_t,Zt=0,en=R.interpolate||At,an="__p += '",Rn=S_((R.escape||At).source+"|"+en.source+"|"+(en===xe?pn:At).source+"|"+(R.evaluate||At).source+"|$","g"),qn="//# sourceURL="+(no.call(R,"sourceURL")?(R.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++n2+"]")+`
- `;S.replace(Rn,function(_i,gs,Ts,Nc,Ma,tl){return Ts||(Ts=Nc),an+=S.slice(Zt,tl).replace(In,rk),gs&&(ut=!0,an+=`' +
- __e(`+gs+`) +
- '`),Ma&&(_t=!0,an+=`';
- `+Ma+`;
- __p += '`),Ts&&(an+=`' +
- ((__t = (`+Ts+`)) == null ? '' : __t) +
- '`),Zt=tl+_i.length,_i}),an+=`';
- `;var Ei=no.call(R,"variable")&&R.variable;if(!Ei)an=`with (obj) {
- `+an+`
- }
- `;else if(gt.test(Ei))throw new Pi(a);an=(_t?an.replace(Tn,""):an).replace(Hn,"$1").replace(Xn,"$1;"),an="function("+(Ei||"obj")+`) {
- `+(Ei?"":`obj || (obj = {});
- `)+"var __t, __p = ''"+(ut?", __e = _.escape":"")+(_t?`, __j = Array.prototype.join;
- function print() { __p += __j.call(arguments, '') }
- `:`;
- `)+an+`return __p
- }`;var Ui=eS(function(){return zs(Pe,qn+"return "+an).apply(t,lt)});if(Ui.source=an,CL(Ui))throw Ui;return Ui}function Ac(S){return as(S).toLowerCase()}function tf(S){return as(S).toUpperCase()}function kB(S,R,B){if(S=as(S),S&&(B||R===t))return mI(S);if(!S||!(R=yc(R)))return S;var ne=La(S),Ce=La(R),Pe=ik(ne,Ce),lt=sk(ne,Ce)+1;return za(ne,Pe,lt).join("")}function kL(S,R,B){if(S=as(S),S&&(B||R===t))return S.slice(0,vI(S)+1);if(!S||!(R=yc(R)))return S;var ne=La(S),Ce=sk(ne,La(R))+1;return za(ne,0,Ce).join("")}function AB(S,R,B){if(S=as(S),S&&(B||R===t))return S.replace(De,"");if(!S||!(R=yc(R)))return S;var ne=La(S),Ce=ik(ne,La(R));return za(ne,Ce).join("")}function LT(S,R){var B=F,ne=V;if(Cr(R)){var Ce="separator"in R?R.separator:Ce;B="length"in R?Oi(R.length):B,ne="omission"in R?yc(R.omission):ne}S=as(S);var Pe=S.length;if(y_(S)){var lt=La(S);Pe=lt.length}if(B>=Pe)return S;var ut=B-wp(ne);if(ut<1)return ne;var _t=lt?za(lt,0,ut).join(""):S.slice(0,ut);if(Ce===t)return _t+ne;if(lt&&(ut+=_t.length-ut),Yd(Ce)){if(S.slice(ut).search(Ce)){var Zt,en=_t;for(Ce.global||(Ce=S_(Ce.source,as(Fn.exec(Ce))+"g")),Ce.lastIndex=0;Zt=Ce.exec(en);)var an=Zt.index;_t=_t.slice(0,an===t?ut:an)}}else if(S.indexOf(yc(Ce),ut)!=ut){var Rn=_t.lastIndexOf(Ce);Rn>-1&&(_t=_t.slice(0,Rn))}return _t+ne}function AL(S){return S=as(S),S&&Hi.test(S)?S.replace(vs,ak):S}var OT=zd(function(S,R,B){return S+(B?" ":"")+R.toUpperCase()}),NL=Oa("toUpperCase");function NB(S,R,B){return S=as(S),R=B?t:R,R===t?g2(S)?bI(S):u2(S):S.match(R)||[]}var eS=os(function(S,R){try{return qr(S,t,R)}catch(B){return CL(B)?B:new Pi(B)}}),YA=Sc(function(S,R){return Tc(R,function(B){B=na(B),Hh(S,B,gg(S[B],S))}),S});function qA(S){var R=S==null?0:S.length,B=Ti();return S=R?qo(S,function(ne){if(typeof ne[1]!="function")throw new ql(r);return[B(ne[0]),ne[1]]}):[],os(function(ne){for(var Ce=-1;++Ce<R;){var Pe=S[Ce];if(qr(Pe[0],this,ne))return qr(Pe[1],this,ne)}})}function XG(S){return A2(Ql(S,f))}function JA(S){return function(){return S}}function YG(S,R){return S==null||S!==S?R:S}var DB=U2(),qG=U2(!0);function Ja(S){return S}function Bs(S){return Dk(typeof S=="function"?S:Ql(S,f))}function nf(S){return BI(Ql(S,f))}function tS(S,R){return HI(S,Ql(R,f))}var DL=os(function(S,R){return function(B){return kp(B,S,R)}}),sf=os(function(S,R){return function(B){return kp(S,B,R)}});function QA(S,R,B){var ne=ar(R),Ce=Zb(R,ne);B==null&&!(Cr(R)&&(Ce.length||!ne.length))&&(B=R,R=S,S=this,Ce=Zb(R,ar(R)));var Pe=!(Cr(B)&&"chain"in B)||!!B.chain,lt=Qh(S);return Tc(Ce,function(ut){var _t=R[ut];S[ut]=_t,lt&&(S.prototype[ut]=function(){var Zt=this.__chain__;if(Pe||Zt){var en=S(this.__wrapped__),an=en.__actions__=Gr(this.__actions__);return an.push({func:_t,args:arguments,thisArg:S}),en.__chain__=Zt,en}return _t.apply(S,ig([this.value()],arguments))})}),S}function RT(){return Yr._===this&&(Yr._=_2),this}function $L(){}function $B(S){return S=Oi(S),os(function(R){return VI(R,S)})}var ZA=oT(qo),JG=oT(JM),eN=oT(pI);function xL(S){return zr(S)?su(na(S)):F2(S)}function xB(S){return function(R){return S==null?t:ag(S,R)}}var tN=zk(),PL=zk(!0);function FL(){return[]}function iv(){return!1}function nN(){return{}}function iN(){return""}function sN(){return!0}function oN(S,R){if(S=Oi(S),S<1||S>Z)return[];var B=ve,ne=Jl(S,ve);R=Ti(R),S-=ve;for(var Ce=xb(ne,R);++B<S;)R(B);return Ce}function Wp(S){return Xi(S)?qo(S,na):Mc(S)?[S]:Gr(nA(as(S)))}function rN(S){var R=++CI;return as(S)+R}var lN=Wh(function(S,R){return S+R},0),aN=rT("ceil"),cN=Wh(function(S,R){return S/R},1),uN=rT("floor");function Wn(S){return S&&S.length?Mp(S,Ja,pE):t}function PB(S,R){return S&&S.length?Mp(S,Ti(R,2),pE):t}function FB(S){return nk(S,Ja)}function sv(S,R){return nk(S,Ti(R,2))}function nS(S){return S&&S.length?Mp(S,Ja,TE):t}function MT(S,R){return S&&S.length?Mp(S,Ti(R,2),TE):t}var BB=Wh(function(S,R){return S*R},1),BL=rT("round"),HB=Wh(function(S,R){return S-R},0);function VB(S){return S&&S.length?Jy(S,Ja):0}function UB(S,R){return S&&S.length?Jy(S,Ti(R,2)):0}return Be.after=uB,Be.ary=wA,Be.assign=KE,Be.assignIn=IL,Be.assignInWith=nd,Be.assignWith=Up,Be.at=LL,Be.before=IA,Be.bind=gg,Be.bindAll=YA,Be.bindKey=_L,Be.castArray=uu,Be.chain=dT,Be.chunk=U_,Be.compact=Xa,Be.concat=z2,Be.cond=qA,Be.conforms=XG,Be.constant=JA,Be.countBy=lB,Be.create=ST,Be.curry=vL,Be.curryRight=Hp,Be.debounce=HE,Be.defaults=$A,Be.defaultsDeep=TB,Be.defer=VE,Be.delay=TT,Be.difference=wc,Be.differenceBy=K2,Be.differenceWith=j2,Be.drop=X2,Be.dropRight=Y2,Be.dropRightWhile=W_,Be.dropWhile=iA,Be.fill=q2,Be.filter=Yh,Be.flatMap=xE,Be.flatMapDeep=TA,Be.flatMapDepth=aB,Be.flatten=cT,Be.flattenDeep=sA,Be.flattenDepth=oA,Be.flip=dB,Be.flow=DB,Be.flowRight=qG,Be.fromPairs=J2,Be.functions=EB,Be.functionsIn=SB,Be.groupBy=CA,Be.initial=rA,Be.intersection=lA,Be.intersectionBy=lL,Be.intersectionWith=Zr,Be.invert=BA,Be.invertBy=XE,Be.invokeMap=mT,Be.iteratee=Bs,Be.keyBy=_T,Be.keys=ar,Be.keysIn=Nr,Be.map=Is,Be.mapKeys=wB,Be.mapValues=ef,Be.matches=nf,Be.matchesProperty=tS,Be.memoize=UE,Be.merge=_g,Be.mergeWith=kc,Be.method=DL,Be.methodOf=sf,Be.mixin=QA,Be.negate=qh,Be.nthArg=$B,Be.omit=IB,Be.omitBy=wT,Be.once=LA,Be.orderBy=vT,Be.over=ZA,Be.overArgs=OA,Be.overEvery=JG,Be.overSome=eN,Be.partial=Oc,Be.partialRight=CT,Be.partition=Y_,Be.pick=nn,Be.pickBy=OL,Be.property=xL,Be.propertyOf=xB,Be.pull=aA,Be.pullAll=G_,Be.pullAllBy=cA,Be.pullAllWith=Q2,Be.pullAt=uL,Be.range=tN,Be.rangeRight=PL,Be.rearg=RA,Be.reject=cB,Be.remove=Ic,Be.rest=MA,Be.reverse=Pp,Be.sampleSize=Ra,Be.set=UG,Be.setWith=WG,Be.shuffle=mL,Be.slice=Z2,Be.sortBy=SA,Be.sortedUniq=sB,Be.sortedUniqBy=oB,Be.split=jA,Be.spread=hB,Be.tail=DG,Be.take=uA,Be.takeRight=rB,Be.takeRightWhile=$E,Be.takeWhile=K_,Be.tap=vA,Be.throttle=fB,Be.thru=hT,Be.toArray=DA,Be.toPairs=RL,Be.toPairsIn=qE,Be.toPath=Wp,Be.toPlainObject=bB,Be.transform=Ns,Be.unary=bL,Be.union=dA,Be.unionBy=$G,Be.unionWith=hA,Be.uniq=fA,Be.uniqBy=gA,Be.uniqWith=Pn,Be.unset=ev,Be.unzip=Fp,Be.unzipWith=uT,Be.update=ML,Be.updateWith=GG,Be.values=tv,Be.valuesIn=Jd,Be.without=pA,Be.words=NB,Be.wrap=el,Be.xor=mA,Be.xorBy=_A,Be.xorWith=j_,Be.zip=xG,Be.zipObject=PG,Be.zipObjectDeep=Lc,Be.zipWith=Ao,Be.entries=RL,Be.entriesIn=qE,Be.extend=IL,Be.extendWith=nd,QA(Be,Be),Be.add=lN,Be.attempt=eS,Be.camelCase=HA,Be.capitalize=nv,Be.ceil=aN,Be.clamp=JE,Be.clone=gB,Be.cloneDeep=BG,Be.cloneDeepWith=pg,Be.cloneWith=FG,Be.conformsTo=kA,Be.deburr=VA,Be.defaultTo=YG,Be.divide=cN,Be.endsWith=UA,Be.eq=Ya,Be.escape=WA,Be.escapeRegExp=GA,Be.every=fL,Be.find=Ks,Be.findIndex=aT,Be.findKey=hu,Be.findLast=gL,Be.findLastIndex=rL,Be.findLastKey=xA,Be.floor=uN,Be.forEach=pL,Be.forEachRight=PE,Be.forIn=jE,Be.forInRight=PA,Be.forOwn=CB,Be.forOwnRight=yB,Be.get=Q_,Be.gt=pB,Be.gte=q_,Be.has=FA,Be.hasIn=Z_,Be.head=ia,Be.identity=Ja,Be.includes=X_,Be.indexOf=Kh,Be.inRange=qs,Be.invoke=YE,Be.isArguments=J_,Be.isArray=Xi,Be.isArrayBuffer=TL,Be.isArrayLike=Jo,Be.isArrayLikeObject=No,Be.isBoolean=AA,Be.isBuffer=Jh,Be.isDate=mB,Be.isElement=ed,Be.isEmpty=WE,Be.isEqual=fs,Be.isEqualWith=Co,Be.isError=CL,Be.isFinite=yL,Be.isFunction=Qh,Be.isInteger=GE,Be.isLength=du,Be.isMap=Rc,Be.isMatch=js,Be.isMatchWith=mg,Be.isNaN=EL,Be.isNative=SL,Be.isNil=HG,Be.isNull=yT,Be.isNumber=td,Be.isObject=Cr,Be.isObjectLike=Ar,Be.isPlainObject=Vi,Be.isRegExp=Yd,Be.isSafeInteger=lr,Be.isSet=wL,Be.isString=ET,Be.isSymbol=Mc,Be.isTypedArray=Vp,Be.isUndefined=_B,Be.isWeakMap=vB,Be.isWeakSet=qa,Be.join=aL,Be.kebabCase=QE,Be.last=Zu,Be.lastIndexOf=sa,Be.lowerCase=zG,Be.lowerFirst=OB,Be.lt=NA,Be.lte=qd,Be.max=Wn,Be.maxBy=PB,Be.mean=FB,Be.meanBy=sv,Be.min=nS,Be.minBy=MT,Be.stubArray=FL,Be.stubFalse=iv,Be.stubObject=nN,Be.stubString=iN,Be.stubTrue=sN,Be.multiply=BB,Be.nth=cL,Be.noConflict=RT,Be.noop=$L,Be.now=bT,Be.pad=KG,Be.padEnd=jG,Be.padStart=Qd,Be.parseInt=zA,Be.random=LB,Be.reduce=yA,Be.reduceRight=Bp,Be.repeat=KA,Be.replace=IT,Be.result=VG,Be.round=BL,Be.runInContext=bt,Be.sample=EA,Be.size=FE,Be.snakeCase=RB,Be.some=BE,Be.sortedIndex=DE,Be.sortedIndexBy=eB,Be.sortedIndexOf=tB,Be.sortedLastIndex=nB,Be.sortedLastIndexBy=z_,Be.sortedLastIndexOf=iB,Be.startCase=ZE,Be.startsWith=MB,Be.subtract=HB,Be.sum=VB,Be.sumBy=UB,Be.template=XA,Be.times=oN,Be.toFinite=Zh,Be.toInteger=Oi,Be.toLength=zE,Be.toLower=Ac,Be.toNumber=Ho,Be.toSafeInteger=ft,Be.toString=as,Be.toUpper=tf,Be.trim=kB,Be.trimEnd=kL,Be.trimStart=AB,Be.truncate=LT,Be.unescape=AL,Be.uniqueId=rN,Be.upperCase=OT,Be.upperFirst=NL,Be.each=pL,Be.eachRight=PE,Be.first=ia,QA(Be,function(){var S={};return Xu(Be,function(R,B){no.call(Be.prototype,B)||(S[B]=R)}),S}(),{chain:!1}),Be.VERSION=i,Tc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){Be[S].placeholder=Be}),Tc(["drop","take"],function(S,R){bs.prototype[S]=function(B){B=B===t?1:Jr(Oi(B),0);var ne=this.__filtered__&&!R?new bs(this):this.clone();return ne.__filtered__?ne.__takeCount__=Jl(B,ne.__takeCount__):ne.__views__.push({size:Jl(B,ve),type:S+(ne.__dir__<0?"Right":"")}),ne},bs.prototype[S+"Right"]=function(B){return this.reverse()[S](B).reverse()}}),Tc(["filter","map","takeWhile"],function(S,R){var B=R+1,ne=B==de||B==K;bs.prototype[S]=function(Ce){var Pe=this.clone();return Pe.__iteratees__.push({iteratee:Ti(Ce,3),type:B}),Pe.__filtered__=Pe.__filtered__||ne,Pe}}),Tc(["head","last"],function(S,R){var B="take"+(R?"Right":"");bs.prototype[S]=function(){return this[B](1).value()[0]}}),Tc(["initial","tail"],function(S,R){var B="drop"+(R?"":"Right");bs.prototype[S]=function(){return this.__filtered__?new bs(this):this[B](1)}}),bs.prototype.compact=function(){return this.filter(Ja)},bs.prototype.find=function(S){return this.filter(S).head()},bs.prototype.findLast=function(S){return this.reverse().find(S)},bs.prototype.invokeMap=os(function(S,R){return typeof S=="function"?new bs(this):this.map(function(B){return kp(B,S,R)})}),bs.prototype.reject=function(S){return this.filter(qh(Ti(S)))},bs.prototype.slice=function(S,R){S=Oi(S);var B=this;return B.__filtered__&&(S>0||R<0)?new bs(B):(S<0?B=B.takeRight(-S):S&&(B=B.drop(S)),R!==t&&(R=Oi(R),B=R<0?B.dropRight(-R):B.take(R-S)),B)},bs.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},bs.prototype.toArray=function(){return this.take(ve)},Xu(bs.prototype,function(S,R){var B=/^(?:filter|find|map|reject)|While$/.test(R),ne=/^(?:head|last)$/.test(R),Ce=Be[ne?"take"+(R=="last"?"Right":""):R],Pe=ne||/^find/.test(R);Ce&&(Be.prototype[R]=function(){var lt=this.__wrapped__,ut=ne?[1]:arguments,_t=lt instanceof bs,Zt=ut[0],en=_t||Xi(lt),an=function(gs){var Ts=Ce.apply(Be,ig([gs],ut));return ne&&Rn?Ts[0]:Ts};en&&B&&typeof Zt=="function"&&Zt.length!=1&&(_t=en=!1);var Rn=this.__chain__,qn=!!this.__actions__.length,Ei=Pe&&!Rn,Ui=_t&&!qn;if(!Pe&&en){lt=Ui?lt:new bs(this);var _i=S.apply(lt,ut);return _i.__actions__.push({func:hT,args:[an],thisArg:t}),new ou(_i,Rn)}return Ei&&Ui?S.apply(this,ut):(_i=this.thru(an),Ei?ne?_i.value()[0]:_i.value():_i)})}),Tc(["pop","push","shift","sort","splice","unshift"],function(S){var R=w_[S],B=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",ne=/^(?:pop|shift)$/.test(S);Be.prototype[S]=function(){var Ce=arguments;if(ne&&!this.__chain__){var Pe=this.value();return R.apply(Xi(Pe)?Pe:[],Ce)}return this[B](function(lt){return R.apply(Xi(lt)?lt:[],Ce)})}}),Xu(bs.prototype,function(S,R){var B=Be[R];if(B){var ne=B.name+"";no.call(og,ne)||(og[ne]=[]),og[ne].push({name:R,func:B})}}),og[SE(t,y).name]=[{name:"wrapper",func:t}],bs.prototype.clone=T2,bs.prototype.reverse=Tk,bs.prototype.value=C2,Be.prototype.at=fT,Be.prototype.chain=dL,Be.prototype.commit=bA,Be.prototype.next=gT,Be.prototype.plant=jh,Be.prototype.reverse=Xh,Be.prototype.toJSON=Be.prototype.valueOf=Be.prototype.value=hL,Be.prototype.first=Be.prototype.head,jb&&(Be.prototype[jb]=pT),Be},E_=TI();Ep?((Ep.exports=E_)._=E_,Db._=E_):Yr._=E_}).call(hWt)}(CD,CD.exports)),CD.exports}fWt();const gWt={class:"main"},pWt={id:"blockly"},mWt={__name:"App",setup(n){return Yc.useyXmlStore(),Yc.useLoadBlocklyStatus(),te(""),Sl(()=>{}),(e,t)=>(G(),he("div",gWt,[ce(Z4t),oe("div",pWt,[ce(UVt)]),ce(dWt)]))}},BAe=Oh(mWt,[["__scopeId","data-v-660adf66"]]);/*!
- * vue-router v4.5.0
- * (c) 2024 Eduardo San Martin Morote
- * @license MIT
- */const N1=typeof document<"u";function HAe(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function _Wt(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&HAe(n.default)}const Eo=Object.assign;function kK(n,e){const t={};for(const i in e){const s=e[i];t[i]=ap(s)?s.map(n):n(s)}return t}const y$=()=>{},ap=Array.isArray,VAe=/#/g,vWt=/&/g,bWt=/\//g,TWt=/=/g,CWt=/\?/g,UAe=/\+/g,yWt=/%5B/g,EWt=/%5D/g,WAe=/%5E/g,SWt=/%60/g,GAe=/%7B/g,wWt=/%7C/g,zAe=/%7D/g,IWt=/%20/g;function goe(n){return encodeURI(""+n).replace(wWt,"|").replace(yWt,"[").replace(EWt,"]")}function LWt(n){return goe(n).replace(GAe,"{").replace(zAe,"}").replace(WAe,"^")}function fZ(n){return goe(n).replace(UAe,"%2B").replace(IWt,"+").replace(VAe,"%23").replace(vWt,"%26").replace(SWt,"`").replace(GAe,"{").replace(zAe,"}").replace(WAe,"^")}function OWt(n){return fZ(n).replace(TWt,"%3D")}function RWt(n){return goe(n).replace(VAe,"%23").replace(CWt,"%3F")}function MWt(n){return n==null?"":RWt(n).replace(bWt,"%2F")}function DP(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const kWt=/\/$/,AWt=n=>n.replace(kWt,"");function AK(n,e,t="/"){let i,s={},o="",r="";const a=e.indexOf("#");let c=e.indexOf("?");return a<c&&a>=0&&(c=-1),c>-1&&(i=e.slice(0,c),o=e.slice(c+1,a>-1?a:e.length),s=n(o)),a>-1&&(i=i||e.slice(0,a),r=e.slice(a,e.length)),i=xWt(i??e,t),{fullPath:i+(o&&"?")+o+r,path:i,query:s,hash:DP(r)}}function NWt(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function qme(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function DWt(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&KR(e.matched[i],t.matched[s])&&KAe(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function KR(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function KAe(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!$Wt(n[t],e[t]))return!1;return!0}function $Wt(n,e){return ap(n)?Jme(n,e):ap(e)?Jme(e,n):n===e}function Jme(n,e){return ap(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function xWt(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let o=t.length-1,r,a;for(r=0;r<i.length;r++)if(a=i[r],a!==".")if(a==="..")o>1&&o--;else break;return t.slice(0,o).join("/")+"/"+i.slice(r).join("/")}const HT={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var $P;(function(n){n.pop="pop",n.push="push"})($P||($P={}));var E$;(function(n){n.back="back",n.forward="forward",n.unknown=""})(E$||(E$={}));function PWt(n){if(!n)if(N1){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),AWt(n)}const FWt=/^[^#]+#/;function BWt(n,e){return n.replace(FWt,"#")+e}function HWt(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const kG=()=>({left:window.scrollX,top:window.scrollY});function VWt(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=HWt(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Qme(n,e){return(history.state?history.state.position-e:-1)+n}const gZ=new Map;function UWt(n,e){gZ.set(n,e)}function WWt(n){const e=gZ.get(n);return gZ.delete(n),e}let GWt=()=>location.protocol+"//"+location.host;function jAe(n,e){const{pathname:t,search:i,hash:s}=e,o=n.indexOf("#");if(o>-1){let a=s.includes(n.slice(o))?n.slice(o).length:1,c=s.slice(a);return c[0]!=="/"&&(c="/"+c),qme(c,"")}return qme(t,n)+i+s}function zWt(n,e,t,i){let s=[],o=[],r=null;const a=({state:g})=>{const p=jAe(n,location),_=t.value,v=e.value;let C=0;if(g){if(t.value=p,e.value=g,r&&r===_){r=null;return}C=v?g.position-v.position:0}else i(p);s.forEach(y=>{y(t.value,_,{delta:C,type:$P.pop,direction:C?C>0?E$.forward:E$.back:E$.unknown})})};function c(){r=t.value}function u(g){s.push(g);const p=()=>{const _=s.indexOf(g);_>-1&&s.splice(_,1)};return o.push(p),p}function d(){const{history:g}=window;g.state&&g.replaceState(Eo({},g.state,{scroll:kG()}),"")}function f(){for(const g of o)g();o=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:c,listen:u,destroy:f}}function Zme(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?kG():null}}function KWt(n){const{history:e,location:t}=window,i={value:jAe(n,t)},s={value:e.state};s.value||o(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(c,u,d){const f=n.indexOf("#"),g=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+c:GWt()+n+c;try{e[d?"replaceState":"pushState"](u,"",g),s.value=u}catch(p){console.error(p),t[d?"replace":"assign"](g)}}function r(c,u){const d=Eo({},e.state,Zme(s.value.back,c,s.value.forward,!0),u,{position:s.value.position});o(c,d,!0),i.value=c}function a(c,u){const d=Eo({},s.value,e.state,{forward:c,scroll:kG()});o(d.current,d,!0);const f=Eo({},Zme(i.value,c,null),{position:d.position+1},u);o(c,f,!1),i.value=c}return{location:i,state:s,push:a,replace:r}}function jWt(n){n=PWt(n);const e=KWt(n),t=zWt(n,e.state,e.location,e.replace);function i(o,r=!0){r||t.pauseListeners(),history.go(o)}const s=Eo({location:"",base:n,go:i,createHref:BWt.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function XWt(n){return typeof n=="string"||n&&typeof n=="object"}function XAe(n){return typeof n=="string"||typeof n=="symbol"}const YAe=Symbol("");var e_e;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(e_e||(e_e={}));function jR(n,e){return Eo(new Error,{type:n,[YAe]:!0},e)}function pv(n,e){return n instanceof Error&&YAe in n&&(e==null||!!(n.type&e))}const t_e="[^/]+?",YWt={sensitive:!1,strict:!1,start:!0,end:!0},qWt=/[.+*?^${}()[\]/\\]/g;function JWt(n,e){const t=Eo({},YWt,e),i=[];let s=t.start?"^":"";const o=[];for(const u of n){const d=u.length?[]:[90];t.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const g=u[f];let p=40+(t.sensitive?.25:0);if(g.type===0)f||(s+="/"),s+=g.value.replace(qWt,"\\$&"),p+=40;else if(g.type===1){const{value:_,repeatable:v,optional:C,regexp:y}=g;o.push({name:_,repeatable:v,optional:C});const w=y||t_e;if(w!==t_e){p+=10;try{new RegExp(`(${w})`)}catch(L){throw new Error(`Invalid custom RegExp for param "${_}" (${w}): `+L.message)}}let I=v?`((?:${w})(?:/(?:${w}))*)`:`(${w})`;f||(I=C&&u.length<2?`(?:/${I})`:"/"+I),C&&(I+="?"),s+=I,p+=20,C&&(p+=-8),v&&(p+=-20),w===".*"&&(p+=-50)}d.push(p)}i.push(d)}if(t.strict&&t.end){const u=i.length-1;i[u][i[u].length-1]+=.7000000000000001}t.strict||(s+="/?"),t.end?s+="$":t.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const r=new RegExp(s,t.sensitive?"":"i");function a(u){const d=u.match(r),f={};if(!d)return null;for(let g=1;g<d.length;g++){const p=d[g]||"",_=o[g-1];f[_.name]=p&&_.repeatable?p.split("/"):p}return f}function c(u){let d="",f=!1;for(const g of n){(!f||!d.endsWith("/"))&&(d+="/"),f=!1;for(const p of g)if(p.type===0)d+=p.value;else if(p.type===1){const{value:_,repeatable:v,optional:C}=p,y=_ in u?u[_]:"";if(ap(y)&&!v)throw new Error(`Provided param "${_}" is an array but it is not repeatable (* or + modifiers)`);const w=ap(y)?y.join("/"):y;if(!w)if(C)g.length<2&&(d.endsWith("/")?d=d.slice(0,-1):f=!0);else throw new Error(`Missing required param "${_}"`);d+=w}}return d||"/"}return{re:r,score:i,keys:o,parse:a,stringify:c}}function QWt(n,e){let t=0;for(;t<n.length&&t<e.length;){const i=e[t]-n[t];if(i)return i;t++}return n.length<e.length?n.length===1&&n[0]===80?-1:1:n.length>e.length?e.length===1&&e[0]===80?1:-1:0}function qAe(n,e){let t=0;const i=n.score,s=e.score;for(;t<i.length&&t<s.length;){const o=QWt(i[t],s[t]);if(o)return o;t++}if(Math.abs(s.length-i.length)===1){if(n_e(i))return 1;if(n_e(s))return-1}return s.length-i.length}function n_e(n){const e=n[n.length-1];return n.length>0&&e[e.length-1]<0}const ZWt={type:0,value:""},e3t=/[a-zA-Z0-9_]/;function t3t(n){if(!n)return[[]];if(n==="/")return[[ZWt]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(p){throw new Error(`ERR (${t})/"${u}": ${p}`)}let t=0,i=t;const s=[];let o;function r(){o&&s.push(o),o=[]}let a=0,c,u="",d="";function f(){u&&(t===0?o.push({type:0,value:u}):t===1||t===2||t===3?(o.length>1&&(c==="*"||c==="+")&&e(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:u,regexp:d,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):e("Invalid state to consume buffer"),u="")}function g(){u+=c}for(;a<n.length;){if(c=n[a++],c==="\\"&&t!==2){i=t,t=4;continue}switch(t){case 0:c==="/"?(u&&f(),r()):c===":"?(f(),t=1):g();break;case 4:g(),t=i;break;case 1:c==="("?t=2:e3t.test(c)?g():(f(),t=0,c!=="*"&&c!=="?"&&c!=="+"&&a--);break;case 2:c===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+c:t=3:d+=c;break;case 3:f(),t=0,c!=="*"&&c!=="?"&&c!=="+"&&a--,d="";break;default:e("Unknown state");break}}return t===2&&e(`Unfinished custom RegExp for param "${u}"`),f(),r(),s}function n3t(n,e,t){const i=JWt(t3t(n.path),t),s=Eo(i,{record:n,parent:e,children:[],alias:[]});return e&&!s.record.aliasOf==!e.record.aliasOf&&e.children.push(s),s}function i3t(n,e){const t=[],i=new Map;e=r_e({strict:!1,end:!0,sensitive:!1},e);function s(f){return i.get(f)}function o(f,g,p){const _=!p,v=s_e(f);v.aliasOf=p&&p.record;const C=r_e(e,f),y=[v];if("alias"in f){const L=typeof f.alias=="string"?[f.alias]:f.alias;for(const O of L)y.push(s_e(Eo({},v,{components:p?p.record.components:v.components,path:O,aliasOf:p?p.record:v})))}let w,I;for(const L of y){const{path:O}=L;if(g&&O[0]!=="/"){const A=g.record.path,N=A[A.length-1]==="/"?"":"/";L.path=g.record.path+(O&&N+O)}if(w=n3t(L,g,C),p?p.alias.push(w):(I=I||w,I!==w&&I.alias.push(w),_&&f.name&&!o_e(w)&&r(f.name)),JAe(w)&&c(w),v.children){const A=v.children;for(let N=0;N<A.length;N++)o(A[N],w,p&&p.children[N])}p=p||w}return I?()=>{r(I)}:y$}function r(f){if(XAe(f)){const g=i.get(f);g&&(i.delete(f),t.splice(t.indexOf(g),1),g.children.forEach(r),g.alias.forEach(r))}else{const g=t.indexOf(f);g>-1&&(t.splice(g,1),f.record.name&&i.delete(f.record.name),f.children.forEach(r),f.alias.forEach(r))}}function a(){return t}function c(f){const g=r3t(f,t);t.splice(g,0,f),f.record.name&&!o_e(f)&&i.set(f.record.name,f)}function u(f,g){let p,_={},v,C;if("name"in f&&f.name){if(p=i.get(f.name),!p)throw jR(1,{location:f});C=p.record.name,_=Eo(i_e(g.params,p.keys.filter(I=>!I.optional).concat(p.parent?p.parent.keys.filter(I=>I.optional):[]).map(I=>I.name)),f.params&&i_e(f.params,p.keys.map(I=>I.name))),v=p.stringify(_)}else if(f.path!=null)v=f.path,p=t.find(I=>I.re.test(v)),p&&(_=p.parse(v),C=p.record.name);else{if(p=g.name?i.get(g.name):t.find(I=>I.re.test(g.path)),!p)throw jR(1,{location:f,currentLocation:g});C=p.record.name,_=Eo({},g.params,f.params),v=p.stringify(_)}const y=[];let w=p;for(;w;)y.unshift(w.record),w=w.parent;return{name:C,path:v,params:_,matched:y,meta:o3t(y)}}n.forEach(f=>o(f));function d(){t.length=0,i.clear()}return{addRoute:o,resolve:u,removeRoute:r,clearRoutes:d,getRoutes:a,getRecordMatcher:s}}function i_e(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function s_e(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:s3t(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function s3t(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function o_e(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function o3t(n){return n.reduce((e,t)=>Eo(e,t.meta),{})}function r_e(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function r3t(n,e){let t=0,i=e.length;for(;t!==i;){const o=t+i>>1;qAe(n,e[o])<0?i=o:t=o+1}const s=l3t(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function l3t(n){let e=n;for(;e=e.parent;)if(JAe(e)&&qAe(n,e)===0)return e}function JAe({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function a3t(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;s<i.length;++s){const o=i[s].replace(UAe," "),r=o.indexOf("="),a=DP(r<0?o:o.slice(0,r)),c=r<0?null:DP(o.slice(r+1));if(a in e){let u=e[a];ap(u)||(u=e[a]=[u]),u.push(c)}else e[a]=c}return e}function l_e(n){let e="";for(let t in n){const i=n[t];if(t=OWt(t),i==null){i!==void 0&&(e+=(e.length?"&":"")+t);continue}(ap(i)?i.map(o=>o&&fZ(o)):[i&&fZ(i)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+t,o!=null&&(e+="="+o))})}return e}function c3t(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=ap(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const u3t=Symbol(""),a_e=Symbol(""),poe=Symbol(""),QAe=Symbol(""),pZ=Symbol("");function qN(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function sC(n,e,t,i,s,o=r=>r()){const r=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,c)=>{const u=g=>{g===!1?c(jR(4,{from:t,to:e})):g instanceof Error?c(g):XWt(g)?c(jR(2,{from:e,to:g})):(r&&i.enterCallbacks[s]===r&&typeof g=="function"&&r.push(g),a())},d=o(()=>n.call(i&&i.instances[s],e,t,u));let f=Promise.resolve(d);n.length<3&&(f=f.then(u)),f.catch(g=>c(g))})}function NK(n,e,t,i,s=o=>o()){const o=[];for(const r of n)for(const a in r.components){let c=r.components[a];if(!(e!=="beforeRouteEnter"&&!r.instances[a]))if(HAe(c)){const d=(c.__vccOpts||c)[e];d&&o.push(sC(d,t,i,r,a,s))}else{let u=c();o.push(()=>u.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${a}" at "${r.path}"`);const f=_Wt(d)?d.default:d;r.mods[a]=d,r.components[a]=f;const p=(f.__vccOpts||f)[e];return p&&sC(p,t,i,r,a,s)()}))}}return o}function c_e(n){const e=Kt(poe),t=Kt(QAe),i=W(()=>{const c=T(n.to);return e.resolve(c)}),s=W(()=>{const{matched:c}=i.value,{length:u}=c,d=c[u-1],f=t.matched;if(!d||!f.length)return-1;const g=f.findIndex(KR.bind(null,d));if(g>-1)return g;const p=u_e(c[u-2]);return u>1&&u_e(d)===p&&f[f.length-1].path!==p?f.findIndex(KR.bind(null,c[u-2])):g}),o=W(()=>s.value>-1&&p3t(t.params,i.value.params)),r=W(()=>s.value>-1&&s.value===t.matched.length-1&&KAe(t.params,i.value.params));function a(c={}){if(g3t(c)){const u=e[T(n.replace)?"replace":"push"](T(n.to)).catch(y$);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:i,href:W(()=>i.value.href),isActive:o,isExactActive:r,navigate:a}}function d3t(n){return n.length===1?n[0]:n}const h3t=$e({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:c_e,setup(n,{slots:e}){const t=Ki(c_e(n)),{options:i}=Kt(poe),s=W(()=>({[d_e(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[d_e(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const o=e.default&&d3t(e.default(t));return n.custom?o:hn("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},o)}}}),f3t=h3t;function g3t(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function p3t(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!ap(s)||s.length!==i.length||i.some((o,r)=>o!==s[r]))return!1}return!0}function u_e(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const d_e=(n,e,t)=>n??e??t,m3t=$e({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=Kt(pZ),s=W(()=>n.route||i.value),o=Kt(a_e,0),r=W(()=>{let u=T(o);const{matched:d}=s.value;let f;for(;(f=d[u])&&!f.components;)u++;return u}),a=W(()=>s.value.matched[r.value]);pi(a_e,W(()=>r.value+1)),pi(u3t,a),pi(pZ,s);const c=te();return ht(()=>[c.value,a.value,n.name],([u,d,f],[g,p,_])=>{d&&(d.instances[f]=u,p&&p!==d&&u&&u===g&&(d.leaveGuards.size||(d.leaveGuards=p.leaveGuards),d.updateGuards.size||(d.updateGuards=p.updateGuards))),u&&d&&(!p||!KR(d,p)||!g)&&(d.enterCallbacks[f]||[]).forEach(v=>v(u))},{flush:"post"}),()=>{const u=s.value,d=n.name,f=a.value,g=f&&f.components[d];if(!g)return h_e(t.default,{Component:g,route:u});const p=f.props[d],_=p?p===!0?u.params:typeof p=="function"?p(u):p:null,C=hn(g,Eo({},_,e,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(f.instances[d]=null)},ref:c}));return h_e(t.default,{Component:C,route:u})||C}}});function h_e(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const _3t=m3t;function v3t(n){const e=i3t(n.routes,n),t=n.parseQuery||a3t,i=n.stringifyQuery||l_e,s=n.history,o=qN(),r=qN(),a=qN(),c=us(HT);let u=HT;N1&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=kK.bind(null,we=>""+we),f=kK.bind(null,MWt),g=kK.bind(null,DP);function p(we,Ve){let Ge,dt;return XAe(we)?(Ge=e.getRecordMatcher(we),dt=Ve):dt=we,e.addRoute(dt,Ge)}function _(we){const Ve=e.getRecordMatcher(we);Ve&&e.removeRoute(Ve)}function v(){return e.getRoutes().map(we=>we.record)}function C(we){return!!e.getRecordMatcher(we)}function y(we,Ve){if(Ve=Eo({},Ve||c.value),typeof we=="string"){const Me=AK(t,we,Ve.path),et=e.resolve({path:Me.path},Ve),at=s.createHref(Me.fullPath);return Eo(Me,et,{params:g(et.params),hash:DP(Me.hash),redirectedFrom:void 0,href:at})}let Ge;if(we.path!=null)Ge=Eo({},we,{path:AK(t,we.path,Ve.path).path});else{const Me=Eo({},we.params);for(const et in Me)Me[et]==null&&delete Me[et];Ge=Eo({},we,{params:f(Me)}),Ve.params=f(Ve.params)}const dt=e.resolve(Ge,Ve),ze=we.hash||"";dt.params=d(g(dt.params));const ee=NWt(i,Eo({},we,{hash:LWt(ze),path:dt.path})),ye=s.createHref(ee);return Eo({fullPath:ee,hash:ze,query:i===l_e?c3t(we.query):we.query||{}},dt,{redirectedFrom:void 0,href:ye})}function w(we){return typeof we=="string"?AK(t,we,c.value.path):Eo({},we)}function I(we,Ve){if(u!==we)return jR(8,{from:Ve,to:we})}function L(we){return N(we)}function O(we){return L(Eo(w(we),{replace:!0}))}function A(we){const Ve=we.matched[we.matched.length-1];if(Ve&&Ve.redirect){const{redirect:Ge}=Ve;let dt=typeof Ge=="function"?Ge(we):Ge;return typeof dt=="string"&&(dt=dt.includes("?")||dt.includes("#")?dt=w(dt):{path:dt},dt.params={}),Eo({query:we.query,hash:we.hash,params:dt.path!=null?{}:we.params},dt)}}function N(we,Ve){const Ge=u=y(we),dt=c.value,ze=we.state,ee=we.force,ye=we.replace===!0,Me=A(Ge);if(Me)return N(Eo(w(Me),{state:typeof Me=="object"?Eo({},ze,Me.state):ze,force:ee,replace:ye}),Ve||Ge);const et=Ge;et.redirectedFrom=Ve;let at;return!ee&&DWt(i,dt,Ge)&&(at=jR(16,{to:et,from:dt}),ve(dt,dt,!0,!1)),(at?Promise.resolve(at):F(et,dt)).catch(Ue=>pv(Ue)?pv(Ue,2)?Ue:ge(Ue):Z(Ue,et,dt)).then(Ue=>{if(Ue){if(pv(Ue,2))return N(Eo({replace:ye},w(Ue.to),{state:typeof Ue.to=="object"?Eo({},ze,Ue.to.state):ze,force:ee}),Ve||et)}else Ue=U(et,dt,!0,ye,ze);return V(et,dt,Ue),Ue})}function D(we,Ve){const Ge=I(we,Ve);return Ge?Promise.reject(Ge):Promise.resolve()}function P(we){const Ve=Ne.values().next().value;return Ve&&typeof Ve.runWithContext=="function"?Ve.runWithContext(we):we()}function F(we,Ve){let Ge;const[dt,ze,ee]=b3t(we,Ve);Ge=NK(dt.reverse(),"beforeRouteLeave",we,Ve);for(const Me of dt)Me.leaveGuards.forEach(et=>{Ge.push(sC(et,we,Ve))});const ye=D.bind(null,we,Ve);return Ge.push(ye),Re(Ge).then(()=>{Ge=[];for(const Me of o.list())Ge.push(sC(Me,we,Ve));return Ge.push(ye),Re(Ge)}).then(()=>{Ge=NK(ze,"beforeRouteUpdate",we,Ve);for(const Me of ze)Me.updateGuards.forEach(et=>{Ge.push(sC(et,we,Ve))});return Ge.push(ye),Re(Ge)}).then(()=>{Ge=[];for(const Me of ee)if(Me.beforeEnter)if(ap(Me.beforeEnter))for(const et of Me.beforeEnter)Ge.push(sC(et,we,Ve));else Ge.push(sC(Me.beforeEnter,we,Ve));return Ge.push(ye),Re(Ge)}).then(()=>(we.matched.forEach(Me=>Me.enterCallbacks={}),Ge=NK(ee,"beforeRouteEnter",we,Ve,P),Ge.push(ye),Re(Ge))).then(()=>{Ge=[];for(const Me of r.list())Ge.push(sC(Me,we,Ve));return Ge.push(ye),Re(Ge)}).catch(Me=>pv(Me,8)?Me:Promise.reject(Me))}function V(we,Ve,Ge){a.list().forEach(dt=>P(()=>dt(we,Ve,Ge)))}function U(we,Ve,Ge,dt,ze){const ee=I(we,Ve);if(ee)return ee;const ye=Ve===HT,Me=N1?history.state:{};Ge&&(dt||ye?s.replace(we.fullPath,Eo({scroll:ye&&Me&&Me.scroll},ze)):s.push(we.fullPath,ze)),c.value=we,ve(we,Ve,Ge,ye),ge()}let Q;function de(){Q||(Q=s.listen((we,Ve,Ge)=>{if(!qe.listening)return;const dt=y(we),ze=A(dt);if(ze){N(Eo(ze,{replace:!0,force:!0}),dt).catch(y$);return}u=dt;const ee=c.value;N1&&UWt(Qme(ee.fullPath,Ge.delta),kG()),F(dt,ee).catch(ye=>pv(ye,12)?ye:pv(ye,2)?(N(Eo(w(ye.to),{force:!0}),dt).then(Me=>{pv(Me,20)&&!Ge.delta&&Ge.type===$P.pop&&s.go(-1,!1)}).catch(y$),Promise.reject()):(Ge.delta&&s.go(-Ge.delta,!1),Z(ye,dt,ee))).then(ye=>{ye=ye||U(dt,ee,!1),ye&&(Ge.delta&&!pv(ye,8)?s.go(-Ge.delta,!1):Ge.type===$P.pop&&pv(ye,20)&&s.go(-1,!1)),V(dt,ee,ye)}).catch(y$)}))}let q=qN(),K=qN(),re;function Z(we,Ve,Ge){ge(we);const dt=K.list();return dt.length?dt.forEach(ze=>ze(we,Ve,Ge)):console.error(we),Promise.reject(we)}function J(){return re&&c.value!==HT?Promise.resolve():new Promise((we,Ve)=>{q.add([we,Ve])})}function ge(we){return re||(re=!we,de(),q.list().forEach(([Ve,Ge])=>we?Ge(we):Ve()),q.reset()),we}function ve(we,Ve,Ge,dt){const{scrollBehavior:ze}=n;if(!N1||!ze)return Promise.resolve();const ee=!Ge&&WWt(Qme(we.fullPath,0))||(dt||!Ge)&&history.state&&history.state.scroll||null;return cn().then(()=>ze(we,Ve,ee)).then(ye=>ye&&VWt(ye)).catch(ye=>Z(ye,we,Ve))}const Le=we=>s.go(we);let Ee;const Ne=new Set,qe={currentRoute:c,listening:!0,addRoute:p,removeRoute:_,clearRoutes:e.clearRoutes,hasRoute:C,getRoutes:v,resolve:y,options:n,push:L,replace:O,go:Le,back:()=>Le(-1),forward:()=>Le(1),beforeEach:o.add,beforeResolve:r.add,afterEach:a.add,onError:K.add,isReady:J,install(we){const Ve=this;we.component("RouterLink",f3t),we.component("RouterView",_3t),we.config.globalProperties.$router=Ve,Object.defineProperty(we.config.globalProperties,"$route",{enumerable:!0,get:()=>T(c)}),N1&&!Ee&&c.value===HT&&(Ee=!0,L(s.location).catch(ze=>{}));const Ge={};for(const ze in HT)Object.defineProperty(Ge,ze,{get:()=>c.value[ze],enumerable:!0});we.provide(poe,Ve),we.provide(QAe,IZ(Ge)),we.provide(pZ,c);const dt=we.unmount;Ne.add(we),we.unmount=function(){Ne.delete(we),Ne.size<1&&(u=HT,Q&&Q(),Q=null,c.value=HT,Ee=!1,re=!1),dt()}}};function Re(we){return we.reduce((Ve,Ge)=>Ve.then(()=>P(Ge)),Promise.resolve())}return qe}function b3t(n,e){const t=[],i=[],s=[],o=Math.max(e.matched.length,n.matched.length);for(let r=0;r<o;r++){const a=e.matched[r];a&&(n.matched.find(u=>KR(u,a))?i.push(a):t.push(a));const c=n.matched[r];c&&(e.matched.find(u=>KR(u,c))||s.push(c))}return[t,i,s]}const T3t=v3t({history:jWt("/"),routes:[{path:"/",name:"home",component:BAe}]}),C3t=SUe(),y3t={message:{close:"关闭",save:"保存",example:"样例",open_example_error:"样例加载失败",open_example_success:"样例加载成功",example_1:"示例1",example_1_1:"示例1_1",example_1_1_1:"示例1_1_1",example_1_1_2:"示例1_1_2",example_1_2:"示例1_2",example_1_2_1:"示例1_2_1",example_1_2_2:"示例1_2_2",example_2:"示例2",example_2_1:"示例2_1",example_2_1_1:"示例2_1_1",example_2_1_2:"示例2_1_2",labs:"实验室",student:"学习",cloud_save:"云端存储",Export:"导出",import:"导入",copy:"复制",share:"分享",delete_all_blockly:"删除所有积木",screenshot:"一键截图",untitled:"未命名",export_content_empty:"导出内容为空",link_copy:"链接已复制到剪贴板",link_copy_error:"链接已复制到剪贴板",please_login:"请先登录",login:"登录",logout:"退出",go_cloud_serve:"前往云端服务",your_email:"您的邮箱:",your_school:"您的学校:",cloud_project:"云端项目:",click_to_refresh:"点击刷新云端事件",copy_apiKey:"复制API Key",login_success:"登录成功",logout_success:"登出成功",all_categorization:"所有分类:",AI:"人工智能",IoT:"物联网",robot_control:"机器人控制",scientific_experiment:"科学实验",Interactive_games:"互动游戏",system_configure:"最低配置要求",system:"系统:",memory:"内存:",HardDisk:"硬盘:",GraphicsCard:"显卡:",camera:"摄像头:",microphone:"麦克风:",need:"需要",not_need:"不需要",enter:"进入",Deep_learning_Machines:"深度学习机器",Deep_learning_Machines_content:"机器人发展的趋势是人工智能化,深度学习是智能机器人的前沿技术,也是机器学习领域的新课题。深度学习技术被广泛运用于农业、工业、军事、航空等领域,与机器让人的有机结合能设计出具有高工作效率、高实时性、高精确度的智能机器人。",emotion_recognition:"情绪识别",emotion_recognition_content:"情绪识别发展的趋势是人工智能化,情绪识别是智能识别的前沿技术,也是识别领域的新课题。情绪识别技术被广泛运用于农业、工业、军事、航空等领域。",gesture_recognition:"手势识别",gesture_recognition_content:"手势识别发展的趋势是人工智能化,手势识别是智能识别的前沿技术,也是识别领域的新课题。手势识别技术被广泛运用于农业、工业、军事、航空等领域。",object_recognition:"物体识别",object_recognition_content:"物体识别发展的趋势是人工智能化,物体识别是智能识别的前沿技术,也是识别领域的新课题。物体识别技术被广泛运用于农业、工业、军事、航空等领域。",pose_recognition:"姿势识别",pose_recognition_content:"姿态识别发展是人工智能发展的大趋势,姿态识别运用了许多智能识别的前沿技术,是识别领域的新课题。姿态识别技术被广泛运用于多中领域",face_recognition:"慧眼识人",face_recognition_content:"机器人发展的趋势是人工智能化,深度学习是智能机器人的前沿技术,也是机器学习领域的新课题。深度学习技术被广泛运用于农业、工业、军事、航空等领域,与机器让人的有机结合能设计出具有高工作效率、高实时性、高精确度的智能机器人。",speech_recognition:"语音识别",speech_recognition_content:"语音识别发展的趋势是人工智能化,语音识别是智能识别的前沿技术,也是识别领域的新课题。语音识别技术被广泛运用于农业、工业、军事、航空等领域。",study:"学习",go_edu_teaching_platform:"前往教学平台",go_train_platform:"学习人工智能:训练平台",go_biaoji_platform:"学习人工智能:标记平台",go_aihub:"学习人工智能:原理",go_aihub_vision:"学习人工智能:视觉处理",go_aihub_text:"学习人工智能:文本分析",go_aihub_speech:"学习人工智能:语音识别",go_aihub_art:"学习人工智能:艺术",file:"文件",last_version:"上次修改:",delete_success:"删除成功",delete_error:"删除失败",save_success:"保存成功",save_error:"保存失败",open_error:"打开失败",languare:"语言",visual_identification:"视觉识别",text_processing:"文本处理",stay_tuned:"敬请期待",cocorobo:"可可乐博(深圳)科技有限公司",cocorobo_copy:"版权所有",update_log:"更新日志",help_file:"帮助文档",device:"设备",wired_connection:"有线连接",wireless_connection:"无线连接",not_uploader_connection:"无法连接插件,点击图标了解如何解决",uploader_connection:"上传软件已连接",software_not_connection:"软件未连接",no_port_detected:"没有检测到端口",uploading:"正在上传",uploading_error:"上传失败",reset_device_success:"重置设备成功",reset_device_error:"重置设备失败",module_not_connection:"模块未连接",module_connection:"模块已连接",code_upload_to_module:"直接将代码上传到电子模块中",running_code:"运行中",running_code_error:"代码为空,运行失败",running_code_success:"运行成功",running:"运行",upload:"上传",initialization:"初始化主屏界面",reset_device:"重置设备",clear_print_data:"清除打印数据",edit_mode:"是否启用编辑模式",copy_code:"复制代码",copy_code_success:"复制成功",copy_code_error:"复制失败",download_code:"下载代码",download_code_success:"下载成功",download_code_error:"下载失败",upload_code:"上传代码",upload_code_success:"上传成功",upload_code_error:"上传失败",serial_port:"串口交互窗",python_code:"python 源代码",update_success:"更新成功",update_error:"更新失败",add_success:"添加成功",add_error:"添加失败",add:"添加",update:"更新",ok:"确定"}},E3t={message:{close:"關閉",save:"存儲",example:"範例",open_example_error:"範例加載失敗",open_example_success:"範例加載成功",example_1:"範例1",example_1_1:"範例1_1",example_1_1_1:"範例1_1_1",example_1_1_2:"範例1_1_2",example_1_2:"範例1_2",example_1_2_1:"範例1_2_1",example_1_2_2:"範例1_2_2",example_2:"範例2",example_2_1:"範例2_1",example_2_1_1:"範例2_1_1",example_2_1_2:"範例2_1_2",labs:"實驗室",student:"學習",cloud_save:"雲端存儲",Export:"匯出",import:"匯入",copy:"複製",share:"分享",delete_all_blockly:"刪除所有積木",screenshot:"一鍵截圖",untitled:"未命名",export_content_empty:"匯出內容爲空",link_copy:"鏈接已複製到剪貼板",link_copy_error:"鏈接已複製到剪貼板",please_login:"請先登錄",login:"登錄",logout:"登出",go_cloud_serve:"前往雲端服務",your_email:"您的郵箱:",your_school:"您的學校:",cloud_project:"雲端項目:",click_to_refresh:"點擊刷新雲端事件",copy_apiKey:"複製API Key",login_success:"登錄成功",logout_success:"登出成功",all_categorization:"所有分類:",AI:"人工智能",IoT:"物聯網",robot_control:"機器人控制",scientific_experiment:"科學實驗",Interactive_games:"互動遊戲",system_configure:"最低配置要求",system:"系統:",memory:"內存:",HardDisk:"硬盤:",GraphicsCard:"顯卡:",camera:"攝像頭:",microphone:"麥克風:",need:"需要",not_need:"不需要",enter:"進入",Deep_learning_Machines:"深度學習機器",Deep_learning_Machines_content:"機器人發展的趨勢是人工智能化,深度學習是智能機器人的前沿技術,也是機器學習領域的新課題。深度學習技術被廣泛運用於農業、工業、軍事、航空等領域,與機器讓人的有機結合能設計出具有高工作效率、高實時性、高精確度的智能機器人。",emotion_recognition:"情緒識別",emotion_recognition_content:"情緒識別發展的趨勢是人工智能化,情緒識別是智能識別的前沿技術,也是識別領域的新課題。情緒識別技術被廣泛運用於農業、工業、軍事、航空等領域。",gesture_recognition:"手勢識別",gesture_recognition_content:"手勢識別發展的趨勢是人工智能化,手勢識別是智能識別的前沿技術,也是識別領域的新課題。手勢識別技術被廣泛運用於農業、工業、軍事、航空等領域。",object_recognition:"物體識別",object_recognition_content:"物體識別發展的趨勢是人工智能化,物體識別是智能識別的前沿技術,也是識別領域的新課題。物體識別技術被廣泛運用於農業、工業、軍事、航空等領域。",pose_recognition:"姿勢識別",pose_recognition_content:"姿態識別發展是人工智能發展的大趨勢,姿態識別運用了許多智能識別的前沿技術,是識別領域的新課題。姿態識別技術被廣泛運用於多中領域",face_recognition:"慧眼識人",face_recognition_content:"機器人發展的趨勢是人工智能化,深度學習是智能機器人的前沿技術,也是機器學習領域的新課題。深度學習技術被廣泛運用於農業、工業、軍事、航空等領域,與機器讓人的有機結合能設計出具有高工作效率、高實時性、高精確度的智能機器人。",speech_recognition:"語音識別",speech_recognition_content:"語音識別發展的趨勢是人工智能化,語音識別是智能識別的前沿技術,也是識別領域的新課題。語音識別技術被廣泛運用於農業、工業、軍事、航空等領域。",study:"學習",go_edu_teaching_platform:"前往教學平臺",go_train_platform:"學習人工智能:訓練平臺",go_biaoji_platform:"學習人工智能:標記平臺",go_aihub:"學習人工智能:原理",go_aihub_vision:"學習人工智能:視覺處理",go_aihub_text:"學習人工智能:文本分析",go_aihub_speech:"學習人工智能:語音識別",go_aihub_art:"學習人工智能:藝術",file:"文件",last_version:"上次修改:",delete_success:"刪除成功",delete_error:"刪除失敗",save_success:"保存成功",save_error:"保存失敗",open_error:"打開失敗",languare:"語言",visual_identification:"視覺識別",text_processing:"文本處理",stay_tuned:"敬請期待",cocorobo:"可可樂博(深圳)科技有限公司",cocorobo_copy:"版權所有",update_log:"更新日誌",help_file:"幫助文檔",device:"設備",wired_connection:"有線連接",wireless_connection:"無線連接",not_uploader_connection:"無法連接插件,點擊圖標瞭解如何解決",uploader_connection:"上傳軟件已連接",software_not_connection:"軟件未連接",no_port_detected:"沒有檢測到端口",uploading:"正在上傳",uploading_error:"上傳失敗",reset_device_success:"重置設備成功",reset_device_error:"重置設備失敗",module_not_connection:"模組未連接",module_connection:"模組已連接",code_upload_to_module:"直接將代碼上傳到電子模組中",running_code:"運行中",running_code_error:"代碼爲空,運行失敗",running_code_success:"運行成功",running:"運行",upload:"上載",initialization:"初始化主屏頁面",reset_device:"重置設備",clear_print_data:"清除打印數據",edit_mode:"是否啓用編輯模式",copy_code:"複製代碼",copy_code_success:"複製成功",copy_code_error:"複製失敗",download_code:"下載代碼",download_code_success:"下載成功",download_code_error:"下載失敗",upload_code:"上載代碼",upload_code_success:"上載成功",upload_code_error:"上載失敗",serial_port:"串口交互窗",python_code:"python 源代碼",catLogic:"邏輯",update_success:"更新成功",update_error:"更新失敗",add_success:"添加成功",add_error:"添加失敗",add:"添加",update:"更新",ok:"確定"}},S3t={message:{close:"Close",save:"Save",example:"Example",open_example_error:"Sample Load Failure",open_example_success:"Sample Load Success",example_1:"Example1",example_1_1:"Example1_1",example_1_1_1:"Example1_1_1",example_1_1_2:"Example1_1_2",example_1_2:"Example1_2",example_1_2_1:"Example1_2_1",example_1_2_2:"Example1_2_2",example_2:"Example2",example_2_1:"Example2_1",example_2_1_1:"Example2_1_1",example_2_1_2:"Example2_1_2",labs:"Labs",student:"Study",cloud_save:"Cloud storage",Export:"Export",import:"Import",copy:"Copy",share:"Share",delete_all_blockly:"Delete all blocks",screenshot:"One-click screenshot",untitled:"Untitled",export_content_empty:"Exported content is empty",link_copy:"Link copied to clipboard",link_copy_error:"Copy Failure",please_login:"Please log in first",login:"Login",logout:"Sign out",go_cloud_serve:"Go to CocoCloud",your_email:"Your Email:",your_school:"Your School:",cloud_project:"Cloud Event",click_to_refresh:"Click to refresh the Event list",copy_apiKey:"Copy API Key",login_success:"Login Success",logout_success:"Sign out Success",all_categorization:"All classifications:",AI:"AI",IoT:"IoT",robot_control:"Robot control",scientific_experiment:"Scientific experiment",Interactive_games:"Interactive games",system_configure:"Minimum Hardware Requirementss",system:"Suggested Resolution Supported:",memory:"Memory Capacity:",HardDisk:"The Hard Disk:",GraphicsCard:"The Graphics Card:",camera:"Camera:",microphone:"Microphone:",need:"OK",not_need:"No",enter:"Enter",Deep_learning_Machines:"Teachable Machine",Deep_learning_Machines_content:"The trend of robot development is artificial intelligence. Deep learning is the frontier technology of intelligent robot and a new topic in the field of machine learning.Deep learning technology is widely used in agriculture, industry, military, aviation and other fields, and the organic combination with machines can design intelligent robots with high working efficiency, high real-time and high accuracy.",emotion_recognition:"Emotion Recognition",emotion_recognition_content:"The development trend of emotion recognition is artificial intelligence. Emotion recognition is the frontier technology of intelligent recognition and a new subject in the field of recognition.Emotion recognition technology is widely used in agriculture, industry, military, aviation and other fields.",gesture_recognition:"Gesture Recognition",gesture_recognition_content:"The development trend of gesture recognition is artificial intelligence. Gesture recognition is the frontier technology of intelligent recognition and a new subject in the field of recognition.Gesture recognition technology is widely used in agriculture, industry, military, aviation and other fields.",object_recognition:"Object Recognition",object_recognition_content:"The development trend of object recognition is artificial intelligence. Object recognition is the frontier technology of intelligent recognition and a new subject in the field of recognition.Object recognition technology is widely used in agriculture, industry, military, aviation and other fields.",pose_recognition:"Posenet Recognition",pose_recognition_content:"The development of attitude recognition is the general trend of the development of artificial intelligence. Attitude recognition technology is widely used in many fields",face_recognition:"Teachable Machine (with Pose Recognition)",face_recognition_content:"The trend of robot development is artificial intelligence. Deep learning is the frontier technology of intelligent robot and a new topic in the field of machine learning.Deep learning technology is widely used in agriculture, industry, military, aviation and other fields, and the organic combination with machines can design intelligent robots with high working efficiency, high real-time and high accuracy.",speech_recognition:"Speech Recognition",speech_recognition_content:"The development trend of speech recognition is artificial intelligence. Speech recognition is the frontier technology of intelligent recognition and a new subject in the field of recognition.Speech recognition technology is widely used in agriculture, industry, military, aviation and other fields.",study:"Study",go_edu_teaching_platform:"Coco Edu",go_train_platform:"AI Training",go_biaoji_platform:"AI Labeling",go_aihub:"Learn AI: Theory",go_aihub_vision:"Learn AI: Vision",go_aihub_text:"Learn AI: Text",go_aihub_speech:"Learn AI: Speech",go_aihub_art:"Learn AI: Art",file:"File",last_version:"Last modified:",delete_success:"Delete Success",delete_error:"Delete Failure",save_success:"Save Success",save_error:"Save Failure",open_error:"Open Failure",languare:"Language",visual_identification:"Vision",text_processing:"Text",stay_tuned:"Coming soon",cocorobo:"CocoRobo LTD",cocorobo_copy:"Copyright",update_log:"Update Log",help_file:"Help",device:"Device",wired_connection:"Wired connection",wireless_connection:"Wireless connection",not_uploader_connection:"Can't connect to the plugin, click on the icon to find out how to fix it",uploader_connection:"Upload software is connected",software_not_connection:"Software not connected",no_port_detected:"No port detected",uploading:"Uploading",uploading_error:"Upload failed",reset_device_success:"Reset device success",reset_device_error:"Reset device failed",module_not_connection:"Module not connected",module_connection:"Module connected",code_upload_to_module:"Upload the code directly into the e-module",running_code:"Running ...",running_code_error:"Code is empty, running failed",running_code_success:"Running Success",running:"Running",upload:"Upload",initialization:"Reset Main UI",reset_device:"Reset Device",clear_print_data:"Clearing Data",edit_mode:"Enable/Disable Editing",copy_code:"Copy Code",copy_code_success:"Copy Success",copy_code_error:"Copy Failure",download_code:"Download Code",download_code_success:"Download Success",download_code_error:"Download Failure",upload_code:"Upload Code",upload_code_success:"Upload Success",upload_code_error:"Upload Failure",serial_port:"Serial Interactive Window",python_code:"Python Code",catLogic:"Logic",update_success:"Update Success",update_error:"Update Failure",add_success:"Add Success",add_error:"Add Failure",add:"Add",update:"Update",ok:"OK"}},w3t=UWe({locale:localStorage.getItem("lang")||"zhHans",messages:{en:S3t,zhHans:y3t,zhHant:E3t}}),XF=Fve(BAe);XF.use(Rmt);XF.use(T3t);XF.use(C3t);XF.use(w3t);XF.mount("#app");export{D5t as M,A5t as R,$5t as U,N5t as a,PAt as e,Xc as l,$Re as t};
|